From 4935678150293fb8d51611d3e42becc8a0648b3f Mon Sep 17 00:00:00 2001 From: audrasjb Date: Tue, 9 May 2023 14:13:25 +0000 Subject: [PATCH] Editor: Update block editor packages to the latest patch releases. This updates the block editor related npm dependencies to their latest patch versions ahead of WordPress 6.2.1 RC1. Updated packages: - @wordpress/annotations@2.26.4 - @wordpress/block-directory@4.3.12 - @wordpress/block-editor@11.3.10 - @wordpress/block-library@8.3.12 - @wordpress/components@23.3.7 - @wordpress/customize-widgets@4.3.12 - @wordpress/edit-post@7.3.12 - @wordpress/edit-site@5.3.12 - @wordpress/edit-widgets@5.3.12 - @wordpress/editor@13.3.10 - @wordpress/format-library@4.3.10 - @wordpress/interface@5.3.8 - @wordpress/list-reusable-blocks@4.3.7 - @wordpress/preferences@3.3.7 - @wordpress/reusable-blocks@4.3.10 - @wordpress/rich-text@6.3.4 - @wordpress/server-side-render@4.3.7 - @wordpress/widgets@3.3.10 This changeset includes the following fixes: - i18n: Add context to labels related to CSS position properties gutenberg#49135 - Comments: Fix 'sprintf requires more than 1 params' error gutenberg#49054 - Fix the site editor loading in multi-site installs gutenberg#49861 - Fix quick inserter going off-screen in some situations gutenberg#49881 - Site Editor: Decode the site title properly gutenberg#49685 - Firefox: fix input rules (React async state issue) gutenberg#48210 - Only show alignment info when parent layout is constrained. gutenberg#49703 - [Inserter]: Fix onHover error on patterns tab in mobile gutenberg#49450 - Fix site editor redirection after creating new template or template part gutenberg#49364 Props mamaduka, audrasjb, wildworks, ocean90, aristath, costdev, hellofromtonya, youknowriad, mdxfr, oandregal, mattwiebe, bph, ndiego, talldanwp, joen, ellatrix, kevin940726, isabel_brison, andrewserong, ntsekouras, welcher. Fixes #58274. Built from https://develop.svn.wordpress.org/trunk@55737 git-svn-id: http://core.svn.wordpress.org/trunk@55249 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../assets/script-loader-packages.min.php | 2 +- wp-includes/assets/script-loader-packages.php | 2 +- wp-includes/blocks/comment-template.php | 3 +- wp-includes/js/dist/block-editor.js | 38 +- wp-includes/js/dist/block-editor.min.js | 4 +- wp-includes/js/dist/components.js | 1062 ++++++++--------- wp-includes/js/dist/components.min.js | 4 +- wp-includes/js/dist/edit-site.js | 33 +- wp-includes/js/dist/edit-site.min.js | 2 +- wp-includes/js/dist/editor.js | 127 +- wp-includes/js/dist/editor.min.js | 2 +- wp-includes/js/dist/rich-text.js | 6 + wp-includes/js/dist/rich-text.min.js | 2 +- wp-includes/version.php | 2 +- 14 files changed, 575 insertions(+), 714 deletions(-) diff --git a/wp-includes/assets/script-loader-packages.min.php b/wp-includes/assets/script-loader-packages.min.php index 40e6bfe7c7..6913b2585e 100644 --- a/wp-includes/assets/script-loader-packages.min.php +++ b/wp-includes/assets/script-loader-packages.min.php @@ -1 +1 @@ - array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => 'ecce20f002eda4c19664'), 'annotations.min.js' => array('dependencies' => array('wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => '1720fc5d5c76f53a1740'), 'api-fetch.min.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'bc0029ca2c943aec5311'), 'autop.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '43197d709df445ccf849'), 'blob.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'e7b4ea96175a89b263e2'), 'block-directory.min.js' => array('dependencies' => array('wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '9c45b8d28fc867ceed45'), 'block-editor.min.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-shortcode', 'wp-style-engine', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'ed2b2aa3837336baf00f'), 'block-library.min.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => '3115f0b5551a55bb6d3b'), 'block-serialization-default-parser.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '30ffd7e7e199f10b2a6d'), 'blocks.min.js' => array('dependencies' => array('lodash', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-shortcode'), 'version' => '639e14271099dc3d85bf'), 'components.min.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-warning'), 'version' => '6038bb142b708e24d750'), 'compose.min.js' => array('dependencies' => array('react', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-priority-queue'), 'version' => '7d5916e3b2ef0ea01400'), 'core-data.min.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => 'fc0de6bb17aa25caf698'), 'customize-widgets.min.js' => array('dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-widgets'), 'version' => '7ae69cc350436c0cf301'), 'data.min.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-private-apis', 'wp-redux-routine'), 'version' => '90cebfec01d1a3f0368e'), 'data-controls.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated', 'wp-polyfill'), 'version' => 'e10d473d392daa8501e8'), 'date.min.js' => array('dependencies' => array('moment', 'wp-deprecated', 'wp-polyfill'), 'version' => 'f8550b1212d715fbf745'), 'deprecated.min.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '6c963cb9494ba26b77eb'), 'dom.min.js' => array('dependencies' => array('wp-deprecated', 'wp-polyfill'), 'version' => 'e03c89e1dd68aee1cb3a'), 'dom-ready.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '392bdd43726760d1f3ca'), 'edit-post.min.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-widgets'), 'version' => 'd098b8ee5bdffa238c03'), 'edit-site.min.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-reusable-blocks', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => '2e1906ed8187c4e2f3f7'), 'edit-widgets.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-reusable-blocks', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => 'd683d5fc75e655fdf974'), 'editor.min.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => 'f49ef02c2dddb31edd0e'), 'element.min.js' => array('dependencies' => array('react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => 'b3bda690cfc516378771'), 'escape-html.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '03e27a7b6ae14f7afaa6'), 'format-library.min.js' => array('dependencies' => array('wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => 'cd4a10ec005e2f001978'), 'hooks.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '4169d3cf8e8d95a3d6d5'), 'html-entities.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '36a4a255da7dd2e1bf8e'), 'i18n.min.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '9e794f35a71bb98672ae'), 'is-shallow-equal.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '20c2b06ecf04afb14fee'), 'keyboard-shortcuts.min.js' => array('dependencies' => array('wp-data', 'wp-element', 'wp-keycodes', 'wp-polyfill'), 'version' => 'b696c16720133edfc065'), 'keycodes.min.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill'), 'version' => '184b321fa2d3bc7fd173'), 'list-reusable-blocks.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '6ba78be26d660b6af113'), 'media-utils.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'f837b6298c83612cd6f6'), 'notices.min.js' => array('dependencies' => array('wp-data', 'wp-polyfill'), 'version' => '9c1575b7a31659f45a45'), 'nux.min.js' => array('dependencies' => array('wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '038c48e26a91639ae8ab'), 'plugins.min.js' => array('dependencies' => array('wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill', 'wp-primitives'), 'version' => '0d1b90278bae7df6ecf9'), 'preferences.min.js' => array('dependencies' => array('wp-a11y', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'c66e137a7e588dab54c3'), 'preferences-persistence.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-polyfill'), 'version' => 'c5543628aa7ff5bd5be4'), 'primitives.min.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => 'dfac1545e52734396640'), 'priority-queue.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '422e19e9d48b269c5219'), 'private-apis.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '6f247ed2bc3571743bba'), 'redux-routine.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'd86e7e9f062d7582f76b'), 'reusable-blocks.min.js' => array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'a7367a6154c724b51b31'), 'rich-text.min.js' => array('dependencies' => array('wp-a11y', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes', 'wp-polyfill'), 'version' => '29557b2dbbe17d0d4317'), 'server-side-render.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'd1bc93277666143a3f5e'), 'shortcode.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '7539044b04e6bca57f2e'), 'style-engine.min.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '528e6cf281ffc9b7bd3c'), 'token-list.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'f2cf0bb3ae80de227e43'), 'url.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '16185fce2fb043a0cfed'), 'viewport.min.js' => array('dependencies' => array('wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => '4f6bd168b2b8b45c8a6b'), 'warning.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '4acee5fc2fd9a24cefc2'), 'widgets.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives'), 'version' => '040ac8be5e0cfc4b52df'), 'wordcount.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'feb9569307aec24292f2')); + array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => 'ecce20f002eda4c19664'), 'annotations.min.js' => array('dependencies' => array('wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => '1720fc5d5c76f53a1740'), 'api-fetch.min.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'bc0029ca2c943aec5311'), 'autop.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '43197d709df445ccf849'), 'blob.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'e7b4ea96175a89b263e2'), 'block-directory.min.js' => array('dependencies' => array('wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '9c45b8d28fc867ceed45'), 'block-editor.min.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-shortcode', 'wp-style-engine', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '43e40e04f77d598ede94'), 'block-library.min.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => '3115f0b5551a55bb6d3b'), 'block-serialization-default-parser.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '30ffd7e7e199f10b2a6d'), 'blocks.min.js' => array('dependencies' => array('lodash', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-shortcode'), 'version' => '639e14271099dc3d85bf'), 'components.min.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-warning'), 'version' => 'ac6fc54435e5853df0a8'), 'compose.min.js' => array('dependencies' => array('react', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-priority-queue'), 'version' => '7d5916e3b2ef0ea01400'), 'core-data.min.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => 'fc0de6bb17aa25caf698'), 'customize-widgets.min.js' => array('dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-widgets'), 'version' => '7ae69cc350436c0cf301'), 'data.min.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-private-apis', 'wp-redux-routine'), 'version' => '90cebfec01d1a3f0368e'), 'data-controls.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated', 'wp-polyfill'), 'version' => 'e10d473d392daa8501e8'), 'date.min.js' => array('dependencies' => array('moment', 'wp-deprecated', 'wp-polyfill'), 'version' => 'f8550b1212d715fbf745'), 'deprecated.min.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '6c963cb9494ba26b77eb'), 'dom.min.js' => array('dependencies' => array('wp-deprecated', 'wp-polyfill'), 'version' => 'e03c89e1dd68aee1cb3a'), 'dom-ready.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '392bdd43726760d1f3ca'), 'edit-post.min.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-widgets'), 'version' => 'd098b8ee5bdffa238c03'), 'edit-site.min.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-reusable-blocks', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => 'fcf81e803ab1af60d4f8'), 'edit-widgets.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-reusable-blocks', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => 'd683d5fc75e655fdf974'), 'editor.min.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => '1fb5fcf129627da4939e'), 'element.min.js' => array('dependencies' => array('react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => 'b3bda690cfc516378771'), 'escape-html.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '03e27a7b6ae14f7afaa6'), 'format-library.min.js' => array('dependencies' => array('wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => 'cd4a10ec005e2f001978'), 'hooks.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '4169d3cf8e8d95a3d6d5'), 'html-entities.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '36a4a255da7dd2e1bf8e'), 'i18n.min.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '9e794f35a71bb98672ae'), 'is-shallow-equal.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '20c2b06ecf04afb14fee'), 'keyboard-shortcuts.min.js' => array('dependencies' => array('wp-data', 'wp-element', 'wp-keycodes', 'wp-polyfill'), 'version' => 'b696c16720133edfc065'), 'keycodes.min.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill'), 'version' => '184b321fa2d3bc7fd173'), 'list-reusable-blocks.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '6ba78be26d660b6af113'), 'media-utils.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'f837b6298c83612cd6f6'), 'notices.min.js' => array('dependencies' => array('wp-data', 'wp-polyfill'), 'version' => '9c1575b7a31659f45a45'), 'nux.min.js' => array('dependencies' => array('wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '038c48e26a91639ae8ab'), 'plugins.min.js' => array('dependencies' => array('wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill', 'wp-primitives'), 'version' => '0d1b90278bae7df6ecf9'), 'preferences.min.js' => array('dependencies' => array('wp-a11y', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'c66e137a7e588dab54c3'), 'preferences-persistence.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-polyfill'), 'version' => 'c5543628aa7ff5bd5be4'), 'primitives.min.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => 'dfac1545e52734396640'), 'priority-queue.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '422e19e9d48b269c5219'), 'private-apis.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '6f247ed2bc3571743bba'), 'redux-routine.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'd86e7e9f062d7582f76b'), 'reusable-blocks.min.js' => array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'a7367a6154c724b51b31'), 'rich-text.min.js' => array('dependencies' => array('wp-a11y', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes', 'wp-polyfill'), 'version' => '9307ec04c67d79b6e813'), 'server-side-render.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'd1bc93277666143a3f5e'), 'shortcode.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '7539044b04e6bca57f2e'), 'style-engine.min.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '528e6cf281ffc9b7bd3c'), 'token-list.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'f2cf0bb3ae80de227e43'), 'url.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '16185fce2fb043a0cfed'), 'viewport.min.js' => array('dependencies' => array('wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => '4f6bd168b2b8b45c8a6b'), 'warning.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '4acee5fc2fd9a24cefc2'), 'widgets.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives'), 'version' => '040ac8be5e0cfc4b52df'), 'wordcount.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'feb9569307aec24292f2')); diff --git a/wp-includes/assets/script-loader-packages.php b/wp-includes/assets/script-loader-packages.php index 2d700bb6ed..9925404f55 100644 --- a/wp-includes/assets/script-loader-packages.php +++ b/wp-includes/assets/script-loader-packages.php @@ -1 +1 @@ - array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => '0ee61caf926b8a5c5f27'), 'annotations.js' => array('dependencies' => array('wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => '4d49f11a15c40df3bf3c'), 'api-fetch.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '68af4ed41fa8a1b94f61'), 'autop.js' => array('dependencies' => array('wp-polyfill'), 'version' => '9dfc70c5ecb460ef802d'), 'blob.js' => array('dependencies' => array('wp-polyfill'), 'version' => '4358553d8083f2393262'), 'block-directory.js' => array('dependencies' => array('wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'f0a8770c8b4a8ec390b9'), 'block-editor.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-shortcode', 'wp-style-engine', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'db6c86bb83c79eb2c95a'), 'block-library.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => 'd9e06804132bedc510cd'), 'block-serialization-default-parser.js' => array('dependencies' => array('wp-polyfill'), 'version' => '659c02a916d332d198d3'), 'blocks.js' => array('dependencies' => array('lodash', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-shortcode'), 'version' => '5f23cda55814f981387d'), 'components.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-warning'), 'version' => '44a078ed77cc03c99918'), 'compose.js' => array('dependencies' => array('react', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-priority-queue'), 'version' => '931b797529818d5ec638'), 'core-data.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => '60feb4306fe9534bc937'), 'customize-widgets.js' => array('dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-widgets'), 'version' => 'cc141d4539c9582ac6b8'), 'data.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-private-apis', 'wp-redux-routine'), 'version' => '325ebd654e2aa93715a1'), 'data-controls.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated', 'wp-polyfill'), 'version' => 'a9db8689c0dc134496f2'), 'date.js' => array('dependencies' => array('moment', 'wp-deprecated', 'wp-polyfill'), 'version' => '9cf52367916dd73a1aeb'), 'deprecated.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '9a578dedacc95dee5274'), 'dom.js' => array('dependencies' => array('wp-deprecated', 'wp-polyfill'), 'version' => 'b93565ec9d5379c780ad'), 'dom-ready.js' => array('dependencies' => array('wp-polyfill'), 'version' => '7c25017459f1da90355d'), 'edit-post.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-widgets'), 'version' => '8d52dae6937ea57c9af0'), 'edit-site.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-reusable-blocks', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => 'f24bac8a29f51459c647'), 'edit-widgets.js' => array('dependencies' => array('wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-reusable-blocks', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => 'ccf0538dc0da3fd9fbe5'), 'editor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => '8f76ff9b62db4d9f4a08'), 'element.js' => array('dependencies' => array('react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => '0cad38f6457224436f2c'), 'escape-html.js' => array('dependencies' => array('wp-polyfill'), 'version' => '6cf743ecc1ac531a8ee6'), 'format-library.js' => array('dependencies' => array('wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => 'cf8adce62678d9a64c60'), 'hooks.js' => array('dependencies' => array('wp-polyfill'), 'version' => '3ad9b2919ff3fc96ce63'), 'html-entities.js' => array('dependencies' => array('wp-polyfill'), 'version' => '87ef261e846b76e5a37b'), 'i18n.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '0343553cc8c879477a4a'), 'is-shallow-equal.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b8f723a062b0818425f1'), 'keyboard-shortcuts.js' => array('dependencies' => array('wp-data', 'wp-element', 'wp-keycodes', 'wp-polyfill'), 'version' => 'd9997e5c243ce7427d4e'), 'keycodes.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill'), 'version' => 'e05b6bffe500867f27e8'), 'list-reusable-blocks.js' => array('dependencies' => array('wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '1f2da3834fe510c12e67'), 'media-utils.js' => array('dependencies' => array('wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'b53823237263f9d526b5'), 'notices.js' => array('dependencies' => array('wp-data', 'wp-polyfill'), 'version' => '72014f2e1361090a48e0'), 'nux.js' => array('dependencies' => array('wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'cd90e6b2a9140895480a'), 'plugins.js' => array('dependencies' => array('wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill', 'wp-primitives'), 'version' => '86345f1b98bd487fb760'), 'preferences.js' => array('dependencies' => array('wp-a11y', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'b68672fbcc78e405d114'), 'preferences-persistence.js' => array('dependencies' => array('wp-api-fetch', 'wp-polyfill'), 'version' => 'd4082da1f03df7787408'), 'primitives.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => '16174c161e15be86c4e6'), 'priority-queue.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'c1d62738f06e87528f62'), 'private-apis.js' => array('dependencies' => array('wp-polyfill'), 'version' => '18f3ef9ff9519ffbb0b6'), 'redux-routine.js' => array('dependencies' => array('wp-polyfill'), 'version' => '847fa8b3d926b1bcf533'), 'reusable-blocks.js' => array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '7ae393123206d036f3d9'), 'rich-text.js' => array('dependencies' => array('wp-a11y', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes', 'wp-polyfill'), 'version' => 'b844e727d75133fead36'), 'server-side-render.js' => array('dependencies' => array('wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'a92cb36becaeba47ce44'), 'shortcode.js' => array('dependencies' => array('wp-polyfill'), 'version' => '51bfa0ce50c94567c1d2'), 'style-engine.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '41dca70fa912251373d1'), 'token-list.js' => array('dependencies' => array('wp-polyfill'), 'version' => '0aa873f736c379f28e78'), 'url.js' => array('dependencies' => array('wp-polyfill'), 'version' => '51470de6b529e717152a'), 'viewport.js' => array('dependencies' => array('wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => '2769d3f5d7462b726ba8'), 'warning.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'aa73c6d9a1563e863795'), 'widgets.js' => array('dependencies' => array('wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives'), 'version' => '61dd42dc2aa437d40f2b'), 'wordcount.js' => array('dependencies' => array('wp-polyfill'), 'version' => '27e23086e41dbb80f874')); + array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => '0ee61caf926b8a5c5f27'), 'annotations.js' => array('dependencies' => array('wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => '4d49f11a15c40df3bf3c'), 'api-fetch.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '68af4ed41fa8a1b94f61'), 'autop.js' => array('dependencies' => array('wp-polyfill'), 'version' => '9dfc70c5ecb460ef802d'), 'blob.js' => array('dependencies' => array('wp-polyfill'), 'version' => '4358553d8083f2393262'), 'block-directory.js' => array('dependencies' => array('wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'f0a8770c8b4a8ec390b9'), 'block-editor.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-shortcode', 'wp-style-engine', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '9cab0a54be77c672ab85'), 'block-library.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => 'd9e06804132bedc510cd'), 'block-serialization-default-parser.js' => array('dependencies' => array('wp-polyfill'), 'version' => '659c02a916d332d198d3'), 'blocks.js' => array('dependencies' => array('lodash', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-shortcode'), 'version' => '5f23cda55814f981387d'), 'components.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-warning'), 'version' => 'f068a8c572ae0962259b'), 'compose.js' => array('dependencies' => array('react', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-priority-queue'), 'version' => '931b797529818d5ec638'), 'core-data.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => '60feb4306fe9534bc937'), 'customize-widgets.js' => array('dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-widgets'), 'version' => 'cc141d4539c9582ac6b8'), 'data.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-private-apis', 'wp-redux-routine'), 'version' => '325ebd654e2aa93715a1'), 'data-controls.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated', 'wp-polyfill'), 'version' => 'a9db8689c0dc134496f2'), 'date.js' => array('dependencies' => array('moment', 'wp-deprecated', 'wp-polyfill'), 'version' => '9cf52367916dd73a1aeb'), 'deprecated.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '9a578dedacc95dee5274'), 'dom.js' => array('dependencies' => array('wp-deprecated', 'wp-polyfill'), 'version' => 'b93565ec9d5379c780ad'), 'dom-ready.js' => array('dependencies' => array('wp-polyfill'), 'version' => '7c25017459f1da90355d'), 'edit-post.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-widgets'), 'version' => '8d52dae6937ea57c9af0'), 'edit-site.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-reusable-blocks', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => '8de599fa2b9fa2fbef7a'), 'edit-widgets.js' => array('dependencies' => array('wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-reusable-blocks', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => 'ccf0538dc0da3fd9fbe5'), 'editor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => '0765c62b1487efab97a9'), 'element.js' => array('dependencies' => array('react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => '0cad38f6457224436f2c'), 'escape-html.js' => array('dependencies' => array('wp-polyfill'), 'version' => '6cf743ecc1ac531a8ee6'), 'format-library.js' => array('dependencies' => array('wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => 'cf8adce62678d9a64c60'), 'hooks.js' => array('dependencies' => array('wp-polyfill'), 'version' => '3ad9b2919ff3fc96ce63'), 'html-entities.js' => array('dependencies' => array('wp-polyfill'), 'version' => '87ef261e846b76e5a37b'), 'i18n.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '0343553cc8c879477a4a'), 'is-shallow-equal.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b8f723a062b0818425f1'), 'keyboard-shortcuts.js' => array('dependencies' => array('wp-data', 'wp-element', 'wp-keycodes', 'wp-polyfill'), 'version' => 'd9997e5c243ce7427d4e'), 'keycodes.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill'), 'version' => 'e05b6bffe500867f27e8'), 'list-reusable-blocks.js' => array('dependencies' => array('wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '1f2da3834fe510c12e67'), 'media-utils.js' => array('dependencies' => array('wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'b53823237263f9d526b5'), 'notices.js' => array('dependencies' => array('wp-data', 'wp-polyfill'), 'version' => '72014f2e1361090a48e0'), 'nux.js' => array('dependencies' => array('wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'cd90e6b2a9140895480a'), 'plugins.js' => array('dependencies' => array('wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill', 'wp-primitives'), 'version' => '86345f1b98bd487fb760'), 'preferences.js' => array('dependencies' => array('wp-a11y', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'b68672fbcc78e405d114'), 'preferences-persistence.js' => array('dependencies' => array('wp-api-fetch', 'wp-polyfill'), 'version' => 'd4082da1f03df7787408'), 'primitives.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => '16174c161e15be86c4e6'), 'priority-queue.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'c1d62738f06e87528f62'), 'private-apis.js' => array('dependencies' => array('wp-polyfill'), 'version' => '18f3ef9ff9519ffbb0b6'), 'redux-routine.js' => array('dependencies' => array('wp-polyfill'), 'version' => '847fa8b3d926b1bcf533'), 'reusable-blocks.js' => array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '7ae393123206d036f3d9'), 'rich-text.js' => array('dependencies' => array('wp-a11y', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes', 'wp-polyfill'), 'version' => '3a2ed21adf680fa0a881'), 'server-side-render.js' => array('dependencies' => array('wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'a92cb36becaeba47ce44'), 'shortcode.js' => array('dependencies' => array('wp-polyfill'), 'version' => '51bfa0ce50c94567c1d2'), 'style-engine.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '41dca70fa912251373d1'), 'token-list.js' => array('dependencies' => array('wp-polyfill'), 'version' => '0aa873f736c379f28e78'), 'url.js' => array('dependencies' => array('wp-polyfill'), 'version' => '51470de6b529e717152a'), 'viewport.js' => array('dependencies' => array('wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => '2769d3f5d7462b726ba8'), 'warning.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'aa73c6d9a1563e863795'), 'widgets.js' => array('dependencies' => array('wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives'), 'version' => '61dd42dc2aa437d40f2b'), 'wordcount.js' => array('dependencies' => array('wp-polyfill'), 'version' => '27e23086e41dbb80f874')); diff --git a/wp-includes/blocks/comment-template.php b/wp-includes/blocks/comment-template.php index 08620a3ea6..45fd993adb 100644 --- a/wp-includes/blocks/comment-template.php +++ b/wp-includes/blocks/comment-template.php @@ -58,11 +58,10 @@ function block_core_comment_template_render_comments( $comments, $block ) { $block_content .= sprintf( '
    %1$s
', $inner_content ); --$comment_depth; } else { - $inner_content = block_core_comment_template_render_comments( + $block_content .= block_core_comment_template_render_comments( $children, $block ); - $block_content .= sprintf( $inner_content ); } } diff --git a/wp-includes/js/dist/block-editor.js b/wp-includes/js/dist/block-editor.js index 062723e560..36da330e1d 100644 --- a/wp-includes/js/dist/block-editor.js +++ b/wp-includes/js/dist/block-editor.js @@ -11040,12 +11040,13 @@ function getBlockGapCSS(selector, layoutDefinitions, layoutType, blockGapValue) function getAlignmentsInfo(layout) { const { contentSize, - wideSize + wideSize, + type = 'default' } = layout; const alignmentInfo = {}; const sizeRegex = /^(?!0)\d+(px|em|rem|vw|vh|%)?$/i; - if (sizeRegex.test(contentSize)) { + if (sizeRegex.test(contentSize) && type === 'constrained') { // translators: %s: container size (i.e. 600px etc) alignmentInfo.none = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Max %s wide'), contentSize); } @@ -16752,19 +16753,19 @@ function BlockHTML(_ref) { /* harmony default export */ var block_html = (BlockHTML); ;// CONCATENATED MODULE: ./node_modules/@react-spring/rafz/dist/esm/index.js -var f=l(),esm_n=e=>c(e,f),m=l();esm_n.write=e=>c(e,m);var d=l();esm_n.onStart=e=>c(e,d);var h=l();esm_n.onFrame=e=>c(e,h);var p=l();esm_n.onFinish=e=>c(e,p);var i=[];esm_n.setTimeout=(e,t)=>{let a=esm_n.now()+t,o=()=>{let F=i.findIndex(z=>z.cancel==o);~F&&i.splice(F,1),u-=~F?1:0},s={time:a,handler:e,cancel:o};return i.splice(w(a),0,s),u+=1,v(),s};var w=e=>~(~i.findIndex(t=>t.time>e)||~i.length);esm_n.cancel=e=>{d.delete(e),h.delete(e),p.delete(e),f.delete(e),m.delete(e)};esm_n.sync=e=>{T=!0,esm_n.batchedUpdates(e),T=!1};esm_n.throttle=e=>{let t;function a(){try{e(...t)}finally{t=null}}function o(...s){t=s,esm_n.onStart(a)}return o.handler=e,o.cancel=()=>{d.delete(a),t=null},o};var y=typeof window<"u"?window.requestAnimationFrame:()=>{};esm_n.use=e=>y=e;esm_n.now=typeof performance<"u"?()=>performance.now():Date.now;esm_n.batchedUpdates=e=>e();esm_n.catch=console.error;esm_n.frameLoop="always";esm_n.advance=()=>{esm_n.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):x()};var r=-1,u=0,T=!1;function c(e,t){T?(t.delete(e),e(0)):(t.add(e),v())}function v(){r<0&&(r=0,esm_n.frameLoop!=="demand"&&y(b))}function R(){r=-1}function b(){~r&&(y(b),esm_n.batchedUpdates(x))}function x(){let e=r;r=esm_n.now();let t=w(r);if(t&&(Q(i.splice(0,t),a=>a.handler()),u-=t),!u){R();return}d.flush(),f.flush(e?Math.min(64,r-e):16.667),h.flush(),m.flush(),p.flush()}function l(){let e=new Set,t=e;return{add(a){u+=t==e&&!e.has(a)?1:0,e.add(a)},delete(a){return u-=t==e&&e.has(a)?1:0,e.delete(a)},flush(a){t.size&&(e=new Set,u-=t.size,Q(t,o=>o(a)&&e.add(o)),u+=e.size,t=e)}}}function Q(e,t){e.forEach(a=>{try{t(a)}catch(o){esm_n.catch(o)}})}var S={count(){return u},isRunning(){return r>=0},clear(){r=-1,i=[],d=l(),f=l(),h=l(),m=l(),p=l(),u=0}}; +var f=r(),esm_n=e=>c(e,f),m=r();esm_n.write=e=>c(e,m);var d=r();esm_n.onStart=e=>c(e,d);var h=r();esm_n.onFrame=e=>c(e,h);var p=r();esm_n.onFinish=e=>c(e,p);var i=[];esm_n.setTimeout=(e,t)=>{let a=esm_n.now()+t,o=()=>{let F=i.findIndex(z=>z.cancel==o);~F&&i.splice(F,1),u-=~F?1:0},s={time:a,handler:e,cancel:o};return i.splice(w(a),0,s),u+=1,v(),s};var w=e=>~(~i.findIndex(t=>t.time>e)||~i.length);esm_n.cancel=e=>{d.delete(e),h.delete(e),p.delete(e),f.delete(e),m.delete(e)};esm_n.sync=e=>{T=!0,esm_n.batchedUpdates(e),T=!1};esm_n.throttle=e=>{let t;function a(){try{e(...t)}finally{t=null}}function o(...s){t=s,esm_n.onStart(a)}return o.handler=e,o.cancel=()=>{d.delete(a),t=null},o};var y=typeof window<"u"?window.requestAnimationFrame:()=>{};esm_n.use=e=>y=e;esm_n.now=typeof performance<"u"?()=>performance.now():Date.now;esm_n.batchedUpdates=e=>e();esm_n.catch=console.error;esm_n.frameLoop="always";esm_n.advance=()=>{esm_n.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):x()};var l=-1,u=0,T=!1;function c(e,t){T?(t.delete(e),e(0)):(t.add(e),v())}function v(){l<0&&(l=0,esm_n.frameLoop!=="demand"&&y(b))}function R(){l=-1}function b(){~l&&(y(b),esm_n.batchedUpdates(x))}function x(){let e=l;l=esm_n.now();let t=w(l);if(t&&(Q(i.splice(0,t),a=>a.handler()),u-=t),!u){R();return}d.flush(),f.flush(e?Math.min(64,l-e):16.667),h.flush(),m.flush(),p.flush()}function r(){let e=new Set,t=e;return{add(a){u+=t==e&&!e.has(a)?1:0,e.add(a)},delete(a){return u-=t==e&&e.has(a)?1:0,e.delete(a)},flush(a){t.size&&(e=new Set,u-=t.size,Q(t,o=>o(a)&&e.add(o)),u+=e.size,t=e)}}}function Q(e,t){e.forEach(a=>{try{t(a)}catch(o){esm_n.catch(o)}})}var S={count(){return u},isRunning(){return l>=0},clear(){l=-1,i=[],d=r(),f=r(),h=r(),m=r(),p=r(),u=0}}; // EXTERNAL MODULE: external "React" var external_React_ = __webpack_require__(9196); var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_); ;// CONCATENATED MODULE: ./node_modules/@react-spring/shared/dist/esm/index.js -var ze=Object.defineProperty;var Le=(e,t)=>{for(var r in t)ze(e,r,{get:t[r],enumerable:!0})};var esm_p={};Le(esm_p,{assign:()=>U,colors:()=>esm_c,createStringInterpolator:()=>k,skipAnimation:()=>ee,to:()=>J,willAdvance:()=>esm_S});function Y(){}var mt=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),esm_l={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function bt(e,t){if(esm_l.arr(e)){if(!esm_l.arr(t)||e.length!==t.length)return!1;for(let r=0;re.forEach(t);function xt(e,t,r){if(esm_l.arr(e)){for(let n=0;nesm_l.und(e)?[]:esm_l.arr(e)?e:[e];function Pe(e,t){if(e.size){let r=Array.from(e);e.clear(),Ve(r,t)}}var yt=(e,...t)=>Pe(e,r=>r(...t)),esm_h=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);var k,J,esm_c=null,ee=!1,esm_S=Y,U=e=>{e.to&&(J=e.to),e.now&&(esm_n.now=e.now),e.colors!==void 0&&(esm_c=e.colors),e.skipAnimation!=null&&(ee=e.skipAnimation),e.createStringInterpolator&&(k=e.createStringInterpolator),e.requestAnimationFrame&&esm_n.use(e.requestAnimationFrame),e.batchedUpdates&&(esm_n.batchedUpdates=e.batchedUpdates),e.willAdvance&&(esm_S=e.willAdvance),e.frameLoop&&(esm_n.frameLoop=e.frameLoop)};var E=new Set,esm_u=[],H=[],A=0,qe={get idle(){return!E.size&&!esm_u.length},start(e){A>e.priority?(E.add(e),esm_n.onStart($e)):(te(e),esm_n(B))},advance:B,sort(e){if(A)esm_n.onFrame(()=>qe.sort(e));else{let t=esm_u.indexOf(e);~t&&(esm_u.splice(t,1),re(e))}},clear(){esm_u=[],E.clear()}};function $e(){E.forEach(te),E.clear(),esm_n(B)}function te(e){esm_u.includes(e)||re(e)}function re(e){esm_u.splice(Ge(esm_u,t=>t.priority>e.priority),0,e)}function B(e){let t=H;for(let r=0;r0}function Ge(e,t){let r=e.findIndex(t);return r<0?e.length:r}var ne=(e,t,r)=>Math.min(Math.max(r,e),t);var It={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199};var esm_d="[-+]?\\d*\\.?\\d+",M=esm_d+"%";function C(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var oe=new RegExp("rgb"+C(esm_d,esm_d,esm_d)),fe=new RegExp("rgba"+C(esm_d,esm_d,esm_d,esm_d)),ae=new RegExp("hsl"+C(esm_d,M,M)),ie=new RegExp("hsla"+C(esm_d,M,M,esm_d)),se=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ue=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,le=/^#([0-9a-fA-F]{6})$/,ce=/^#([0-9a-fA-F]{8})$/;function be(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=le.exec(e))?parseInt(t[1]+"ff",16)>>>0:esm_c&&esm_c[e]!==void 0?esm_c[e]:(t=oe.exec(e))?(esm_y(t[1])<<24|esm_y(t[2])<<16|esm_y(t[3])<<8|255)>>>0:(t=fe.exec(e))?(esm_y(t[1])<<24|esm_y(t[2])<<16|esm_y(t[3])<<8|me(t[4]))>>>0:(t=se.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=ce.exec(e))?parseInt(t[1],16)>>>0:(t=ue.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=ae.exec(e))?(de(pe(t[1]),z(t[2]),z(t[3]))|255)>>>0:(t=ie.exec(e))?(de(pe(t[1]),z(t[2]),z(t[3]))|me(t[4]))>>>0:null}function esm_j(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function de(e,t,r){let n=r<.5?r*(1+t):r+t-r*t,f=2*r-n,o=esm_j(f,n,e+1/3),i=esm_j(f,n,e),s=esm_j(f,n,e-1/3);return Math.round(o*255)<<24|Math.round(i*255)<<16|Math.round(s*255)<<8}function esm_y(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function pe(e){return(parseFloat(e)%360+360)%360/360}function me(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function z(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function D(e){let t=be(e);if(t===null)return e;t=t||0;let r=(t&4278190080)>>>24,n=(t&16711680)>>>16,f=(t&65280)>>>8,o=(t&255)/255;return`rgba(${r}, ${n}, ${f}, ${o})`}var W=(e,t,r)=>{if(esm_l.fun(e))return e;if(esm_l.arr(e))return W({range:e,output:t,extrapolate:r});if(esm_l.str(e.output[0]))return k(e);let n=e,f=n.output,o=n.range||[0,1],i=n.extrapolateLeft||n.extrapolate||"extend",s=n.extrapolateRight||n.extrapolate||"extend",x=n.easing||(a=>a);return a=>{let F=He(a,o);return Ue(a,o[F],o[F+1],f[F],f[F+1],x,i,s,n.map)}};function Ue(e,t,r,n,f,o,i,s,x){let a=x?x(e):e;if(ar){if(s==="identity")return a;s==="clamp"&&(a=r)}return n===f?n:t===r?e<=t?n:f:(t===-1/0?a=-a:r===1/0?a=a-t:a=(a-t)/(r-t),a=o(a),n===-1/0?a=-a:f===1/0?a=a+n:a=a*(f-n)+n,a)}function He(e,t){for(var r=1;r=e);++r);return r-1}var Be=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);let n=r*e,f=t==="end"?Math.floor(n):Math.ceil(n);return ne(0,1,f/e)},P=1.70158,L=P*1.525,xe=P+1,he=2*Math.PI/3,ye=2*Math.PI/4.5,V=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,Lt={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e===1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>xe*e*e*e-P*e*e,easeOutBack:e=>1+xe*Math.pow(e-1,3)+P*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((L+1)*2*e-L)/2:(Math.pow(2*e-2,2)*((L+1)*(e*2-2)+L)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*he),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*he)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*ye))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*ye)/2+1,easeInBounce:e=>1-V(1-e),easeOutBounce:V,easeInOutBounce:e=>e<.5?(1-V(1-2*e))/2:(1+V(2*e-1))/2,steps:Be};var g=Symbol.for("FluidValue.get"),esm_m=Symbol.for("FluidValue.observers");var Pt=e=>Boolean(e&&e[g]),ve=e=>e&&e[g]?e[g]():e,esm_qt=e=>e[esm_m]||null;function je(e,t){e.eventObserved?e.eventObserved(t):e(t)}function $t(e,t){let r=e[esm_m];r&&r.forEach(n=>{je(n,t)})}var esm_ge=class{[g];[esm_m];constructor(t){if(!t&&!(t=this.get))throw Error("Unknown getter");De(this,t)}},De=(e,t)=>Ee(e,g,t);function Gt(e,t){if(e[g]){let r=e[esm_m];r||Ee(e,esm_m,r=new Set),r.has(t)||(r.add(t),e.observerAdded&&e.observerAdded(r.size,t))}return t}function Qt(e,t){let r=e[esm_m];if(r&&r.has(t)){let n=r.size-1;n?r.delete(t):e[esm_m]=null,e.observerRemoved&&e.observerRemoved(n,t)}}var Ee=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0});var O=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,esm_Oe=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,K=new RegExp(`(${O.source})(%|[a-z]+)`,"i"),we=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,esm_b=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;var N=e=>{let[t,r]=We(e);if(!t||esm_h())return e;let n=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(n)return n.trim();if(r&&r.startsWith("--")){let f=window.getComputedStyle(document.documentElement).getPropertyValue(r);return f||e}else{if(r&&esm_b.test(r))return N(r);if(r)return r}return e},We=e=>{let t=esm_b.exec(e);if(!t)return[,];let[,r,n]=t;return[r,n]};var _,Ke=(e,t,r,n,f)=>`rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(n)}, ${f})`,Xt=e=>{_||(_=esm_c?new RegExp(`(${Object.keys(esm_c).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map(o=>ve(o).replace(esm_b,N).replace(esm_Oe,D).replace(_,D)),r=t.map(o=>o.match(O).map(Number)),f=r[0].map((o,i)=>r.map(s=>{if(!(i in s))throw Error('The arity of each "output" value must be equal');return s[i]})).map(o=>W({...e,output:o}));return o=>{let i=!K.test(t[0])&&t.find(x=>K.test(x))?.replace(O,""),s=0;return t[0].replace(O,()=>`${f[s++](o)}${i||""}`).replace(we,Ke)}};var Z="react-spring: ",Te=e=>{let t=e,r=!1;if(typeof t!="function")throw new TypeError(`${Z}once requires a function parameter`);return(...n)=>{r||(t(...n),r=!0)}},Ne=Te(console.warn);function Jt(){Ne(`${Z}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var _e=Te(console.warn);function er(){_e(`${Z}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function esm_or(e){return esm_l.str(e)&&(e[0]=="#"||/\d/.test(e)||!esm_h()&&esm_b.test(e)||e in(esm_c||{}))}var esm_v,q=new WeakMap,Ze=e=>e.forEach(({target:t,contentRect:r})=>q.get(t)?.forEach(n=>n(r)));function Fe(e,t){esm_v||typeof ResizeObserver<"u"&&(esm_v=new ResizeObserver(Ze));let r=q.get(t);return r||(r=new Set,q.set(t,r)),r.add(e),esm_v&&esm_v.observe(t),()=>{let n=q.get(t);!n||(n.delete(e),!n.size&&esm_v&&esm_v.unobserve(t))}}var $=new Set,esm_w,Xe=()=>{let e=()=>{$.forEach(t=>t({width:window.innerWidth,height:window.innerHeight}))};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},Ie=e=>($.add(e),esm_w||(esm_w=Xe()),()=>{$.delete(e),!$.size&&esm_w&&(esm_w(),esm_w=void 0)});var ke=(e,{container:t=document.documentElement}={})=>t===document.documentElement?Ie(e):Fe(e,t);var Se=(e,t,r)=>t-e===0?1:(r-e)/(t-e);var Ye={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}},esm_G=class{callback;container;info;constructor(t,r){this.callback=t,this.container=r,this.info={time:0,x:this.createAxis(),y:this.createAxis()}}createAxis=()=>({current:0,progress:0,scrollLength:0});updateAxis=t=>{let r=this.info[t],{length:n,position:f}=Ye[t];r.current=this.container[`scroll${f}`],r.scrollLength=this.container["scroll"+n]-this.container["client"+n],r.progress=Se(0,r.scrollLength,r.current)};update=()=>{this.updateAxis("x"),this.updateAxis("y")};sendEvent=()=>{this.callback(this.info)};advance=()=>{this.update(),this.sendEvent()}};var esm_T=new WeakMap,Ae=new WeakMap,X=new WeakMap,Me=e=>e===document.documentElement?window:e,yr=(e,{container:t=document.documentElement}={})=>{let r=X.get(t);r||(r=new Set,X.set(t,r));let n=new esm_G(e,t);if(r.add(n),!esm_T.has(t)){let o=()=>(r?.forEach(s=>s.advance()),!0);esm_T.set(t,o);let i=Me(t);window.addEventListener("resize",o,{passive:!0}),t!==document.documentElement&&Ae.set(t,ke(o,{container:t})),i.addEventListener("scroll",o,{passive:!0})}let f=esm_T.get(t);return Re(f),()=>{Re.cancel(f);let o=X.get(t);if(!o||(o.delete(n),o.size))return;let i=esm_T.get(t);esm_T.delete(t),i&&(Me(t).removeEventListener("scroll",i),window.removeEventListener("resize",i),Ae.get(t)?.())}};function Er(e){let t=Je(null);return t.current===null&&(t.current=e()),t.current}var esm_Q=esm_h()?external_React_.useEffect:external_React_.useLayoutEffect;var Ce=()=>{let e=(0,external_React_.useRef)(!1);return esm_Q(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function Mr(){let e=(0,external_React_.useState)()[1],t=Ce();return()=>{t.current&&e(Math.random())}}function Lr(e,t){let[r]=(0,external_React_.useState)(()=>({inputs:t,result:e()})),n=(0,external_React_.useRef)(),f=n.current,o=f;return o?Boolean(t&&o.inputs&&it(t,o.inputs))||(o={inputs:t,result:e()}):o=r,(0,external_React_.useEffect)(()=>{n.current=o,f==r&&(r.inputs=r.result=void 0)},[o]),o.result}function it(e,t){if(e.length!==t.length)return!1;for(let r=0;r(0,external_React_.useEffect)(e,ut),ut=[];function Ur(e){let t=(0,external_React_.useRef)();return (0,external_React_.useEffect)(()=>{t.current=e}),t.current}var Wr=()=>{let[e,t]=dt(null);return esm_Q(()=>{let r=window.matchMedia("(prefers-reduced-motion)"),n=f=>{t(f.matches),U({skipAnimation:f.matches})};return n(r),r.addEventListener("change",n),()=>{r.removeEventListener("change",n)}},[]),e}; +var ze=Object.defineProperty;var Le=(e,t)=>{for(var r in t)ze(e,r,{get:t[r],enumerable:!0})};var esm_p={};Le(esm_p,{assign:()=>U,colors:()=>esm_c,createStringInterpolator:()=>k,skipAnimation:()=>ee,to:()=>J,willAdvance:()=>esm_S});function Y(){}var mt=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),esm_l={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function bt(e,t){if(esm_l.arr(e)){if(!esm_l.arr(t)||e.length!==t.length)return!1;for(let r=0;re.forEach(t);function xt(e,t,r){if(esm_l.arr(e)){for(let n=0;nesm_l.und(e)?[]:esm_l.arr(e)?e:[e];function Pe(e,t){if(e.size){let r=Array.from(e);e.clear(),Ve(r,t)}}var yt=(e,...t)=>Pe(e,r=>r(...t)),esm_h=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);var k,J,esm_c=null,ee=!1,esm_S=Y,U=e=>{e.to&&(J=e.to),e.now&&(esm_n.now=e.now),e.colors!==void 0&&(esm_c=e.colors),e.skipAnimation!=null&&(ee=e.skipAnimation),e.createStringInterpolator&&(k=e.createStringInterpolator),e.requestAnimationFrame&&esm_n.use(e.requestAnimationFrame),e.batchedUpdates&&(esm_n.batchedUpdates=e.batchedUpdates),e.willAdvance&&(esm_S=e.willAdvance),e.frameLoop&&(esm_n.frameLoop=e.frameLoop)};var E=new Set,esm_u=[],H=[],A=0,qe={get idle(){return!E.size&&!esm_u.length},start(e){A>e.priority?(E.add(e),esm_n.onStart($e)):(te(e),esm_n(B))},advance:B,sort(e){if(A)esm_n.onFrame(()=>qe.sort(e));else{let t=esm_u.indexOf(e);~t&&(esm_u.splice(t,1),re(e))}},clear(){esm_u=[],E.clear()}};function $e(){E.forEach(te),E.clear(),esm_n(B)}function te(e){esm_u.includes(e)||re(e)}function re(e){esm_u.splice(Ge(esm_u,t=>t.priority>e.priority),0,e)}function B(e){let t=H;for(let r=0;r0}function Ge(e,t){let r=e.findIndex(t);return r<0?e.length:r}var ne=(e,t,r)=>Math.min(Math.max(r,e),t);var It={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199};var esm_d="[-+]?\\d*\\.?\\d+",M=esm_d+"%";function C(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var oe=new RegExp("rgb"+C(esm_d,esm_d,esm_d)),fe=new RegExp("rgba"+C(esm_d,esm_d,esm_d,esm_d)),ae=new RegExp("hsl"+C(esm_d,M,M)),ie=new RegExp("hsla"+C(esm_d,M,M,esm_d)),se=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ue=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,le=/^#([0-9a-fA-F]{6})$/,ce=/^#([0-9a-fA-F]{8})$/;function be(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=le.exec(e))?parseInt(t[1]+"ff",16)>>>0:esm_c&&esm_c[e]!==void 0?esm_c[e]:(t=oe.exec(e))?(esm_y(t[1])<<24|esm_y(t[2])<<16|esm_y(t[3])<<8|255)>>>0:(t=fe.exec(e))?(esm_y(t[1])<<24|esm_y(t[2])<<16|esm_y(t[3])<<8|me(t[4]))>>>0:(t=se.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=ce.exec(e))?parseInt(t[1],16)>>>0:(t=ue.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=ae.exec(e))?(de(pe(t[1]),z(t[2]),z(t[3]))|255)>>>0:(t=ie.exec(e))?(de(pe(t[1]),z(t[2]),z(t[3]))|me(t[4]))>>>0:null}function esm_j(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function de(e,t,r){let n=r<.5?r*(1+t):r+t-r*t,f=2*r-n,o=esm_j(f,n,e+1/3),i=esm_j(f,n,e),s=esm_j(f,n,e-1/3);return Math.round(o*255)<<24|Math.round(i*255)<<16|Math.round(s*255)<<8}function esm_y(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function pe(e){return(parseFloat(e)%360+360)%360/360}function me(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function z(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function D(e){let t=be(e);if(t===null)return e;t=t||0;let r=(t&4278190080)>>>24,n=(t&16711680)>>>16,f=(t&65280)>>>8,o=(t&255)/255;return`rgba(${r}, ${n}, ${f}, ${o})`}var W=(e,t,r)=>{if(esm_l.fun(e))return e;if(esm_l.arr(e))return W({range:e,output:t,extrapolate:r});if(esm_l.str(e.output[0]))return k(e);let n=e,f=n.output,o=n.range||[0,1],i=n.extrapolateLeft||n.extrapolate||"extend",s=n.extrapolateRight||n.extrapolate||"extend",x=n.easing||(a=>a);return a=>{let F=He(a,o);return Ue(a,o[F],o[F+1],f[F],f[F+1],x,i,s,n.map)}};function Ue(e,t,r,n,f,o,i,s,x){let a=x?x(e):e;if(ar){if(s==="identity")return a;s==="clamp"&&(a=r)}return n===f?n:t===r?e<=t?n:f:(t===-1/0?a=-a:r===1/0?a=a-t:a=(a-t)/(r-t),a=o(a),n===-1/0?a=-a:f===1/0?a=a+n:a=a*(f-n)+n,a)}function He(e,t){for(var r=1;r=e);++r);return r-1}var Be=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);let n=r*e,f=t==="end"?Math.floor(n):Math.ceil(n);return ne(0,1,f/e)},P=1.70158,L=P*1.525,xe=P+1,he=2*Math.PI/3,ye=2*Math.PI/4.5,V=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,Lt={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e===1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>xe*e*e*e-P*e*e,easeOutBack:e=>1+xe*Math.pow(e-1,3)+P*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((L+1)*2*e-L)/2:(Math.pow(2*e-2,2)*((L+1)*(e*2-2)+L)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*he),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*he)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*ye))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*ye)/2+1,easeInBounce:e=>1-V(1-e),easeOutBounce:V,easeInOutBounce:e=>e<.5?(1-V(1-2*e))/2:(1+V(2*e-1))/2,steps:Be};var g=Symbol.for("FluidValue.get"),esm_m=Symbol.for("FluidValue.observers");var Pt=e=>!!(e&&e[g]),ve=e=>e&&e[g]?e[g]():e,esm_qt=e=>e[esm_m]||null;function je(e,t){e.eventObserved?e.eventObserved(t):e(t)}function $t(e,t){let r=e[esm_m];r&&r.forEach(n=>{je(n,t)})}var esm_ge=class{[g];[esm_m];constructor(t){if(!t&&!(t=this.get))throw Error("Unknown getter");De(this,t)}},De=(e,t)=>Ee(e,g,t);function Gt(e,t){if(e[g]){let r=e[esm_m];r||Ee(e,esm_m,r=new Set),r.has(t)||(r.add(t),e.observerAdded&&e.observerAdded(r.size,t))}return t}function Qt(e,t){let r=e[esm_m];if(r&&r.has(t)){let n=r.size-1;n?r.delete(t):e[esm_m]=null,e.observerRemoved&&e.observerRemoved(n,t)}}var Ee=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0});var O=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,esm_Oe=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,K=new RegExp(`(${O.source})(%|[a-z]+)`,"i"),we=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,esm_b=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;var N=e=>{let[t,r]=We(e);if(!t||esm_h())return e;let n=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(n)return n.trim();if(r&&r.startsWith("--")){let f=window.getComputedStyle(document.documentElement).getPropertyValue(r);return f||e}else{if(r&&esm_b.test(r))return N(r);if(r)return r}return e},We=e=>{let t=esm_b.exec(e);if(!t)return[,];let[,r,n]=t;return[r,n]};var _,Ke=(e,t,r,n,f)=>`rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(n)}, ${f})`,Xt=e=>{_||(_=esm_c?new RegExp(`(${Object.keys(esm_c).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map(o=>ve(o).replace(esm_b,N).replace(esm_Oe,D).replace(_,D)),r=t.map(o=>o.match(O).map(Number)),f=r[0].map((o,i)=>r.map(s=>{if(!(i in s))throw Error('The arity of each "output" value must be equal');return s[i]})).map(o=>W({...e,output:o}));return o=>{let i=!K.test(t[0])&&t.find(x=>K.test(x))?.replace(O,""),s=0;return t[0].replace(O,()=>`${f[s++](o)}${i||""}`).replace(we,Ke)}};var Z="react-spring: ",Te=e=>{let t=e,r=!1;if(typeof t!="function")throw new TypeError(`${Z}once requires a function parameter`);return(...n)=>{r||(t(...n),r=!0)}},Ne=Te(console.warn);function Jt(){Ne(`${Z}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var _e=Te(console.warn);function er(){_e(`${Z}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function esm_or(e){return esm_l.str(e)&&(e[0]=="#"||/\d/.test(e)||!esm_h()&&esm_b.test(e)||e in(esm_c||{}))}var esm_v,q=new WeakMap,Ze=e=>e.forEach(({target:t,contentRect:r})=>q.get(t)?.forEach(n=>n(r)));function Fe(e,t){esm_v||typeof ResizeObserver<"u"&&(esm_v=new ResizeObserver(Ze));let r=q.get(t);return r||(r=new Set,q.set(t,r)),r.add(e),esm_v&&esm_v.observe(t),()=>{let n=q.get(t);n&&(n.delete(e),!n.size&&esm_v&&esm_v.unobserve(t))}}var $=new Set,esm_w,Xe=()=>{let e=()=>{$.forEach(t=>t({width:window.innerWidth,height:window.innerHeight}))};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},Ie=e=>($.add(e),esm_w||(esm_w=Xe()),()=>{$.delete(e),!$.size&&esm_w&&(esm_w(),esm_w=void 0)});var ke=(e,{container:t=document.documentElement}={})=>t===document.documentElement?Ie(e):Fe(e,t);var Se=(e,t,r)=>t-e===0?1:(r-e)/(t-e);var Ye={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}},esm_G=class{callback;container;info;constructor(t,r){this.callback=t,this.container=r,this.info={time:0,x:this.createAxis(),y:this.createAxis()}}createAxis=()=>({current:0,progress:0,scrollLength:0});updateAxis=t=>{let r=this.info[t],{length:n,position:f}=Ye[t];r.current=this.container[`scroll${f}`],r.scrollLength=this.container["scroll"+n]-this.container["client"+n],r.progress=Se(0,r.scrollLength,r.current)};update=()=>{this.updateAxis("x"),this.updateAxis("y")};sendEvent=()=>{this.callback(this.info)};advance=()=>{this.update(),this.sendEvent()}};var esm_T=new WeakMap,Ae=new WeakMap,X=new WeakMap,Me=e=>e===document.documentElement?window:e,yr=(e,{container:t=document.documentElement}={})=>{let r=X.get(t);r||(r=new Set,X.set(t,r));let n=new esm_G(e,t);if(r.add(n),!esm_T.has(t)){let o=()=>(r?.forEach(s=>s.advance()),!0);esm_T.set(t,o);let i=Me(t);window.addEventListener("resize",o,{passive:!0}),t!==document.documentElement&&Ae.set(t,ke(o,{container:t})),i.addEventListener("scroll",o,{passive:!0})}let f=esm_T.get(t);return Re(f),()=>{Re.cancel(f);let o=X.get(t);if(!o||(o.delete(n),o.size))return;let i=esm_T.get(t);esm_T.delete(t),i&&(Me(t).removeEventListener("scroll",i),window.removeEventListener("resize",i),Ae.get(t)?.())}};function Er(e){let t=Je(null);return t.current===null&&(t.current=e()),t.current}var esm_Q=esm_h()?external_React_.useEffect:external_React_.useLayoutEffect;var Ce=()=>{let e=(0,external_React_.useRef)(!1);return esm_Q(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function Mr(){let e=(0,external_React_.useState)()[1],t=Ce();return()=>{t.current&&e(Math.random())}}function Lr(e,t){let[r]=(0,external_React_.useState)(()=>({inputs:t,result:e()})),n=(0,external_React_.useRef)(),f=n.current,o=f;return o?t&&o.inputs&&it(t,o.inputs)||(o={inputs:t,result:e()}):o=r,(0,external_React_.useEffect)(()=>{n.current=o,f==r&&(r.inputs=r.result=void 0)},[o]),o.result}function it(e,t){if(e.length!==t.length)return!1;for(let r=0;r(0,external_React_.useEffect)(e,ut),ut=[];function Ur(e){let t=(0,external_React_.useRef)();return (0,external_React_.useEffect)(()=>{t.current=e}),t.current}var Wr=()=>{let[e,t]=dt(null);return esm_Q(()=>{let r=window.matchMedia("(prefers-reduced-motion)"),n=f=>{t(f.matches),U({skipAnimation:f.matches})};return n(r),r.addEventListener("change",n),()=>{r.removeEventListener("change",n)}},[]),e}; ;// CONCATENATED MODULE: ./node_modules/@react-spring/animated/dist/esm/index.js var dist_esm_h=Symbol.for("Animated:node"),dist_esm_v=e=>!!e&&e[dist_esm_h]===e,esm_k=e=>e&&e[dist_esm_h],esm_D=(e,t)=>mt(e,dist_esm_h,t),F=e=>e&&e[dist_esm_h]&&e[dist_esm_h].getPayload(),dist_esm_c=class{payload;constructor(){esm_D(this,this)}getPayload(){return this.payload||[]}};var dist_esm_l=class extends dist_esm_c{constructor(r){super();this._value=r;esm_l.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(r){return new dist_esm_l(r)}getPayload(){return[this]}getValue(){return this._value}setValue(r,n){return esm_l.num(r)&&(this.lastPosition=r,n&&(r=Math.round(r/n)*n,this.done&&(this.lastPosition=r))),this._value===r?!1:(this._value=r,!0)}reset(){let{done:r}=this;this.done=!1,esm_l.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,r&&(this.lastVelocity=null),this.v0=null)}};var dist_esm_d=class extends dist_esm_l{_string=null;_toString;constructor(t){super(0),this._toString=W({output:[t,t]})}static create(t){return new dist_esm_d(t)}getValue(){let t=this._string;return t??(this._string=this._toString(this._value))}setValue(t){if(esm_l.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=W({output:[this.getValue(),t]})),this._value=0,super.reset()}};var esm_f={dependencies:null};var dist_esm_u=class extends dist_esm_c{constructor(r){super();this.source=r;this.setValue(r)}getValue(r){let n={};return xt(this.source,(a,i)=>{dist_esm_v(a)?n[i]=a.getValue(r):Pt(a)?n[i]=ve(a):r||(n[i]=a)}),n}setValue(r){this.source=r,this.payload=this._makePayload(r)}reset(){this.payload&&Ve(this.payload,r=>r.reset())}_makePayload(r){if(r){let n=new Set;return xt(r,this._addToPayload,n),Array.from(n)}}_addToPayload(r){esm_f.dependencies&&Pt(r)&&esm_f.dependencies.add(r);let n=F(r);n&&Ve(n,a=>this.add(a))}};var dist_esm_y=class extends dist_esm_u{constructor(t){super(t)}static create(t){return new dist_esm_y(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){let r=this.getPayload();return t.length==r.length?r.map((n,a)=>n.setValue(t[a])).some(Boolean):(super.setValue(t.map(esm_z)),!0)}};function esm_z(e){return(esm_or(e)?dist_esm_d:dist_esm_l).create(e)}function esm_Le(e){let t=esm_k(e);return t?t.constructor:esm_l.arr(e)?dist_esm_y:esm_or(e)?dist_esm_d:dist_esm_l}var esm_x=(e,t)=>{let r=!esm_l.fun(e)||e.prototype&&e.prototype.isReactComponent;return (0,external_React_.forwardRef)((n,a)=>{let i=(0,external_React_.useRef)(null),o=r&&(0,external_React_.useCallback)(s=>{i.current=esm_ae(a,s)},[a]),[m,T]=esm_ne(n,t),W=Mr(),P=()=>{let s=i.current;if(r&&!s)return;(s?t.applyAnimatedValues(s,m.getValue(!0)):!1)===!1&&W()},_=new dist_esm_b(P,T),p=(0,external_React_.useRef)();esm_Q(()=>(p.current=_,Ve(T,s=>Gt(s,_)),()=>{p.current&&(Ve(p.current.deps,s=>Qt(s,p.current)),esm_n.cancel(p.current.update))})),(0,external_React_.useEffect)(P,[]),$r(()=>()=>{let s=p.current;Ve(s.deps,S=>Qt(S,s))});let $=t.getComponentProps(m.getValue());return external_React_.createElement(e,{...$,ref:o})})},dist_esm_b=class{constructor(t,r){this.update=t;this.deps=r}eventObserved(t){t.type=="change"&&esm_n.write(this.update)}};function esm_ne(e,t){let r=new Set;return esm_f.dependencies=r,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new dist_esm_u(e),esm_f.dependencies=null,[e,r]}function esm_ae(e,t){return e&&(esm_l.fun(e)?e(t):e.current=t),t}var dist_esm_j=Symbol.for("AnimatedComponent"),esm_Ke=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:r=a=>new dist_esm_u(a),getComponentProps:n=a=>a}={})=>{let a={applyAnimatedValues:t,createAnimatedStyle:r,getComponentProps:n},i=o=>{let m=I(o)||"Anonymous";return esm_l.str(o)?o=i[o]||(i[o]=esm_x(o,a)):o=o[dist_esm_j]||(o[dist_esm_j]=esm_x(o,a)),o.displayName=`Animated(${m})`,o};return xt(e,(o,m)=>{esm_l.arr(e)&&(m=I(o)),i[m]=i(o)}),{animated:i}},I=e=>esm_l.str(e)?e:e&&esm_l.str(e.displayName)?e.displayName:esm_l.fun(e)&&e.name||null; ;// CONCATENATED MODULE: ./node_modules/@react-spring/core/dist/esm/index.js -function esm_I(t,...e){return esm_l.fun(t)?t(...e):t}var esm_te=(t,e)=>t===!0||!!(e&&t&&(esm_l.fun(t)?t(e):ht(t).includes(e))),et=(t,e)=>esm_l.obj(t)?e&&t[e]:t;var esm_ke=(t,e)=>t.default===!0?t[e]:t.default?t.default[e]:void 0,nn=t=>t,dist_esm_ne=(t,e=nn)=>{let n=rn;t.default&&t.default!==!0&&(t=t.default,n=Object.keys(t));let r={};for(let o of n){let s=e(t[o],o);esm_l.und(s)||(r[o]=s)}return r},rn=["config","onProps","onStart","onChange","onPause","onResume","onRest"],on={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function sn(t){let e={},n=0;if(xt(t,(r,o)=>{on[o]||(e[o]=r,n++)}),n)return e}function esm_de(t){let e=sn(t);if(e){let n={to:e};return xt(t,(r,o)=>o in e||(n[o]=r)),n}return{...t}}function esm_me(t){return t=ve(t),esm_l.arr(t)?t.map(esm_me):esm_or(t)?esm_p.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function esm_Ue(t){for(let e in t)return!0;return!1}function esm_Ee(t){return esm_l.fun(t)||esm_l.arr(t)&&esm_l.obj(t[0])}function esm_xe(t,e){t.ref?.delete(t),e?.delete(t)}function esm_he(t,e){e&&t.ref!==e&&(t.ref?.delete(t),e.add(t),t.ref=e)}function wr(t,e,n=1e3){an(()=>{if(e){let r=0;ge(t,(o,s)=>{let a=o.current;if(a.length){let i=n*e[s];isNaN(i)?i=r:r=i,ge(a,u=>{ge(u.queue,p=>{let f=p.delay;p.delay=d=>i+esm_I(f||0,d)})}),o.start()}})}else{let r=Promise.resolve();ge(t,o=>{let s=o.current;if(s.length){let a=s.map(i=>{let u=i.queue;return i.queue=[],u});r=r.then(()=>(ge(s,(i,u)=>ge(a[u]||[],p=>i.queue.push(p))),Promise.all(o.start())))}})}})}var esm_mt={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}};var tt={...esm_mt.default,mass:1,damping:1,easing:Lt.linear,clamp:!1},esm_we=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,tt)}};function gt(t,e,n){n&&(n={...n},esm_ht(n,e),e={...n,...e}),esm_ht(t,e),Object.assign(t,e);for(let a in tt)t[a]==null&&(t[a]=tt[a]);let{mass:r,frequency:o,damping:s}=t;return esm_l.und(o)||(o<.01&&(o=.01),s<0&&(s=0),t.tension=Math.pow(2*Math.PI/o,2)*r,t.friction=4*Math.PI*s*r/o),t}function esm_ht(t,e){if(!esm_l.und(e.decay))t.duration=void 0;else{let n=!esm_l.und(e.tension)||!esm_l.und(e.friction);(n||!esm_l.und(e.frequency)||!esm_l.und(e.damping)||!esm_l.und(e.mass))&&(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}}var esm_yt=[],dist_esm_Le=class{changed=!1;values=esm_yt;toValues=null;fromValues=esm_yt;to;from;config=new esm_we;immediate=!1};function esm_Me(t,{key:e,props:n,defaultProps:r,state:o,actions:s}){return new Promise((a,i)=>{let u,p,f=esm_te(n.cancel??r?.cancel,e);if(f)b();else{esm_l.und(n.pause)||(o.paused=esm_te(n.pause,e));let c=r?.pause;c!==!0&&(c=o.paused||esm_te(c,e)),u=esm_I(n.delay||0,e),c?(o.resumeQueue.add(m),s.pause()):(s.resume(),m())}function d(){o.resumeQueue.add(m),o.timeouts.delete(p),p.cancel(),u=p.time-esm_n.now()}function m(){u>0&&!esm_p.skipAnimation?(o.delayed=!0,p=esm_n.setTimeout(b,u),o.pauseQueue.add(d),o.timeouts.add(p)):b()}function b(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(d),o.timeouts.delete(p),t<=(o.cancelId||0)&&(f=!0);try{s.start({...n,callId:t,cancel:f},a)}catch(c){i(c)}}})}var esm_be=(t,e)=>e.length==1?e[0]:e.some(n=>n.cancelled)?esm_q(t.get()):e.every(n=>n.noop)?nt(t.get()):esm_E(t.get(),e.every(n=>n.finished)),nt=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),esm_E=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),esm_q=t=>({value:t,cancelled:!0,finished:!1});function esm_De(t,e,n,r){let{callId:o,parentId:s,onRest:a}=e,{asyncTo:i,promise:u}=n;return!s&&t===i&&!e.reset?u:n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;let p=dist_esm_ne(e,(l,h)=>h==="onRest"?void 0:l),f,d,m=new Promise((l,h)=>(f=l,d=h)),b=l=>{let h=o<=(n.cancelId||0)&&esm_q(r)||o!==n.asyncId&&esm_E(r,!1);if(h)throw l.result=h,d(l),l},c=(l,h)=>{let g=new esm_Ae,x=new esm_Ne;return(async()=>{if(esm_p.skipAnimation)throw esm_oe(n),x.result=esm_E(r,!1),d(x),x;b(g);let S=esm_l.obj(l)?{...l}:{...h,to:l};S.parentId=o,xt(p,(V,_)=>{esm_l.und(S[_])&&(S[_]=V)});let A=await r.start(S);return b(g),n.paused&&await new Promise(V=>{n.resumeQueue.add(V)}),A})()},P;if(esm_p.skipAnimation)return esm_oe(n),esm_E(r,!1);try{let l;esm_l.arr(t)?l=(async h=>{for(let g of h)await c(g)})(t):l=Promise.resolve(t(c,r.stop.bind(r))),await Promise.all([l.then(f),m]),P=esm_E(r.get(),!0,!1)}catch(l){if(l instanceof esm_Ae)P=l.result;else if(l instanceof esm_Ne)P=l.result;else throw l}finally{o==n.asyncId&&(n.asyncId=s,n.asyncTo=s?i:void 0,n.promise=s?u:void 0)}return esm_l.fun(a)&&esm_n.batchedUpdates(()=>{a(P,r,r.item)}),P})()}function esm_oe(t,e){Pe(t.timeouts,n=>n.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}var esm_Ae=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},esm_Ne=class extends Error{result;constructor(){super("SkipAnimationSignal")}};var esm_Re=t=>t instanceof esm_X,Sn=1,esm_X=class extends esm_ge{id=Sn++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=esm_k(this);return e&&e.getValue()}to(...e){return esm_p.to(this,e)}interpolate(...e){return Jt(),esm_p.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,n=!1){$t(this,{type:"change",parent:this,value:e,idle:n})}_onPriorityChange(e){this.idle||qe.sort(this),$t(this,{type:"priority",parent:this,priority:e})}};var esm_se=Symbol.for("SpringPhase"),esm_bt=1,rt=2,ot=4,esm_qe=t=>(t[esm_se]&esm_bt)>0,dist_esm_Q=t=>(t[esm_se]&rt)>0,esm_ye=t=>(t[esm_se]&ot)>0,st=(t,e)=>e?t[esm_se]|=rt|esm_bt:t[esm_se]&=~rt,esm_it=(t,e)=>e?t[esm_se]|=ot:t[esm_se]&=~ot;var esm_ue=class extends esm_X{key;animation=new dist_esm_Le;queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,n){if(super(),!esm_l.und(e)||!esm_l.und(n)){let r=esm_l.obj(e)?{...e}:{...n,from:e};esm_l.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(dist_esm_Q(this)||this._state.asyncTo)||esm_ye(this)}get goal(){return ve(this.animation.to)}get velocity(){let e=esm_k(this);return e instanceof dist_esm_l?e.lastVelocity||0:e.getPayload().map(n=>n.lastVelocity||0)}get hasAnimated(){return esm_qe(this)}get isAnimating(){return dist_esm_Q(this)}get isPaused(){return esm_ye(this)}get isDelayed(){return this._state.delayed}advance(e){let n=!0,r=!1,o=this.animation,{config:s,toValues:a}=o,i=F(o.to);!i&&Pt(o.to)&&(a=ht(ve(o.to))),o.values.forEach((f,d)=>{if(f.done)return;let m=f.constructor==dist_esm_d?1:i?i[d].lastPosition:a[d],b=o.immediate,c=m;if(!b){if(c=f.lastPosition,s.tension<=0){f.done=!0;return}let P=f.elapsedTime+=e,l=o.fromValues[d],h=f.v0!=null?f.v0:f.v0=esm_l.arr(s.velocity)?s.velocity[d]:s.velocity,g,x=s.precision||(l==m?.005:Math.min(1,Math.abs(m-l)*.001));if(esm_l.und(s.duration))if(s.decay){let S=s.decay===!0?.998:s.decay,A=Math.exp(-(1-S)*P);c=l+h/(1-S)*(1-A),b=Math.abs(f.lastPosition-c)<=x,g=h*A}else{g=f.lastVelocity==null?h:f.lastVelocity;let S=s.restVelocity||x/10,A=s.clamp?0:s.bounce,V=!esm_l.und(A),_=l==m?f.v0>0:lS,!(!v&&(b=Math.abs(m-c)<=x,b)));++L){V&&(w=c==m||c>m==_,w&&(g=-g*A,c=m));let N=-s.tension*1e-6*(c-m),y=-s.friction*.001*g,T=(N+y)/s.mass;g=g+T*C,c=c+g*C}}else{let S=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,f.durationProgress>0&&(f.elapsedTime=s.duration*f.durationProgress,P=f.elapsedTime+=e)),S=(s.progress||0)+P/this._memoizedDuration,S=S>1?1:S<0?0:S,f.durationProgress=S),c=l+s.easing(S)*(m-l),g=(c-f.lastPosition)/e,b=S==1}f.lastVelocity=g,Number.isNaN(c)&&(console.warn("Got NaN while animating:",this),b=!0)}i&&!i[d].done&&(b=!1),b?f.done=!0:n=!1,f.setValue(c,s.round)&&(r=!0)});let u=esm_k(this),p=u.getValue();if(n){let f=ve(o.to);(p!==f||r)&&!s.decay?(u.setValue(f),this._onChange(f)):r&&s.decay&&this._onChange(p),this._stop()}else r&&this._onChange(p)}set(e){return esm_n.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(dist_esm_Q(this)){let{to:e,config:n}=this.animation;esm_n.batchedUpdates(()=>{this._onStart(),n.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,n){let r;return esm_l.und(e)?(r=this.queue||[],this.queue=[]):r=[esm_l.obj(e)?e:{...n,to:e}],Promise.all(r.map(o=>this._update(o))).then(o=>esm_be(this,o))}stop(e){let{to:n}=this.animation;return this._focus(this.get()),esm_oe(this._state,e&&this._lastCallId),esm_n.batchedUpdates(()=>this._stop(n,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){let n=this.key||"",{to:r,from:o}=e;r=esm_l.obj(r)?r[n]:r,(r==null||esm_Ee(r))&&(r=void 0),o=esm_l.obj(o)?o[n]:o,o==null&&(o=void 0);let s={to:r,from:o};return esm_qe(this)||(e.reverse&&([r,o]=[o,r]),o=ve(o),esm_l.und(o)?esm_k(this)||this._set(r):this._set(o)),s}_update({...e},n){let{key:r,defaultProps:o}=this;e.default&&Object.assign(o,dist_esm_ne(e,(i,u)=>/^on/.test(u)?et(i,r):i)),_t(this,e,"onProps"),esm_Ie(this,"onProps",e,this);let s=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let a=this._state;return esm_Me(++this._lastCallId,{key:r,props:e,defaultProps:o,state:a,actions:{pause:()=>{esm_ye(this)||(esm_it(this,!0),yt(a.pauseQueue),esm_Ie(this,"onPause",esm_E(this,esm_Ce(this,this.animation.to)),this))},resume:()=>{esm_ye(this)&&(esm_it(this,!1),dist_esm_Q(this)&&this._resume(),yt(a.resumeQueue),esm_Ie(this,"onResume",esm_E(this,esm_Ce(this,this.animation.to)),this))},start:this._merge.bind(this,s)}}).then(i=>{if(e.loop&&i.finished&&!(n&&i.noop)){let u=at(e);if(u)return this._update(u,!0)}return i})}_merge(e,n,r){if(n.cancel)return this.stop(!0),r(esm_q(this));let o=!esm_l.und(e.to),s=!esm_l.und(e.from);if(o||s)if(n.callId>this._lastToId)this._lastToId=n.callId;else return r(esm_q(this));let{key:a,defaultProps:i,animation:u}=this,{to:p,from:f}=u,{to:d=p,from:m=f}=e;s&&!o&&(!n.default||esm_l.und(d))&&(d=m),n.reverse&&([d,m]=[m,d]);let b=!bt(m,f);b&&(u.from=m),m=ve(m);let c=!bt(d,p);c&&this._focus(d);let P=esm_Ee(n.to),{config:l}=u,{decay:h,velocity:g}=l;(o||s)&&(l.velocity=0),n.config&&!P&>(l,esm_I(n.config,a),n.config!==i.config?esm_I(i.config,a):void 0);let x=esm_k(this);if(!x||esm_l.und(d))return r(esm_E(this,!0));let S=esm_l.und(n.reset)?s&&!n.default:!esm_l.und(m)&&esm_te(n.reset,a),A=S?m:this.get(),V=esm_me(d),_=esm_l.num(V)||esm_l.arr(V)||esm_or(V),v=!P&&(!_||esm_te(i.immediate||n.immediate,a));if(c){let L=esm_Le(d);if(L!==x.constructor)if(v)x=this._set(V);else throw Error(`Cannot animate between ${x.constructor.name} and ${L.name}, as the "to" prop suggests`)}let w=x.constructor,C=Pt(d),$=!1;if(!C){let L=S||!esm_qe(this)&&b;(c||L)&&($=bt(esm_me(A),V),C=!$),(!bt(u.immediate,v)&&!v||!bt(l.decay,h)||!bt(l.velocity,g))&&(C=!0)}if($&&dist_esm_Q(this)&&(u.changed&&!S?C=!0:C||this._stop(p)),!P&&((C||Pt(p))&&(u.values=x.getPayload(),u.toValues=Pt(d)?null:w==dist_esm_d?[1]:ht(V)),u.immediate!=v&&(u.immediate=v,!v&&!S&&this._set(p)),C)){let{onRest:L}=u;Ve(_n,y=>_t(this,n,y));let N=esm_E(this,esm_Ce(this,p));yt(this._pendingCalls,N),this._pendingCalls.add(r),u.changed&&esm_n.batchedUpdates(()=>{u.changed=!S,L?.(N,this),S?esm_I(i.onRest,N):u.onStart?.(N,this)})}S&&this._set(A),P?r(esm_De(n.to,n,this._state,this)):C?this._start():dist_esm_Q(this)&&!c?this._pendingCalls.add(r):r(nt(A))}_focus(e){let n=this.animation;e!==n.to&&(esm_qt(this)&&this._detach(),n.to=e,esm_qt(this)&&this._attach())}_attach(){let e=0,{to:n}=this.animation;Pt(n)&&(Gt(n,this),esm_Re(n)&&(e=n.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Pt(e)&&Qt(e,this)}_set(e,n=!0){let r=ve(e);if(!esm_l.und(r)){let o=esm_k(this);if(!o||!bt(r,o.getValue())){let s=esm_Le(r);!o||o.constructor!=s?esm_D(this,s.create(r)):o.setValue(r),o&&esm_n.batchedUpdates(()=>{this._onChange(r,n)})}}return esm_k(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,esm_Ie(this,"onStart",esm_E(this,esm_Ce(this,e.to)),this))}_onChange(e,n){n||(this._onStart(),esm_I(this.animation.onChange,e,this)),esm_I(this.defaultProps.onChange,e,this),super._onChange(e,n)}_start(){let e=this.animation;esm_k(this).reset(ve(e.to)),e.immediate||(e.fromValues=e.values.map(n=>n.lastPosition)),dist_esm_Q(this)||(st(this,!0),esm_ye(this)||this._resume())}_resume(){esm_p.skipAnimation?this.finish():qe.start(this)}_stop(e,n){if(dist_esm_Q(this)){st(this,!1);let r=this.animation;Ve(r.values,s=>{s.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),$t(this,{type:"idle",parent:this});let o=n?esm_q(this.get()):esm_E(this.get(),esm_Ce(this,e??r.to));yt(this._pendingCalls,o),r.changed&&(r.changed=!1,esm_Ie(this,"onRest",o,this))}}};function esm_Ce(t,e){let n=esm_me(e),r=esm_me(t.get());return bt(r,n)}function at(t,e=t.loop,n=t.to){let r=esm_I(e);if(r){let o=r!==!0&&esm_de(r),s=(o||t).reverse,a=!o||o.reset;return esm_Pe({...t,loop:e,default:!1,pause:void 0,to:!s||esm_Ee(n)?n:void 0,from:a?t.from:void 0,reset:a,...o})}}function esm_Pe(t){let{to:e,from:n}=t=esm_de(t),r=new Set;return esm_l.obj(e)&&Vt(e,r),esm_l.obj(n)&&Vt(n,r),t.keys=r.size?Array.from(r):null,t}function Ot(t){let e=esm_Pe(t);return esm_l.und(e.default)&&(e.default=dist_esm_ne(e)),e}function Vt(t,e){xt(t,(n,r)=>n!=null&&e.add(r))}var _n=["onStart","onRest","onChange","onPause","onResume"];function _t(t,e,n){t.animation[n]=e[n]!==esm_ke(e,n)?et(e[n],t.key):void 0}function esm_Ie(t,e,...n){t.animation[e]?.(...n),t.defaultProps[e]?.(...n)}var Fn=["onStart","onChange","onRest"],kn=1,esm_le=class{id=kn++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,n){this._onFrame=this._onFrame.bind(this),n&&(this._flush=n),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each((n,r)=>e[r]=n.get()),e}set(e){for(let n in e){let r=e[n];esm_l.und(r)||this.springs[n].set(r)}}update(e){return e&&this.queue.push(esm_Pe(e)),this}start(e){let{queue:n}=this;return e?n=ht(e).map(esm_Pe):this.queue=[],this._flush?this._flush(this,n):(jt(this,n),esm_ze(this,n))}stop(e,n){if(e!==!!e&&(n=e),n){let r=this.springs;Ve(ht(n),o=>r[o].stop(!!e))}else esm_oe(this._state,this._lastAsyncId),this.each(r=>r.stop(!!e));return this}pause(e){if(esm_l.und(e))this.start({pause:!0});else{let n=this.springs;Ve(ht(e),r=>n[r].pause())}return this}resume(e){if(esm_l.und(e))this.start({pause:!1});else{let n=this.springs;Ve(ht(e),r=>n[r].resume())}return this}each(e){xt(this.springs,e)}_onFrame(){let{onStart:e,onChange:n,onRest:r}=this._events,o=this._active.size>0,s=this._changed.size>0;(o&&!this._started||s&&!this._started)&&(this._started=!0,Pe(e,([u,p])=>{p.value=this.get(),u(p,this,this._item)}));let a=!o&&this._started,i=s||a&&r.size?this.get():null;s&&n.size&&Pe(n,([u,p])=>{p.value=i,u(p,this,this._item)}),a&&(this._started=!1,Pe(r,([u,p])=>{p.value=i,u(p,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;esm_n.onFrame(this._onFrame)}};function esm_ze(t,e){return Promise.all(e.map(n=>wt(t,n))).then(n=>esm_be(t,n))}async function wt(t,e,n){let{keys:r,to:o,from:s,loop:a,onRest:i,onResolve:u}=e,p=esm_l.obj(e.default)&&e.default;a&&(e.loop=!1),o===!1&&(e.to=null),s===!1&&(e.from=null);let f=esm_l.arr(o)||esm_l.fun(o)?o:void 0;f?(e.to=void 0,e.onRest=void 0,p&&(p.onRest=void 0)):Ve(Fn,P=>{let l=e[P];if(esm_l.fun(l)){let h=t._events[P];e[P]=({finished:g,cancelled:x})=>{let S=h.get(l);S?(g||(S.finished=!1),x&&(S.cancelled=!0)):h.set(l,{value:null,finished:g||!1,cancelled:x||!1})},p&&(p[P]=e[P])}});let d=t._state;e.pause===!d.paused?(d.paused=e.pause,yt(e.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(e.pause=!0);let m=(r||Object.keys(t.springs)).map(P=>t.springs[P].start(e)),b=e.cancel===!0||esm_ke(e,"cancel")===!0;(f||b&&d.asyncId)&&m.push(esm_Me(++t._lastAsyncId,{props:e,state:d,actions:{pause:Y,resume:Y,start(P,l){b?(esm_oe(d,t._lastAsyncId),l(esm_q(t))):(P.onRest=i,l(esm_De(f,P,d,t)))}}})),d.paused&&await new Promise(P=>{d.resumeQueue.add(P)});let c=esm_be(t,await Promise.all(m));if(a&&c.finished&&!(n&&c.noop)){let P=at(e,a,o);if(P)return jt(t,[P]),wt(t,P,!0)}return u&&esm_n.batchedUpdates(()=>u(c,t,t.item)),c}function esm_e(t,e){let n={...t.springs};return e&&Ve(ht(e),r=>{esm_l.und(r.keys)&&(r=esm_Pe(r)),esm_l.obj(r.to)||(r={...r,to:void 0}),Mt(n,r,o=>esm_Lt(o))}),pt(t,n),n}function pt(t,e){xt(e,(n,r)=>{t.springs[r]||(t.springs[r]=n,Gt(n,t))})}function esm_Lt(t,e){let n=new esm_ue;return n.key=t,e&&Gt(n,e),n}function Mt(t,e,n){e.keys&&Ve(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function jt(t,e){Ve(e,n=>{Mt(t.springs,n,r=>esm_Lt(r,t))})}var esm_H=({children:t,...e})=>{let n=(0,external_React_.useContext)(esm_Ge),r=e.pause||!!n.pause,o=e.immediate||!!n.immediate;e=Lr(()=>({pause:r,immediate:o}),[r,o]);let{Provider:s}=esm_Ge;return external_React_.createElement(s,{value:e},t)},esm_Ge=wn(esm_H,{});esm_H.Provider=esm_Ge.Provider;esm_H.Consumer=esm_Ge.Consumer;function wn(t,e){return Object.assign(t,external_React_.createContext(e)),t.Provider._context=t,t.Consumer._context=t,t}var esm_fe=()=>{let t=[],e=function(r){er();let o=[];return Ve(t,(s,a)=>{if(esm_l.und(r))o.push(s.start());else{let i=n(r,s,a);i&&o.push(s.start(i))}}),o};e.current=t,e.add=function(r){t.includes(r)||t.push(r)},e.delete=function(r){let o=t.indexOf(r);~o&&t.splice(o,1)},e.pause=function(){return Ve(t,r=>r.pause(...arguments)),this},e.resume=function(){return Ve(t,r=>r.resume(...arguments)),this},e.set=function(r){Ve(t,(o,s)=>{let a=esm_l.fun(r)?r(s,o):r;a&&o.set(a)})},e.start=function(r){let o=[];return Ve(t,(s,a)=>{if(esm_l.und(r))o.push(s.start());else{let i=this._getProps(r,s,a);i&&o.push(s.start(i))}}),o},e.stop=function(){return Ve(t,r=>r.stop(...arguments)),this},e.update=function(r){return Ve(t,(o,s)=>o.update(this._getProps(r,o,s))),this};let n=function(r,o,s){return esm_l.fun(r)?r(s,o):r};return e._getProps=n,e};function esm_He(t,e,n){let r=esm_l.fun(e)&&e;r&&!n&&(n=[]);let o=(0,external_React_.useMemo)(()=>r||arguments.length==3?esm_fe():void 0,[]),s=(0,external_React_.useRef)(0),a=Mr(),i=(0,external_React_.useMemo)(()=>({ctrls:[],queue:[],flush(h,g){let x=esm_e(h,g);return s.current>0&&!i.queue.length&&!Object.keys(x).some(A=>!h.springs[A])?esm_ze(h,g):new Promise(A=>{pt(h,x),i.queue.push(()=>{A(esm_ze(h,g))}),a()})}}),[]),u=(0,external_React_.useRef)([...i.ctrls]),p=[],f=Ur(t)||0;(0,external_React_.useMemo)(()=>{Ve(u.current.slice(t,f),h=>{esm_xe(h,o),h.stop(!0)}),u.current.length=t,d(f,t)},[t]),(0,external_React_.useMemo)(()=>{d(0,Math.min(f,t))},n);function d(h,g){for(let x=h;xesm_e(h,p[g])),b=(0,external_React_.useContext)(esm_H),c=Ur(b),P=b!==c&&esm_Ue(b);esm_Q(()=>{s.current++,i.ctrls=u.current;let{queue:h}=i;h.length&&(i.queue=[],Ve(h,g=>g())),Ve(u.current,(g,x)=>{o?.add(g),P&&g.start({default:b});let S=p[x];S&&(esm_he(g,S.ref),g.ref?g.queue.push(S):g.start(S))})}),$r(()=>()=>{Ve(i.ctrls,h=>h.stop(!0))});let l=m.map(h=>({...h}));return o?[l,o]:l}function esm_J(t,e){let n=esm_l.fun(t),[[r],o]=esm_He(1,n?t:[t],n?e||[]:e);return n||arguments.length==2?[r,o]:r}var Gn=()=>esm_fe(),Xo=()=>zn(Gn)[0];var Wo=(t,e)=>{let n=Bn(()=>new esm_ue(t,e));return Kn(()=>()=>{n.stop()}),n};function esm_Qt(t,e,n){let r=qt.fun(e)&&e;r&&!n&&(n=[]);let o=!0,s,a=esm_He(t,(i,u)=>{let p=r?r(i,u):e;return s=p.ref,o=o&&p.reverse,p},n||[{}]);if(Yn(()=>{Xn(a[1].current,(i,u)=>{let p=a[1].current[u+(o?1:-1)];if(esm_he(i,s),i.ref){p&&i.update({to:p.springs});return}p?i.start({to:p.springs}):i.start()})},n),r||arguments.length==3){let i=s??a[1];return i._getProps=(u,p,f)=>{let d=qt.fun(u)?u(f,p):u;if(d){let m=i.current[f+(d.reverse?1:-1)];return m&&(d.to=m.springs),d}},a}return a[0]}function esm_Gt(t,e,n){let r=G.fun(e)&&e,{reset:o,sort:s,trail:a=0,expires:i=!0,exitBeforeEnter:u=!1,onDestroyed:p,ref:f,config:d}=r?r():e,m=Jn(()=>r||arguments.length==3?esm_fe():void 0,[]),b=zt(t),c=[],P=lt(null),l=o?null:P.current;Je(()=>{P.current=c}),$n(()=>(j(c,y=>{m?.add(y.ctrl),y.ctrl.ref=m}),()=>{j(P.current,y=>{y.expired&&clearTimeout(y.expirationId),esm_xe(y.ctrl,m),y.ctrl.stop(!0)})}));let h=tr(b,r?r():e,l),g=o&&P.current||[];Je(()=>j(g,({ctrl:y,item:T,key:F})=>{esm_xe(y,m),esm_I(p,T,F)}));let x=[];if(l&&j(l,(y,T)=>{y.expired?(clearTimeout(y.expirationId),g.push(y)):(T=x[T]=h.indexOf(y.key),~T&&(c[T]=y))}),j(b,(y,T)=>{c[T]||(c[T]={key:h[T],item:y,phase:"mount",ctrl:new esm_le},c[T].ctrl.item=y)}),x.length){let y=-1,{leave:T}=r?r():e;j(x,(F,k)=>{let O=l[k];~F?(y=c.indexOf(O),c[y]={...O,item:b[F]}):T&&c.splice(++y,0,O)})}G.fun(s)&&c.sort((y,T)=>s(y.item,T.item));let S=-a,A=Wn(),V=dist_esm_ne(e),_=new Map,v=lt(new Map),w=lt(!1);j(c,(y,T)=>{let F=y.key,k=y.phase,O=r?r():e,U,D,Jt=esm_I(O.delay||0,F);if(k=="mount")U=O.enter,D="enter";else{let M=h.indexOf(F)<0;if(k!="leave")if(M)U=O.leave,D="leave";else if(U=O.update)D="update";else return;else if(!M)U=O.enter,D="enter";else return}if(U=esm_I(U,y.item,T),U=G.obj(U)?esm_de(U):{to:U},!U.config){let M=d||V.config;U.config=esm_I(M,y.item,T,D)}S+=a;let Z={...V,delay:Jt+S,ref:f,immediate:O.immediate,reset:!1,...U};if(D=="enter"&&G.und(Z.from)){let M=r?r():e,Te=G.und(M.initial)||l?M.from:M.initial;Z.from=esm_I(Te,y.item,T)}let{onResolve:Wt}=Z;Z.onResolve=M=>{esm_I(Wt,M);let Te=P.current,B=Te.find(Fe=>Fe.key===F);if(!!B&&!(M.cancelled&&B.phase!="update")&&B.ctrl.idle){let Fe=Te.every(ee=>ee.ctrl.idle);if(B.phase=="leave"){let ee=esm_I(i,B.item);if(ee!==!1){let Ze=ee===!0?0:ee;if(B.expired=!0,!Fe&&Ze>0){Ze<=2147483647&&(B.expirationId=setTimeout(A,Ze));return}}}Fe&&Te.some(ee=>ee.expired)&&(v.current.delete(B),u&&(w.current=!0),A())}};let ft=esm_e(y.ctrl,Z);D==="leave"&&u?v.current.set(y,{phase:D,springs:ft,payload:Z}):_.set(y,{phase:D,springs:ft,payload:Z})});let C=Hn(esm_H),$=Zn(C),L=C!==$&&esm_Ue(C);Je(()=>{L&&j(c,y=>{y.ctrl.start({default:C})})},[C]),j(_,(y,T)=>{if(v.current.size){let F=c.findIndex(k=>k.key===T.key);c.splice(F,1)}}),Je(()=>{j(v.current.size?v.current:_,({phase:y,payload:T},F)=>{let{ctrl:k}=F;F.phase=y,m?.add(k),L&&y=="enter"&&k.start({default:C}),T&&(esm_he(k,T.ref),(k.ref||m)&&!w.current?k.update(T):(k.start(T),w.current&&(w.current=!1)))})},o?void 0:n);let N=y=>Oe.createElement(Oe.Fragment,null,c.map((T,F)=>{let{springs:k}=_.get(T)||T.ctrl,O=y({...k},T.item,T,F);return O&&O.type?Oe.createElement(O.type,{...O.props,key:G.str(T.key)||G.num(T.key)?T.key:T.ctrl.id,ref:O.ref}):O}));return m?[N,m]:N}var esm_er=1;function tr(t,{key:e,keys:n=e},r){if(n===null){let o=new Set;return t.map(s=>{let a=r&&r.find(i=>i.item===s&&i.phase!=="leave"&&!o.has(i));return a?(o.add(a),a.key):esm_er++})}return G.und(n)?t:G.fun(n)?t.map(n):zt(n)}var hs=({container:t,...e}={})=>{let[n,r]=esm_J(()=>({scrollX:0,scrollY:0,scrollXProgress:0,scrollYProgress:0,...e}),[]);return or(()=>{let o=rr(({x:s,y:a})=>{r.start({scrollX:s.current,scrollXProgress:s.progress,scrollY:a.current,scrollYProgress:a.progress})},{container:t?.current||void 0});return()=>{nr(Object.values(n),s=>s.stop()),o()}},[]),n};var Ps=({container:t,...e})=>{let[n,r]=esm_J(()=>({width:0,height:0,...e}),[]);return ar(()=>{let o=sr(({width:s,height:a})=>{r.start({width:s,height:a,immediate:n.width.get()===0||n.height.get()===0})},{container:t?.current||void 0});return()=>{ir(Object.values(n),s=>s.stop()),o()}},[]),n};var cr={any:0,all:1};function Cs(t,e){let[n,r]=pr(!1),o=ur(),s=Bt.fun(t)&&t,a=s?s():{},{to:i={},from:u={},...p}=a,f=s?e:t,[d,m]=esm_J(()=>({from:u,...p}),[]);return lr(()=>{let b=o.current,{root:c,once:P,amount:l="any",...h}=f??{};if(!b||P&&n||typeof IntersectionObserver>"u")return;let g=new WeakMap,x=()=>(i&&m.start(i),r(!0),P?void 0:()=>{u&&m.start(u),r(!1)}),S=V=>{V.forEach(_=>{let v=g.get(_.target);if(_.isIntersecting!==Boolean(v))if(_.isIntersecting){let w=x();Bt.fun(w)?g.set(_.target,w):A.unobserve(_.target)}else v&&(v(),g.delete(_.target))})},A=new IntersectionObserver(S,{root:c&&c.current||void 0,threshold:typeof l=="number"||Array.isArray(l)?l:cr[l],...h});return A.observe(b),()=>A.unobserve(b)},[f]),s?[o,d]:[o,n]}function qs({children:t,...e}){return t(esm_J(e))}function Bs({items:t,children:e,...n}){let r=esm_Qt(t.length,n);return t.map((o,s)=>{let a=e(o,s);return fr.fun(a)?a(r[s]):a})}function Ys({items:t,children:e,...n}){return esm_Gt(t,n)(e)}var esm_W=class extends esm_X{constructor(n,r){super();this.source=n;this.calc=W(...r);let o=this._get(),s=esm_Le(o);esm_D(this,s.create(o))}key;idle=!0;calc;_active=new Set;advance(n){let r=this._get(),o=this.get();bt(r,o)||(esm_k(this).setValue(r),this._onChange(r,this.idle)),!this.idle&&Yt(this._active)&&ct(this)}_get(){let n=esm_l.arr(this.source)?this.source.map(ve):ht(ve(this.source));return this.calc(...n)}_start(){this.idle&&!Yt(this._active)&&(this.idle=!1,Ve(F(this),n=>{n.done=!1}),esm_p.skipAnimation?(esm_n.batchedUpdates(()=>this.advance()),ct(this)):qe.start(this))}_attach(){let n=1;Ve(ht(this.source),r=>{Pt(r)&&Gt(r,this),esm_Re(r)&&(r.idle||this._active.add(r),n=Math.max(n,r.priority+1))}),this.priority=n,this._start()}_detach(){Ve(ht(this.source),n=>{Pt(n)&&Qt(n,this)}),this._active.clear(),ct(this)}eventObserved(n){n.type=="change"?n.idle?this.advance():(this._active.add(n.parent),this._start()):n.type=="idle"?this._active.delete(n.parent):n.type=="priority"&&(this.priority=ht(this.source).reduce((r,o)=>Math.max(r,(esm_Re(o)?o.priority:0)+1),0))}};function vr(t){return t.idle!==!1}function Yt(t){return!t.size||Array.from(t).every(vr)}function ct(t){t.idle||(t.idle=!0,Ve(F(t),e=>{e.done=!0}),$t(t,{type:"idle",parent:t}))}var esm_ui=(t,...e)=>new esm_W(t,e),pi=(t,...e)=>(Cr(),new esm_W(t,e));esm_p.assign({createStringInterpolator:Xt,to:(t,e)=>new esm_W(t,e)});var di=qe.advance; +function esm_I(t,...e){return esm_l.fun(t)?t(...e):t}var esm_te=(t,e)=>t===!0||!!(e&&t&&(esm_l.fun(t)?t(e):ht(t).includes(e))),et=(t,e)=>esm_l.obj(t)?e&&t[e]:t;var esm_ke=(t,e)=>t.default===!0?t[e]:t.default?t.default[e]:void 0,nn=t=>t,dist_esm_ne=(t,e=nn)=>{let n=rn;t.default&&t.default!==!0&&(t=t.default,n=Object.keys(t));let r={};for(let o of n){let s=e(t[o],o);esm_l.und(s)||(r[o]=s)}return r},rn=["config","onProps","onStart","onChange","onPause","onResume","onRest"],on={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function sn(t){let e={},n=0;if(xt(t,(r,o)=>{on[o]||(e[o]=r,n++)}),n)return e}function esm_de(t){let e=sn(t);if(e){let n={to:e};return xt(t,(r,o)=>o in e||(n[o]=r)),n}return{...t}}function esm_me(t){return t=ve(t),esm_l.arr(t)?t.map(esm_me):esm_or(t)?esm_p.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function esm_Ue(t){for(let e in t)return!0;return!1}function esm_Ee(t){return esm_l.fun(t)||esm_l.arr(t)&&esm_l.obj(t[0])}function esm_xe(t,e){t.ref?.delete(t),e?.delete(t)}function esm_he(t,e){e&&t.ref!==e&&(t.ref?.delete(t),e.add(t),t.ref=e)}function wr(t,e,n=1e3){an(()=>{if(e){let r=0;ge(t,(o,s)=>{let i=o.current;if(i.length){let a=n*e[s];isNaN(a)?a=r:r=a,ge(i,u=>{ge(u.queue,p=>{let f=p.delay;p.delay=d=>a+esm_I(f||0,d)})}),o.start()}})}else{let r=Promise.resolve();ge(t,o=>{let s=o.current;if(s.length){let i=s.map(a=>{let u=a.queue;return a.queue=[],u});r=r.then(()=>(ge(s,(a,u)=>ge(i[u]||[],p=>a.queue.push(p))),Promise.all(o.start())))}})}})}var esm_mt={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}};var tt={...esm_mt.default,mass:1,damping:1,easing:Lt.linear,clamp:!1},esm_we=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,tt)}};function gt(t,e,n){n&&(n={...n},esm_ht(n,e),e={...n,...e}),esm_ht(t,e),Object.assign(t,e);for(let i in tt)t[i]==null&&(t[i]=tt[i]);let{frequency:r,damping:o}=t,{mass:s}=t;return esm_l.und(r)||(r<.01&&(r=.01),o<0&&(o=0),t.tension=Math.pow(2*Math.PI/r,2)*s,t.friction=4*Math.PI*o*s/r),t}function esm_ht(t,e){if(!esm_l.und(e.decay))t.duration=void 0;else{let n=!esm_l.und(e.tension)||!esm_l.und(e.friction);(n||!esm_l.und(e.frequency)||!esm_l.und(e.damping)||!esm_l.und(e.mass))&&(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}}var esm_yt=[],dist_esm_Le=class{changed=!1;values=esm_yt;toValues=null;fromValues=esm_yt;to;from;config=new esm_we;immediate=!1};function esm_Me(t,{key:e,props:n,defaultProps:r,state:o,actions:s}){return new Promise((i,a)=>{let u,p,f=esm_te(n.cancel??r?.cancel,e);if(f)b();else{esm_l.und(n.pause)||(o.paused=esm_te(n.pause,e));let c=r?.pause;c!==!0&&(c=o.paused||esm_te(c,e)),u=esm_I(n.delay||0,e),c?(o.resumeQueue.add(m),s.pause()):(s.resume(),m())}function d(){o.resumeQueue.add(m),o.timeouts.delete(p),p.cancel(),u=p.time-esm_n.now()}function m(){u>0&&!esm_p.skipAnimation?(o.delayed=!0,p=esm_n.setTimeout(b,u),o.pauseQueue.add(d),o.timeouts.add(p)):b()}function b(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(d),o.timeouts.delete(p),t<=(o.cancelId||0)&&(f=!0);try{s.start({...n,callId:t,cancel:f},i)}catch(c){a(c)}}})}var esm_be=(t,e)=>e.length==1?e[0]:e.some(n=>n.cancelled)?esm_q(t.get()):e.every(n=>n.noop)?nt(t.get()):esm_E(t.get(),e.every(n=>n.finished)),nt=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),esm_E=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),esm_q=t=>({value:t,cancelled:!0,finished:!1});function esm_De(t,e,n,r){let{callId:o,parentId:s,onRest:i}=e,{asyncTo:a,promise:u}=n;return!s&&t===a&&!e.reset?u:n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;let p=dist_esm_ne(e,(l,h)=>h==="onRest"?void 0:l),f,d,m=new Promise((l,h)=>(f=l,d=h)),b=l=>{let h=o<=(n.cancelId||0)&&esm_q(r)||o!==n.asyncId&&esm_E(r,!1);if(h)throw l.result=h,d(l),l},c=(l,h)=>{let g=new esm_Ae,x=new esm_Ne;return(async()=>{if(esm_p.skipAnimation)throw esm_oe(n),x.result=esm_E(r,!1),d(x),x;b(g);let S=esm_l.obj(l)?{...l}:{...h,to:l};S.parentId=o,xt(p,(V,_)=>{esm_l.und(S[_])&&(S[_]=V)});let A=await r.start(S);return b(g),n.paused&&await new Promise(V=>{n.resumeQueue.add(V)}),A})()},P;if(esm_p.skipAnimation)return esm_oe(n),esm_E(r,!1);try{let l;esm_l.arr(t)?l=(async h=>{for(let g of h)await c(g)})(t):l=Promise.resolve(t(c,r.stop.bind(r))),await Promise.all([l.then(f),m]),P=esm_E(r.get(),!0,!1)}catch(l){if(l instanceof esm_Ae)P=l.result;else if(l instanceof esm_Ne)P=l.result;else throw l}finally{o==n.asyncId&&(n.asyncId=s,n.asyncTo=s?a:void 0,n.promise=s?u:void 0)}return esm_l.fun(i)&&esm_n.batchedUpdates(()=>{i(P,r,r.item)}),P})()}function esm_oe(t,e){Pe(t.timeouts,n=>n.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}var esm_Ae=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},esm_Ne=class extends Error{result;constructor(){super("SkipAnimationSignal")}};var esm_Re=t=>t instanceof esm_X,Sn=1,esm_X=class extends esm_ge{id=Sn++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=esm_k(this);return e&&e.getValue()}to(...e){return esm_p.to(this,e)}interpolate(...e){return Jt(),esm_p.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,n=!1){$t(this,{type:"change",parent:this,value:e,idle:n})}_onPriorityChange(e){this.idle||qe.sort(this),$t(this,{type:"priority",parent:this,priority:e})}};var esm_se=Symbol.for("SpringPhase"),esm_bt=1,rt=2,ot=4,esm_qe=t=>(t[esm_se]&esm_bt)>0,dist_esm_Q=t=>(t[esm_se]&rt)>0,esm_ye=t=>(t[esm_se]&ot)>0,st=(t,e)=>e?t[esm_se]|=rt|esm_bt:t[esm_se]&=~rt,esm_it=(t,e)=>e?t[esm_se]|=ot:t[esm_se]&=~ot;var esm_ue=class extends esm_X{key;animation=new dist_esm_Le;queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,n){if(super(),!esm_l.und(e)||!esm_l.und(n)){let r=esm_l.obj(e)?{...e}:{...n,from:e};esm_l.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(dist_esm_Q(this)||this._state.asyncTo)||esm_ye(this)}get goal(){return ve(this.animation.to)}get velocity(){let e=esm_k(this);return e instanceof dist_esm_l?e.lastVelocity||0:e.getPayload().map(n=>n.lastVelocity||0)}get hasAnimated(){return esm_qe(this)}get isAnimating(){return dist_esm_Q(this)}get isPaused(){return esm_ye(this)}get isDelayed(){return this._state.delayed}advance(e){let n=!0,r=!1,o=this.animation,{toValues:s}=o,{config:i}=o,a=F(o.to);!a&&Pt(o.to)&&(s=ht(ve(o.to))),o.values.forEach((f,d)=>{if(f.done)return;let m=f.constructor==dist_esm_d?1:a?a[d].lastPosition:s[d],b=o.immediate,c=m;if(!b){if(c=f.lastPosition,i.tension<=0){f.done=!0;return}let P=f.elapsedTime+=e,l=o.fromValues[d],h=f.v0!=null?f.v0:f.v0=esm_l.arr(i.velocity)?i.velocity[d]:i.velocity,g,x=i.precision||(l==m?.005:Math.min(1,Math.abs(m-l)*.001));if(esm_l.und(i.duration))if(i.decay){let S=i.decay===!0?.998:i.decay,A=Math.exp(-(1-S)*P);c=l+h/(1-S)*(1-A),b=Math.abs(f.lastPosition-c)<=x,g=h*A}else{g=f.lastVelocity==null?h:f.lastVelocity;let S=i.restVelocity||x/10,A=i.clamp?0:i.bounce,V=!esm_l.und(A),_=l==m?f.v0>0:lS,!(!v&&(b=Math.abs(m-c)<=x,b)));++L){V&&(w=c==m||c>m==_,w&&(g=-g*A,c=m));let N=-i.tension*1e-6*(c-m),y=-i.friction*.001*g,T=(N+y)/i.mass;g=g+T*C,c=c+g*C}}else{let S=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,f.durationProgress>0&&(f.elapsedTime=i.duration*f.durationProgress,P=f.elapsedTime+=e)),S=(i.progress||0)+P/this._memoizedDuration,S=S>1?1:S<0?0:S,f.durationProgress=S),c=l+i.easing(S)*(m-l),g=(c-f.lastPosition)/e,b=S==1}f.lastVelocity=g,Number.isNaN(c)&&(console.warn("Got NaN while animating:",this),b=!0)}a&&!a[d].done&&(b=!1),b?f.done=!0:n=!1,f.setValue(c,i.round)&&(r=!0)});let u=esm_k(this),p=u.getValue();if(n){let f=ve(o.to);(p!==f||r)&&!i.decay?(u.setValue(f),this._onChange(f)):r&&i.decay&&this._onChange(p),this._stop()}else r&&this._onChange(p)}set(e){return esm_n.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(dist_esm_Q(this)){let{to:e,config:n}=this.animation;esm_n.batchedUpdates(()=>{this._onStart(),n.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,n){let r;return esm_l.und(e)?(r=this.queue||[],this.queue=[]):r=[esm_l.obj(e)?e:{...n,to:e}],Promise.all(r.map(o=>this._update(o))).then(o=>esm_be(this,o))}stop(e){let{to:n}=this.animation;return this._focus(this.get()),esm_oe(this._state,e&&this._lastCallId),esm_n.batchedUpdates(()=>this._stop(n,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){let n=this.key||"",{to:r,from:o}=e;r=esm_l.obj(r)?r[n]:r,(r==null||esm_Ee(r))&&(r=void 0),o=esm_l.obj(o)?o[n]:o,o==null&&(o=void 0);let s={to:r,from:o};return esm_qe(this)||(e.reverse&&([r,o]=[o,r]),o=ve(o),esm_l.und(o)?esm_k(this)||this._set(r):this._set(o)),s}_update({...e},n){let{key:r,defaultProps:o}=this;e.default&&Object.assign(o,dist_esm_ne(e,(a,u)=>/^on/.test(u)?et(a,r):a)),_t(this,e,"onProps"),esm_Ie(this,"onProps",e,this);let s=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let i=this._state;return esm_Me(++this._lastCallId,{key:r,props:e,defaultProps:o,state:i,actions:{pause:()=>{esm_ye(this)||(esm_it(this,!0),yt(i.pauseQueue),esm_Ie(this,"onPause",esm_E(this,esm_Ce(this,this.animation.to)),this))},resume:()=>{esm_ye(this)&&(esm_it(this,!1),dist_esm_Q(this)&&this._resume(),yt(i.resumeQueue),esm_Ie(this,"onResume",esm_E(this,esm_Ce(this,this.animation.to)),this))},start:this._merge.bind(this,s)}}).then(a=>{if(e.loop&&a.finished&&!(n&&a.noop)){let u=at(e);if(u)return this._update(u,!0)}return a})}_merge(e,n,r){if(n.cancel)return this.stop(!0),r(esm_q(this));let o=!esm_l.und(e.to),s=!esm_l.und(e.from);if(o||s)if(n.callId>this._lastToId)this._lastToId=n.callId;else return r(esm_q(this));let{key:i,defaultProps:a,animation:u}=this,{to:p,from:f}=u,{to:d=p,from:m=f}=e;s&&!o&&(!n.default||esm_l.und(d))&&(d=m),n.reverse&&([d,m]=[m,d]);let b=!bt(m,f);b&&(u.from=m),m=ve(m);let c=!bt(d,p);c&&this._focus(d);let P=esm_Ee(n.to),{config:l}=u,{decay:h,velocity:g}=l;(o||s)&&(l.velocity=0),n.config&&!P&>(l,esm_I(n.config,i),n.config!==a.config?esm_I(a.config,i):void 0);let x=esm_k(this);if(!x||esm_l.und(d))return r(esm_E(this,!0));let S=esm_l.und(n.reset)?s&&!n.default:!esm_l.und(m)&&esm_te(n.reset,i),A=S?m:this.get(),V=esm_me(d),_=esm_l.num(V)||esm_l.arr(V)||esm_or(V),v=!P&&(!_||esm_te(a.immediate||n.immediate,i));if(c){let L=esm_Le(d);if(L!==x.constructor)if(v)x=this._set(V);else throw Error(`Cannot animate between ${x.constructor.name} and ${L.name}, as the "to" prop suggests`)}let w=x.constructor,C=Pt(d),$=!1;if(!C){let L=S||!esm_qe(this)&&b;(c||L)&&($=bt(esm_me(A),V),C=!$),(!bt(u.immediate,v)&&!v||!bt(l.decay,h)||!bt(l.velocity,g))&&(C=!0)}if($&&dist_esm_Q(this)&&(u.changed&&!S?C=!0:C||this._stop(p)),!P&&((C||Pt(p))&&(u.values=x.getPayload(),u.toValues=Pt(d)?null:w==dist_esm_d?[1]:ht(V)),u.immediate!=v&&(u.immediate=v,!v&&!S&&this._set(p)),C)){let{onRest:L}=u;Ve(_n,y=>_t(this,n,y));let N=esm_E(this,esm_Ce(this,p));yt(this._pendingCalls,N),this._pendingCalls.add(r),u.changed&&esm_n.batchedUpdates(()=>{u.changed=!S,L?.(N,this),S?esm_I(a.onRest,N):u.onStart?.(N,this)})}S&&this._set(A),P?r(esm_De(n.to,n,this._state,this)):C?this._start():dist_esm_Q(this)&&!c?this._pendingCalls.add(r):r(nt(A))}_focus(e){let n=this.animation;e!==n.to&&(esm_qt(this)&&this._detach(),n.to=e,esm_qt(this)&&this._attach())}_attach(){let e=0,{to:n}=this.animation;Pt(n)&&(Gt(n,this),esm_Re(n)&&(e=n.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Pt(e)&&Qt(e,this)}_set(e,n=!0){let r=ve(e);if(!esm_l.und(r)){let o=esm_k(this);if(!o||!bt(r,o.getValue())){let s=esm_Le(r);!o||o.constructor!=s?esm_D(this,s.create(r)):o.setValue(r),o&&esm_n.batchedUpdates(()=>{this._onChange(r,n)})}}return esm_k(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,esm_Ie(this,"onStart",esm_E(this,esm_Ce(this,e.to)),this))}_onChange(e,n){n||(this._onStart(),esm_I(this.animation.onChange,e,this)),esm_I(this.defaultProps.onChange,e,this),super._onChange(e,n)}_start(){let e=this.animation;esm_k(this).reset(ve(e.to)),e.immediate||(e.fromValues=e.values.map(n=>n.lastPosition)),dist_esm_Q(this)||(st(this,!0),esm_ye(this)||this._resume())}_resume(){esm_p.skipAnimation?this.finish():qe.start(this)}_stop(e,n){if(dist_esm_Q(this)){st(this,!1);let r=this.animation;Ve(r.values,s=>{s.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),$t(this,{type:"idle",parent:this});let o=n?esm_q(this.get()):esm_E(this.get(),esm_Ce(this,e??r.to));yt(this._pendingCalls,o),r.changed&&(r.changed=!1,esm_Ie(this,"onRest",o,this))}}};function esm_Ce(t,e){let n=esm_me(e),r=esm_me(t.get());return bt(r,n)}function at(t,e=t.loop,n=t.to){let r=esm_I(e);if(r){let o=r!==!0&&esm_de(r),s=(o||t).reverse,i=!o||o.reset;return esm_Pe({...t,loop:e,default:!1,pause:void 0,to:!s||esm_Ee(n)?n:void 0,from:i?t.from:void 0,reset:i,...o})}}function esm_Pe(t){let{to:e,from:n}=t=esm_de(t),r=new Set;return esm_l.obj(e)&&Vt(e,r),esm_l.obj(n)&&Vt(n,r),t.keys=r.size?Array.from(r):null,t}function Ot(t){let e=esm_Pe(t);return esm_l.und(e.default)&&(e.default=dist_esm_ne(e)),e}function Vt(t,e){xt(t,(n,r)=>n!=null&&e.add(r))}var _n=["onStart","onRest","onChange","onPause","onResume"];function _t(t,e,n){t.animation[n]=e[n]!==esm_ke(e,n)?et(e[n],t.key):void 0}function esm_Ie(t,e,...n){t.animation[e]?.(...n),t.defaultProps[e]?.(...n)}var Fn=["onStart","onChange","onRest"],kn=1,esm_le=class{id=kn++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,n){this._onFrame=this._onFrame.bind(this),n&&(this._flush=n),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each((n,r)=>e[r]=n.get()),e}set(e){for(let n in e){let r=e[n];esm_l.und(r)||this.springs[n].set(r)}}update(e){return e&&this.queue.push(esm_Pe(e)),this}start(e){let{queue:n}=this;return e?n=ht(e).map(esm_Pe):this.queue=[],this._flush?this._flush(this,n):(jt(this,n),esm_ze(this,n))}stop(e,n){if(e!==!!e&&(n=e),n){let r=this.springs;Ve(ht(n),o=>r[o].stop(!!e))}else esm_oe(this._state,this._lastAsyncId),this.each(r=>r.stop(!!e));return this}pause(e){if(esm_l.und(e))this.start({pause:!0});else{let n=this.springs;Ve(ht(e),r=>n[r].pause())}return this}resume(e){if(esm_l.und(e))this.start({pause:!1});else{let n=this.springs;Ve(ht(e),r=>n[r].resume())}return this}each(e){xt(this.springs,e)}_onFrame(){let{onStart:e,onChange:n,onRest:r}=this._events,o=this._active.size>0,s=this._changed.size>0;(o&&!this._started||s&&!this._started)&&(this._started=!0,Pe(e,([u,p])=>{p.value=this.get(),u(p,this,this._item)}));let i=!o&&this._started,a=s||i&&r.size?this.get():null;s&&n.size&&Pe(n,([u,p])=>{p.value=a,u(p,this,this._item)}),i&&(this._started=!1,Pe(r,([u,p])=>{p.value=a,u(p,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;esm_n.onFrame(this._onFrame)}};function esm_ze(t,e){return Promise.all(e.map(n=>wt(t,n))).then(n=>esm_be(t,n))}async function wt(t,e,n){let{keys:r,to:o,from:s,loop:i,onRest:a,onResolve:u}=e,p=esm_l.obj(e.default)&&e.default;i&&(e.loop=!1),o===!1&&(e.to=null),s===!1&&(e.from=null);let f=esm_l.arr(o)||esm_l.fun(o)?o:void 0;f?(e.to=void 0,e.onRest=void 0,p&&(p.onRest=void 0)):Ve(Fn,P=>{let l=e[P];if(esm_l.fun(l)){let h=t._events[P];e[P]=({finished:g,cancelled:x})=>{let S=h.get(l);S?(g||(S.finished=!1),x&&(S.cancelled=!0)):h.set(l,{value:null,finished:g||!1,cancelled:x||!1})},p&&(p[P]=e[P])}});let d=t._state;e.pause===!d.paused?(d.paused=e.pause,yt(e.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(e.pause=!0);let m=(r||Object.keys(t.springs)).map(P=>t.springs[P].start(e)),b=e.cancel===!0||esm_ke(e,"cancel")===!0;(f||b&&d.asyncId)&&m.push(esm_Me(++t._lastAsyncId,{props:e,state:d,actions:{pause:Y,resume:Y,start(P,l){b?(esm_oe(d,t._lastAsyncId),l(esm_q(t))):(P.onRest=a,l(esm_De(f,P,d,t)))}}})),d.paused&&await new Promise(P=>{d.resumeQueue.add(P)});let c=esm_be(t,await Promise.all(m));if(i&&c.finished&&!(n&&c.noop)){let P=at(e,i,o);if(P)return jt(t,[P]),wt(t,P,!0)}return u&&esm_n.batchedUpdates(()=>u(c,t,t.item)),c}function esm_e(t,e){let n={...t.springs};return e&&Ve(ht(e),r=>{esm_l.und(r.keys)&&(r=esm_Pe(r)),esm_l.obj(r.to)||(r={...r,to:void 0}),Mt(n,r,o=>esm_Lt(o))}),pt(t,n),n}function pt(t,e){xt(e,(n,r)=>{t.springs[r]||(t.springs[r]=n,Gt(n,t))})}function esm_Lt(t,e){let n=new esm_ue;return n.key=t,e&&Gt(n,e),n}function Mt(t,e,n){e.keys&&Ve(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function jt(t,e){Ve(e,n=>{Mt(t.springs,n,r=>esm_Lt(r,t))})}var esm_H=({children:t,...e})=>{let n=(0,external_React_.useContext)(esm_Ge),r=e.pause||!!n.pause,o=e.immediate||!!n.immediate;e=Lr(()=>({pause:r,immediate:o}),[r,o]);let{Provider:s}=esm_Ge;return external_React_.createElement(s,{value:e},t)},esm_Ge=wn(esm_H,{});esm_H.Provider=esm_Ge.Provider;esm_H.Consumer=esm_Ge.Consumer;function wn(t,e){return Object.assign(t,external_React_.createContext(e)),t.Provider._context=t,t.Consumer._context=t,t}var esm_fe=()=>{let t=[],e=function(r){er();let o=[];return Ve(t,(s,i)=>{if(esm_l.und(r))o.push(s.start());else{let a=n(r,s,i);a&&o.push(s.start(a))}}),o};e.current=t,e.add=function(r){t.includes(r)||t.push(r)},e.delete=function(r){let o=t.indexOf(r);~o&&t.splice(o,1)},e.pause=function(){return Ve(t,r=>r.pause(...arguments)),this},e.resume=function(){return Ve(t,r=>r.resume(...arguments)),this},e.set=function(r){Ve(t,(o,s)=>{let i=esm_l.fun(r)?r(s,o):r;i&&o.set(i)})},e.start=function(r){let o=[];return Ve(t,(s,i)=>{if(esm_l.und(r))o.push(s.start());else{let a=this._getProps(r,s,i);a&&o.push(s.start(a))}}),o},e.stop=function(){return Ve(t,r=>r.stop(...arguments)),this},e.update=function(r){return Ve(t,(o,s)=>o.update(this._getProps(r,o,s))),this};let n=function(r,o,s){return esm_l.fun(r)?r(s,o):r};return e._getProps=n,e};function esm_He(t,e,n){let r=esm_l.fun(e)&&e;r&&!n&&(n=[]);let o=(0,external_React_.useMemo)(()=>r||arguments.length==3?esm_fe():void 0,[]),s=(0,external_React_.useRef)(0),i=Mr(),a=(0,external_React_.useMemo)(()=>({ctrls:[],queue:[],flush(h,g){let x=esm_e(h,g);return s.current>0&&!a.queue.length&&!Object.keys(x).some(A=>!h.springs[A])?esm_ze(h,g):new Promise(A=>{pt(h,x),a.queue.push(()=>{A(esm_ze(h,g))}),i()})}}),[]),u=(0,external_React_.useRef)([...a.ctrls]),p=[],f=Ur(t)||0;(0,external_React_.useMemo)(()=>{Ve(u.current.slice(t,f),h=>{esm_xe(h,o),h.stop(!0)}),u.current.length=t,d(f,t)},[t]),(0,external_React_.useMemo)(()=>{d(0,Math.min(f,t))},n);function d(h,g){for(let x=h;xesm_e(h,p[g])),b=(0,external_React_.useContext)(esm_H),c=Ur(b),P=b!==c&&esm_Ue(b);esm_Q(()=>{s.current++,a.ctrls=u.current;let{queue:h}=a;h.length&&(a.queue=[],Ve(h,g=>g())),Ve(u.current,(g,x)=>{o?.add(g),P&&g.start({default:b});let S=p[x];S&&(esm_he(g,S.ref),g.ref?g.queue.push(S):g.start(S))})}),$r(()=>()=>{Ve(a.ctrls,h=>h.stop(!0))});let l=m.map(h=>({...h}));return o?[l,o]:l}function esm_J(t,e){let n=esm_l.fun(t),[[r],o]=esm_He(1,n?t:[t],n?e||[]:e);return n||arguments.length==2?[r,o]:r}var Gn=()=>esm_fe(),Xo=()=>zn(Gn)[0];var Wo=(t,e)=>{let n=Bn(()=>new esm_ue(t,e));return Kn(()=>()=>{n.stop()}),n};function esm_Qt(t,e,n){let r=qt.fun(e)&&e;r&&!n&&(n=[]);let o=!0,s,i=esm_He(t,(a,u)=>{let p=r?r(a,u):e;return s=p.ref,o=o&&p.reverse,p},n||[{}]);if(Yn(()=>{Xn(i[1].current,(a,u)=>{let p=i[1].current[u+(o?1:-1)];if(esm_he(a,s),a.ref){p&&a.update({to:p.springs});return}p?a.start({to:p.springs}):a.start()})},n),r||arguments.length==3){let a=s??i[1];return a._getProps=(u,p,f)=>{let d=qt.fun(u)?u(f,p):u;if(d){let m=a.current[f+(d.reverse?1:-1)];return m&&(d.to=m.springs),d}},i}return i[0]}function esm_Gt(t,e,n){let r=G.fun(e)&&e,{reset:o,sort:s,trail:i=0,expires:a=!0,exitBeforeEnter:u=!1,onDestroyed:p,ref:f,config:d}=r?r():e,m=Jn(()=>r||arguments.length==3?esm_fe():void 0,[]),b=zt(t),c=[],P=lt(null),l=o?null:P.current;Je(()=>{P.current=c}),$n(()=>(j(c,y=>{m?.add(y.ctrl),y.ctrl.ref=m}),()=>{j(P.current,y=>{y.expired&&clearTimeout(y.expirationId),esm_xe(y.ctrl,m),y.ctrl.stop(!0)})}));let h=tr(b,r?r():e,l),g=o&&P.current||[];Je(()=>j(g,({ctrl:y,item:T,key:F})=>{esm_xe(y,m),esm_I(p,T,F)}));let x=[];if(l&&j(l,(y,T)=>{y.expired?(clearTimeout(y.expirationId),g.push(y)):(T=x[T]=h.indexOf(y.key),~T&&(c[T]=y))}),j(b,(y,T)=>{c[T]||(c[T]={key:h[T],item:y,phase:"mount",ctrl:new esm_le},c[T].ctrl.item=y)}),x.length){let y=-1,{leave:T}=r?r():e;j(x,(F,k)=>{let O=l[k];~F?(y=c.indexOf(O),c[y]={...O,item:b[F]}):T&&c.splice(++y,0,O)})}G.fun(s)&&c.sort((y,T)=>s(y.item,T.item));let S=-i,A=Wn(),V=dist_esm_ne(e),_=new Map,v=lt(new Map),w=lt(!1);j(c,(y,T)=>{let F=y.key,k=y.phase,O=r?r():e,U,D,Jt=esm_I(O.delay||0,F);if(k=="mount")U=O.enter,D="enter";else{let M=h.indexOf(F)<0;if(k!="leave")if(M)U=O.leave,D="leave";else if(U=O.update)D="update";else return;else if(!M)U=O.enter,D="enter";else return}if(U=esm_I(U,y.item,T),U=G.obj(U)?esm_de(U):{to:U},!U.config){let M=d||V.config;U.config=esm_I(M,y.item,T,D)}S+=i;let Z={...V,delay:Jt+S,ref:f,immediate:O.immediate,reset:!1,...U};if(D=="enter"&&G.und(Z.from)){let M=r?r():e,Te=G.und(M.initial)||l?M.from:M.initial;Z.from=esm_I(Te,y.item,T)}let{onResolve:Wt}=Z;Z.onResolve=M=>{esm_I(Wt,M);let Te=P.current,B=Te.find(Fe=>Fe.key===F);if(B&&!(M.cancelled&&B.phase!="update")&&B.ctrl.idle){let Fe=Te.every(ee=>ee.ctrl.idle);if(B.phase=="leave"){let ee=esm_I(a,B.item);if(ee!==!1){let Ze=ee===!0?0:ee;if(B.expired=!0,!Fe&&Ze>0){Ze<=2147483647&&(B.expirationId=setTimeout(A,Ze));return}}}Fe&&Te.some(ee=>ee.expired)&&(v.current.delete(B),u&&(w.current=!0),A())}};let ft=esm_e(y.ctrl,Z);D==="leave"&&u?v.current.set(y,{phase:D,springs:ft,payload:Z}):_.set(y,{phase:D,springs:ft,payload:Z})});let C=Hn(esm_H),$=Zn(C),L=C!==$&&esm_Ue(C);Je(()=>{L&&j(c,y=>{y.ctrl.start({default:C})})},[C]),j(_,(y,T)=>{if(v.current.size){let F=c.findIndex(k=>k.key===T.key);c.splice(F,1)}}),Je(()=>{j(v.current.size?v.current:_,({phase:y,payload:T},F)=>{let{ctrl:k}=F;F.phase=y,m?.add(k),L&&y=="enter"&&k.start({default:C}),T&&(esm_he(k,T.ref),(k.ref||m)&&!w.current?k.update(T):(k.start(T),w.current&&(w.current=!1)))})},o?void 0:n);let N=y=>Oe.createElement(Oe.Fragment,null,c.map((T,F)=>{let{springs:k}=_.get(T)||T.ctrl,O=y({...k},T.item,T,F);return O&&O.type?Oe.createElement(O.type,{...O.props,key:G.str(T.key)||G.num(T.key)?T.key:T.ctrl.id,ref:O.ref}):O}));return m?[N,m]:N}var esm_er=1;function tr(t,{key:e,keys:n=e},r){if(n===null){let o=new Set;return t.map(s=>{let i=r&&r.find(a=>a.item===s&&a.phase!=="leave"&&!o.has(a));return i?(o.add(i),i.key):esm_er++})}return G.und(n)?t:G.fun(n)?t.map(n):zt(n)}var hs=({container:t,...e}={})=>{let[n,r]=esm_J(()=>({scrollX:0,scrollY:0,scrollXProgress:0,scrollYProgress:0,...e}),[]);return or(()=>{let o=rr(({x:s,y:i})=>{r.start({scrollX:s.current,scrollXProgress:s.progress,scrollY:i.current,scrollYProgress:i.progress})},{container:t?.current||void 0});return()=>{nr(Object.values(n),s=>s.stop()),o()}},[]),n};var Ps=({container:t,...e})=>{let[n,r]=esm_J(()=>({width:0,height:0,...e}),[]);return ar(()=>{let o=sr(({width:s,height:i})=>{r.start({width:s,height:i,immediate:n.width.get()===0||n.height.get()===0})},{container:t?.current||void 0});return()=>{ir(Object.values(n),s=>s.stop()),o()}},[]),n};var cr={any:0,all:1};function Cs(t,e){let[n,r]=pr(!1),o=ur(),s=Bt.fun(t)&&t,i=s?s():{},{to:a={},from:u={},...p}=i,f=s?e:t,[d,m]=esm_J(()=>({from:u,...p}),[]);return lr(()=>{let b=o.current,{root:c,once:P,amount:l="any",...h}=f??{};if(!b||P&&n||typeof IntersectionObserver>"u")return;let g=new WeakMap,x=()=>(a&&m.start(a),r(!0),P?void 0:()=>{u&&m.start(u),r(!1)}),S=V=>{V.forEach(_=>{let v=g.get(_.target);if(_.isIntersecting!==!!v)if(_.isIntersecting){let w=x();Bt.fun(w)?g.set(_.target,w):A.unobserve(_.target)}else v&&(v(),g.delete(_.target))})},A=new IntersectionObserver(S,{root:c&&c.current||void 0,threshold:typeof l=="number"||Array.isArray(l)?l:cr[l],...h});return A.observe(b),()=>A.unobserve(b)},[f]),s?[o,d]:[o,n]}function qs({children:t,...e}){return t(esm_J(e))}function Bs({items:t,children:e,...n}){let r=esm_Qt(t.length,n);return t.map((o,s)=>{let i=e(o,s);return fr.fun(i)?i(r[s]):i})}function Ys({items:t,children:e,...n}){return esm_Gt(t,n)(e)}var esm_W=class extends esm_X{constructor(n,r){super();this.source=n;this.calc=W(...r);let o=this._get(),s=esm_Le(o);esm_D(this,s.create(o))}key;idle=!0;calc;_active=new Set;advance(n){let r=this._get(),o=this.get();bt(r,o)||(esm_k(this).setValue(r),this._onChange(r,this.idle)),!this.idle&&Yt(this._active)&&ct(this)}_get(){let n=esm_l.arr(this.source)?this.source.map(ve):ht(ve(this.source));return this.calc(...n)}_start(){this.idle&&!Yt(this._active)&&(this.idle=!1,Ve(F(this),n=>{n.done=!1}),esm_p.skipAnimation?(esm_n.batchedUpdates(()=>this.advance()),ct(this)):qe.start(this))}_attach(){let n=1;Ve(ht(this.source),r=>{Pt(r)&&Gt(r,this),esm_Re(r)&&(r.idle||this._active.add(r),n=Math.max(n,r.priority+1))}),this.priority=n,this._start()}_detach(){Ve(ht(this.source),n=>{Pt(n)&&Qt(n,this)}),this._active.clear(),ct(this)}eventObserved(n){n.type=="change"?n.idle?this.advance():(this._active.add(n.parent),this._start()):n.type=="idle"?this._active.delete(n.parent):n.type=="priority"&&(this.priority=ht(this.source).reduce((r,o)=>Math.max(r,(esm_Re(o)?o.priority:0)+1),0))}};function vr(t){return t.idle!==!1}function Yt(t){return!t.size||Array.from(t).every(vr)}function ct(t){t.idle||(t.idle=!0,Ve(F(t),e=>{e.done=!0}),$t(t,{type:"idle",parent:t}))}var esm_ui=(t,...e)=>new esm_W(t,e),pi=(t,...e)=>(Cr(),new esm_W(t,e));esm_p.assign({createStringInterpolator:Xt,to:(t,e)=>new esm_W(t,e)});var di=qe.advance; ;// CONCATENATED MODULE: external "ReactDOM" var external_ReactDOM_namespaceObject = window["ReactDOM"]; @@ -23922,9 +23923,12 @@ function MobileTabNavigation(_ref2) { - // Preffered order of pattern categories. Any other categories should + + +const block_patterns_tab_noop = () => {}; // Preferred order of pattern categories. Any other categories should // be at the bottom without any re-ordering. + const patternCategoriesOrder = ['featured', 'posts', 'text', 'gallery', 'call-to-action', 'banner', 'header', 'footer']; function usePatternsCategories(rootClientId) { @@ -24007,7 +24011,7 @@ function BlockPatternsCategoryPanel(_ref4) { let { rootClientId, onInsert, - onHover, + onHover = block_patterns_tab_noop, category, showTitlesAsTooltip } = _ref4; @@ -25755,7 +25759,8 @@ class PrivateInserter extends external_wp_element_namespaceObject.Component { 'is-quick': isQuick }), popoverProps: { - position + position, + shift: true }, onToggle: this.onToggle, expandOnMobile: true, @@ -31973,14 +31978,14 @@ const DEFAULT_OPTION = { const STICKY_OPTION = { key: 'sticky', value: 'sticky', - name: (0,external_wp_i18n_namespaceObject.__)('Sticky'), + name: (0,external_wp_i18n_namespaceObject._x)('Sticky', 'Name for the value of the CSS position property'), className: OPTION_CLASSNAME, __experimentalHint: (0,external_wp_i18n_namespaceObject.__)('The block will stick to the top of the window instead of scrolling.') }; const FIXED_OPTION = { key: 'fixed', value: 'fixed', - name: (0,external_wp_i18n_namespaceObject.__)('Fixed'), + name: (0,external_wp_i18n_namespaceObject._x)('Fixed', 'Name for the value of the CSS position property'), className: OPTION_CLASSNAME, __experimentalHint: (0,external_wp_i18n_namespaceObject.__)('The block will not move when the page is scrolled.') }; @@ -49520,15 +49525,18 @@ function useInputRules(props) { return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { function inputRule() { const { - value, + getValue, onReplace, selectionChange } = propsRef.current; if (!onReplace) { return; - } + } // We must use getValue() here because value may be update + // asynchronously. + + const value = getValue(); const { start, text @@ -49573,7 +49581,7 @@ function useInputRules(props) { type } = event; const { - value, + getValue, onChange, __unstableAllowPrefixTransformations, formatTypes @@ -49587,6 +49595,7 @@ function useInputRules(props) { inputRule(); } + const value = getValue(); const transformed = formatTypes.reduce((accumlator, _ref3) => { let { __unstableInputRule @@ -50340,6 +50349,7 @@ function RichTextWrapper(_ref, forwardedRef) { const { value, + getValue, onChange, ref: richTextRef } = (0,external_wp_richText_namespaceObject.__unstableUseRichText)({ @@ -50457,7 +50467,7 @@ function RichTextWrapper(_ref, forwardedRef) { value, onChange }), useInputRules({ - value, + getValue, onChange, __unstableAllowPrefixTransformations, formatTypes, diff --git a/wp-includes/js/dist/block-editor.min.js b/wp-includes/js/dist/block-editor.min.js index be1a0b2d91..9b87dd4f86 100644 --- a/wp-includes/js/dist/block-editor.min.js +++ b/wp-includes/js/dist/block-editor.min.js @@ -23,7 +23,7 @@ * @return {boolean} True if the event is supported. * @internal * @license Modernizr 3.0.0pre (Custom Build) | MIT - */,e.exports=function(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,l=n in document;if(!l){var i=document.createElement("div");i.setAttribute(n,"return;"),l="function"==typeof i[n]}return!l&&o&&"wheel"===e&&(l=document.implementation.hasFeature("Events.wheel","3.0")),l}},195:function(e,t,n){"use strict";var o=n(3812),r=n(7939);function l(e){var t=0,n=0,o=0,r=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),o=10*t,r=10*n,"deltaY"in e&&(r=e.deltaY),"deltaX"in e&&(o=e.deltaX),(o||r)&&e.deltaMode&&(1==e.deltaMode?(o*=40,r*=40):(o*=800,r*=800)),o&&!t&&(t=o<1?-1:1),r&&!n&&(n=r<1?-1:1),{spinX:t,spinY:n,pixelX:o,pixelY:r}}l.getEventType=function(){return o.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=l},5372:function(e,t,n){"use strict";var o=n(9567);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return n.PropTypes=n,n}},2652:function(e,t,n){e.exports=n(5372)()},9567:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),C(r,e.slice(t,t+o),n)}const w=e=>e;function B(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=new Map,o=[];return n.set(t,o),e.forEach((e=>{const{clientId:t,innerBlocks:r}=e;o.push(t),B(r,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function I(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=[],o=[[t,e]];for(;o.length;){const[e,t]=o.shift();t.forEach((t=>{let{innerBlocks:r,...l}=t;n.push([l.clientId,e]),null!=r&&r.length&&o.push([l.clientId,r])}))}return n}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:w;const n=[],o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n.push([r.clientId,t(r)])}return n}function T(e){const t={},n=[...e];for(;n.length;){const{innerBlocks:e,...o}=n.shift();n.push(...e),t[o.clientId]=!0}return t}function M(e){return x(e,(e=>{const{attributes:t,...n}=e;return n}))}function N(e){return x(e,(e=>e.attributes))}function P(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&k()(e.clientIds,t.clientIds)&&function(e,t){return k()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function L(e,t){const n=e.tree,o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n.set(e.clientId,{});for(const t of r)n.set(t.clientId,Object.assign(n.get(t.clientId),{...e.byClientId.get(t.clientId),attributes:e.attributes.get(t.clientId),innerBlocks:t.innerBlocks.map((e=>n.get(e.clientId)))}))}function R(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=e.tree,r=new Set([]),l=new Set;for(const o of t){let t=n?o:e.parents.get(o);do{if(e.controlledInnerBlocks[t]){l.add(t);break}r.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of r)o.set(e,{...o.get(e)});for(const t of r)o.get(t).innerBlocks=(e.order.get(t)||[]).map((e=>o.get(e)));for(const t of l)o.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>o.get(e)))})}const A=(0,m.pipe)(g.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=new Map(t.attributes),t.attributes.forEach(((n,r)=>{const{name:l}=t.byClientId.get(r);"core/block"===l&&n.ref===e&&t.attributes.set(r,{...n,ref:o})}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:new Map,n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":o.tree=new Map(o.tree),L(o,n.blocks),R(o,n.rootClientId?[n.rootClientId]:[""],!0);break;case"UPDATE_BLOCK":o.tree=new Map(o.tree),o.tree.set(n.clientId,{...o.tree.get(n.clientId),...o.byClientId.get(n.clientId),attributes:o.attributes.get(n.clientId)}),R(o,[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":o.tree=new Map(o.tree),n.clientIds.forEach((e=>{o.tree.set(e,{...o.tree.get(e),attributes:o.attributes.get(e)})})),R(o,n.clientIds,!1);break;case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=T(n.blocks);o.tree=new Map(o.tree),n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),L(o,n.blocks),R(o,n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents.get(e)||""!==t.parents.get(e)&&!o.byClientId.get(t.parents.get(e))||r.push(t.parents.get(e));R(o,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents.get(r)||""!==t.parents.get(r)&&!o.byClientId.get(t.parents.get(r))||e.push(t.parents.get(r));o.tree=new Map(o.tree),n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),R(o,e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),o.tree=new Map(o.tree),R(o,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=new Map(o.tree),R(o,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=[];o.attributes.forEach(((t,r)=>{"core/block"===o.byClientId.get(r).name&&t.ref===n.updatedId&&e.push(r)})),o.tree=new Map(o.tree),e.forEach((e=>{o.tree.set(e,{...o.byClientId.get(e),attributes:o.attributes.get(e),innerBlocks:o.tree.get(e).innerBlocks})})),R(o,e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order.get(n.rootClientId)&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order.get(n.rootClientId)}));let l=r;if(n.blocks.length){l=e(l,{...n,type:"INSERT_BLOCKS",index:0});const r=new Map(l.order);Object.keys(o).forEach((e=>{t.order.get(e)&&r.set(e,t.order.get(e))})),l.order=r,l.tree=new Map(l.tree),Object.keys(o).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&l.tree.set(n,t.tree.get(n))}))}return l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(M(n.blocks)),attributes:new Map(N(n.blocks)),order:B(n.blocks),parents:new Map(I(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(null==t?void 0:t.tree),L(e,n.blocks),e.tree.set("",{innerBlocks:n.blocks.map((t=>e.tree.get(t.clientId)))}),e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var a;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(a=null==o?void 0:o.isPersistentChange)||void 0===a||a;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!P(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return M(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;const{attributes:n,...o}=t.updates;if(0===Object.values(o).length)return e;const r=new Map(e);return r.set(t.clientId,{...e.get(t.clientId),...o}),r}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),M(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return N(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"UPDATE_BLOCK":{if(!e.get(t.clientId)||!t.updates.attributes)return e;const n=new Map(e);return n.set(t.clientId,{...e.get(t.clientId),...t.updates.attributes}),n}case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e.get(t))))return e;let o=!1;const r=new Map(e);for(const l of t.clientIds){var n;const i=Object.entries(t.uniqueByBlock?t.attributes[l]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===i.length)continue;let a=!1;const s=e.get(l),c={};i.forEach((e=>{let[t,n]=e;s[t]!==n&&(a=!0,c[t]=n)})),o=o||a,a&&r.set(l,{...s,...c})}return o?r:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),N(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{var n;const o=B(t.blocks),r=new Map(e);return o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.set("",(null!==(n=e.get(""))&&void 0!==n?n:[]).concat(o[""])),r}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e.get(n)||[],r=B(t.blocks,n),{index:l=o.length}=t,i=new Map(e);return r.forEach(((e,t)=>{i.set(t,e)})),i.set(n,C(o,r.get(n),l)),i}case"MOVE_BLOCKS_TO_POSITION":{var o,r;const{fromRootClientId:n="",toRootClientId:l="",clientIds:i}=t,{index:a=e.get(l).length}=t;if(n===l){const t=e.get(l).indexOf(i[0]),n=new Map(e);return n.set(l,S(e.get(l),t,a,i.length)),n}const s=new Map(e);return s.set(n,null!==(o=null===(r=e.get(n))||void 0===r?void 0:r.filter((e=>!i.includes(e))))&&void 0!==o?o:[]),s.set(l,C(e.get(l),i,a)),s}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=e.get(o);if(!l.length||r===l[0])return e;const i=l.indexOf(r),a=new Map(e);return a.set(o,S(l,i,i-1,n.length)),a}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=n[n.length-1],i=e.get(o);if(!i.length||l===i[i.length-1])return e;const a=i.indexOf(r),s=new Map(e);return s.set(o,S(i,a,a+1,n.length)),s}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=B(t.blocks),r=new Map(e);return t.replacedClientIds.forEach((e=>{r.delete(e)})),o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.forEach(((e,t)=>{const l=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...o.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);r.set(t,l)})),r}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,o)=>{var r;const l=null!==(r=null==e?void 0:e.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==r?r:[];l.length!==e.length&&n.set(o,l)})),n}}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return I(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return I(t.blocks,t.rootClientId||"").forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"MOVE_BLOCKS_TO_POSITION":{const n=new Map(e);return t.clientIds.forEach((e=>{n.set(e,t.toRootClientId||"")})),n}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),I(t.blocks,e.get(t.clientIds[0])).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function O(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}var D=(0,g.combineReducers)({blocks:A,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},isBlockInterfaceHidden:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(){var e,t,n,o;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"SELECTION_CHANGE":return l.clientId?{selectionStart:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.startOffset},selectionEnd:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.endOffset}}:{selectionStart:l.start||r.selectionStart,selectionEnd:l.end||r.selectionEnd};case"RESET_SELECTION":const{selectionStart:i,selectionEnd:a}=l;return{selectionStart:i,selectionEnd:a};case"MULTI_SELECT":const{start:s,end:c}=l;return s===(null===(e=r.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=r.selectionEnd)||void 0===t?void 0:t.clientId)?r:{selectionStart:{clientId:s},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==r||null===(n=r.selectionStart)||void 0===n?void 0:n.clientId,d=null==r||null===(o=r.selectionEnd)||void 0===o?void 0:o.clientId;if(!u&&!d)return r;if(!l.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!l.blocks.some((e=>e.clientId===d)))return{...r,selectionEnd:r.selectionStart}}return{selectionStart:O(r.selectionStart,l),selectionEnd:O(r.selectionEnd,l)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return Object.fromEntries(Object.entries(e).filter((e=>{let[n]=e;return!t.clientIds.includes(n)})));case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;if(!t.settings){if(e.hasOwnProperty(n)){const{[n]:t,...o}=e;return o}return e}return k()(e[n],t.settings)?e:{...e,[n]:t.settings}}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:o,__unstableWithInserter:r,operation:l}=t,i={rootClientId:n,index:o,__unstableWithInserter:r,operation:l};return k()(e,i)?e:i}case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:E,t=arguments.length>1?arguments[1]:void 0;return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:r}=n,l=(0,g.select)(a.store).getActiveBlockVariation(r,o);let i=null!=l&&l.name?`${r}/${l.name}`:r;const s={name:i};return"core/block"===r&&(s.ref=o.ref,i+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[i]:{time:t.time,count:e.insertUsage[i]?e.insertUsage[i].count+1:1,insert:s}}}}),e)}return e},lastBlockAttributesChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return e},editorMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"edit",t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode:e},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_EDITOR_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"SET_BLOCK_VISIBILITY":case"START_TYPING":case"STOP_TYPING":case"UPDATE_BLOCK_LIST_SETTINGS":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":case"REPLACE_INNER_BLOCKS":if(!n.blocks.length)return t;const o=n.blocks.map((e=>e.clientId));return{clientIds:o,source:null===(e=n.meta)||void 0===e?void 0:e.source};case"RESET_BLOCKS":return{}}return t},temporarilyEditingAsBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e},blockVisibility:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e}}),z={};function F(e){return[e]}function V(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o(o,r)=>{let l,i;if("function"==typeof e?(l=e(o),i=e(r)):(l=o[e],i=r[e]),l>i)return"asc"===n?1:-1;if(i>l)return"asc"===n?-1:1;const a=t.findIndex((e=>e===o)),s=t.findIndex((e=>e===r));return a>s?1:s>a?-1:0};function Y(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"asc";return e.concat().sort(q(t,e,n))}const Z=[];function Q(e,t){const n=e.blocks.byClientId.get(t),o="core/social-link";if("web"!==u.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes.get(t),{service:r}=null!=n?n:{};return r?`core/social-link-${r}`:o}return n?n.name:null}function X(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function J(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function ee(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const te=H(((e,t)=>e.blocks.byClientId.has(t)?{...e.blocks.byClientId.get(t),attributes:J(e,t)}:null),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function ne(e,t){var n;const o=t&&Zt(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree.get(o))||void 0===n?void 0:n.innerBlocks)||Z}const oe=H(((e,t)=>({clientId:t,innerBlocks:re(e,t)})),(e=>[e.blocks.order])),re=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return $e(e,t).map((t=>oe(e,t)))}),(e=>[e.blocks.order])),le=H(((e,t)=>{const n=[];for(const o of t)for(const t of $e(e,o))n.push(t,...le(e,[t]));return n}),(e=>[e.blocks.order])),ie=H((e=>{const t=[];for(const n of $e(e))t.push(n,...le(e,[n]));return t}),(e=>[e.blocks.order])),ae=H(((e,t)=>{const n=ie(e);return t?n.reduce(((n,o)=>e.blocks.byClientId.get(o).name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),se=H(((e,t)=>{if(!t)return Z;const n=ie(e).filter((n=>e.blocks.byClientId.get(n).name===t));return n.length>0?n:Z}),(e=>[e.blocks.order,e.blocks.byClientId])),ce=H(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>ee(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),ue=H(((e,t)=>ce(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>ce(e,t)));function de(e,t){return $e(e,t).length}function pe(e){return e.selection.selectionStart}function me(e){return e.selection.selectionEnd}function ge(e){return e.selection.selectionStart.clientId}function fe(e){return e.selection.selectionEnd.clientId}function he(e){const t=Me(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function be(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ke(e){const t=be(e);return t?ee(e,t):null}function _e(e,t){return e.blocks.parents.has(t)?e.blocks.parents.get(t):null}const ye=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents.get(r);)r=e.blocks.parents.get(r),o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),Ee=H((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=ye(e,t,o);return r.map((t=>({id:t,name:Q(e,t)}))).filter((e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})).map((e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function Ce(e,t){let n,o=t;do{n=o,o=e.blocks.parents.get(o)}while(o);return n}function Se(e,t){const n=be(e),o=[...ye(e,t),t],r=[...ye(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=be(e)),void 0===t&&(t=n<0?Pe(e):Le(e)),!t)return null;const o=_e(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r.get(o),i=l.indexOf(t),a=i+1*n;return a<0||a===l.length?null:l[a]}function Be(e,t){return we(e,t,-1)}function Ie(e,t){return we(e,t,1)}function xe(e){return e.initialPosition}const Te=H((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return Z;if(t.clientId===n.clientId)return[t.clientId];const o=_e(e,t.clientId);if(null===o)return Z;const r=$e(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Me(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?Z:Te(e)}const Ne=H((e=>{const t=Me(e);return t.length?t.map((t=>ee(e,t))):Z}),(e=>[...Te.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Pe(e){return Me(e)[0]||null}function Le(e){const t=Me(e);return t[t.length-1]||null}function Re(e,t){return Pe(e)===t}function Ae(e,t){return-1!==Me(e).indexOf(t)}const Oe=H(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=_e(e,n),o=Ae(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function De(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function ze(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Fe(e){const t=pe(e),n=me(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ve(e){const t=pe(e),n=me(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function He(e){return Te(e).some((t=>{const n=Q(e,t);return!(0,a.getBlockType)(n).merge}))}function Ge(e,t){const n=pe(e),o=me(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const r=_e(e,n.clientId);if(r!==_e(e,o.clientId))return!1;const l=$e(e,r);let i,s;l.indexOf(n.clientId)>l.indexOf(o.clientId)?(i=o,s=n):(i=n,s=o);const c=t?s.clientId:i.clientId,u=t?i.clientId:s.clientId,d=Q(e,c);if(!(0,a.getBlockType)(d).merge)return!1;const p=ee(e,u);if(p.name===d)return!0;const m=(0,a.switchToBlockType)(p,d);return m&&m.length}const Ue=e=>{const t=pe(e),n=me(e);if(t.clientId===n.clientId)return Z;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return Z;const o=_e(e,t.clientId);if(o!==_e(e,n.clientId))return Z;const r=$e(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId),[s,c]=l>i?[n,t]:[t,n],u=ee(e,s.clientId),d=(0,a.getBlockType)(u.name),p=ee(e,c.clientId),m=(0,a.getBlockType)(p.name),g=u.attributes[s.attributeKey],f=p.attributes[c.attributeKey],h=d.attributes[s.attributeKey],v=m.attributes[c.attributeKey];let b=(0,$.create)({html:g,...K(h)}),k=(0,$.create)({html:f,...K(v)});return b=(0,$.remove)(b,0,s.offset),k=(0,$.remove)(k,c.offset,k.text.length),[{...u,attributes:{...u.attributes,[s.attributeKey]:(0,$.toHTMLString)({value:b,...K(h)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,$.toHTMLString)({value:k,...K(v)})}}]};function $e(e,t){return e.blocks.order.get(t||"")||Z}function je(e,t){return $e(e,_e(e,t)).indexOf(t)}function We(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Ke(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return $e(e,t).some((t=>We(e,t)||Ae(e,t)||n&&Ke(e,t,n)))}function qe(e,t){if(!t)return!1;const n=Me(e),o=n.indexOf(t);return o>-1&&ont(e,t)))}function rt(){return W()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const lt=H((e=>{let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=_e(e,l)||void 0,n=je(e,r.clientId)+1):n=$e(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionPoint,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function it(e){return null!==e.insertionPoint}function at(e){return e.template.isValid}function st(e){return e.settings.template}function ct(e,t){var n,o,r;return t?null!==(n=null===(o=Dt(e,t))||void 0===o?void 0:o.templateLock)&&void 0!==n&&n:null!==(r=e.settings.templateLock)&&void 0!==r&&r}const ut=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},dt=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,a.getBlockType)(t),!n)return!1;const{allowedBlockTypes:r}=zt(e),l=ut(r,t,!0);if(!l)return!1;const i=!!ct(e,o);if(i)return!1;const c=Dt(e,o);if(o&&void 0===c)return!1;const u=null==c?void 0:c.allowedBlocks,d=ut(u,t),p=n.parent,m=Q(e,o),g=ut(p,m);let f=!0;const h=n.ancestor;if(h){f=[o,...ye(e,o)].some((t=>ut(h,Q(e,t))))}const v=f&&(null===d&&null===g||!0===d||!0===g);return v?(0,s.applyFilters)("blockEditor.__unstableCanInsertBlockType",v,n,o,{getBlock:ee.bind(null,e),getBlockParentsByBlockName:Ee.bind(null,e)}):v},pt=H(dt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId.get(n),e.settings.allowedBlockTypes,e.settings.templateLock]));function mt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>pt(e,Q(e,t),n)))}function gt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=J(e,t);if(null===o)return!0;const{lock:r}=o,l=!!ct(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function ft(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>gt(e,t,n)))}function ht(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=J(e,t);if(null===o)return;const{lock:r}=o,l="all"===ct(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function vt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ht(e,t,n)))}function bt(e,t){const n=J(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function kt(e,t){var n;return!!(0,a.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function _t(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const yt=(e,t,n)=>!!(0,a.hasBlockSupport)(t,"inserter",!0)&&dt(e,t.name,n),Et=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=_t(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:Ct(r,l)}},Ct=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},St=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let r=!1;(0,a.hasBlockSupport)(t.name,"multiple",!0)||(r=ce(e,ie(e)).some((e=>{let{name:n}=e;return n===t.name})));const{time:l,count:i=0}=_t(e,o)||{},s={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:r,frecency:Ct(l,i)};if("transform"===n)return s;const c=(0,a.getBlockVariations)(t.name,"inserter");return{...s,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},wt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=St(e,{buildScope:"inserter"}),o=/^\s*)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,r=t=>{let n=U;if("web"===u.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,r=(0,a.getBlockType)(t+o);r&&(n=r.icon)}}const r=`core/block/${t.id}`,{time:l,count:i=0}=_t(e,r)||{},s=Ct(l,i);return{id:r,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:s}},l=(0,a.getBlockTypes)().filter((n=>yt(e,n,t))).map(n),i=dt(e,"core/block",t)?$t(e).map(r):[],s=l.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=Et(e,n);t.push(...o.map(r))}return t}),[]),c=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=s.reduce(c,{core:[],noncore:[]}),m=[...d,...p];return[...m,...i]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,$t(e),(0,a.getBlockTypes)()])),Bt=H((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=Array.isArray(t)?t:[t],[l]=r,i=St(e,{buildScope:"transform"}),s=(0,a.getBlockTypes)().filter((t=>yt(e,t,o))).map(i),c=Object.fromEntries(Object.entries(s).map((e=>{let[,t]=e;return[t.name,t]})));c["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,_.__)("Unwrap"),icon:null===(n=c[null==l?void 0:l.name])||void 0===n?void 0:n.icon};const u=(0,a.getPossibleBlockTransformations)(r).reduce(((e,t)=>("*"===t?e.push(c["*"]):c[null==t?void 0:t.name]&&e.push(c[t.name]),e)),[]);return Y(u,(e=>c[e.name].frecency),"desc")}),((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,a.getBlockTypes)()])),It=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,a.getBlockTypes)().some((n=>yt(e,n,t)));if(n)return!0;const o=dt(e,"core/block",t)&&$t(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,$t(e),(0,a.getBlockTypes)()])),xt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,a.getBlockTypes)().filter((n=>yt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,a.getBlockTypes)()])),Tt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return W()('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),xt(e,t)}),((e,t)=>[...xt.getDependants(e,t)])),Mt=H((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(ee(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree.get(t)])),Nt=H(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,a.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),Pt=H((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=zt(e),o=t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return Nt(e,n)})),r=o.filter((e=>{let{blocks:t}=e;return((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!ut(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(t,n)}));return r}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),Lt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Pt(e),o=n.filter((n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return pt(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId.get(t)])),Rt=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return Z;const o=Lt(e,n),r=Array.isArray(t)?t:[t],l=o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}));return 0===l.length?Z:l}),((e,t,n)=>[...Lt.getDependants(e,n)])),At=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return W()('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),Rt(e,t,n)}),((e,t,n)=>[...Lt.getDependants(e,n)])),Ot=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return Z;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Zt(e,n)})))return Z;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return Rt(e,o,n)}),((e,t,n)=>[...Rt.getDependants(e,n)]));function Dt(e,t){return e.blockListSettings[t]}function zt(e){return e.settings}function Ft(e){return e.blocks.isPersistentChange}const Vt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),Ht=H(((e,t)=>{var n;const o=$t(e).find((e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[$t(e)]));function Gt(e){return e.blocks.isIgnoredChange}function Ut(e){return e.lastBlockAttributesChange}function $t(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:Z}function jt(e){return"navigation"===e.editorMode}function Wt(e){return e.editorMode}function Kt(e){return e.hasBlockMovingClientId}function qt(e){return!!e.automaticChangeStatus}function Yt(e,t){return e.highlightedBlock===t}function Zt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Qt=H(((e,t)=>{if(!t.length)return null;const n=be(e);if(t.includes(Q(e,n)))return n;const o=Me(e),r=Ee(e,n||o[0],t);return r?r[r.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Xt(e,t,n){var o;const{lastBlockInserted:r}=e;return(null===(o=r.clientIds)||void 0===o?void 0:o.includes(t))&&r.source===n}function Jt(e,t){var n,o;return null===(n=null===(o=e.blockVisibility)||void 0===o?void 0:o[t])||void 0===n||n}const en=H((e=>new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])))),(e=>[e.blockVisibility])),tn=H(((e,t)=>{let n,o=t;for(;e.blocks.parents.has(o);)o=e.blocks.parents.get(o),o&&"contentOnly"===ct(e,o)&&(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function nn(e){return e.temporarilyEditingAsBlocks}function on(e,t){if(!bt(e,t))return!0;const n=Wt(e);if("zoom-out"===n&&t&&!_e(e,t))return!0;const o=(0,a.hasBlockSupport)(Q(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!o&&Zt(e,t))&&!We(e,t)&&!Ke(e,t,!0)}function rn(e,t){let n=e.blocks.parents.get(t);for(;n;){if(on(e,n))return!0;n=e.blocks.parents.get(n)}return!1}const ln=["inserterMediaCategories","blockInspectorAnimation"];function an(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e;if(t&&"web"===u.Platform.OS){n={};for(const t in e)ln.includes(t)||(n[t]=e[t])}return{type:"UPDATE_SETTINGS",settings:n}}function sn(){return{type:"HIDE_BLOCK_INTERFACE"}}function cn(){return{type:"SHOW_BLOCK_INTERFACE"}}function un(e){return e.isBlockInterfaceHidden}function dn(e){var t;return null==e||null===(t=e.lastBlockInserted)||void 0===t?void 0:t.clientIds}var pn=window.wp.a11y;const mn="†";function gn(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(mn)}))}const fn=e=>Array.isArray(e)?e:[e],hn=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(vn(e))},vn=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getTemplate(),l=n.getTemplateLock(),i=!r||"all"!==l||(0,a.doBlocksMatchTemplate)(e,r);if(i!==n.isValidTemplate())return o.setTemplateValidity(i),i};function bn(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function kn(e){return W()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function _n(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:fn(e),attributes:t,uniqueByBlock:n}}function yn(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function En(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Cn=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n=>{let{select:o,dispatch:r}=n;const l=o.getPreviousBlockClientId(e);if(l)r.selectBlock(l,-1);else if(t){const t=o.getBlockRootClientId(e);t&&r.selectBlock(t,-1)}}},Sn=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function wn(){return{type:"START_MULTI_SELECT"}}function Bn(){return{type:"STOP_MULTI_SELECT"}}const In=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o=>{let{select:r,dispatch:l}=o;if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;l({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,pn.speak)((0,_.sprintf)((0,_._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function xn(){return{type:"CLEAR_SELECTED_BLOCK"}}function Tn(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function Mn(e,t){var n,o;const r=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,a.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!r[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:l={}}=e,i=r[n];return{...e,attributes:{...l,className:`${o||""} is-style-${i}`.trim()}}}))}const Nn=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0;return l=>{let{select:i,dispatch:a}=l;e=fn(e),t=Mn(fn(t),i.getSettings());const s=i.getBlockRootClientId(e[0]);for(let e=0;e{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function Pn(e,t){return Nn(e,t)}const Ln=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:fn(t),rootClientId:n})},Rn=Ln("MOVE_BLOCKS_DOWN"),An=Ln("MOVE_BLOCKS_UP"),On=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return r=>{let{select:l,dispatch:i}=r;if(l.canMoveBlocks(e,t)){if(t!==n){if(!l.canRemoveBlocks(e,t))return;if(!l.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function Dn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return On([e],t,n,o)}function zn(e,t,n,o,r){return Fn([e],t,n,o,0,r)}const Fn=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:a,dispatch:s}=i;null!==r&&"object"==typeof r&&(l=r,r=0,W()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=Mn(fn(e),a.getSettings());const c=[];for(const t of e){a.canInsertBlockType(t.name,n)&&c.push(t)}c.length&&s({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})}};function Vn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o,operation:r}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o,operation:r}}const Hn=()=>e=>{let{select:t,dispatch:n}=e;t.isBlockInsertionPointVisible()&&n({type:"HIDE_INSERTION_POINT"})};function Gn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const Un=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),r=t.getTemplate(),l=(0,a.synchronizeBlocksWithTemplate)(o,r);n.resetBlocks(l)},$n=e=>t=>{let{registry:n,select:o,dispatch:r}=t;const l=o.getSelectionStart(),i=o.getSelectionEnd();if(l.clientId===i.clientId)return;if(!l.attributeKey||!i.attributeKey||void 0===l.offset||void 0===i.offset)return!1;const s=o.getBlockRootClientId(l.clientId);if(s!==o.getBlockRootClientId(i.clientId))return;const c=o.getBlockOrder(s);let u,d;c.indexOf(l.clientId)>c.indexOf(i.clientId)?(u=i,d=l):(u=l,d=i);const p=e?d:u,m=o.getBlock(p.clientId),g=(0,a.getBlockType)(m.name);if(!g.merge)return;const f=u,h=d,v=o.getBlock(f.clientId),b=(0,a.getBlockType)(v.name),k=o.getBlock(h.clientId),_=(0,a.getBlockType)(k.name),y=v.attributes[f.attributeKey],E=k.attributes[h.attributeKey],C=b.attributes[f.attributeKey],S=_.attributes[h.attributeKey];let w=(0,$.create)({html:y,...K(C)}),B=(0,$.create)({html:E,...K(S)});w=(0,$.remove)(w,f.offset,w.text.length),B=(0,$.insert)(B,mn,0,h.offset);const I=(0,a.cloneBlock)(v,{[f.attributeKey]:(0,$.toHTMLString)({value:w,...K(C)})}),x=(0,a.cloneBlock)(k,{[h.attributeKey]:(0,$.toHTMLString)({value:B,...K(S)})}),T=e?I:x,M=v.name===k.name?[T]:(0,a.switchToBlockType)(T,g.name);if(!M||!M.length)return;let N;if(e){const e=M.pop();N=g.merge(e.attributes,x.attributes)}else{const e=M.shift();N=g.merge(I.attributes,e.attributes)}const P=gn(N),L=N[P],R=(0,$.create)({html:L,...K(g.attributes[P])}),A=R.text.indexOf(mn),O=(0,$.remove)(R,A,A+1),D=(0,$.toHTMLString)({value:O,...K(g.attributes[P])});N[P]=D;const z=o.getSelectedBlockClientIds(),F=[...e?M:[],{...m,attributes:{...m.attributes,...N}},...e?[]:M];n.batch((()=>{r.selectionChange(m.clientId,P,A,A),r.replaceBlocks(z,F,0,o.getSelectedBlocksInitialCaretPosition())}))},jn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();if(o.clientId===r.clientId)return;if(!o.attributeKey||!r.attributeKey||void 0===o.offset||void 0===r.offset)return;const l=t.getBlockRootClientId(o.clientId);if(l!==t.getBlockRootClientId(r.clientId))return;const i=t.getBlockOrder(l);let s,c;i.indexOf(o.clientId)>i.indexOf(r.clientId)?(s=r,c=o):(s=o,c=r);const u=s,d=c,p=t.getBlock(u.clientId),m=(0,a.getBlockType)(p.name),g=t.getBlock(d.clientId),f=(0,a.getBlockType)(g.name),h=p.attributes[u.attributeKey],v=g.attributes[d.attributeKey],b=m.attributes[u.attributeKey],k=f.attributes[d.attributeKey];let _=(0,$.create)({html:h,...K(b)}),y=(0,$.create)({html:v,...K(k)});_=(0,$.remove)(_,u.offset,_.text.length),y=(0,$.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,$.toHTMLString)({value:_,...K(b)})}},(0,a.createBlock)((0,a.getDefaultBlockName)()),{...g,attributes:{...g.attributes,[d.attributeKey]:(0,$.toHTMLString)({value:y,...K(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},Wn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},Kn=(e,t)=>n=>{let{registry:o,select:r,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[s,c]=i,u=r.getBlock(s),d=(0,a.getBlockType)(u.name);if(!d)return;const p=r.getBlock(c);if(d&&!d.merge){const e=(0,a.switchToBlockType)(p,d.name);if(1!==(null==e?void 0:e.length))return void l.selectBlock(u.clientId);const[t]=e;return t.innerBlocks.length<1?void l.selectBlock(u.clientId):void o.batch((()=>{l.insertBlocks(t.innerBlocks,void 0,s),l.removeBlock(c),l.selectBlock(t.innerBlocks[0].clientId)}))}const m=(0,a.getBlockType)(p.name),{clientId:g,attributeKey:f,offset:h}=r.getSelectionStart(),v=(g===s?d:m).attributes[f],b=(g===s||g===c)&&void 0!==f&&void 0!==h&&!!v;v||("number"==typeof f?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof f):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const k=(0,a.cloneBlock)(u),_=(0,a.cloneBlock)(p);if(b){const e=g===s?k:_,t=e.attributes[f],n=(0,$.insert)((0,$.create)({html:t,...K(v)}),mn,h,h);e.attributes[f]=(0,$.toHTMLString)({value:n,...K(v)})}const y=u.name===p.name?[_]:(0,a.switchToBlockType)(_,u.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=gn(E),t=E[e],n=(0,$.create)({html:t,...K(d.attributes[e])}),o=n.text.indexOf(mn),r=(0,$.remove)(n,o,o+1),i=(0,$.toHTMLString)({value:r,...K(d.attributes[e])});E[e]=i,l.selectionChange(u.clientId,e,o,o)}l.replaceBlocks([u.clientId,p.clientId],[{...u,attributes:{...u.attributes,...E}},...y.slice(1)],0)},qn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=fn(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0],t),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function Yn(e,t){return qn([e],t)}function Zn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function Qn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Xn(){return{type:"START_TYPING"}}function Jn(){return{type:"STOP_TYPING"}}function eo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function to(){return{type:"STOP_DRAGGING_BLOCKS"}}function no(){return W()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function oo(){return W()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function ro(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const lo=(e,t,n)=>o=>{let{dispatch:r}=o;const l=(0,a.getDefaultBlockName)();if(!l)return;const i=(0,a.createBlock)(l,e);return r.insertBlock(i,n,t)};function io(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function ao(e){return an(e,!0)}function so(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function co(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function uo(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const po=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n((()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},mo=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n.__unstableSetEditorMode(e?"navigation":"edit")}},go=e=>t=>{let{dispatch:n,select:o}=t;if("zoom-out"===e){const e=o.getBlockSelectionStart();e&&n.selectBlock(o.getBlockHierarchyRootClientId(e))}n({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,pn.speak)((0,_.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):"edit"===e?(0,pn.speak)((0,_.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,pn.speak)((0,_.__)("You are currently in zoom-out mode."))},fo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,pn.speak)((0,_.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},ho=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;const l=o.getBlocksByClientId(e);if(l.some((e=>!e)))return;const i=l.map((e=>e.name));if(i.some((e=>!(0,a.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),c=fn(e),u=o.getBlockIndex(c[c.length-1]),d=l.map((e=>(0,a.__experimentalCloneSanitizedBlock)(e)));return r.insertBlocks(d,u+1,s,t),d.length>1&&t&&r.multiSelect(d[0].clientId,d[d.length-1].clientId),d.map((e=>e.clientId))}},vo=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l)},bo=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l+1)};function ko(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const _o=e=>async t=>{let{dispatch:n}=t;n(ko(e,!0)),await new Promise((e=>setTimeout(e,150))),n(ko(e,!1))};function yo(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function Eo(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function Co(e){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e}}const So="core/block-editor";var wo=window.wp.privateApis;const{lock:Bo,unlock:Io}=(0,wo.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/block-editor"),xo={reducer:D,selectors:e,actions:l},To=(0,g.createReduxStore)(So,{...xo,persist:["preferences"]}),Mo=(0,g.registerStore)(So,{...xo,persist:["preferences"]});Io(Mo).registerPrivateActions(t),Io(Mo).registerPrivateSelectors(r);const No={name:"",isSelected:!1},Po=(0,u.createContext)(No),{Provider:Lo}=Po;function Ro(){return(0,u.useContext)(Po)}function Ao(){const{isSelected:e,clientId:t,name:n}=Ro();return(0,g.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(To);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function Oo(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:r=!1}=e;const l=function(e,t){const n=Ao(),{clientId:o}=Ro(),r=(0,g.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:r}=e(To),{hasBlockSupport:l}=e(a.store);return t&&l(n(o),"__experimentalExposeControlsToChildren",!1)&&r(o)}),[t,o]);var l;return n?null===(l=v[e])||void 0===l?void 0:l.Fill:r?v.parent.Fill:null}(t,r);return l?(0,u.createElement)(h.__experimentalStyleProvider,{document:document},(0,u.createElement)(l,null,(e=>{const r=(0,f.isEmpty)(e)?null:e;return(0,u.createElement)(h.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,u.createElement)(h.ToolbarGroup,{controls:n}),o)}))):null}function Do(e){let{group:t="default",...n}=e;const o=(0,u.useContext)(h.__experimentalToolbarContext),r=v[t].Slot,l=(0,h.__experimentalUseSlotFills)(r.__unstableName);return Boolean(l&&l.length)?"default"===t?(0,u.createElement)(r,c({},n,{bubblesVirtually:!0,fillProps:o})):(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(r,c({},n,{bubblesVirtually:!0,fillProps:o}))):null}const zo=Oo;zo.Slot=Do;const Fo=e=>(0,u.createElement)(Oo,c({group:"inline"},e));Fo.Slot=e=>(0,u.createElement)(Do,c({group:"inline"},e));var Vo=zo;var Ho=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"}));var Go=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"}));var Uo=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"}));var $o=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"}));var jo=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z"}));var Wo=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"}));var Ko=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"}));function qo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function Yo(e,t,n,o){var r,l;let i="";return null!=t&&null!==(r=t[n])&&void 0!==r&&null!==(l=r.spacingStyles)&&void 0!==l&&l.length&&o&&t[n].spacingStyles.forEach((t=>{i+=`${qo(e,t.selector.trim())} { `,i+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||o}`})).join("; "),i+="; }"})),i}function Zo(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(o.none=(0,_.sprintf)((0,_.__)("Max %s wide"),t)),r.test(n)&&(o.wide=(0,_.sprintf)((0,_.__)("Max %s wide"),n)),o}const Qo=(0,u.createContext)({refs:new Map,callbacks:new Map});function Xo(e){let{children:t}=e;const n=(0,u.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,u.createElement)(Qo.Provider,{value:n},t)}function Jo(e){const{refs:t,callbacks:n}=(0,u.useContext)(Qo),o=(0,u.useRef)();return(0,u.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,m.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function er(e){const{refs:t}=(0,u.useContext)(Qo),n=(0,u.useRef)();return n.current=e,(0,u.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function tr(e){const{callbacks:t}=(0,u.useContext)(Qo),n=er(e),[o,r]=(0,u.useState)(null);return(0,u.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}function nr(e){return!(null==e||!e.includes)&&("0"===e||e.includes("var:preset|spacing|"))}function or(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function rr(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}const lr={all:(0,_.__)("All sides"),top:(0,_.__)("Top"),bottom:(0,_.__)("Bottom"),left:(0,_.__)("Left"),right:(0,_.__)("Right"),mixed:(0,_.__)("Mixed"),vertical:(0,_.__)("Vertical"),horizontal:(0,_.__)("Horizontal")},ir={top:void 0,right:void 0,bottom:void 0,left:void 0},ar=["top","right","bottom","left"];function sr(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function cr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ar;return Object.values(e).length>=1&&Object.values(e).length1}function ur(e){return null!=e&&Object.values(e).filter((e=>!!e)).length>0}var dr=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"}));const pr=["color","border","dimensions","typography","spacing"],mr={"color.palette":e=>e.colors,"color.gradients":e=>e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},gr={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"};function fr(e){const{name:t,clientId:n}=Ro();return(0,g.useSelect)((o=>{if(pr.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let r=(0,s.applyFilters)("blockEditor.useSetting.before",void 0,e,n,t);if(void 0!==r)return r;const l=(e=>gr[e]||e)(e),i=[n,...o(To).getBlockParents(n,!0)];for(const e of i){const n=o(To).getBlockName(e);if((0,a.hasBlockSupport)(n,"__experimentalSettings",!1)){var c;const n=o(To).getBlockAttributes(e);if(r=null!==(c=(0,f.get)(n,`settings.blocks.${t}.${l}`))&&void 0!==c?c:(0,f.get)(n,`settings.${l}`),void 0!==r)break}}const u=o(To).getSettings();if(void 0===r){var d;const e=`__experimentalFeatures.${l}`,n=`__experimentalFeatures.blocks.${t}.${l}`;r=null!==(d=(0,f.get)(u,n))&&void 0!==d?d:(0,f.get)(u,e)}var p,m;if(void 0!==r)return a.__EXPERIMENTAL_PATHS_WITH_MERGE[l]?null!==(p=null!==(m=r.custom)&&void 0!==m?m:r.theme)&&void 0!==p?p:r.default:r;const g=mr[l]?mr[l](u):void 0;return void 0!==g?g:"typography.dropCap"===l||void 0}),[t,n,e])}const hr={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1}};function vr(e){var t,n,o,r,l;let{spacingSizes:i,value:a,side:s,onChange:c,isMixed:d=!1,type:m,minimumCustomValue:f,onMouseOver:v,onMouseOut:b}=e;a=function(e,t){if(nr(e))return e;const n=t.find((t=>String(t.size)===String(e)));return null!=n&&n.slug?`var:preset|spacing|${n.slug}`:e}(a,i);let k=i;const y=i.length<=8,E=(0,g.useSelect)((e=>{const t=e(To).getSettings();return null==t?void 0:t.disableCustomSpacingSizes})),[C,S]=(0,u.useState)(!E&&void 0!==a&&!nr(a)),w=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["px","em","rem"]});let B=null;!y&&!C&&void 0!==a&&(!nr(a)||nr(a)&&d)?(k=[...i,{name:d?(0,_.__)("Mixed"):(0,_.sprintf)((0,_.__)("Custom (%s)"),a),slug:"custom",size:a}],B=k.length-1):d||(B=C?function(e,t){if(!nr(e))return e;const n=rr(e),o=t.find((e=>String(e.slug)===n));return null==o?void 0:o.size}(a,i):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":rr(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(a,i));const I=(0,u.useMemo)((()=>(0,h.__experimentalParseQuantityAndUnitFromRawValue)(B)),[B])[1]||w[0].value,x=e=>{var t;return void 0===a||null===(t=i[e])||void 0===t?void 0:t.name},T=parseFloat(B,10),M=(e,t)=>{var n;const o=parseInt(e,10);if("selectList"===t){if(0===o)return;if(1===o)return"0"}else if(0===o)return"0";return`var:preset|spacing|${null===(n=i[e])||void 0===n?void 0:n.slug}`},N=d?(0,_.__)("Mixed"):null,P=d?(0,_.__)("Mixed"):x(B),L=k.map(((e,t)=>({key:t,name:e.name}))),R=i.map(((e,t)=>({value:t,label:void 0}))),A=(0,_.sprintf)((0,_.__)("%1$s %2$s"),lr[s],null==m?void 0:m.toLowerCase()),O=y&&!C&&void 0!==P;return(0,u.createElement)(u.Fragment,null,"all"!==s&&(0,u.createElement)(h.__experimentalHStack,{className:"components-spacing-sizes-control__side-labels"},(0,u.createElement)(h.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__side-label"},lr[s]),O&&(0,u.createElement)(h.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-single"},P)),"all"===s&&O&&(0,u.createElement)(h.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-all"},P),!E&&(0,u.createElement)(h.Button,{label:C?(0,_.__)("Use size preset"):(0,_.__)("Set custom size"),icon:dr,onClick:()=>{S(!C)},isPressed:C,isSmall:!0,className:p()({"components-spacing-sizes-control__custom-toggle-all":"all"===s,"components-spacing-sizes-control__custom-toggle-single":"all"!==s}),iconSize:24}),C&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalUnitControl,{onMouseOver:v,onMouseOut:b,onFocus:v,onBlur:b,onChange:e=>c((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:B,units:w,min:f,placeholder:N,disableUnits:d,label:A,hideLabelFromVision:!0,className:"components-spacing-sizes-control__custom-value-input",size:"__unstable-large"}),(0,u.createElement)(h.RangeControl,{onMouseOver:v,onMouseOut:b,onFocus:v,onBlur:b,value:T,min:0,max:null!==(t=null===(n=hr[I])||void 0===n?void 0:n.max)&&void 0!==t?t:10,step:null!==(o=null===(r=hr[I])||void 0===r?void 0:r.steps)&&void 0!==o?o:.1,withInputField:!1,onChange:e=>{c([e,I].join(""))},className:"components-spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0})),y&&!C&&(0,u.createElement)(h.RangeControl,{onMouseOver:v,onMouseOut:b,className:"components-spacing-sizes-control__range-control",value:B,onChange:e=>c(M(e)),onMouseDown:e=>{var t;(null==e||null===(t=e.nativeEvent)||void 0===t?void 0:t.offsetX)<35&&void 0===a&&c("0")},withInputField:!1,"aria-valuenow":B,"aria-valuetext":null===(l=i[B])||void 0===l?void 0:l.name,renderTooltipContent:x,min:0,max:i.length-1,marks:R,label:A,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:v,onBlur:b}),!y&&!C&&(0,u.createElement)(h.CustomSelectControl,{className:"components-spacing-sizes-control__custom-select-control",value:L.find((e=>e.key===B))||"",onChange:e=>{c(M(e.selectedItem.key,"selectList"))},options:L,label:A,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0,size:"__unstable-large",onMouseOver:v,onMouseOut:b,onFocus:v,onBlur:b}))}function br(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s}=e;const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return sr(Object.values(e))}(n),d=ur(n)&&cr(n,o);return(0,u.createElement)(vr,{value:c,onChange:e=>{const r=(0,h.__experimentalApplyValueToSides)(n,e,o);t(r)},side:"all",spacingSizes:r,isMixed:d,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s})}function kr(e){let{values:t,sides:n,onChange:o,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s}=e;const c=null!=n&&n.length?ar.filter((e=>n.includes(e))):ar,d=e=>n=>{const r={...t};r[e]=n,o(r)};return(0,u.createElement)(u.Fragment,null,c.map((e=>(0,u.createElement)(vr,{value:t[e],label:lr[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,onChange:d(e),spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s}))))}const _r=["vertical","horizontal"];function yr(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s}=e;const c=e=>o=>{if(!t)return;const r={...n};"vertical"===e&&(r.top=o,r.bottom=o),"horizontal"===e&&(r.left=o,r.right=o),t(r)},d=null!=o&&o.length?_r.filter((e=>o.includes(e))):_r;return(0,u.createElement)(u.Fragment,null,d.map((e=>{const t="vertical"===e?n.top:n.left;return(0,u.createElement)(vr,{value:t,onChange:c(e),label:lr[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s})})))}var Er=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"}));var Cr=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function Sr(e){let{isLinked:t,onClick:n}=e;const o=t?(0,_.__)("Unlink sides"):(0,_.__)("Link sides");return(0,u.createElement)(h.Tooltip,{text:o},(0,u.createElement)("span",{className:"component-spacing-sizes-control__linked-button"},(0,u.createElement)(h.Button,{isSmall:!0,icon:t?Er:Cr,iconSize:24,"aria-label":o,onClick:n})))}function wr(e){let{inputProps:t,onChange:n,label:o=(0,_.__)("Spacing Control"),values:r,sides:l,splitOnAxis:i=!1,useSelect:a,minimumCustomValue:s=0,onMouseOver:d,onMouseOut:m}=e;const g=[{name:0,slug:"0",size:0},...fr("spacing.spacingSizes")||[]];g.length>8&&g.unshift({name:(0,_.__)("Default"),slug:"default",size:void 0});const f=r||ir,v=ur(r),b=1===(null==l?void 0:l.length),[k,y]=(0,u.useState)(!v||!cr(f,l)||b),E={...t,onChange:e=>{const t={...r,...e};n(t)},isLinked:k,sides:l,values:f,spacingSizes:g,useSelect:a,type:o,minimumCustomValue:s,onMouseOver:d,onMouseOut:m};return(0,u.createElement)("fieldset",{className:p()("component-spacing-sizes-control",{"is-unlinked":!k})},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},o),!b&&(0,u.createElement)(Sr,{onClick:()=>{y(!k)},isLinked:k}),k&&(0,u.createElement)(br,c({"aria-label":o},E)),!k&&i&&(0,u.createElement)(yr,E),!k&&!i&&(0,u.createElement)(kr,E))}window.wp.warning;const Br=(0,h.createSlotFill)("InspectorControls"),Ir=(0,h.createSlotFill)("InspectorAdvancedControls"),xr=(0,h.createSlotFill)("InspectorControlsBorder"),Tr=(0,h.createSlotFill)("InspectorControlsColor"),Mr=(0,h.createSlotFill)("InspectorControlsDimensions"),Nr=(0,h.createSlotFill)("InspectorControlsPosition"),Pr=(0,h.createSlotFill)("InspectorControlsTypography");var Lr={default:Br,advanced:Ir,border:xr,color:Tr,dimensions:Mr,list:(0,h.createSlotFill)("InspectorControlsListView"),settings:Br,styles:(0,h.createSlotFill)("InspectorControlsStyles"),typography:Pr,position:Nr};function Rr(e){var t;let{children:n,group:o="default",__experimentalGroup:r}=e;r&&(W()("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),o=r);const l=Ao(),i=null===(t=Lr[o])||void 0===t?void 0:t.Fill;return i?l?(0,u.createElement)(h.__experimentalStyleProvider,{document:document},(0,u.createElement)(i,null,(e=>{const t=(0,f.isEmpty)(e)?null:e;return(0,u.createElement)(h.__experimentalToolsPanelContext.Provider,{value:t},n)}))):null:("undefined"!=typeof process&&process.env,null)}const Ar=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.fromEntries(Object.entries((0,f.mapValues)(e,Ar)).filter((e=>{let[,t]=e;return Boolean(t)})));return(0,f.isEmpty)(t)?void 0:t};function Or(e){return"object"==typeof e?{...Object.fromEntries(Object.entries(e).map((e=>{let[t,n]=e;return[t,Or(n)]})))}:e}function Dr(e,t,n){const o=function(e){return Array.isArray(e)?e:"number"==typeof e?[e.toString()]:[e]}(t),r=e?Or(e):{};return o.reduce(((e,t,r)=>(void 0===e[t]&&(e[t]={}),r===o.length-1&&(e[t]=n),e[t])),r),r}function zr(e,t,n,o,r,l){var i;if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let a=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var s;a=null===(s=o[r])||void 0===s?void 0:s.attributes}let c=n;return Object.entries(e).forEach((e=>{let[n,o]=e;o&&t[n].forEach((e=>{const t=(0,f.get)(a,e);t&&(c={...c,attributes:Dr(c.attributes,e,t)})}))})),c}function Fr(e,t,n){const o=(0,a.getBlockSupport)(e,t),r=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}function Vr(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,g.useDispatch)(To),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:s}=(0,g.useSelect)(To),c=a(),d=(0,u.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=s()?i():[c];n.forEach((n=>{const{style:o}=l(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:Ar(r.style)},t[n]=r})),r(n,t,!0)}),[Ar,l,i,s,c,r]);return(0,u.createElement)(h.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:c,panelId:c,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Hr(e){let{Slot:t,...n}=e;const o=(0,u.useContext)(h.__experimentalToolsPanelContext);return(0,u.createElement)(t,c({},n,{fillProps:o,bubblesVirtually:!0}))}function Gr(e){var t;let{__experimentalGroup:n,group:o="default",label:r,...l}=e;n&&(W()("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),o=n);const i=null===(t=Lr[o])||void 0===t?void 0:t.Slot,a=(0,h.__experimentalUseSlot)(null==i?void 0:i.__unstableName),s=(0,h.__experimentalUseSlotFills)(null==i?void 0:i.__unstableName);if(!i||!a)return"undefined"!=typeof process&&process.env,null;return Boolean(s&&s.length)?r?(0,u.createElement)(Vr,{group:o,label:r},(0,u.createElement)(Hr,c({},l,{Slot:i}))):(0,u.createElement)(i,c({},l,{bubblesVirtually:!0})):null}const Ur=Rr;Ur.Slot=Gr;const $r=e=>(0,u.createElement)(Rr,c({},e,{group:"advanced"}));$r.Slot=e=>(0,u.createElement)(Gr,c({},e,{group:"advanced"})),$r.slotName="InspectorAdvancedControls";var jr=Ur,Wr=window.wp.isShallowEqual,Kr=n.n(Wr);var qr=function(e){return(0,m.useRefEffect)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])};const Yr=Number.MAX_SAFE_INTEGER;var Zr=(0,u.forwardRef)((function(e,t){let{clientId:n,bottomClientId:o,children:r,__unstableRefreshSize:l,__unstableCoverTarget:i=!1,__unstablePopoverSlot:a,__unstableContentRef:s,shift:d=!0,...g}=e;const f=tr(n),v=tr(null!=o?o:n),b=(0,m.useMergeRefs)([t,qr(s)]),[k,_]=(0,u.useReducer)((e=>(e+1)%Yr),0);(0,u.useLayoutEffect)((()=>{if(!f)return;const e=new window.MutationObserver(_);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}}),[f]);const y=(0,u.useMemo)((()=>k<0||!f||v!==f?{}:{position:"absolute",width:f.offsetWidth,height:f.offsetHeight}),[f,v,l,k]),E=(0,u.useMemo)((()=>{if(!(k<0||!f||o&&!v))return{getBoundingClientRect(){var e,t,n,o;const r=f.getBoundingClientRect(),l=null==v?void 0:v.getBoundingClientRect(),i=Math.min(r.left,null!==(e=null==l?void 0:l.left)&&void 0!==e?e:1/0),a=Math.min(r.top,null!==(t=null==l?void 0:l.top)&&void 0!==t?t:1/0),s=Math.max(r.right,null!==(n=l.right)&&void 0!==n?n:-1/0)-i,c=Math.max(r.bottom,null!==(o=l.bottom)&&void 0!==o?o:-1/0)-a;return new window.DOMRect(i,a,s,c)},ownerDocument:f.ownerDocument}}),[o,v,f,k]);return!f||o&&!v?null:(0,u.createElement)(h.Popover,c({ref:b,animate:!1,focusOnMount:!1,anchor:E,__unstableSlotName:a||null,placement:"top-start",resize:!1,flip:!1,shift:d},g,{className:p()("block-editor-block-popover",g.className),variant:"unstyled"}),i&&(0,u.createElement)("div",{style:y},r),!i&&r)}));function Qr(e){const t=(0,a.getBlockSupport)(e,hl);return!!(!0===t||null!=t&&t.margin)}function Xr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("spacing.margin"),n=!Cl(e,"margin");return!Qr(e)||t||n}function Jr(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l,onMouseOver:i,onMouseOut:a}=e,s=fr("spacing.spacingSizes"),c=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vw"]}),d=El(o,"margin"),p=d&&d.some((e=>bl.includes(e)));if(Xr(e))return null;const m=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,margin:e}};l({style:Ar(t)})};return u.Platform.select({web:(0,u.createElement)(u.Fragment,null,(!s||0===(null==s?void 0:s.length))&&(0,u.createElement)(h.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.margin,onChange:m,label:(0,_.__)("Margin"),sides:d,units:c,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:a}),(null==s?void 0:s.length)>0&&(0,u.createElement)(wr,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.margin,onChange:m,label:(0,_.__)("Margin"),sides:d,units:c,allowReset:!1,splitOnAxis:!1,onMouseOver:i,onMouseOut:a})),native:null})}function el(e){var t,n;let{clientId:o,attributes:r,forceShow:l}=e;const i=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,a=(0,u.useMemo)((()=>{const e=null!=i&&i.top?or(null==i?void 0:i.top):0,t=null!=i&&i.right?or(null==i?void 0:i.right):0,n=null!=i&&i.bottom?or(null==i?void 0:i.bottom):0,o=null!=i&&i.left?or(null==i?void 0:i.left):0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:o,top:e?`calc(${e} * -1)`:0,right:t?`calc(${t} * -1)`:0,bottom:n?`calc(${n} * -1)`:0,left:o?`calc(${o} * -1)`:0}}),[i]),[s,c]=(0,u.useState)(!1),d=(0,u.useRef)(i),p=(0,u.useRef)();return(0,u.useEffect)((()=>(Kr()(i,d.current)||l||(c(!0),d.current=i,p.current=setTimeout((()=>{c(!1)}),400)),()=>{c(!1),p.current&&window.clearTimeout(p.current)})),[i,l]),s||l?(0,u.createElement)(Zr,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:i,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,u.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}const tl={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1}};function nl(e){var t,n,o,r,l;let{label:i=(0,_.__)("Height"),onChange:a,value:s}=e;const c=parseFloat(s),d=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vh","vw"]}),p=(0,u.useMemo)((()=>(0,h.__experimentalParseQuantityAndUnitFromRawValue)(s)),[s])[1]||(null===(t=d[0])||void 0===t?void 0:t.value)||"px";return(0,u.createElement)("fieldset",{className:"block-editor-height-control"},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},i),(0,u.createElement)(h.Flex,null,(0,u.createElement)(h.FlexItem,{isBlock:!0},(0,u.createElement)(h.__experimentalUnitControl,{value:s,units:d,onChange:a,onUnitChange:e=>{const[t,n]=(0,h.__experimentalParseQuantityAndUnitFromRawValue)(s);["em","rem"].includes(e)&&"px"===n?a((t/16).toFixed(2)+e):["em","rem"].includes(n)&&"px"===e?a(Math.round(16*t)+e):["vh","vw","%"].includes(e)&&t>100&&a(100+e)},min:0,size:"__unstable-large"})),(0,u.createElement)(h.FlexItem,{isBlock:!0},(0,u.createElement)(h.__experimentalSpacer,{marginX:2,marginBottom:0},(0,u.createElement)(h.RangeControl,{value:c,min:0,max:null!==(n=null===(o=tl[p])||void 0===o?void 0:o.max)&&void 0!==n?n:100,step:null!==(r=null===(l=tl[p])||void 0===l?void 0:l.step)&&void 0!==r?r:.1,withInputField:!1,onChange:e=>{a([e,p].join(""))},__nextHasNoMarginBottom:!0})))))}function ol(e){const t=(0,a.getBlockSupport)(e,fl);return!!(!0===t||null!=t&&t.minHeight)}function rl(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("dimensions.minHeight");return!ol(e)||t}function ll(e){var t;const{attributes:{style:n},setAttributes:o}=e;if(rl(e))return null;return(0,u.createElement)(nl,{label:(0,_.__)("Min. height"),value:null==n||null===(t=n.dimensions)||void 0===t?void 0:t.minHeight,onChange:e=>{const t={...n,dimensions:{...null==n?void 0:n.dimensions,minHeight:e}};o({style:Ar(t)})}})}function il(e){const t=(0,a.getBlockSupport)(e,hl);return!!(!0===t||null!=t&&t.padding)}function al(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("spacing.padding"),n=!Cl(e,"padding");return!il(e)||t||n}function sl(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l,onMouseOver:i,onMouseOut:a}=e,s=fr("spacing.spacingSizes"),c=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vw"]}),d=El(o,"padding"),p=d&&d.some((e=>bl.includes(e)));if(al(e))return null;const m=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,padding:e}};l({style:Ar(t)})};return u.Platform.select({web:(0,u.createElement)(u.Fragment,null,(!s||0===(null==s?void 0:s.length))&&(0,u.createElement)(h.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.padding,onChange:m,label:(0,_.__)("Padding"),sides:d,units:c,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:a}),(null==s?void 0:s.length)>0&&(0,u.createElement)(wr,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.padding,onChange:m,label:(0,_.__)("Padding"),sides:d,units:c,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:a})),native:null})}function cl(e){var t,n;let{clientId:o,attributes:r,forceShow:l}=e;const i=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,a=(0,u.useMemo)((()=>({borderTopWidth:null!=i&&i.top?or(null==i?void 0:i.top):0,borderRightWidth:null!=i&&i.right?or(null==i?void 0:i.right):0,borderBottomWidth:null!=i&&i.bottom?or(null==i?void 0:i.bottom):0,borderLeftWidth:null!=i&&i.left?or(null==i?void 0:i.left):0})),[i]),[s,c]=(0,u.useState)(!1),d=(0,u.useRef)(i),p=(0,u.useRef)();return(0,u.useEffect)((()=>(Kr()(i,d.current)||l||(c(!0),d.current=i,p.current=setTimeout((()=>{c(!1)}),400)),()=>{c(!1),p.current&&window.clearTimeout(p.current)})),[i,l]),s||l?(0,u.createElement)(Zr,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:i,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,u.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}function ul(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,_.__)("Stretch to fill available space."):"fixed"===e?"horizontal"===n?(0,_.__)("Specify a fixed width."):(0,_.__)("Specify a fixed height."):(0,_.__)("Fit contents.")}function dl(e){let{attributes:t,setAttributes:n,__unstableParentLayout:o}=e;const{style:r={}}=t,{layout:l={}}=r,{selfStretch:i,flexSize:a}=l;return(0,u.useEffect)((()=>{"fixed"!==i||a||n({style:{...r,layout:{...l,selfStretch:"fit"}}})}),[]),(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:gl(o),value:i||"fit",help:ul(i,o),onChange:e=>{const t="fixed"!==e?null:a;n({style:{...r,layout:{...l,selfStretch:e,flexSize:t}}})},isBlock:!0},(0,u.createElement)(h.__experimentalToggleGroupControlOption,{key:"fit",value:"fit",label:(0,_.__)("Fit")}),(0,u.createElement)(h.__experimentalToggleGroupControlOption,{key:"fill",value:"fill",label:(0,_.__)("Fill")}),(0,u.createElement)(h.__experimentalToggleGroupControlOption,{key:"fixed",value:"fixed",label:(0,_.__)("Fixed")})),"fixed"===i&&(0,u.createElement)(h.__experimentalUnitControl,{size:"__unstable-large",onChange:e=>{n({style:{...r,layout:{...l,flexSize:e}}})},value:a}))}function pl(e){let{__unstableParentLayout:t={}}=e;const{type:n="default",default:{type:o="default"}={},allowSizingOnChildren:r=!1}=t;return("flex"===o||"flex"===n)&&r}function ml(e){const t=!fr("layout");return!pl(e)||t}function gl(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,_.__)("Width"):(0,_.__)("Height")}const fl="dimensions",hl="spacing",vl=["top","right","bottom","left"],bl=["vertical","horizontal"];function kl(){const[e,t]=(0,u.useState)(!1),{hideBlockInterface:n,showBlockInterface:o}=Io((0,g.useDispatch)(To));return{isMouseOver:e,onMouseOver:e=>{e.stopPropagation(),n(),t(!0)},onMouseOut:e=>{e.stopPropagation(),o(),t(!1)}}}function _l(e){const t=Il(e),n=al(e),o=Xr(e),r=rl(e),l=ml(e),i=yl(e),s=function(e){if("web"!==u.Platform.OS)return!1;const{name:t}=e;return Sl(t)||ol(t)||il(t)||Qr(t)||pl(e)}(e),d=fr("spacing.spacingSizes"),m=kl(),g=kl();if(i||!s)return null;const f=(0,a.getBlockSupport)(e.name,[fl,"__experimentalDefaultControls"]),v=(0,a.getBlockSupport)(e.name,[hl,"__experimentalDefaultControls"]),b=(e,t)=>n=>{var o;return{...n,style:{...n.style,[t]:{...null===(o=n.style)||void 0===o?void 0:o[t],[e]:void 0}}}},k=p()({"tools-panel-item-spacing":d&&d.length>0}),{__unstableParentLayout:y}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(jr,{group:"dimensions"},!n&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:k,hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,_.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ar({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:b("padding","spacing"),isShownByDefault:null==v?void 0:v.padding,panelId:e.clientId},(0,u.createElement)(sl,c({onMouseOver:m.onMouseOver,onMouseOut:m.onMouseOut},e))),!o&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:k,hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,_.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ar({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:b("margin","spacing"),isShownByDefault:null==v?void 0:v.margin,panelId:e.clientId},(0,u.createElement)(Jr,c({onMouseOver:g.onMouseOver,onMouseOut:g.onMouseOut},e))),!t&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:k,hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,_.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:b("blockGap","spacing"),isShownByDefault:null==v?void 0:v.blockGap,panelId:e.clientId},(0,u.createElement)(xl,e)),!r&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.dimensions)||void 0===n?void 0:n.minHeight)}(e),label:(0,_.__)("Min. height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ar({...o,dimensions:{...null==o?void 0:o.dimensions,minHeight:void 0}})})}(e),resetAllFilter:b("minHeight","dimensions"),isShownByDefault:null==f?void 0:f.minHeight,panelId:e.clientId},(0,u.createElement)(ll,e)),!l&&(0,u.createElement)(h.__experimentalVStack,{as:h.__experimentalToolsPanelItem,spacing:2,hasValue:()=>function(e){var t;return void 0!==(null===(t=e.attributes.style)||void 0===t?void 0:t.layout)}(e),label:gl(y),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,layout:void 0}})}(e),resetAllFilter:b("selfStretch","layout"),isShownByDefault:!1,panelId:e.clientId},(0,u.createElement)(dl,e))),!n&&(0,u.createElement)(cl,c({forceShow:m.isMouseOver},e)),!o&&(0,u.createElement)(el,c({forceShow:g.isMouseOver},e)))}const yl=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Il(e),n=rl(e),o=al(e),r=Xr(e),l=ml(e);return t&&n&&o&&r&&l};function El(e,t){var n;const o=(0,a.getBlockSupport)(e,hl);if(o&&"boolean"!=typeof o[t])return Array.isArray(o[t])?o[t]:null!==(n=o[t])&&void 0!==n&&n.sides?o[t].sides:void 0}function Cl(e,t){const n=El(e,t);return!(n&&n.some((e=>vl.includes(e)))&&n.some((e=>bl.includes(e))))||(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),!1)}function Sl(e){const t=(0,a.getBlockSupport)(e,hl);return!!(!0===t||null!=t&&t.blockGap)}function wl(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:null==e?void 0:e.top,left:t?e:null==e?void 0:e.left}}function Bl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=wl(e);if(!n)return null;const o=or(null==n?void 0:n.top)||t,r=or(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}function Il(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("spacing.blockGap");return!Sl(e)||t}function xl(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=fr("spacing.spacingSizes"),a=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vw"]}),s=El(r,"blockGap"),c=er(n);if(Il(e))return null;const d=s&&s.some((e=>bl.includes(e))),p=e=>{var t;let n=e;e&&d?n={...wl(e)}:null!=e&&e.hasOwnProperty("top")&&(n=e.top);const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:Ar(r)});const i=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var a;c.current&&i&&(null===(a=c.current.parentNode)||void 0===a||a.replaceChild(c.current,c.current))},m=wl(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),g=d?{...m,right:null==m?void 0:m.left,bottom:null==m?void 0:m.top}:{top:null==m?void 0:m.top};return u.Platform.select({web:(0,u.createElement)(u.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(d?(0,u.createElement)(h.__experimentalBoxControl,{label:(0,_.__)("Block spacing"),min:0,onChange:p,units:a,sides:s,values:g,allowReset:!1,splitOnAxis:d}):(0,u.createElement)(h.__experimentalUnitControl,{label:(0,_.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:p,units:a,value:g})),(null==i?void 0:i.length)>0&&(0,u.createElement)(wr,{values:g,onChange:p,label:(0,_.__)("Block spacing"),sides:d?s:["top"],units:a,allowReset:!1,splitOnAxis:d})),native:null})}const Tl=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Ml=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),Nl=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),Pl=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})),Ll=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})),Rl={top:{icon:Nl,title:(0,_._x)("Align top","Block vertical alignment setting")},center:{icon:Ml,title:(0,_._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Tl,title:(0,_._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:Pl,title:(0,_._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:Ll,title:(0,_._x)("Space between","Block vertical alignment setting")}},Al=["top","center","bottom"];var Ol=function(e){let{value:t,onChange:n,controls:o=Al,isCollapsed:r=!0,isToolbar:l}=e;const i=Rl[t],a=Rl.top,s=l?h.ToolbarGroup:h.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{popoverProps:{variant:"toolbar"}};return(0,u.createElement)(s,c({icon:i?i.icon:a.icon,label:(0,_._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...Rl[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};const Dl=e=>(0,u.createElement)(Ol,c({},e,{isToolbar:!1})),zl=e=>(0,u.createElement)(Ol,c({},e,{isToolbar:!0})),Fl={left:Ho,center:Go,right:Uo,"space-between":$o,stretch:jo};var Vl=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:r,popoverProps:l,isToolbar:i}=e;const a=e=>{o(e===r?void 0:e)},s=r?Fl[r]:Fl.left,d=[{name:"left",icon:Ho,title:(0,_.__)("Justify items left"),isActive:"left"===r,onClick:()=>a("left")},{name:"center",icon:Go,title:(0,_.__)("Justify items center"),isActive:"center"===r,onClick:()=>a("center")},{name:"right",icon:Uo,title:(0,_.__)("Justify items right"),isActive:"right"===r,onClick:()=>a("right")},{name:"space-between",icon:$o,title:(0,_.__)("Space between items"),isActive:"space-between"===r,onClick:()=>a("space-between")},{name:"stretch",icon:jo,title:(0,_.__)("Stretch items"),isActive:"stretch"===r,onClick:()=>a("stretch")}],p=i?h.ToolbarGroup:h.ToolbarDropdownMenu,m=i?{isCollapsed:n}:{};return(0,u.createElement)(p,c({icon:s,popoverProps:l,label:(0,_.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},m))};const Hl=e=>(0,u.createElement)(Vl,c({},e,{isToolbar:!1})),Gl=e=>(0,u.createElement)(Vl,c({},e,{isToolbar:!0})),Ul={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},$l={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},jl={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},Wl=["wrap","nowrap"];var Kl={name:"flex",label:(0,_.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:r=!0}=o;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Flex,null,(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(Yl,{layout:t,onChange:n})),(0,u.createElement)(h.FlexItem,null,r&&(0,u.createElement)(Ql,{layout:t,onChange:n}))),(0,u.createElement)(Zl,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;if(null!=o&&o.allowSwitching)return null;const{allowVerticalAlignment:r=!0}=o;return(0,u.createElement)(Vo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,u.createElement)(Yl,{layout:t,onChange:n,isToolbar:!0}),r&&(0,u.createElement)(ql,{layout:t,onChange:n,isToolbar:!0}))},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r,style:l,blockName:i,hasBlockGapSupport:a,layoutDefinitions:s}=e;const{orientation:c="horizontal"}=r,u=null!=l&&null!==(t=l.spacing)&&void 0!==t&&t.blockGap&&!Fr(i,"spacing","blockGap")?Bl(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):void 0,d=Ul[r.justifyContent],p=Wl.includes(r.flexWrap)?r.flexWrap:"wrap",m=jl[r.verticalAlignment],g=$l[r.justifyContent]||$l.left;let f="";const h=[];return p&&"wrap"!==p&&h.push(`flex-wrap: ${p}`),"horizontal"===c?(m&&h.push(`align-items: ${m}`),d&&h.push(`justify-content: ${d}`)):(m&&h.push(`justify-content: ${m}`),h.push("flex-direction: column"),h.push(`align-items: ${g}`)),h.length&&(f=`${qo(o)} {\n\t\t\t\t${h.join("; ")};\n\t\t\t}`),a&&u&&(f+=Yo(o,s,"flex",u)),f},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments(){return[]}};function ql(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{orientation:r="horizontal"}=t,l="horizontal"===r?jl.center:jl.top,{verticalAlignment:i=l}=t,a=e=>{n({...t,verticalAlignment:e})};if(o)return(0,u.createElement)(Dl,{onChange:a,value:i,controls:"horizontal"===r?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]});const s=[{value:"flex-start",label:(0,_.__)("Align items top")},{value:"center",label:(0,_.__)("Align items center")},{value:"flex-end",label:(0,_.__)("Align items bottom")}];return(0,u.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,u.createElement)("legend",null,(0,_.__)("Vertical alignment")),(0,u.createElement)("div",null,s.map(((e,t,n)=>(0,u.createElement)(h.Button,{key:e,label:n,icon:t,isPressed:i===e,onClick:()=>a(e)})))))}function Yl(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:r="left",orientation:l="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===l?a.push("space-between"):a.push("stretch"),o)return(0,u.createElement)(Hl,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",variant:"toolbar"}});const s=[{value:"left",icon:Ho,label:(0,_.__)("Justify items left")},{value:"center",icon:Go,label:(0,_.__)("Justify items center")},{value:"right",icon:Uo,label:(0,_.__)("Justify items right")}];return"horizontal"===l?s.push({value:"space-between",icon:$o,label:(0,_.__)("Space between items")}):s.push({value:"stretch",icon:jo,label:(0,_.__)("Stretch items")}),(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Justification"),value:r,onChange:i,className:"block-editor-hooks__flex-layout-justification-controls"},s.map((e=>{let{value:t,icon:n,label:o}=e;return(0,u.createElement)(h.__experimentalToggleGroupControlOptionIcon,{key:t,value:t,icon:n,label:o})})))}function Zl(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,u.createElement)(h.ToggleControl,{label:(0,_.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function Ql(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal",verticalAlignment:r,justifyContent:l}=t;return(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,_.__)("Orientation"),value:o,onChange:e=>{let o=r,i=l;return"horizontal"===e?("space-between"===r&&(o="center"),"stretch"===l&&(i="left")):("stretch"===r&&(o="top"),"space-between"===l&&(i="left")),n({...t,orientation:e,verticalAlignment:o,justifyContent:i})}},(0,u.createElement)(h.__experimentalToggleGroupControlOptionIcon,{icon:Wo,value:"horizontal",label:(0,_.__)("Horizontal")}),(0,u.createElement)(h.__experimentalToggleGroupControlOptionIcon,{icon:Ko,value:"vertical",label:(0,_.__)("Vertical")}))}var Xl={name:"default",label:(0,_.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function(e){var t;let{selector:n,style:o,blockName:r,hasBlockGapSupport:l,layoutDefinitions:i}=e;const a=Bl(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap);let s="";Fr(r,"spacing","blockGap")||(null!=a&&a.top?s=Bl(null==a?void 0:a.top):"string"==typeof a&&(s=Bl(a)));let c="";return l&&s&&(c+=Yo(n,i,"default",s)),c},getOrientation(){return"vertical"},getAlignments(e,t){const n=Zo(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:n[e]})));const o=[{name:"left"},{name:"center"},{name:"right"}];if(!t){const{contentSize:t,wideSize:r}=e;t&&o.unshift({name:"full"}),r&&o.unshift({name:"wide",info:n.wide})}return o.unshift({name:"none",info:n.none}),o}};var Jl=function(e){let{icon:t,size:n=24,...o}=e;return(0,u.cloneElement)(t,{width:n,height:n,...o})};var ei=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));var ti=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),ni=window.wp.styleEngine,oi={name:"constrained",label:(0,_.__)("Constrained"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r,justifyContent:l="center"}=t,i=[{value:"left",icon:Ho,label:(0,_.__)("Justify items left")},{value:"center",icon:Go,label:(0,_.__)("Justify items center")},{value:"right",icon:Uo,label:(0,_.__)("Justify items right")}],a=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vw"]});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,u.createElement)(h.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,_.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:a}),(0,u.createElement)(Jl,{icon:ei})),(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,u.createElement)(h.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,_.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:a}),(0,u.createElement)(Jl,{icon:ti}))),(0,u.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,_.__)("Customize the width for all elements that are assigned to the center or wide columns.")),(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Justification"),value:l,onChange:e=>{n({...t,justifyContent:e})}},i.map((e=>{let{value:t,icon:n,label:o}=e;return(0,u.createElement)(h.__experimentalToggleGroupControlOptionIcon,{key:t,value:t,icon:n,label:o})}))))},toolBarControls:function(){return null},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r={},style:l,blockName:i,hasBlockGapSupport:a,layoutDefinitions:s}=e;const{contentSize:c,wideSize:u,justifyContent:d}=r,p=Bl(null==l||null===(t=l.spacing)||void 0===t?void 0:t.blockGap);let m="";Fr(i,"spacing","blockGap")||(null!=p&&p.top?m=Bl(null==p?void 0:p.top):"string"==typeof p&&(m=Bl(p)));const g="left"===d?"0 !important":"auto !important",f="right"===d?"0 !important":"auto !important";let h=c||u?`\n\t\t\t\t\t${qo(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=c?c:u};\n\t\t\t\t\t\tmargin-left: ${g};\n\t\t\t\t\t\tmargin-right: ${f};\n\t\t\t\t\t}\n\t\t\t\t\t${qo(o,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=u?u:c};\n\t\t\t\t\t}\n\t\t\t\t\t${qo(o,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";if("left"===d?h+=`${qo(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${g}; }`:"right"===d&&(h+=`${qo(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${f}; }`),null!=l&&null!==(n=l.spacing)&&void 0!==n&&n.padding){(0,ni.getCSSRules)(l).forEach((e=>{"paddingRight"===e.key?h+=`\n\t\t\t\t\t${qo(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===e.key&&(h+=`\n\t\t\t\t\t${qo(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)}))}return a&&m&&(h+=Yo(o,s,"constrained",m)),h},getOrientation(){return"vertical"},getAlignments(e){const t=Zo(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}};const ri=[Xl,Kl,oi];function li(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return ri.find((t=>t.name===e))}const ii={type:"default"},ai=(0,u.createContext)(ii),si=ai.Provider;function ci(){return(0,u.useContext)(ai)}function ui(e){let{layout:t={},css:n,...o}=e;const r=li(t.type),l=null!==fr("spacing.blockGap");if(r){var i;if(n)return(0,u.createElement)("style",null,n);const e=null===(i=r.getLayoutStyle)||void 0===i?void 0:i.call(r,{hasBlockGapSupport:l,layout:t,...o});if(e)return(0,u.createElement)("style",null,e)}return null}const di=[],pi=["none","left","center","right","wide","full"],mi=["wide","full"];function gi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pi;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n,isBlockBasedTheme:o}=(0,g.useSelect)((e=>{const{getSettings:t}=e(To),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout,isBlockBasedTheme:n.__unstableIsBlockBasedTheme}}),[]),r=ci(),l=li(null==r?void 0:r.type),i=l.getAlignments(r,o);if(n){const t=i.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?di:t}if("default"!==l.name&&"constrained"!==l.name)return di;const{alignments:a=pi}=r,s=e.filter((e=>(r.alignments||t||!mi.includes(e))&&a.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?di:s}var fi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"}));var hi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"}));var vi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"}));var bi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"}));const ki={none:{icon:fi,title:(0,_._x)("None","Alignment option")},left:{icon:hi,title:(0,_.__)("Align left")},center:{icon:ei,title:(0,_.__)("Align center")},right:{icon:vi,title:(0,_.__)("Align right")},wide:{icon:ti,title:(0,_.__)("Wide width")},full:{icon:bi,title:(0,_.__)("Full width")}},_i={variant:"toolbar"};var yi=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const i=gi(o);if(!!!i.length)return null;function a(e){n([t,"none"].includes(e)?void 0:e)}const s=ki[t],d=ki.none,m=r?h.ToolbarGroup:h.ToolbarDropdownMenu,g={icon:s?s.icon:d.icon,label:(0,_.__)("Align")},f=r?{isCollapsed:l,controls:i.map((e=>{let{name:n}=e;return{...ki[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>a(n)}}))}:{toggleProps:{describedBy:(0,_.__)("Change alignment")},popoverProps:_i,children:e=>{let{onClose:n}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},i.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=ki[o],s=o===t||!t&&"none"===o;return(0,u.createElement)(h.MenuItem,{key:o,icon:l,iconPosition:"left",className:p()("components-dropdown-menu__menu-item",{"is-active":s}),isSelected:s,onClick:()=>{a(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,u.createElement)(m,c({},g,f))};const Ei=e=>(0,u.createElement)(yi,c({},e,{isToolbar:!1})),Ci=e=>(0,u.createElement)(yi,c({},e,{isToolbar:!0})),Si=["left","center","right","wide","full"],wi=["wide","full"];function Bi(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?Si.filter((t=>e.includes(t))):!0===e?[...Si]:[],!o||!0===e&&!n?t.filter((e=>!wi.includes(e))):t}const Ii=(0,m.createHigherOrderComponent)((e=>t=>{const n=(0,u.createElement)(e,t),{name:o}=t,r=gi(Bi((0,a.getBlockSupport)(o,"align"),(0,a.hasBlockSupport)(o,"alignWide",!0))).map((e=>{let{name:t}=e;return t})),l=(0,g.useSelect)((e=>e(To).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);if(!r.length||l)return n;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Vo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,u.createElement)(Ei,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const r=(0,a.getBlockType)(t.name);(null==r||null===(n=r.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:r})),n)}),"withToolbarControls"),xi=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:r}=o,l=gi(Bi((0,a.getBlockSupport)(n,"align"),(0,a.hasBlockSupport)(n,"alignWide",!0)));if(void 0===r)return(0,u.createElement)(e,t);let i=t.wrapperProps;return l.some((e=>e.name===r))&&(i={...i,"data-align":r}),(0,u.createElement)(e,c({},t,{wrapperProps:i}))}));(0,s.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.align)&&void 0!==t?t:{})||(0,a.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Si,""]}}),e})),(0,s.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",xi),(0,s.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Ii),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Bi((0,a.getBlockSupport)(t,"align"),(0,a.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=p()(`align${o}`,e.className)),e})),(0,s.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const Ti=/[\s#]/g,Mi={type:"string",source:"attribute",attribute:"id",selector:"*"};const Ni=(0,m.createHigherOrderComponent)((e=>t=>{if((0,a.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===u.Platform.OS,o=(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,className:"html-anchor-control",label:(0,_.__)("HTML anchor"),help:(0,u.createElement)(u.Fragment,null,(0,_.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,u.createElement)(h.ExternalLink,{href:(0,_.__)("https://wordpress.org/support/article/page-jumps/")},(0,_.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,_.__)("Add an anchor"),onChange:e=>{e=e.replace(Ti,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(e,t),n&&(0,u.createElement)(jr,{group:"advanced"},o),!n&&"core/heading"===t.name&&(0,u.createElement)(jr,null,(0,u.createElement)(h.PanelBody,{title:(0,_.__)("Heading settings")},o)))}return(0,u.createElement)(e,t)}),"withInspectorControl");(0,s.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.anchor)&&void 0!==t?t:{})||(0,a.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Mi}),e})),(0,s.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Ni),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const Pi={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,s.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.ariaLabel)&&void 0!==n&&n.type||(0,a.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:Pi}),e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const Li=(0,m.createHigherOrderComponent)((e=>t=>(0,a.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,u.createElement)(u.Fragment,null,(0,u.createElement)(e,t),(0,u.createElement)(jr,{group:"advanced"},(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,_.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,_.__)("Separate multiple classes with spaces.")}))):(0,u.createElement)(e,t)),"withInspectorControl");(0,s.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,a.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,s.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",Li),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=p()(e.className,n.className)),e})),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,a.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var r;const o=null===(r=t[n])||void 0===r?void 0:r.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,a.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,a.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,a.getBlockDefaultClassName)(t.name)),e}));var Ri=window.wp.dom;const Ai=(0,u.createContext)({});function Oi(e){let{value:t,children:n}=e;const o=(0,u.useContext)(Ai),r=(0,u.useMemo)((()=>({...o,...t})),[o,t]);return(0,u.createElement)(Ai.Provider,{value:r,children:n})}var Di=Ai;const zi={};var Fi=(0,h.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,a.getBlockType)(n),r=(0,u.useContext)(Di),l=(0,u.useMemo)((()=>o&&o.usesContext?Object.fromEntries(Object.entries(r).filter((e=>{let[t]=e;return o.usesContext.includes(t)}))):zi),[o,r]);if(!o)return null;const i=o.edit||o.save;if(o.apiVersion>1)return(0,u.createElement)(i,c({},e,{context:l}));const s=(0,a.hasBlockSupport)(o,"className",!0)?(0,a.getBlockDefaultClassName)(n):null,d=p()(s,t.className,e.className);return(0,u.createElement)(i,c({},e,{context:l,className:d}))}));function Vi(e){const{name:t,isSelected:n,clientId:o,attributes:r={},__unstableLayoutClassNames:l}=e,{layout:i=null}=r,s={name:t,isSelected:n,clientId:o,layout:(0,a.hasBlockSupport)(t,"__experimentalLayout",!1)?i:null,__unstableLayoutClassNames:l};return(0,u.createElement)(Lo,{value:(0,u.useMemo)((()=>s),Object.values(s))},(0,u.createElement)(Fi,e))}var Hi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"}));var Gi=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,u.createElement)("div",{style:{display:"contents",all:"initial"}},(0,u.createElement)("div",{className:p()(t,"block-editor-warning")},(0,u.createElement)("div",{className:"block-editor-warning__contents"},(0,u.createElement)("p",{className:"block-editor-warning__message"},o),(u.Children.count(n)>0||r)&&(0,u.createElement)("div",{className:"block-editor-warning__actions"},u.Children.count(n)>0&&u.Children.map(n,((e,t)=>(0,u.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,u.createElement)(h.DropdownMenu,{className:"block-editor-warning__secondary",icon:Hi,label:(0,_.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,u.createElement)(h.MenuGroup,null,r.map(((e,t)=>(0,u.createElement)(h.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))},Ui=n(1973);function $i(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,u.createElement)("div",{className:i},(0,u.createElement)("div",{className:"block-editor-block-compare__content"},(0,u.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,u.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,u.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,u.createElement)(u.RawHTML,null,(0,Ri.safeHTML)(o)))),(0,u.createElement)("div",{className:"block-editor-block-compare__action"},(0,u.createElement)(h.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var ji=function(e){let{block:t,onKeep:n,onConvert:o,convertor:r,convertButtonText:l}=e;const i=(s=r(t),(Array.isArray(s)?s:[s]).map((e=>(0,a.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var s;const c=(d=t.originalContent,m=i,(0,Ui.Kx)(d,m).map(((e,t)=>{const n=p()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,u.createElement)("span",{key:t,className:n},e.value)})));var d,m;return(0,u.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,u.createElement)($i,{title:(0,_.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,_.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,u.createElement)($i,{title:(0,_.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:l,rawContent:c,renderedContent:i}))};const Wi=e=>(0,a.rawHandler)({HTML:e.originalContent});var Ki=(0,m.compose)([(0,g.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(To).getBlock(n)}})),(0,g.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(To);return{convertToClassic(){o(n.clientId,(e=>(0,a.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,a.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,Wi(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,a.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:r,block:l}=e;const i=!!(0,a.getBlockType)("core/html"),s=!!(0,a.getBlockType)("core/freeform"),[c,d]=(0,u.useState)(!1),p=(0,u.useCallback)((()=>d(!0)),[]),m=(0,u.useCallback)((()=>d(!1)),[]),g=(0,u.useMemo)((()=>[{title:(0,_._x)("Resolve","imperative verb"),onClick:p},i&&{title:(0,_.__)("Convert to HTML"),onClick:t},s&&{title:(0,_.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[p,i,t,s,o]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Gi,{actions:[(0,u.createElement)(h.Button,{key:"recover",onClick:r,variant:"primary"},(0,_.__)("Attempt Block Recovery"))],secondaryActions:g},(0,_.__)("This block contains unexpected or invalid content.")),c&&(0,u.createElement)(h.Modal,{title:(0,_.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,u.createElement)(ji,{block:l,onKeep:t,onConvert:n,convertor:Wi,convertButtonText:(0,_.__)("Convert to Blocks")})))}));const qi=(0,u.createElement)(Gi,{className:"block-editor-block-list__block-crash-warning"},(0,_.__)("This block has encountered an error and cannot be previewed."));var Yi=()=>qi;class Zi extends u.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}var Qi=Zi,Xi=n(773);var Ji=function(e){let{clientId:t}=e;const[n,o]=(0,u.useState)(""),r=(0,g.useSelect)((e=>e(To).getBlock(t)),[t]),{updateBlock:l}=(0,g.useDispatch)(To);return(0,u.useEffect)((()=>{o((0,a.getBlockContent)(r))}),[r]),(0,u.createElement)(Xi.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,a.getBlockType)(r.name);if(!e)return;const i=(0,a.getBlockAttributes)(e,n,r.attributes),s=n||(0,a.getSaveContent)(e,i),[c]=n?(0,a.validateBlock)({...r,attributes:i,originalContent:s}):[!0];l(t,{attributes:i,originalContent:s,isValid:c}),n||o({content:s})},onChange:e=>o(e.target.value)})},ea=ha(),ta=e=>pa(e,ea),na=ha();ta.write=e=>pa(e,na);var oa=ha();ta.onStart=e=>pa(e,oa);var ra=ha();ta.onFrame=e=>pa(e,ra);var la=ha();ta.onFinish=e=>pa(e,la);var ia=[];ta.setTimeout=(e,t)=>{let n=ta.now()+t,o=()=>{let e=ia.findIndex((e=>e.cancel==o));~e&&ia.splice(e,1),ua-=~e?1:0},r={time:n,handler:e,cancel:o};return ia.splice(aa(n),0,r),ua+=1,ma(),r};var aa=e=>~(~ia.findIndex((t=>t.time>e))||~ia.length);ta.cancel=e=>{oa.delete(e),ra.delete(e),la.delete(e),ea.delete(e),na.delete(e)},ta.sync=e=>{da=!0,ta.batchedUpdates(e),da=!1},ta.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,ta.onStart(n)}return o.handler=e,o.cancel=()=>{oa.delete(n),t=null},o};var sa=typeof window<"u"?window.requestAnimationFrame:()=>{};ta.use=e=>sa=e,ta.now=typeof performance<"u"?()=>performance.now():Date.now,ta.batchedUpdates=e=>e(),ta.catch=console.error,ta.frameLoop="always",ta.advance=()=>{"demand"!==ta.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):fa()};var ca=-1,ua=0,da=!1;function pa(e,t){da?(t.delete(e),e(0)):(t.add(e),ma())}function ma(){ca<0&&(ca=0,"demand"!==ta.frameLoop&&sa(ga))}function ga(){~ca&&(sa(ga),ta.batchedUpdates(fa))}function fa(){let e=ca;ca=ta.now();let t=aa(ca);t&&(va(ia.splice(0,t),(e=>e.handler())),ua-=t),ua?(oa.flush(),ea.flush(e?Math.min(64,ca-e):16.667),ra.flush(),na.flush(),la.flush()):ca=-1}function ha(){let e=new Set,t=e;return{add(n){ua+=t!=e||e.has(n)?0:1,e.add(n)},delete(n){return ua-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,ua-=t.size,va(t,(t=>t(n)&&e.add(t))),ua+=e.size,t=e)}}}function va(e,t){e.forEach((e=>{try{t(e)}catch(e){ta.catch(e)}}))}var ba=n(9196),ka=n.n(ba),_a=Object.defineProperty,ya={};function Ea(){}((e,t)=>{for(var n in t)_a(e,n,{get:t[n],enumerable:!0})})(ya,{assign:()=>Oa,colors:()=>La,createStringInterpolator:()=>Ta,skipAnimation:()=>Ra,to:()=>Ma,willAdvance:()=>Aa});var Ca={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function Sa(e,t){if(Ca.arr(e)){if(!Ca.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function Ba(e,t,n){if(Ca.arr(e))for(let o=0;oCa.und(e)?[]:Ca.arr(e)?e:[e];function xa(e,t){if(e.size){let n=Array.from(e);e.clear(),wa(n,t)}}var Ta,Ma,Na=(e,...t)=>xa(e,(e=>e(...t))),Pa=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),La=null,Ra=!1,Aa=Ea,Oa=e=>{e.to&&(Ma=e.to),e.now&&(ta.now=e.now),void 0!==e.colors&&(La=e.colors),null!=e.skipAnimation&&(Ra=e.skipAnimation),e.createStringInterpolator&&(Ta=e.createStringInterpolator),e.requestAnimationFrame&&ta.use(e.requestAnimationFrame),e.batchedUpdates&&(ta.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Aa=e.willAdvance),e.frameLoop&&(ta.frameLoop=e.frameLoop)},Da=new Set,za=[],Fa=[],Va=0,Ha={get idle(){return!Da.size&&!za.length},start(e){Va>e.priority?(Da.add(e),ta.onStart(Ga)):(Ua(e),ta(ja))},advance:ja,sort(e){if(Va)ta.onFrame((()=>Ha.sort(e)));else{let t=za.indexOf(e);~t&&(za.splice(t,1),$a(e))}},clear(){za=[],Da.clear()}};function Ga(){Da.forEach(Ua),Da.clear(),ta(ja)}function Ua(e){za.includes(e)||$a(e)}function $a(e){za.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(za,(t=>t.priority>e.priority)),0,e)}function ja(e){let t=Fa;for(let n=0;n0}var Wa="[-+]?\\d*\\.?\\d+",Ka=Wa+"%";function qa(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Ya=new RegExp("rgb"+qa(Wa,Wa,Wa)),Za=new RegExp("rgba"+qa(Wa,Wa,Wa,Wa)),Qa=new RegExp("hsl"+qa(Wa,Ka,Ka)),Xa=new RegExp("hsla"+qa(Wa,Ka,Ka,Wa)),Ja=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,es=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ts=/^#([0-9a-fA-F]{6})$/,ns=/^#([0-9a-fA-F]{8})$/;function os(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function rs(e,t,n){let o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=os(r,o,e+1/3),i=os(r,o,e),a=os(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function ls(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function is(e){return(parseFloat(e)%360+360)%360/360}function as(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function ss(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function cs(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=ts.exec(e))?parseInt(t[1]+"ff",16)>>>0:La&&void 0!==La[e]?La[e]:(t=Ya.exec(e))?(ls(t[1])<<24|ls(t[2])<<16|ls(t[3])<<8|255)>>>0:(t=Za.exec(e))?(ls(t[1])<<24|ls(t[2])<<16|ls(t[3])<<8|as(t[4]))>>>0:(t=Ja.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=ns.exec(e))?parseInt(t[1],16)>>>0:(t=es.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Qa.exec(e))?(255|rs(is(t[1]),ss(t[2]),ss(t[3])))>>>0:(t=Xa.exec(e))?(rs(is(t[1]),ss(t[2]),ss(t[3]))|as(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}var us=(e,t,n)=>{if(Ca.fun(e))return e;if(Ca.arr(e))return us({range:e,output:t,extrapolate:n});if(Ca.str(e.output[0]))return Ta(e);let o=e,r=o.output,l=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",a=o.extrapolateRight||o.extrapolate||"extend",s=o.easing||(e=>e);return e=>{let t=function(e,t){for(var n=1;n=e);++n);return n-1}(e,l);return function(e,t,n,o,r,l,i,a,s){let c=s?s(e):e;if(cn){if("identity"===a)return c;"clamp"===a&&(c=n)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,l[t],l[t+1],r[t],r[t+1],s,i,a,o.map)}};var ds=1.70158,ps=1.525*ds,ms=ds+1,gs=2*Math.PI/3,fs=2*Math.PI/4.5,hs=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,vs={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>0===e?0:Math.pow(2,10*e-10),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>ms*e*e*e-ds*e*e,easeOutBack:e=>1+ms*Math.pow(e-1,3)+ds*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*(ps+1)*e-ps)/2:(Math.pow(2*e-2,2)*((ps+1)*(2*e-2)+ps)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*gs),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*gs)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*fs)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*fs)/2+1,easeInBounce:e=>1-hs(1-e),easeOutBounce:hs,easeInOutBounce:e=>e<.5?(1-hs(1-2*e))/2:(1+hs(2*e-1))/2,steps:(e,t="end")=>n=>{let o=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,e),t))(0,1,("end"===t?Math.floor(o):Math.ceil(o))/e)}},bs=Symbol.for("FluidValue.get"),ks=Symbol.for("FluidValue.observers"),_s=e=>Boolean(e&&e[bs]),ys=e=>e&&e[bs]?e[bs]():e,Es=e=>e[ks]||null;function Cs(e,t){let n=e[ks];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var Ss=class{[bs];[ks];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");ws(this,e)}},ws=(e,t)=>Ts(e,bs,t);function Bs(e,t){if(e[bs]){let n=e[ks];n||Ts(e,ks,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Is(e,t){let n=e[ks];if(n&&n.has(t)){let o=n.size-1;o?n.delete(t):e[ks]=null,e.observerRemoved&&e.observerRemoved(o,t)}}var xs,Ts=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ms=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Ns=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Ps=new RegExp(`(${Ms.source})(%|[a-z]+)`,"i"),Ls=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Rs=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,As=e=>{let[t,n]=Os(e);if(!t||Pa())return e;let o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&Rs.test(n)?As(n):n||e},Os=e=>{let t=Rs.exec(e);if(!t)return[,];let[,n,o]=t;return[n,o]},Ds=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,zs=e=>{xs||(xs=La?new RegExp(`(${Object.keys(La).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>ys(e).replace(Rs,As).replace(Ns,cs).replace(xs,cs))),n=t.map((e=>e.match(Ms).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>us({...e,output:t})));return e=>{let n=!Ps.test(t[0])&&t.find((e=>Ps.test(e)))?.replace(Ms,""),r=0;return t[0].replace(Ms,(()=>`${o[r++](e)}${n||""}`)).replace(Ls,Ds)}},Fs="react-spring: ",Vs=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${Fs}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Hs=Vs(console.warn);var Gs=Vs(console.warn);function Us(e){return Ca.str(e)&&("#"==e[0]||/\d/.test(e)||!Pa()&&Rs.test(e)||e in(La||{}))}new WeakMap;new Set,new WeakMap,new WeakMap,new WeakMap;var $s=Pa()?ba.useEffect:ba.useLayoutEffect;function js(){let e=(0,ba.useState)()[1],t=(()=>{let e=(0,ba.useRef)(!1);return $s((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}var Ws=e=>(0,ba.useEffect)(e,Ks),Ks=[];function qs(e){let t=(0,ba.useRef)();return(0,ba.useEffect)((()=>{t.current=e})),t.current}var Ys=Symbol.for("Animated:node"),Zs=e=>e&&e[Ys],Qs=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,Ys,t),Xs=e=>e&&e[Ys]&&e[Ys].getPayload(),Js=class{payload;constructor(){Qs(this,this)}getPayload(){return this.payload||[]}},ec=class extends Js{constructor(e){super(),this._value=e,Ca.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new ec(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Ca.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,Ca.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},tc=class extends ec{_string=null;_toString;constructor(e){super(0),this._toString=us({output:[e,e]})}static create(e){return new tc(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(Ca.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=us({output:[this.getValue(),e]})),this._value=0,super.reset()}},nc={dependencies:null},oc=class extends Js{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return Ba(this.source,((n,o)=>{(e=>!!e&&e[Ys]===e)(n)?t[o]=n.getValue(e):_s(n)?t[o]=ys(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&wa(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return Ba(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){nc.dependencies&&_s(e)&&nc.dependencies.add(e);let t=Xs(e);t&&wa(t,(e=>this.add(e)))}},rc=class extends oc{constructor(e){super(e)}static create(e){return new rc(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){let t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(lc)),!0)}};function lc(e){return(Us(e)?tc:ec).create(e)}function ic(e){let t=Zs(e);return t?t.constructor:Ca.arr(e)?rc:Us(e)?tc:ec}var ac=(e,t)=>{let n=!Ca.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,ba.forwardRef)(((o,r)=>{let l=(0,ba.useRef)(null),i=n&&(0,ba.useCallback)((e=>{l.current=function(e,t){return e&&(Ca.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[a,s]=function(e,t){let n=new Set;return nc.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new oc(e),nc.dependencies=null,[e,n]}(o,t),c=js(),u=()=>{let e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new sc(u,s),p=(0,ba.useRef)();$s((()=>(p.current=d,wa(s,(e=>Bs(e,d))),()=>{p.current&&(wa(p.current.deps,(e=>Is(e,p.current))),ta.cancel(p.current.update))}))),(0,ba.useEffect)(u,[]),Ws((()=>()=>{let e=p.current;wa(e.deps,(t=>Is(t,e)))}));let m=t.getComponentProps(a.getValue());return ba.createElement(e,{...m,ref:i})}))},sc=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&ta.write(this.update)}};var cc=Symbol.for("AnimatedComponent"),uc=e=>Ca.str(e)?e:e&&Ca.str(e.displayName)?e.displayName:Ca.fun(e)&&e.name||null;function dc(e,...t){return Ca.fun(e)?e(...t):e}var pc=(e,t)=>!0===e||!!(t&&e&&(Ca.fun(e)?e(t):Ia(e).includes(t))),mc=(e,t)=>Ca.obj(e)?t&&e[t]:e,gc=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,fc=e=>e,hc=(e,t=fc)=>{let n=vc;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));let o={};for(let r of n){let n=t(e[r],r);Ca.und(n)||(o[r]=n)}return o},vc=["config","onProps","onStart","onChange","onPause","onResume","onRest"],bc={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function kc(e){let t=function(e){let t={},n=0;if(Ba(e,((e,o)=>{bc[o]||(t[o]=e,n++)})),n)return t}(e);if(t){let n={to:t};return Ba(e,((e,o)=>o in t||(n[o]=e))),n}return{...e}}function _c(e){return e=ys(e),Ca.arr(e)?e.map(_c):Us(e)?ya.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function yc(e){for(let t in e)return!0;return!1}function Ec(e){return Ca.fun(e)||Ca.arr(e)&&Ca.obj(e[0])}function Cc(e,t){e.ref?.delete(e),t?.delete(e)}function Sc(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var wc={tension:170,friction:26,mass:1,damping:1,easing:vs.linear,clamp:!1};function Bc(e,t){if(Ca.und(t.decay)){let n=!Ca.und(t.tension)||!Ca.und(t.friction);(n||!Ca.und(t.frequency)||!Ca.und(t.damping)||!Ca.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var Ic=[];function xc(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,a)=>{let s,c,u=pc(n.cancel??o?.cancel,t);if(u)m();else{Ca.und(n.pause)||(r.paused=pc(n.pause,t));let e=o?.pause;!0!==e&&(e=r.paused||pc(e,t)),s=dc(n.delay||0,t),e?(r.resumeQueue.add(p),l.pause()):(l.resume(),p())}function d(){r.resumeQueue.add(p),r.timeouts.delete(c),c.cancel(),s=c.time-ta.now()}function p(){s>0&&!ya.skipAnimation?(r.delayed=!0,c=ta.setTimeout(m,s),r.pauseQueue.add(d),r.timeouts.add(c)):m()}function m(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(d),r.timeouts.delete(c),e<=(r.cancelId||0)&&(u=!0);try{l.start({...n,callId:e,cancel:u},i)}catch(e){a(e)}}}))}var Tc=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Pc(e.get()):t.every((e=>e.noop))?Mc(e.get()):Nc(e.get(),t.every((e=>e.finished))),Mc=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Nc=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Pc=e=>({value:e,cancelled:!0,finished:!1});function Lc(e,t,n,o){let{callId:r,parentId:l,onRest:i}=t,{asyncTo:a,promise:s}=n;return l||e!==a||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;let c,u,d,p=hc(t,((e,t)=>"onRest"===t?void 0:e)),m=new Promise(((e,t)=>(c=e,u=t))),g=e=>{let t=r<=(n.cancelId||0)&&Pc(o)||r!==n.asyncId&&Nc(o,!1);if(t)throw e.result=t,u(e),e},f=(e,t)=>{let l=new Ac,i=new Oc;return(async()=>{if(ya.skipAnimation)throw Rc(n),i.result=Nc(o,!1),u(i),i;g(l);let a=Ca.obj(e)?{...e}:{...t,to:e};a.parentId=r,Ba(p,((e,t)=>{Ca.und(a[t])&&(a[t]=e)}));let s=await o.start(a);return g(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),s})()};if(ya.skipAnimation)return Rc(n),Nc(o,!1);try{let t;t=Ca.arr(e)?(async e=>{for(let t of e)await f(t)})(e):Promise.resolve(e(f,o.stop.bind(o))),await Promise.all([t.then(c),m]),d=Nc(o.get(),!0,!1)}catch(e){if(e instanceof Ac)d=e.result;else{if(!(e instanceof Oc))throw e;d=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?a:void 0,n.promise=l?s:void 0)}return Ca.fun(i)&&ta.batchedUpdates((()=>{i(d,o,o.item)})),d})():s}function Rc(e,t){xa(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var Ac=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},Oc=class extends Error{result;constructor(){super("SkipAnimationSignal")}},Dc=e=>e instanceof Fc,zc=1,Fc=class extends Ss{id=zc++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=Zs(this);return e&&e.getValue()}to(...e){return ya.to(this,e)}interpolate(...e){return Hs(`${Fs}The "interpolate" function is deprecated in v9 (use "to" instead)`),ya.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Cs(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Ha.sort(this),Cs(this,{type:"priority",parent:this,priority:e})}},Vc=Symbol.for("SpringPhase"),Hc=e=>(1&e[Vc])>0,Gc=e=>(2&e[Vc])>0,Uc=e=>(4&e[Vc])>0,$c=(e,t)=>t?e[Vc]|=3:e[Vc]&=-3,jc=(e,t)=>t?e[Vc]|=4:e[Vc]&=-5,Wc=class extends Fc{key;animation=new class{changed=!1;values=Ic;toValues=null;fromValues=Ic;to;from;config=new class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,wc)}};immediate=!1};queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,t){if(super(),!Ca.und(e)||!Ca.und(t)){let n=Ca.obj(e)?{...e}:{...t,from:e};Ca.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Gc(this)||this._state.asyncTo)||Uc(this)}get goal(){return ys(this.animation.to)}get velocity(){let e=Zs(this);return e instanceof ec?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Hc(this)}get isAnimating(){return Gc(this)}get isPaused(){return Uc(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,o=this.animation,{config:r,toValues:l}=o,i=Xs(o.to);!i&&_s(o.to)&&(l=Ia(ys(o.to))),o.values.forEach(((a,s)=>{if(a.done)return;let c=a.constructor==tc?1:i?i[s].lastPosition:l[s],u=o.immediate,d=c;if(!u){if(d=a.lastPosition,r.tension<=0)return void(a.done=!0);let t,n=a.elapsedTime+=e,l=o.fromValues[s],i=null!=a.v0?a.v0:a.v0=Ca.arr(r.velocity)?r.velocity[s]:r.velocity,p=r.precision||(l==c?.005:Math.min(1,.001*Math.abs(c-l)));if(Ca.und(r.duration))if(r.decay){let e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*n);d=l+i/(1-e)*(1-o),u=Math.abs(a.lastPosition-d)<=p,t=i*o}else{t=null==a.lastVelocity?i:a.lastVelocity;let n,o=r.restVelocity||p/10,s=r.clamp?0:r.bounce,m=!Ca.und(s),g=l==c?a.v0>0:lo,n||(u=Math.abs(c-d)<=p,!u));++e){m&&(f=d==c||d>c==g,f&&(t=-t*s,d=c)),t+=(1e-6*-r.tension*(d-c)+.001*-r.friction*t)/r.mass*h,d+=t*h}}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,a.durationProgress>0&&(a.elapsedTime=r.duration*a.durationProgress,n=a.elapsedTime+=e)),o=(r.progress||0)+n/this._memoizedDuration,o=o>1?1:o<0?0:o,a.durationProgress=o),d=l+r.easing(o)*(c-l),t=(d-a.lastPosition)/e,u=1==o}a.lastVelocity=t,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[s].done&&(u=!1),u?a.done=!0:t=!1,a.setValue(d,r.round)&&(n=!0)}));let a=Zs(this),s=a.getValue();if(t){let e=ys(o.to);s===e&&!n||r.decay?n&&r.decay&&this._onChange(s):(a.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(s)}set(e){return ta.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Gc(this)){let{to:e,config:t}=this.animation;ta.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Ca.und(e)?(n=this.queue||[],this.queue=[]):n=[Ca.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>Tc(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),Rc(this._state,e&&this._lastCallId),ta.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||"",{to:n,from:o}=e;n=Ca.obj(n)?n[t]:n,(null==n||Ec(n))&&(n=void 0),o=Ca.obj(o)?o[t]:o,null==o&&(o=void 0);let r={to:n,from:o};return Hc(this)||(e.reverse&&([n,o]=[o,n]),o=ys(o),Ca.und(o)?Zs(this)||this._set(n):this._set(o)),r}_update({...e},t){let{key:n,defaultProps:o}=this;e.default&&Object.assign(o,hc(e,((e,t)=>/^on/.test(t)?mc(e,n):e))),Jc(this,e,"onProps"),eu(this,"onProps",e,this);let r=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let l=this._state;return xc(++this._lastCallId,{key:n,props:e,defaultProps:o,state:l,actions:{pause:()=>{Uc(this)||(jc(this,!0),Na(l.pauseQueue),eu(this,"onPause",Nc(this,Kc(this,this.animation.to)),this))},resume:()=>{Uc(this)&&(jc(this,!1),Gc(this)&&this._resume(),Na(l.resumeQueue),eu(this,"onResume",Nc(this,Kc(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){let t=qc(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Pc(this));let o=!Ca.und(e.to),r=!Ca.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Pc(this));this._lastToId=t.callId}let{key:l,defaultProps:i,animation:a}=this,{to:s,from:c}=a,{to:u=s,from:d=c}=e;r&&!o&&(!t.default||Ca.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let p=!Sa(d,c);p&&(a.from=d),d=ys(d);let m=!Sa(u,s);m&&this._focus(u);let g=Ec(t.to),{config:f}=a,{decay:h,velocity:v}=f;(o||r)&&(f.velocity=0),t.config&&!g&&function(e,t,n){n&&(Bc(n={...n},t),t={...n,...t}),Bc(e,t),Object.assign(e,t);for(let t in wc)null==e[t]&&(e[t]=wc[t]);let{mass:o,frequency:r,damping:l}=e;Ca.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(f,dc(t.config,l),t.config!==i.config?dc(i.config,l):void 0);let b=Zs(this);if(!b||Ca.und(u))return n(Nc(this,!0));let k=Ca.und(t.reset)?r&&!t.default:!Ca.und(d)&&pc(t.reset,l),_=k?d:this.get(),y=_c(u),E=Ca.num(y)||Ca.arr(y)||Us(y),C=!g&&(!E||pc(i.immediate||t.immediate,l));if(m){let e=ic(u);if(e!==b.constructor){if(!C)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(y)}}let S=b.constructor,w=_s(u),B=!1;if(!w){let e=k||!Hc(this)&&p;(m||e)&&(B=Sa(_c(_),y),w=!B),(!Sa(a.immediate,C)&&!C||!Sa(f.decay,h)||!Sa(f.velocity,v))&&(w=!0)}if(B&&Gc(this)&&(a.changed&&!k?w=!0:w||this._stop(s)),!g&&((w||_s(s))&&(a.values=b.getPayload(),a.toValues=_s(u)?null:S==tc?[1]:Ia(y)),a.immediate!=C&&(a.immediate=C,!C&&!k&&this._set(s)),w)){let{onRest:e}=a;wa(Xc,(e=>Jc(this,t,e)));let o=Nc(this,Kc(this,s));Na(this._pendingCalls,o),this._pendingCalls.add(n),a.changed&&ta.batchedUpdates((()=>{a.changed=!k,e?.(o,this),k?dc(i.onRest,o):a.onStart?.(o,this)}))}k&&this._set(_),g?n(Lc(t.to,t,this._state,this)):w?this._start():Gc(this)&&!m?this._pendingCalls.add(n):n(Mc(_))}_focus(e){let t=this.animation;e!==t.to&&(Es(this)&&this._detach(),t.to=e,Es(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;_s(t)&&(Bs(t,this),Dc(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;_s(e)&&Is(e,this)}_set(e,t=!0){let n=ys(e);if(!Ca.und(n)){let e=Zs(this);if(!e||!Sa(n,e.getValue())){let o=ic(n);e&&e.constructor==o?e.setValue(n):Qs(this,o.create(n)),e&&ta.batchedUpdates((()=>{this._onChange(n,t)}))}}return Zs(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,eu(this,"onStart",Nc(this,Kc(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),dc(this.animation.onChange,e,this)),dc(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;Zs(this).reset(ys(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Gc(this)||($c(this,!0),Uc(this)||this._resume())}_resume(){ya.skipAnimation?this.finish():Ha.start(this)}_stop(e,t){if(Gc(this)){$c(this,!1);let n=this.animation;wa(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Cs(this,{type:"idle",parent:this});let o=t?Pc(this.get()):Nc(this.get(),Kc(this,e??n.to));Na(this._pendingCalls,o),n.changed&&(n.changed=!1,eu(this,"onRest",o,this))}}};function Kc(e,t){let n=_c(t);return Sa(_c(e.get()),n)}function qc(e,t=e.loop,n=e.to){let o=dc(t);if(o){let r=!0!==o&&kc(o),l=(r||e).reverse,i=!r||r.reset;return Yc({...e,loop:t,default:!1,pause:void 0,to:!l||Ec(n)?n:void 0,from:i?e.from:void 0,reset:i,...r})}}function Yc(e){let{to:t,from:n}=e=kc(e),o=new Set;return Ca.obj(t)&&Qc(t,o),Ca.obj(n)&&Qc(n,o),e.keys=o.size?Array.from(o):null,e}function Zc(e){let t=Yc(e);return Ca.und(t.default)&&(t.default=hc(t)),t}function Qc(e,t){Ba(e,((e,n)=>null!=e&&t.add(n)))}var Xc=["onStart","onRest","onChange","onPause","onResume"];function Jc(e,t,n){e.animation[n]=t[n]!==gc(t,n)?mc(t[n],e.key):void 0}function eu(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var tu=["onStart","onChange","onRest"],nu=1,ou=class{id=nu++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,t){this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(let t in e){let n=e[t];Ca.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Yc(e)),this}start(e){let{queue:t}=this;return e?t=Ia(e).map(Yc):this.queue=[],this._flush?this._flush(this,t):(uu(this,t),ru(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;wa(Ia(t),(t=>n[t].stop(!!e)))}else Rc(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Ca.und(e))this.start({pause:!0});else{let t=this.springs;wa(Ia(e),(e=>t[e].pause()))}return this}resume(e){if(Ca.und(e))this.start({pause:!1});else{let t=this.springs;wa(Ia(e),(e=>t[e].resume()))}return this}each(e){Ba(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,xa(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&xa(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,xa(n,(([e,t])=>{t.value=i,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}ta.onFrame(this._onFrame)}};function ru(e,t){return Promise.all(t.map((t=>lu(e,t)))).then((t=>Tc(e,t)))}async function lu(e,t,n){let{keys:o,to:r,from:l,loop:i,onRest:a,onResolve:s}=t,c=Ca.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);let u=Ca.arr(r)||Ca.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):wa(tu,(n=>{let o=t[n];if(Ca.fun(o)){let r=e._events[n];t[n]=({finished:e,cancelled:t})=>{let n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));let d=e._state;t.pause===!d.paused?(d.paused=t.pause,Na(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===gc(t,"cancel");(u||m&&d.asyncId)&&p.push(xc(++e._lastAsyncId,{props:t,state:d,actions:{pause:Ea,resume:Ea,start(t,n){m?(Rc(d,e._lastAsyncId),n(Pc(e))):(t.onRest=a,n(Lc(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));let g=Tc(e,await Promise.all(p));if(i&&g.finished&&(!n||!g.noop)){let n=qc(t,i,r);if(n)return uu(e,[n]),lu(e,n,!0)}return s&&ta.batchedUpdates((()=>s(g,e,e.item))),g}function iu(e,t){let n={...e.springs};return t&&wa(Ia(t),(e=>{Ca.und(e.keys)&&(e=Yc(e)),Ca.obj(e.to)||(e={...e,to:void 0}),cu(n,e,(e=>su(e)))})),au(e,n),n}function au(e,t){Ba(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Bs(t,e))}))}function su(e,t){let n=new Wc;return n.key=e,t&&Bs(n,t),n}function cu(e,t,n){t.keys&&wa(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function uu(e,t){wa(t,(t=>{cu(e.springs,t,(t=>su(t,e)))}))}var du=({children:e,...t})=>{let n=(0,ba.useContext)(pu),o=t.pause||!!n.pause,r=t.immediate||!!n.immediate;t=function(e,t){let[n]=(0,ba.useState)((()=>({inputs:t,result:e()}))),o=(0,ba.useRef)(),r=o.current,l=r;return l?Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:o,immediate:r})),[o,r]);let{Provider:l}=pu;return ba.createElement(l,{value:t},e)},pu=function(e,t){return Object.assign(e,ba.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}(du,{});du.Provider=pu.Provider,du.Consumer=pu.Consumer;var mu=()=>{let e=[],t=function(t){Gs(`${Fs}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);let o=[];return wa(e,((e,r)=>{if(Ca.und(t))o.push(e.start());else{let l=n(t,e,r);l&&o.push(e.start(l))}})),o};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){let n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return wa(e,(e=>e.pause(...arguments))),this},t.resume=function(){return wa(e,(e=>e.resume(...arguments))),this},t.set=function(t){wa(e,((e,n)=>{let o=Ca.fun(t)?t(n,e):t;o&&e.set(o)}))},t.start=function(t){let n=[];return wa(e,((e,o)=>{if(Ca.und(t))n.push(e.start());else{let r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return wa(e,(e=>e.stop(...arguments))),this},t.update=function(t){return wa(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};let n=function(e,t,n){return Ca.fun(e)?e(n,t):e};return t._getProps=n,t};function gu(e,t,n){let o=Ca.fun(t)&&t;o&&!n&&(n=[]);let r=(0,ba.useMemo)((()=>o||3==arguments.length?mu():void 0),[]),l=(0,ba.useRef)(0),i=js(),a=(0,ba.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){let n=iu(e,t);return l.current>0&&!a.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?ru(e,t):new Promise((o=>{au(e,n),a.queue.push((()=>{o(ru(e,t))})),i()}))}})),[]),s=(0,ba.useRef)([...a.ctrls]),c=[],u=qs(e)||0;function d(e,n){for(let r=e;r{wa(s.current.slice(e,u),(e=>{Cc(e,r),e.stop(!0)})),s.current.length=e,d(u,e)}),[e]),(0,ba.useMemo)((()=>{d(0,Math.min(u,e))}),n);let p=s.current.map(((e,t)=>iu(e,c[t]))),m=(0,ba.useContext)(du),g=qs(m),f=m!==g&&yc(m);$s((()=>{l.current++,a.ctrls=s.current;let{queue:e}=a;e.length&&(a.queue=[],wa(e,(e=>e()))),wa(s.current,((e,t)=>{r?.add(e),f&&e.start({default:m});let n=c[t];n&&(Sc(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Ws((()=>()=>{wa(a.ctrls,(e=>e.stop(!0)))}));let h=p.map((e=>({...e})));return r?[h,r]:h}function fu(e,t){let n=Ca.fun(e),[[o],r]=gu(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[o,r]:o}var hu=class extends Fc{constructor(e,t){super(),this.source=e,this.calc=us(...t);let n=this._get(),o=ic(n);Qs(this,o.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();Sa(t,this.get())||(Zs(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&bu(this._active)&&ku(this)}_get(){let e=Ca.arr(this.source)?this.source.map(ys):Ia(ys(this.source));return this.calc(...e)}_start(){this.idle&&!bu(this._active)&&(this.idle=!1,wa(Xs(this),(e=>{e.done=!1})),ya.skipAnimation?(ta.batchedUpdates((()=>this.advance())),ku(this)):Ha.start(this))}_attach(){let e=1;wa(Ia(this.source),(t=>{_s(t)&&Bs(t,this),Dc(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){wa(Ia(this.source),(e=>{_s(e)&&Is(e,this)})),this._active.clear(),ku(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=Ia(this.source).reduce(((e,t)=>Math.max(e,(Dc(t)?t.priority:0)+1)),0))}};function vu(e){return!1!==e.idle}function bu(e){return!e.size||Array.from(e).every(vu)}function ku(e){e.idle||(e.idle=!0,wa(Xs(e),(e=>{e.done=!0})),Cs(e,{type:"idle",parent:e}))}ya.assign({createStringInterpolator:zs,to:(e,t)=>new hu(e,t)});Ha.advance;var _u=window.ReactDOM,yu=/^--/;function Eu(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||yu.test(e)||Su.hasOwnProperty(e)&&Su[e]?(""+t).trim():t+"px"}var Cu={};var Su={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},wu=["Webkit","Ms","Moz","O"];Su=Object.keys(Su).reduce(((e,t)=>(wu.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Su);var Bu=/^(matrix|translate|scale|rotate|skew)/,Iu=/^(translate)/,xu=/^(rotate|skew)/,Tu=(e,t)=>Ca.num(e)&&0!==e?e+t:e,Mu=(e,t)=>Ca.arr(e)?e.every((e=>Mu(e,t))):Ca.num(e)?e===t:parseFloat(e)===t,Nu=class extends oc{constructor({x:e,y:t,z:n,...o}){let r=[],l=[];(e||t||n)&&(r.push([e||0,t||0,n||0]),l.push((e=>[`translate3d(${e.map((e=>Tu(e,"px"))).join(",")})`,Mu(e,0)]))),Ba(o,((e,t)=>{if("transform"===t)r.push([e||""]),l.push((e=>[e,""===e]));else if(Bu.test(t)){if(delete o[t],Ca.und(e))return;let n=Iu.test(t)?"px":xu.test(t)?"deg":"";r.push(Ia(e)),l.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Tu(r,n)})`,Mu(r,0)]:e=>[`${t}(${e.map((e=>Tu(e,n))).join(",")})`,Mu(e,t.startsWith("scale")?1:0)])}})),r.length&&(o.transform=new Pu(r,l)),super(o)}},Pu=class extends Ss{constructor(e,t){super(),this.inputs=e,this.transforms=t}_value=null;get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return wa(this.inputs,((n,o)=>{let r=ys(n[0]),[l,i]=this.transforms[o](Ca.arr(r)?r:n.map(ys));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&wa(this.inputs,(e=>wa(e,(e=>_s(e)&&Bs(e,this)))))}observerRemoved(e){0==e&&wa(this.inputs,(e=>wa(e,(e=>_s(e)&&Is(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Cs(this,e)}};ya.assign({batchedUpdates:_u.unstable_batchedUpdates,createStringInterpolator:zs,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});var Lu=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new oc(e)),getComponentProps:o=(e=>e)}={})=>{let r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{let t=uc(e)||"Anonymous";return(e=Ca.str(e)?l[e]||(l[e]=ac(e,r)):e[cc]||(e[cc]=ac(e,r))).displayName=`Animated(${t})`,e};return Ba(e,((t,n)=>{Ca.arr(e)&&(n=uc(t)),l[n]=l(t)})),{animated:l}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;let n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{style:o,children:r,scrollTop:l,scrollLeft:i,viewBox:a,...s}=t,c=Object.values(s),u=Object.keys(s).map((t=>n||e.hasAttribute(t)?t:Cu[t]||(Cu[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==r&&(e.textContent=r);for(let t in o)if(o.hasOwnProperty(t)){let n=Eu(t,o[t]);yu.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==l&&(e.scrollTop=l),void 0!==i&&(e.scrollLeft=i),void 0!==a&&e.setAttribute("viewBox",a)},createAnimatedStyle:e=>new Nu(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),Ru=Lu.animated;const Au=e=>e+1,Ou=e=>({top:e.offsetTop,left:e.offsetLeft});var Du=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,u.useRef)(),i=(0,m.useReducedMotion)()||!o,[a,s]=(0,u.useReducer)(Au,0),[c,d]=(0,u.useReducer)(Au,0),[p,g]=(0,u.useState)({x:0,y:0}),f=(0,u.useMemo)((()=>l.current?Ou(l.current):null),[r]),h=(0,u.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,Ri.getScrollContainer)(l.current);if(!e)return()=>{};const t=l.current.getBoundingClientRect();return()=>{const n=l.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[r,n]);return(0,u.useLayoutEffect)((()=>{a&&d()}),[a]),(0,u.useLayoutEffect)((()=>{if(!f)return;if(i)return void h();l.current.style.transform=void 0;const e=Ou(l.current);s(),g({x:Math.round(f.left-e.left),y:Math.round(f.top-e.top)})}),[r]),fu({from:{x:p.x,y:p.y},to:{x:0,y:0},reset:a!==c,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:function(e){let{value:n}=e;if(!l.current)return;let{x:o,y:r}=n;o=Math.round(o),r=Math.round(r);const i=0===o&&0===r;l.current.style.transformOrigin="center center",l.current.style.transform=i?void 0:`translate3d(${o}px,${r}px,0)`,l.current.style.zIndex=t?"1":"",h()}}),l};const zu=".block-editor-block-list__block",Fu=".block-list-appender",Vu=".block-editor-button-block-appender";function Hu(e,t){return t.closest([zu,Fu,Vu].join(","))===e}function Gu(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(zu);return t?t.id.slice("block-".length):void 0}function Uu(e){const t=(0,u.useRef)(),n=function(e){return(0,g.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,__unstableGetEditorMode:o,isBlockSelected:r}=t(To);if(r(e)&&"edit"===o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,g.useSelect)(To);return(0,u.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(Hu(t.current,l.activeElement))return;const i=Ri.focus.tabbable.find(t.current).filter((e=>(0,Ri.isTextField)(e))),a=-1===n,s=i[a?i.length-1:0]||t.current;if(Hu(t.current,s)){if(!t.current.getAttribute("contenteditable")){const e=Ri.focus.tabbable.findNext(t.current);if(e&&Hu(t.current,e)&&(0,Ri.isFormElement)(e))return void e.focus()}(0,Ri.placeCaretAtHorizontalEdge)(s,a)}else t.current.focus()}),[n,e]),t}function $u(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function ju(){const e=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return t().outlineMode}),[]);return(0,m.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",$u),t.addEventListener("mouseover",$u),()=>{t.removeEventListener("mouseout",$u),t.removeEventListener("mouseover",$u),t.classList.remove("is-hovered")}}),[e])}function Wu(e){return(0,g.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:r,isBlockMultiSelected:l,getBlockName:i,getSettings:s,hasSelectedInnerBlock:c,isTyping:u,__unstableIsFullySelected:d,__unstableSelectionHasUnmergeableBlock:m}=t(To),{outlineMode:g}=s(),f=n(e),h=r(e),v=i(e),b=c(e,!0),k=l(e);return p()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":k,"is-partially-selected":k&&!d()&&!m(),"is-reusable":(0,a.isReusableBlock)((0,a.getBlockType)(v)),"is-dragging":f,"has-child-selected":b,"remove-outline":h&&g&&u()})}),[e])}function Ku(e){return(0,g.useSelect)((t=>{const n=t(To).getBlockName(e),o=(0,a.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,a.getBlockDefaultClassName)(n)}),[e])}function qu(e){return(0,g.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(To),r=o(e);if(null==r||!r.className)return;const l=(0,a.getBlockType)(n(e));return(null==l?void 0:l.apiVersion)>1?r.className:void 0}),[e])}function Yu(e){return(0,g.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(To);if(!i(e))return;const a=n();return a?p()("is-block-moving-mode",{"can-insert-moving-block":o(r(a),l(e))}):void 0}),[e])}function Zu(e){const{isBlockSelected:t}=(0,g.useSelect)(To),{selectBlock:n,selectionChange:o}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):Hu(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var Qu=window.wp.keycodes;function Xu(e){const t=(0,g.useSelect)((t=>t(To).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,g.useSelect)(To),{insertDefaultBlock:r,removeBlock:l}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",a),i.addEventListener("dragstart",s),()=>{i.removeEventListener("keydown",a),i.removeEventListener("dragstart",s)};function a(t){const{keyCode:a,target:s}=t;a!==Qu.ENTER&&a!==Qu.BACKSPACE&&a!==Qu.DELETE||s!==i||(0,Ri.isTextField)(s)||(t.preventDefault(),a===Qu.ENTER?r({},n(e),o(e)+1):l(e))}function s(e){e.preventDefault()}}),[e,t,n,o,r,l])}function Ju(e){const{isNavigationMode:t,isBlockSelected:n}=(0,g.useSelect)(To),{setNavigationMode:o,selectBlock:r}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}function ed(){const e=(0,u.useContext)(Uv);return(0,m.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function td(e){return(0,g.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(To);return n(e)}),[e])}function nd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n,className:o,wrapperProps:r={},isAligned:l}=(0,u.useContext)(od),{index:i,mode:s,name:c,blockApiVersion:d,blockTitle:f,isPartOfSelection:h,adjustScrolling:v,enableAnimation:b}=(0,g.useSelect)((e=>{const{getBlockAttributes:t,getBlockIndex:o,getBlockMode:r,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:c,isBlockMultiSelected:u,isAncestorMultiSelected:d,isFirstMultiSelectedBlock:p}=e(To),{getActiveBlockVariation:m}=e(a.store),g=c(n),f=u(n)||d(n),h=l(n),v=(0,a.getBlockType)(h),b=m(h,t(n));return{index:o(n),mode:r(n),name:h,blockApiVersion:(null==v?void 0:v.apiVersion)||1,blockTitle:(null==b?void 0:b.title)||(null==v?void 0:v.title),isPartOfSelection:g||f,adjustScrolling:g||p(n),enableAnimation:!i()&&s()<=200}}),[n]),k=td(n),y=(0,_.sprintf)((0,_.__)("Block: %s"),f),E="html"!==s||t?"":"-visual",C=(0,m.useMergeRefs)([e.ref,Uu(n),Jo(n),Zu(n),Xu(n),Ju(n),ju(),ed(),Du({isSelected:h,adjustScrolling:v,enableAnimation:b,triggerAnimationOnChange:i}),(0,m.useDisabled)({isDisabled:!k})]),S=Ro();return d<2&&n===S.clientId&&"undefined"!=typeof process&&process.env,{tabIndex:0,...r,...e,ref:C,id:`block-${n}${E}`,role:"document","aria-label":y,"data-block":n,"data-type":c,"data-title":f,className:p()(p()("block-editor-block-list__block",{"wp-block":!l,"has-block-overlay":k}),o,e.className,r.className,Wu(n),Ku(n),qu(n),Yu(n)),style:{...r.style,...e.style}}}nd.save=a.__unstableGetBlockProps;const od=(0,u.createContext)();function rd(e){let{children:t,isHtml:n,...o}=e;return(0,u.createElement)("div",nd(o,{__unstableIsHtml:n}),t)}const ld=(0,g.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:l,isSelectionEnabled:i,getTemplateLock:a,__unstableGetBlockWithoutInnerBlocks:s,canRemoveBlock:c,canMoveBlock:u}=e(To),d=s(n),p=r(n),m=a(o),g=c(n,o),f=u(n,o),{name:h,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:g,canMove:f,block:d,name:h,attributes:v,isValid:b,isSelected:p}})),id=(0,g.withDispatch)(((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:r,mergeBlocks:l,replaceBlocks:i,toggleSelection:s,__unstableMarkLastChangeAsPersistent:c,moveBlocksToPosition:u,removeBlock:d}=e(To);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select(To),l=r(),{clientId:i}=t,a=l.length?l:[i];o(a,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;r(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:l}=t,{getBlockIndex:i}=n.select(To),a=i(o);r(e,a+1,l)},onMerge(e){const{clientId:o,rootClientId:i}=t,{getPreviousBlockClientId:s,getNextBlockClientId:c,getBlock:p,getBlockAttributes:m,getBlockName:g,getBlockOrder:f,getBlockIndex:h,getBlockRootClientId:v,canInsertBlockType:b}=n.select(To);function k(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const o=v(e),l=f(e),[i]=l;if(1===l.length&&(0,a.isUnmodifiedBlock)(p(i)))d(e);else{if(b(g(i),o))u([i],e,o,h(e));else{const l=(0,a.switchToBlockType)(p(i),(0,a.getDefaultBlockName)());l&&l.length&&n.batch((()=>{r(l,h(e),o,t),d(i,!1)}))}!f(e).length&&(0,a.isUnmodifiedBlock)(p(e))&&d(e,!1)}}if(e){if(i){const e=c(i);if(e){if(g(i)!==g(e))return void l(i,e);{const t=m(i),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(f(e),e,i),d(e,!1)}))}}}const e=c(o);if(!e)return;f(e).length?k(e,!1):l(o,e)}else{const e=s(o);if(e)l(e,o);else if(i){const e=s(i);if(e&&g(i)===g(e)){const t=m(i),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(f(i),i,e),d(i,!1)}))}k(i)}}},onReplace(e,n,o){e.length&&!(0,a.isUnmodifiedDefaultBlock)(e[e.length-1])&&c(),i([t.clientId],e,n,o)},toggleSelection(e){s(e)}}}));var ad=(0,m.compose)(m.pure,ld,id,(0,m.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,h.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:r,canRemove:l,clientId:i,isSelected:s,isSelectionEnabled:c,className:d,__unstableLayoutClassNames:m,name:f,isValid:h,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const{themeSupportsLayout:S,hasContentLockedParent:w,isContentBlock:B,isContentLocking:I,isTemporarilyEditingAsBlocks:x}=(0,g.useSelect)((e=>{const{getSettings:t,__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=e(To),l=!!n(i);return{themeSupportsLayout:t().supportsLayout,isContentBlock:e(a.store).__experimentalHasContentRoleAttribute(f),hasContentLockedParent:l,isContentLocking:"contentOnly"===o(i)&&!l,isTemporarilyEditingAsBlocks:r()===i}}),[f,i]),{removeBlock:T}=(0,g.useDispatch)(To),M=(0,u.useCallback)((()=>T(i)),[i]),N=ci()||{};let P=(0,u.createElement)(Vi,{name:f,isSelected:s,attributes:v,setAttributes:k,insertBlocksAfter:r?void 0:y,onReplace:l?_:void 0,onRemove:l?M:void 0,mergeBlocks:l?E:void 0,clientId:i,isSelectionEnabled:c,toggleSelection:C,__unstableLayoutClassNames:m,__unstableParentLayout:Object.keys(N).length?N:void 0});const L=(0,a.getBlockType)(f);w&&!B&&(b={...b,tabIndex:-1}),null!=L&&L.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return null!=e&&e.className&&null!=t&&t.className&&(n.className=p()(e.className,t.className)),null!=e&&e.style&&null!=t&&t.style&&(n.style={...e.style,...t.style}),n}(b,L.getEditWrapperProps(v)));const R=b&&!!b["data-align"]&&!S;let A;if(R&&(P=(0,u.createElement)("div",{className:"wp-block","data-align":b["data-align"]},P)),h)A="html"===o?(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{style:{display:"none"}},P),(0,u.createElement)(rd,{isHtml:!0},(0,u.createElement)(Ji,{clientId:i}))):(null==L?void 0:L.apiVersion)>1?P:(0,u.createElement)(rd,b,P);else{const e=n?(0,a.serializeRawBlock)(n):(0,a.getSaveContent)(L,v);A=(0,u.createElement)(rd,{className:"has-warning"},(0,u.createElement)(Ki,{clientId:i}),(0,u.createElement)(u.RawHTML,null,(0,Ri.safeHTML)(e)))}const{"data-align":O,...D}=null!==(t=b)&&void 0!==t?t:{},z={clientId:i,className:p()({"is-content-locked":I,"is-content-locked-temporarily-editing-as-blocks":x,"is-content-block":w&&B},O&&S&&`align${O}`,d),wrapperProps:D,isAligned:R},F=(0,u.useMemo)((()=>z),Object.values(z));return(0,u.createElement)(od.Provider,{value:F},(0,u.createElement)(Qi,{fallback:(0,u.createElement)(rd,{className:"has-warning"},(0,u.createElement)(Yi,null))},A))})),sd=window.wp.htmlEntities;var cd=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const ud=[(0,u.createInterpolateElement)((0,_.__)("While writing, you can press / to quickly insert new blocks."),{kbd:(0,u.createElement)("kbd",null)}),(0,u.createInterpolateElement)((0,_.__)("Indent a list by pressing space at the beginning of a line."),{kbd:(0,u.createElement)("kbd",null)}),(0,u.createInterpolateElement)((0,_.__)("Outdent a list by pressing backspace at the beginning of a line."),{kbd:(0,u.createElement)("kbd",null)}),(0,_.__)("Drag files into the editor to automatically insert media blocks."),(0,_.__)("Change a block's type by pressing the block icon on the toolbar.")];var dd=function(){const[e]=(0,u.useState)(Math.floor(Math.random()*ud.length));return(0,u.createElement)(h.Tip,null,ud[e])};var pd=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));var md=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var gd=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"}));var fd=(0,u.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:r,context:l}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:gd});const i=(0,u.createElement)(h.Icon,{icon:n&&n.src?n.src:n,context:l}),a=o?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,u.createElement)("span",{style:a,className:p()("block-editor-block-icon",r,{"has-colors":o})},i)}));var hd=function(e){let{title:t,icon:n,description:o,blockType:r,className:l}=e;r&&(W()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r));const{parentNavBlockClientId:i}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e(To);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:a}=(0,g.useDispatch)(To);return(0,u.createElement)("div",{className:p()("block-editor-block-card",l)},i&&(0,u.createElement)(h.Button,{onClick:()=>a(i),label:(0,_.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,_.isRTL)()?pd:md,isSmall:!0}),(0,u.createElement)(fd,{icon:n,showColors:!0}),(0,u.createElement)("div",{className:"block-editor-block-card__content"},(0,u.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,u.createElement)("span",{className:"block-editor-block-card__description"},o)))};const vd=(0,m.createHigherOrderComponent)((e=>(0,g.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,u.createElement)(e,c({registry:o},r));const[l,i]=(0,u.useState)(null);return(0,u.useEffect)((()=>{const e=(0,g.createRegistry)({},o);e.registerStore(So,xo),i(e)}),[o]),l?(0,u.createElement)(g.RegistryProvider,{value:l},(0,u.createElement)(e,c({registry:l},r))):null}))),"withRegistryProvider");const bd=()=>{};function kd(e){let{clientId:t=null,value:n,selection:o,onChange:r=bd,onInput:l=bd}=e;const i=(0,g.useRegistry)(),{resetBlocks:s,resetSelection:c,replaceInnerBlocks:d,setHasControlledInnerBlocks:p,__unstableMarkNextChangeAsNotPersistent:m}=i.dispatch(To),{getBlockName:f,getBlocks:h}=i.select(To),v=(0,g.useSelect)((e=>!t||e(To).areInnerBlocksControlled(t)),[t]),b=(0,u.useRef)({incoming:null,outgoing:[]}),k=(0,u.useRef)(!1),_=()=>{n&&(m(),t?i.batch((()=>{p(t,!0);const e=n.map((e=>(0,a.cloneBlock)(e)));k.current&&(b.current.incoming=e),m(),d(t,e)})):(k.current&&(b.current.incoming=n),s(n)))},y=(0,u.useRef)(l),E=(0,u.useRef)(r);(0,u.useEffect)((()=>{y.current=l,E.current=r}),[l,r]),(0,u.useEffect)((()=>{b.current.outgoing.includes(n)?b.current.outgoing[b.current.outgoing.length-1]===n&&(b.current.outgoing=[]):h(t)!==n&&(b.current.outgoing=[],_(),o&&c(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,u.useEffect)((()=>{v||(b.current.outgoing=[],_())}),[v]),(0,u.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:a}=i.select(To);let s=h(t),c=r(),u=!1;k.current=!0;const d=i.subscribe((()=>{if(null!==t&&null===f(t))return;if(!(!t||a(t)))return;const i=r(),d=h(t),p=d!==s;if(s=d,p&&(b.current.incoming||l()))return b.current.incoming=null,void(c=i);if(p||u&&!p&&i&&!c){c=i,b.current.outgoing.push(s);(c?E.current:y.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})}u=p}));return()=>{k.current=!1,d()}}),[i,t])}const _d=vd((e=>{const{children:t,settings:n,stripExperimentalSettings:o=!1}=e,{__experimentalUpdateSettings:r}=Io((0,g.useDispatch)(To));return(0,u.useEffect)((()=>{r({...n,__internalIsInitialized:!0},o)}),[n]),kd(e),(0,u.createElement)(Xo,null,t)}));var yd=e=>(0,u.createElement)(_d,c({},e,{stripExperimentalSettings:!0}),e.children);function Ed(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,g.useSelect)(To),{clearSelectedBlock:o}=(0,g.useDispatch)(To),{clearBlockSelection:r}=e();return(0,m.useRefEffect)((e=>{if(r)return e.addEventListener("mousedown",l),()=>{e.removeEventListener("mousedown",l)};function l(r){(t()||n())&&r.target===e&&o()}}),[t,n,o,r])}function Cd(e){return(0,u.createElement)("div",c({ref:Ed()},e))}function Sd(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(To);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function wd(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,g.useSelect)(Sd,[]);return(0,m.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:a}=i;if(null==e)return;if(!o||t)return;const{length:s}=n;s<2||l&&(r.contentEditable=!0,r.focus(),a.getSelection().removeAllRanges())}),[o,t,n,r,e,l])}function Bd(e,t,n,o){let r,l=Ri.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),l.find((function(e){if(1!==e.children.length||!function(e,t){return e.closest(zu)===t.closest(zu)}(e,e.firstElementChild)||"true"!==e.firstElementChild.getAttribute("contenteditable")){if(!Ri.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}}))}function Id(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,g.useSelect)(To),{selectBlock:l}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((i=>{let a;function s(){a=null}function c(s){if(s.defaultPrevented)return;const{keyCode:c,target:u,shiftKey:d,ctrlKey:p,altKey:m,metaKey:g}=s,f=c===Qu.UP,h=c===Qu.DOWN,v=c===Qu.LEFT,b=c===Qu.RIGHT,k=f||v,_=v||b,y=f||h,E=_||y,C=d||p||m||g,S=y?Ri.isVerticalEdge:Ri.isHorizontalEdge,{ownerDocument:w}=i,{defaultView:B}=w;if(!E)return;if(o()){if(d)return;if(!r())return;return s.preventDefault(),void(k?l(e()):l(t(),-1))}if(!function(e,t,n){if((t===Qu.UP||t===Qu.DOWN)&&!n)return!0;const{tagName:o}=e;if("INPUT"===o)return["button","checkbox","color","file","image","radio","reset","submit"].includes(e.getAttribute("type"));return"TEXTAREA"!==o}(u,c,C))return;y?a||(a=(0,Ri.computeCaretRect)(B)):a=null;const I=(0,Ri.isRTL)(u)?!k:k,{keepCaretInsideBlock:x}=n();if(d)(function(e,t){const n=Bd(e,t,i);return n&&Gu(n)})(u,k)&&S(u,k)&&(i.contentEditable=!0,i.focus());else if(!y||!(0,Ri.isVerticalEdge)(u,k)||m&&!(0,Ri.isHorizontalEdge)(u,I)||x){if(_&&B.getSelection().isCollapsed&&(0,Ri.isHorizontalEdge)(u,I)&&!x){const e=Bd(u,I,i);(0,Ri.placeCaretAtHorizontalEdge)(e,k),s.preventDefault()}}else{const e=Bd(u,k,i,!0);e&&((0,Ri.placeCaretAtVerticalEdge)(e,m?!k:k,m?void 0:a),s.preventDefault())}}return i.addEventListener("mousedown",s),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",s),i.removeEventListener("keydown",c)}}),[])}var xd=window.wp.keyboardShortcuts;function Td(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,g.useSelect)(To),{multiSelect:o,selectBlock:r}=(0,g.useDispatch)(To),l=(0,xd.__unstableUseShortcutEventMatch)();return(0,m.useRefEffect)((i=>{function a(a){if(!l("core/block-editor/select-all",a))return;const s=t();if(s.length<2&&!(0,Ri.isEntirelySelected)(a.target))return;a.preventDefault();const[c]=s,u=n(c),d=e(u);s.length!==d.length?o(d[0],d[d.length-1]):u&&(i.ownerDocument.defaultView.getSelection().removeAllRanges(),r(u))}return i.addEventListener("keydown",a),()=>{i.removeEventListener("keydown",a)}}),[])}function Md(e,t){e.contentEditable=t,t&&e.focus()}function Nd(){const{startMultiSelect:e,stopMultiSelect:t}=(0,g.useDispatch)(To),{isSelectionEnabled:n,hasMultiSelection:o,isDraggingBlocks:r}=(0,g.useSelect)(To);return(0,m.useRefEffect)((l=>{const{ownerDocument:i}=l,{defaultView:a}=i;let s,c;function u(){t(),a.removeEventListener("mouseup",u),c=a.requestAnimationFrame((()=>{if(o())return;Md(l,!1);const e=a.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);s.contains(t)&&s.focus()}}))}function d(t){let{buttons:o,target:c}=t;r()||1===o&&c.getAttribute("contenteditable")&&n()&&(s=i.activeElement,e(),a.addEventListener("mouseup",u),Md(l,!0))}return l.addEventListener("mouseout",d),()=>{l.removeEventListener("mouseout",d),a.removeEventListener("mouseup",u),a.cancelAnimationFrame(c)}}),[e,t,n,o])}function Pd(e,t){e.contentEditable=t,t&&e.focus()}function Ld(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,g.useDispatch)(To),{getBlockParents:o,getBlockSelectionStart:r}=(0,g.useSelect)(To);return(0,m.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function a(l){const a=i.getSelection();if(!a.rangeCount)return;const s=l.shiftKey&&"mouseup"===l.type;if(a.isCollapsed&&!s)return void Pd(n,!1);let c=Gu(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(a)),u=Gu(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(a));if(s){const e=r(),t=Gu(l.target),n=t!==u;(c===u&&a.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0===c&&void 0===u)return void Pd(n,!1);if(c===u)t(c);else{const t=[...o(c),c],n=[...o(u),u],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}}function s(){l.addEventListener("selectionchange",a),i.addEventListener("mouseup",a)}function c(){l.removeEventListener("selectionchange",a),i.removeEventListener("mouseup",a)}function u(){c(),s()}return s(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,o])}function Rd(){const{selectBlock:e}=(0,g.useDispatch)(To),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,g.useSelect)(To);return(0,m.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),a=Gu(l.target);l.shiftKey?i!==a&&(r.contentEditable=!0,r.focus()):o()&&e(a)}return r.addEventListener("mousedown",l),()=>{r.removeEventListener("mousedown",l)}}),[e,t,n,o])}function Ad(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,g.useSelect)(To),{replaceBlocks:r,__unstableSplitSelection:l,removeBlocks:i,__unstableDeleteSelection:s,__unstableExpandSelection:c}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((u=>{function d(e){var t;o()&&null!==(t=e.inputType)&&void 0!==t&&t.startsWith("format")&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===Qu.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?r(t(),(0,a.createBlock)((0,a.getDefaultBlockName)())):l()):d.keyCode===Qu.BACKSPACE||d.keyCode===Qu.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?i(t()):n()?s(d.keyCode===Qu.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?s(d.keyCode===Qu.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function m(e){o()&&(u.contentEditable=!1,n()?s():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("beforeinput",d),u.addEventListener("keydown",p),u.addEventListener("compositionstart",m),()=>{u.removeEventListener("beforeinput",d),u.removeEventListener("keydown",p),u.removeEventListener("compositionstart",m)}}),[])}function Od(){const[e,t,n]=function(){const e=(0,u.useRef)(),t=(0,u.useRef)(),n=(0,u.useRef)(),o=(0,u.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,g.useSelect)(To),{setNavigationMode:a}=(0,g.useDispatch)(To),s=(0,g.useSelect)((e=>e(To).isNavigationMode()),[])?void 0:"0",c=(0,u.useRef)();function d(t){if(c.current)c.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";Ri.focus.tabbable[n](t.target).focus()}}const p=(0,u.createElement)("div",{ref:t,tabIndex:s,onFocus:d}),f=(0,u.createElement)("div",{ref:n,tabIndex:s,onFocus:d}),h=(0,m.useRefEffect)((s=>{function u(e){if(e.defaultPrevented)return;if(e.keyCode===Qu.ESCAPE)return e.preventDefault(),void a(!0);if(e.keyCode!==Qu.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,Ri.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,Ri.isFormElement)(Ri.focus.tabbable[i](e.target)))return;const u=o?t:n;c.current=!0,u.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){var r;if(o.keyCode!==Qu.TAB)return;if("region"===(null===(r=o.target)||void 0===r?void 0:r.getAttribute("role")))return;if(e.current===o.target)return;const l=o.shiftKey?"findPrevious":"findNext",i=Ri.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:g}=m;return g.addEventListener("keydown",p),s.addEventListener("keydown",u),s.addEventListener("focusout",d),()=>{g.removeEventListener("keydown",p),s.removeEventListener("keydown",u),s.removeEventListener("focusout",d)}}),[]);return[p,(0,m.useMergeRefs)([e,h]),f]}(),o=(0,g.useSelect)((e=>e(To).hasMultiSelection()),[]);return[e,(0,m.useMergeRefs)([t,Ad(),Nd(),Ld(),Rd(),wd(),Td(),Id(),(0,m.useRefEffect)((e=>{if(e.tabIndex=0,e.contentEditable=o,o)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,_.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[o])]),n]}var Dd=(0,u.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,i]=Od();return(0,u.createElement)(u.Fragment,null,r,(0,u.createElement)("div",c({},o,{ref:(0,m.useMergeRefs)([l,t]),className:p()(o.className,"block-editor-writing-flow")}),n),i)}));function zd(e){return(0,u.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}function Fd(e){let{contentRef:t,children:n,head:o,tabIndex:r=0,scale:l=1,frameSize:i=0,readonly:a,forwardedRef:s,...d}=e;const f=(0,g.useSelect)((e=>e(To).getSettings().__unstableResolvedAssets),[]),[,v]=(0,u.useReducer)((()=>({}))),[b,k]=(0,u.useState)(),[y,E]=(0,u.useState)([]),C=zd(null==f?void 0:f.styles),S=C.map((e=>e.id)),w=(0,u.useMemo)((()=>Array.from(document.styleSheets).reduce(((e,t)=>{try{t.cssRules}catch(t){return e}const{ownerNode:n,cssRules:o}=t;if(null===n)return e;if(!o)return e;if("LINK"!==n.tagName)return e;if("wp-reset-editor-styles-css"===n.id)return e;if(function e(t){return Array.from(t).find((t=>{let{selectorText:n,conditionText:o,cssRules:r}=t;return o?e(r):n&&(n.includes(".editor-styles-wrapper")||n.includes(".wp-block"))}))}(o)){e.push(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.push(o.cloneNode(!0))}return e}),[])),[]).filter((e=>!S.includes(e.id))),B=zd(null==f?void 0:f.scripts),I=Ed(),[x,T,M]=Od(),[N,{height:P}]=(0,m.useResizeObserver)(),L=(0,m.useRefEffect)((e=>{let t;function n(e){e.preventDefault()}function o(){const{contentDocument:o,ownerDocument:r}=e,{readyState:l,documentElement:i}=o;return t=o,("interactive"===l||"complete"===l)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(o),k(o),I(i),E(Array.from(r.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),o.dir=r.dir,i.removeChild(o.head),i.removeChild(o.body),t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1),!0)}return e.addEventListener("load",o),()=>{var r,l;e.removeEventListener("load",o),null===(r=t)||void 0===r||r.removeEventListener("dragover",n),null===(l=t)||void 0===l||l.removeEventListener("drop",n)}}),[]),R=(0,m.useRefEffect)((e=>{B.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,r)=>{const l=e.ownerDocument.createElement("script");l.id=n,o?(l.src=o,l.onload=()=>t(),l.onerror=()=>r()):t(),e.appendChild(l)}))}(e,n)))),Promise.resolve()).finally((()=>{v()}))}),[]),A=(0,m.useDisabled)({isDisabled:!a}),O=(0,m.useMergeRefs)([t,I,T,A]),D=(0,u.createElement)(u.Fragment,null,(0,u.createElement)("style",null,"html{height:auto!important;}body{margin:0}"),[...C,...w].map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,u.createElement)(a,{id:o,key:o},i):(0,u.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})}))),z=(0,u.useMemo)((()=>""+(0,u.renderToString)(D)),[]);return(0,u.createElement)(u.Fragment,null,r>=0&&x,(0,u.createElement)("iframe",c({},d,{ref:(0,m.useMergeRefs)([s,L]),tabIndex:r,srcDoc:z,title:(0,_.__)("Editor canvas")}),b&&(0,u.createPortal)((0,u.createElement)(u.Fragment,null,(0,u.createElement)("head",{ref:R},D,o,(0,u.createElement)("style",null,`html { transition: background 5s; ${i?"background: #2f2f2f; transition: background 0s;":""} }`)),(0,u.createElement)("body",{ref:O,className:p()("block-editor-iframe__body","editor-styles-wrapper",...y),style:{marginBottom:`-${P*(1-l)-i}px`,marginTop:i,transform:`scale( ${l} )`}},N,(0,u.createElement)(h.__experimentalStyleProvider,{document:b},n))),b.documentElement)),r>=0&&M)}var Vd=(0,u.forwardRef)((function(e,t){return(0,g.useSelect)((e=>e(To).getSettings().__internalIsInitialized),[])?(0,u.createElement)(Fd,c({},e,{forwardedRef:t})):null})),Hd={grad:.9,turn:360,rad:360/(2*Math.PI)},Gd=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Ud=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},$d=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},jd=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Wd=function(e){return{r:$d(e.r,0,255),g:$d(e.g,0,255),b:$d(e.b,0,255),a:$d(e.a)}},Kd=function(e){return{r:Ud(e.r),g:Ud(e.g),b:Ud(e.b),a:Ud(e.a,3)}},qd=/^#([0-9a-f]{3,8})$/i,Yd=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Zd=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=Math.max(t,n,o),i=l-Math.min(t,n,o),a=i?l===t?(n-o)/i:l===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(a<0?a+6:a),s:l?i/l*100:0,v:l/255*100,a:r}},Qd=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),i=o*(1-n),a=o*(1-(t-l)*n),s=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,a,i,i,s,o][c],g:255*[s,o,o,a,i,i][c],b:255*[i,i,s,o,o,a][c],a:r}},Xd=function(e){return{h:jd(e.h),s:$d(e.s,0,100),l:$d(e.l,0,100),a:$d(e.a)}},Jd=function(e){return{h:Ud(e.h),s:Ud(e.s),l:Ud(e.l),a:Ud(e.a,3)}},ep=function(e){return Qd((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},tp=function(e){return{h:(t=Zd(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},np=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,op=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,lp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ip={string:[[function(e){var t=qd.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?Ud(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?Ud(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=rp.exec(e)||lp.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Wd({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=np.exec(e)||op.exec(e);if(!t)return null;var n,o,r=Xd({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Hd[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return ep(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=void 0===r?1:r;return Gd(t)&&Gd(n)&&Gd(o)?Wd({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,l=void 0===r?1:r;if(!Gd(t)||!Gd(n)||!Gd(o))return null;var i=Xd({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return ep(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!Gd(t)||!Gd(n)||!Gd(o))return null;var i=function(e){return{h:jd(e.h),s:$d(e.s,0,100),v:$d(e.v,0,100),a:$d(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return Qd(i)},"hsv"]]},ap=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=Kd(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?Yd(Ud(255*r)):"","#"+Yd(t)+Yd(n)+Yd(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return Kd(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Kd(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return Jd(tp(this.rgba))},e.prototype.toHslString=function(){return t=(e=Jd(tp(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=Zd(this.rgba),{h:Ud(e.h),s:Ud(e.s),v:Ud(e.v),a:Ud(e.a,3)};var e},e.prototype.invert=function(){return mp({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),mp(cp(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),mp(cp(this.rgba,-e))},e.prototype.grayscale=function(){return mp(cp(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),mp(dp(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),mp(dp(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?mp({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Ud(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=tp(this.rgba);return"number"==typeof e?mp({h:e,s:t.s,l:t.l,a:t.a}):Ud(t.h)},e.prototype.isEqual=function(e){return this.toHex()===mp(e).toHex()},e}(),mp=function(e){return e instanceof pp?e:new pp(e)},gp=[],fp=function(e){e.forEach((function(e){gp.indexOf(e)<0&&(e(pp,ip),gp.push(e))}))};function hp(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,a=o[this.toHex()];if(a)return a;if(null==t?void 0:t.closest){var s=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=s,i=l[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));m(s=bp(i))?(a+.05)/(s+.05):(s+.05)/(a+.05),void 0===(o=2)&&(o=0),void 0===r&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===r&&"large"===i?3:4.5);var n,o,r,l,i}}var _p=n(3124),yp=n.n(_p);const Ep=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Cp(e,t){t=t||{};let n=1,o=1;function r(e){const t=e.match(/\n/g);t&&(n+=t.length);const r=e.lastIndexOf("\n");o=~r?e.length-r:o+e.length}function l(){const e={line:n,column:o};return function(t){return t.position=new i(e),m(),t}}function i(e){this.start=e,this.end={line:n,column:o},this.source=t.source}i.prototype.content=e;const a=[];function s(r){const l=new Error(t.source+":"+n+":"+o+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=o,l.source=e,!t.silent)throw l;a.push(l)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),g(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),g(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function g(e){let t;for(e=e||[];t=f();)!1!==t&&e.push(t);return e}function f(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return s("End of comment missing");const i=e.slice(2,n-2);return o+=2,r(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function h(){const e=p(/^([^{]+)/);if(e)return Sp(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function v(){const e=l();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=Sp(t[0]),!p(/^:\s*/))return s("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Ep,""),value:n?Sp(n[0]).replace(Ep,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return s("missing '{'");let t;for(g(e);t=v();)!1!==t&&(e.push(t),g(e));return u()?e:s("missing '}'")}function k(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const _=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return s("@keyframes missing name");const o=t[1];if(!c())return s("@keyframes missing '{'");let r,i=g();for(;r=k();)i.push(r),i=i.concat(g());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):s("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=Sp(t[1]);if(!c())return s("@media missing '{'");const o=g().concat(d());return u()?e({type:"media",media:n,rules:o}):s("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:Sp(t[1]),media:Sp(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Sp(t[1]);if(!c())return s("@supports missing '{'");const o=g().concat(d());return u()?e({type:"supports",supports:n,rules:o}):s("@supports missing '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Sp(t[1]),o=Sp(t[2]);if(!c())return s("@document missing '{'");const r=g().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):s("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=h()||[];if(!c())return s("@page missing '{'");let n,o=g();for(;n=v();)o.push(n),o=o.concat(g());return u()?e({type:"page",selectors:t,declarations:o}):s("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return s("@host missing '{'");const t=g().concat(d());return u()?e({type:"host",rules:t}):s("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return s("@font-face missing '{'");let t,n=g();for(;t=v();)n.push(t),n=n.concat(g());return u()?e({type:"font-face",declarations:n}):s("@font-face missing '}'")}()}function w(){const e=l(),t=h();return t?(g(),e({type:"rule",selectors:t,declarations:b()})):s("selector missing")}return wp(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function Sp(e){return e?e.replace(/^\s+|\s+$/g,""):""}function wp(e,t){const n=e&&"string"==typeof e.type,o=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){wp(e,o)})):n&&"object"==typeof n&&wp(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Bp=n(8575),Ip=n.n(Bp),xp=Tp;function Tp(e){this.options=e||{}}Tp.prototype.emit=function(e){return e},Tp.prototype.visit=function(e){return this[e.type](e)},Tp.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;ot=>{if("declaration"===t.type){const l=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const o=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};Ap(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+Op(e.value,r)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=l,o.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,o,r;return t};const zp=/^(body|html|:root).*$/;var Fp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>{const o=n=>t.includes(n.trim())?n:n.match(zp)?n.replace(/^(body|html|:root)/,e):e+" "+n;return"rule"===n.type?{...n,selectors:n.selectors.map(o)}:n}};var Vp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.values(null!=e?e:[]).map((e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(Fp(t)),o&&r.push(Dp(o)),r.length?Rp(n,(0,m.compose)(r)):n}))};const Hp=".editor-styles-wrapper";function Gp(e){return(0,u.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(Hp);let l;if(r)l=n.getComputedStyle(r,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),l=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=mp(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function Up(e){let{styles:t}=e;const n=(0,u.useMemo)((()=>Vp(t,Hp)),[t]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("style",{ref:Gp(t)}),n.map(((e,t)=>(0,u.createElement)("style",{key:t},e))))}function $p(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=mp(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)})),t}function jp(e){let{selector:t,id:n}=e;const o=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,u.createElement)("style",null,o)}function Wp(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,u.createElement)("style",null,n)}function Kp(e){let{id:t,colors:n}=e;const o=$p(n);return(0,u.createElement)(h.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,u.createElement)("defs",null,(0,u.createElement)("filter",{id:t},(0,u.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,u.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,u.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,u.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,u.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,u.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,u.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function qp(e){let{preset:t}=e;return(0,u.createElement)(Kp,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let Yp;fp([hp,kp]);const Zp=2e3;function Qp(e){let{viewportWidth:t,containerWidth:n,minHeight:o,additionalStyles:r=[]}=e;t||(t=n);const[l,{height:i}]=(0,m.useResizeObserver)(),{styles:a,duotone:s}=(0,g.useSelect)((e=>{var t,n;const o=e(To).getSettings();return{styles:o.styles,duotone:null===(t=o.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),c=(0,u.useMemo)((()=>a?[...a,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...r]:a),[a,r]),d=(0,u.useMemo)((()=>{var e,t;return[...null!==(e=null==s?void 0:s.default)&&void 0!==e?e:[],...null!==(t=null==s?void 0:s.theme)&&void 0!==t?t:[]]}),[s]);Yp=Yp||(0,m.pure)(Wv);const p=n/t;return(0,u.createElement)(h.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${p})`,height:i*p,maxHeight:i>Zp?Zp*p:void 0,minHeight:o}},(0,u.createElement)(Vd,{head:(0,u.createElement)(Up,{styles:c}),contentRef:(0,m.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:i,pointerEvents:"none",maxHeight:Zp,minHeight:0!==p&&p<1&&o?o/p:o}},l,d.map((e=>(0,u.createElement)(qp,{preset:e,key:e.slug}))),(0,u.createElement)(Yp,{renderAppender:!1})))}function Xp(e){const[t,{width:n}]=(0,m.useResizeObserver)();return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{style:{position:"relative",width:"100%",height:0}},t),(0,u.createElement)("div",{className:"block-editor-block-preview__container"},!!n&&(0,u.createElement)(Qp,c({},e,{containerWidth:n}))))}var Jp=(0,u.memo)((function(e){let{blocks:t,viewportWidth:n=1200,minHeight:o,additionalStyles:r=[],__experimentalMinHeight:l,__experimentalPadding:i}=e;l&&(o=l,W()("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),i&&(r=[...r,{css:`body { padding: ${i}px; }`}],W()("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const a=(0,g.useSelect)((e=>e(To).getSettings()),[]),s=(0,u.useMemo)((()=>({...a,__unstableIsPreviewMode:!0})),[a]),c=(0,u.useMemo)((()=>Array.isArray(t)?t:[t]),[t]);return t&&0!==t.length?(0,u.createElement)(_d,{value:c,settings:s},(0,u.createElement)(Xp,{viewportWidth:n,minHeight:o,additionalStyles:r})):null}));function em(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,g.useSelect)((e=>e(To).getSettings()),[]),l=(0,u.useMemo)((()=>({...r,__unstableIsPreviewMode:!0})),[r]),i=(0,m.useDisabled)(),a=(0,m.useMergeRefs)([n.ref,i]),s=(0,u.useMemo)((()=>Array.isArray(t)?t:[t]),[t]),c=(0,u.createElement)(_d,{value:s,settings:l},(0,u.createElement)(qv,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:a,className:p()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?c:null}}var tm=function(e){var t;let{item:n}=e;const{name:o,title:r,icon:l,description:i,initialAttributes:s,example:c}=n,d=(0,a.isReusableBlock)(n);return(0,u.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,u.createElement)("div",{className:"block-editor-inserter__preview"},d||c?(0,u.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,u.createElement)(Jp,{blocks:c?(0,a.getBlockFromExample)(o,{attributes:{...c.attributes,...s},innerBlocks:c.innerBlocks}):(0,a.createBlock)(o,s),viewportWidth:null!==(t=null==c?void 0:c.viewportWidth)&&void 0!==t?t:500,additionalStyles:[{css:"body { padding: 16px; }"}]})):(0,u.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,_.__)("No Preview Available."))),!d&&(0,u.createElement)(hd,{title:r,icon:l,description:i}))};var nm=(0,u.createContext)();var om=(0,u.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const i=(0,u.useContext)(nm);return(0,u.createElement)(h.__unstableCompositeItem,c({ref:t,state:i,role:"option",focusable:!0},l),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,u.createElement)(o,t,r):"function"==typeof r?r(t):(0,u.createElement)(h.Button,t,r)}))}));var rm=(0,u.createElement)(G.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function lm(e){let{count:t,icon:n,isPattern:o}=e;const r=o&&(0,_.__)("Pattern");return(0,u.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,u.createElement)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip"},(0,u.createElement)(h.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,u.createElement)(h.FlexItem,null,n?(0,u.createElement)(fd,{icon:n}):r||(0,_.sprintf)((0,_._n)("%d block","%d blocks",t),t)),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(fd,{icon:rm})))))}var im=e=>{let{isEnabled:t,blocks:n,icon:o,children:r,isPattern:l}=e;const i={type:"inserter",blocks:n};return(0,u.createElement)(h.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:i,__experimentalDragComponent:(0,u.createElement)(lm,{count:n.length,icon:o,isPattern:l})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return r({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))};var am=(0,u.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:r,onHover:l,isDraggable:i,...s}=e;const d=(0,u.useRef)(!1),m=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},g=(0,u.useMemo)((()=>[(0,a.createBlock)(o.name,o.initialAttributes,(0,a.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]),f=(0,a.isReusableBlock)(o)||(0,a.isTemplatePart)(o);return(0,u.createElement)(im,{isEnabled:i&&!o.disabled,blocks:g,icon:o.icon},(e=>{let{draggable:i,onDragStart:a,onDragEnd:g}=e;return(0,u.createElement)("div",{className:p()("block-editor-block-types-list__list-item",{"is-synced":f}),draggable:i,onDragStart:e=>{d.current=!0,a&&(l(null),a(e))},onDragEnd:e=>{d.current=!1,g&&g(e)}},(0,u.createElement)(om,c({isFirst:n,className:p()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),r(o,(0,Qu.isAppleOS)()?e.metaKey:e.ctrlKey),l(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Qu.ENTER&&(e.preventDefault(),r(o,(0,Qu.isAppleOS)()?e.metaKey:e.ctrlKey),l(null))},onMouseEnter:()=>{d.current||l(o)},onMouseLeave:()=>l(null)},s),(0,u.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:m},(0,u.createElement)(fd,{icon:o.icon,showColors:!0})),(0,u.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,u.createElement)(h.__experimentalTruncate,{numberOfLines:3},o.title))))}))}));var sm=(0,u.forwardRef)((function(e,t){const[n,o]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{n&&(0,pn.speak)((0,_.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,u.createElement)("div",c({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)}},e))}));var cm=(0,u.forwardRef)((function(e,t){const n=(0,u.useContext)(nm);return(0,u.createElement)(h.__unstableCompositeGroup,c({state:n,role:"presentation",ref:t},e))}));var um=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:r,label:l,isDraggable:i=!0}=e;return(0,u.createElement)(sm,{className:"block-editor-block-types-list","aria-label":l},function(e,t){const n=[];for(let o=0,r=e.length;o(0,u.createElement)(cm,{key:t},e.map(((e,r)=>(0,u.createElement)(am,{key:e.id,item:e,className:(0,a.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:i&&!e.isDisabled,isFirst:0===t&&0===r})))))),r)};var dm=function(e){let{title:t,icon:n,children:o}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,u.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),(0,u.createElement)(h.Icon,{icon:n})),(0,u.createElement)("div",{className:"block-editor-inserter__panel-content"},o))};var pm=(e,t)=>{const{categories:n,collections:o,items:r}=(0,g.useSelect)((t=>{const{getInserterItems:n}=t(To),{getCategories:o,getCollections:r}=t(a.store);return{categories:o(),collections:r(),items:n(e)}}),[e]);return[r,n,o,(0,u.useCallback)(((e,n)=>{let{name:o,initialAttributes:r,innerBlocks:l}=e;const i=(0,a.createBlock)(o,r,(0,a.createBlocksFromInnerBlocksTemplate)(l));t(i,void 0,n)}),[t])]};var mm=function(e){let{children:t}=e;const n=(0,h.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,u.createElement)(nm.Provider,{value:n},t)};const gm=[];var fm=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,s]=pm(t,n),c=(0,u.useMemo)((()=>Y(l,"frecency","desc").slice(0,6)),[l]),d=(0,u.useMemo)((()=>l.filter((e=>!e.category))),[l]),p=(0,u.useMemo)((()=>(0,m.pipe)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,f.groupBy)(e,"category")))(l)),[l]),g=(0,u.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=l.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[l,a]);(0,u.useEffect)((()=>()=>o(null)),[]);const h=(0,m.useAsyncList)(i),v=i.length===h.length,b=(0,u.useMemo)((()=>Object.entries(a)),[a]),k=(0,m.useAsyncList)(v?b:gm);return(0,u.createElement)(mm,null,(0,u.createElement)("div",null,r&&!!c.length&&(0,u.createElement)(dm,{title:(0,_._x)("Most used","blocks")},(0,u.createElement)(um,{items:c,onSelect:s,onHover:o,label:(0,_._x)("Most used","blocks")})),h.map((e=>{const t=p[e.slug];return t&&t.length?(0,u.createElement)(dm,{key:e.slug,title:e.title,icon:e.icon},(0,u.createElement)(um,{items:t,onSelect:s,onHover:o,label:e.title})):null})),v&&d.length>0&&(0,u.createElement)(dm,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,_.__)("Uncategorized")},(0,u.createElement)(um,{items:d,onSelect:s,onHover:o,label:(0,_.__)("Uncategorized")})),k.map((e=>{let[t,n]=e;const r=g[t];return r&&r.length?(0,u.createElement)(dm,{key:t,title:n.title,icon:n.icon},(0,u.createElement)(um,{items:r,onSelect:s,onHover:o,label:n.title})):null}))))},hm=window.wp.notices;var vm=(e,t)=>{const{patternCategories:n,patterns:o}=(0,g.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(To);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:r}=(0,g.useDispatch)(hm.store),l=(0,u.useCallback)(((t,n)=>{e((null!=n?n:[]).map((e=>(0,a.cloneBlock)(e))),t.name),r((0,_.sprintf)((0,_.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[]);return[o,n,l]};const bm=e=>{let{showTooltip:t,title:n,children:o}=e;return t?(0,u.createElement)(h.Tooltip,{text:n},o):(0,u.createElement)(u.Fragment,null,o)};function km(e){let{isDraggable:t,pattern:n,onClick:o,onHover:r,composite:l,showTooltip:i}=e;const[a,s]=(0,u.useState)(!1),{blocks:d,viewportWidth:p}=n,g=`block-editor-block-patterns-list__item-description-${(0,m.useInstanceId)(km)}`;return(0,u.createElement)(im,{isEnabled:t,blocks:d,isPattern:!!n},(e=>{let{draggable:t,onDragStart:m,onDragEnd:f}=e;return(0,u.createElement)("div",{className:"block-editor-block-patterns-list__list-item",draggable:t,onDragStart:e=>{s(!0),m&&(null==r||r(null),m(e))},onDragEnd:e=>{s(!1),f&&f(e)}},(0,u.createElement)(bm,{showTooltip:i,title:n.title},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},l,{className:"block-editor-block-patterns-list__item",onClick:()=>{o(n,d),null==r||r(null)},onMouseEnter:()=>{a||null==r||r(n)},onMouseLeave:()=>null==r?void 0:r(null),"aria-label":n.title,"aria-describedby":n.description?g:void 0}),(0,u.createElement)(Jp,{blocks:d,viewportWidth:p}),!i&&(0,u.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,u.createElement)(h.VisuallyHidden,{id:g},n.description))))}))}function _m(){return(0,u.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var ym=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onHover:r,onClickPattern:l,orientation:i,label:a=(0,_.__)("Block Patterns"),showTitlesAsTooltip:s}=e;const d=(0,h.__unstableUseCompositeState)({orientation:i});return(0,u.createElement)(h.__unstableComposite,c({},d,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":a}),n.map((e=>o.includes(e)?(0,u.createElement)(km,{key:e.name,pattern:e,onClick:l,onHover:r,isDraggable:t,composite:d,showTooltip:s}):(0,u.createElement)(_m,{key:e.name}))))};function Em(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o}=e;const r="block-editor-block-patterns-explorer__sidebar";return(0,u.createElement)("div",{className:`${r}__categories-list`},n.map((e=>{let{name:n,label:l}=e;return(0,u.createElement)(h.Button,{key:n,label:l,className:`${r}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},l)})))}function Cm(e){let{filterValue:t,setFilterValue:n}=e;return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,u.createElement)(h.SearchControl,{__nextHasNoMarginBottom:!0,onChange:n,value:t,label:(0,_.__)("Search for patterns"),placeholder:(0,_.__)("Search")}))}var Sm=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,filterValue:r,setFilterValue:l}=e;return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,u.createElement)(Cm,{filterValue:r,setFilterValue:l}),!r&&(0,u.createElement)(Em,{selectedCategory:t,patternCategories:n,onClickCategory:o}))};var wm=function(){return(0,u.createElement)("div",{className:"block-editor-inserter__no-results"},(0,u.createElement)(Jl,{className:"block-editor-inserter__no-results-icon",icon:gd}),(0,u.createElement)("p",null,(0,_.__)("No results found.")))};var Bm=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:r,onSelect:l,shouldFocusBlock:i=!0,selectBlockOnInsert:s=!0}=e;const{getSelectedBlock:c}=(0,g.useSelect)(To),{destinationRootClientId:d,destinationIndex:p}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:l,getBlockRootClientId:i,getBlockIndex:a,getBlockOrder:s}=e(To),c=l();let u,d=t;return void 0!==n?u=n:o?u=a(o):!r&&c?(d=i(c),u=a(c)+1):u=s(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,r]),{replaceBlocks:m,insertBlocks:f,showInsertionPoint:h,hideInsertionPoint:v}=(0,g.useDispatch)(To),b=(0,u.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=c();!r&&o&&(0,a.isUnmodifiedDefaultBlock)(o)?m(o.clientId,e,null,i||n?0:null,t):f(e,p,d,s,i||n?0:null,t);const u=Array.isArray(e)?e.length:1,g=(0,_.sprintf)((0,_._n)("%d block added.","%d blocks added.",u),u);(0,pn.speak)(g),l&&l(e)}),[r,c,m,f,d,p,l,i]),k=(0,u.useCallback)((e=>{e?h(d,p):v()}),[h,v,d,p]);return[d,b,k]},Im=n(4793),xm=n.n(Im);function Tm(e){return e.toLowerCase()}var Mm=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Nm=/[^A-Z0-9]+/gi;function Pm(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?Mm:n,r=t.stripRegexp,l=void 0===r?Nm:r,i=t.transform,a=void 0===i?Tm:i,s=t.delimiter,c=void 0===s?" ":s,u=Lm(Lm(e,o,"$1\0$2"),l,"\0"),d=0,p=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(p-1);)p--;return u.slice(d,p).split("\0").map(a).join(c)}function Lm(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}const Rm=e=>e.name||"",Am=e=>e.title,Om=e=>e.description||"",Dm=e=>e.keywords||[],zm=e=>e.category,Fm=()=>null;function Vm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Pm(e,{splitRegexp:[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],stripRegexp:/(\p{C}|\p{P}|\p{S})+/giu}).split(" ").filter(Boolean)}function Hm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=xm()(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const Gm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Vm(Hm(e))},Um=(e,t)=>e.filter((e=>!Gm(t).some((t=>t.includes(e))))),$m=(e,t,n,o)=>{if(0===Gm(o).length)return e;return jm(e,o,{getCategory:e=>{var n;return null===(n=t.find((t=>{let{slug:n}=t;return n===e.category})))||void 0===n?void 0:n.title},getCollection:e=>{var t;return null===(t=n[e.name.split("/")[0]])||void 0===t?void 0:t.title}})},jm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=Gm(t);if(0===o.length)return e;const r=e.map((e=>[e,Wm(e,t,n)])).filter((e=>{let[,t]=e;return t>0}));return r.sort(((e,t)=>{let[,n]=e,[,o]=t;return o-n})),r.map((e=>{let[t]=e;return t}))};function Wm(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Rm,getTitle:r=Am,getDescription:l=Om,getKeywords:i=Dm,getCategory:a=zm,getCollection:s=Fm}=n,c=o(e),u=r(e),d=l(e),p=i(e),m=a(e),g=s(e),f=Hm(t),h=Hm(u);let v=0;if(f===h)v+=30;else if(h.startsWith(f))v+=20;else{const e=[c,u,d,...p,m,g].join(" "),t=Vm(f);0===Um(t,e).length&&(v+=10)}if(0!==v&&c.startsWith("core/")){v+=c!==e.id?1:2}return v}function Km(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,u.createElement)(h.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,_.sprintf)((0,_._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var qm=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,m.useDebounce)(pn.speak,500),[l,i]=Bm({shouldFocusBlock:!0}),[a,,s]=vm(i,l),c=(0,u.useMemo)((()=>o.map((e=>e.name))),[o]),d=(0,u.useMemo)((()=>t?jm(a,t):a.filter((e=>{var t,o;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every((e=>!c.includes(e))):null===(o=e.categories)||void 0===o?void 0:o.includes(n)}))),[t,n,a]);(0,u.useEffect)((()=>{if(!t)return;const e=d.length,n=(0,_.sprintf)((0,_._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const p=(0,m.useAsyncList)(d,{step:2}),g=!(null==d||!d.length);return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},g&&(0,u.createElement)(Km,{filterValue:t,filteredBlockPatternsLength:d.length}),(0,u.createElement)(mm,null,!g&&(0,u.createElement)(wm,null),g&&(0,u.createElement)(ym,{shownPatterns:p,blockPatterns:d,onClickPattern:s,isDraggable:!1})))};function Ym(e){let{initialCategory:t,patternCategories:n}=e;const[o,r]=(0,u.useState)(""),[l,i]=(0,u.useState)(null==t?void 0:t.name);return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,u.createElement)(Sm,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,u.createElement)(qm,{filterValue:o,selectedCategory:l,patternCategories:n}))}var Zm=function(e){let{onModalClose:t,...n}=e;return(0,u.createElement)(h.Modal,{title:(0,_.__)("Patterns"),onRequestClose:t,isFullScreen:!0},(0,u.createElement)(Ym,n))};function Qm(e){let{title:t}=e;return(0,u.createElement)(h.__experimentalVStack,{spacing:0},(0,u.createElement)(h.__experimentalView,null,(0,u.createElement)(h.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3},(0,u.createElement)(h.__experimentalHStack,{spacing:2},(0,u.createElement)(h.__experimentalNavigatorBackButton,{style:{minWidth:24,padding:0},icon:(0,_.isRTL)()?pd:md,isSmall:!0,"aria-label":(0,_.__)("Navigate to the previous view")}),(0,u.createElement)(h.__experimentalSpacer,null,(0,u.createElement)(h.__experimentalHeading,{level:5},t))))))}function Xm(e){let{categories:t,children:n}=e;return(0,u.createElement)(h.__experimentalNavigatorProvider,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation"},(0,u.createElement)(h.__experimentalNavigatorScreen,{path:"/"},(0,u.createElement)(h.__experimentalItemGroup,null,t.map((e=>(0,u.createElement)(h.__experimentalNavigatorButton,{key:e.name,path:`/category/${e.name}`,as:h.__experimentalItem,isAction:!0},(0,u.createElement)(h.__experimentalHStack,null,(0,u.createElement)(h.FlexBlock,null,e.label),(0,u.createElement)(Jl,{icon:(0,_.isRTL)()?md:pd}))))))),t.map((e=>(0,u.createElement)(h.__experimentalNavigatorScreen,{key:e.name,path:`/category/${e.name}`},(0,u.createElement)(Qm,{title:(0,_.__)("Back")}),n(e)))))}const Jm=["featured","posts","text","gallery","call-to-action","banner","header","footer"];function eg(e){const[t,n]=vm(void 0,e),o=(0,u.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>n.some((t=>t.name===e))))),[n]),r=(0,u.useMemo)((()=>{const e=n.filter((e=>t.some((t=>{var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)})))).sort(((e,t)=>{let{name:n}=e,{name:o}=t;return[n,o].some((e=>Jm.includes(e)))?[n,o].every((e=>Jm.includes(e)))?Jm.indexOf(n)-Jm.indexOf(o):Jm.includes(n)?-1:1:0}));return t.some((e=>!o(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,_._x)("Uncategorized")}),e}),[t,n]);return r}function tg(e){let{rootClientId:t,onInsert:n,onHover:o,category:r,showTitlesAsTooltip:l}=e;const i=(0,u.useRef)();return(0,u.useEffect)((()=>{const e=setTimeout((()=>{const[e]=Ri.focus.tabbable.find(i.current);null==e||e.focus()}));return()=>clearTimeout(e)}),[r]),(0,u.createElement)("div",{ref:i,className:"block-editor-inserter__patterns-category-dialog"},(0,u.createElement)(ng,{rootClientId:t,onInsert:n,onHover:o,category:r,showTitlesAsTooltip:l}))}function ng(e){let{rootClientId:t,onInsert:n,onHover:o,category:r,showTitlesAsTooltip:l}=e;const[i,,a]=vm(n,t),s=eg(t),c=(0,u.useMemo)((()=>i.filter((e=>{var t,n,o;if("uncategorized"!==r.name)return null===(o=e.categories)||void 0===o?void 0:o.includes(r.name);return 0===(null!==(t=null===(n=e.categories)||void 0===n?void 0:n.filter((e=>s.find((t=>t.name===e)))))&&void 0!==t?t:[]).length}))),[i,r]),d=(0,m.useAsyncList)(c);return(0,u.useEffect)((()=>()=>o(null)),[]),c.length?(0,u.createElement)("div",{className:"block-editor-inserter__patterns-category-panel"},(0,u.createElement)("div",{className:"block-editor-inserter__patterns-category-panel-title"},r.label),(0,u.createElement)("p",null,r.description),(0,u.createElement)(ym,{shownPatterns:d,blockPatterns:c,onClickPattern:a,onHover:o,label:r.label,orientation:"vertical",category:r.label,isDraggable:!0,showTitlesAsTooltip:l})):null}var og=function(e){let{onSelectCategory:t,selectedCategory:n,onInsert:o,rootClientId:r}=e;const[l,i]=(0,u.useState)(!1),a=eg(r),s=n||a[0],c=(0,m.useViewportMatch)("medium","<");return(0,u.createElement)(u.Fragment,null,!c&&(0,u.createElement)("div",{className:"block-editor-inserter__block-patterns-tabs-container"},(0,u.createElement)("nav",{"aria-label":(0,_.__)("Block pattern categories")},(0,u.createElement)(h.__experimentalItemGroup,{role:"list",className:"block-editor-inserter__block-patterns-tabs"},a.map((e=>(0,u.createElement)(h.__experimentalItem,{role:"listitem",key:e.name,onClick:()=>t(e),className:e===n?"block-editor-inserter__patterns-category block-editor-inserter__patterns-selected-category":"block-editor-inserter__patterns-category","aria-label":e.label,"aria-current":e===n?"true":void 0},(0,u.createElement)(h.__experimentalHStack,null,(0,u.createElement)(h.FlexBlock,null,e.label),(0,u.createElement)(Jl,{icon:pd}))))),(0,u.createElement)("div",{role:"listitem"},(0,u.createElement)(h.Button,{className:"block-editor-inserter__patterns-explore-button",onClick:()=>i(!0),variant:"secondary"},(0,_.__)("Explore all patterns")))))),c&&(0,u.createElement)(Xm,{categories:a},(e=>(0,u.createElement)(ng,{onInsert:o,rootClientId:r,category:e,showTitlesAsTooltip:!1}))),l&&(0,u.createElement)(Zm,{initialCategory:s,patternCategories:a,onModalClose:()=>i(!1)}))},rg=window.wp.url;function lg(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=pm(o,n),i=(0,u.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,u.createElement)(wm,null):(0,u.createElement)(dm,{title:(0,_.__)("Reusable blocks")},(0,u.createElement)(um,{items:i,onSelect:l,onHover:t,label:(0,_.__)("Reusable blocks")}))}var ig=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(lg,{onHover:o,onInsert:n,rootClientId:t}),(0,u.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,u.createElement)(h.Button,{className:"block-editor-inserter__manage-reusable-blocks",variant:"secondary",href:(0,rg.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,_.__)("Manage Reusable blocks"))))};function ag(e){const[t,n]=(0,u.useState)([]),{canInsertImage:o,canInsertVideo:r,canInsertAudio:l}=(0,g.useSelect)((t=>{const{canInsertBlockType:n}=t(To);return{canInsertImage:n("core/image",e),canInsertVideo:n("core/video",e),canInsertAudio:n("core/audio",e)}}),[e]),i=function(){const{inserterMediaCategories:e,allowedMimeTypes:t,enableOpenverseMediaCategory:n}=(0,g.useSelect)((e=>{const t=e(To).getSettings();return{inserterMediaCategories:t.inserterMediaCategories,allowedMimeTypes:t.allowedMimeTypes,enableOpenverseMediaCategory:t.enableOpenverseMediaCategory}}),[]),o=(0,u.useMemo)((()=>{if(e&&t)return e.filter((e=>!(!n&&"openverse"===e.name)&&Object.values(t).some((t=>t.startsWith(`${e.mediaType}/`)))))}),[e,t,n]);return o}();return(0,u.useEffect)((()=>{(async()=>{const e=[];if(!i)return;const t=new Map(await Promise.all(i.map((async e=>{if(e.isExternalResource)return[e.name,!0];let t=[];try{t=await e.fetch({per_page:1})}catch(e){}return[e.name,!!t.length]})))),a={image:o,video:r,audio:l};i.forEach((n=>{a[n.mediaType]&&t.get(n.name)&&e.push(n)})),e.length&&n(e)})()}),[o,r,l,i]),t}var sg=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));var cg=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),ug=window.wp.blob;const dg={image:"img",video:"video",audio:"audio"};function pg(e,t){const n={id:e.id||void 0,caption:e.caption||void 0},o=e.url,r=e.alt||void 0;"image"===t?(n.url=o,n.alt=r):["video","audio"].includes(t)&&(n.src=o);const l=dg[t],i=(0,u.createElement)(l,{src:e.previewUrl||o,alt:r,controls:"audio"===t||void 0,inert:"true",onError:t=>{let{currentTarget:n}=t;n.src===e.previewUrl&&(n.src=o)}});return[(0,a.createBlock)(`core/${t}`,n),i]}const mg=["image"],gg={position:"bottom left",className:"block-editor-inserter__media-list__item-preview-options__popover"};function fg(e){let{category:t,media:n}=e;if(!t.getReportUrl)return null;const o=t.getReportUrl(n);return(0,u.createElement)(h.DropdownMenu,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,_.__)("Options"),popoverProps:gg,icon:sg},(()=>(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(h.MenuItem,{onClick:()=>window.open(o,"_blank").focus(),icon:cg},(0,_.sprintf)((0,_.__)("Report %s"),t.mediaType)))))}function hg(e){let{onClose:t,onSubmit:n}=e;return(0,u.createElement)(h.Modal,{title:(0,_.__)("Insert external image"),onRequestClose:t,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal"},(0,u.createElement)(h.__experimentalVStack,{spacing:3},(0,u.createElement)("p",null,(0,_.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")),(0,u.createElement)("p",null,(0,_.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation."))),(0,u.createElement)(h.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{variant:"tertiary",onClick:t},(0,_.__)("Cancel"))),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{variant:"primary",onClick:n},(0,_.__)("Insert")))))}function vg(e){var t;let{media:n,onClick:o,composite:r,category:l}=e;const[i,s]=(0,u.useState)(!1),[d,m]=(0,u.useState)(!1),[f,v]=(0,u.useState)(!1),[b,k]=(0,u.useMemo)((()=>pg(n,l.mediaType)),[n,l.mediaType]),{createErrorNotice:y,createSuccessNotice:E}=(0,g.useDispatch)(hm.store),C=(0,g.useSelect)((e=>e(To).getSettings().mediaUpload),[]),S=(0,u.useCallback)((e=>{if(f)return;const t=(0,a.cloneBlock)(e),{id:n,url:r,caption:l}=t.attributes;n?o(t):(v(!0),window.fetch(r).then((e=>e.blob())).then((e=>{C({filesList:[e],additionalData:{caption:l},onFileChange(e){let[n]=e;(0,ug.isBlobURL)(n.url)||(o({...t,attributes:{...t.attributes,id:n.id,url:n.url}}),E((0,_.__)("Image uploaded and inserted."),{type:"snackbar"}),v(!1))},allowedTypes:mg,onError(e){y(e,{type:"snackbar"}),v(!1)}})})).catch((()=>{s(!0),v(!1)})))}),[f,o,C,y,E]),w=(null===(t=n.title)||void 0===t?void 0:t.rendered)||n.title;let B;if(w.length>25){const e="...";B=w.slice(0,25-e.length)+e}const I=(0,u.useCallback)((()=>m(!0)),[]),x=(0,u.useCallback)((()=>m(!1)),[]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(im,{isEnabled:!0,blocks:[b]},(e=>{let{draggable:t,onDragStart:o,onDragEnd:i}=e;return(0,u.createElement)("div",{className:p()("block-editor-inserter__media-list__list-item",{"is-hovered":d}),draggable:t,onDragStart:o,onDragEnd:i},(0,u.createElement)(h.Tooltip,{text:B||w},(0,u.createElement)("div",{onMouseEnter:I,onMouseLeave:x},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},r,{className:"block-editor-inserter__media-list__item",onClick:()=>S(b),"aria-label":w}),(0,u.createElement)("div",{className:"block-editor-inserter__media-list__item-preview"},k,f&&(0,u.createElement)("div",{className:"block-editor-inserter__media-list__item-preview-spinner"},(0,u.createElement)(h.Spinner,null)))),!f&&(0,u.createElement)(fg,{category:l,media:n}))))})),i&&(0,u.createElement)(hg,{onClose:()=>s(!1),onSubmit:()=>{o((0,a.cloneBlock)(b)),E((0,_.__)("Image inserted."),{type:"snackbar"}),s(!1)}}))}var bg=function(e){let{mediaList:t,category:n,onClick:o,label:r=(0,_.__)("Media List")}=e;const l=(0,h.__unstableUseCompositeState)();return(0,u.createElement)(h.__unstableComposite,c({},l,{role:"listbox",className:"block-editor-inserter__media-list","aria-label":r}),t.map(((e,t)=>(0,u.createElement)(vg,{key:e.id||e.sourceId||t,media:e,category:n,onClick:o,composite:l}))))};function kg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[t,n]=(0,u.useState)(e),[o,r]=(0,u.useState)(e),l=(0,m.useDebounce)(r,250);return(0,u.useEffect)((()=>{o!==t&&l(t)}),[o,t]),[t,n,o]}function _g(e){let{rootClientId:t,onInsert:n,category:o}=e;const r=(0,u.useRef)();return(0,u.useEffect)((()=>{const e=setTimeout((()=>{const[e]=Ri.focus.tabbable.find(r.current);null==e||e.focus()}));return()=>clearTimeout(e)}),[o]),(0,u.createElement)("div",{ref:r,className:"block-editor-inserter__media-dialog"},(0,u.createElement)(yg,{rootClientId:t,onInsert:n,category:o}))}function yg(e){let{rootClientId:t,onInsert:n,category:o}=e;const[r,l,i]=kg(),{mediaList:a,isLoading:s}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[n,o]=(0,u.useState)(),[r,l]=(0,u.useState)(!1),i=(0,u.useRef)();return(0,u.useEffect)((()=>{(async()=>{var n;const r=JSON.stringify({category:e.name,...t});i.current=r,l(!0),o([]);const a=await(null===(n=e.fetch)||void 0===n?void 0:n.call(e,t));r===i.current&&(o(a),l(!1))})()}),[e.name,...Object.values(t)]),{mediaList:n,isLoading:r}}(o,{per_page:i?20:10,search:i}),c="block-editor-inserter__media-panel",d=o.labels.search_items||(0,_.__)("Search");return(0,u.createElement)("div",{className:c},(0,u.createElement)(h.SearchControl,{className:`${c}-search`,onChange:l,value:r,label:d,placeholder:d}),s&&(0,u.createElement)("div",{className:`${c}-spinner`},(0,u.createElement)(h.Spinner,null)),!s&&!(null!=a&&a.length)&&(0,u.createElement)(wm,null),!s&&!(null==a||!a.length)&&(0,u.createElement)(bg,{rootClientId:t,onClick:n,mediaList:a,category:o}))}var Eg=function(e){let{fallback:t=null,children:n}=e;const o=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return!!t().mediaUpload}),[]);return o?n:t};var Cg=(0,h.withFilters)("editor.MediaUpload")((()=>null));const Sg=["image","video","audio"];var wg=function(e){let{rootClientId:t,selectedCategory:n,onSelectCategory:o,onInsert:r}=e;const l=ag(t),i=(0,m.useViewportMatch)("medium","<"),a="block-editor-inserter__media-tabs",s=(0,u.useCallback)((e=>{if(null==e||!e.url)return;const[t]=pg(e,e.type);r(t)}),[r]),c=(0,u.useMemo)((()=>l.map((e=>({...e,label:e.labels.name})))),[l]);return(0,u.createElement)(u.Fragment,null,!i&&(0,u.createElement)("div",{className:`${a}-container`},(0,u.createElement)("nav",{"aria-label":(0,_.__)("Media categories")},(0,u.createElement)(h.__experimentalItemGroup,{role:"list",className:a},l.map((e=>(0,u.createElement)(h.__experimentalItem,{role:"listitem",key:e.name,onClick:()=>o(e),className:p()(`${a}__media-category`,{"is-selected":n===e}),"aria-label":e.labels.name,"aria-current":e===n?"true":void 0},(0,u.createElement)(h.__experimentalHStack,null,(0,u.createElement)(h.FlexBlock,null,e.labels.name),(0,u.createElement)(Jl,{icon:pd}))))),(0,u.createElement)("div",{role:"listitem"},(0,u.createElement)(Eg,null,(0,u.createElement)(Cg,{multiple:!1,onSelect:s,allowedTypes:Sg,render:e=>{let{open:t}=e;return(0,u.createElement)(h.Button,{onClick:e=>{e.target.focus(),t()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal"},(0,_.__)("Open Media Library"))}})))))),i&&(0,u.createElement)(Xm,{categories:c},(e=>(0,u.createElement)(yg,{onInsert:r,rootClientId:t,category:e}))))};const{Fill:Bg,Slot:Ig}=(0,h.createSlotFill)("__unstableInserterMenuExtension");Bg.Slot=Ig;var xg=Bg;const Tg=[];var Mg=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:s,maxBlockTypes:c,showBlockDirectory:d=!1,isDraggable:p=!0,shouldFocusBlock:g=!0,prioritizePatterns:f,selectBlockOnInsert:v,orderInitialBlockItems:b}=e;const k=(0,m.useDebounce)(pn.speak,500),[y,E]=Bm({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:g,selectBlockOnInsert:v}),[C,S,w,B]=pm(y,E),[I,,x]=vm(E,y),T=(0,u.useMemo)((()=>{if(0===s)return[];const e=jm(I,t);return void 0!==s?e.slice(0,s):e}),[t,I,s]);let M=c;f&&T.length>2&&(M=0);const N=(0,u.useMemo)((()=>{if(0===M)return[];let e=Y(C,"frecency","desc");!t&&b&&(e=b(e));const n=$m(e,S,w,t);return void 0!==M?n.slice(0,M):n}),[t,C,S,w,c,b]);(0,u.useEffect)((()=>{if(!t)return;const e=N.length+T.length,n=(0,_.sprintf)((0,_._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const P=(0,m.useAsyncList)(N,{step:9}),L=(0,m.useAsyncList)(P.length===N.length?T:Tg),R=N.length>0||T.length>0,A=!!N.length&&(0,u.createElement)(dm,{title:(0,u.createElement)(h.VisuallyHidden,null,(0,_.__)("Blocks"))},(0,u.createElement)(um,{items:P,onSelect:B,onHover:o,label:(0,_.__)("Blocks"),isDraggable:p})),O=!!T.length&&(0,u.createElement)(dm,{title:(0,u.createElement)(h.VisuallyHidden,null,(0,_.__)("Block Patterns"))},(0,u.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,u.createElement)(ym,{shownPatterns:L,blockPatterns:T,onClickPattern:x,onHover:o,isDraggable:p})));return(0,u.createElement)(mm,null,!d&&!R&&(0,u.createElement)(wm,null),f?O:A,!!N.length&&!!T.length&&(0,u.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),f?A:O,d&&(0,u.createElement)(xg.Slot,{fillProps:{onSelect:B,onHover:o,filterValue:t,hasItems:R,rootClientId:y}},(e=>e.length?e:R?null:(0,u.createElement)(wm,null))))};const Ng={name:"blocks",title:(0,_.__)("Blocks")},Pg={name:"patterns",title:(0,_.__)("Patterns")},Lg={name:"reusable",title:(0,_.__)("Reusable"),icon:U},Rg={name:"media",title:(0,_.__)("Media")};var Ag=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,showMedia:r=!1,onSelect:l,prioritizePatterns:i}=e;const a=(0,u.useMemo)((()=>{const e=[];return i&&n&&e.push(Pg),e.push(Ng),!i&&n&&e.push(Pg),r&&e.push(Rg),o&&e.push(Lg),e}),[i,Ng,n,Pg,o,r,Lg]);return(0,u.createElement)(h.TabPanel,{className:"block-editor-inserter__tabs",tabs:a,onSelect:l},t)};var Og=(0,u.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,onSelect:i,showInserterHelpPanel:a,showMostUsedBlocks:s,__experimentalFilterValue:c="",shouldFocusBlock:d=!0,prioritizePatterns:m}=e;const[f,v,b]=kg(c),[k,y]=(0,u.useState)(null),[E,C]=(0,u.useState)(null),[S,w]=(0,u.useState)(null),[B,I]=(0,u.useState)(null),[x,T,M]=Bm({rootClientId:n,clientId:o,isAppender:r,insertionIndex:l,shouldFocusBlock:d}),{showPatterns:N,inserterItems:P}=(0,g.useSelect)((e=>{const{__experimentalGetAllowedPatterns:t,getInserterItems:n}=e(To);return{showPatterns:!!t(x).length,inserterItems:n(x)}}),[x]),L=(0,u.useMemo)((()=>P.some((e=>{let{category:t}=e;return"reusable"===t}))),[P]),R=!!ag(x).length,A=(0,u.useCallback)(((e,t,n)=>{T(e,t,n),i()}),[T,i]),O=(0,u.useCallback)(((e,t)=>{T(e,{patternName:t}),i()}),[T,i]),D=(0,u.useCallback)((e=>{M(!!e),y(e)}),[M,y]),z=(0,u.useCallback)((e=>{M(!!e)}),[M]),F=(0,u.useCallback)((e=>{C(e)}),[C]),V=(0,u.useMemo)((()=>(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"block-editor-inserter__block-list"},(0,u.createElement)(fm,{rootClientId:x,onInsert:A,onHover:D,showMostUsedBlocks:s})),a&&(0,u.createElement)("div",{className:"block-editor-inserter__tips"},(0,u.createElement)(h.VisuallyHidden,{as:"h2"},(0,_.__)("A tip for using the block editor")),(0,u.createElement)(dd,null)))),[x,A,D,b,s,a]),H=(0,u.useMemo)((()=>(0,u.createElement)(og,{rootClientId:x,onInsert:O,onSelectCategory:F,selectedCategory:E})),[x,O,F,E]),G=(0,u.useMemo)((()=>(0,u.createElement)(ig,{rootClientId:x,onInsert:A,onHover:D})),[x,A,D]),U=(0,u.useMemo)((()=>(0,u.createElement)(wg,{rootClientId:x,selectedCategory:S,onSelectCategory:w,onInsert:A})),[x,A,S,w]),$=(0,u.useCallback)((e=>"blocks"===e.name?V:"patterns"===e.name?H:"reusable"===e.name?G:"media"===e.name?U:void 0),[V,H,G,U]),j=(0,u.useRef)();(0,u.useImperativeHandle)(t,(()=>({focusSearch:()=>{j.current.focus()}})));const W="patterns"===B&&!b&&E,K=!b&&(N||L||R),q="media"===B&&!b&&S;return(0,u.createElement)("div",{className:"block-editor-inserter__menu"},(0,u.createElement)("div",{className:p()("block-editor-inserter__main-area",{"show-as-tabs":K})},(0,u.createElement)(h.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:e=>{k&&y(null),v(e)},value:f,label:(0,_.__)("Search for blocks and patterns"),placeholder:(0,_.__)("Search"),ref:j}),!!b&&(0,u.createElement)("div",{className:"block-editor-inserter__no-tab-container"},(0,u.createElement)(Mg,{filterValue:b,onSelect:i,onHover:D,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d})),K&&(0,u.createElement)(Ag,{showPatterns:N,showReusableBlocks:L,showMedia:R,prioritizePatterns:m,onSelect:I},$),!b&&!K&&(0,u.createElement)("div",{className:"block-editor-inserter__no-tab-container"},V)),q&&(0,u.createElement)(_g,{rootClientId:x,onInsert:A,category:S}),a&&k&&(0,u.createElement)(tm,{item:k}),W&&(0,u.createElement)(tg,{rootClientId:x,onInsert:O,onHover:z,category:E,showTitlesAsTooltip:!0}))}));function Dg(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:l,selectBlockOnInsert:i,orderInitialBlockItems:a}=e;const[s,c]=(0,u.useState)(""),[d,m]=Bm({onSelect:t,rootClientId:n,clientId:o,isAppender:r,selectBlockOnInsert:i}),[f]=pm(d,m),[v]=vm(m,d),{setInserterIsOpened:b,insertionIndex:k}=(0,g.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(To),l=t(),i=n(o),a=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?a:i}}),[o]),y=v.length&&(!!s||l),E=y&&v.length>6||f.length>6;(0,u.useEffect)((()=>{b&&b(!1)}),[b]);let C=0;return y&&(C=l?4:2),(0,u.createElement)("div",{className:p()("block-editor-inserter__quick-inserter",{"has-search":E,"has-expand":b})},E&&(0,u.createElement)(h.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",value:s,onChange:e=>{c(e)},label:(0,_.__)("Search for blocks and patterns"),placeholder:(0,_.__)("Search")}),(0,u.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,u.createElement)(Mg,{filterValue:s,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:C,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:l,selectBlockOnInsert:i,orderInitialBlockItems:a})),b&&(0,u.createElement)(h.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{b({rootClientId:n,insertionIndex:k,filterValue:s})},"aria-label":(0,_.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,_.__)("Browse all")))}const zg=e=>{let{onToggle:t,disabled:n,isOpen:o,blockTitle:r,hasSingleBlockType:l,toggleProps:i={},prioritizePatterns:a}=e;const{as:s=h.Button,label:d,onClick:p,...m}=i;let g=d;return!g&&l?g=(0,_.sprintf)((0,_._x)("Add %s","directly add the only allowed block"),r):!g&&a?g=(0,_.__)("Add pattern"):g||(g=(0,_._x)("Add block","Generic label for block inserter button")),(0,u.createElement)(s,c({icon:cd,label:g,tooltipPosition:"bottom",onClick:function(e){t&&t(e),p&&p(e)},className:"block-editor-inserter__toggle","aria-haspopup":!l&&"true","aria-expanded":!l&&o,disabled:n},m))};class Fg extends u.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle(e){let{onToggle:t,isOpen:n}=e;const{disabled:o,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:a,hasItems:s,renderToggle:c=zg,prioritizePatterns:u}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!s,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:a,prioritizePatterns:u})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,__experimentalIsQuick:i,prioritizePatterns:a,onSelectOrClose:s,selectBlockOnInsert:c,orderInitialBlockItems:d}=this.props;return i?(0,u.createElement)(Dg,{onSelect:e=>{const n=Array.isArray(e)&&null!=e&&e.length?e[0]:e;s&&"function"==typeof s&&s(n),t()},rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:a,selectBlockOnInsert:c,orderInitialBlockItems:d}):(0,u.createElement)(Og,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,prioritizePatterns:a})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,u.createElement)(h.Dropdown,{className:"block-editor-inserter",contentClassName:p()("block-editor-inserter__popover",{"is-quick":r}),popoverProps:{position:e},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,_.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}const Vg=(0,m.compose)([(0,g.withSelect)(((e,t)=>{var n;let{clientId:o,rootClientId:r,shouldDirectInsert:l=!0}=t;const{getBlockRootClientId:i,hasInserterItems:s,getAllowedBlocks:c,__experimentalGetDirectInsertBlock:u,getSettings:d}=e(To),{getBlockVariations:p}=e(a.store);r=r||i(o)||void 0;const m=c(r),g=l&&u(r),f=d(),h=1===(null==m?void 0:m.length)&&0===(null===(n=p(m[0].name,"inserter"))||void 0===n?void 0:n.length);let v=!1;return h&&(v=m[0]),{hasItems:s(r),hasSingleBlockType:h,blockTitle:v?v.title:"",allowedBlockType:v,directInsertBlock:g,rootClientId:r,prioritizePatterns:f.__experimentalPreferPatternsOnRoot&&!r}})),(0,g.withDispatch)(((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:r,isAppender:l,hasSingleBlockType:i,allowedBlockType:s,directInsertBlock:c,onSelectOrClose:u,selectBlockOnInsert:d}=t;if(!i&&!c)return;const{insertBlock:p}=e(To);let m;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:l}=o(To);if(!e||!r&&!n)return{};const i={};let a={};if(r){const e=t(r),n=t(l(r));(null==e?void 0:e.name)===(null==n?void 0:n.name)&&(a=(null==n?void 0:n.attributes)||{})}else{var s;const e=t(n);if(null!=e&&null!==(s=e.innerBlocks)&&void 0!==s&&s.length){const t=e.innerBlocks[e.innerBlocks.length-1];c&&(null==c?void 0:c.name)===t.name&&(a=t.attributes)}}return e.forEach((e=>{a.hasOwnProperty(e)&&(i[e]=a[e])})),i}(c.attributesToCopy);m=(0,a.createBlock)(c.name,{...c.attributes||{},...e})}else m=(0,a.createBlock)(s.name);var g;(p(m,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:i,getBlockRootClientId:a}=o(To);if(r)return e(r);const s=t();return!l&&s&&a(s)===n?e(s)+1:i(n).length}(),n,d),u)&&u({clientId:null===(g=m)||void 0===g?void 0:g.clientId});const f=(0,_.sprintf)((0,_.__)("%s block added"),s.title);(0,pn.speak)(f)}}})),(0,m.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(Fg);var Hg=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(Vg,c({ref:t},e,{orderInitialBlockItems:void 0}))));var Gg=(0,m.compose)((0,g.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(To),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,g.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(To);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:o,placeholder:r,rootClientId:l}=e;if(t)return null;const i=(0,sd.decodeEntities)(r)||(0,_.__)("Type / to choose a block");return(0,u.createElement)("div",{"data-root-client-id":l||"",className:p()("block-editor-default-block-appender",{"has-visible-prompt":o})},(0,u.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,_.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{Qu.ENTER!==e.keyCode&&Qu.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,u.createElement)(Hg,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Ug(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,u.createElement)(Hg,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:i,disabled:a,isOpen:s,blockTitle:c,hasSingleBlockType:d}=e;n=d?(0,_.sprintf)((0,_._x)("Add %s","directly add the only allowed block"),c):(0,_._x)("Add block","Generic label for block inserter button");const m=!d;let g=(0,u.createElement)(h.Button,{ref:t,onFocus:r,tabIndex:l,className:p()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":m?"true":void 0,"aria-expanded":m?s:void 0,disabled:a,label:n},!d&&(0,u.createElement)(h.VisuallyHidden,{as:"span"},n),(0,u.createElement)(Jl,{icon:cd}));return(m||d)&&(g=(0,u.createElement)(h.Tooltip,{text:n},g)),g},isAppender:!0})}const $g=(0,u.forwardRef)(((e,t)=>(W()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Ug(e,t))));var jg=(0,u.forwardRef)(Ug);function Wg(e){let{rootClientId:t}=e;return(0,g.useSelect)((e=>e(To).canInsertBlockType((0,a.getDefaultBlockName)(),t)))?(0,u.createElement)(Gg,{rootClientId:t}):(0,u.createElement)(jg,{rootClientId:t,className:"block-list-appender__toggle"})}var Kg=function(e){let{rootClientId:t,renderAppender:n,className:o,tagName:r="div"}=e;const l=function(e,t){const{hideInserter:n,isParentSelected:o}=(0,g.useSelect)((t=>{const{getTemplateLock:n,getSelectedBlockClientId:o,__unstableGetEditorMode:r}=t(To),l=o();return{hideInserter:!!n(e)||"zoom-out"===r(),isParentSelected:e===l||!e&&!l}}),[e]);return n||!1===t?null:t?(0,u.createElement)(t,null):o?(0,u.createElement)(Wg,{rootClientId:e}):null}(t,n);return l?(0,u.createElement)(r,{tabIndex:-1,className:p()("block-list-appender wp-block",o),contentEditable:!1,"data-block":!0},l):null};const qg=Number.MAX_SAFE_INTEGER;(0,u.createContext)();var Yg=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...i}=e;const[a,s]=(0,u.useReducer)((e=>(e+1)%qg),0),{orientation:d,rootClientId:m,isVisible:f}=(0,g.useSelect)((e=>{var o;const{getBlockListSettings:r,getBlockRootClientId:l,isBlockVisible:i}=e(To),a=l(null!=t?t:n);return{orientation:(null===(o=r(a))||void 0===o?void 0:o.orientation)||"vertical",rootClientId:a,isVisible:i(t)&&i(n)}}),[t,n]),v=tr(t),b=tr(n),k="vertical"===d,y=(0,u.useMemo)((()=>{if(a<0||!v&&!b||!f)return{};const e=v?v.getBoundingClientRect():null,t=b?b.getBoundingClientRect():null;if(k)return{width:e?e.width:t.width,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,_.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:e?e.height:t.height}}),[v,b,k,a,f]),E=(0,u.useMemo)((()=>{if(a<0||!v&&!b||!f)return;const{ownerDocument:e}=v||b;return{ownerDocument:e,getBoundingClientRect(){const e=v?v.getBoundingClientRect():null,t=b?b.getBoundingClientRect():null;let n=0,o=0;return k?(o=e?e.bottom:t.top,n=(0,_.isRTL)()?e?e.right:t.right:e?e.left:t.left):(o=e?e.top:t.top,n=(0,_.isRTL)()?e?e.left:t.right:e?e.right:t.left),new window.DOMRect(n,o,0,0)}}}),[v,b,a,k,f]),C=qr(l);return(0,u.useLayoutEffect)((()=>{if(!v)return;const e=new window.MutationObserver(s);return e.observe(v,{attributes:!0}),()=>{e.disconnect()}}),[v]),(0,u.useLayoutEffect)((()=>{if(!b)return;const e=new window.MutationObserver(s);return e.observe(b,{attributes:!0}),()=>{e.disconnect()}}),[b]),(0,u.useLayoutEffect)((()=>{if(v)return v.ownerDocument.defaultView.addEventListener("resize",s),()=>{var e;null===(e=v.ownerDocument.defaultView)||void 0===e||e.removeEventListener("resize",s)}}),[v]),(v||b)&&f?(0,u.createElement)(h.Popover,c({ref:C,animate:!1,anchor:E,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+m},i,{className:p()("block-editor-block-popover","block-editor-block-popover__inbetween",i.className),resize:!1,flip:!1,placement:"bottom-start",variant:"unstyled"}),(0,u.createElement)("div",{className:"block-editor-block-popover__inbetween-container",style:y},o)):null};const Zg={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};var Qg=function(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{clientId:o}=(0,g.useSelect)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(To),o=n(),r=t(o.rootClientId);return r.length?{clientId:r[o.index]}:{}}),[]),r=(0,m.useReducedMotion)();return(0,u.createElement)(Zr,{clientId:o,__unstableCoverTarget:!0,__unstablePopoverSlot:t,__unstableContentRef:n,className:"block-editor-block-popover__drop-zone"},(0,u.createElement)(h.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:r?Zg.show:Zg.hide,animate:Zg.show,exit:r?Zg.show:Zg.exit,className:"block-editor-block-popover__drop-zone-foreground"}))};const Xg=(0,u.createContext)();function Jg(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,g.useDispatch)(To),l=(0,u.useContext)(Xg),i=(0,u.useRef)(),{orientation:a,previousClientId:s,nextClientId:c,rootClientId:d,isInserterShown:f,isDistractionFree:v,isNavigationMode:b}=(0,g.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:a,getSettings:s,isNavigationMode:c}=e(To),u=r(),d=n(u.rootClientId);if(!d.length)return{};let p=d[u.index-1],m=d[u.index];for(;l(p);)p=i(p);for(;l(m);)m=a(m);const g=s();return{previousClientId:p,nextClientId:m,orientation:(null===(t=o(u.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:u.rootClientId,isNavigationMode:c(),isDistractionFree:g.isDistractionFree,isInserterShown:null==u?void 0:u.__unstableWithInserter}}),[]),k=(0,m.useReducedMotion)();const _={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:f?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},y={start:{scale:k?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(v&&!b)return null;const E=p()("block-editor-block-list__insertion-point","is-"+a);return(0,u.createElement)(Yg,{previousClientId:s,nextClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n},(0,u.createElement)(h.__unstableMotion.div,{layout:!k,initial:k?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&c&&o(c,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:p()(E,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==i.current||l.current||r()}},(0,u.createElement)(h.__unstableMotion.div,{variants:_,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),f&&(0,u.createElement)(h.__unstableMotion.div,{variants:y,className:p()("block-editor-block-list__insertion-point-inserter")},(0,u.createElement)(Hg,{position:"bottom center",clientId:c,rootClientId:d,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function ef(e){const{insertionPoint:t,isVisible:n}=(0,g.useSelect)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n}=e(To);return{insertionPoint:t(),isVisible:n()}}),[]);return n?"replace"===t.operation?(0,u.createElement)(Qg,c({key:`${t.rootClientId}-${t.index}`},e)):(0,u.createElement)(Jg,e):null}function tf(){const e=(0,u.useContext)(Xg),t=(0,g.useSelect)((e=>e(To).getSettings().isDistractionFree||"zoom-out"===e(To).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:s,__unstableIsWithinBlockOverlay:c}=(0,g.useSelect)(To),{showInsertionPoint:d,hideInsertionPoint:p}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",l),()=>{o.removeEventListener("mousemove",l)};function l(t){var o;if(e.current)return;if(t.target.nodeType===t.target.TEXT_NODE)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void p();let l;if(!t.target.classList.contains("is-root-container")){l=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")}if(s(l))return;const u=(null===(o=n(l))||void 0===o?void 0:o.orientation)||"vertical",m=t.clientY,g=t.clientX;let f=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===u&&t.top>m||e.classList.contains("wp-block")&&"horizontal"===u&&t.left>g}));if(!f)return void p();if(!f.id&&(f=f.firstElementChild,!f))return void p();const h=f.id.slice("block-".length);if(!h||c(h))return;if(a().includes(h))return;const v=f.getBoundingClientRect();if("horizontal"===u&&(t.clientY>v.bottom||t.clientYv.right||t.clientX{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,of="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function rf(e){return(0,g.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(To),{getBlockType:r,getActiveBlockVariation:l}=t(a.store),i=n(e),s=r(i);if(!s)return null;const c=o(e),u=l(i,c),d=(0,a.isReusableBlock)(s)||(0,a.isTemplatePart)(s),p={isSynced:d,title:s.title,icon:s.icon,description:s.description,anchor:null==c?void 0:c.anchor};return u?{isSynced:d,title:u.title||s.title,icon:u.icon||s.icon,description:u.description||s.description,anchor:null==c?void 0:c.anchor}:p}),[e])}function lf(e){let{clientId:t,maximumLength:n,context:o}=e;const{attributes:r,name:l,reusableBlockTitle:i}=(0,g.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:r}=e(To),l=n(t);if(!l)return{};const i=(0,a.isReusableBlock)((0,a.getBlockType)(l));return{attributes:o(t),name:l,reusableBlockTitle:i&&r(o(t).ref)}}),[t]),s=rf(t);if(!l||!s)return null;const c=(0,a.getBlockType)(l),u=c?(0,a.__experimentalGetBlockLabel)(c,r,o):null,d=i||u,p=d&&d!==c.title?d:s.title;if(n&&n>0&&p.length>n){const e="...";return p.slice(0,n-e.length)+e}return p}function af(e){let{clientId:t,maximumLength:n,context:o}=e;return lf({clientId:t,maximumLength:n,context:o})}var sf=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:r,onDragEnd:l}=e;const{srcRootClientId:i,isDraggable:s,icon:c}=(0,g.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:r,getBlockName:l}=e(To),i=r(n[0]),s=l(n[0]);return{srcRootClientId:i,isDraggable:o(n,i),icon:null===(t=(0,a.getBlockType)(s))||void 0===t?void 0:t.icon}}),[n]),d=(0,u.useRef)(!1),[p,m,f]=function(){const e=(0,u.useRef)(null),t=(0,u.useRef)(null),n=(0,u.useRef)(null),o=(0,u.useRef)(null);return(0,u.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,u.useCallback)((r=>{e.current=r.clientY,n.current=(0,Ri.getScrollContainer)(r.target),o.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,u.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,l=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(r-l-50,0),n=Math.max(i-l-50,0)/e;t.current=25*n}else if(o.clientY{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,g.useDispatch)(To);if((0,u.useEffect)((()=>()=>{d.current&&b()}),[]),!s)return t({draggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:i};return(0,u.createElement)(h.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),d.current=!0,p(e),r&&r()},onDragOver:m,onDragEnd:()=>{b(),d.current=!1,f(),l&&l()},__experimentalDragComponent:(0,u.createElement)(lm,{count:n.length,icon:c})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))};var cf=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));var uf=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const df=(e,t)=>"up"===e?"horizontal"===t?(0,_.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,_.isRTL)()?"left":"right":"down":null;function pf(e,t,n,o,r,l,i){const a=n+1;if(e>1)return function(e,t,n,o,r,l){const i=t+1;if(n&&o)return(0,_.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=df("down",l);if("down"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d down by one place"),e,i);if("left"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r>0&&o){const e=df("down",l);if("down"===e)return(0,_.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,_.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,_.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const t=df("up",l);if("up"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d up by one place"),e,i);if("left"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r<0&&n){const e=df("up",l);if("up"===e)return(0,_.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,_.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,_.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,o,r,l,i);if(o&&r)return(0,_.sprintf)((0,_.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=df("down",i);if("down"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d down to position %3$d"),t,a,a+1);if("left"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a+1);if("right"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a+1)}if(l>0&&r){const e=df("down",i);if("down"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(l<0&&!o){const e=df("up",i);if("up"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d up to position %3$d"),t,a,a-1);if("left"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a-1);if("right"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a-1)}if(l<0&&o){const e=df("up",i);if("up"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}const mf=(e,t)=>"up"===e?"horizontal"===t?(0,_.isRTL)()?pd:md:cf:"down"===e?"horizontal"===t?(0,_.isRTL)()?md:pd:uf:null,gf=(e,t)=>"up"===e?"horizontal"===t?(0,_.isRTL)()?(0,_.__)("Move right"):(0,_.__)("Move left"):(0,_.__)("Move up"):"down"===e?"horizontal"===t?(0,_.isRTL)()?(0,_.__)("Move left"):(0,_.__)("Move right"):(0,_.__)("Move down"):null,ff=(0,u.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:r,...l}=e;const i=(0,m.useInstanceId)(ff),s=Array.isArray(n)?n:[n],d=s.length,{blockType:f,isDisabled:v,rootClientId:b,isFirst:k,isLast:_,firstIndex:y,orientation:E="vertical"}=(0,g.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:n,getBlockOrder:l,getBlock:i,getBlockListSettings:c}=e(To),u=s[0],d=n(u),p=t(u),m=t(s[s.length-1]),g=l(d),f=i(u),h=0===p,v=m===g.length-1,{orientation:b}=c(d)||{};return{blockType:f?(0,a.getBlockType)(f.name):null,isDisabled:"up"===o?h:v,rootClientId:d,firstIndex:p,isFirst:h,isLast:v,orientation:r||b}}),[n,o]),{moveBlocksDown:C,moveBlocksUp:S}=(0,g.useDispatch)(To),w="up"===o?S:C,B=`block-editor-block-mover-button__description-${i}`;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Button,c({ref:t,className:p()("block-editor-block-mover-button",`is-${o}-button`),icon:mf(o,E),label:gf(o,E),"aria-describedby":B},l,{onClick:v?null:e=>{w(n,b),l.onClick&&l.onClick(e)},disabled:v,__experimentalIsFocusable:!0})),(0,u.createElement)(h.VisuallyHidden,{id:B},pf(d,f&&f.title,y,k,_,"up"===o?-1:1,E)))})),hf=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(ff,c({direction:"up",ref:t},e)))),vf=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(ff,c({direction:"down",ref:t},e))));var bf=function(e){let{clientIds:t,hideDragHandle:n}=e;const{canMove:o,rootClientId:r,isFirst:l,isLast:i,orientation:a}=(0,g.useSelect)((e=>{var n;const{getBlockIndex:o,getBlockListSettings:r,canMoveBlocks:l,getBlockOrder:i,getBlockRootClientId:a}=e(To),s=Array.isArray(t)?t:[t],c=s[0],u=a(c),d=o(c),p=o(s[s.length-1]),m=i(u);return{canMove:l(t,u),rootClientId:u,isFirst:0===d,isLast:p===m.length-1,orientation:null===(n=r(u))||void 0===n?void 0:n.orientation}}),[t]);if(!o||l&&i&&!r)return null;const s=(0,_.__)("Drag");return(0,u.createElement)(h.ToolbarGroup,{className:p()("block-editor-block-mover",{"is-horizontal":"horizontal"===a})},!n&&(0,u.createElement)(sf,{clientIds:t},(e=>(0,u.createElement)(h.Button,c({icon:rm,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:s,tabIndex:"-1"},e)))),(0,u.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(hf,c({clientIds:t},e)))),(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(vf,c({clientIds:t},e))))))};var kf=function(e){let{clientId:t,rootClientId:n}=e;const o=rf(t),r=(0,g.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:a,__unstableGetEditorMode:s}=e(To),c=l(t),{name:u,attributes:d}=r(t);return{index:c,name:u,attributes:d,blockMovingMode:i(),orientation:null===(o=a(n))||void 0===o?void 0:o.orientation,editorMode:s()}}),[t,n]),{index:l,name:i,attributes:s,blockMovingMode:d,orientation:m,editorMode:f}=r,{setNavigationMode:v,removeBlock:b}=(0,g.useDispatch)(To),k=(0,u.useRef)(),y=(0,a.getBlockType)(i),E=(0,a.__experimentalGetAccessibleBlockLabel)(y,s,l+1,m);(0,u.useEffect)((()=>{k.current.focus(),(0,pn.speak)(E)}),[E]);const C=tr(t),{hasBlockMovingClientId:S,getBlockIndex:w,getBlockRootClientId:B,getClientIdsOfDescendants:I,getSelectedBlockClientId:x,getMultiSelectedBlocksEndClientId:T,getPreviousBlockClientId:M,getNextBlockClientId:N}=(0,g.useSelect)(To),{selectBlock:P,clearSelectedBlock:L,setBlockMovingClientId:R,moveBlockToPosition:A}=(0,g.useDispatch)(To),O=p()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!d}),D=(0,_.__)("Drag");return(0,u.createElement)("div",{className:O},(0,u.createElement)(h.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(fd,{icon:null==o?void 0:o.icon,showColors:!0})),(0,u.createElement)(h.FlexItem,null,"zoom-out"===f&&(0,u.createElement)(bf,{clientIds:[t],hideDragHandle:!0}),"navigation"===f&&(0,u.createElement)(sf,{clientIds:[t]},(e=>(0,u.createElement)(h.Button,c({icon:rm,className:"block-selection-button_drag-handle","aria-hidden":"true",label:D,tabIndex:"-1"},e))))),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{ref:k,onClick:"navigation"===f?()=>v(!1):void 0,onKeyDown:function(e){const{keyCode:n}=e,o=n===Qu.UP,r=n===Qu.DOWN,l=n===Qu.LEFT,i=n===Qu.RIGHT,a=n===Qu.TAB,s=n===Qu.ESCAPE,c=n===Qu.ENTER,u=n===Qu.SPACE,d=e.shiftKey;if(n===Qu.BACKSPACE||n===Qu.DELETE)return b(t),void e.preventDefault();const p=x(),m=T(),g=M(m||p),f=N(m||p),h=a&&d||o,v=a&&!d||r,k=l,_=i;let y;if(h)y=g;else if(v)y=f;else if(k){var E;y=null!==(E=B(p))&&void 0!==E?E:p}else if(_){var O;y=null!==(O=I([p])[0])&&void 0!==O?O:p}const D=S();if(s&&D&&!e.defaultPrevented&&(R(null),e.preventDefault()),(c||u)&&D){const e=B(D),t=B(p),n=w(D);let o=w(p);n{!function(e){const[t]=Ri.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,xd.useShortcut)("core/block-editor/focus-toolbar",a),(0,u.useEffect)((()=>{l&&a()}),[n,l,a]),(0,u.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=_f(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=_f(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}var Ef=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const i=(0,u.useRef)(),a=function(e){const[t,n]=(0,u.useState)(!0),o=(0,u.useCallback)((()=>{const t=!Ri.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||W()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,u.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(i);return yf(i,n,a,o,r),a?(0,u.createElement)(h.Toolbar,c({label:l["aria-label"],ref:i},l),t):(0,u.createElement)(h.NavigableMenu,c({orientation:"horizontal",role:"toolbar",ref:i},l),t)};const{clearTimeout:Cf,setTimeout:Sf}=window,wf=()=>{},Bf=200;function If(e){let{ref:t,isFocused:n,debounceTimeout:o=Bf,onChange:r=wf}=e;const[l,i]=(0,u.useState)(!1),a=(0,u.useRef)(),s=e=>{null!=t&&t.current&&i(e),r(e)},c=()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e},d=()=>{const e=a.current;e&&Cf&&Cf(e)};return(0,u.useEffect)((()=>()=>{s(!1),d()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),d(),l||s(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),d(),a.current=Sf((()=>{c()&&s(!1)}),o)}}}function xf(e){let{ref:t,debounceTimeout:n=Bf,onChange:o=wf}=e;const[r,l]=(0,u.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:s}=If({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),c=(0,u.useRef)(!1),d=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,u.useEffect)((()=>{const e=t.current,n=()=>{d()&&(l(!0),a())},o=()=>{d()||(l(!1),s())};return e&&!c.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),c.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,c,l,a,s]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:s}}}function Tf(){const{selectBlock:e,toggleBlockHighlight:t}=(0,g.useDispatch)(To),{firstParentClientId:n,shouldHide:o,isDistractionFree:r}=(0,g.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:r}=e(To),{hasBlockSupport:l}=e(a.store),i=n(o()),s=i[i.length-1],c=t(s),u=(0,a.getBlockType)(c),d=r();return{firstParentClientId:s,shouldHide:!l(u,"__experimentalParentSelector",!0),isDistractionFree:d.isDistractionFree}}),[]),l=rf(n),i=(0,u.useRef)(),{gestures:s}=xf({ref:i,onChange(e){e&&r||t(n,e)}});return o||void 0===n?null:(0,u.createElement)("div",c({className:"block-editor-block-parent-selector",key:n,ref:i},s),(0,u.createElement)(h.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,_.sprintf)((0,_.__)("Select %s"),null==l?void 0:l.title),showTooltip:!0,icon:(0,u.createElement)(fd,{icon:null==l?void 0:l.icon})}))}var Mf=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"}));function Nf(e){let{blocks:t}=e;return(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,u.createElement)(h.Popover,{className:"block-editor-block-switcher__preview__popover",placement:"bottom-start",focusOnMount:!1},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,_.__)("Preview")),(0,u.createElement)(Jp,{viewportWidth:500,blocks:t})))))}function Pf(e){let{restTransformations:t,onSelect:n,setHoveredTransformItemName:o}=e;return t.map((e=>(0,u.createElement)(Lf,{key:e.name,item:e,onSelect:n,setHoveredTransformItemName:o})))}function Lf(e){let{item:t,onSelect:n,setHoveredTransformItemName:o}=e;const{name:r,icon:l,title:i,isDisabled:s}=t;return(0,u.createElement)(h.MenuItem,{className:(0,a.getBlockMenuDefaultClassName)(r),onClick:e=>{e.preventDefault(),n(r)},disabled:s,onMouseLeave:()=>o(null),onMouseEnter:()=>o(r)},(0,u.createElement)(fd,{icon:l,showColors:!0}),i)}var Rf=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:r}=e;const[l,i]=(0,u.useState)(),{priorityTextTransformations:s,restTransformations:c}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,u.useMemo)((()=>{const n=Object.keys(t);return e.reduce(((e,t)=>{const{name:o}=t;return n.includes(o)?e.priorityTextTransformations.push(t):e.restTransformations.push(t),e}),{priorityTextTransformations:[],restTransformations:[]})}),[e]);return n.priorityTextTransformations.sort(((e,n)=>{let{name:o}=e,{name:r}=n;return t[o](0,u.createElement)(Lf,{key:e.name,item:e,onSelect:o,setHoveredTransformItemName:i}))),!d&&p),!!d&&(0,u.createElement)(h.MenuGroup,{className:t},p))};var Af=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),Of=window.wp.tokenList,Df=n.n(Of);function zf(e,t,n){const o=new(Df())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function Ff(e){return null==e?void 0:e.find((e=>e.isDefault))}function Vf(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:r,blockType:l,className:i}=(0,g.useSelect)((e=>{const{getBlock:n}=e(To),o=n(t);if(!o)return{};const r=(0,a.getBlockType)(o.name),{getBlockStyles:l}=e(a.store);return{block:o,blockType:r,styles:l(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:s}=(0,g.useDispatch)(To),c=function(e){return e&&0!==e.length?Ff(e)?e:[{name:"default",label:(0,_._x)("Default","block style"),isDefault:!0},...e]:[]}(o),d=function(e,t){for(const n of new(Df())(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=null==e?void 0:e.find((e=>{let{name:n}=e;return n===t}));if(o)return o}return Ff(e)}(c,i),p=function(e,t){return(0,u.useMemo)((()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?(0,a.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,a.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(r,l);return{onSelect:e=>{const o=zf(i,d,e);s(t,{className:o}),n()},stylesToRender:c,activeStyle:d,genericPreviewBlock:p,className:i}}const Hf=()=>{};function Gf(e){let{clientId:t,onSwitch:n=Hf}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=Vf({clientId:t,onSwitch:n});return r&&0!==r.length?(0,u.createElement)(u.Fragment,null,r.map((e=>{const t=e.label||e.name;return(0,u.createElement)(h.MenuItem,{key:e.name,icon:l.name===e.name?Af:null,onClick:()=>o(e)},(0,u.createElement)(h.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function Uf(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,u.createElement)(h.MenuGroup,{label:(0,_.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,u.createElement)(Gf,{clientId:o,onSwitch:n}))}const $f=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const{clientId:o,name:r,innerBlocks:l=[]}=e;if(!n.has(o)){if(r===t)return e;for(const e of l){const o=$f(e,t,n);if(o)return o}}},jf=(e,t)=>{const n=((e,t)=>{const n=(0,a.__experimentalGetBlockAttributesNamesByRole)(e,"content");return null!=n&&n.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};var Wf=(e,t)=>(0,u.useMemo)((()=>e.reduce(((e,n)=>{const o=((e,t)=>{const n=t.map((e=>(0,a.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=$f(r,t.name,o);if(n){e=!0,o.add(n.clientId),jf(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]);function Kf(e){let{patterns:t,onSelect:n}=e;return(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,u.createElement)(h.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,_.__)("Preview")),(0,u.createElement)(qf,{patterns:t,onSelect:n})))))}function qf(e){let{patterns:t,onSelect:n}=e;const o=(0,h.__unstableUseCompositeState)();return(0,u.createElement)(h.__unstableComposite,c({},o,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,_.__)("Patterns list")}),t.map((e=>(0,u.createElement)(Yf,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Yf(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,m.useInstanceId)(Yf,`${r}-list__item-description`);return(0,u.createElement)("div",{className:`${r}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?l:void 0},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},o,{className:`${r}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,u.createElement)(Jp,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,u.createElement)("div",{className:`${r}-list__item-title`},t.title)),!!t.description&&(0,u.createElement)(h.VisuallyHidden,{id:l},t.description))}var Zf=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[r,l]=(0,u.useState)(!1),i=Wf(n,t);return i.length?(0,u.createElement)(h.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},r&&(0,u.createElement)(Kf,{patterns:i,onSelect:o}),(0,u.createElement)(h.MenuItem,{onClick:e=>{e.preventDefault(),l(!r)},icon:pd},(0,_.__)("Patterns"))):null};const Qf=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o,multiSelect:r}=(0,g.useDispatch)(To),l=rf(n[0].clientId),{possibleBlockTransformations:i,canRemove:s,hasBlockStyles:c,icon:d,patterns:p}=(0,g.useSelect)((e=>{const{getBlockRootClientId:o,getBlockTransformItems:r,__experimentalGetPatternTransformItems:i}=e(To),{getBlockStyles:s,getBlockType:c}=e(a.store),{canRemoveBlocks:u}=e(To),d=o(Array.isArray(t)?t[0]:t),[{name:p}]=n,m=1===n.length,g=m&&s(p);let f;if(m)f=null==l?void 0:l.icon;else{var h;f=1===new Set(n.map((e=>{let{name:t}=e;return t}))).size?null===(h=c(p))||void 0===h?void 0:h.icon:Mf}return{possibleBlockTransformations:r(n,d),canRemove:u(t,d),hasBlockStyles:!(null==g||!g.length),icon:f,patterns:i(n,d)}}),[t,n,null==l?void 0:l.icon]),m=lf({clientId:Array.isArray(t)?t[0]:t,maximumLength:35}),f=1===n.length&&(0,a.isReusableBlock)(n[0]),v=1===n.length&&(0,a.isTemplatePart)(n[0]);function b(e){e.length>1&&r(e[0].clientId,e[e.length-1].clientId)}const k=!!i.length&&s&&!v,y=!(null==p||!p.length)&&s;if(!c&&!k)return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:m,icon:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(fd,{icon:d,showColors:!0}),(f||v)&&(0,u.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},m))}));const E=m,C=1===n.length?(0,_.sprintf)((0,_.__)("%s: Change block type or style"),m):(0,_.sprintf)((0,_._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),S=c||k||y;return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(h.DropdownMenu,{className:"block-editor-block-switcher",label:E,popoverProps:{position:"bottom right",variant:"toolbar",className:"block-editor-block-switcher__popover"},icon:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(fd,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(f||v)&&(0,u.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},m)),toggleProps:{describedBy:C,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:r}=e;return S&&(0,u.createElement)("div",{className:"block-editor-block-switcher__container"},y&&(0,u.createElement)(Zf,{blocks:n,patterns:p,onSelect:e=>{!function(e){o(t,e),b(e)}(e),r()}}),k&&(0,u.createElement)(Rf,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,blocks:n,onSelect:e=>{!function(e){const r=(0,a.switchToBlockType)(n,e);o(t,r),b(r)}(e),r()}}),c&&(0,u.createElement)(Uf,{hoveredBlock:n[0],onSwitch:r}))})))))};var Xf=e=>{let{clientIds:t}=e;const n=(0,g.useSelect)((e=>e(To).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,u.createElement)(Qf,{clientIds:t,blocks:n})};const{Fill:Jf,Slot:eh}=(0,h.createSlotFill)("__unstableBlockToolbarLastItem");Jf.Slot=eh;var th=Jf;function nh(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;if(1!==(null===(n=t.match(e))||void 0===n?void 0:n.length))return!0;const o=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(o))return!0}return!1}function oh(){const{getBlockName:e}=(0,g.useSelect)(To),{getBlockType:t}=(0,g.useSelect)(a.store),{createSuccessNotice:n}=(0,g.useDispatch)(hm.store);return(0,u.useCallback)(((o,r)=>{let l="";if(1===r.length){var i;const n=r[0],a=null===(i=t(e(n)))||void 0===i?void 0:i.title;l="copy"===o?(0,_.sprintf)((0,_.__)('Copied "%s" to clipboard.'),a):(0,_.sprintf)((0,_.__)('Moved "%s" to clipboard.'),a)}else l="copy"===o?(0,_.sprintf)((0,_._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,_.sprintf)((0,_._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function rh(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:r,__unstableIsSelectionCollapsed:l,__unstableIsSelectionMergeable:i,__unstableGetSelectedBlocksWithPartialSelection:s,canInsertBlockType:c}=(0,g.useSelect)(To),{flashBlock:u,removeBlocks:d,replaceBlocks:p,__unstableDeleteSelection:f,__unstableExpandSelection:h,insertBlocks:v}=(0,g.useDispatch)(To),b=oh();return(0,m.useRefEffect)((m=>{function g(g){const k=t();if(0===k.length)return;if(!n()){const{target:e}=g,{ownerDocument:t}=e;if("copy"===g.type||"cut"===g.type?(0,Ri.documentHasUncollapsedSelection)(t):(0,Ri.documentHasSelection)(t))return}if(!m.contains(g.target.ownerDocument.activeElement))return;const _=g.defaultPrevented;g.preventDefault();const y=i(),E=l()||r(),C=!E&&!y;if("copy"===g.type||"cut"===g.type)if(1===k.length&&u(k[0]),C)h();else{let t;if(b(g.type,k),E)t=e(k);else{const[n,o]=s();t=[n,...e(k.slice(1,k.length-1)),o]}const n=g.clipboardData.getData("__unstableWrapperBlockName");n&&(t=(0,a.createBlock)(n,JSON.parse(g.clipboardData.getData("__unstableWrapperBlockAttributes")),t));const o=(0,a.serialize)(t);g.clipboardData.setData("text/plain",function(e){e=e.replace(/
/g,"\n");return(0,Ri.__unstableStripHTML)(e).trim().replace(/\n\n+/g,"\n\n")}(o)),g.clipboardData.setData("text/html",o)}if("cut"===g.type)E&&!C?d(k):f();else if("paste"===g.type){if(_)return;const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n,files:r}=function(e){let{clipboardData:t}=e,n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}const r=(0,Ri.getFilesFromDataTransfer)(t);return r.length&&!nh(r,o)?{files:r}:{html:o,plainText:n,files:[]}}(g);let l=[];if(r.length){const e=(0,a.getBlockTransforms)("from");l=r.reduce(((t,n)=>{const o=(0,a.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat()}else l=(0,a.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});if(1===k.length){const[e]=k;if(l.every((t=>c(t.name,e))))return void v(l,void 0,e)}p(k,l,l.length-1,-1)}}return m.ownerDocument.addEventListener("copy",g),m.ownerDocument.addEventListener("cut",g),m.ownerDocument.addEventListener("paste",g),()=>{m.ownerDocument.removeEventListener("copy",g),m.ownerDocument.removeEventListener("cut",g),m.ownerDocument.removeEventListener("paste",g)}}),[])}var lh=function(e){let{children:t}=e;return(0,u.createElement)("div",{ref:rh()},t)};const ih="align",ah="__experimentalBorder",sh="color",ch="customClassName",uh="typography.__experimentalFontFamily",dh="typography.fontSize",ph="__experimentalLayout",mh=[...["typography.lineHeight",dh,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",uh,"typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"],ah,sh,"spacing"];const gh={align:e=>(0,a.hasBlockSupport)(e,ih),borderColor:e=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==u.Platform.OS)return!1;const n=(0,a.getBlockSupport)(e,ah);return!!(!0===n||("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}(e,"color"),backgroundColor:e=>{const t=(0,a.getBlockSupport)(e,sh);return t&&!1!==t.background},textColor:e=>{const t=(0,a.getBlockSupport)(e,sh);return t&&!1!==t.text},gradient:e=>{const t=(0,a.getBlockSupport)(e,sh);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>(0,a.hasBlockSupport)(e,ch,!0),fontFamily:e=>(0,a.hasBlockSupport)(e,uh),fontSize:e=>(0,a.hasBlockSupport)(e,dh),layout:e=>(0,a.hasBlockSupport)(e,ph),style:e=>mh.some((t=>(0,a.hasBlockSupport)(e,t)))};function fh(e,t){return Object.entries(gh).reduce(((n,o)=>{let[r,l]=o;return l(e.name)&&l(t.name)&&(n[r]=e.attributes[r]),n}),{})}function hh(e,t,n){for(let o=0;o{let i="";try{if(!window.navigator.clipboard)return void r((0,_.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});i=await window.navigator.clipboard.readText()}catch(e){return void r((0,_.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"})}if(!i||!function(e){try{const t=(0,a.parse)(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return 1!==t.length||"core/freeform"!==t[0].name}catch(e){return!1}}(i))return void o((0,_.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});const s=(0,a.parse)(i);if(1===s.length?e.batch((()=>{hh(l,l.map((()=>s[0])),t)})):e.batch((()=>{hh(l,s,t)})),1===l.length){var c;const e=null===(c=(0,a.getBlockType)(l[0].name))||void 0===c?void 0:c.title;n((0,_.sprintf)((0,_.__)("Pasted styles to %s."),e),{type:"snackbar"})}else n((0,_.sprintf)((0,_.__)("Pasted styles to %d blocks."),l.length),{type:"snackbar"})}),[e.batch,t,n,o,r])}function bh(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:r,getBlockRootClientId:l,getBlocksByClientId:i,canMoveBlocks:s,canRemoveBlocks:c}=(0,g.useSelect)(To),{getDefaultBlockName:u,getGroupingBlockName:d}=(0,g.useSelect)(a.store),p=i(t),m=l(t[0]),f=p.every((e=>!!e&&(0,a.hasBlockSupport)(e.name,"multiple",!0)&&r(e.name,m))),h=r(u(),m),v=s(t,m),b=c(t,m),{removeBlocks:k,replaceBlocks:_,duplicateBlocks:y,insertAfterBlock:E,insertBeforeBlock:C,flashBlock:S,setBlockMovingClientId:w,setNavigationMode:B,selectBlock:I}=(0,g.useDispatch)(To),x=oh(),T=vh();return n({canDuplicate:f,canInsertDefaultBlock:h,canMove:v,canRemove:b,rootClientId:m,blocks:p,onDuplicate(){return y(t,o)},onRemove(){return k(t,o)},onInsertBefore(){const e=Array.isArray(t)?t[0]:e;C(e)},onInsertAfter(){const e=Array.isArray(t)?t[t.length-1]:e;E(e)},onMoveTo(){B(!0),I(t[0]),w(t[0])},onGroup(){if(!p.length)return;const e=d(),n=(0,a.switchToBlockType)(p,e);n&&_(t,n)},onUngroup(){if(!p.length)return;const e=p[0].innerBlocks;e.length&&_(t,e)},onCopy(){const e=p.map((e=>{let{clientId:t}=e;return t}));1===p.length&&S(e[0]),x("copy",e)},async onPasteStyles(){await T(p)}})}const kh=()=>{};var _h=(0,m.compose)([(0,g.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:r,getSettings:l}=e(To),i=o(n),s=l().codeEditingEnabled;return{mode:r(n),blockType:i?(0,a.getBlockType)(i.name):null,isCodeEditingEnabled:s}})),(0,g.withDispatch)(((e,t)=>{let{onToggle:n=kh,clientId:o}=t;return{onToggleMode(){e(To).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:r=!1,isCodeEditingEnabled:l=!0}=e;if(!t||!(0,a.hasBlockSupport)(t,"html",!0)||!l)return null;const i="visual"===n?(0,_.__)("Edit as HTML"):(0,_.__)("Edit visually");return(0,u.createElement)(h.MenuItem,{onClick:o},!r&&i)}));var yh=(0,m.compose)((0,g.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(To).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,g.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(To).replaceBlocks(n.clientId,(0,a.rawHandler)({HTML:(0,a.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const r=(0,_.__)("Convert to Blocks");return(0,u.createElement)(h.MenuItem,{onClick:n},!o&&r)}));const{Fill:Eh,Slot:Ch}=(0,h.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Eh.Slot=Ch;var Sh=Eh;function wh(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}=(0,g.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:r,getSelectedBlockClientIds:l}=e(To),{getGroupingBlockName:i}=e(a.store),s=l(),c=i(),u=r(c,null!=s&&s.length?n(s[0]):void 0),d=o(s),p=1===d.length&&(null===(t=d[0])||void 0===t?void 0:t.name)===c;return{clientIds:s,isGroupable:u&&d.length,isUngroupable:p&&!!d[0].innerBlocks.length,blocksSelection:d,groupingBlockName:c}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}}function Bh(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:r,groupingBlockName:l,onClose:i=(()=>{})}=e;const{replaceBlocks:s}=(0,g.useDispatch)(To);return n||o?(0,u.createElement)(u.Fragment,null,n&&(0,u.createElement)(h.MenuItem,{onClick:()=>{(()=>{const e=(0,a.switchToBlockType)(r,l);e&&s(t,e)})(),i()}},(0,_._x)("Group","verb")),o&&(0,u.createElement)(h.MenuItem,{onClick:()=>{(()=>{const e=r[0].innerBlocks;e.length&&s(t,e)})(),i()}},(0,_._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function Ih(e){return(0,g.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:a,getTemplateLock:s}=t(To),c=a(e),u=n(e),d=o(e,c),p=r(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:l(i(e)),isContentLocked:"contentOnly"===s(e),isLocked:!u||!d||!p}}),[e])}var xh=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"}));var Th=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zM9.8 7c0-1.2 1-2.2 2.2-2.2 1.2 0 2.2 1 2.2 2.2v3H9.8V7zm6.7 11.5h-9v-7h9v7z"}));var Mh=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"}));const Nh=["core/block","core/navigation"];function Ph(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function Lh(e){let{clientId:t,onClose:n}=e;const[o,r]=(0,u.useState)({move:!1,remove:!1}),{canEdit:l,canMove:i,canRemove:s}=Ih(t),{allowsEditLocking:c,templateLock:d,hasTemplateLock:p}=(0,g.useSelect)((e=>{var n,o;const{getBlockName:r,getBlockAttributes:l}=e(To),i=r(t),s=(0,a.getBlockType)(i);return{allowsEditLocking:Nh.includes(i),templateLock:null===(n=l(t))||void 0===n?void 0:n.templateLock,hasTemplateLock:!(null==s||null===(o=s.attributes)||void 0===o||!o.templateLock)}}),[t]),[f,v]=(0,u.useState)(!!d),{updateBlockAttributes:b}=(0,g.useDispatch)(To),k=rf(t),y=(0,m.useInstanceId)(Lh,"block-editor-block-lock-modal__options-title");(0,u.useEffect)((()=>{r({move:!i,remove:!s,...c?{edit:!l}:{}})}),[l,i,s,c]);const E=Object.values(o).every(Boolean),C=Object.values(o).some(Boolean)&&!E;return(0,u.createElement)(h.Modal,{title:(0,_.sprintf)((0,_.__)("Lock %s"),k.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:n},(0,u.createElement)("p",null,(0,_.__)("Choose specific attributes to restrict or lock all available options.")),(0,u.createElement)("form",{onSubmit:e=>{e.preventDefault(),b([t],{lock:o,templateLock:f?Ph(o):void 0}),n()}},(0,u.createElement)("div",{role:"group","aria-labelledby":y,className:"block-editor-block-lock-modal__options"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-title",label:(0,u.createElement)("span",{id:y},(0,_.__)("Lock all")),checked:E,indeterminate:C,onChange:e=>r({move:e,remove:e,...c?{edit:e}:{}})}),(0,u.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},c&&(0,u.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Restrict editing"),checked:!!o.edit,onChange:e=>r((t=>({...t,edit:e})))}),(0,u.createElement)(h.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.edit?Mh:xh})),(0,u.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Disable movement"),checked:o.move,onChange:e=>r((t=>({...t,move:e})))}),(0,u.createElement)(h.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.move?Mh:xh})),(0,u.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Prevent removal"),checked:o.remove,onChange:e=>r((t=>({...t,remove:e})))}),(0,u.createElement)(h.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.remove?Mh:xh}))),p&&(0,u.createElement)(h.ToggleControl,{className:"block-editor-block-lock-modal__template-lock",label:(0,_.__)("Apply to all blocks inside"),checked:f,disabled:o.move&&!o.remove,onChange:()=>v(!f)})),(0,u.createElement)(h.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{variant:"tertiary",onClick:n},(0,_.__)("Cancel"))),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{variant:"primary",type:"submit"},(0,_.__)("Apply"))))))}function Rh(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=Ih(t),[r,l]=(0,u.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,_.__)("Unlock"):(0,_.__)("Lock");return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuItem,{icon:o?xh:Th,onClick:l},i),r&&(0,u.createElement)(Lh,{clientId:t,onClose:l}))}const{Fill:Ah,Slot:Oh}=(0,h.createSlotFill)("BlockSettingsMenuControls");function Dh(e){let{...t}=e;return(0,u.createElement)(h.__experimentalStyleProvider,{document:document},(0,u.createElement)(Ah,t))}Dh.Slot=e=>{let{fillProps:t,clientIds:n=null,__unstableDisplayLocation:o}=e;const{selectedBlocks:r,selectedClientIds:l,canRemove:i}=(0,g.useSelect)((e=>{const{getBlockNamesByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e(To),l=null!==n?n:o();return{selectedBlocks:t(l),selectedClientIds:l,canRemove:r(l)}}),[n]),{canLock:a}=Ih(l[0]),s=1===l.length&&a,d=wh(),{isGroupable:p,isUngroupable:m}=d,f=(p||m)&&i;return(0,u.createElement)(Oh,{fillProps:{...t,__unstableDisplayLocation:o,selectedBlocks:r,selectedClientIds:l}},(e=>!(null!=e&&e.length)>0&&!f&&!s?null:(0,u.createElement)(h.MenuGroup,null,s&&(0,u.createElement)(Rh,{clientId:l[0]}),e,f&&(0,u.createElement)(Bh,c({},d,{onClose:null==t?void 0:t.onClose})))))};var zh=Dh;const Fh=()=>{},Vh={className:"block-editor-block-settings-menu__popover",position:"bottom right",variant:"toolbar"};function Hh(e){let{blocks:t,onCopy:n,label:o}=e;const r=(0,m.useCopyToClipboard)((()=>(0,a.serialize)(t)),n),l=t.length>1?(0,_.__)("Copy blocks"):(0,_.__)("Copy block"),i=o||l;return(0,u.createElement)(h.MenuItem,{ref:r},i)}var Gh=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,__unstableDisplayLocation:r,...l}=e;const i=Array.isArray(t)?t:[t],s=i.length,d=i[0],{firstParentClientId:p,isDistractionFree:f,onlyBlock:v,parentBlockType:b,previousBlockClientId:k,nextBlockClientId:y,selectedBlockClientIds:E}=(0,g.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:o,getPreviousBlockClientId:r,getNextBlockClientId:l,getSelectedBlockClientIds:i,getSettings:s,getBlockAttributes:c}=e(To),{getActiveBlockVariation:u}=e(a.store),p=o(d),m=p&&n(p);return{firstParentClientId:p,isDistractionFree:s().isDistractionFree,onlyBlock:1===t(p),parentBlockType:p&&(u(m,c(p))||(0,a.getBlockType)(m)),previousBlockClientId:r(d),nextBlockClientId:l(d),selectedBlockClientIds:i()}}),[d]),C=(0,g.useSelect)((e=>{const{getShortcutRepresentation:t}=e(xd.store);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),{selectBlock:S,toggleBlockHighlight:w}=(0,g.useDispatch)(To),B=(0,u.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:Fh,[n]),I=lf({clientId:d,maximumLength:25}),x=(0,u.useCallback)(n?()=>{const e=k||y||p;e&&E.includes(d)&&!E.includes(e)&&n(e)}:Fh,[n,k,y,p,E]),T=(0,_.sprintf)((0,_.__)("Remove %s"),I),M=1===s?T:(0,_.__)("Remove blocks"),N=(0,u.useRef)(),{gestures:P}=xf({ref:N,onChange(e){e&&f||w(p,e)}}),L=null==E?void 0:E.includes(p);return(0,u.createElement)(bh,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:i,canMove:a,canRemove:g,onDuplicate:f,onInsertAfter:k,onInsertBefore:y,onRemove:E,onCopy:w,onPasteStyles:I,onMoveTo:T,blocks:R}=e;return(0,u.createElement)(h.DropdownMenu,c({icon:sg,label:(0,_.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:Vh,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(Sh.Slot,{fillProps:{onClose:l}}),!L&&!!p&&(0,u.createElement)(h.MenuItem,c({},P,{ref:N,icon:(0,u.createElement)(fd,{icon:b.icon}),onClick:()=>S(p)}),(0,_.sprintf)((0,_.__)("Select parent block (%s)"),b.title)),1===s&&(0,u.createElement)(yh,{clientId:d}),(0,u.createElement)(Hh,{blocks:R,onCopy:w}),n&&(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,f,B),shortcut:C.duplicate},(0,_.__)("Duplicate")),i&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,y),shortcut:C.insertBefore},(0,_.__)("Insert before")),(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,k),shortcut:C.insertAfter},(0,_.__)("Insert after"))),a&&!v&&(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,T)},(0,_.__)("Move to")),1===s&&(0,u.createElement)(_h,{clientId:d,onToggle:l})),(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(Hh,{blocks:R,onCopy:w,label:(0,_.__)("Copy styles")}),(0,u.createElement)(h.MenuItem,{onClick:I},(0,_.__)("Paste styles"))),(0,u.createElement)(zh.Slot,{fillProps:{onClose:l},clientIds:t,__unstableDisplayLocation:r}),"function"==typeof o?o({onClose:l}):u.Children.map((e=>(0,u.cloneElement)(e,{onClose:l}))),g&&(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,E,x),shortcut:C.remove},M)))}))}))};var Uh=function(e){let{clientIds:t,...n}=e;return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(Gh,c({clientIds:t,toggleProps:e},n)))))};function $h(e){let{clientId:t}=e;const n=rf(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=Ih(t),[a,s]=(0,u.useReducer)((e=>!e),!1);return i?o&&r&&l?null:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,u.createElement)(h.ToolbarButton,{icon:Mh,label:(0,_.sprintf)((0,_.__)("Unlock %s"),n.title),onClick:s})),a&&(0,u.createElement)(Lh,{clientId:t,onClose:s})):null}var jh=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"}));var Wh=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"}));var Kh=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"}));const qh={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var Yh=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=wh(),{replaceBlocks:r}=(0,g.useDispatch)(To),{canRemove:l,variations:i}=(0,g.useSelect)((e=>{const{canRemoveBlocks:o}=e(To),{getBlockVariations:r}=e(a.store);return{canRemove:o(t),variations:r(n,"transform")}}),[t,n]),s=o=>{const l=(0,a.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),l&&l.length>0&&(l[0].attributes.layout=qh[o],r(t,l))};if(!o||!l)return null;const c=!!i.find((e=>{let{name:t}=e;return"group-row"===t})),d=!!i.find((e=>{let{name:t}=e;return"group-stack"===t}));return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{icon:jh,label:(0,_._x)("Group","verb"),onClick:s}),c&&(0,u.createElement)(h.ToolbarButton,{icon:Wh,label:(0,_._x)("Row","single horizontal line"),onClick:()=>s("row")}),d&&(0,u.createElement)(h.ToolbarButton,{icon:Kh,label:(0,_._x)("Stack","verb"),onClick:()=>s("stack")}))};function Zh(e){let{clientIds:t}=e;const n=1===t.length?t[0]:void 0,o=(0,g.useSelect)((e=>!!n&&"html"===e(To).getBlockMode(n)),[n]),{toggleBlockMode:r}=(0,g.useDispatch)(To);return o?(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{onClick:()=>{r(n)}},(0,_.__)("Edit visually"))):null}var Qh=(0,u.createContext)("");var Xh=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:r,hasFixedToolbar:l,isDistractionFree:i,isValid:s,isVisual:d,isContentLocked:f}=(0,g.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:r,getBlockRootClientId:l,getSettings:i,__unstableGetContentLockingParent:s}=e(To),c=o(),u=c[0],d=l(u),p=i();return{blockClientIds:c,blockClientId:u,blockType:u&&(0,a.getBlockType)(t(u)),hasFixedToolbar:p.hasFixedToolbar,isDistractionFree:p.isDistractionFree,rootClientId:d,isValid:c.every((e=>r(e))),isVisual:c.every((e=>"visual"===n(e))),isContentLocked:!!s(u)}}),[]),{toggleBlockHighlight:v}=(0,g.useDispatch)(To),b=(0,u.useRef)(),{showMovers:k,gestures:_}=xf({ref:b,onChange(e){e&&i||v(o,e)}}),y=(0,m.useViewportMatch)("medium","<")||l;if(r&&!(0,a.hasBlockSupport)(r,"__experimentalToolbar",!0))return null;const E=y||k;if(0===n.length)return null;const C=s&&d,S=n.length>1,w=(0,a.isReusableBlock)(r)||(0,a.isTemplatePart)(r),B=p()("block-editor-block-toolbar",{"is-showing-movers":E,"is-synced":w});return(0,u.createElement)("div",{className:B},!S&&!y&&!f&&(0,u.createElement)(Tf,null),(0,u.createElement)("div",c({ref:b},_),(C||S)&&!f&&(0,u.createElement)(h.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,u.createElement)(Xf,{clientIds:n}),!S&&(0,u.createElement)($h,{clientId:n[0]}),(0,u.createElement)(bf,{clientIds:n,hideDragHandle:t}))),C&&S&&(0,u.createElement)(Yh,null),C&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Vo.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Vo.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Vo.Slot,{className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Vo.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Vo.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Qh.Provider,{value:null==r?void 0:r.name},(0,u.createElement)(th.Slot,null))),(0,u.createElement)(Zh,{clientIds:n}),!f&&(0,u.createElement)(Uh,{clientIds:n}))};var Jh=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:r,hasParents:l,showParentSelector:i}=(0,g.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o,__unstableGetContentLockingParent:r}=e(To),{getBlockType:l}=e(a.store),i=o(),s=i[0],c=n(s),u=l(t(c[c.length-1]));return{blockType:s&&l(t(s)),hasParents:c.length,showParentSelector:u&&(0,a.hasBlockSupport)(u,"__experimentalParentSelector",!0)&&i.length<=1&&!r(s)}}),[]);if(r&&!(0,a.hasBlockSupport)(r,"__experimentalToolbar",!0))return null;const s=p()("block-editor-block-contextual-toolbar",{"has-parent":l&&i,"is-fixed":n});return(0,u.createElement)(Ef,c({focusOnMount:t,className:s,"aria-label":(0,_.__)("Block tools")},o),(0,u.createElement)(Xh,{hideDragHandle:n}))};const{CustomSelectControl:ev}=Io(h.privateApis),tv="position",nv="block-editor-hooks__position-selection__select-control__option",ov={key:"default",value:"",name:(0,_.__)("Default"),className:nv},rv={key:"sticky",value:"sticky",name:(0,_.__)("Sticky"),className:nv,__experimentalHint:(0,_.__)("The block will stick to the top of the window instead of scrolling.")},lv={key:"fixed",value:"fixed",name:(0,_.__)("Fixed"),className:nv,__experimentalHint:(0,_.__)("The block will not move when the page is scrolled.")},iv=["top","right","bottom","left"],av=["sticky","fixed"];function sv(e){return!!(0,a.getBlockSupport)(e,tv)}function cv(e){var t,n;const o=null===(t=e.style)||void 0===t||null===(n=t.position)||void 0===n?void 0:n.type;return"sticky"===o||"fixed"===o}function uv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=fr("position.fixed"),n=fr("position.sticky"),o=!t&&!n;return!sv(e)||o}function dv(e){var t;const{attributes:{style:n={}},clientId:o,name:r,setAttributes:l}=e,i=function(e){const t=(0,a.getBlockSupport)(e,tv);return!!(!0===t||null!=t&&t.fixed)}(r),s=function(e){const t=(0,a.getBlockSupport)(e,tv);return!!(!0===t||null!=t&&t.sticky)}(r),c=null==n||null===(t=n.position)||void 0===t?void 0:t.type,{hasParents:d}=(0,g.useSelect)((e=>{const{getBlockParents:t}=e(To);return{hasParents:t(o).length}}),[o]),p=(0,u.useMemo)((()=>{const e=[ov];return(s&&!d||c===rv.value)&&e.push(rv),(i||c===lv.value)&&e.push(lv),e}),[i,s,d,c]),m=c&&p.find((e=>e.value===c))||ov;return u.Platform.select({web:p.length>1?(0,u.createElement)(jr,{group:"position"},(0,u.createElement)(h.BaseControl,{className:"block-editor-hooks__position-selection"},(0,u.createElement)(ev,{__nextUnconstrainedWidth:!0,__next36pxDefaultSize:!0,className:"block-editor-hooks__position-selection__select-control",label:(0,_.__)("Position"),hideLabelFromVision:!0,describedBy:(0,_.sprintf)((0,_.__)("Currently selected position: %s"),m.name),options:p,value:m,__experimentalShowSelectedHint:!0,onChange:e=>{let{selectedItem:t}=e;(e=>{const t={...n,position:{...null==n?void 0:n.position,type:e,top:"sticky"===e||"fixed"===e?"0px":void 0}};l({style:Ar(t)})})(t.value)},size:"__unstable-large"}))):null,native:null})}const pv=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,a.hasBlockSupport)(n,tv)&&!uv(t)&&(0,u.createElement)(dv,c({key:"position"},t)),(0,u.createElement)(e,c({key:"edit"},t))]}),"withInspectorControls"),mv=(0,m.createHigherOrderComponent)((e=>t=>{var n,o,r,l;const{name:i,attributes:s}=t,d=(0,a.hasBlockSupport)(i,tv)&&!uv(t),g=(0,m.useInstanceId)(e),f=(0,u.useContext)(Wv.__unstableElementContext);let h;d&&(h=function(e){let{selector:t,style:n}=e,o="";const{type:r}=(null==n?void 0:n.position)||{};return av.includes(r)?(o+=`${t} {`,o+=`position: ${r};`,iv.forEach((e=>{var t;void 0!==(null==n||null===(t=n.position)||void 0===t?void 0:t[e])&&(o+=`${e}: ${n.position[e]};`)})),"sticky"!==r&&"fixed"!==r||(o+="z-index: 10"),o+="}",o):o}({selector:`.wp-container-${g}.wp-container-${g}`,style:null==s?void 0:s.style})||"");const v=p()(null==t?void 0:t.className,{[`wp-container-${g}`]:d&&!!h,[`is-position-${null==s||null===(n=s.style)||void 0===n||null===(o=n.position)||void 0===o?void 0:o.type}`]:d&&!!h&&!(null==s||null===(r=s.style)||void 0===r||null===(l=r.position)||void 0===l||!l.type)});return(0,u.createElement)(u.Fragment,null,d&&f&&!!h&&(0,u.createPortal)((0,u.createElement)("style",null,h),f),(0,u.createElement)(e,c({},t,{className:v})))}));(0,s.addFilter)("editor.BlockListBlock","core/editor/position/with-position-styles",mv),(0,s.addFilter)("editor.BlockEdit","core/editor/position/with-inspector-controls",pv);const gv={placement:"top-start"},fv={...gv,flip:!1,shift:!0},hv={...gv,flip:!0,shift:!1};function vv(e,t,n,o,r){if(!e||!t)return fv;const l=(null==n?void 0:n.scrollTop)||0,i=t.getBoundingClientRect(),a=l+e.getBoundingClientRect().top,s=e.ownerDocument.documentElement.clientHeight,c=a+o,u=i.top>c,d=i.height>s-o;return r||!u&&!d?hv:fv}function bv(e){const{__unstableGetEditorMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isBlockInterfaceHidden:l,getSettings:i,getLastMultiSelectedBlockClientId:a}=Io(e(To));return{editorMode:t(),hasMultiSelection:o(),isMultiSelecting:n(),isTyping:r(),isBlockInterfaceHidden:l(),hasFixedToolbar:i().hasFixedToolbar,isDistractionFree:i().isDistractionFree,lastClientId:o()?a():null}}function kv(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,showContents:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:a}=e;const{editorMode:s,hasMultiSelection:d,isMultiSelecting:f,isTyping:h,isBlockInterfaceHidden:v,hasFixedToolbar:b,isDistractionFree:k,lastClientId:_}=(0,g.useSelect)(bv,[]),y=(0,g.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(To);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),E=(0,m.useViewportMatch)("medium"),C=(0,u.useRef)(!1),{stopTyping:S}=(0,g.useDispatch)(To),w=!h&&"edit"===s&&o,B=!d&&("navigation"===s||"zoom-out"===s),I="edit"===s&&!b&&E&&!f&&!w&&!h&&!v,x=!("edit"!==s||I||b||k||o);(0,xd.useShortcut)("core/block-editor/focus-toolbar",(()=>{C.current=!0,S(!0)}),{isDisabled:!x}),(0,u.useEffect)((()=>{C.current=!1}));const T=(0,u.useRef)(),M=function(e){let{contentElement:t,clientId:n}=e;const o=tr(n),[r,l]=(0,u.useState)(0),{blockIndex:i,isSticky:a}=(0,g.useSelect)((e=>{const{getBlockIndex:t,getBlockAttributes:o}=e(To);return{blockIndex:t(n),isSticky:cv(o(n))}}),[n]),s=(0,u.useMemo)((()=>{if(t)return(0,Ri.getScrollContainer)(t)}),[t]),[c,d]=(0,u.useState)((()=>vv(t,o,s,r,a))),p=(0,m.useRefEffect)((e=>{l(e.offsetHeight)}),[]),f=(0,u.useCallback)((()=>d(vv(t,o,s,r,a))),[t,o,s,r]);return(0,u.useLayoutEffect)(f,[i,f]),(0,u.useLayoutEffect)((()=>{var e,n,r;if(!t||!o)return;const l=null==t||null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;let i;null==l||null===(n=l.addEventHandler)||void 0===n||n.call(l,"resize",f);const a=null==o||null===(r=o.ownerDocument)||void 0===r?void 0:r.defaultView;return a.ResizeObserver&&(i=new a.ResizeObserver(f),i.observe(o)),()=>{var e;null==l||null===(e=l.removeEventHandler)||void 0===e||e.call(l,"resize",f),i&&i.disconnect()}}),[f,t,o]),{...c,ref:p}}({contentElement:null==a?void 0:a.current,clientId:t});return w?(0,u.createElement)(Zr,c({clientId:l||t,__unstableCoverTarget:!0,bottomClientId:_,className:p()("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":y}),__unstablePopoverSlot:i,__unstableContentRef:a,resize:!1,shift:!1},M),(0,u.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,u.createElement)(Hg,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0}))):B||I?(0,u.createElement)(Zr,c({clientId:l||t,bottomClientId:_,className:p()("block-editor-block-list__block-popover",{"is-insertion-point-visible":y}),__unstablePopoverSlot:i,__unstableContentRef:a,resize:!1},M),I&&r&&(0,u.createElement)(Jh,{focusOnMount:C.current,__experimentalInitialIndex:T.current,__experimentalOnIndexChange:e=>{T.current=e},key:t}),B&&(0,u.createElement)(kf,{clientId:t,rootClientId:n})):null}function _v(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:r,getBlockParents:l,getSettings:i,isNavigationMode:s,__experimentalGetBlockListSettingsForBlocks:c}=e(To),u=t()||n();if(!u)return;const{name:d,attributes:p={}}=r(u)||{},m=l(u),g=c(m),f=m.find((e=>{var t;return null===(t=g[e])||void 0===t?void 0:t.__experimentalCaptureToolbars})),h=i();return{clientId:u,rootClientId:o(u),name:d,isDistractionFree:h.isDistractionFree,isNavigationMode:s(),isEmptyDefaultBlock:d&&(0,a.isUnmodifiedDefaultBlock)({name:d,attributes:p}),capturingClientId:f}}function yv(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,g.useSelect)(_v,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:a,capturingClientId:s,isDistractionFree:c,isNavigationMode:d}=o;return i?(0,u.createElement)(kv,{clientId:r,rootClientId:l,isEmptyDefaultBlock:a,showContents:!c||d,capturingClientId:s,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Ev(e){let{children:t}=e;const n=(0,u.useContext)(Xg),o=(0,u.useContext)(h.Disabled.Context);return n||o?t:(W()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8",version:"6.3"}),(0,u.createElement)(ef,{__unstablePopoverSlot:"block-toolbar"},(0,u.createElement)(yv,{__unstablePopoverSlot:"block-toolbar"}),t))}var Cv=(0,m.createHigherOrderComponent)((e=>t=>{const{clientId:n}=Ro();return(0,u.createElement)(e,c({},t,{clientId:n}))}),"withClientId");var Sv=Cv((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,u.createElement)(jg,{className:p()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})}));var wv=(0,m.compose)([Cv,(0,g.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(To),r=o(n);return{lastBlockClientId:r[r.length-1]}}))])((e=>{let{clientId:t}=e;return(0,u.createElement)(Gg,{rootClientId:t})}));const Bv=new WeakMap;function Iv(e,t,n,o,r,l,i){return s=>{const{srcRootClientId:c,srcClientIds:u,type:d,blocks:p}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(s);if("inserter"===d){i();const e=p.map((e=>(0,a.cloneBlock)(e)));l(e,!0,null)}if("block"===d){const l=n(u[0]);if(c===e&&l===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,a=u.length;r(u,c,i&&l{if(!n)return;const i=(0,a.findTransform)((0,a.getBlockTransforms)("from"),(n=>"files"===n.type&&r(n.blockName,e)&&n.isMatch(t)));if(i){const e=i.transform(t,o);l(e)}}}function Tv(e,t,n){return e=>{const t=(0,a.pasteHandler)({HTML:e,mode:"BLOCKS"});t.length&&n(t)}}function Mv(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{operation:o="insert"}=n,r=(0,g.useSelect)((e=>e(To).getSettings().mediaUpload),[]),{canInsertBlockType:l,getBlockIndex:i,getClientIdsOfDescendants:a,getBlockOrder:s,getBlocksByClientId:c}=(0,g.useSelect)(To),{insertBlocks:d,moveBlocksToPosition:p,updateBlockAttributes:m,clearSelectedBlock:f,replaceBlocks:h,removeBlocks:v}=(0,g.useDispatch)(To),b=(0,g.useRegistry)(),k=(0,u.useCallback)((function(n){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if("replace"===o){const o=s(e)[t];h(o,n,void 0,l)}else d(n,t,e,r,l)}),[o,s,d,h,t,e]),_=(0,u.useCallback)(((n,r,l)=>{if("replace"===o){const o=c(n),r=s(e)[t];b.batch((()=>{v(n,!1),h(r,o,void 0,0)}))}else p(n,r,e,l)}),[o,s,c,d,p,v,t,e]),y=Iv(e,t,i,a,_,k,f),E=xv(e,0,r,m,l,k),C=Tv(0,0,k);return e=>{const t=(0,Ri.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?C(n):t.length?E(t):y(e)}}function Nv(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:l}=e,i=o?r:l,a=o?l:r,s=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=s&&i<=c?i:i2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=Nv(e,t,r);(void 0===n||l=e.x&&t.top<=e.y&&t.bottom>=e.y}function Rv(e,t){var n,o;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertical";const l="horizontal"===r?["left","right"]:["top","bottom"],i=(0,_.isRTL)();let a=0,s="before",c=1/0;e.forEach((e=>{let{isUnmodifiedDefaultBlock:n,getBoundingClientRect:o,blockIndex:r}=e;const u=o();let[d,p]=Pv(t,u,l);n&&Lv(t,u)&&(d=0),d0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,u.useState)({index:null,operation:"insert"}),o=(0,g.useSelect)((t=>{const{getTemplateLock:n,__unstableIsWithinBlockOverlay:o,__unstableHasActiveBlockOverlayActive:r}=t(To),l=n(e);return["all","contentOnly"].some((e=>e===l))||r(e)||o(e)}),[e]),{getBlockListSettings:r,getBlocks:l,getBlockIndex:i}=(0,g.useSelect)(To),{showInsertionPoint:s,hideInsertionPoint:c}=(0,g.useDispatch)(To),d=Mv(e,t.index,{operation:t.operation}),p=(0,m.useThrottle)((0,u.useCallback)(((t,o)=>{var c;const u=l(e);if(0===u.length)return void n({index:0,operation:"insert"});const d=u.map((e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:(0,a.isUnmodifiedDefaultBlock)(e),getBoundingClientRect:()=>o.getElementById(`block-${t}`).getBoundingClientRect(),blockIndex:i(t)}})),[p,m]=Rv(d,{x:t.clientX,y:t.clientY},null===(c=r(e))||void 0===c?void 0:c.orientation);n({index:p,operation:m}),s(e,p,{operation:m})}),[e]),200);return(0,m.__experimentalUseDropZone)({isDisabled:o,onDrop:d,onDragOver(e){p(e,e.currentTarget.ownerDocument)},onDragLeave(){p.cancel(),c()},onDragEnd(){p.cancel(),c()}})}const Ov={};function Dv(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:r,template:l,templateLock:i,wrapperRef:s,templateInsertUpdatesSelection:c,__experimentalCaptureToolbars:d,__experimentalAppenderTagName:p,renderAppender:m,orientation:f,placeholder:h,layout:v}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:s}=(0,g.useDispatch)(To),c=(0,g.useRegistry)(),{blockListSettings:d,parentLock:p}=(0,g.useSelect)((t=>{const n=t(To).getBlockRootClientId(e);return{blockListSettings:t(To).getBlockListSettings(e),parentLock:t(To).getTemplateLock(n)}}),[e]),m=(0,u.useMemo)((()=>t),t);(0,u.useLayoutEffect)((()=>{const t={allowedBlocks:m,templateLock:void 0===r||"contentOnly"===p?p:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=li(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),Kr()(d,t)||(Bv.get(c)||Bv.set(c,[]),Bv.get(c).push([e,t]),window.queueMicrotask((()=>{var e;null!==(e=Bv.get(c))&&void 0!==e&&e.length&&c.batch((()=>{Bv.get(c).forEach((e=>{s(...e)})),Bv.set(c,[])}))})))}),[e,d,m,n,o,r,p,l,i,s,a,c])}(t,n,o,r,i,d,f,v),function(e,t,n,o){const{getBlocks:r,getSelectedBlocksInitialCaretPosition:l,isBlockSelected:i}=(0,g.useSelect)(To),{replaceInnerBlocks:s,__unstableMarkNextChangeAsNotPersistent:c}=(0,g.useDispatch)(To),{innerBlocks:d}=(0,g.useSelect)((t=>({innerBlocks:t(To).getBlocks(e)})),[e]),p=(0,u.useRef)(null);(0,u.useLayoutEffect)((()=>{let u=!1;return window.queueMicrotask((()=>{if(u)return;const d=r(e),m=0===d.length||"all"===n||"contentOnly"===n,g=!k()(t,p.current);if(!m||!g)return;p.current=t;const f=(0,a.synchronizeBlocksWithTemplate)(d,t);k()(f,d)||(c(),s(e,f,0===d.length&&o&&0!==f.length&&i(e),l()))})),()=>{u=!0}}),[d,t,n,e])}(t,l,i,c);const b=function(e){return(0,g.useSelect)((t=>{const n=t(To).getBlock(e);if(!n)return;const o=t(a.store).getBlockType(n.name);return o&&0!==Object.keys(o.providesContext).length?Object.fromEntries(Object.entries(o.providesContext).map((e=>{let[t,o]=e;return[t,n.attributes[o]]}))):void 0}),[e])}(t),_=(0,g.useSelect)((e=>{var n;return null===(n=e(To).getBlock(t))||void 0===n?void 0:n.name}),[t]),y=(0,a.getBlockSupport)(_,"__experimentalLayout")||Ov,{allowSizingOnChildren:E=!1}=y,C=fr("layout")||Ov,S=v||y,w=(0,u.useMemo)((()=>({...C,...S,...E&&{allowSizingOnChildren:!0}})),[C,S,E]);return(0,u.createElement)(Oi,{value:b},(0,u.createElement)(qv,{rootClientId:t,renderAppender:m,__experimentalAppenderTagName:p,__experimentalLayout:w,wrapperRef:s,placeholder:h}))}function zv(e){return kd(e),(0,u.createElement)(Dv,e)}const Fv=(0,u.forwardRef)(((e,t)=>{const n=Vv({ref:t},e);return(0,u.createElement)("div",{className:"block-editor-inner-blocks"},(0,u.createElement)("div",n))}));function Vv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:o}=t,{clientId:r,layout:l=null,__unstableLayoutClassNames:i=""}=Ro(),s=(0,m.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:d,hasOverlay:f}=(0,g.useSelect)((e=>{if(!r)return{};const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:o,__unstableGetEditorMode:l}=e(To),i=t(r),c="navigation"===l()||s;return{__experimentalCaptureToolbars:e(a.store).hasBlockSupport(i,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==i&&!n(r)&&!o(r,!0)&&c}}),[r,s]),h=Av({rootClientId:r}),v=(0,m.useMergeRefs)([e.ref,o?null:h]),b={__experimentalCaptureToolbars:d,layout:l,...t},k=b.value&&b.onChange?zv:Dv;return{...e,ref:v,className:p()(e.className,"block-editor-block-list__layout",n?"":i,{"has-overlay":f}),children:r?(0,u.createElement)(k,c({},b,{clientId:r})):(0,u.createElement)(qv,t)}}Vv.save=a.__unstableGetInnerBlocksProps,Fv.DefaultBlockAppender=wv,Fv.ButtonBlockAppender=Sv,Fv.Content=()=>Vv.save().children;var Hv=Fv;const Gv=(0,u.createContext)(),Uv=(0,u.createContext)(),$v=new WeakMap;function jv(e){let{className:t,...n}=e;const[o,r]=(0,u.useState)(),l=(0,m.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,editorMode:s}=(0,g.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(To),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,editorMode:n()}}),[]),c=(0,g.useRegistry)(),{setBlockVisibility:d}=(0,g.useDispatch)(To),f=(0,m.useDebounce)((0,u.useCallback)((()=>{const e={};$v.get(c).forEach((t=>{let[n,o]=t;e[n]=o})),d(e)}),[c]),300,{trailing:!0}),h=(0,u.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{$v.get(c)||$v.set(c,[]);for(const t of e){const e=t.target.getAttribute("data-block");$v.get(c).push([e,t.isIntersecting])}f()}))}),[]),v=Vv({ref:(0,m.useMergeRefs)([Ed(),tf(),r]),className:p()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&l,"is-navigate-mode":"navigation"===s})},n);return(0,u.createElement)(Gv.Provider,{value:o},(0,u.createElement)(Uv.Provider,{value:h},(0,u.createElement)("div",v)))}function Wv(e){return function(){const{patterns:e,isPreviewMode:t}=(0,g.useSelect)((e=>{const{__experimentalBlockPatterns:t,__unstableIsPreviewMode:n}=e(To).getSettings();return{patterns:t,isPreviewMode:n}}),[]);(0,u.useEffect)((()=>{if(t)return;if(null==e||!e.length)return;let n,o=-1;const r=()=>{o++,o>=e.length||((0,g.select)(To).__experimentalGetParsedPattern(e[o].name),n=nf(r))};return n=nf(r),()=>of(n)}),[e,t])}(),(0,u.createElement)(Ev,null,(0,u.createElement)(Lo,{value:No},(0,u.createElement)(jv,e)))}function Kv(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=ii}=e;const{order:i,selectedBlocks:a,visibleBlocks:s}=(0,g.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:r}=e(To);return{order:t(n),selectedBlocks:o(),visibleBlocks:r()}}),[n]);return(0,u.createElement)(si,{value:l},i.map((e=>(0,u.createElement)(g.AsyncModeProvider,{key:e,value:!s.has(e)&&!a.includes(e)},(0,u.createElement)(ad,{rootClientId:n,clientId:e})))),i.length<1&&t,(0,u.createElement)(Kg,{tagName:r,rootClientId:n,renderAppender:o}))}function qv(e){return(0,u.createElement)(g.AsyncModeProvider,{value:!1},(0,u.createElement)(Kv,e))}function Yv(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Zv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{flat:t,...n}=e;return t||Yv(Object.values(n).filter(Boolean))||"px"}function Qv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,h.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=Yv(o),i=0===r||r?`${r}${l}`:void 0;return i}function Xv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Qv(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function Jv(e){if(!e)return!1;if("string"==typeof e)return!0;return!!Object.values(e).filter((e=>!!e||0===e)).length}function eb(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e,i=Qv(r);void 0===i&&(i=Zv(n));const a=Jv(r)&&Xv(r),s=a?(0,_.__)("Mixed"):null;return(0,u.createElement)(h.__experimentalUnitControl,c({},l,{"aria-label":(0,_.__)("Border radius"),disableUnits:a,isOnly:!0,value:i,onChange:e=>{const n=!isNaN(parseFloat(e));t(n?e:void 0)},onUnitChange:e=>{o({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:s,size:"__unstable-large"}))}Wv.__unstableElementContext=Gv;const tb={topLeft:(0,_.__)("Top left"),topRight:(0,_.__)("Top right"),bottomLeft:(0,_.__)("Bottom left"),bottomRight:(0,_.__)("Bottom right")};function nb(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e;const i=e=>n=>{if(!t)return;const o=!isNaN(parseFloat(n))?n:void 0;t({...a,[e]:o})},a="string"!=typeof r?r:{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r};return(0,u.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(tb).map((e=>{let[t,r]=e;const[s,d]=(0,h.__experimentalParseQuantityAndUnitFromRawValue)(a[t]),p=a[t]?d:n[t]||n.flat;return(0,u.createElement)(h.Tooltip,{text:r,position:"top",key:t},(0,u.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,u.createElement)(h.__experimentalUnitControl,c({},l,{"aria-label":r,value:[s,p].join(""),onChange:i(t),onUnitChange:(m=t,e=>{const t={...n};t[m]=e,o(t)}),size:"__unstable-large"}))));var m})))}function ob(e){let{isLinked:t,...n}=e;const o=t?(0,_.__)("Unlink radii"):(0,_.__)("Link radii");return(0,u.createElement)(h.Tooltip,{text:o},(0,u.createElement)("span",null,(0,u.createElement)(h.Button,c({},n,{className:"component-border-radius-control__linked-button",isSmall:!0,icon:t?Er:Cr,iconSize:24,"aria-label":o}))))}const rb={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},lb={px:100,em:20,rem:20};function ib(e){let{onChange:t,values:n}=e;const[o,r]=(0,u.useState)(!Jv(n)||!Xv(n)),[l,i]=(0,u.useState)({flat:"string"==typeof n?(0,h.__experimentalParseQuantityAndUnitFromRawValue)(n)[1]:void 0,topLeft:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topLeft)[1],topRight:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topRight)[1],bottomLeft:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomLeft)[1],bottomRight:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomRight)[1]}),a=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["px","em","rem"]}),s=Zv(l),c=a&&a.find((e=>e.value===s)),d=(null==c?void 0:c.step)||1,[p]=(0,h.__experimentalParseQuantityAndUnitFromRawValue)(Qv(n));return(0,u.createElement)("fieldset",{className:"components-border-radius-control"},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},(0,_.__)("Radius")),(0,u.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,u.createElement)(u.Fragment,null,(0,u.createElement)(eb,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,units:a}),(0,u.createElement)(h.RangeControl,{label:(0,_.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=p?p:"",min:0,max:lb[s],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${s}`:void 0)},step:d,__nextHasNoMarginBottom:!0})):(0,u.createElement)(nb,{min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,values:n||rb,units:a}),(0,u.createElement)(ob,{onClick:()=>r(!o),isLinked:o})))}function ab(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(ib,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{const t=Ar({...n,border:{...null==n?void 0:n.border,radius:e}});o({style:t})}})}fp([hp,kp]);const sb=(e,t,n)=>{if(t){const n=null==e?void 0:e.find((e=>e.slug===t));if(n)return n}return{color:n}},cb=(e,t)=>null==e?void 0:e.find((e=>e.color===t));function ub(e,t){if(e&&t)return`has-${(0,f.kebabCase)(t)}-${e}`}function db(){const e={disableCustomColors:!fr("color.custom"),disableCustomGradients:!fr("color.customGradient")},t=fr("color.palette.custom"),n=fr("color.palette.theme"),o=fr("color.palette.default"),r=fr("color.defaultPalette");e.colors=(0,u.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,_._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,_._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,_._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=fr("color.gradients.custom"),i=fr("color.gradients.theme"),a=fr("color.gradients.default"),s=fr("color.defaultGradients");return e.gradients=(0,u.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,_._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),s&&a&&a.length&&e.push({name:(0,_._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,_._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}const pb="__experimentalBorder",mb=["top","right","bottom","left"],gb=e=>{var t,n;return{...e,borderColor:void 0,style:{...e.style,border:{radius:null===(t=e.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius}}}},fb=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},hb=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=fb(t,"slug",n);if(e)return e}if(!o)return{color:void 0};const r=fb(t,"color",o);return r||{color:o}};function vb(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function bb(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:r}=t,{colors:l}=db(),i=kb(e.name),s=fr("border.color")&&kb(e.name,"color"),c=fr("border.radius")&&kb(e.name,"radius"),d=fr("border.style")&&kb(e.name,"style"),p=fr("border.width")&&kb(e.name,"width");if([!s,!c,!d,!p].every(Boolean)||!i)return null;const m=(0,a.getBlockSupport)(e.name,[pb,"__experimentalDefaultControls"]),g=(null==m?void 0:m.color)||(null==m?void 0:m.width),f=((e,t)=>{const{borderColor:n,style:o}=e,{border:r}=o||{};if(n){const{color:e}=hb({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return mb.forEach((e=>{var n;const o=vb(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=hb({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,l);return(0,u.createElement)(jr,{group:"border"},(p||s)&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return(0,h.__experimentalIsDefinedBorder)(null==n?void 0:n.border)||!!t})(e),label:(0,_.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:o}=e;const{style:r}=n;o({borderColor:void 0,style:{...r,border:Ar({radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:g,resetAllFilter:gb,panelId:n},(0,u.createElement)(h.__experimentalBorderBoxControl,{colors:l,enableAlpha:!0,enableStyle:d,onChange:e=>{var t;let n,i={...e};if((0,h.__experimentalHasSplitBorders)(e))i={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},mb.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=hb({colors:l,customColor:null===(o=e[t])||void 0===o?void 0:o.color});n.slug&&(i[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,o=hb({colors:l,customColor:t});o.slug&&(n=o.slug,i.color=void 0)}const a=Ar({...r,border:{radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius,...i}});o({style:a,borderColor:n})},popoverOffset:40,popoverPlacement:"left-start",size:"__unstable-large",value:f,__experimentalIsRenderedInSidebar:!0})),c&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;const o=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof o?Object.entries(o).some(Boolean):!!o}(e),label:(0,_.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:_b(o,"radius")})}(e),isShownByDefault:null==m?void 0:m.radius,resetAllFilter:e=>{var t;return{...e,style:{...e.style,border:{...null===(t=e.style)||void 0===t?void 0:t.border,radius:void 0}}}},panelId:n},(0,u.createElement)(ab,e)))}function kb(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==u.Platform.OS)return!1;const n=(0,a.getBlockSupport)(e,pb);return!0===n||("any"===t?!!(null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style):!(null==n||!n[t]))}function _b(e,t){return Ar({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function yb(e,t,n){if(!kb(t,"color")||Fr(t,pb,"color"))return e;const o=Eb(n),r=p()(e.className,o);return e.className=r||void 0,e}function Eb(e){var t;const{borderColor:n,style:o}=e,r=ub("border-color",n);return p()({"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color),[r]:!!r})}const Cb=(0,m.createHigherOrderComponent)((e=>t=>{var n,o,r,l,i,a,s,d,p;const{name:m,attributes:g}=t,{borderColor:f,style:h}=g,{colors:v}=db();if(!kb(m,"color")||Fr(m,pb,"color"))return(0,u.createElement)(e,t);const{color:b}=hb({colors:v,namedColor:f}),{color:k}=hb({colors:v,namedColor:vb(null==h||null===(n=h.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:_}=hb({colors:v,namedColor:vb(null==h||null===(r=h.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=hb({colors:v,namedColor:vb(null==h||null===(i=h.border)||void 0===i||null===(a=i.bottom)||void 0===a?void 0:a.color)}),{color:E}=hb({colors:v,namedColor:vb(null==h||null===(s=h.border)||void 0===s||null===(d=s.left)||void 0===d?void 0:d.color)}),C={borderTopColor:k||b,borderRightColor:_||b,borderBottomColor:y||b,borderLeftColor:E||b};let S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,u.createElement)(e,c({},t,{wrapperProps:S}))}));function Sb(e){if(e)return`has-${e}-gradient-background`}function wb(e,t){const n=null==e?void 0:e.find((e=>e.slug===t));return n&&n.gradient}function Bb(e,t){const n=null==e?void 0:e.find((e=>e.gradient===t));return n}function Ib(e,t){const n=Bb(e,t);return n&&n.slug}function xb(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=Ro(),o=fr("color.gradients.custom"),r=fr("color.gradients.theme"),l=fr("color.gradients.default"),i=(0,u.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:s}=(0,g.useSelect)((o=>{const{getBlockAttributes:r}=o(To),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:c}=(0,g.useDispatch)(To),d=(0,u.useCallback)((o=>{const r=Ib(i,o);c(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,c]),p=Sb(a);let m;return m=a?wb(i,a):s,{gradientClass:p,gradientValue:m,setGradient:d}}(0,s.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return kb(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",yb),(0,s.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!kb(e,"color")||Fr(e,pb,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),yb(o,e,n)},e})),(0,s.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Cb);const Tb=["colors","disableCustomColors","gradients","disableCustomGradients"],Mb={name:"color",title:"Solid",value:"color"},Nb={name:"gradient",title:"Gradient",value:"gradient"},Pb=[Mb,Nb];function Lb(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalIsRenderedInSidebar:l,className:i,label:a,onColorChange:s,onGradientChange:c,colorValue:d,gradientValue:m,clearable:g,showTitle:v=!0,enableAlpha:b}=e;const k=s&&(!(0,f.isEmpty)(t)||!o),_=c&&(!(0,f.isEmpty)(n)||!r);if(!k&&!_)return null;const y={[Mb.value]:(0,u.createElement)(h.ColorPalette,{value:d,onChange:_?e=>{s(e),c()}:s,colors:t,disableCustomColors:o,__experimentalIsRenderedInSidebar:l,clearable:g,enableAlpha:b}),[Nb.value]:(0,u.createElement)(h.GradientPicker,{__nextHasNoMargin:!0,value:m,onChange:k?e=>{c(e),s()}:c,gradients:n,disableCustomGradients:r,__experimentalIsRenderedInSidebar:l,clearable:g})},E=e=>(0,u.createElement)("div",{className:"block-editor-color-gradient-control__panel"},y[e]);return(0,u.createElement)(h.BaseControl,{__nextHasNoMarginBottom:!0,className:p()("block-editor-color-gradient-control",i)},(0,u.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,u.createElement)(h.__experimentalVStack,{spacing:1},v&&(0,u.createElement)("legend",null,(0,u.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,u.createElement)(h.BaseControl.VisualLabel,null,a))),k&&_&&(0,u.createElement)(h.TabPanel,{className:"block-editor-color-gradient-control__tabs",tabs:Pb,initialTabName:m?Nb.value:!!k&&Mb.value},(e=>E(e.value))),!_&&E(Mb.value),!k&&E(Nb.value))))}function Rb(e){const t={};return t.colors=fr("color.palette"),t.gradients=fr("color.gradients"),t.disableCustomColors=!fr("color.custom"),t.disableCustomGradients=!fr("color.customGradient"),(0,u.createElement)(Lb,c({},t,e))}var Ab=function(e){return Tb.every((t=>e.hasOwnProperty(t)))?(0,u.createElement)(Lb,e):(0,u.createElement)(Rb,e)};const Ob=e=>{let{setting:t,children:n,panelId:o,...r}=e;return(0,u.createElement)(h.__experimentalToolsPanelItem,c({hasValue:()=>!!t.colorValue||!!t.gradientValue,label:t.label,onDeselect:()=>{t.colorValue?t.onColorChange():t.gradientValue&&t.onGradientChange()},isShownByDefault:void 0===t.isShownByDefault||t.isShownByDefault},r,{className:"block-editor-tools-panel-color-gradient-settings__item",panelId:o,resetAllFilter:t.resetAllFilter}),n)},Db=e=>{let{colorValue:t,label:n}=e;return(0,u.createElement)(h.__experimentalHStack,{justify:"flex-start"},(0,u.createElement)(h.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,u.createElement)(h.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:n},n))},zb=e=>t=>{let{onToggle:n,isOpen:o}=t;const{colorValue:r,label:l}=e,i={onClick:n,className:p()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":o}),"aria-expanded":o};return(0,u.createElement)(h.Button,i,(0,u.createElement)(Db,{colorValue:r,label:l}))};function Fb(e){let t,{colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradients:i,settings:a,__experimentalIsRenderedInSidebar:s,...d}=e;return s&&(t={placement:"left-start",offset:36,shift:!0}),(0,u.createElement)(u.Fragment,null,a.map(((e,a)=>{var p;const m={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradientValue:e.gradientValue,gradients:i,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:s,...e},g={colorValue:null!==(p=e.gradientValue)&&void 0!==p?p:e.colorValue,label:e.label};return e&&(0,u.createElement)(Ob,c({key:a,setting:e},d),(0,u.createElement)(h.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:zb(g),renderContent:()=>(0,u.createElement)(h.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,u.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,u.createElement)(Ab,m)))}))})))}fp([hp,kp]);var Vb=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:a,linkColor:s,enableAlphaChecker:c=!1}=e;const d=t||n;if(!d)return null;const p=a||o,m=s||r;if(!p&&!m)return null;const g=[{color:p,description:(0,_.__)("text color")},{color:m,description:(0,_.__)("link color")}],f=mp(d),v=f.alpha()<1,b=f.brightness(),k={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of g){if(!e.color)continue;const t=mp(e.color),n=t.isReadable(f,k),o=t.alpha()<1;if(!n){if(v||o)continue;y=bnull==e?void 0:e.colorValue));(0,u.useEffect)((()=>{var e;if(!r)return;if(!g.length)return l&&i(),a&&s(),void(d&&s());if(!m.current)return;s(Hb(m.current).color);const t=null===(e=m.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&p(Hb(t).color);let n=m.current,o=Hb(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=Hb(n).backgroundColor;i(o)}));const f=db();return(0,u.createElement)(jr,{group:"color"},(0,u.createElement)(Fb,c({enableAlpha:t,panelId:o,settings:n,__experimentalIsItemGroup:!1,__experimentalIsRenderedInSidebar:!0},f)),r&&(0,u.createElement)(Vb,{backgroundColor:l,textColor:a,enableAlphaChecker:t,linkColor:d}))}const Ub="color",$b=e=>{const t=(0,a.getBlockSupport)(e,Ub);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},jb=e=>{if("web"!==u.Platform.OS)return!1;const t=(0,a.getBlockSupport)(e,Ub);return null!==t&&"object"==typeof t&&!!t.link},Wb=e=>{const t=(0,a.getBlockSupport)(e,Ub);return null!==t&&"object"==typeof t&&!!t.gradients},Kb=e=>{const t=(0,a.getBlockSupport)(e,Ub);return t&&!1!==t.background},qb=e=>{const t=(0,a.getBlockSupport)(e,Ub);return t&&!1!==t.text},Yb=(e,t)=>Ar(Dr(t,e,void 0)),Zb=e=>({textColor:void 0,style:Yb(["color","text"],e.style)}),Qb=e=>({style:Yb(["elements","link","color","text"],e.style)}),Xb=e=>{var t;return{backgroundColor:void 0,gradient:void 0,style:{...e.style,color:{...null===(t=e.style)||void 0===t?void 0:t.color,background:void 0,gradient:void 0}}}};function Jb(e,t,n){var o,r,l,i,a,s;if(!$b(t)||Fr(t,Ub))return e;const c=Wb(t),{backgroundColor:u,textColor:d,gradient:m,style:g}=n,f=e=>!Fr(t,Ub,e),h=f("text")?ub("color",d):void 0,v=f("gradients")?Sb(m):void 0,b=f("background")?ub("background-color",u):void 0,k=f("background")||f("gradients"),_=u||(null==g||null===(o=g.color)||void 0===o?void 0:o.background)||c&&(m||(null==g||null===(r=g.color)||void 0===r?void 0:r.gradient)),y=p()(e.className,h,v,{[b]:!(c&&null!=g&&null!==(l=g.color)&&void 0!==l&&l.gradient||!b),"has-text-color":f("text")&&(d||(null==g||null===(i=g.color)||void 0===i?void 0:i.text)),"has-background":k&&_,"has-link-color":f("link")&&(null==g||null===(a=g.elements)||void 0===a||null===(s=a.link)||void 0===s?void 0:s.color)});return e.className=y||void 0,e}const ek=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?sb(e,n[1]).color:t};function tk(e){var t,n,o,r,l,i;const{name:s,attributes:c}=e,d=fr("color.palette.custom"),p=fr("color.palette.theme"),m=fr("color.palette.default"),g=(0,u.useMemo)((()=>[...d||[],...p||[],...m||[]]),[d,p,m]),f=fr("color.gradients.custom"),h=fr("color.gradients.theme"),v=fr("color.gradients.default"),b=(0,u.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),k=fr("color.custom"),y=fr("color.customGradient"),E=fr("color.background"),C=fr("color.link"),S=fr("color.text"),w=k||!p||(null==p?void 0:p.length)>0,B=y||!h||(null==h?void 0:h.length)>0,I=(0,u.useRef)(c);if((0,u.useEffect)((()=>{I.current=c}),[c]),!$b(s))return null;const x=jb(s)&&C&&w,T=qb(s)&&S&&w,M=Kb(s)&&E&&w,N=Wb(s)&&B;if(!(x||T||M||N))return null;const{style:P,textColor:L,backgroundColor:R,gradient:A}=c;let O;if(N&&A)O=wb(b,A);else if(N){var D;O=null==P||null===(D=P.color)||void 0===D?void 0:D.gradient}const z=t=>n=>{var o,r;const l=cb(g,n),i=t+"Color",a={...I.current.style,color:{...null===(o=I.current)||void 0===o||null===(r=o.style)||void 0===r?void 0:r.color,[t]:null!=l&&l.slug?void 0:n}},s=null!=l&&l.slug?l.slug:void 0,c={style:Ar(a),[i]:s};e.setAttributes(c),I.current={...I.current,...c}},F=(0,a.getBlockSupport)(e.name,[Ub,"__experimentalDefaultControls"]),V="web"===u.Platform.OS&&!A&&!(null!=P&&null!==(t=P.color)&&void 0!==t&&t.gradient)&&M&&(x||T)&&!1!==(0,a.getBlockSupport)(e.name,[Ub,"enableContrastChecker"]);return(0,u.createElement)(Gb,{enableContrastChecking:V,clientId:e.clientId,enableAlpha:!0,settings:[...T?[{label:(0,_.__)("Text"),onColorChange:z("text"),colorValue:sb(g,L,null==P||null===(n=P.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==F?void 0:F.text,resetAllFilter:Zb}]:[],...M||N?[{label:(0,_.__)("Background"),onColorChange:M?z("background"):void 0,colorValue:sb(g,R,null==P||null===(o=P.color)||void 0===o?void 0:o.background).color,gradientValue:O,onGradientChange:N?t=>{const n=Ib(b,t);let o;if(n){var r,l,i;const e={...null===(r=I.current)||void 0===r?void 0:r.style,color:{...null===(l=I.current)||void 0===l||null===(i=l.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:Ar(e),gradient:n}}else{var a,s,c;const e={...null===(a=I.current)||void 0===a?void 0:a.style,color:{...null===(s=I.current)||void 0===s||null===(c=s.style)||void 0===c?void 0:c.color,gradient:t}};o={style:Ar(e),gradient:void 0}}e.setAttributes(o),I.current={...I.current,...o}}:void 0,isShownByDefault:null==F?void 0:F.background,resetAllFilter:Xb}]:[],...x?[{label:(0,_.__)("Link"),onColorChange:t=>{var n;const o=cb(g,t),r=null!=o&&o.slug?`var:preset|color|${o.slug}`:t,l=Ar(Dr(null===(n=I.current)||void 0===n?void 0:n.style,["elements","link","color","text"],r));e.setAttributes({style:l}),I.current={...I.current,style:l}},colorValue:ek(g,null==P||null===(r=P.elements)||void 0===r||null===(l=r.link)||void 0===l||null===(i=l.color)||void 0===i?void 0:i.text),isShownByDefault:null==F?void 0:F.link,resetAllFilter:Qb}]:[]]})}const nk=(0,m.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:i}=r,a=fr("color.palette.custom"),s=fr("color.palette.theme"),d=fr("color.palette.default"),p=(0,u.useMemo)((()=>[...a||[],...s||[],...d||[]]),[a,s,d]);if(!$b(o)||Fr(o,Ub))return(0,u.createElement)(e,t);const m={};var g,f;i&&!Fr(o,Ub,"text")&&(m.color=null===(g=sb(p,i))||void 0===g?void 0:g.color);l&&!Fr(o,Ub,"background")&&(m.backgroundColor=null===(f=sb(p,l))||void 0===f?void 0:f.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,u.createElement)(e,c({},t,{wrapperProps:h}))})),ok={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,s.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return $b(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Wb(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Jb),(0,s.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!$b(e)||Fr(e,Ub))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Jb(o,e,n)},e})),(0,s.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",nk),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return zr({linkColor:jb(r),textColor:qb(r),backgroundColor:Kb(r),gradient:Wb(r)},ok,e,t,n,o)}));const rk=[{name:(0,_._x)("Regular","font style"),value:"normal"},{name:(0,_._x)("Italic","font style"),value:"italic"}],lk=[{name:(0,_._x)("Thin","font weight"),value:"100"},{name:(0,_._x)("Extra Light","font weight"),value:"200"},{name:(0,_._x)("Light","font weight"),value:"300"},{name:(0,_._x)("Regular","font weight"),value:"400"},{name:(0,_._x)("Medium","font weight"),value:"500"},{name:(0,_._x)("Semi Bold","font weight"),value:"600"},{name:(0,_._x)("Bold","font weight"),value:"700"},{name:(0,_._x)("Extra Bold","font weight"),value:"800"},{name:(0,_._x)("Black","font weight"),value:"900"}],ik=(e,t)=>e?t?(0,_.__)("Appearance"):(0,_.__)("Font style"):(0,_.__)("Font weight");function ak(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l},...i}=e,a=n||o,s=ik(n,o),d={key:"default",name:(0,_.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},p=(0,u.useMemo)((()=>n&&o?(()=>{const e=[d];return rk.forEach((t=>{let{name:n,value:o}=t;lk.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,_.sprintf)((0,_.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[d];return rk.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[d];return lk.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),m=p.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||p[0];return a&&(0,u.createElement)(h.CustomSelectControl,c({},i,{className:"components-font-appearance-control",label:s,describedBy:m?n?o?(0,_.sprintf)((0,_.__)("Currently selected font appearance: %s"),m.name):(0,_.sprintf)((0,_.__)("Currently selected font style: %s"),m.name):(0,_.sprintf)((0,_.__)("Currently selected font weight: %s"),m.name):(0,_.__)("No selected font appearance"),options:p,value:m,onChange:e=>{let{selectedItem:n}=e;return t(n.style)},__nextUnconstrainedWidth:!0}))}const sk=1.5,ck=.1;var uk=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px",...l}=e;const i=function(e){return void 0!==e&&""!==e}(t),a=i?t:"";o||W()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const s=o?void 0:{marginBottom:24};return(0,u.createElement)("div",{className:"block-editor-line-height-control",style:s},(0,u.createElement)(h.__experimentalNumberControl,c({},l,{__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),r=((e,t)=>{if(i)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return sk;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,_.__)("Line height"),placeholder:sk,step:ck,value:a,min:0,spinControls:"custom"})))};const dk="typography.lineHeight";function pk(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(uk,{__unstableInputWidth:"100%",__nextHasNoMarginBottom:!0,value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};o({style:Ar(t)})},size:"__unstable-large"})}function mk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("typography.lineHeight");return!(0,a.hasBlockSupport)(e,dk)||t}const gk="typography.__experimentalFontStyle",fk="typography.__experimentalFontWeight";function hk(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!vk(e),i=!bk(e),a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,s=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return(0,u.createElement)(ak,{onChange:e=>{r({style:Ar({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:s},size:"__unstable-large"})}function vk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,a.hasBlockSupport)(e,gk),n=fr("typography.fontStyle");return!t||!n}function bk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,a.hasBlockSupport)(e,fk),n=fr("typography.fontWeight");return!t||!n}function kk(e){const t=vk(e),n=bk(e);return t&&n}function _k(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=fr("typography.fontFamilies");if(o||(o=l),!o||0===o.length)return null;const i=[{value:"",label:(0,_.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,u.createElement)(h.SelectControl,c({label:(0,_.__)("Font"),options:i,value:t,onChange:n,labelPosition:"top"},r))}const yk="typography.__experimentalFontFamily";function Ek(e,t,n){if(!(0,a.hasBlockSupport)(t,yk))return e;if(Fr(t,s_,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(Df())(e.className);o.add(`has-${(0,f.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const r=o.value;return e.className=r||void 0,e}function Ck(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=fr("typography.fontFamilies"),l=null==r||null===(t=r.find((e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,u.createElement)(_k,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=null==r?void 0:r.find((t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})},size:"__unstable-large",__nextHasNoMarginBottom:!0})}function Sk(e){let{name:t}=e;const n=fr("typography.fontFamilies");return!n||0===n.length||!(0,a.hasBlockSupport)(t,yk)}(0,s.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,a.hasBlockSupport)(e,yk)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Ek),(0,s.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,a.hasBlockSupport)(e,yk))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Ek(o,e,n)},e}));const wk=(e,t,n)=>{if(t){const n=null==e?void 0:e.find((e=>{let{slug:n}=e;return n===t}));if(n)return n}return{size:n}};function Bk(e,t){const n=null==e?void 0:e.find((e=>{let{size:n}=e;return n===t}));return n||{size:t}}function Ik(e){if(e)return`has-${(0,f.kebabCase)(e)}-font-size`}var xk=function(e){const t=fr("typography.fontSizes"),n=!fr("typography.customFontSize");return(0,u.createElement)(h.FontSizePicker,c({},e,{fontSizes:t,disableCustomFontSizes:n}))};const Tk="1600px",Mk="768px",Nk=1,Pk=.75;function Lk(e){let{minimumFontSize:t,maximumFontSize:n,fontSize:o,minimumViewPortWidth:r=Mk,maximumViewPortWidth:l=Tk,scaleFactor:i=Nk,minimumFontSizeFactor:a=Pk,minimumFontSizeLimit:s}=e;if(s=Rk(s)?s:"14px",o){const e=Rk(o);if(null==e||!e.unit)return null;const r=Rk(s,{coerceTo:e.unit});if(null!=r&&r.value&&!t&&!n&&(null==e?void 0:e.value)<=(null==r?void 0:r.value))return null;if(n||(n=`${e.value}${e.unit}`),!t){const n=Ak(e.value*a,3);t=null!=r&&r.value&&n<(null==r?void 0:r.value)?`${r.value}${r.unit}`:`${n}${e.unit}`}}const c=Rk(t),u=(null==c?void 0:c.unit)||"rem",d=Rk(n,{coerceTo:u});if(!c||!d)return null;const p=Rk(t,{coerceTo:"rem"}),m=Rk(l,{coerceTo:u}),g=Rk(r,{coerceTo:u});if(!m||!g||!p)return null;const f=Ak(g.value/100,3),h=Ak(f,3)+u,v=Ak(((d.value-c.value)/(m.value-g.value)*100||1)*i,3);return`clamp(${t}, ${`${p.value}${p.unit} + ((1vw - ${h}) * ${v})`}, ${n})`}function Rk(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:o,acceptableUnits:r}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},l=null==r?void 0:r.join("|"),i=new RegExp(`^(\\d*\\.?\\d+)(${l}){1,1}$`),a=e.match(i);if(!a||a.length<3)return null;let[,s,c]=a,u=parseFloat(s);return"px"!==n||"em"!==c&&"rem"!==c||(u*=o,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=o,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),{value:Ak(u,3),unit:c}}function Ak(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}const Ok="typography.fontSize";function Dk(e,t,n){if(!(0,a.hasBlockSupport)(t,Ok))return e;if(Fr(t,s_,"fontSize"))return e;const o=new(Df())(e.className);o.add(Ik(n.fontSize));const r=o.value;return e.className=r||void 0,e}function zk(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=fr("typography.fontSizes"),a=wk(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),s=(null==a?void 0:a.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,u.createElement)(xk,{onChange:e=>{const t=Bk(i,e).slug;l({style:Ar({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:s,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}function Fk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=fr("typography.fontSizes"),n=!(null==t||!t.length);return!(0,a.hasBlockSupport)(e,Ok)||!n}const Vk=(0,m.createHigherOrderComponent)((e=>t=>{var n,o;const r=fr("typography.fontSizes"),{name:l,attributes:{fontSize:i,style:s},wrapperProps:c}=t;if(!(0,a.hasBlockSupport)(l,Ok)||Fr(l,s_,"fontSize")||!i||null!=s&&null!==(n=s.typography)&&void 0!==n&&n.fontSize)return(0,u.createElement)(e,t);const d=wk(r,i,null==s||null===(o=s.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...c,style:{fontSize:d,...null==c?void 0:c.style}}};return(0,u.createElement)(e,p)}),"withFontSizeInlineStyles"),Hk={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,s.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,a.hasBlockSupport)(e,Ok)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Dk),(0,s.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,a.hasBlockSupport)(e,Ok))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Dk(o,e,n)},e})),(0,s.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Vk),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const r=e.name;return zr({fontSize:(0,a.hasBlockSupport)(r,Ok)},Hk,e,t,n,o)})),(0,s.addFilter)("blocks.registerBlockType","core/font-size/addEditPropsForFluidCustomFontSizes",(function(e){if(!(0,a.hasBlockSupport)(e,Ok)||Fr(e,s_,"fontSize"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=e=>{var n,o,r;const l=t?t(e):{},i=null==l||null===(n=l.style)||void 0===n?void 0:n.fontSize,a=null===(o=(0,g.select)(To).getSettings().__experimentalFeatures)||void 0===o||null===(r=o.typography)||void 0===r?void 0:r.fluid,s="object"==typeof a?a:{},c=i&&a?Lk({fontSize:i,minimumFontSizeLimit:null==s?void 0:s.minFontSize}):null;return null===c?l:{...l,style:{...null==l?void 0:l.style,fontSize:c}}},e}),11);var Gk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M7 11.5h10V13H7z"}));var Uk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"}));var $k=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));const jk=[{name:(0,_.__)("None"),value:"none",icon:Gk},{name:(0,_.__)("Underline"),value:"underline",icon:Uk},{name:(0,_.__)("Strikethrough"),value:"line-through",icon:$k}];function Wk(e){let{value:t,onChange:n,className:o}=e;return(0,u.createElement)("fieldset",{className:p()("block-editor-text-decoration-control",o)},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},(0,_.__)("Decoration")),(0,u.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},jk.map((e=>(0,u.createElement)(h.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}const Kk="typography.__experimentalTextDecoration";function qk(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(Wk,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:Ar({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})},size:"__unstable-large"})}function Yk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,a.hasBlockSupport)(e,Kk),n=fr("typography.textDecoration");return t||!n}var Zk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"}));var Qk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"}));var Xk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"}));const Jk=[{name:(0,_.__)("None"),value:"none",icon:Gk},{name:(0,_.__)("Uppercase"),value:"uppercase",icon:Zk},{name:(0,_.__)("Lowercase"),value:"lowercase",icon:Qk},{name:(0,_.__)("Capitalize"),value:"capitalize",icon:Xk}];function e_(e){let{className:t,value:n,onChange:o}=e;return(0,u.createElement)("fieldset",{className:p()("block-editor-text-transform-control",t)},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},(0,_.__)("Letter case")),(0,u.createElement)("div",{className:"block-editor-text-transform-control__buttons"},Jk.map((e=>(0,u.createElement)(h.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===n,onClick:()=>{o(e.value===n?void 0:e.value)}})))))}const t_="typography.__experimentalTextTransform";function n_(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(e_,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:Ar({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})},size:"__unstable-large"})}function o_(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,a.hasBlockSupport)(e,t_),n=fr("typography.textTransform");return t||!n}function r_(e){let{value:t,onChange:n,__unstableInputWidth:o="60px",...r}=e;const l=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,u.createElement)(h.__experimentalUnitControl,c({},r,{label:(0,_.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:l,onChange:n}))}const l_="typography.__experimentalLetterSpacing";function i_(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(r_,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:Ar({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%",size:"__unstable-large"})}function a_(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,a.hasBlockSupport)(e,l_),n=fr("typography.letterSpacing");return t||!n}const s_="typography",c_=[dk,Ok,gk,fk,yk,Kk,t_,l_];function u_(e){const{clientId:t}=e,n=Sk(e),o=Fk(e),r=kk(e),l=mk(e),i=Yk(e),s=o_(e),c=a_(e),d=!vk(e),p=!bk(e),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[kk(e),Fk(e),mk(e),Sk(e),Yk(e),o_(e),a_(e)];return t.filter(Boolean).length===t.length}(e),g=d_(e.name);if(m||!g)return null;const f=(0,a.getBlockSupport)(e.name,[s_,"__experimentalDefaultControls"]),v=e=>t=>{var n;return{...t,style:{...t.style,typography:{...null===(n=t.style)||void 0===n?void 0:n.typography,[e]:void 0}}}};return(0,u.createElement)(jr,{group:"typography"},!n&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,_.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==f?void 0:f.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,u.createElement)(Ck,e)),!o&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{fontSize:n,style:o}=e.attributes;return!!n||!(null==o||null===(t=o.typography)||void 0===t||!t.fontSize)}(e),label:(0,_.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:Ar({...o,typography:{...null==o?void 0:o.typography,fontSize:void 0}})})}(e),isShownByDefault:null==f?void 0:f.fontSize,resetAllFilter:e=>{var t;return{...e,fontSize:void 0,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontSize:void 0}}}},panelId:t},(0,u.createElement)(zk,e)),!r&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t;const{fontStyle:n,fontWeight:o}=(null===(t=e.attributes.style)||void 0===t?void 0:t.typography)||{};return!!n||!!o}(e),label:ik(d,p),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ar({...o,typography:{...null==o?void 0:o.typography,fontStyle:void 0,fontWeight:void 0}})})}(e),isShownByDefault:null==f?void 0:f.fontAppearance,resetAllFilter:e=>{var t;return{...e,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontStyle:void 0,fontWeight:void 0}}}},panelId:t},(0,u.createElement)(hk,e)),!l&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.lineHeight)}(e),label:(0,_.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ar({...o,typography:{...null==o?void 0:o.typography,lineHeight:void 0}})})}(e),isShownByDefault:null==f?void 0:f.lineHeight,resetAllFilter:v("lineHeight"),panelId:t},(0,u.createElement)(pk,e)),!c&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.letterSpacing)}(e),label:(0,_.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ar({...o,typography:{...null==o?void 0:o.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==f?void 0:f.letterSpacing,resetAllFilter:v("letterSpacing"),panelId:t},(0,u.createElement)(i_,e)),!i&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textDecoration)}(e),label:(0,_.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ar({...o,typography:{...null==o?void 0:o.typography,textDecoration:void 0}})})}(e),isShownByDefault:null==f?void 0:f.textDecoration,resetAllFilter:v("textDecoration"),panelId:t},(0,u.createElement)(qk,e)),!s&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e),label:(0,_.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ar({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==f?void 0:f.textTransform,resetAllFilter:v("textTransform"),panelId:t},(0,u.createElement)(n_,e)))}const d_=e=>c_.some((t=>(0,a.hasBlockSupport)(e,t)));const p_=[...c_,pb,Ub,fl,hl],m_=e=>p_.some((t=>(0,a.hasBlockSupport)(e,t)));function g_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};return(0,ni.getCSSRules)(e).forEach((e=>{t[e.key]=e.value})),t}const f_={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[Ub],[`${s_}.__experimentalSkipSerialization`]:[s_],[`${fl}.__experimentalSkipSerialization`]:[fl],[`${hl}.__experimentalSkipSerialization`]:[hl]},h_={...f_,[`${hl}`]:["spacing.blockGap"]},v_={gradients:"gradient"};function b_(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return e;let o=e;return n||(o=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach((e=>{if(Array.isArray(e)||(e=e.split(".")),e.length>1){const[t,...n]=e;b_(o[t],[n],!0)}else 1===e.length&&delete o[e[0]]})),o}function k_(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h_;if(!m_(t))return e;let{style:r}=n;return Object.entries(o).forEach((e=>{let[n,o]=e;const l=(0,a.getBlockSupport)(t,n);!0===l&&(r=b_(r,o)),Array.isArray(l)&&l.forEach((e=>{const t=v_[e]||e;r=b_(r,[[...o,t]])}))})),e.style={...g_(r),...e.style},e}const __=(0,m.createHigherOrderComponent)((e=>t=>{const n=Ao();return(0,u.createElement)(u.Fragment,null,n&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(tk,t),(0,u.createElement)(u_,t),(0,u.createElement)(bb,t),(0,u.createElement)(_l,t)),(0,u.createElement)(e,t))}),"withToolbarControls"),y_=(0,m.createHigherOrderComponent)((e=>t=>{var n,o;const r=`wp-elements-${(0,m.useInstanceId)(e)}`,l=Fr(t.name,Ub,"link"),i=(0,u.useMemo)((()=>{var e;const n=null===(e=t.attributes.style)||void 0===e?void 0:e.elements,o=[];if(n&&Object.keys(n).length>0){var i;const e={...n,link:{...n.link,color:l||null===(i=n.link)||void 0===i?void 0:i.color}};for(const[t,n]of Object.entries(e)){const e=(0,ni.compileCSS)(n,{selector:`.editor-styles-wrapper .${r} ${a.__EXPERIMENTAL_ELEMENTS[t]}`});e&&o.push(e)}}return o.length>0?o:void 0}),[null===(n=t.attributes.style)||void 0===n?void 0:n.elements]),s=(0,u.useContext)(Wv.__unstableElementContext);return(0,u.createElement)(u.Fragment,null,i&&s&&(0,u.createPortal)((0,u.createElement)("style",{dangerouslySetInnerHTML:{__html:i}}),s),(0,u.createElement)(e,c({},t,{className:null!==(o=t.attributes.style)&&void 0!==o&&o.elements?p()(t.className,r):t.className})))}));(0,s.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return m_(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",k_),(0,s.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!m_(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),k_(o,e,n,f_)},e})),(0,s.addFilter)("editor.BlockEdit","core/style/with-block-controls",__),(0,s.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",y_);(0,s.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,a.hasBlockSupport)(n,"__experimentalSettings",!1)?(null!=e&&null!==(t=e.attributes)&&void 0!==t&&t.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));var E_=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"}));var C_=function(e){let t,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}=e;return t="unset"===i?(0,u.createElement)(h.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?(0,u.createElement)(h.DuotoneSwatch,{values:i}):(0,u.createElement)(Jl,{icon:E_}),(0,u.createElement)(h.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,_.__)("Duotone"),variant:"toolbar"},renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,u.createElement)(h.ToolbarButton,{showTooltip:!0,onClick:o,"aria-haspopup":"true","aria-expanded":n,onKeyDown:e=>{n||e.keyCode!==Qu.DOWN||(e.preventDefault(),o())},label:(0,_.__)("Apply duotone filter"),icon:t})},renderContent:()=>(0,u.createElement)(h.MenuGroup,{label:(0,_.__)("Duotone")},(0,u.createElement)("div",{className:"block-editor-duotone-control__description"},(0,_.__)("Create a two-tone color effect without losing your original image.")),(0,u.createElement)(h.DuotonePicker,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}))})};const S_=[];function w_(e){let{selector:t,id:n,colors:o}=e;return"unset"===o?(0,u.createElement)(Wp,{selector:t}):(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Kp,{id:n,colors:o}),(0,u.createElement)(jp,{id:n,selector:t}))}function B_(e){let{presetSetting:t,defaultSetting:n}=e;const o=!fr(n),r=fr(`${t}.custom`)||S_,l=fr(`${t}.theme`)||S_,i=fr(`${t}.default`)||S_;return(0,u.useMemo)((()=>[...r,...l,...o?S_:i]),[o,r,l,i])}function I_(e){var t;let{attributes:n,setAttributes:o}=e;const r=null==n?void 0:n.style,l=null==r||null===(t=r.color)||void 0===t?void 0:t.duotone,i=B_({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=B_({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),s=!fr("color.custom"),c=!fr("color.customDuotone")||0===(null==a?void 0:a.length)&&s;return 0===(null==i?void 0:i.length)&&c?null:(0,u.createElement)(Vo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,u.createElement)(C_,{duotonePalette:i,colorPalette:a,disableCustomDuotone:c,disableCustomColors:s,value:l,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}fp([hp]);const x_=(0,m.createHigherOrderComponent)((e=>t=>{const n=(0,a.hasBlockSupport)(t.name,"color.__experimentalDuotone"),o=(0,g.useSelect)((e=>e(To).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(e,t),n&&!o&&(0,u.createElement)(I_,t))}),"withDuotoneControls");const T_=(0,m.createHigherOrderComponent)((e=>t=>{var n,o,r;const l=(0,a.getBlockSupport)(t.name,"color.__experimentalDuotone"),i=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(r=o.color)||void 0===r?void 0:r.duotone;if(!l||!i)return(0,u.createElement)(e,t);const s=`wp-duotone-${(0,m.useInstanceId)(e)}`,d=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${s}`,l),g=p()(null==t?void 0:t.className,s),f=(0,u.useContext)(Wv.__unstableElementContext);return(0,u.createElement)(u.Fragment,null,f&&(0,u.createPortal)((0,u.createElement)(w_,{selector:d,id:s,colors:i}),f),(0,u.createElement)(e,c({},t,{className:g})))}),"withDuotoneStyles");(0,s.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,a.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,s.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",x_),(0,s.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",T_);const M_="__experimentalLayout";function N_(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=(0,g.useSelect)((e=>{var t;const{getSettings:n}=e(To);return null===(t=n().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments}),[]),r=fr("layout")||{},{attributes:l={},name:i}=n,{layout:s}=l,{default:c}=(0,a.getBlockSupport)(i,M_)||{},u=null!=s&&s.inherit||null!=s&&s.contentSize||null!=s&&s.wideSize?{...s,type:"constrained"}:s||c||{},d=[];var p,m;null!=r&&null!==(e=r.definitions)&&void 0!==e&&null!==(t=e[(null==u?void 0:u.type)||"default"])&&void 0!==t&&t.className&&d.push(null==r||null===(p=r.definitions)||void 0===p||null===(m=p[(null==u?void 0:u.type)||"default"])||void 0===m?void 0:m.className);return(null!=u&&u.inherit||null!=u&&u.contentSize||"constrained"===(null==u?void 0:u.type))&&o&&d.push("has-global-padding"),null!=u&&u.orientation&&d.push(`is-${(0,f.kebabCase)(u.orientation)}`),null!=u&&u.justifyContent&&d.push(`is-content-justification-${(0,f.kebabCase)(u.justifyContent)}`),null!=u&&u.flexWrap&&"nowrap"===u.flexWrap&&d.push("is-nowrap"),d}function P_(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const{attributes:o={},name:r}=t,{layout:l={},style:i={}}=o,a=null!=l&&l.inherit||null!=l&&l.contentSize||null!=l&&l.wideSize?{...l,type:"constrained"}:l||{},s=li((null==a?void 0:a.type)||"default"),c=fr("layout")||{},u=fr("spacing.blockGap"),d=null!==u,p=null==s||null===(e=s.getLayoutStyle)||void 0===e?void 0:e.call(s,{blockName:r,selector:n,layout:l,layoutDefinitions:null==c?void 0:c.definitions,style:i,hasBlockGapSupport:d});return p}function L_(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:r}=n,l=fr("layout"),i=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return t().supportsLayout}),[]),s=(0,a.getBlockSupport)(o,M_,{}),{allowSwitching:c,allowEditing:d=!0,allowInheriting:p=!0,default:m}=s;if(!d)return null;const f=!(!p||!l||null!=r&&r.type&&"default"!==(null==r?void 0:r.type)&&"constrained"!==(null==r?void 0:r.type)&&(null==r||!r.inherit)),v=r||m||{},{inherit:b=!1,type:k="default",contentSize:y=null}=v;if(("default"===k||"constrained"===k)&&!i)return null;const E=li(k),C=li("constrained"),S=!v.type&&(y||b),w=!!b||!!y,B=e=>t({layout:e});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(jr,null,(0,u.createElement)(h.PanelBody,{title:(0,_.__)("Layout")},f&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ToggleControl,{className:"block-editor-hooks__toggle-control",label:(0,_.__)("Inner blocks use content width"),checked:"constrained"===(null==E?void 0:E.name)||w,onChange:()=>t({layout:{type:"constrained"===(null==E?void 0:E.name)||w?"default":"constrained"}}),help:"constrained"===(null==E?void 0:E.name)||w?(0,_.__)("Nested blocks use content width with options for full and wide widths."):(0,_.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})),!b&&c&&(0,u.createElement)(R_,{type:k,onChange:e=>t({layout:{type:e}})}),E&&"default"!==E.name&&(0,u.createElement)(E.inspectorControls,{layout:v,onChange:B,layoutBlockSupport:s}),C&&S&&(0,u.createElement)(C.inspectorControls,{layout:v,onChange:B,layoutBlockSupport:s}))),!b&&E&&(0,u.createElement)(E.toolBarControls,{layout:v,onChange:B,layoutBlockSupport:s}))}function R_(e){let{type:t,onChange:n}=e;return(0,u.createElement)(h.ButtonGroup,null,ri.map((e=>{let{name:o,label:r}=e;return(0,u.createElement)(h.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const A_=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,a.hasBlockSupport)(n,M_)&&(0,u.createElement)(L_,c({key:"layout"},t)),(0,u.createElement)(e,c({key:"edit"},t))]}),"withInspectorControls"),O_=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o,block:r}=t,l=(0,a.hasBlockSupport)(n,M_),i=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return!!t().disableLayoutStyles})),s=l&&!i,d=(0,m.useInstanceId)(e),f=fr("layout")||{},h=(0,u.useContext)(Wv.__unstableElementContext),{layout:v}=o,{default:b}=(0,a.getBlockSupport)(n,M_)||{},k=null!=v&&v.inherit||null!=v&&v.contentSize||null!=v&&v.wideSize?{...v,type:"constrained"}:v||b||{},_=l?N_(r):null,y=`.wp-container-${d}.wp-container-${d}`,E=null!==fr("spacing.blockGap");let C;if(s){var S;const e=li((null==k?void 0:k.type)||"default");C=null==e||null===(S=e.getLayoutStyle)||void 0===S?void 0:S.call(e,{blockName:n,selector:y,layout:k,layoutDefinitions:null==f?void 0:f.definitions,style:null==o?void 0:o.style,hasBlockGapSupport:E})}const w=p()({[`wp-container-${d}`]:s&&!!C},_);return(0,u.createElement)(u.Fragment,null,s&&h&&!!C&&(0,u.createPortal)((0,u.createElement)(ui,{blockName:n,selector:y,css:C,layout:k,style:null==o?void 0:o.style}),h),(0,u.createElement)(e,c({},t,{__unstableLayoutClassNames:w})))})),D_=(0,m.createHigherOrderComponent)((e=>t=>{const{attributes:n}=t,{style:{layout:o={}}={}}=n,{selfStretch:r,flexSize:l}=o,i=r||l,a=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return!!t().disableLayoutStyles})),s=i&&!a,d=(0,u.useContext)(Wv.__unstableElementContext),f=(0,m.useInstanceId)(e),h=`.wp-container-content-${f}`;let v="";"fixed"===r&&l?v+=`${h} {\n\t\t\t\tflex-basis: ${l};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===r&&(v+=`${h} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`);const b=p()(null==t?void 0:t.className,{[`wp-container-content-${f}`]:s&&!!v});return(0,u.createElement)(u.Fragment,null,s&&d&&!!v&&(0,u.createPortal)((0,u.createElement)("style",null,v),d),(0,u.createElement)(e,c({},t,{className:b})))}));function z_(e){let{clientId:t,stopEditingAsBlock:n}=e;const o=(0,g.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=e(To);return n(t)||o(t,!0)}),[t]);return(0,u.useEffect)((()=>{o||n()}),[o]),null}(0,s.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.layout)&&void 0!==t?t:{})||(0,a.hasBlockSupport)(e,M_)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,s.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",O_),(0,s.addFilter)("editor.BlockListBlock","core/editor/layout/with-child-layout-styles",D_),(0,s.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",A_);const F_=(0,m.createHigherOrderComponent)((e=>t=>{const{getBlockListSettings:n,getSettings:o}=(0,g.useSelect)(To),r=(0,u.useRef)(),{templateLock:l,isLockedByParent:i,isEditingAsBlocks:a}=(0,g.useSelect)((e=>{const{__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=e(To);return{templateLock:o(t.clientId),isLockedByParent:!!n(t.clientId),isEditingAsBlocks:r()===t.clientId}}),[t.clientId]),{updateSettings:s,updateBlockListSettings:d,__unstableSetTemporarilyEditingAsBlocks:m}=(0,g.useDispatch)(To),f=!i&&"contentOnly"===l,{__unstableMarkNextChangeAsNotPersistent:v,updateBlockAttributes:b}=(0,g.useDispatch)(To),k=(0,u.useCallback)((()=>{v(),b(t.clientId,{templateLock:"contentOnly"}),d(t.clientId,{...n(t.clientId),templateLock:"contentOnly"}),s({focusMode:r.current}),m()}),[t.clientId,r,s,d,n,v,b,m]);return f||a?(0,u.createElement)(u.Fragment,null,a&&!f&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(z_,{clientId:t.clientId,stopEditingAsBlock:k}),(0,u.createElement)(Vo,{group:"other"},(0,u.createElement)(h.ToolbarButton,{onClick:()=>{k()}},(0,_.__)("Done")))),!a&&f&&t.isSelected&&(0,u.createElement)(zh,null,(e=>{let{onClose:l}=e;return(0,u.createElement)(h.MenuItem,{onClick:()=>{v(),b(t.clientId,{templateLock:void 0}),d(t.clientId,{...n(t.clientId),templateLock:!1}),r.current=o().focusMode,s({focusMode:!0}),m(t.clientId),l()}},(0,_.__)("Modify"))})),(0,u.createElement)(e,c({},t,{className:p()(t.className,a&&"is-content-locked-editing-as-blocks")}))):(0,u.createElement)(e,t)}),"withToolbarControls");(0,s.addFilter)("editor.BlockEdit","core/content-lock-ui/with-block-controls",F_);const V_="metadata";function H_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e.name.startsWith("core/"))return!1;const n=(0,a.getBlockSupport)(e,"__experimentalMetadata");return!!(!0===n||null!=n&&n[t])}function G_(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:Eb(e)||void 0,style:g_({border:n})}}function U_(e){const{colors:t}=db(),n=G_(e),{borderColor:o}=e;if(o){const e=hb({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function $_(e){var t,n,o,r,l,i;const{backgroundColor:a,textColor:s,gradient:c,style:u}=e,d=ub("background-color",a),m=ub("color",s),g=Sb(c),f=g||(null==u||null===(t=u.color)||void 0===t?void 0:t.gradient);return{className:p()(m,g,{[d]:!f&&!!d,"has-text-color":s||(null==u||null===(n=u.color)||void 0===n?void 0:n.text),"has-background":a||(null==u||null===(o=u.color)||void 0===o?void 0:o.background)||c||(null==u||null===(r=u.color)||void 0===r?void 0:r.gradient),"has-link-color":null==u||null===(l=u.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:g_({color:(null==u?void 0:u.color)||{}})}}(0,s.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.metadata)&&void 0!==n&&n.type||H_(e,"name")&&(e.attributes={...e.attributes,[V_]:{type:"object"}}),e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/metadata/save-props",(function(e,t,n){return H_(t)&&(e.metadata=n.metadata),e})),(0,s.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||H_(e,"name",!1)&&(e.__experimentalLabel=(e,t)=>{let{context:n}=t;const{metadata:o}=e;if("list-view"===n&&null!=o&&o.name)return o.name}),e}));const j_={};function W_(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=fr("color.palette.custom"),l=fr("color.palette.theme"),i=fr("color.palette.default"),a=fr("color.gradients")||j_,s=(0,u.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),c=(0,u.useMemo)((()=>[...(null==a?void 0:a.custom)||[],...(null==a?void 0:a.theme)||[],...(null==a?void 0:a.default)||[]]),[a]),d=$_(e);if(t){const e=sb(s,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=wb(c,o)),n){const e=sb(s,n);d.style.color=e.color}return d}function K_(e){const{style:t}=e;return{style:g_({spacing:(null==t?void 0:t.spacing)||{}})}}function q_(e,t){var n;let o=(null==e||null===(n=e.style)||void 0===n?void 0:n.typography)||{};if(t&&(!0===t||0!==Object.keys(t).length)){var r,l,i,a;const n=Lk({fontSize:null==e||null===(r=e.style)||void 0===r||null===(l=r.typography)||void 0===l?void 0:l.fontSize,minimumFontSizeLimit:null==t?void 0:t.minFontSize})||(null==e||null===(i=e.style)||void 0===i||null===(a=i.typography)||void 0===a?void 0:a.fontSize);o={...o,fontSize:n}}const s=g_({typography:o}),c=null!=e&&e.fontFamily?`has-${(0,f.kebabCase)(e.fontFamily)}-font-family`:"";return{className:p()(c,Ik(null==e?void 0:e.fontSize)),style:s}}function Y_(e){const[t,n]=(0,u.useState)(e);return(0,u.useEffect)((()=>{e&&n(e)}),[e]),t}const Z_=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},Q_=e=>(0,m.createHigherOrderComponent)((t=>n=>(0,u.createElement)(t,c({},n,{colors:e}))),"withCustomColorPalette"),X_=()=>(0,m.createHigherOrderComponent)((e=>t=>{const n=fr("color.palette.custom"),o=fr("color.palette.theme"),r=fr("color.palette.default"),l=(0,u.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,u.createElement)(e,c({},t,{colors:l}))}),"withEditorColorPalette");function J_(e,t){const n=e.reduce(((e,t)=>({...e,..."string"==typeof t?{[t]:(0,f.kebabCase)(t)}:t})),{});return(0,m.compose)([t,e=>class extends u.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=mp(t),o=e=>{let{color:t}=e;return n.contrast(t)},r=Math.max(...e.map(o));return e.find((e=>o(e)===r)).color}(t,e)}createSetters(){return Object.keys(n).reduce(((e,t)=>{const n=Z_(t),o=`custom${n}`;return e[`set${n}`]=this.createSetColor(t,o),e}),{})}createSetColor(e,t){return n=>{const o=cb(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:o,colors:r}=e;return Object.entries(n).reduce(((e,n)=>{let[l,i]=n;const a=sb(r,o[l],o[`custom${Z_(l)}`]),s=t[l];return(null==s?void 0:s.color)===a.color&&s?e[l]=s:e[l]={...a,class:ub(i,a.slug)},e}),{})}render(){return(0,u.createElement)(e,c({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function ey(e){return function(){const t=Q_(e);for(var n=arguments.length,o=new Array(n),r=0;r{let[t,...n]=e;return t.toUpperCase()+n.join("")};var ry=function(){for(var e=arguments.length,t=new Array(e),n=0;n(e[t]=`custom${oy(t)}`,e)),{});return(0,m.createHigherOrderComponent)((0,m.compose)([(0,m.createHigherOrderComponent)((e=>t=>{const n=fr("typography.fontSizes")||ny;return(0,u.createElement)(e,c({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends u.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return Object.entries(o).reduce(((e,t)=>{let[n,o]=t;return e[`set${oy(n)}`]=this.createSetFontSize(n,o),e}),{})}createSetFontSize(e,t){return n=>{var o;const r=null===(o=this.props.fontSizes)||void 0===o?void 0:o.find((e=>{let{size:t}=e;return t===Number(n)}));this.props.setAttributes({[e]:r&&r.slug?r.slug:void 0,[t]:r&&r.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:r}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!Object.values(o).some(l))return null;const i=Object.entries(o).filter((e=>{let[t,n]=e;return l(n,t)})).reduce(((e,t)=>{let[o,l]=t;const i=n[o],a=wk(r,i,n[l]);return e[o]={...a,class:Ik(i)},e}),{});return{...t,...i}}render(){return(0,u.createElement)(e,c({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")};var ly=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"}));var iy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"}));var ay=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const sy=[{icon:ly,title:(0,_.__)("Align text left"),align:"left"},{icon:iy,title:(0,_.__)("Align text center"),align:"center"},{icon:ay,title:(0,_.__)("Align text right"),align:"right"}],cy={position:"bottom right",variant:"toolbar"};var uy=function(e){let{value:t,onChange:n,alignmentControls:o=sy,label:r=(0,_.__)("Align text"),describedBy:l=(0,_.__)("Change text alignment"),isCollapsed:i=!0,isToolbar:a}=e;function s(e){return()=>n(t===e?void 0:e)}const d=o.find((e=>e.align===t)),p=a?h.ToolbarGroup:h.ToolbarDropdownMenu,m=a?{isCollapsed:i}:{toggleProps:{describedBy:l},popoverProps:cy};return(0,u.createElement)(p,c({icon:d?d.icon:(0,_.isRTL)()?ay:ly,label:r,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:i?"menuitemradio":void 0,onClick:s(n)}}))},m))};const dy=e=>(0,u.createElement)(uy,c({},e,{isToolbar:!1})),py=e=>(0,u.createElement)(uy,c({},e,{isToolbar:!0})),my=()=>{};var gy={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(To),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=pm(t,my),i=(0,u.useMemo)((()=>(e.trim()?$m(o,r,l,e):Y(o,"frecency","desc")).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]),a=(0,u.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(fd,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i]);return[a]},allowContext(e,t){return!(/\S/.test(e)||/\S/.test(t))},getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,a.createBlock)(t,n,(0,a.createBlocksFromInnerBlocksTemplate)(o))}}},fy=window.wp.apiFetch,hy=n.n(fy);var vy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"}));var by=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"}));var ky={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await hy()({path:(0,rg.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords(e){return[...e.title.split(/\s+/)]},getOptionLabel(e){return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Jl,{key:"icon",icon:"page"===e.subtype?vy:by}),e.title)},getOptionCompletion(e){return(0,u.createElement)("a",{href:e.url},e.title)}};const _y=[];function yy(e){let{completers:t=_y}=e;const{name:n}=Ro();return(0,u.useMemo)((()=>{let e=[...t,ky];return(n===(0,a.getDefaultBlockName)()||(0,a.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=[...e,gy]),(0,s.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map((e=>({...e})))),e=(0,s.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}var Ey=function(e){return(0,u.createElement)(h.Autocomplete,c({},e,{completers:yy(e)}))};var Cy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"}));var Sy=function(e){let{isActive:t,label:n=(0,_.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,u.createElement)(h.ToolbarButton,{isActive:t,icon:Cy,label:n,onClick:()=>o(!t),disabled:r})};const wy=()=>{};var By=function(e){const{label:t=(0,_.__)("Change matrix alignment"),onChange:n=wy,value:o="center",isDisabled:r}=e,l=(0,u.createElement)(h.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,u.createElement)(h.Dropdown,{popoverProps:{variant:"toolbar",placement:"bottom-start"},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,u.createElement)(h.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==Qu.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,u.createElement)(h.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})};var Iy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"}));var xy=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,g.useDispatch)(To),{clientId:r,parents:l,hasSelection:i}=(0,g.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(To),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,_.__)("Document");return(0,u.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,_.__)("Block breadcrumb")},(0,u.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,u.createElement)(h.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,u.createElement)(Jl,{icon:Iy,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,u.createElement)("li",{key:e},(0,u.createElement)(h.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,u.createElement)(af,{clientId:e,maximumLength:35})),(0,u.createElement)(Jl,{icon:Iy,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,u.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,u.createElement)(af,{clientId:r,maximumLength:35})))};const Ty=()=>(0,u.createElement)(h.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,u.createElement)(h.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),My=e=>{let{style:t,className:n}=e;return(0,u.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,u.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,u.createElement)(Ty,null)))},Ny=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,_.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==Qu.DOWN||(e.preventDefault(),o())},icon:(0,u.createElement)(n,null,(0,u.createElement)(t,null,(0,u.createElement)(My,null)))}))}};var Py=e=>{let{children:t,...n}=e;return W()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,u.createElement)(h.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:Ny(n),renderContent:()=>t})};var Ly=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const Ry=Ru(h.__experimentalTreeGridRow);var Ay=(0,u.forwardRef)(((e,t)=>{let{isSelected:n,position:o,level:r,rowCount:l,children:i,className:a,path:s,...d}=e;const g=Du({isSelected:n,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:s}),f=(0,m.useMergeRefs)([t,g]);return(0,u.createElement)(Ry,c({ref:f,className:p()("block-editor-list-view-leaf",a),level:r,positionInSet:o,setSize:l},d),i)}));var Oy=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"}));var Dy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"}));function zy(e){let{onClick:t}=e;return(0,u.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,u.createElement)(Jl,{icon:(0,_.isRTL)()?Dy:Iy}))}var Fy=(0,u.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:a,onDragStart:s,onDragEnd:c,draggable:d}=e;const m=rf(o),g=lf({clientId:o,context:"list-view"}),{isLocked:f}=Ih(o);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Button,{className:p()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==Qu.ENTER&&e.keyCode!==Qu.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),null==s||s(e)},onDragEnd:c,draggable:d,href:`#block-${o}`,"aria-hidden":!0},(0,u.createElement)(zy,{onClick:l}),(0,u.createElement)(fd,{icon:null==m?void 0:m.icon,showColors:!0}),(0,u.createElement)(h.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,u.createElement)(h.__experimentalTruncate,{ellipsizeMode:"auto"},g)),(null==m?void 0:m.anchor)&&(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper"},(0,u.createElement)(h.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto"},m.anchor)),f&&(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,u.createElement)(Jl,{icon:Oy})))))}));const Vy=(0,u.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:i,siblingBlockCount:a,level:s,isExpanded:d,selectedClientIds:m,...f}=e;const{clientId:h}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,g.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(To);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[h]),k=v&&b===h,_=p()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=m.includes(h)?m:[h];return(0,u.createElement)(sf,{clientIds:y},(e=>{let{draggable:p,onDragStart:m,onDragEnd:g}=e;return(0,u.createElement)(Fy,c({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:i,siblingBlockCount:a,level:s,draggable:p,onDragStart:m,onDragEnd:g,isExpanded:d},f))}))}));var Hy=Vy;const Gy=(0,u.createContext)({}),Uy=()=>(0,u.useContext)(Gy);var $y=(0,u.memo)((function e(t){let{block:n,isDragged:o,isSelected:r,isBranchSelected:l,selectBlock:i,position:s,level:c,rowCount:d,siblingBlockCount:f,showBlockMovers:v,path:b,isExpanded:k,selectedClientIds:y,preventAnnouncement:E,isSyncedBranch:C}=t;const S=(0,u.useRef)(null),w=(0,u.useRef)(null),[B,I]=(0,u.useState)(!1),{clientId:x}=n,{isLocked:T,isContentLocked:M,canEdit:N}=Ih(x),P=(0,g.useSelect)((e=>!r&&(!!M&&e(To).hasSelectedInnerBlock(x,!0))),[M,x,r]),L=!M&&N,R=P||r&&y[0]===x,A=P||r&&y[y.length-1]===x,{toggleBlockHighlight:O}=(0,g.useDispatch)(To),D=rf(x),z=(0,g.useSelect)((e=>e(To).getBlockName(x)),[x]),F=(0,a.hasBlockSupport)(z,"__experimentalToolbar",!0),V=`list-view-block-select-button__${(0,m.useInstanceId)(e)}`,H=((e,t,n)=>(0,_.sprintf)((0,_.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(s,f,c);let G=(0,_.__)("Link");D&&(G=T?(0,_.sprintf)((0,_.__)("%s link (locked)"),D.title):(0,_.sprintf)((0,_.__)("%s link"),D.title));const U=D?(0,_.sprintf)((0,_.__)("Options for %s block"),D.title):(0,_.__)("Options"),{isTreeGridMounted:$,expand:j,collapse:W}=Uy(),K=v&&f>0,q=p()("block-editor-list-view-block__mover-cell",{"is-visible":B||r}),Y=p()("block-editor-list-view-block__menu-cell",{"is-visible":B||R});(0,u.useEffect)((()=>{!$&&r&&S.current.focus()}),[]);const Z=(0,u.useCallback)((()=>{I(!0),O(x,!0)}),[x,I,O]),Q=(0,u.useCallback)((()=>{I(!1),O(x,!1)}),[x,I,O]),X=(0,u.useCallback)((e=>{i(e,x),e.preventDefault()}),[x,i]),J=(0,u.useCallback)((e=>{i(void 0,e)}),[i]),ee=(0,u.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?W(x):!1===k&&j(x)}),[x,j,W,k]);let te;K?te=2:F||(te=3);const ne=p()({"is-selected":r||P,"is-first-selected":R,"is-last-selected":A,"is-branch-selected":l,"is-synced-branch":C,"is-dragging":o,"has-single-cell":!F,"is-synced":null==D?void 0:D.isSynced}),oe=y.includes(x)?y:[x];return function(e){let{isSelected:t,selectedClientIds:n,rowItemRef:o}=e;const r=1===n.length;(0,u.useLayoutEffect)((()=>{if(!t||!r||!o.current)return;const e=(0,Ri.getScrollContainer)(o.current),{ownerDocument:n}=o.current;if(e===n.body||e===n.documentElement||!e)return;const l=o.current.getBoundingClientRect(),i=e.getBoundingClientRect();(l.topi.bottom)&&o.current.scrollIntoView()}),[t,r,o])}({isSelected:r,rowItemRef:w,selectedClientIds:y}),(0,u.createElement)(Ay,{className:ne,onMouseEnter:Z,onMouseLeave:Q,onFocus:Z,onBlur:Q,level:c,position:s,rowCount:d,path:b,id:`list-view-block-${x}`,"data-block":x,isExpanded:L?k:void 0,"aria-selected":!!r||P,ref:w},(0,u.createElement)(h.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:te,ref:S,"aria-label":G,"aria-selected":!!r||P,"aria-expanded":L?k:void 0,"aria-describedby":V},(e=>{let{ref:t,tabIndex:o,onFocus:l}=e;return(0,u.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,u.createElement)(Hy,{block:n,onClick:X,onToggleExpanded:ee,isSelected:r,position:s,siblingBlockCount:f,level:c,ref:t,tabIndex:o,onFocus:l,isExpanded:k,selectedClientIds:y,preventAnnouncement:E}),(0,u.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:V},H))})),K&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalTreeGridCell,{className:q,withoutGridItem:!0},(0,u.createElement)(h.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,u.createElement)(hf,{orientation:"vertical",clientIds:[x],ref:t,tabIndex:n,onFocus:o})})),(0,u.createElement)(h.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,u.createElement)(vf,{orientation:"vertical",clientIds:[x],ref:t,tabIndex:n,onFocus:o})})))),F&&(0,u.createElement)(h.__experimentalTreeGridCell,{className:Y,"aria-selected":!!r||P},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,u.createElement)(Gh,{clientIds:oe,icon:sg,label:U,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:J})})))}));function jy(e,t,n,o){var r;if(null==n?void 0:n.includes(e.clientId))return 0;return(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(Wy(t,n,o),0):1}const Wy=(e,t,n)=>(o,r)=>{var l;if(null==t?void 0:t.includes(r.clientId))return o;return(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+jy(r,e,t,n):o+1},Ky=()=>{};var qy=(0,u.memo)((function e(t){const{blocks:n,selectBlock:o=Ky,showBlockMovers:r,selectedClientIds:l,level:i=1,path:a="",isBranchSelected:s=!1,listPosition:c=0,fixedListWindow:d,isExpanded:p,parentId:m,shouldShowInnerBlocks:f=!0,isSyncedBranch:h=!1}=t,v=rf(m),b=h||!(null==v||!v.isSynced),k=(0,g.useSelect)((e=>{if(!m)return!0;const t="contentOnly"===e(To).getTemplateLock(m),n=e(To).canEditBlock(m);return!t&&n}),[m]),{expandedState:_,draggedClientIds:y}=Uy();if(!k)return null;const E=n.filter(Boolean),C=E.length;let S=c;return(0,u.createElement)(u.Fragment,null,E.map(((t,n)=>{var c;const{clientId:m,innerBlocks:h}=t;n>0&&(S+=jy(E[n-1],_,y,p));const{itemInView:v}=d,k=v(S),w=n+1,B=a.length>0?`${a}_${w}`:`${w}`,I=!(null==h||!h.length),x=I&&f?null!==(c=_[m])&&void 0!==c?c:p:void 0,T=!(null==y||!y.includes(m)),M=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(m,l),N=s||M&&I,P=T||k||M;return(0,u.createElement)(g.AsyncModeProvider,{key:m,value:!M},P&&(0,u.createElement)($y,{block:t,selectBlock:o,isSelected:M,isBranchSelected:N,isDragged:T,level:i,position:w,rowCount:C,siblingBlockCount:C,showBlockMovers:r,path:B,isExpanded:x,listPosition:S,selectedClientIds:l,isSyncedBranch:b}),!P&&(0,u.createElement)("tr",null,(0,u.createElement)("td",{className:"block-editor-list-view-placeholder"})),I&&x&&!T&&(0,u.createElement)(e,{parentId:m,blocks:h,selectBlock:o,showBlockMovers:r,level:i+1,path:B,listPosition:S+1,fixedListWindow:d,isBranchSelected:N,selectedClientIds:l,isExpanded:p,isSyncedBranch:b}))})))}));function Yy(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,a]=(0,u.useMemo)((()=>{if(!t.current)return[];return[o?t.current.querySelector(`[data-block="${o}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]}),[o,r]),s=a||i,c=(0,u.useCallback)((()=>{if(!i)return 0;const e=s.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,s]),d=(0,u.useMemo)((()=>{if(!s)return{};const e=c();return{width:s.offsetWidth-e}}),[c,s]),p=(0,u.useMemo)((()=>{if(s&&("top"===l||"bottom"===l||"inside"===l))return{ownerDocument:s.ownerDocument,getBoundingClientRect(){const e=s.getBoundingClientRect(),t=c(),n=e.left+t,o=e.right;let r=0,i=0;"top"===l?(r=e.top,i=e.top):(r=e.bottom,i=e.bottom);const a=o-n,u=i-r;return new window.DOMRect(n,r,a,u)}}}),[s,l,c]);return s?(0,u.createElement)(h.Popover,{animate:!1,anchor:p,focusOnMount:!1,className:"block-editor-list-view-drop-indicator",variant:"unstyled"},(0,u.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}function Zy(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,g.useDispatch)(To),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:l,getBlockSelectionEnd:i,getSelectedBlockClientIds:s,hasMultiSelection:c,hasSelectedBlock:d}=(0,g.useSelect)(To),{getBlockType:p}=(0,g.useSelect)(a.store);return{updateBlockSelection:(0,u.useCallback)((async(i,a,u)=>{if(null==i||!i.shiftKey)return void n(a);i.preventDefault();const m="keydown"===i.type&&(i.keyCode===Qu.UP||i.keyCode===Qu.DOWN||i.keyCode===Qu.HOME||i.keyCode===Qu.END);if(!m&&!d()&&!c())return void n(a,null);const g=s(),f=[...r(a),a];m&&!g.some((e=>f.includes(e)))&&await e();let h=l(),v=a;m&&(d()||c()||(h=a),u&&(v=u));const b=r(h),k=r(v),{start:y,end:E}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(h,v,b,k);await t(y,E,null);const C=s();if((i.keyCode===Qu.HOME||i.keyCode===Qu.END)&&C.length>1)return;const S=g.filter((e=>!C.includes(e)));let w;if(1===S.length){var B;const e=null===(B=p(o(S[0])))||void 0===B?void 0:B.title;e&&(w=(0,_.sprintf)((0,_.__)("%s deselected."),e))}else S.length>1&&(w=(0,_.sprintf)((0,_.__)("%s blocks deselected."),S.length));w&&(0,pn.speak)(w)}),[e,o,p,r,l,i,s,c,d,t,n])}}const Qy=["top","bottom"];function Xy(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,g.useSelect)(To),[l,i]=(0,u.useState)(),{rootClientId:a,blockIndex:s}=l||{},c=Mv(a,s),d=o(),p=(0,m.useThrottle)((0,u.useCallback)(((o,l)=>{const a={x:o.clientX,y:o.clientY},s=!(null==d||!d.length),c=function(e,t){let n,o,r,l;for(const i of e){if(i.isDraggedBlock)continue;const a=i.element.getBoundingClientRect(),[s,c]=Pv(t,a,Qy),u=Lv(t,a);if(void 0===r||s0||function(e,t){const n=t.left+t.width/2;return e.x>n}(t,l)))return{rootClientId:o.clientId,blockIndex:0,dropPosition:"inside"};if(!o.canInsertDraggedBlocksAsSibling)return;const a=i?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+a,dropPosition:n}}(Array.from(l.querySelectorAll("[data-block]")).map((o=>{const l=o.dataset.block,i=e(l);return{clientId:l,rootClientId:i,blockIndex:t(l),element:o,isDraggedBlock:!!s&&d.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!s||r(d,i),canInsertDraggedBlocksAsChild:!s||r(d,l)}})),a);c&&i(c)}),[d]),200);return{ref:(0,m.__experimentalUseDropZone)({onDrop:c,onDragOver(e){p(e,e.currentTarget)},onDragEnd(){p.cancel(),i(null)}}),target:l}}const Jy=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var eE=(0,u.forwardRef)((function(e,t){let{id:n,blocks:o,showBlockMovers:r=!1,isExpanded:l=!1}=e;const{clientIdsTree:i,draggedClientIds:a,selectedClientIds:s}=function(e){return(0,g.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(To);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(o),{visibleBlockCount:c,shouldShowInnerBlocks:d}=(0,g.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n,__unstableGetEditorMode:o}=e(To),r=(null==a?void 0:a.length)>0?n(a).length+1:0;return{visibleBlockCount:t()-r,shouldShowInnerBlocks:"zoom-out"!==o()}}),[a]),{updateBlockSelection:p}=Zy(),[f,v]=(0,u.useReducer)(Jy,{}),{ref:b,target:k}=Xy(),y=(0,u.useRef)(),E=(0,m.useMergeRefs)([y,b,t]),C=(0,u.useRef)(!1),{setSelectedTreeId:S}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,u.useState)(null),{selectedBlockParentClientIds:l}=(0,g.useSelect)((e=>{const{getBlockParents:n}=e(To);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,u.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:s[0],setExpandedState:v}),w=(0,u.useCallback)(((e,t)=>{p(e,t),S(t)}),[S,p]);(0,u.useEffect)((()=>{C.current=!0}),[]);const[B]=(0,m.__experimentalUseFixedWindowList)(y,36,c,{useWindowing:!0,windowOverscan:40}),I=(0,u.useCallback)((e=>{e&&v({type:"expand",clientIds:[e]})}),[v]),x=(0,u.useCallback)((e=>{e&&v({type:"collapse",clientIds:[e]})}),[v]),T=(0,u.useCallback)((e=>{var t;I(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[I]),M=(0,u.useCallback)((e=>{var t;x(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[x]),N=(0,u.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&p(e,null==t||null===(o=t.dataset)||void 0===o?void 0:o.block,null==n||null===(r=n.dataset)||void 0===r?void 0:r.block)}),[p]),P=(0,u.useMemo)((()=>({isTreeGridMounted:C.current,draggedClientIds:a,expandedState:f,expand:I,collapse:x})),[C.current,a,f,I,x]);return(0,u.createElement)(g.AsyncModeProvider,{value:!0},(0,u.createElement)(Yy,{listViewRef:y,blockDropTarget:k}),(0,u.createElement)(h.__experimentalTreeGrid,{id:n,className:"block-editor-list-view-tree","aria-label":(0,_.__)("Block navigation structure"),ref:E,onCollapseRow:M,onExpandRow:T,onFocusRow:N,applicationAriaLabel:(0,_.__)("Block navigation structure")},(0,u.createElement)(Gy.Provider,{value:P},(0,u.createElement)(qy,{blocks:i,selectBlock:w,showBlockMovers:r,fixedListWindow:B,selectedClientIds:s,isExpanded:l,shouldShowInnerBlocks:d}))))}));function tE(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,u.createElement)(h.Button,c({},l,{ref:r,icon:Ly,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0,label:(0,_.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var nE=(0,u.forwardRef)((function(e,t){let{isDisabled:n,...o}=e;W()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const r=(0,g.useSelect)((e=>!!e(To).getBlockCount()),[])&&!n;return(0,u.createElement)(h.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:e=>{let{isOpen:n,onToggle:l}=e;return(0,u.createElement)(tE,c({},o,{innerRef:t,isOpen:n,onToggle:l,isEnabled:r}))},renderContent:()=>(0,u.createElement)("div",{className:"block-editor-block-navigation__container"},(0,u.createElement)("p",{className:"block-editor-block-navigation__label"},(0,_.__)("List view")),(0,u.createElement)(eE,null))})}));function oE(e){var t;let{genericPreviewBlock:n,style:o,className:r,activeStyle:l}=e;const i=null===(t=(0,a.getBlockType)(n.name))||void 0===t?void 0:t.example,s=zf(r,l,o),c=(0,u.useMemo)((()=>({...n,title:o.label||o.name,description:o.description,initialAttributes:{...n.attributes,className:s+" block-editor-block-styles__block-preview-container"},example:i})),[n,s]);return(0,u.createElement)(tm,{item:c,isStylePreview:!0})}const rE=()=>{};function lE(e){let{clientId:t,onSwitch:n=rE,onHoverClassName:o=rE}=e;const{onSelect:r,stylesToRender:l,activeStyle:i,genericPreviewBlock:a,className:s}=Vf({clientId:t,onSwitch:n}),[c,d]=(0,u.useState)(null),g=(0,m.useViewportMatch)("medium","<");if(!l||0===l.length)return null;const f=(0,m.debounce)(d,250),v=e=>{var t;c!==e?(f(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):f.cancel()};return(0,u.createElement)("div",{className:"block-editor-block-styles"},(0,u.createElement)("div",{className:"block-editor-block-styles__variants"},l.map((e=>{const t=e.isDefault?(0,_.__)("Default"):e.label||e.name;return(0,u.createElement)(h.Button,{className:p()("block-editor-block-styles__item",{"is-active":i.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>v(e),onFocus:()=>v(e),onMouseLeave:()=>v(null),onBlur:()=>v(null),onClick:()=>(e=>{r(e),o(null),d(null),f.cancel()})(e),"aria-current":i.name===e.name},(0,u.createElement)(h.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text"},t))}))),c&&!g&&(0,u.createElement)(h.Popover,{placement:"left-start",offset:20},(0,u.createElement)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>v(null)},(0,u.createElement)(oE,{activeStyle:i,className:s,genericPreviewBlock:a,style:c}))))}var iE=lE;lE.Slot=()=>(W()("BlockStyles.Slot",{version:"6.4",since:"6.2"}),null);var aE=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));var sE=function(e){let{icon:t=aE,label:n=(0,_.__)("Choose variation"),instructions:o=(0,_.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const a=p()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,u.createElement)(h.Placeholder,{icon:t,label:n,instructions:o,className:a},(0,u.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,_.__)("Block variations")},r.map((e=>(0,u.createElement)("li",{key:e.name},(0,u.createElement)(h.Button,{variant:"secondary",icon:e.icon&&e.icon.src?e.icon.src:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,u.createElement)("span",{className:"block-editor-block-variation-picker__variation-label"},e.title))))),i&&(0,u.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,u.createElement)(h.Button,{variant:"link",onClick:()=>l()},(0,_.__)("Skip"))))};var cE=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"}));const uE={carousel:"carousel",grid:"grid"},dE=e=>{let{onBlockPatternSelect:t}=e;return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,u.createElement)(h.Button,{variant:"primary",onClick:t},(0,_.__)("Choose")))},pE=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,u.createElement)(h.Button,{icon:md,label:(0,_.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,u.createElement)(h.Button,{icon:pd,label:(0,_.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var mE=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a}=e;const s=t===uE.carousel,c=(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,u.createElement)(h.Button,{icon:bi,label:(0,_.__)("Carousel view"),onClick:()=>n(uE.carousel),isPressed:s}),(0,u.createElement)(h.Button,{icon:cE,label:(0,_.__)("Grid view"),onClick:()=>n(uE.grid),isPressed:t===uE.grid}));return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},s&&(0,u.createElement)(pE,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),c,s&&(0,u.createElement)(dE,{onBlockPatternSelect:a}))};var gE=function(e,t,n){return(0,g.useSelect)((o=>{const{getBlockRootClientId:r,getPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(To),a=r(e);return n?i(a).filter(n):l(t,a)}),[e,t,n])};const fE=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r,showTitles:l}=e;const i=(0,h.__unstableUseCompositeState)(),a="block-editor-block-pattern-setup__container";if(t===uE.carousel){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__carousel"},(0,u.createElement)("div",{className:a},(0,u.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,u.createElement)(vE,{className:e.get(n)||"",key:t.name,pattern:t}))))))}return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__grid"},(0,u.createElement)(h.__unstableComposite,c({},i,{role:"listbox",className:a,"aria-label":(0,_.__)("Patterns list")}),o.map((e=>(0,u.createElement)(hE,{key:e.name,pattern:e,onSelect:r,composite:i,showTitles:l})))))};function hE(e){let{pattern:t,onSelect:n,composite:o,showTitles:r}=e;const l="block-editor-block-pattern-setup-list",{blocks:i,description:a,viewportWidth:s=700}=t,d=(0,m.useInstanceId)(hE,`${l}__item-description`);return(0,u.createElement)("div",{className:`${l}__list-item`,"aria-label":t.title,"aria-describedby":t.description?d:void 0},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},o,{className:`${l}__item`,onClick:()=>n(i)}),(0,u.createElement)(Jp,{blocks:i,viewportWidth:s}),r&&(0,u.createElement)("div",{className:`${l}__item-title`},t.title),!!a&&(0,u.createElement)(h.VisuallyHidden,{id:d},a)))}function vE(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,a=(0,m.useInstanceId)(vE,"block-editor-block-pattern-setup-list__item-description");return(0,u.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":l,"aria-describedby":i?a:void 0},(0,u.createElement)(Jp,{blocks:r,minHeight:o}),!!i&&(0,u.createElement)(h.VisuallyHidden,{id:a},i))}var bE=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,onBlockPatternSelect:r,initialViewMode:l=uE.carousel,showTitles:i=!1}=e;const[s,c]=(0,u.useState)(l),[d,p]=(0,u.useState)(0),{replaceBlock:m}=(0,g.useDispatch)(To),f=gE(t,n,o);if(null==f||!f.length)return null;const h=r||(e=>{const n=e.map((e=>(0,a.cloneBlock)(e)));m(t,n)});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${s}`},(0,u.createElement)(fE,{viewMode:s,activeSlide:d,patterns:f,onBlockPatternSelect:h,showTitles:i}),(0,u.createElement)(mE,{viewMode:s,setViewMode:c,activeSlide:d,totalSlides:f.length,handleNext:()=>{p((e=>e+1))},handlePrevious:()=>{p((e=>e-1))},onBlockPatternSelect:()=>{h(f[d].blocks)}})))};function kE(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;return(0,u.createElement)("fieldset",{className:t},(0,u.createElement)(h.VisuallyHidden,{as:"legend"},(0,_.__)("Transform to variation")),r.map((e=>(0,u.createElement)(h.Button,{key:e.name,icon:(0,u.createElement)(fd,{icon:e.icon,showColors:!0}),isPressed:o===e.name,label:o===e.name?e.title:(0,_.sprintf)((0,_.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function _E(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;const l=r.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}}));return(0,u.createElement)(h.DropdownMenu,{className:t,label:(0,_.__)("Transform to variation"),text:(0,_.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:uf,toggleProps:{iconPosition:"right"}},(()=>(0,u.createElement)("div",{className:`${t}__container`},(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(h.MenuItemsChoice,{choices:l,value:o,onSelect:n})))))}var yE=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,g.useDispatch)(To),{activeBlockVariation:o,variations:r}=(0,g.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(a.store),{getBlockName:r,getBlockAttributes:l}=e(To),i=t&&r(t);return{activeBlockVariation:n(i,l(t)),variations:i&&o(i,"transform")}}),[t]),l=null==o?void 0:o.name,i=(0,u.useMemo)((()=>{const e=new Set;return!!r&&(r.forEach((t=>{var n;t.icon&&e.add((null===(n=t.icon)||void 0===n?void 0:n.src)||t.icon)})),e.size===r.length)}),[r]);if(null==r||!r.length)return null;const s=i?kE:_E;return(0,u.createElement)(s,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...r.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:l,variations:r})},EE=(0,m.createHigherOrderComponent)((e=>t=>{const n=fr("color.palette"),o=!fr("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,i=!(0,f.isEmpty)(r)||!l;return(0,u.createElement)(e,c({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:i}))}),"withColorContext"),CE=EE(h.ColorPalette);function SE(e){let{onChange:t,value:n,...o}=e;return(0,u.createElement)(Ab,c({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var wE=window.wp.date;const BE=new Date(2022,0,25);function IE(e){let{format:t,defaultFormat:n,onChange:o}=e;return(0,u.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,u.createElement)(h.VisuallyHidden,{as:"legend"},(0,_.__)("Date format")),(0,u.createElement)(h.ToggleControl,{label:(0,u.createElement)(u.Fragment,null,(0,_.__)("Default format"),(0,u.createElement)("span",{className:"block-editor-date-format-picker__default-format-toggle-control__hint"},(0,wE.dateI18n)(n,BE))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,u.createElement)(xE,{format:t,onChange:o}))}function xE(e){var t;let{format:n,onChange:o}=e;const r=[...new Set(["Y-m-d",(0,_._x)("n/j/Y","short date format"),(0,_._x)("n/j/Y g:i A","short date format with time"),(0,_._x)("M j, Y","medium date format"),(0,_._x)("M j, Y g:i A","medium date format with time"),(0,_._x)("F j, Y","long date format"),(0,_._x)("M j","short date format without the year")])],l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,wE.dateI18n)(e,BE),format:e}))),i={key:"custom",name:(0,_.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,_.__)("Enter your own date format")},[a,s]=(0,u.useState)((()=>!!n&&!r.includes(n)));return(0,u.createElement)(h.__experimentalVStack,null,(0,u.createElement)(h.CustomSelectControl,{__nextUnconstrainedWidth:!0,label:(0,_.__)("Choose a format"),options:[...l,i],value:a?i:null!==(t=l.find((e=>e.format===n)))&&void 0!==t?t:i,onChange:e=>{let{selectedItem:t}=e;t===i?s(!0):(s(!1),o(t.format))}}),a&&(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Custom format"),hideLabelFromVision:!0,help:(0,u.createInterpolateElement)((0,_.__)("Enter a date or time format string."),{Link:(0,u.createElement)(h.ExternalLink,{href:(0,_.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}const TE=["colors","disableCustomColors","gradients","disableCustomGradients"],ME=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:i,settings:a,title:s,showTitle:c=!0,__experimentalIsRenderedInSidebar:d,enableAlpha:v}=e;const b=(0,m.useInstanceId)(ME),{batch:k}=(0,g.useRegistry)();return(0,f.isEmpty)(n)&&(0,f.isEmpty)(o)&&r&&l&&null!=a&&a.every((e=>(0,f.isEmpty)(e.colors)&&(0,f.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?null:(0,u.createElement)(h.__experimentalToolsPanel,{className:p()("block-editor-panel-color-gradient-settings",t),label:c?s:void 0,resetAll:()=>{k((()=>{a.forEach((e=>{let{colorValue:t,gradientValue:n,onColorChange:o,onGradientChange:r}=e;t?o():n&&r()}))}))},panelId:b,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,u.createElement)(Fb,{settings:a,panelId:b,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalIsRenderedInSidebar:d,enableAlpha:v}),!!i&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalSpacer,{marginY:4})," ",i))},NE=e=>{const t=db();return(0,u.createElement)(ME,c({},t,e))};var PE=e=>TE.every((t=>e.hasOwnProperty(t)))?(0,u.createElement)(ME,e):(0,u.createElement)(NE,e);const LE=(0,u.createContext)({}),RE=()=>(0,u.useContext)(LE);function AE(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,onFinishEditing:l,onSaveImage:i,children:a}=e;const c=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,l]=(0,u.useState)(),[i,a]=(0,u.useState)(),[c,d]=(0,u.useState)({x:0,y:0}),[p,m]=(0,u.useState)(100),[g,f]=(0,u.useState)(0),h=n/o,[v,b]=(0,u.useState)(h),k=(0,u.useCallback)((()=>{const e=(g+90)%360;let n=h;if(g%180==90&&(n=1/h),0===e)return l(),f(e),b(h),void d({x:-c.y*n,y:c.x*n});const o=new window.Image;o.src=t,o.onload=function(t){const o=document.createElement("canvas");let r=0,i=0;e%180?(o.width=t.target.height,o.height=t.target.width):(o.width=t.target.width,o.height=t.target.height),90!==e&&180!==e||(r=o.width),270!==e&&180!==e||(i=o.height);const a=o.getContext("2d");a.translate(r,i),a.rotate(e*Math.PI/180),a.drawImage(t.target,0,0),o.toBlob((t=>{l(URL.createObjectURL(t)),f(e),b(o.width/o.height),d({x:-c.y*n,y:c.x*n})}))};const r=(0,s.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof r&&(o.crossOrigin=r)}),[g,h]);return(0,u.useMemo)((()=>({editedUrl:r,setEditedUrl:l,crop:i,setCrop:a,position:c,setPosition:d,zoom:p,setZoom:m,rotation:g,setRotation:f,rotateClockwise:k,aspect:v,setAspect:b,defaultAspect:h})),[r,i,c,p,g,k,v,h])}({url:n,naturalWidth:o,naturalHeight:r}),d=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:a,onSaveImage:s,onFinishEditing:c}=e;const{createErrorNotice:d}=(0,g.useDispatch)(hm.store),[p,m]=(0,u.useState)(!1),f=(0,u.useCallback)((()=>{m(!1),c()}),[m,c]),h=(0,u.useCallback)((()=>{m(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,hy()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{s({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{d((0,_.sprintf)((0,_.__)("Could not edit image. %s"),(0,Ri.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{m(!1),c()}))}),[m,t,n,o,r,l,i,s,d,m,c]);return(0,u.useMemo)((()=>({isInProgress:p,apply:h,cancel:f})),[p,h,f])}({id:t,url:n,onSaveImage:i,onFinishEditing:l,...c}),p=(0,u.useMemo)((()=>({...c,...d})),[c,d]);return(0,u.createElement)(LE.Provider,{value:p},a)} + */,e.exports=function(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,l=n in document;if(!l){var i=document.createElement("div");i.setAttribute(n,"return;"),l="function"==typeof i[n]}return!l&&o&&"wheel"===e&&(l=document.implementation.hasFeature("Events.wheel","3.0")),l}},195:function(e,t,n){"use strict";var o=n(3812),r=n(7939);function l(e){var t=0,n=0,o=0,r=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),o=10*t,r=10*n,"deltaY"in e&&(r=e.deltaY),"deltaX"in e&&(o=e.deltaX),(o||r)&&e.deltaMode&&(1==e.deltaMode?(o*=40,r*=40):(o*=800,r*=800)),o&&!t&&(t=o<1?-1:1),r&&!n&&(n=r<1?-1:1),{spinX:t,spinY:n,pixelX:o,pixelY:r}}l.getEventType=function(){return o.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=l},5372:function(e,t,n){"use strict";var o=n(9567);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return n.PropTypes=n,n}},2652:function(e,t,n){e.exports=n(5372)()},9567:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),C(r,e.slice(t,t+o),n)}const w=e=>e;function B(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=new Map,o=[];return n.set(t,o),e.forEach((e=>{const{clientId:t,innerBlocks:r}=e;o.push(t),B(r,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function I(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=[],o=[[t,e]];for(;o.length;){const[e,t]=o.shift();t.forEach((t=>{let{innerBlocks:r,...l}=t;n.push([l.clientId,e]),null!=r&&r.length&&o.push([l.clientId,r])}))}return n}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:w;const n=[],o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n.push([r.clientId,t(r)])}return n}function T(e){const t={},n=[...e];for(;n.length;){const{innerBlocks:e,...o}=n.shift();n.push(...e),t[o.clientId]=!0}return t}function M(e){return x(e,(e=>{const{attributes:t,...n}=e;return n}))}function N(e){return x(e,(e=>e.attributes))}function P(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&k()(e.clientIds,t.clientIds)&&function(e,t){return k()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function L(e,t){const n=e.tree,o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n.set(e.clientId,{});for(const t of r)n.set(t.clientId,Object.assign(n.get(t.clientId),{...e.byClientId.get(t.clientId),attributes:e.attributes.get(t.clientId),innerBlocks:t.innerBlocks.map((e=>n.get(e.clientId)))}))}function R(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=e.tree,r=new Set([]),l=new Set;for(const o of t){let t=n?o:e.parents.get(o);do{if(e.controlledInnerBlocks[t]){l.add(t);break}r.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of r)o.set(e,{...o.get(e)});for(const t of r)o.get(t).innerBlocks=(e.order.get(t)||[]).map((e=>o.get(e)));for(const t of l)o.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>o.get(e)))})}const A=(0,m.pipe)(g.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=new Map(t.attributes),t.attributes.forEach(((n,r)=>{const{name:l}=t.byClientId.get(r);"core/block"===l&&n.ref===e&&t.attributes.set(r,{...n,ref:o})}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:new Map,n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":o.tree=new Map(o.tree),L(o,n.blocks),R(o,n.rootClientId?[n.rootClientId]:[""],!0);break;case"UPDATE_BLOCK":o.tree=new Map(o.tree),o.tree.set(n.clientId,{...o.tree.get(n.clientId),...o.byClientId.get(n.clientId),attributes:o.attributes.get(n.clientId)}),R(o,[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":o.tree=new Map(o.tree),n.clientIds.forEach((e=>{o.tree.set(e,{...o.tree.get(e),attributes:o.attributes.get(e)})})),R(o,n.clientIds,!1);break;case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=T(n.blocks);o.tree=new Map(o.tree),n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),L(o,n.blocks),R(o,n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents.get(e)||""!==t.parents.get(e)&&!o.byClientId.get(t.parents.get(e))||r.push(t.parents.get(e));R(o,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents.get(r)||""!==t.parents.get(r)&&!o.byClientId.get(t.parents.get(r))||e.push(t.parents.get(r));o.tree=new Map(o.tree),n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),R(o,e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),o.tree=new Map(o.tree),R(o,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=new Map(o.tree),R(o,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=[];o.attributes.forEach(((t,r)=>{"core/block"===o.byClientId.get(r).name&&t.ref===n.updatedId&&e.push(r)})),o.tree=new Map(o.tree),e.forEach((e=>{o.tree.set(e,{...o.byClientId.get(e),attributes:o.attributes.get(e),innerBlocks:o.tree.get(e).innerBlocks})})),R(o,e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order.get(n.rootClientId)&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order.get(n.rootClientId)}));let l=r;if(n.blocks.length){l=e(l,{...n,type:"INSERT_BLOCKS",index:0});const r=new Map(l.order);Object.keys(o).forEach((e=>{t.order.get(e)&&r.set(e,t.order.get(e))})),l.order=r,l.tree=new Map(l.tree),Object.keys(o).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&l.tree.set(n,t.tree.get(n))}))}return l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(M(n.blocks)),attributes:new Map(N(n.blocks)),order:B(n.blocks),parents:new Map(I(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(null==t?void 0:t.tree),L(e,n.blocks),e.tree.set("",{innerBlocks:n.blocks.map((t=>e.tree.get(t.clientId)))}),e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var a;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(a=null==o?void 0:o.isPersistentChange)||void 0===a||a;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!P(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return M(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;const{attributes:n,...o}=t.updates;if(0===Object.values(o).length)return e;const r=new Map(e);return r.set(t.clientId,{...e.get(t.clientId),...o}),r}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),M(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return N(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"UPDATE_BLOCK":{if(!e.get(t.clientId)||!t.updates.attributes)return e;const n=new Map(e);return n.set(t.clientId,{...e.get(t.clientId),...t.updates.attributes}),n}case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e.get(t))))return e;let o=!1;const r=new Map(e);for(const l of t.clientIds){var n;const i=Object.entries(t.uniqueByBlock?t.attributes[l]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===i.length)continue;let a=!1;const s=e.get(l),c={};i.forEach((e=>{let[t,n]=e;s[t]!==n&&(a=!0,c[t]=n)})),o=o||a,a&&r.set(l,{...s,...c})}return o?r:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),N(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{var n;const o=B(t.blocks),r=new Map(e);return o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.set("",(null!==(n=e.get(""))&&void 0!==n?n:[]).concat(o[""])),r}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e.get(n)||[],r=B(t.blocks,n),{index:l=o.length}=t,i=new Map(e);return r.forEach(((e,t)=>{i.set(t,e)})),i.set(n,C(o,r.get(n),l)),i}case"MOVE_BLOCKS_TO_POSITION":{var o,r;const{fromRootClientId:n="",toRootClientId:l="",clientIds:i}=t,{index:a=e.get(l).length}=t;if(n===l){const t=e.get(l).indexOf(i[0]),n=new Map(e);return n.set(l,S(e.get(l),t,a,i.length)),n}const s=new Map(e);return s.set(n,null!==(o=null===(r=e.get(n))||void 0===r?void 0:r.filter((e=>!i.includes(e))))&&void 0!==o?o:[]),s.set(l,C(e.get(l),i,a)),s}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=e.get(o);if(!l.length||r===l[0])return e;const i=l.indexOf(r),a=new Map(e);return a.set(o,S(l,i,i-1,n.length)),a}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=n[n.length-1],i=e.get(o);if(!i.length||l===i[i.length-1])return e;const a=i.indexOf(r),s=new Map(e);return s.set(o,S(i,a,a+1,n.length)),s}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=B(t.blocks),r=new Map(e);return t.replacedClientIds.forEach((e=>{r.delete(e)})),o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.forEach(((e,t)=>{const l=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...o.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);r.set(t,l)})),r}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,o)=>{var r;const l=null!==(r=null==e?void 0:e.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==r?r:[];l.length!==e.length&&n.set(o,l)})),n}}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return I(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return I(t.blocks,t.rootClientId||"").forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"MOVE_BLOCKS_TO_POSITION":{const n=new Map(e);return t.clientIds.forEach((e=>{n.set(e,t.toRootClientId||"")})),n}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),I(t.blocks,e.get(t.clientIds[0])).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function O(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}var D=(0,g.combineReducers)({blocks:A,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},isBlockInterfaceHidden:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(){var e,t,n,o;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"SELECTION_CHANGE":return l.clientId?{selectionStart:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.startOffset},selectionEnd:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.endOffset}}:{selectionStart:l.start||r.selectionStart,selectionEnd:l.end||r.selectionEnd};case"RESET_SELECTION":const{selectionStart:i,selectionEnd:a}=l;return{selectionStart:i,selectionEnd:a};case"MULTI_SELECT":const{start:s,end:c}=l;return s===(null===(e=r.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=r.selectionEnd)||void 0===t?void 0:t.clientId)?r:{selectionStart:{clientId:s},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==r||null===(n=r.selectionStart)||void 0===n?void 0:n.clientId,d=null==r||null===(o=r.selectionEnd)||void 0===o?void 0:o.clientId;if(!u&&!d)return r;if(!l.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!l.blocks.some((e=>e.clientId===d)))return{...r,selectionEnd:r.selectionStart}}return{selectionStart:O(r.selectionStart,l),selectionEnd:O(r.selectionEnd,l)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return Object.fromEntries(Object.entries(e).filter((e=>{let[n]=e;return!t.clientIds.includes(n)})));case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;if(!t.settings){if(e.hasOwnProperty(n)){const{[n]:t,...o}=e;return o}return e}return k()(e[n],t.settings)?e:{...e,[n]:t.settings}}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:o,__unstableWithInserter:r,operation:l}=t,i={rootClientId:n,index:o,__unstableWithInserter:r,operation:l};return k()(e,i)?e:i}case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:E,t=arguments.length>1?arguments[1]:void 0;return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:r}=n,l=(0,g.select)(a.store).getActiveBlockVariation(r,o);let i=null!=l&&l.name?`${r}/${l.name}`:r;const s={name:i};return"core/block"===r&&(s.ref=o.ref,i+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[i]:{time:t.time,count:e.insertUsage[i]?e.insertUsage[i].count+1:1,insert:s}}}}),e)}return e},lastBlockAttributesChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return e},editorMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"edit",t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode:e},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_EDITOR_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"SET_BLOCK_VISIBILITY":case"START_TYPING":case"STOP_TYPING":case"UPDATE_BLOCK_LIST_SETTINGS":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":case"REPLACE_INNER_BLOCKS":if(!n.blocks.length)return t;const o=n.blocks.map((e=>e.clientId));return{clientIds:o,source:null===(e=n.meta)||void 0===e?void 0:e.source};case"RESET_BLOCKS":return{}}return t},temporarilyEditingAsBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e},blockVisibility:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e}}),z={};function F(e){return[e]}function V(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o(o,r)=>{let l,i;if("function"==typeof e?(l=e(o),i=e(r)):(l=o[e],i=r[e]),l>i)return"asc"===n?1:-1;if(i>l)return"asc"===n?-1:1;const a=t.findIndex((e=>e===o)),s=t.findIndex((e=>e===r));return a>s?1:s>a?-1:0};function Y(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"asc";return e.concat().sort(q(t,e,n))}const Z=[];function Q(e,t){const n=e.blocks.byClientId.get(t),o="core/social-link";if("web"!==u.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes.get(t),{service:r}=null!=n?n:{};return r?`core/social-link-${r}`:o}return n?n.name:null}function X(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function J(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function ee(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const te=H(((e,t)=>e.blocks.byClientId.has(t)?{...e.blocks.byClientId.get(t),attributes:J(e,t)}:null),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function ne(e,t){var n;const o=t&&Zt(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree.get(o))||void 0===n?void 0:n.innerBlocks)||Z}const oe=H(((e,t)=>({clientId:t,innerBlocks:re(e,t)})),(e=>[e.blocks.order])),re=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return $e(e,t).map((t=>oe(e,t)))}),(e=>[e.blocks.order])),le=H(((e,t)=>{const n=[];for(const o of t)for(const t of $e(e,o))n.push(t,...le(e,[t]));return n}),(e=>[e.blocks.order])),ie=H((e=>{const t=[];for(const n of $e(e))t.push(n,...le(e,[n]));return t}),(e=>[e.blocks.order])),ae=H(((e,t)=>{const n=ie(e);return t?n.reduce(((n,o)=>e.blocks.byClientId.get(o).name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),se=H(((e,t)=>{if(!t)return Z;const n=ie(e).filter((n=>e.blocks.byClientId.get(n).name===t));return n.length>0?n:Z}),(e=>[e.blocks.order,e.blocks.byClientId])),ce=H(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>ee(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),ue=H(((e,t)=>ce(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>ce(e,t)));function de(e,t){return $e(e,t).length}function pe(e){return e.selection.selectionStart}function me(e){return e.selection.selectionEnd}function ge(e){return e.selection.selectionStart.clientId}function fe(e){return e.selection.selectionEnd.clientId}function he(e){const t=Me(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function be(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ke(e){const t=be(e);return t?ee(e,t):null}function _e(e,t){return e.blocks.parents.has(t)?e.blocks.parents.get(t):null}const ye=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents.get(r);)r=e.blocks.parents.get(r),o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),Ee=H((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=ye(e,t,o);return r.map((t=>({id:t,name:Q(e,t)}))).filter((e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})).map((e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function Ce(e,t){let n,o=t;do{n=o,o=e.blocks.parents.get(o)}while(o);return n}function Se(e,t){const n=be(e),o=[...ye(e,t),t],r=[...ye(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=be(e)),void 0===t&&(t=n<0?Pe(e):Le(e)),!t)return null;const o=_e(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r.get(o),i=l.indexOf(t),a=i+1*n;return a<0||a===l.length?null:l[a]}function Be(e,t){return we(e,t,-1)}function Ie(e,t){return we(e,t,1)}function xe(e){return e.initialPosition}const Te=H((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return Z;if(t.clientId===n.clientId)return[t.clientId];const o=_e(e,t.clientId);if(null===o)return Z;const r=$e(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Me(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?Z:Te(e)}const Ne=H((e=>{const t=Me(e);return t.length?t.map((t=>ee(e,t))):Z}),(e=>[...Te.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Pe(e){return Me(e)[0]||null}function Le(e){const t=Me(e);return t[t.length-1]||null}function Re(e,t){return Pe(e)===t}function Ae(e,t){return-1!==Me(e).indexOf(t)}const Oe=H(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=_e(e,n),o=Ae(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function De(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function ze(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Fe(e){const t=pe(e),n=me(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ve(e){const t=pe(e),n=me(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function He(e){return Te(e).some((t=>{const n=Q(e,t);return!(0,a.getBlockType)(n).merge}))}function Ge(e,t){const n=pe(e),o=me(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const r=_e(e,n.clientId);if(r!==_e(e,o.clientId))return!1;const l=$e(e,r);let i,s;l.indexOf(n.clientId)>l.indexOf(o.clientId)?(i=o,s=n):(i=n,s=o);const c=t?s.clientId:i.clientId,u=t?i.clientId:s.clientId,d=Q(e,c);if(!(0,a.getBlockType)(d).merge)return!1;const p=ee(e,u);if(p.name===d)return!0;const m=(0,a.switchToBlockType)(p,d);return m&&m.length}const Ue=e=>{const t=pe(e),n=me(e);if(t.clientId===n.clientId)return Z;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return Z;const o=_e(e,t.clientId);if(o!==_e(e,n.clientId))return Z;const r=$e(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId),[s,c]=l>i?[n,t]:[t,n],u=ee(e,s.clientId),d=(0,a.getBlockType)(u.name),p=ee(e,c.clientId),m=(0,a.getBlockType)(p.name),g=u.attributes[s.attributeKey],f=p.attributes[c.attributeKey],h=d.attributes[s.attributeKey],v=m.attributes[c.attributeKey];let b=(0,$.create)({html:g,...K(h)}),k=(0,$.create)({html:f,...K(v)});return b=(0,$.remove)(b,0,s.offset),k=(0,$.remove)(k,c.offset,k.text.length),[{...u,attributes:{...u.attributes,[s.attributeKey]:(0,$.toHTMLString)({value:b,...K(h)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,$.toHTMLString)({value:k,...K(v)})}}]};function $e(e,t){return e.blocks.order.get(t||"")||Z}function je(e,t){return $e(e,_e(e,t)).indexOf(t)}function We(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Ke(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return $e(e,t).some((t=>We(e,t)||Ae(e,t)||n&&Ke(e,t,n)))}function qe(e,t){if(!t)return!1;const n=Me(e),o=n.indexOf(t);return o>-1&&ont(e,t)))}function rt(){return W()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const lt=H((e=>{let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=_e(e,l)||void 0,n=je(e,r.clientId)+1):n=$e(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionPoint,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function it(e){return null!==e.insertionPoint}function at(e){return e.template.isValid}function st(e){return e.settings.template}function ct(e,t){var n,o,r;return t?null!==(n=null===(o=Dt(e,t))||void 0===o?void 0:o.templateLock)&&void 0!==n&&n:null!==(r=e.settings.templateLock)&&void 0!==r&&r}const ut=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},dt=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,a.getBlockType)(t),!n)return!1;const{allowedBlockTypes:r}=zt(e),l=ut(r,t,!0);if(!l)return!1;const i=!!ct(e,o);if(i)return!1;const c=Dt(e,o);if(o&&void 0===c)return!1;const u=null==c?void 0:c.allowedBlocks,d=ut(u,t),p=n.parent,m=Q(e,o),g=ut(p,m);let f=!0;const h=n.ancestor;if(h){f=[o,...ye(e,o)].some((t=>ut(h,Q(e,t))))}const v=f&&(null===d&&null===g||!0===d||!0===g);return v?(0,s.applyFilters)("blockEditor.__unstableCanInsertBlockType",v,n,o,{getBlock:ee.bind(null,e),getBlockParentsByBlockName:Ee.bind(null,e)}):v},pt=H(dt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId.get(n),e.settings.allowedBlockTypes,e.settings.templateLock]));function mt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>pt(e,Q(e,t),n)))}function gt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=J(e,t);if(null===o)return!0;const{lock:r}=o,l=!!ct(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function ft(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>gt(e,t,n)))}function ht(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=J(e,t);if(null===o)return;const{lock:r}=o,l="all"===ct(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function vt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ht(e,t,n)))}function bt(e,t){const n=J(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function kt(e,t){var n;return!!(0,a.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function _t(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const yt=(e,t,n)=>!!(0,a.hasBlockSupport)(t,"inserter",!0)&&dt(e,t.name,n),Et=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=_t(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:Ct(r,l)}},Ct=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},St=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let r=!1;(0,a.hasBlockSupport)(t.name,"multiple",!0)||(r=ce(e,ie(e)).some((e=>{let{name:n}=e;return n===t.name})));const{time:l,count:i=0}=_t(e,o)||{},s={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:r,frecency:Ct(l,i)};if("transform"===n)return s;const c=(0,a.getBlockVariations)(t.name,"inserter");return{...s,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},wt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=St(e,{buildScope:"inserter"}),o=/^\s*)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,r=t=>{let n=U;if("web"===u.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,r=(0,a.getBlockType)(t+o);r&&(n=r.icon)}}const r=`core/block/${t.id}`,{time:l,count:i=0}=_t(e,r)||{},s=Ct(l,i);return{id:r,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:s}},l=(0,a.getBlockTypes)().filter((n=>yt(e,n,t))).map(n),i=dt(e,"core/block",t)?$t(e).map(r):[],s=l.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=Et(e,n);t.push(...o.map(r))}return t}),[]),c=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=s.reduce(c,{core:[],noncore:[]}),m=[...d,...p];return[...m,...i]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,$t(e),(0,a.getBlockTypes)()])),Bt=H((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=Array.isArray(t)?t:[t],[l]=r,i=St(e,{buildScope:"transform"}),s=(0,a.getBlockTypes)().filter((t=>yt(e,t,o))).map(i),c=Object.fromEntries(Object.entries(s).map((e=>{let[,t]=e;return[t.name,t]})));c["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,_.__)("Unwrap"),icon:null===(n=c[null==l?void 0:l.name])||void 0===n?void 0:n.icon};const u=(0,a.getPossibleBlockTransformations)(r).reduce(((e,t)=>("*"===t?e.push(c["*"]):c[null==t?void 0:t.name]&&e.push(c[t.name]),e)),[]);return Y(u,(e=>c[e.name].frecency),"desc")}),((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,a.getBlockTypes)()])),It=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,a.getBlockTypes)().some((n=>yt(e,n,t)));if(n)return!0;const o=dt(e,"core/block",t)&&$t(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,$t(e),(0,a.getBlockTypes)()])),xt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,a.getBlockTypes)().filter((n=>yt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,a.getBlockTypes)()])),Tt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return W()('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),xt(e,t)}),((e,t)=>[...xt.getDependants(e,t)])),Mt=H((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(ee(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree.get(t)])),Nt=H(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,a.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),Pt=H((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=zt(e),o=t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return Nt(e,n)})),r=o.filter((e=>{let{blocks:t}=e;return((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!ut(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(t,n)}));return r}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),Lt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Pt(e),o=n.filter((n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return pt(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId.get(t)])),Rt=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return Z;const o=Lt(e,n),r=Array.isArray(t)?t:[t],l=o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}));return 0===l.length?Z:l}),((e,t,n)=>[...Lt.getDependants(e,n)])),At=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return W()('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),Rt(e,t,n)}),((e,t,n)=>[...Lt.getDependants(e,n)])),Ot=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return Z;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Zt(e,n)})))return Z;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return Rt(e,o,n)}),((e,t,n)=>[...Rt.getDependants(e,n)]));function Dt(e,t){return e.blockListSettings[t]}function zt(e){return e.settings}function Ft(e){return e.blocks.isPersistentChange}const Vt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),Ht=H(((e,t)=>{var n;const o=$t(e).find((e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[$t(e)]));function Gt(e){return e.blocks.isIgnoredChange}function Ut(e){return e.lastBlockAttributesChange}function $t(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:Z}function jt(e){return"navigation"===e.editorMode}function Wt(e){return e.editorMode}function Kt(e){return e.hasBlockMovingClientId}function qt(e){return!!e.automaticChangeStatus}function Yt(e,t){return e.highlightedBlock===t}function Zt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Qt=H(((e,t)=>{if(!t.length)return null;const n=be(e);if(t.includes(Q(e,n)))return n;const o=Me(e),r=Ee(e,n||o[0],t);return r?r[r.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Xt(e,t,n){var o;const{lastBlockInserted:r}=e;return(null===(o=r.clientIds)||void 0===o?void 0:o.includes(t))&&r.source===n}function Jt(e,t){var n,o;return null===(n=null===(o=e.blockVisibility)||void 0===o?void 0:o[t])||void 0===n||n}const en=H((e=>new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])))),(e=>[e.blockVisibility])),tn=H(((e,t)=>{let n,o=t;for(;e.blocks.parents.has(o);)o=e.blocks.parents.get(o),o&&"contentOnly"===ct(e,o)&&(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function nn(e){return e.temporarilyEditingAsBlocks}function on(e,t){if(!bt(e,t))return!0;const n=Wt(e);if("zoom-out"===n&&t&&!_e(e,t))return!0;const o=(0,a.hasBlockSupport)(Q(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!o&&Zt(e,t))&&!We(e,t)&&!Ke(e,t,!0)}function rn(e,t){let n=e.blocks.parents.get(t);for(;n;){if(on(e,n))return!0;n=e.blocks.parents.get(n)}return!1}const ln=["inserterMediaCategories","blockInspectorAnimation"];function an(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e;if(t&&"web"===u.Platform.OS){n={};for(const t in e)ln.includes(t)||(n[t]=e[t])}return{type:"UPDATE_SETTINGS",settings:n}}function sn(){return{type:"HIDE_BLOCK_INTERFACE"}}function cn(){return{type:"SHOW_BLOCK_INTERFACE"}}function un(e){return e.isBlockInterfaceHidden}function dn(e){var t;return null==e||null===(t=e.lastBlockInserted)||void 0===t?void 0:t.clientIds}var pn=window.wp.a11y;const mn="†";function gn(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(mn)}))}const fn=e=>Array.isArray(e)?e:[e],hn=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(vn(e))},vn=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getTemplate(),l=n.getTemplateLock(),i=!r||"all"!==l||(0,a.doBlocksMatchTemplate)(e,r);if(i!==n.isValidTemplate())return o.setTemplateValidity(i),i};function bn(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function kn(e){return W()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function _n(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:fn(e),attributes:t,uniqueByBlock:n}}function yn(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function En(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Cn=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n=>{let{select:o,dispatch:r}=n;const l=o.getPreviousBlockClientId(e);if(l)r.selectBlock(l,-1);else if(t){const t=o.getBlockRootClientId(e);t&&r.selectBlock(t,-1)}}},Sn=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function wn(){return{type:"START_MULTI_SELECT"}}function Bn(){return{type:"STOP_MULTI_SELECT"}}const In=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o=>{let{select:r,dispatch:l}=o;if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;l({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,pn.speak)((0,_.sprintf)((0,_._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function xn(){return{type:"CLEAR_SELECTED_BLOCK"}}function Tn(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function Mn(e,t){var n,o;const r=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,a.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!r[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:l={}}=e,i=r[n];return{...e,attributes:{...l,className:`${o||""} is-style-${i}`.trim()}}}))}const Nn=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0;return l=>{let{select:i,dispatch:a}=l;e=fn(e),t=Mn(fn(t),i.getSettings());const s=i.getBlockRootClientId(e[0]);for(let e=0;e{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function Pn(e,t){return Nn(e,t)}const Ln=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:fn(t),rootClientId:n})},Rn=Ln("MOVE_BLOCKS_DOWN"),An=Ln("MOVE_BLOCKS_UP"),On=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return r=>{let{select:l,dispatch:i}=r;if(l.canMoveBlocks(e,t)){if(t!==n){if(!l.canRemoveBlocks(e,t))return;if(!l.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function Dn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return On([e],t,n,o)}function zn(e,t,n,o,r){return Fn([e],t,n,o,0,r)}const Fn=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:a,dispatch:s}=i;null!==r&&"object"==typeof r&&(l=r,r=0,W()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=Mn(fn(e),a.getSettings());const c=[];for(const t of e){a.canInsertBlockType(t.name,n)&&c.push(t)}c.length&&s({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})}};function Vn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o,operation:r}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o,operation:r}}const Hn=()=>e=>{let{select:t,dispatch:n}=e;t.isBlockInsertionPointVisible()&&n({type:"HIDE_INSERTION_POINT"})};function Gn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const Un=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),r=t.getTemplate(),l=(0,a.synchronizeBlocksWithTemplate)(o,r);n.resetBlocks(l)},$n=e=>t=>{let{registry:n,select:o,dispatch:r}=t;const l=o.getSelectionStart(),i=o.getSelectionEnd();if(l.clientId===i.clientId)return;if(!l.attributeKey||!i.attributeKey||void 0===l.offset||void 0===i.offset)return!1;const s=o.getBlockRootClientId(l.clientId);if(s!==o.getBlockRootClientId(i.clientId))return;const c=o.getBlockOrder(s);let u,d;c.indexOf(l.clientId)>c.indexOf(i.clientId)?(u=i,d=l):(u=l,d=i);const p=e?d:u,m=o.getBlock(p.clientId),g=(0,a.getBlockType)(m.name);if(!g.merge)return;const f=u,h=d,v=o.getBlock(f.clientId),b=(0,a.getBlockType)(v.name),k=o.getBlock(h.clientId),_=(0,a.getBlockType)(k.name),y=v.attributes[f.attributeKey],E=k.attributes[h.attributeKey],C=b.attributes[f.attributeKey],S=_.attributes[h.attributeKey];let w=(0,$.create)({html:y,...K(C)}),B=(0,$.create)({html:E,...K(S)});w=(0,$.remove)(w,f.offset,w.text.length),B=(0,$.insert)(B,mn,0,h.offset);const I=(0,a.cloneBlock)(v,{[f.attributeKey]:(0,$.toHTMLString)({value:w,...K(C)})}),x=(0,a.cloneBlock)(k,{[h.attributeKey]:(0,$.toHTMLString)({value:B,...K(S)})}),T=e?I:x,M=v.name===k.name?[T]:(0,a.switchToBlockType)(T,g.name);if(!M||!M.length)return;let N;if(e){const e=M.pop();N=g.merge(e.attributes,x.attributes)}else{const e=M.shift();N=g.merge(I.attributes,e.attributes)}const P=gn(N),L=N[P],R=(0,$.create)({html:L,...K(g.attributes[P])}),A=R.text.indexOf(mn),O=(0,$.remove)(R,A,A+1),D=(0,$.toHTMLString)({value:O,...K(g.attributes[P])});N[P]=D;const z=o.getSelectedBlockClientIds(),F=[...e?M:[],{...m,attributes:{...m.attributes,...N}},...e?[]:M];n.batch((()=>{r.selectionChange(m.clientId,P,A,A),r.replaceBlocks(z,F,0,o.getSelectedBlocksInitialCaretPosition())}))},jn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();if(o.clientId===r.clientId)return;if(!o.attributeKey||!r.attributeKey||void 0===o.offset||void 0===r.offset)return;const l=t.getBlockRootClientId(o.clientId);if(l!==t.getBlockRootClientId(r.clientId))return;const i=t.getBlockOrder(l);let s,c;i.indexOf(o.clientId)>i.indexOf(r.clientId)?(s=r,c=o):(s=o,c=r);const u=s,d=c,p=t.getBlock(u.clientId),m=(0,a.getBlockType)(p.name),g=t.getBlock(d.clientId),f=(0,a.getBlockType)(g.name),h=p.attributes[u.attributeKey],v=g.attributes[d.attributeKey],b=m.attributes[u.attributeKey],k=f.attributes[d.attributeKey];let _=(0,$.create)({html:h,...K(b)}),y=(0,$.create)({html:v,...K(k)});_=(0,$.remove)(_,u.offset,_.text.length),y=(0,$.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,$.toHTMLString)({value:_,...K(b)})}},(0,a.createBlock)((0,a.getDefaultBlockName)()),{...g,attributes:{...g.attributes,[d.attributeKey]:(0,$.toHTMLString)({value:y,...K(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},Wn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},Kn=(e,t)=>n=>{let{registry:o,select:r,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[s,c]=i,u=r.getBlock(s),d=(0,a.getBlockType)(u.name);if(!d)return;const p=r.getBlock(c);if(d&&!d.merge){const e=(0,a.switchToBlockType)(p,d.name);if(1!==(null==e?void 0:e.length))return void l.selectBlock(u.clientId);const[t]=e;return t.innerBlocks.length<1?void l.selectBlock(u.clientId):void o.batch((()=>{l.insertBlocks(t.innerBlocks,void 0,s),l.removeBlock(c),l.selectBlock(t.innerBlocks[0].clientId)}))}const m=(0,a.getBlockType)(p.name),{clientId:g,attributeKey:f,offset:h}=r.getSelectionStart(),v=(g===s?d:m).attributes[f],b=(g===s||g===c)&&void 0!==f&&void 0!==h&&!!v;v||("number"==typeof f?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof f):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const k=(0,a.cloneBlock)(u),_=(0,a.cloneBlock)(p);if(b){const e=g===s?k:_,t=e.attributes[f],n=(0,$.insert)((0,$.create)({html:t,...K(v)}),mn,h,h);e.attributes[f]=(0,$.toHTMLString)({value:n,...K(v)})}const y=u.name===p.name?[_]:(0,a.switchToBlockType)(_,u.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=gn(E),t=E[e],n=(0,$.create)({html:t,...K(d.attributes[e])}),o=n.text.indexOf(mn),r=(0,$.remove)(n,o,o+1),i=(0,$.toHTMLString)({value:r,...K(d.attributes[e])});E[e]=i,l.selectionChange(u.clientId,e,o,o)}l.replaceBlocks([u.clientId,p.clientId],[{...u,attributes:{...u.attributes,...E}},...y.slice(1)],0)},qn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=fn(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0],t),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function Yn(e,t){return qn([e],t)}function Zn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function Qn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Xn(){return{type:"START_TYPING"}}function Jn(){return{type:"STOP_TYPING"}}function eo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function to(){return{type:"STOP_DRAGGING_BLOCKS"}}function no(){return W()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function oo(){return W()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function ro(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const lo=(e,t,n)=>o=>{let{dispatch:r}=o;const l=(0,a.getDefaultBlockName)();if(!l)return;const i=(0,a.createBlock)(l,e);return r.insertBlock(i,n,t)};function io(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function ao(e){return an(e,!0)}function so(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function co(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function uo(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const po=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n((()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},mo=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n.__unstableSetEditorMode(e?"navigation":"edit")}},go=e=>t=>{let{dispatch:n,select:o}=t;if("zoom-out"===e){const e=o.getBlockSelectionStart();e&&n.selectBlock(o.getBlockHierarchyRootClientId(e))}n({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,pn.speak)((0,_.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):"edit"===e?(0,pn.speak)((0,_.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,pn.speak)((0,_.__)("You are currently in zoom-out mode."))},fo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,pn.speak)((0,_.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},ho=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;const l=o.getBlocksByClientId(e);if(l.some((e=>!e)))return;const i=l.map((e=>e.name));if(i.some((e=>!(0,a.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),c=fn(e),u=o.getBlockIndex(c[c.length-1]),d=l.map((e=>(0,a.__experimentalCloneSanitizedBlock)(e)));return r.insertBlocks(d,u+1,s,t),d.length>1&&t&&r.multiSelect(d[0].clientId,d[d.length-1].clientId),d.map((e=>e.clientId))}},vo=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l)},bo=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l+1)};function ko(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const _o=e=>async t=>{let{dispatch:n}=t;n(ko(e,!0)),await new Promise((e=>setTimeout(e,150))),n(ko(e,!1))};function yo(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function Eo(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function Co(e){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e}}const So="core/block-editor";var wo=window.wp.privateApis;const{lock:Bo,unlock:Io}=(0,wo.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/block-editor"),xo={reducer:D,selectors:e,actions:l},To=(0,g.createReduxStore)(So,{...xo,persist:["preferences"]}),Mo=(0,g.registerStore)(So,{...xo,persist:["preferences"]});Io(Mo).registerPrivateActions(t),Io(Mo).registerPrivateSelectors(r);const No={name:"",isSelected:!1},Po=(0,u.createContext)(No),{Provider:Lo}=Po;function Ro(){return(0,u.useContext)(Po)}function Ao(){const{isSelected:e,clientId:t,name:n}=Ro();return(0,g.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(To);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function Oo(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:r=!1}=e;const l=function(e,t){const n=Ao(),{clientId:o}=Ro(),r=(0,g.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:r}=e(To),{hasBlockSupport:l}=e(a.store);return t&&l(n(o),"__experimentalExposeControlsToChildren",!1)&&r(o)}),[t,o]);var l;return n?null===(l=v[e])||void 0===l?void 0:l.Fill:r?v.parent.Fill:null}(t,r);return l?(0,u.createElement)(h.__experimentalStyleProvider,{document:document},(0,u.createElement)(l,null,(e=>{const r=(0,f.isEmpty)(e)?null:e;return(0,u.createElement)(h.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,u.createElement)(h.ToolbarGroup,{controls:n}),o)}))):null}function Do(e){let{group:t="default",...n}=e;const o=(0,u.useContext)(h.__experimentalToolbarContext),r=v[t].Slot,l=(0,h.__experimentalUseSlotFills)(r.__unstableName);return Boolean(l&&l.length)?"default"===t?(0,u.createElement)(r,c({},n,{bubblesVirtually:!0,fillProps:o})):(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(r,c({},n,{bubblesVirtually:!0,fillProps:o}))):null}const zo=Oo;zo.Slot=Do;const Fo=e=>(0,u.createElement)(Oo,c({group:"inline"},e));Fo.Slot=e=>(0,u.createElement)(Do,c({group:"inline"},e));var Vo=zo;var Ho=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"}));var Go=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"}));var Uo=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"}));var $o=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"}));var jo=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z"}));var Wo=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"}));var Ko=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"}));function qo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function Yo(e,t,n,o){var r,l;let i="";return null!=t&&null!==(r=t[n])&&void 0!==r&&null!==(l=r.spacingStyles)&&void 0!==l&&l.length&&o&&t[n].spacingStyles.forEach((t=>{i+=`${qo(e,t.selector.trim())} { `,i+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||o}`})).join("; "),i+="; }"})),i}function Zo(e){const{contentSize:t,wideSize:n,type:o="default"}=e,r={},l=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return l.test(t)&&"constrained"===o&&(r.none=(0,_.sprintf)((0,_.__)("Max %s wide"),t)),l.test(n)&&(r.wide=(0,_.sprintf)((0,_.__)("Max %s wide"),n)),r}const Qo=(0,u.createContext)({refs:new Map,callbacks:new Map});function Xo(e){let{children:t}=e;const n=(0,u.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,u.createElement)(Qo.Provider,{value:n},t)}function Jo(e){const{refs:t,callbacks:n}=(0,u.useContext)(Qo),o=(0,u.useRef)();return(0,u.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,m.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function er(e){const{refs:t}=(0,u.useContext)(Qo),n=(0,u.useRef)();return n.current=e,(0,u.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function tr(e){const{callbacks:t}=(0,u.useContext)(Qo),n=er(e),[o,r]=(0,u.useState)(null);return(0,u.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}function nr(e){return!(null==e||!e.includes)&&("0"===e||e.includes("var:preset|spacing|"))}function or(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function rr(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}const lr={all:(0,_.__)("All sides"),top:(0,_.__)("Top"),bottom:(0,_.__)("Bottom"),left:(0,_.__)("Left"),right:(0,_.__)("Right"),mixed:(0,_.__)("Mixed"),vertical:(0,_.__)("Vertical"),horizontal:(0,_.__)("Horizontal")},ir={top:void 0,right:void 0,bottom:void 0,left:void 0},ar=["top","right","bottom","left"];function sr(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function cr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ar;return Object.values(e).length>=1&&Object.values(e).length1}function ur(e){return null!=e&&Object.values(e).filter((e=>!!e)).length>0}var dr=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"}));const pr=["color","border","dimensions","typography","spacing"],mr={"color.palette":e=>e.colors,"color.gradients":e=>e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},gr={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"};function fr(e){const{name:t,clientId:n}=Ro();return(0,g.useSelect)((o=>{if(pr.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let r=(0,s.applyFilters)("blockEditor.useSetting.before",void 0,e,n,t);if(void 0!==r)return r;const l=(e=>gr[e]||e)(e),i=[n,...o(To).getBlockParents(n,!0)];for(const e of i){const n=o(To).getBlockName(e);if((0,a.hasBlockSupport)(n,"__experimentalSettings",!1)){var c;const n=o(To).getBlockAttributes(e);if(r=null!==(c=(0,f.get)(n,`settings.blocks.${t}.${l}`))&&void 0!==c?c:(0,f.get)(n,`settings.${l}`),void 0!==r)break}}const u=o(To).getSettings();if(void 0===r){var d;const e=`__experimentalFeatures.${l}`,n=`__experimentalFeatures.blocks.${t}.${l}`;r=null!==(d=(0,f.get)(u,n))&&void 0!==d?d:(0,f.get)(u,e)}var p,m;if(void 0!==r)return a.__EXPERIMENTAL_PATHS_WITH_MERGE[l]?null!==(p=null!==(m=r.custom)&&void 0!==m?m:r.theme)&&void 0!==p?p:r.default:r;const g=mr[l]?mr[l](u):void 0;return void 0!==g?g:"typography.dropCap"===l||void 0}),[t,n,e])}const hr={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1}};function vr(e){var t,n,o,r,l;let{spacingSizes:i,value:a,side:s,onChange:c,isMixed:d=!1,type:m,minimumCustomValue:f,onMouseOver:v,onMouseOut:b}=e;a=function(e,t){if(nr(e))return e;const n=t.find((t=>String(t.size)===String(e)));return null!=n&&n.slug?`var:preset|spacing|${n.slug}`:e}(a,i);let k=i;const y=i.length<=8,E=(0,g.useSelect)((e=>{const t=e(To).getSettings();return null==t?void 0:t.disableCustomSpacingSizes})),[C,S]=(0,u.useState)(!E&&void 0!==a&&!nr(a)),w=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["px","em","rem"]});let B=null;!y&&!C&&void 0!==a&&(!nr(a)||nr(a)&&d)?(k=[...i,{name:d?(0,_.__)("Mixed"):(0,_.sprintf)((0,_.__)("Custom (%s)"),a),slug:"custom",size:a}],B=k.length-1):d||(B=C?function(e,t){if(!nr(e))return e;const n=rr(e),o=t.find((e=>String(e.slug)===n));return null==o?void 0:o.size}(a,i):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":rr(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(a,i));const I=(0,u.useMemo)((()=>(0,h.__experimentalParseQuantityAndUnitFromRawValue)(B)),[B])[1]||w[0].value,x=e=>{var t;return void 0===a||null===(t=i[e])||void 0===t?void 0:t.name},T=parseFloat(B,10),M=(e,t)=>{var n;const o=parseInt(e,10);if("selectList"===t){if(0===o)return;if(1===o)return"0"}else if(0===o)return"0";return`var:preset|spacing|${null===(n=i[e])||void 0===n?void 0:n.slug}`},N=d?(0,_.__)("Mixed"):null,P=d?(0,_.__)("Mixed"):x(B),L=k.map(((e,t)=>({key:t,name:e.name}))),R=i.map(((e,t)=>({value:t,label:void 0}))),A=(0,_.sprintf)((0,_.__)("%1$s %2$s"),lr[s],null==m?void 0:m.toLowerCase()),O=y&&!C&&void 0!==P;return(0,u.createElement)(u.Fragment,null,"all"!==s&&(0,u.createElement)(h.__experimentalHStack,{className:"components-spacing-sizes-control__side-labels"},(0,u.createElement)(h.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__side-label"},lr[s]),O&&(0,u.createElement)(h.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-single"},P)),"all"===s&&O&&(0,u.createElement)(h.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-all"},P),!E&&(0,u.createElement)(h.Button,{label:C?(0,_.__)("Use size preset"):(0,_.__)("Set custom size"),icon:dr,onClick:()=>{S(!C)},isPressed:C,isSmall:!0,className:p()({"components-spacing-sizes-control__custom-toggle-all":"all"===s,"components-spacing-sizes-control__custom-toggle-single":"all"!==s}),iconSize:24}),C&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalUnitControl,{onMouseOver:v,onMouseOut:b,onFocus:v,onBlur:b,onChange:e=>c((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:B,units:w,min:f,placeholder:N,disableUnits:d,label:A,hideLabelFromVision:!0,className:"components-spacing-sizes-control__custom-value-input",size:"__unstable-large"}),(0,u.createElement)(h.RangeControl,{onMouseOver:v,onMouseOut:b,onFocus:v,onBlur:b,value:T,min:0,max:null!==(t=null===(n=hr[I])||void 0===n?void 0:n.max)&&void 0!==t?t:10,step:null!==(o=null===(r=hr[I])||void 0===r?void 0:r.steps)&&void 0!==o?o:.1,withInputField:!1,onChange:e=>{c([e,I].join(""))},className:"components-spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0})),y&&!C&&(0,u.createElement)(h.RangeControl,{onMouseOver:v,onMouseOut:b,className:"components-spacing-sizes-control__range-control",value:B,onChange:e=>c(M(e)),onMouseDown:e=>{var t;(null==e||null===(t=e.nativeEvent)||void 0===t?void 0:t.offsetX)<35&&void 0===a&&c("0")},withInputField:!1,"aria-valuenow":B,"aria-valuetext":null===(l=i[B])||void 0===l?void 0:l.name,renderTooltipContent:x,min:0,max:i.length-1,marks:R,label:A,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:v,onBlur:b}),!y&&!C&&(0,u.createElement)(h.CustomSelectControl,{className:"components-spacing-sizes-control__custom-select-control",value:L.find((e=>e.key===B))||"",onChange:e=>{c(M(e.selectedItem.key,"selectList"))},options:L,label:A,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0,size:"__unstable-large",onMouseOver:v,onMouseOut:b,onFocus:v,onBlur:b}))}function br(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s}=e;const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return sr(Object.values(e))}(n),d=ur(n)&&cr(n,o);return(0,u.createElement)(vr,{value:c,onChange:e=>{const r=(0,h.__experimentalApplyValueToSides)(n,e,o);t(r)},side:"all",spacingSizes:r,isMixed:d,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s})}function kr(e){let{values:t,sides:n,onChange:o,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s}=e;const c=null!=n&&n.length?ar.filter((e=>n.includes(e))):ar,d=e=>n=>{const r={...t};r[e]=n,o(r)};return(0,u.createElement)(u.Fragment,null,c.map((e=>(0,u.createElement)(vr,{value:t[e],label:lr[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,onChange:d(e),spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s}))))}const _r=["vertical","horizontal"];function yr(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s}=e;const c=e=>o=>{if(!t)return;const r={...n};"vertical"===e&&(r.top=o,r.bottom=o),"horizontal"===e&&(r.left=o,r.right=o),t(r)},d=null!=o&&o.length?_r.filter((e=>o.includes(e))):_r;return(0,u.createElement)(u.Fragment,null,d.map((e=>{const t="vertical"===e?n.top:n.left;return(0,u.createElement)(vr,{value:t,onChange:c(e),label:lr[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s})})))}var Er=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"}));var Cr=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function Sr(e){let{isLinked:t,onClick:n}=e;const o=t?(0,_.__)("Unlink sides"):(0,_.__)("Link sides");return(0,u.createElement)(h.Tooltip,{text:o},(0,u.createElement)("span",{className:"component-spacing-sizes-control__linked-button"},(0,u.createElement)(h.Button,{isSmall:!0,icon:t?Er:Cr,iconSize:24,"aria-label":o,onClick:n})))}function wr(e){let{inputProps:t,onChange:n,label:o=(0,_.__)("Spacing Control"),values:r,sides:l,splitOnAxis:i=!1,useSelect:a,minimumCustomValue:s=0,onMouseOver:d,onMouseOut:m}=e;const g=[{name:0,slug:"0",size:0},...fr("spacing.spacingSizes")||[]];g.length>8&&g.unshift({name:(0,_.__)("Default"),slug:"default",size:void 0});const f=r||ir,v=ur(r),b=1===(null==l?void 0:l.length),[k,y]=(0,u.useState)(!v||!cr(f,l)||b),E={...t,onChange:e=>{const t={...r,...e};n(t)},isLinked:k,sides:l,values:f,spacingSizes:g,useSelect:a,type:o,minimumCustomValue:s,onMouseOver:d,onMouseOut:m};return(0,u.createElement)("fieldset",{className:p()("component-spacing-sizes-control",{"is-unlinked":!k})},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},o),!b&&(0,u.createElement)(Sr,{onClick:()=>{y(!k)},isLinked:k}),k&&(0,u.createElement)(br,c({"aria-label":o},E)),!k&&i&&(0,u.createElement)(yr,E),!k&&!i&&(0,u.createElement)(kr,E))}window.wp.warning;const Br=(0,h.createSlotFill)("InspectorControls"),Ir=(0,h.createSlotFill)("InspectorAdvancedControls"),xr=(0,h.createSlotFill)("InspectorControlsBorder"),Tr=(0,h.createSlotFill)("InspectorControlsColor"),Mr=(0,h.createSlotFill)("InspectorControlsDimensions"),Nr=(0,h.createSlotFill)("InspectorControlsPosition"),Pr=(0,h.createSlotFill)("InspectorControlsTypography");var Lr={default:Br,advanced:Ir,border:xr,color:Tr,dimensions:Mr,list:(0,h.createSlotFill)("InspectorControlsListView"),settings:Br,styles:(0,h.createSlotFill)("InspectorControlsStyles"),typography:Pr,position:Nr};function Rr(e){var t;let{children:n,group:o="default",__experimentalGroup:r}=e;r&&(W()("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),o=r);const l=Ao(),i=null===(t=Lr[o])||void 0===t?void 0:t.Fill;return i?l?(0,u.createElement)(h.__experimentalStyleProvider,{document:document},(0,u.createElement)(i,null,(e=>{const t=(0,f.isEmpty)(e)?null:e;return(0,u.createElement)(h.__experimentalToolsPanelContext.Provider,{value:t},n)}))):null:("undefined"!=typeof process&&process.env,null)}const Ar=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.fromEntries(Object.entries((0,f.mapValues)(e,Ar)).filter((e=>{let[,t]=e;return Boolean(t)})));return(0,f.isEmpty)(t)?void 0:t};function Or(e){return"object"==typeof e?{...Object.fromEntries(Object.entries(e).map((e=>{let[t,n]=e;return[t,Or(n)]})))}:e}function Dr(e,t,n){const o=function(e){return Array.isArray(e)?e:"number"==typeof e?[e.toString()]:[e]}(t),r=e?Or(e):{};return o.reduce(((e,t,r)=>(void 0===e[t]&&(e[t]={}),r===o.length-1&&(e[t]=n),e[t])),r),r}function zr(e,t,n,o,r,l){var i;if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let a=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var s;a=null===(s=o[r])||void 0===s?void 0:s.attributes}let c=n;return Object.entries(e).forEach((e=>{let[n,o]=e;o&&t[n].forEach((e=>{const t=(0,f.get)(a,e);t&&(c={...c,attributes:Dr(c.attributes,e,t)})}))})),c}function Fr(e,t,n){const o=(0,a.getBlockSupport)(e,t),r=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}function Vr(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,g.useDispatch)(To),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:s}=(0,g.useSelect)(To),c=a(),d=(0,u.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=s()?i():[c];n.forEach((n=>{const{style:o}=l(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:Ar(r.style)},t[n]=r})),r(n,t,!0)}),[Ar,l,i,s,c,r]);return(0,u.createElement)(h.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:c,panelId:c,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Hr(e){let{Slot:t,...n}=e;const o=(0,u.useContext)(h.__experimentalToolsPanelContext);return(0,u.createElement)(t,c({},n,{fillProps:o,bubblesVirtually:!0}))}function Gr(e){var t;let{__experimentalGroup:n,group:o="default",label:r,...l}=e;n&&(W()("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),o=n);const i=null===(t=Lr[o])||void 0===t?void 0:t.Slot,a=(0,h.__experimentalUseSlot)(null==i?void 0:i.__unstableName),s=(0,h.__experimentalUseSlotFills)(null==i?void 0:i.__unstableName);if(!i||!a)return"undefined"!=typeof process&&process.env,null;return Boolean(s&&s.length)?r?(0,u.createElement)(Vr,{group:o,label:r},(0,u.createElement)(Hr,c({},l,{Slot:i}))):(0,u.createElement)(i,c({},l,{bubblesVirtually:!0})):null}const Ur=Rr;Ur.Slot=Gr;const $r=e=>(0,u.createElement)(Rr,c({},e,{group:"advanced"}));$r.Slot=e=>(0,u.createElement)(Gr,c({},e,{group:"advanced"})),$r.slotName="InspectorAdvancedControls";var jr=Ur,Wr=window.wp.isShallowEqual,Kr=n.n(Wr);var qr=function(e){return(0,m.useRefEffect)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])};const Yr=Number.MAX_SAFE_INTEGER;var Zr=(0,u.forwardRef)((function(e,t){let{clientId:n,bottomClientId:o,children:r,__unstableRefreshSize:l,__unstableCoverTarget:i=!1,__unstablePopoverSlot:a,__unstableContentRef:s,shift:d=!0,...g}=e;const f=tr(n),v=tr(null!=o?o:n),b=(0,m.useMergeRefs)([t,qr(s)]),[k,_]=(0,u.useReducer)((e=>(e+1)%Yr),0);(0,u.useLayoutEffect)((()=>{if(!f)return;const e=new window.MutationObserver(_);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}}),[f]);const y=(0,u.useMemo)((()=>k<0||!f||v!==f?{}:{position:"absolute",width:f.offsetWidth,height:f.offsetHeight}),[f,v,l,k]),E=(0,u.useMemo)((()=>{if(!(k<0||!f||o&&!v))return{getBoundingClientRect(){var e,t,n,o;const r=f.getBoundingClientRect(),l=null==v?void 0:v.getBoundingClientRect(),i=Math.min(r.left,null!==(e=null==l?void 0:l.left)&&void 0!==e?e:1/0),a=Math.min(r.top,null!==(t=null==l?void 0:l.top)&&void 0!==t?t:1/0),s=Math.max(r.right,null!==(n=l.right)&&void 0!==n?n:-1/0)-i,c=Math.max(r.bottom,null!==(o=l.bottom)&&void 0!==o?o:-1/0)-a;return new window.DOMRect(i,a,s,c)},ownerDocument:f.ownerDocument}}),[o,v,f,k]);return!f||o&&!v?null:(0,u.createElement)(h.Popover,c({ref:b,animate:!1,focusOnMount:!1,anchor:E,__unstableSlotName:a||null,placement:"top-start",resize:!1,flip:!1,shift:d},g,{className:p()("block-editor-block-popover",g.className),variant:"unstyled"}),i&&(0,u.createElement)("div",{style:y},r),!i&&r)}));function Qr(e){const t=(0,a.getBlockSupport)(e,hl);return!!(!0===t||null!=t&&t.margin)}function Xr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("spacing.margin"),n=!Cl(e,"margin");return!Qr(e)||t||n}function Jr(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l,onMouseOver:i,onMouseOut:a}=e,s=fr("spacing.spacingSizes"),c=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vw"]}),d=El(o,"margin"),p=d&&d.some((e=>bl.includes(e)));if(Xr(e))return null;const m=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,margin:e}};l({style:Ar(t)})};return u.Platform.select({web:(0,u.createElement)(u.Fragment,null,(!s||0===(null==s?void 0:s.length))&&(0,u.createElement)(h.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.margin,onChange:m,label:(0,_.__)("Margin"),sides:d,units:c,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:a}),(null==s?void 0:s.length)>0&&(0,u.createElement)(wr,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.margin,onChange:m,label:(0,_.__)("Margin"),sides:d,units:c,allowReset:!1,splitOnAxis:!1,onMouseOver:i,onMouseOut:a})),native:null})}function el(e){var t,n;let{clientId:o,attributes:r,forceShow:l}=e;const i=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,a=(0,u.useMemo)((()=>{const e=null!=i&&i.top?or(null==i?void 0:i.top):0,t=null!=i&&i.right?or(null==i?void 0:i.right):0,n=null!=i&&i.bottom?or(null==i?void 0:i.bottom):0,o=null!=i&&i.left?or(null==i?void 0:i.left):0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:o,top:e?`calc(${e} * -1)`:0,right:t?`calc(${t} * -1)`:0,bottom:n?`calc(${n} * -1)`:0,left:o?`calc(${o} * -1)`:0}}),[i]),[s,c]=(0,u.useState)(!1),d=(0,u.useRef)(i),p=(0,u.useRef)();return(0,u.useEffect)((()=>(Kr()(i,d.current)||l||(c(!0),d.current=i,p.current=setTimeout((()=>{c(!1)}),400)),()=>{c(!1),p.current&&window.clearTimeout(p.current)})),[i,l]),s||l?(0,u.createElement)(Zr,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:i,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,u.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}const tl={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1}};function nl(e){var t,n,o,r,l;let{label:i=(0,_.__)("Height"),onChange:a,value:s}=e;const c=parseFloat(s),d=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vh","vw"]}),p=(0,u.useMemo)((()=>(0,h.__experimentalParseQuantityAndUnitFromRawValue)(s)),[s])[1]||(null===(t=d[0])||void 0===t?void 0:t.value)||"px";return(0,u.createElement)("fieldset",{className:"block-editor-height-control"},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},i),(0,u.createElement)(h.Flex,null,(0,u.createElement)(h.FlexItem,{isBlock:!0},(0,u.createElement)(h.__experimentalUnitControl,{value:s,units:d,onChange:a,onUnitChange:e=>{const[t,n]=(0,h.__experimentalParseQuantityAndUnitFromRawValue)(s);["em","rem"].includes(e)&&"px"===n?a((t/16).toFixed(2)+e):["em","rem"].includes(n)&&"px"===e?a(Math.round(16*t)+e):["vh","vw","%"].includes(e)&&t>100&&a(100+e)},min:0,size:"__unstable-large"})),(0,u.createElement)(h.FlexItem,{isBlock:!0},(0,u.createElement)(h.__experimentalSpacer,{marginX:2,marginBottom:0},(0,u.createElement)(h.RangeControl,{value:c,min:0,max:null!==(n=null===(o=tl[p])||void 0===o?void 0:o.max)&&void 0!==n?n:100,step:null!==(r=null===(l=tl[p])||void 0===l?void 0:l.step)&&void 0!==r?r:.1,withInputField:!1,onChange:e=>{a([e,p].join(""))},__nextHasNoMarginBottom:!0})))))}function ol(e){const t=(0,a.getBlockSupport)(e,fl);return!!(!0===t||null!=t&&t.minHeight)}function rl(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("dimensions.minHeight");return!ol(e)||t}function ll(e){var t;const{attributes:{style:n},setAttributes:o}=e;if(rl(e))return null;return(0,u.createElement)(nl,{label:(0,_.__)("Min. height"),value:null==n||null===(t=n.dimensions)||void 0===t?void 0:t.minHeight,onChange:e=>{const t={...n,dimensions:{...null==n?void 0:n.dimensions,minHeight:e}};o({style:Ar(t)})}})}function il(e){const t=(0,a.getBlockSupport)(e,hl);return!!(!0===t||null!=t&&t.padding)}function al(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("spacing.padding"),n=!Cl(e,"padding");return!il(e)||t||n}function sl(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l,onMouseOver:i,onMouseOut:a}=e,s=fr("spacing.spacingSizes"),c=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vw"]}),d=El(o,"padding"),p=d&&d.some((e=>bl.includes(e)));if(al(e))return null;const m=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,padding:e}};l({style:Ar(t)})};return u.Platform.select({web:(0,u.createElement)(u.Fragment,null,(!s||0===(null==s?void 0:s.length))&&(0,u.createElement)(h.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.padding,onChange:m,label:(0,_.__)("Padding"),sides:d,units:c,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:a}),(null==s?void 0:s.length)>0&&(0,u.createElement)(wr,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.padding,onChange:m,label:(0,_.__)("Padding"),sides:d,units:c,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:a})),native:null})}function cl(e){var t,n;let{clientId:o,attributes:r,forceShow:l}=e;const i=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,a=(0,u.useMemo)((()=>({borderTopWidth:null!=i&&i.top?or(null==i?void 0:i.top):0,borderRightWidth:null!=i&&i.right?or(null==i?void 0:i.right):0,borderBottomWidth:null!=i&&i.bottom?or(null==i?void 0:i.bottom):0,borderLeftWidth:null!=i&&i.left?or(null==i?void 0:i.left):0})),[i]),[s,c]=(0,u.useState)(!1),d=(0,u.useRef)(i),p=(0,u.useRef)();return(0,u.useEffect)((()=>(Kr()(i,d.current)||l||(c(!0),d.current=i,p.current=setTimeout((()=>{c(!1)}),400)),()=>{c(!1),p.current&&window.clearTimeout(p.current)})),[i,l]),s||l?(0,u.createElement)(Zr,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:i,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,u.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}function ul(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,_.__)("Stretch to fill available space."):"fixed"===e?"horizontal"===n?(0,_.__)("Specify a fixed width."):(0,_.__)("Specify a fixed height."):(0,_.__)("Fit contents.")}function dl(e){let{attributes:t,setAttributes:n,__unstableParentLayout:o}=e;const{style:r={}}=t,{layout:l={}}=r,{selfStretch:i,flexSize:a}=l;return(0,u.useEffect)((()=>{"fixed"!==i||a||n({style:{...r,layout:{...l,selfStretch:"fit"}}})}),[]),(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:gl(o),value:i||"fit",help:ul(i,o),onChange:e=>{const t="fixed"!==e?null:a;n({style:{...r,layout:{...l,selfStretch:e,flexSize:t}}})},isBlock:!0},(0,u.createElement)(h.__experimentalToggleGroupControlOption,{key:"fit",value:"fit",label:(0,_.__)("Fit")}),(0,u.createElement)(h.__experimentalToggleGroupControlOption,{key:"fill",value:"fill",label:(0,_.__)("Fill")}),(0,u.createElement)(h.__experimentalToggleGroupControlOption,{key:"fixed",value:"fixed",label:(0,_.__)("Fixed")})),"fixed"===i&&(0,u.createElement)(h.__experimentalUnitControl,{size:"__unstable-large",onChange:e=>{n({style:{...r,layout:{...l,flexSize:e}}})},value:a}))}function pl(e){let{__unstableParentLayout:t={}}=e;const{type:n="default",default:{type:o="default"}={},allowSizingOnChildren:r=!1}=t;return("flex"===o||"flex"===n)&&r}function ml(e){const t=!fr("layout");return!pl(e)||t}function gl(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,_.__)("Width"):(0,_.__)("Height")}const fl="dimensions",hl="spacing",vl=["top","right","bottom","left"],bl=["vertical","horizontal"];function kl(){const[e,t]=(0,u.useState)(!1),{hideBlockInterface:n,showBlockInterface:o}=Io((0,g.useDispatch)(To));return{isMouseOver:e,onMouseOver:e=>{e.stopPropagation(),n(),t(!0)},onMouseOut:e=>{e.stopPropagation(),o(),t(!1)}}}function _l(e){const t=Il(e),n=al(e),o=Xr(e),r=rl(e),l=ml(e),i=yl(e),s=function(e){if("web"!==u.Platform.OS)return!1;const{name:t}=e;return Sl(t)||ol(t)||il(t)||Qr(t)||pl(e)}(e),d=fr("spacing.spacingSizes"),m=kl(),g=kl();if(i||!s)return null;const f=(0,a.getBlockSupport)(e.name,[fl,"__experimentalDefaultControls"]),v=(0,a.getBlockSupport)(e.name,[hl,"__experimentalDefaultControls"]),b=(e,t)=>n=>{var o;return{...n,style:{...n.style,[t]:{...null===(o=n.style)||void 0===o?void 0:o[t],[e]:void 0}}}},k=p()({"tools-panel-item-spacing":d&&d.length>0}),{__unstableParentLayout:y}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(jr,{group:"dimensions"},!n&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:k,hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,_.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ar({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:b("padding","spacing"),isShownByDefault:null==v?void 0:v.padding,panelId:e.clientId},(0,u.createElement)(sl,c({onMouseOver:m.onMouseOver,onMouseOut:m.onMouseOut},e))),!o&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:k,hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,_.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ar({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:b("margin","spacing"),isShownByDefault:null==v?void 0:v.margin,panelId:e.clientId},(0,u.createElement)(Jr,c({onMouseOver:g.onMouseOver,onMouseOut:g.onMouseOut},e))),!t&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:k,hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,_.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:b("blockGap","spacing"),isShownByDefault:null==v?void 0:v.blockGap,panelId:e.clientId},(0,u.createElement)(xl,e)),!r&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.dimensions)||void 0===n?void 0:n.minHeight)}(e),label:(0,_.__)("Min. height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ar({...o,dimensions:{...null==o?void 0:o.dimensions,minHeight:void 0}})})}(e),resetAllFilter:b("minHeight","dimensions"),isShownByDefault:null==f?void 0:f.minHeight,panelId:e.clientId},(0,u.createElement)(ll,e)),!l&&(0,u.createElement)(h.__experimentalVStack,{as:h.__experimentalToolsPanelItem,spacing:2,hasValue:()=>function(e){var t;return void 0!==(null===(t=e.attributes.style)||void 0===t?void 0:t.layout)}(e),label:gl(y),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,layout:void 0}})}(e),resetAllFilter:b("selfStretch","layout"),isShownByDefault:!1,panelId:e.clientId},(0,u.createElement)(dl,e))),!n&&(0,u.createElement)(cl,c({forceShow:m.isMouseOver},e)),!o&&(0,u.createElement)(el,c({forceShow:g.isMouseOver},e)))}const yl=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Il(e),n=rl(e),o=al(e),r=Xr(e),l=ml(e);return t&&n&&o&&r&&l};function El(e,t){var n;const o=(0,a.getBlockSupport)(e,hl);if(o&&"boolean"!=typeof o[t])return Array.isArray(o[t])?o[t]:null!==(n=o[t])&&void 0!==n&&n.sides?o[t].sides:void 0}function Cl(e,t){const n=El(e,t);return!(n&&n.some((e=>vl.includes(e)))&&n.some((e=>bl.includes(e))))||(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),!1)}function Sl(e){const t=(0,a.getBlockSupport)(e,hl);return!!(!0===t||null!=t&&t.blockGap)}function wl(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:null==e?void 0:e.top,left:t?e:null==e?void 0:e.left}}function Bl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=wl(e);if(!n)return null;const o=or(null==n?void 0:n.top)||t,r=or(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}function Il(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("spacing.blockGap");return!Sl(e)||t}function xl(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=fr("spacing.spacingSizes"),a=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vw"]}),s=El(r,"blockGap"),c=er(n);if(Il(e))return null;const d=s&&s.some((e=>bl.includes(e))),p=e=>{var t;let n=e;e&&d?n={...wl(e)}:null!=e&&e.hasOwnProperty("top")&&(n=e.top);const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:Ar(r)});const i=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var a;c.current&&i&&(null===(a=c.current.parentNode)||void 0===a||a.replaceChild(c.current,c.current))},m=wl(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),g=d?{...m,right:null==m?void 0:m.left,bottom:null==m?void 0:m.top}:{top:null==m?void 0:m.top};return u.Platform.select({web:(0,u.createElement)(u.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(d?(0,u.createElement)(h.__experimentalBoxControl,{label:(0,_.__)("Block spacing"),min:0,onChange:p,units:a,sides:s,values:g,allowReset:!1,splitOnAxis:d}):(0,u.createElement)(h.__experimentalUnitControl,{label:(0,_.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:p,units:a,value:g})),(null==i?void 0:i.length)>0&&(0,u.createElement)(wr,{values:g,onChange:p,label:(0,_.__)("Block spacing"),sides:d?s:["top"],units:a,allowReset:!1,splitOnAxis:d})),native:null})}const Tl=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Ml=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),Nl=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),Pl=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})),Ll=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})),Rl={top:{icon:Nl,title:(0,_._x)("Align top","Block vertical alignment setting")},center:{icon:Ml,title:(0,_._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Tl,title:(0,_._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:Pl,title:(0,_._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:Ll,title:(0,_._x)("Space between","Block vertical alignment setting")}},Al=["top","center","bottom"];var Ol=function(e){let{value:t,onChange:n,controls:o=Al,isCollapsed:r=!0,isToolbar:l}=e;const i=Rl[t],a=Rl.top,s=l?h.ToolbarGroup:h.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{popoverProps:{variant:"toolbar"}};return(0,u.createElement)(s,c({icon:i?i.icon:a.icon,label:(0,_._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...Rl[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};const Dl=e=>(0,u.createElement)(Ol,c({},e,{isToolbar:!1})),zl=e=>(0,u.createElement)(Ol,c({},e,{isToolbar:!0})),Fl={left:Ho,center:Go,right:Uo,"space-between":$o,stretch:jo};var Vl=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:r,popoverProps:l,isToolbar:i}=e;const a=e=>{o(e===r?void 0:e)},s=r?Fl[r]:Fl.left,d=[{name:"left",icon:Ho,title:(0,_.__)("Justify items left"),isActive:"left"===r,onClick:()=>a("left")},{name:"center",icon:Go,title:(0,_.__)("Justify items center"),isActive:"center"===r,onClick:()=>a("center")},{name:"right",icon:Uo,title:(0,_.__)("Justify items right"),isActive:"right"===r,onClick:()=>a("right")},{name:"space-between",icon:$o,title:(0,_.__)("Space between items"),isActive:"space-between"===r,onClick:()=>a("space-between")},{name:"stretch",icon:jo,title:(0,_.__)("Stretch items"),isActive:"stretch"===r,onClick:()=>a("stretch")}],p=i?h.ToolbarGroup:h.ToolbarDropdownMenu,m=i?{isCollapsed:n}:{};return(0,u.createElement)(p,c({icon:s,popoverProps:l,label:(0,_.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},m))};const Hl=e=>(0,u.createElement)(Vl,c({},e,{isToolbar:!1})),Gl=e=>(0,u.createElement)(Vl,c({},e,{isToolbar:!0})),Ul={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},$l={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},jl={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},Wl=["wrap","nowrap"];var Kl={name:"flex",label:(0,_.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:r=!0}=o;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Flex,null,(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(Yl,{layout:t,onChange:n})),(0,u.createElement)(h.FlexItem,null,r&&(0,u.createElement)(Ql,{layout:t,onChange:n}))),(0,u.createElement)(Zl,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;if(null!=o&&o.allowSwitching)return null;const{allowVerticalAlignment:r=!0}=o;return(0,u.createElement)(Vo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,u.createElement)(Yl,{layout:t,onChange:n,isToolbar:!0}),r&&(0,u.createElement)(ql,{layout:t,onChange:n,isToolbar:!0}))},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r,style:l,blockName:i,hasBlockGapSupport:a,layoutDefinitions:s}=e;const{orientation:c="horizontal"}=r,u=null!=l&&null!==(t=l.spacing)&&void 0!==t&&t.blockGap&&!Fr(i,"spacing","blockGap")?Bl(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):void 0,d=Ul[r.justifyContent],p=Wl.includes(r.flexWrap)?r.flexWrap:"wrap",m=jl[r.verticalAlignment],g=$l[r.justifyContent]||$l.left;let f="";const h=[];return p&&"wrap"!==p&&h.push(`flex-wrap: ${p}`),"horizontal"===c?(m&&h.push(`align-items: ${m}`),d&&h.push(`justify-content: ${d}`)):(m&&h.push(`justify-content: ${m}`),h.push("flex-direction: column"),h.push(`align-items: ${g}`)),h.length&&(f=`${qo(o)} {\n\t\t\t\t${h.join("; ")};\n\t\t\t}`),a&&u&&(f+=Yo(o,s,"flex",u)),f},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments(){return[]}};function ql(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{orientation:r="horizontal"}=t,l="horizontal"===r?jl.center:jl.top,{verticalAlignment:i=l}=t,a=e=>{n({...t,verticalAlignment:e})};if(o)return(0,u.createElement)(Dl,{onChange:a,value:i,controls:"horizontal"===r?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]});const s=[{value:"flex-start",label:(0,_.__)("Align items top")},{value:"center",label:(0,_.__)("Align items center")},{value:"flex-end",label:(0,_.__)("Align items bottom")}];return(0,u.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,u.createElement)("legend",null,(0,_.__)("Vertical alignment")),(0,u.createElement)("div",null,s.map(((e,t,n)=>(0,u.createElement)(h.Button,{key:e,label:n,icon:t,isPressed:i===e,onClick:()=>a(e)})))))}function Yl(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:r="left",orientation:l="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===l?a.push("space-between"):a.push("stretch"),o)return(0,u.createElement)(Hl,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",variant:"toolbar"}});const s=[{value:"left",icon:Ho,label:(0,_.__)("Justify items left")},{value:"center",icon:Go,label:(0,_.__)("Justify items center")},{value:"right",icon:Uo,label:(0,_.__)("Justify items right")}];return"horizontal"===l?s.push({value:"space-between",icon:$o,label:(0,_.__)("Space between items")}):s.push({value:"stretch",icon:jo,label:(0,_.__)("Stretch items")}),(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Justification"),value:r,onChange:i,className:"block-editor-hooks__flex-layout-justification-controls"},s.map((e=>{let{value:t,icon:n,label:o}=e;return(0,u.createElement)(h.__experimentalToggleGroupControlOptionIcon,{key:t,value:t,icon:n,label:o})})))}function Zl(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,u.createElement)(h.ToggleControl,{label:(0,_.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function Ql(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal",verticalAlignment:r,justifyContent:l}=t;return(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,_.__)("Orientation"),value:o,onChange:e=>{let o=r,i=l;return"horizontal"===e?("space-between"===r&&(o="center"),"stretch"===l&&(i="left")):("stretch"===r&&(o="top"),"space-between"===l&&(i="left")),n({...t,orientation:e,verticalAlignment:o,justifyContent:i})}},(0,u.createElement)(h.__experimentalToggleGroupControlOptionIcon,{icon:Wo,value:"horizontal",label:(0,_.__)("Horizontal")}),(0,u.createElement)(h.__experimentalToggleGroupControlOptionIcon,{icon:Ko,value:"vertical",label:(0,_.__)("Vertical")}))}var Xl={name:"default",label:(0,_.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function(e){var t;let{selector:n,style:o,blockName:r,hasBlockGapSupport:l,layoutDefinitions:i}=e;const a=Bl(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap);let s="";Fr(r,"spacing","blockGap")||(null!=a&&a.top?s=Bl(null==a?void 0:a.top):"string"==typeof a&&(s=Bl(a)));let c="";return l&&s&&(c+=Yo(n,i,"default",s)),c},getOrientation(){return"vertical"},getAlignments(e,t){const n=Zo(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:n[e]})));const o=[{name:"left"},{name:"center"},{name:"right"}];if(!t){const{contentSize:t,wideSize:r}=e;t&&o.unshift({name:"full"}),r&&o.unshift({name:"wide",info:n.wide})}return o.unshift({name:"none",info:n.none}),o}};var Jl=function(e){let{icon:t,size:n=24,...o}=e;return(0,u.cloneElement)(t,{width:n,height:n,...o})};var ei=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));var ti=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),ni=window.wp.styleEngine,oi={name:"constrained",label:(0,_.__)("Constrained"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r,justifyContent:l="center"}=t,i=[{value:"left",icon:Ho,label:(0,_.__)("Justify items left")},{value:"center",icon:Go,label:(0,_.__)("Justify items center")},{value:"right",icon:Uo,label:(0,_.__)("Justify items right")}],a=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vw"]});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,u.createElement)(h.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,_.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:a}),(0,u.createElement)(Jl,{icon:ei})),(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,u.createElement)(h.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,_.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:a}),(0,u.createElement)(Jl,{icon:ti}))),(0,u.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,_.__)("Customize the width for all elements that are assigned to the center or wide columns.")),(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Justification"),value:l,onChange:e=>{n({...t,justifyContent:e})}},i.map((e=>{let{value:t,icon:n,label:o}=e;return(0,u.createElement)(h.__experimentalToggleGroupControlOptionIcon,{key:t,value:t,icon:n,label:o})}))))},toolBarControls:function(){return null},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r={},style:l,blockName:i,hasBlockGapSupport:a,layoutDefinitions:s}=e;const{contentSize:c,wideSize:u,justifyContent:d}=r,p=Bl(null==l||null===(t=l.spacing)||void 0===t?void 0:t.blockGap);let m="";Fr(i,"spacing","blockGap")||(null!=p&&p.top?m=Bl(null==p?void 0:p.top):"string"==typeof p&&(m=Bl(p)));const g="left"===d?"0 !important":"auto !important",f="right"===d?"0 !important":"auto !important";let h=c||u?`\n\t\t\t\t\t${qo(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=c?c:u};\n\t\t\t\t\t\tmargin-left: ${g};\n\t\t\t\t\t\tmargin-right: ${f};\n\t\t\t\t\t}\n\t\t\t\t\t${qo(o,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=u?u:c};\n\t\t\t\t\t}\n\t\t\t\t\t${qo(o,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";if("left"===d?h+=`${qo(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${g}; }`:"right"===d&&(h+=`${qo(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${f}; }`),null!=l&&null!==(n=l.spacing)&&void 0!==n&&n.padding){(0,ni.getCSSRules)(l).forEach((e=>{"paddingRight"===e.key?h+=`\n\t\t\t\t\t${qo(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===e.key&&(h+=`\n\t\t\t\t\t${qo(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)}))}return a&&m&&(h+=Yo(o,s,"constrained",m)),h},getOrientation(){return"vertical"},getAlignments(e){const t=Zo(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}};const ri=[Xl,Kl,oi];function li(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return ri.find((t=>t.name===e))}const ii={type:"default"},ai=(0,u.createContext)(ii),si=ai.Provider;function ci(){return(0,u.useContext)(ai)}function ui(e){let{layout:t={},css:n,...o}=e;const r=li(t.type),l=null!==fr("spacing.blockGap");if(r){var i;if(n)return(0,u.createElement)("style",null,n);const e=null===(i=r.getLayoutStyle)||void 0===i?void 0:i.call(r,{hasBlockGapSupport:l,layout:t,...o});if(e)return(0,u.createElement)("style",null,e)}return null}const di=[],pi=["none","left","center","right","wide","full"],mi=["wide","full"];function gi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pi;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n,isBlockBasedTheme:o}=(0,g.useSelect)((e=>{const{getSettings:t}=e(To),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout,isBlockBasedTheme:n.__unstableIsBlockBasedTheme}}),[]),r=ci(),l=li(null==r?void 0:r.type),i=l.getAlignments(r,o);if(n){const t=i.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?di:t}if("default"!==l.name&&"constrained"!==l.name)return di;const{alignments:a=pi}=r,s=e.filter((e=>(r.alignments||t||!mi.includes(e))&&a.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?di:s}var fi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"}));var hi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"}));var vi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"}));var bi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"}));const ki={none:{icon:fi,title:(0,_._x)("None","Alignment option")},left:{icon:hi,title:(0,_.__)("Align left")},center:{icon:ei,title:(0,_.__)("Align center")},right:{icon:vi,title:(0,_.__)("Align right")},wide:{icon:ti,title:(0,_.__)("Wide width")},full:{icon:bi,title:(0,_.__)("Full width")}},_i={variant:"toolbar"};var yi=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const i=gi(o);if(!!!i.length)return null;function a(e){n([t,"none"].includes(e)?void 0:e)}const s=ki[t],d=ki.none,m=r?h.ToolbarGroup:h.ToolbarDropdownMenu,g={icon:s?s.icon:d.icon,label:(0,_.__)("Align")},f=r?{isCollapsed:l,controls:i.map((e=>{let{name:n}=e;return{...ki[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>a(n)}}))}:{toggleProps:{describedBy:(0,_.__)("Change alignment")},popoverProps:_i,children:e=>{let{onClose:n}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},i.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=ki[o],s=o===t||!t&&"none"===o;return(0,u.createElement)(h.MenuItem,{key:o,icon:l,iconPosition:"left",className:p()("components-dropdown-menu__menu-item",{"is-active":s}),isSelected:s,onClick:()=>{a(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,u.createElement)(m,c({},g,f))};const Ei=e=>(0,u.createElement)(yi,c({},e,{isToolbar:!1})),Ci=e=>(0,u.createElement)(yi,c({},e,{isToolbar:!0})),Si=["left","center","right","wide","full"],wi=["wide","full"];function Bi(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?Si.filter((t=>e.includes(t))):!0===e?[...Si]:[],!o||!0===e&&!n?t.filter((e=>!wi.includes(e))):t}const Ii=(0,m.createHigherOrderComponent)((e=>t=>{const n=(0,u.createElement)(e,t),{name:o}=t,r=gi(Bi((0,a.getBlockSupport)(o,"align"),(0,a.hasBlockSupport)(o,"alignWide",!0))).map((e=>{let{name:t}=e;return t})),l=(0,g.useSelect)((e=>e(To).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);if(!r.length||l)return n;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Vo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,u.createElement)(Ei,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const r=(0,a.getBlockType)(t.name);(null==r||null===(n=r.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:r})),n)}),"withToolbarControls"),xi=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:r}=o,l=gi(Bi((0,a.getBlockSupport)(n,"align"),(0,a.hasBlockSupport)(n,"alignWide",!0)));if(void 0===r)return(0,u.createElement)(e,t);let i=t.wrapperProps;return l.some((e=>e.name===r))&&(i={...i,"data-align":r}),(0,u.createElement)(e,c({},t,{wrapperProps:i}))}));(0,s.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.align)&&void 0!==t?t:{})||(0,a.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Si,""]}}),e})),(0,s.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",xi),(0,s.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Ii),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Bi((0,a.getBlockSupport)(t,"align"),(0,a.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=p()(`align${o}`,e.className)),e})),(0,s.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const Ti=/[\s#]/g,Mi={type:"string",source:"attribute",attribute:"id",selector:"*"};const Ni=(0,m.createHigherOrderComponent)((e=>t=>{if((0,a.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===u.Platform.OS,o=(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,className:"html-anchor-control",label:(0,_.__)("HTML anchor"),help:(0,u.createElement)(u.Fragment,null,(0,_.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,u.createElement)(h.ExternalLink,{href:(0,_.__)("https://wordpress.org/support/article/page-jumps/")},(0,_.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,_.__)("Add an anchor"),onChange:e=>{e=e.replace(Ti,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(e,t),n&&(0,u.createElement)(jr,{group:"advanced"},o),!n&&"core/heading"===t.name&&(0,u.createElement)(jr,null,(0,u.createElement)(h.PanelBody,{title:(0,_.__)("Heading settings")},o)))}return(0,u.createElement)(e,t)}),"withInspectorControl");(0,s.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.anchor)&&void 0!==t?t:{})||(0,a.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Mi}),e})),(0,s.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Ni),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const Pi={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,s.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.ariaLabel)&&void 0!==n&&n.type||(0,a.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:Pi}),e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const Li=(0,m.createHigherOrderComponent)((e=>t=>(0,a.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,u.createElement)(u.Fragment,null,(0,u.createElement)(e,t),(0,u.createElement)(jr,{group:"advanced"},(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,_.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,_.__)("Separate multiple classes with spaces.")}))):(0,u.createElement)(e,t)),"withInspectorControl");(0,s.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,a.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,s.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",Li),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=p()(e.className,n.className)),e})),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,a.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var r;const o=null===(r=t[n])||void 0===r?void 0:r.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,a.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,a.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,a.getBlockDefaultClassName)(t.name)),e}));var Ri=window.wp.dom;const Ai=(0,u.createContext)({});function Oi(e){let{value:t,children:n}=e;const o=(0,u.useContext)(Ai),r=(0,u.useMemo)((()=>({...o,...t})),[o,t]);return(0,u.createElement)(Ai.Provider,{value:r,children:n})}var Di=Ai;const zi={};var Fi=(0,h.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,a.getBlockType)(n),r=(0,u.useContext)(Di),l=(0,u.useMemo)((()=>o&&o.usesContext?Object.fromEntries(Object.entries(r).filter((e=>{let[t]=e;return o.usesContext.includes(t)}))):zi),[o,r]);if(!o)return null;const i=o.edit||o.save;if(o.apiVersion>1)return(0,u.createElement)(i,c({},e,{context:l}));const s=(0,a.hasBlockSupport)(o,"className",!0)?(0,a.getBlockDefaultClassName)(n):null,d=p()(s,t.className,e.className);return(0,u.createElement)(i,c({},e,{context:l,className:d}))}));function Vi(e){const{name:t,isSelected:n,clientId:o,attributes:r={},__unstableLayoutClassNames:l}=e,{layout:i=null}=r,s={name:t,isSelected:n,clientId:o,layout:(0,a.hasBlockSupport)(t,"__experimentalLayout",!1)?i:null,__unstableLayoutClassNames:l};return(0,u.createElement)(Lo,{value:(0,u.useMemo)((()=>s),Object.values(s))},(0,u.createElement)(Fi,e))}var Hi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"}));var Gi=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,u.createElement)("div",{style:{display:"contents",all:"initial"}},(0,u.createElement)("div",{className:p()(t,"block-editor-warning")},(0,u.createElement)("div",{className:"block-editor-warning__contents"},(0,u.createElement)("p",{className:"block-editor-warning__message"},o),(u.Children.count(n)>0||r)&&(0,u.createElement)("div",{className:"block-editor-warning__actions"},u.Children.count(n)>0&&u.Children.map(n,((e,t)=>(0,u.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,u.createElement)(h.DropdownMenu,{className:"block-editor-warning__secondary",icon:Hi,label:(0,_.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,u.createElement)(h.MenuGroup,null,r.map(((e,t)=>(0,u.createElement)(h.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))},Ui=n(1973);function $i(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,u.createElement)("div",{className:i},(0,u.createElement)("div",{className:"block-editor-block-compare__content"},(0,u.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,u.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,u.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,u.createElement)(u.RawHTML,null,(0,Ri.safeHTML)(o)))),(0,u.createElement)("div",{className:"block-editor-block-compare__action"},(0,u.createElement)(h.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var ji=function(e){let{block:t,onKeep:n,onConvert:o,convertor:r,convertButtonText:l}=e;const i=(s=r(t),(Array.isArray(s)?s:[s]).map((e=>(0,a.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var s;const c=(d=t.originalContent,m=i,(0,Ui.Kx)(d,m).map(((e,t)=>{const n=p()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,u.createElement)("span",{key:t,className:n},e.value)})));var d,m;return(0,u.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,u.createElement)($i,{title:(0,_.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,_.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,u.createElement)($i,{title:(0,_.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:l,rawContent:c,renderedContent:i}))};const Wi=e=>(0,a.rawHandler)({HTML:e.originalContent});var Ki=(0,m.compose)([(0,g.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(To).getBlock(n)}})),(0,g.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(To);return{convertToClassic(){o(n.clientId,(e=>(0,a.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,a.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,Wi(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,a.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:r,block:l}=e;const i=!!(0,a.getBlockType)("core/html"),s=!!(0,a.getBlockType)("core/freeform"),[c,d]=(0,u.useState)(!1),p=(0,u.useCallback)((()=>d(!0)),[]),m=(0,u.useCallback)((()=>d(!1)),[]),g=(0,u.useMemo)((()=>[{title:(0,_._x)("Resolve","imperative verb"),onClick:p},i&&{title:(0,_.__)("Convert to HTML"),onClick:t},s&&{title:(0,_.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[p,i,t,s,o]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Gi,{actions:[(0,u.createElement)(h.Button,{key:"recover",onClick:r,variant:"primary"},(0,_.__)("Attempt Block Recovery"))],secondaryActions:g},(0,_.__)("This block contains unexpected or invalid content.")),c&&(0,u.createElement)(h.Modal,{title:(0,_.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,u.createElement)(ji,{block:l,onKeep:t,onConvert:n,convertor:Wi,convertButtonText:(0,_.__)("Convert to Blocks")})))}));const qi=(0,u.createElement)(Gi,{className:"block-editor-block-list__block-crash-warning"},(0,_.__)("This block has encountered an error and cannot be previewed."));var Yi=()=>qi;class Zi extends u.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}var Qi=Zi,Xi=n(773);var Ji=function(e){let{clientId:t}=e;const[n,o]=(0,u.useState)(""),r=(0,g.useSelect)((e=>e(To).getBlock(t)),[t]),{updateBlock:l}=(0,g.useDispatch)(To);return(0,u.useEffect)((()=>{o((0,a.getBlockContent)(r))}),[r]),(0,u.createElement)(Xi.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,a.getBlockType)(r.name);if(!e)return;const i=(0,a.getBlockAttributes)(e,n,r.attributes),s=n||(0,a.getSaveContent)(e,i),[c]=n?(0,a.validateBlock)({...r,attributes:i,originalContent:s}):[!0];l(t,{attributes:i,originalContent:s,isValid:c}),n||o({content:s})},onChange:e=>o(e.target.value)})},ea=ha(),ta=e=>pa(e,ea),na=ha();ta.write=e=>pa(e,na);var oa=ha();ta.onStart=e=>pa(e,oa);var ra=ha();ta.onFrame=e=>pa(e,ra);var la=ha();ta.onFinish=e=>pa(e,la);var ia=[];ta.setTimeout=(e,t)=>{let n=ta.now()+t,o=()=>{let e=ia.findIndex((e=>e.cancel==o));~e&&ia.splice(e,1),ua-=~e?1:0},r={time:n,handler:e,cancel:o};return ia.splice(aa(n),0,r),ua+=1,ma(),r};var aa=e=>~(~ia.findIndex((t=>t.time>e))||~ia.length);ta.cancel=e=>{oa.delete(e),ra.delete(e),la.delete(e),ea.delete(e),na.delete(e)},ta.sync=e=>{da=!0,ta.batchedUpdates(e),da=!1},ta.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,ta.onStart(n)}return o.handler=e,o.cancel=()=>{oa.delete(n),t=null},o};var sa=typeof window<"u"?window.requestAnimationFrame:()=>{};ta.use=e=>sa=e,ta.now=typeof performance<"u"?()=>performance.now():Date.now,ta.batchedUpdates=e=>e(),ta.catch=console.error,ta.frameLoop="always",ta.advance=()=>{"demand"!==ta.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):fa()};var ca=-1,ua=0,da=!1;function pa(e,t){da?(t.delete(e),e(0)):(t.add(e),ma())}function ma(){ca<0&&(ca=0,"demand"!==ta.frameLoop&&sa(ga))}function ga(){~ca&&(sa(ga),ta.batchedUpdates(fa))}function fa(){let e=ca;ca=ta.now();let t=aa(ca);t&&(va(ia.splice(0,t),(e=>e.handler())),ua-=t),ua?(oa.flush(),ea.flush(e?Math.min(64,ca-e):16.667),ra.flush(),na.flush(),la.flush()):ca=-1}function ha(){let e=new Set,t=e;return{add(n){ua+=t!=e||e.has(n)?0:1,e.add(n)},delete(n){return ua-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,ua-=t.size,va(t,(t=>t(n)&&e.add(t))),ua+=e.size,t=e)}}}function va(e,t){e.forEach((e=>{try{t(e)}catch(e){ta.catch(e)}}))}var ba=n(9196),ka=n.n(ba),_a=Object.defineProperty,ya={};function Ea(){}((e,t)=>{for(var n in t)_a(e,n,{get:t[n],enumerable:!0})})(ya,{assign:()=>Oa,colors:()=>La,createStringInterpolator:()=>Ta,skipAnimation:()=>Ra,to:()=>Ma,willAdvance:()=>Aa});var Ca={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function Sa(e,t){if(Ca.arr(e)){if(!Ca.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function Ba(e,t,n){if(Ca.arr(e))for(let o=0;oCa.und(e)?[]:Ca.arr(e)?e:[e];function xa(e,t){if(e.size){let n=Array.from(e);e.clear(),wa(n,t)}}var Ta,Ma,Na=(e,...t)=>xa(e,(e=>e(...t))),Pa=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),La=null,Ra=!1,Aa=Ea,Oa=e=>{e.to&&(Ma=e.to),e.now&&(ta.now=e.now),void 0!==e.colors&&(La=e.colors),null!=e.skipAnimation&&(Ra=e.skipAnimation),e.createStringInterpolator&&(Ta=e.createStringInterpolator),e.requestAnimationFrame&&ta.use(e.requestAnimationFrame),e.batchedUpdates&&(ta.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Aa=e.willAdvance),e.frameLoop&&(ta.frameLoop=e.frameLoop)},Da=new Set,za=[],Fa=[],Va=0,Ha={get idle(){return!Da.size&&!za.length},start(e){Va>e.priority?(Da.add(e),ta.onStart(Ga)):(Ua(e),ta(ja))},advance:ja,sort(e){if(Va)ta.onFrame((()=>Ha.sort(e)));else{let t=za.indexOf(e);~t&&(za.splice(t,1),$a(e))}},clear(){za=[],Da.clear()}};function Ga(){Da.forEach(Ua),Da.clear(),ta(ja)}function Ua(e){za.includes(e)||$a(e)}function $a(e){za.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(za,(t=>t.priority>e.priority)),0,e)}function ja(e){let t=Fa;for(let n=0;n0}var Wa="[-+]?\\d*\\.?\\d+",Ka=Wa+"%";function qa(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Ya=new RegExp("rgb"+qa(Wa,Wa,Wa)),Za=new RegExp("rgba"+qa(Wa,Wa,Wa,Wa)),Qa=new RegExp("hsl"+qa(Wa,Ka,Ka)),Xa=new RegExp("hsla"+qa(Wa,Ka,Ka,Wa)),Ja=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,es=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ts=/^#([0-9a-fA-F]{6})$/,ns=/^#([0-9a-fA-F]{8})$/;function os(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function rs(e,t,n){let o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=os(r,o,e+1/3),i=os(r,o,e),a=os(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function ls(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function is(e){return(parseFloat(e)%360+360)%360/360}function as(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function ss(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function cs(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=ts.exec(e))?parseInt(t[1]+"ff",16)>>>0:La&&void 0!==La[e]?La[e]:(t=Ya.exec(e))?(ls(t[1])<<24|ls(t[2])<<16|ls(t[3])<<8|255)>>>0:(t=Za.exec(e))?(ls(t[1])<<24|ls(t[2])<<16|ls(t[3])<<8|as(t[4]))>>>0:(t=Ja.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=ns.exec(e))?parseInt(t[1],16)>>>0:(t=es.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Qa.exec(e))?(255|rs(is(t[1]),ss(t[2]),ss(t[3])))>>>0:(t=Xa.exec(e))?(rs(is(t[1]),ss(t[2]),ss(t[3]))|as(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}var us=(e,t,n)=>{if(Ca.fun(e))return e;if(Ca.arr(e))return us({range:e,output:t,extrapolate:n});if(Ca.str(e.output[0]))return Ta(e);let o=e,r=o.output,l=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",a=o.extrapolateRight||o.extrapolate||"extend",s=o.easing||(e=>e);return e=>{let t=function(e,t){for(var n=1;n=e);++n);return n-1}(e,l);return function(e,t,n,o,r,l,i,a,s){let c=s?s(e):e;if(cn){if("identity"===a)return c;"clamp"===a&&(c=n)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,l[t],l[t+1],r[t],r[t+1],s,i,a,o.map)}};var ds=1.70158,ps=1.525*ds,ms=ds+1,gs=2*Math.PI/3,fs=2*Math.PI/4.5,hs=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,vs={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>0===e?0:Math.pow(2,10*e-10),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>ms*e*e*e-ds*e*e,easeOutBack:e=>1+ms*Math.pow(e-1,3)+ds*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*(ps+1)*e-ps)/2:(Math.pow(2*e-2,2)*((ps+1)*(2*e-2)+ps)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*gs),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*gs)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*fs)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*fs)/2+1,easeInBounce:e=>1-hs(1-e),easeOutBounce:hs,easeInOutBounce:e=>e<.5?(1-hs(1-2*e))/2:(1+hs(2*e-1))/2,steps:(e,t="end")=>n=>{let o=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,e),t))(0,1,("end"===t?Math.floor(o):Math.ceil(o))/e)}},bs=Symbol.for("FluidValue.get"),ks=Symbol.for("FluidValue.observers"),_s=e=>!(!e||!e[bs]),ys=e=>e&&e[bs]?e[bs]():e,Es=e=>e[ks]||null;function Cs(e,t){let n=e[ks];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var Ss=class{[bs];[ks];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");ws(this,e)}},ws=(e,t)=>Ts(e,bs,t);function Bs(e,t){if(e[bs]){let n=e[ks];n||Ts(e,ks,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Is(e,t){let n=e[ks];if(n&&n.has(t)){let o=n.size-1;o?n.delete(t):e[ks]=null,e.observerRemoved&&e.observerRemoved(o,t)}}var xs,Ts=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ms=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Ns=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Ps=new RegExp(`(${Ms.source})(%|[a-z]+)`,"i"),Ls=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Rs=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,As=e=>{let[t,n]=Os(e);if(!t||Pa())return e;let o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&Rs.test(n)?As(n):n||e},Os=e=>{let t=Rs.exec(e);if(!t)return[,];let[,n,o]=t;return[n,o]},Ds=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,zs=e=>{xs||(xs=La?new RegExp(`(${Object.keys(La).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>ys(e).replace(Rs,As).replace(Ns,cs).replace(xs,cs))),n=t.map((e=>e.match(Ms).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>us({...e,output:t})));return e=>{let n=!Ps.test(t[0])&&t.find((e=>Ps.test(e)))?.replace(Ms,""),r=0;return t[0].replace(Ms,(()=>`${o[r++](e)}${n||""}`)).replace(Ls,Ds)}},Fs="react-spring: ",Vs=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${Fs}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Hs=Vs(console.warn);var Gs=Vs(console.warn);function Us(e){return Ca.str(e)&&("#"==e[0]||/\d/.test(e)||!Pa()&&Rs.test(e)||e in(La||{}))}new WeakMap;new Set,new WeakMap,new WeakMap,new WeakMap;var $s=Pa()?ba.useEffect:ba.useLayoutEffect;function js(){let e=(0,ba.useState)()[1],t=(()=>{let e=(0,ba.useRef)(!1);return $s((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}var Ws=e=>(0,ba.useEffect)(e,Ks),Ks=[];function qs(e){let t=(0,ba.useRef)();return(0,ba.useEffect)((()=>{t.current=e})),t.current}var Ys=Symbol.for("Animated:node"),Zs=e=>e&&e[Ys],Qs=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,Ys,t),Xs=e=>e&&e[Ys]&&e[Ys].getPayload(),Js=class{payload;constructor(){Qs(this,this)}getPayload(){return this.payload||[]}},ec=class extends Js{constructor(e){super(),this._value=e,Ca.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new ec(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Ca.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,Ca.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},tc=class extends ec{_string=null;_toString;constructor(e){super(0),this._toString=us({output:[e,e]})}static create(e){return new tc(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(Ca.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=us({output:[this.getValue(),e]})),this._value=0,super.reset()}},nc={dependencies:null},oc=class extends Js{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return Ba(this.source,((n,o)=>{(e=>!!e&&e[Ys]===e)(n)?t[o]=n.getValue(e):_s(n)?t[o]=ys(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&wa(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return Ba(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){nc.dependencies&&_s(e)&&nc.dependencies.add(e);let t=Xs(e);t&&wa(t,(e=>this.add(e)))}},rc=class extends oc{constructor(e){super(e)}static create(e){return new rc(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){let t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(lc)),!0)}};function lc(e){return(Us(e)?tc:ec).create(e)}function ic(e){let t=Zs(e);return t?t.constructor:Ca.arr(e)?rc:Us(e)?tc:ec}var ac=(e,t)=>{let n=!Ca.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,ba.forwardRef)(((o,r)=>{let l=(0,ba.useRef)(null),i=n&&(0,ba.useCallback)((e=>{l.current=function(e,t){return e&&(Ca.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[a,s]=function(e,t){let n=new Set;return nc.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new oc(e),nc.dependencies=null,[e,n]}(o,t),c=js(),u=()=>{let e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new sc(u,s),p=(0,ba.useRef)();$s((()=>(p.current=d,wa(s,(e=>Bs(e,d))),()=>{p.current&&(wa(p.current.deps,(e=>Is(e,p.current))),ta.cancel(p.current.update))}))),(0,ba.useEffect)(u,[]),Ws((()=>()=>{let e=p.current;wa(e.deps,(t=>Is(t,e)))}));let m=t.getComponentProps(a.getValue());return ba.createElement(e,{...m,ref:i})}))},sc=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&ta.write(this.update)}};var cc=Symbol.for("AnimatedComponent"),uc=e=>Ca.str(e)?e:e&&Ca.str(e.displayName)?e.displayName:Ca.fun(e)&&e.name||null;function dc(e,...t){return Ca.fun(e)?e(...t):e}var pc=(e,t)=>!0===e||!!(t&&e&&(Ca.fun(e)?e(t):Ia(e).includes(t))),mc=(e,t)=>Ca.obj(e)?t&&e[t]:e,gc=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,fc=e=>e,hc=(e,t=fc)=>{let n=vc;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));let o={};for(let r of n){let n=t(e[r],r);Ca.und(n)||(o[r]=n)}return o},vc=["config","onProps","onStart","onChange","onPause","onResume","onRest"],bc={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function kc(e){let t=function(e){let t={},n=0;if(Ba(e,((e,o)=>{bc[o]||(t[o]=e,n++)})),n)return t}(e);if(t){let n={to:t};return Ba(e,((e,o)=>o in t||(n[o]=e))),n}return{...e}}function _c(e){return e=ys(e),Ca.arr(e)?e.map(_c):Us(e)?ya.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function yc(e){for(let t in e)return!0;return!1}function Ec(e){return Ca.fun(e)||Ca.arr(e)&&Ca.obj(e[0])}function Cc(e,t){e.ref?.delete(e),t?.delete(e)}function Sc(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var wc={tension:170,friction:26,mass:1,damping:1,easing:vs.linear,clamp:!1};function Bc(e,t){if(Ca.und(t.decay)){let n=!Ca.und(t.tension)||!Ca.und(t.friction);(n||!Ca.und(t.frequency)||!Ca.und(t.damping)||!Ca.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var Ic=[];function xc(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,a)=>{let s,c,u=pc(n.cancel??o?.cancel,t);if(u)m();else{Ca.und(n.pause)||(r.paused=pc(n.pause,t));let e=o?.pause;!0!==e&&(e=r.paused||pc(e,t)),s=dc(n.delay||0,t),e?(r.resumeQueue.add(p),l.pause()):(l.resume(),p())}function d(){r.resumeQueue.add(p),r.timeouts.delete(c),c.cancel(),s=c.time-ta.now()}function p(){s>0&&!ya.skipAnimation?(r.delayed=!0,c=ta.setTimeout(m,s),r.pauseQueue.add(d),r.timeouts.add(c)):m()}function m(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(d),r.timeouts.delete(c),e<=(r.cancelId||0)&&(u=!0);try{l.start({...n,callId:e,cancel:u},i)}catch(e){a(e)}}}))}var Tc=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Pc(e.get()):t.every((e=>e.noop))?Mc(e.get()):Nc(e.get(),t.every((e=>e.finished))),Mc=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Nc=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Pc=e=>({value:e,cancelled:!0,finished:!1});function Lc(e,t,n,o){let{callId:r,parentId:l,onRest:i}=t,{asyncTo:a,promise:s}=n;return l||e!==a||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;let c,u,d,p=hc(t,((e,t)=>"onRest"===t?void 0:e)),m=new Promise(((e,t)=>(c=e,u=t))),g=e=>{let t=r<=(n.cancelId||0)&&Pc(o)||r!==n.asyncId&&Nc(o,!1);if(t)throw e.result=t,u(e),e},f=(e,t)=>{let l=new Ac,i=new Oc;return(async()=>{if(ya.skipAnimation)throw Rc(n),i.result=Nc(o,!1),u(i),i;g(l);let a=Ca.obj(e)?{...e}:{...t,to:e};a.parentId=r,Ba(p,((e,t)=>{Ca.und(a[t])&&(a[t]=e)}));let s=await o.start(a);return g(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),s})()};if(ya.skipAnimation)return Rc(n),Nc(o,!1);try{let t;t=Ca.arr(e)?(async e=>{for(let t of e)await f(t)})(e):Promise.resolve(e(f,o.stop.bind(o))),await Promise.all([t.then(c),m]),d=Nc(o.get(),!0,!1)}catch(e){if(e instanceof Ac)d=e.result;else{if(!(e instanceof Oc))throw e;d=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?a:void 0,n.promise=l?s:void 0)}return Ca.fun(i)&&ta.batchedUpdates((()=>{i(d,o,o.item)})),d})():s}function Rc(e,t){xa(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var Ac=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},Oc=class extends Error{result;constructor(){super("SkipAnimationSignal")}},Dc=e=>e instanceof Fc,zc=1,Fc=class extends Ss{id=zc++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=Zs(this);return e&&e.getValue()}to(...e){return ya.to(this,e)}interpolate(...e){return Hs(`${Fs}The "interpolate" function is deprecated in v9 (use "to" instead)`),ya.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Cs(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Ha.sort(this),Cs(this,{type:"priority",parent:this,priority:e})}},Vc=Symbol.for("SpringPhase"),Hc=e=>(1&e[Vc])>0,Gc=e=>(2&e[Vc])>0,Uc=e=>(4&e[Vc])>0,$c=(e,t)=>t?e[Vc]|=3:e[Vc]&=-3,jc=(e,t)=>t?e[Vc]|=4:e[Vc]&=-5,Wc=class extends Fc{key;animation=new class{changed=!1;values=Ic;toValues=null;fromValues=Ic;to;from;config=new class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,wc)}};immediate=!1};queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,t){if(super(),!Ca.und(e)||!Ca.und(t)){let n=Ca.obj(e)?{...e}:{...t,from:e};Ca.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Gc(this)||this._state.asyncTo)||Uc(this)}get goal(){return ys(this.animation.to)}get velocity(){let e=Zs(this);return e instanceof ec?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Hc(this)}get isAnimating(){return Gc(this)}get isPaused(){return Uc(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,o=this.animation,{toValues:r}=o,{config:l}=o,i=Xs(o.to);!i&&_s(o.to)&&(r=Ia(ys(o.to))),o.values.forEach(((a,s)=>{if(a.done)return;let c=a.constructor==tc?1:i?i[s].lastPosition:r[s],u=o.immediate,d=c;if(!u){if(d=a.lastPosition,l.tension<=0)return void(a.done=!0);let t,n=a.elapsedTime+=e,r=o.fromValues[s],i=null!=a.v0?a.v0:a.v0=Ca.arr(l.velocity)?l.velocity[s]:l.velocity,p=l.precision||(r==c?.005:Math.min(1,.001*Math.abs(c-r)));if(Ca.und(l.duration))if(l.decay){let e=!0===l.decay?.998:l.decay,o=Math.exp(-(1-e)*n);d=r+i/(1-e)*(1-o),u=Math.abs(a.lastPosition-d)<=p,t=i*o}else{t=null==a.lastVelocity?i:a.lastVelocity;let n,o=l.restVelocity||p/10,s=l.clamp?0:l.bounce,m=!Ca.und(s),g=r==c?a.v0>0:ro,n||(u=Math.abs(c-d)<=p,!u));++e){m&&(f=d==c||d>c==g,f&&(t=-t*s,d=c)),t+=(1e-6*-l.tension*(d-c)+.001*-l.friction*t)/l.mass*h,d+=t*h}}else{let o=1;l.duration>0&&(this._memoizedDuration!==l.duration&&(this._memoizedDuration=l.duration,a.durationProgress>0&&(a.elapsedTime=l.duration*a.durationProgress,n=a.elapsedTime+=e)),o=(l.progress||0)+n/this._memoizedDuration,o=o>1?1:o<0?0:o,a.durationProgress=o),d=r+l.easing(o)*(c-r),t=(d-a.lastPosition)/e,u=1==o}a.lastVelocity=t,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[s].done&&(u=!1),u?a.done=!0:t=!1,a.setValue(d,l.round)&&(n=!0)}));let a=Zs(this),s=a.getValue();if(t){let e=ys(o.to);s===e&&!n||l.decay?n&&l.decay&&this._onChange(s):(a.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(s)}set(e){return ta.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Gc(this)){let{to:e,config:t}=this.animation;ta.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Ca.und(e)?(n=this.queue||[],this.queue=[]):n=[Ca.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>Tc(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),Rc(this._state,e&&this._lastCallId),ta.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||"",{to:n,from:o}=e;n=Ca.obj(n)?n[t]:n,(null==n||Ec(n))&&(n=void 0),o=Ca.obj(o)?o[t]:o,null==o&&(o=void 0);let r={to:n,from:o};return Hc(this)||(e.reverse&&([n,o]=[o,n]),o=ys(o),Ca.und(o)?Zs(this)||this._set(n):this._set(o)),r}_update({...e},t){let{key:n,defaultProps:o}=this;e.default&&Object.assign(o,hc(e,((e,t)=>/^on/.test(t)?mc(e,n):e))),Jc(this,e,"onProps"),eu(this,"onProps",e,this);let r=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let l=this._state;return xc(++this._lastCallId,{key:n,props:e,defaultProps:o,state:l,actions:{pause:()=>{Uc(this)||(jc(this,!0),Na(l.pauseQueue),eu(this,"onPause",Nc(this,Kc(this,this.animation.to)),this))},resume:()=>{Uc(this)&&(jc(this,!1),Gc(this)&&this._resume(),Na(l.resumeQueue),eu(this,"onResume",Nc(this,Kc(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){let t=qc(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Pc(this));let o=!Ca.und(e.to),r=!Ca.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Pc(this));this._lastToId=t.callId}let{key:l,defaultProps:i,animation:a}=this,{to:s,from:c}=a,{to:u=s,from:d=c}=e;r&&!o&&(!t.default||Ca.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let p=!Sa(d,c);p&&(a.from=d),d=ys(d);let m=!Sa(u,s);m&&this._focus(u);let g=Ec(t.to),{config:f}=a,{decay:h,velocity:v}=f;(o||r)&&(f.velocity=0),t.config&&!g&&function(e,t,n){n&&(Bc(n={...n},t),t={...n,...t}),Bc(e,t),Object.assign(e,t);for(let t in wc)null==e[t]&&(e[t]=wc[t]);let{frequency:o,damping:r}=e,{mass:l}=e;Ca.und(o)||(o<.01&&(o=.01),r<0&&(r=0),e.tension=Math.pow(2*Math.PI/o,2)*l,e.friction=4*Math.PI*r*l/o)}(f,dc(t.config,l),t.config!==i.config?dc(i.config,l):void 0);let b=Zs(this);if(!b||Ca.und(u))return n(Nc(this,!0));let k=Ca.und(t.reset)?r&&!t.default:!Ca.und(d)&&pc(t.reset,l),_=k?d:this.get(),y=_c(u),E=Ca.num(y)||Ca.arr(y)||Us(y),C=!g&&(!E||pc(i.immediate||t.immediate,l));if(m){let e=ic(u);if(e!==b.constructor){if(!C)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(y)}}let S=b.constructor,w=_s(u),B=!1;if(!w){let e=k||!Hc(this)&&p;(m||e)&&(B=Sa(_c(_),y),w=!B),(!Sa(a.immediate,C)&&!C||!Sa(f.decay,h)||!Sa(f.velocity,v))&&(w=!0)}if(B&&Gc(this)&&(a.changed&&!k?w=!0:w||this._stop(s)),!g&&((w||_s(s))&&(a.values=b.getPayload(),a.toValues=_s(u)?null:S==tc?[1]:Ia(y)),a.immediate!=C&&(a.immediate=C,!C&&!k&&this._set(s)),w)){let{onRest:e}=a;wa(Xc,(e=>Jc(this,t,e)));let o=Nc(this,Kc(this,s));Na(this._pendingCalls,o),this._pendingCalls.add(n),a.changed&&ta.batchedUpdates((()=>{a.changed=!k,e?.(o,this),k?dc(i.onRest,o):a.onStart?.(o,this)}))}k&&this._set(_),g?n(Lc(t.to,t,this._state,this)):w?this._start():Gc(this)&&!m?this._pendingCalls.add(n):n(Mc(_))}_focus(e){let t=this.animation;e!==t.to&&(Es(this)&&this._detach(),t.to=e,Es(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;_s(t)&&(Bs(t,this),Dc(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;_s(e)&&Is(e,this)}_set(e,t=!0){let n=ys(e);if(!Ca.und(n)){let e=Zs(this);if(!e||!Sa(n,e.getValue())){let o=ic(n);e&&e.constructor==o?e.setValue(n):Qs(this,o.create(n)),e&&ta.batchedUpdates((()=>{this._onChange(n,t)}))}}return Zs(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,eu(this,"onStart",Nc(this,Kc(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),dc(this.animation.onChange,e,this)),dc(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;Zs(this).reset(ys(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Gc(this)||($c(this,!0),Uc(this)||this._resume())}_resume(){ya.skipAnimation?this.finish():Ha.start(this)}_stop(e,t){if(Gc(this)){$c(this,!1);let n=this.animation;wa(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Cs(this,{type:"idle",parent:this});let o=t?Pc(this.get()):Nc(this.get(),Kc(this,e??n.to));Na(this._pendingCalls,o),n.changed&&(n.changed=!1,eu(this,"onRest",o,this))}}};function Kc(e,t){let n=_c(t);return Sa(_c(e.get()),n)}function qc(e,t=e.loop,n=e.to){let o=dc(t);if(o){let r=!0!==o&&kc(o),l=(r||e).reverse,i=!r||r.reset;return Yc({...e,loop:t,default:!1,pause:void 0,to:!l||Ec(n)?n:void 0,from:i?e.from:void 0,reset:i,...r})}}function Yc(e){let{to:t,from:n}=e=kc(e),o=new Set;return Ca.obj(t)&&Qc(t,o),Ca.obj(n)&&Qc(n,o),e.keys=o.size?Array.from(o):null,e}function Zc(e){let t=Yc(e);return Ca.und(t.default)&&(t.default=hc(t)),t}function Qc(e,t){Ba(e,((e,n)=>null!=e&&t.add(n)))}var Xc=["onStart","onRest","onChange","onPause","onResume"];function Jc(e,t,n){e.animation[n]=t[n]!==gc(t,n)?mc(t[n],e.key):void 0}function eu(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var tu=["onStart","onChange","onRest"],nu=1,ou=class{id=nu++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,t){this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(let t in e){let n=e[t];Ca.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Yc(e)),this}start(e){let{queue:t}=this;return e?t=Ia(e).map(Yc):this.queue=[],this._flush?this._flush(this,t):(uu(this,t),ru(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;wa(Ia(t),(t=>n[t].stop(!!e)))}else Rc(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Ca.und(e))this.start({pause:!0});else{let t=this.springs;wa(Ia(e),(e=>t[e].pause()))}return this}resume(e){if(Ca.und(e))this.start({pause:!1});else{let t=this.springs;wa(Ia(e),(e=>t[e].resume()))}return this}each(e){Ba(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,xa(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&xa(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,xa(n,(([e,t])=>{t.value=i,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}ta.onFrame(this._onFrame)}};function ru(e,t){return Promise.all(t.map((t=>lu(e,t)))).then((t=>Tc(e,t)))}async function lu(e,t,n){let{keys:o,to:r,from:l,loop:i,onRest:a,onResolve:s}=t,c=Ca.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);let u=Ca.arr(r)||Ca.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):wa(tu,(n=>{let o=t[n];if(Ca.fun(o)){let r=e._events[n];t[n]=({finished:e,cancelled:t})=>{let n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));let d=e._state;t.pause===!d.paused?(d.paused=t.pause,Na(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===gc(t,"cancel");(u||m&&d.asyncId)&&p.push(xc(++e._lastAsyncId,{props:t,state:d,actions:{pause:Ea,resume:Ea,start(t,n){m?(Rc(d,e._lastAsyncId),n(Pc(e))):(t.onRest=a,n(Lc(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));let g=Tc(e,await Promise.all(p));if(i&&g.finished&&(!n||!g.noop)){let n=qc(t,i,r);if(n)return uu(e,[n]),lu(e,n,!0)}return s&&ta.batchedUpdates((()=>s(g,e,e.item))),g}function iu(e,t){let n={...e.springs};return t&&wa(Ia(t),(e=>{Ca.und(e.keys)&&(e=Yc(e)),Ca.obj(e.to)||(e={...e,to:void 0}),cu(n,e,(e=>su(e)))})),au(e,n),n}function au(e,t){Ba(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Bs(t,e))}))}function su(e,t){let n=new Wc;return n.key=e,t&&Bs(n,t),n}function cu(e,t,n){t.keys&&wa(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function uu(e,t){wa(t,(t=>{cu(e.springs,t,(t=>su(t,e)))}))}var du=({children:e,...t})=>{let n=(0,ba.useContext)(pu),o=t.pause||!!n.pause,r=t.immediate||!!n.immediate;t=function(e,t){let[n]=(0,ba.useState)((()=>({inputs:t,result:e()}))),o=(0,ba.useRef)(),r=o.current,l=r;return l?t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:o,immediate:r})),[o,r]);let{Provider:l}=pu;return ba.createElement(l,{value:t},e)},pu=function(e,t){return Object.assign(e,ba.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}(du,{});du.Provider=pu.Provider,du.Consumer=pu.Consumer;var mu=()=>{let e=[],t=function(t){Gs(`${Fs}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);let o=[];return wa(e,((e,r)=>{if(Ca.und(t))o.push(e.start());else{let l=n(t,e,r);l&&o.push(e.start(l))}})),o};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){let n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return wa(e,(e=>e.pause(...arguments))),this},t.resume=function(){return wa(e,(e=>e.resume(...arguments))),this},t.set=function(t){wa(e,((e,n)=>{let o=Ca.fun(t)?t(n,e):t;o&&e.set(o)}))},t.start=function(t){let n=[];return wa(e,((e,o)=>{if(Ca.und(t))n.push(e.start());else{let r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return wa(e,(e=>e.stop(...arguments))),this},t.update=function(t){return wa(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};let n=function(e,t,n){return Ca.fun(e)?e(n,t):e};return t._getProps=n,t};function gu(e,t,n){let o=Ca.fun(t)&&t;o&&!n&&(n=[]);let r=(0,ba.useMemo)((()=>o||3==arguments.length?mu():void 0),[]),l=(0,ba.useRef)(0),i=js(),a=(0,ba.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){let n=iu(e,t);return l.current>0&&!a.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?ru(e,t):new Promise((o=>{au(e,n),a.queue.push((()=>{o(ru(e,t))})),i()}))}})),[]),s=(0,ba.useRef)([...a.ctrls]),c=[],u=qs(e)||0;function d(e,n){for(let r=e;r{wa(s.current.slice(e,u),(e=>{Cc(e,r),e.stop(!0)})),s.current.length=e,d(u,e)}),[e]),(0,ba.useMemo)((()=>{d(0,Math.min(u,e))}),n);let p=s.current.map(((e,t)=>iu(e,c[t]))),m=(0,ba.useContext)(du),g=qs(m),f=m!==g&&yc(m);$s((()=>{l.current++,a.ctrls=s.current;let{queue:e}=a;e.length&&(a.queue=[],wa(e,(e=>e()))),wa(s.current,((e,t)=>{r?.add(e),f&&e.start({default:m});let n=c[t];n&&(Sc(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Ws((()=>()=>{wa(a.ctrls,(e=>e.stop(!0)))}));let h=p.map((e=>({...e})));return r?[h,r]:h}function fu(e,t){let n=Ca.fun(e),[[o],r]=gu(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[o,r]:o}var hu=class extends Fc{constructor(e,t){super(),this.source=e,this.calc=us(...t);let n=this._get(),o=ic(n);Qs(this,o.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();Sa(t,this.get())||(Zs(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&bu(this._active)&&ku(this)}_get(){let e=Ca.arr(this.source)?this.source.map(ys):Ia(ys(this.source));return this.calc(...e)}_start(){this.idle&&!bu(this._active)&&(this.idle=!1,wa(Xs(this),(e=>{e.done=!1})),ya.skipAnimation?(ta.batchedUpdates((()=>this.advance())),ku(this)):Ha.start(this))}_attach(){let e=1;wa(Ia(this.source),(t=>{_s(t)&&Bs(t,this),Dc(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){wa(Ia(this.source),(e=>{_s(e)&&Is(e,this)})),this._active.clear(),ku(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=Ia(this.source).reduce(((e,t)=>Math.max(e,(Dc(t)?t.priority:0)+1)),0))}};function vu(e){return!1!==e.idle}function bu(e){return!e.size||Array.from(e).every(vu)}function ku(e){e.idle||(e.idle=!0,wa(Xs(e),(e=>{e.done=!0})),Cs(e,{type:"idle",parent:e}))}ya.assign({createStringInterpolator:zs,to:(e,t)=>new hu(e,t)});Ha.advance;var _u=window.ReactDOM,yu=/^--/;function Eu(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||yu.test(e)||Su.hasOwnProperty(e)&&Su[e]?(""+t).trim():t+"px"}var Cu={};var Su={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},wu=["Webkit","Ms","Moz","O"];Su=Object.keys(Su).reduce(((e,t)=>(wu.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Su);var Bu=/^(matrix|translate|scale|rotate|skew)/,Iu=/^(translate)/,xu=/^(rotate|skew)/,Tu=(e,t)=>Ca.num(e)&&0!==e?e+t:e,Mu=(e,t)=>Ca.arr(e)?e.every((e=>Mu(e,t))):Ca.num(e)?e===t:parseFloat(e)===t,Nu=class extends oc{constructor({x:e,y:t,z:n,...o}){let r=[],l=[];(e||t||n)&&(r.push([e||0,t||0,n||0]),l.push((e=>[`translate3d(${e.map((e=>Tu(e,"px"))).join(",")})`,Mu(e,0)]))),Ba(o,((e,t)=>{if("transform"===t)r.push([e||""]),l.push((e=>[e,""===e]));else if(Bu.test(t)){if(delete o[t],Ca.und(e))return;let n=Iu.test(t)?"px":xu.test(t)?"deg":"";r.push(Ia(e)),l.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Tu(r,n)})`,Mu(r,0)]:e=>[`${t}(${e.map((e=>Tu(e,n))).join(",")})`,Mu(e,t.startsWith("scale")?1:0)])}})),r.length&&(o.transform=new Pu(r,l)),super(o)}},Pu=class extends Ss{constructor(e,t){super(),this.inputs=e,this.transforms=t}_value=null;get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return wa(this.inputs,((n,o)=>{let r=ys(n[0]),[l,i]=this.transforms[o](Ca.arr(r)?r:n.map(ys));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&wa(this.inputs,(e=>wa(e,(e=>_s(e)&&Bs(e,this)))))}observerRemoved(e){0==e&&wa(this.inputs,(e=>wa(e,(e=>_s(e)&&Is(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Cs(this,e)}};ya.assign({batchedUpdates:_u.unstable_batchedUpdates,createStringInterpolator:zs,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});var Lu=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new oc(e)),getComponentProps:o=(e=>e)}={})=>{let r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{let t=uc(e)||"Anonymous";return(e=Ca.str(e)?l[e]||(l[e]=ac(e,r)):e[cc]||(e[cc]=ac(e,r))).displayName=`Animated(${t})`,e};return Ba(e,((t,n)=>{Ca.arr(e)&&(n=uc(t)),l[n]=l(t)})),{animated:l}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;let n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{style:o,children:r,scrollTop:l,scrollLeft:i,viewBox:a,...s}=t,c=Object.values(s),u=Object.keys(s).map((t=>n||e.hasAttribute(t)?t:Cu[t]||(Cu[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==r&&(e.textContent=r);for(let t in o)if(o.hasOwnProperty(t)){let n=Eu(t,o[t]);yu.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==l&&(e.scrollTop=l),void 0!==i&&(e.scrollLeft=i),void 0!==a&&e.setAttribute("viewBox",a)},createAnimatedStyle:e=>new Nu(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),Ru=Lu.animated;const Au=e=>e+1,Ou=e=>({top:e.offsetTop,left:e.offsetLeft});var Du=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,u.useRef)(),i=(0,m.useReducedMotion)()||!o,[a,s]=(0,u.useReducer)(Au,0),[c,d]=(0,u.useReducer)(Au,0),[p,g]=(0,u.useState)({x:0,y:0}),f=(0,u.useMemo)((()=>l.current?Ou(l.current):null),[r]),h=(0,u.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,Ri.getScrollContainer)(l.current);if(!e)return()=>{};const t=l.current.getBoundingClientRect();return()=>{const n=l.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[r,n]);return(0,u.useLayoutEffect)((()=>{a&&d()}),[a]),(0,u.useLayoutEffect)((()=>{if(!f)return;if(i)return void h();l.current.style.transform=void 0;const e=Ou(l.current);s(),g({x:Math.round(f.left-e.left),y:Math.round(f.top-e.top)})}),[r]),fu({from:{x:p.x,y:p.y},to:{x:0,y:0},reset:a!==c,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:function(e){let{value:n}=e;if(!l.current)return;let{x:o,y:r}=n;o=Math.round(o),r=Math.round(r);const i=0===o&&0===r;l.current.style.transformOrigin="center center",l.current.style.transform=i?void 0:`translate3d(${o}px,${r}px,0)`,l.current.style.zIndex=t?"1":"",h()}}),l};const zu=".block-editor-block-list__block",Fu=".block-list-appender",Vu=".block-editor-button-block-appender";function Hu(e,t){return t.closest([zu,Fu,Vu].join(","))===e}function Gu(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(zu);return t?t.id.slice("block-".length):void 0}function Uu(e){const t=(0,u.useRef)(),n=function(e){return(0,g.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,__unstableGetEditorMode:o,isBlockSelected:r}=t(To);if(r(e)&&"edit"===o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,g.useSelect)(To);return(0,u.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(Hu(t.current,l.activeElement))return;const i=Ri.focus.tabbable.find(t.current).filter((e=>(0,Ri.isTextField)(e))),a=-1===n,s=i[a?i.length-1:0]||t.current;if(Hu(t.current,s)){if(!t.current.getAttribute("contenteditable")){const e=Ri.focus.tabbable.findNext(t.current);if(e&&Hu(t.current,e)&&(0,Ri.isFormElement)(e))return void e.focus()}(0,Ri.placeCaretAtHorizontalEdge)(s,a)}else t.current.focus()}),[n,e]),t}function $u(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function ju(){const e=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return t().outlineMode}),[]);return(0,m.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",$u),t.addEventListener("mouseover",$u),()=>{t.removeEventListener("mouseout",$u),t.removeEventListener("mouseover",$u),t.classList.remove("is-hovered")}}),[e])}function Wu(e){return(0,g.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:r,isBlockMultiSelected:l,getBlockName:i,getSettings:s,hasSelectedInnerBlock:c,isTyping:u,__unstableIsFullySelected:d,__unstableSelectionHasUnmergeableBlock:m}=t(To),{outlineMode:g}=s(),f=n(e),h=r(e),v=i(e),b=c(e,!0),k=l(e);return p()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":k,"is-partially-selected":k&&!d()&&!m(),"is-reusable":(0,a.isReusableBlock)((0,a.getBlockType)(v)),"is-dragging":f,"has-child-selected":b,"remove-outline":h&&g&&u()})}),[e])}function Ku(e){return(0,g.useSelect)((t=>{const n=t(To).getBlockName(e),o=(0,a.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,a.getBlockDefaultClassName)(n)}),[e])}function qu(e){return(0,g.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(To),r=o(e);if(null==r||!r.className)return;const l=(0,a.getBlockType)(n(e));return(null==l?void 0:l.apiVersion)>1?r.className:void 0}),[e])}function Yu(e){return(0,g.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(To);if(!i(e))return;const a=n();return a?p()("is-block-moving-mode",{"can-insert-moving-block":o(r(a),l(e))}):void 0}),[e])}function Zu(e){const{isBlockSelected:t}=(0,g.useSelect)(To),{selectBlock:n,selectionChange:o}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):Hu(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var Qu=window.wp.keycodes;function Xu(e){const t=(0,g.useSelect)((t=>t(To).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,g.useSelect)(To),{insertDefaultBlock:r,removeBlock:l}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",a),i.addEventListener("dragstart",s),()=>{i.removeEventListener("keydown",a),i.removeEventListener("dragstart",s)};function a(t){const{keyCode:a,target:s}=t;a!==Qu.ENTER&&a!==Qu.BACKSPACE&&a!==Qu.DELETE||s!==i||(0,Ri.isTextField)(s)||(t.preventDefault(),a===Qu.ENTER?r({},n(e),o(e)+1):l(e))}function s(e){e.preventDefault()}}),[e,t,n,o,r,l])}function Ju(e){const{isNavigationMode:t,isBlockSelected:n}=(0,g.useSelect)(To),{setNavigationMode:o,selectBlock:r}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}function ed(){const e=(0,u.useContext)($v);return(0,m.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function td(e){return(0,g.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(To);return n(e)}),[e])}function nd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n,className:o,wrapperProps:r={},isAligned:l}=(0,u.useContext)(od),{index:i,mode:s,name:c,blockApiVersion:d,blockTitle:f,isPartOfSelection:h,adjustScrolling:v,enableAnimation:b}=(0,g.useSelect)((e=>{const{getBlockAttributes:t,getBlockIndex:o,getBlockMode:r,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:c,isBlockMultiSelected:u,isAncestorMultiSelected:d,isFirstMultiSelectedBlock:p}=e(To),{getActiveBlockVariation:m}=e(a.store),g=c(n),f=u(n)||d(n),h=l(n),v=(0,a.getBlockType)(h),b=m(h,t(n));return{index:o(n),mode:r(n),name:h,blockApiVersion:(null==v?void 0:v.apiVersion)||1,blockTitle:(null==b?void 0:b.title)||(null==v?void 0:v.title),isPartOfSelection:g||f,adjustScrolling:g||p(n),enableAnimation:!i()&&s()<=200}}),[n]),k=td(n),y=(0,_.sprintf)((0,_.__)("Block: %s"),f),E="html"!==s||t?"":"-visual",C=(0,m.useMergeRefs)([e.ref,Uu(n),Jo(n),Zu(n),Xu(n),Ju(n),ju(),ed(),Du({isSelected:h,adjustScrolling:v,enableAnimation:b,triggerAnimationOnChange:i}),(0,m.useDisabled)({isDisabled:!k})]),S=Ro();return d<2&&n===S.clientId&&"undefined"!=typeof process&&process.env,{tabIndex:0,...r,...e,ref:C,id:`block-${n}${E}`,role:"document","aria-label":y,"data-block":n,"data-type":c,"data-title":f,className:p()(p()("block-editor-block-list__block",{"wp-block":!l,"has-block-overlay":k}),o,e.className,r.className,Wu(n),Ku(n),qu(n),Yu(n)),style:{...r.style,...e.style}}}nd.save=a.__unstableGetBlockProps;const od=(0,u.createContext)();function rd(e){let{children:t,isHtml:n,...o}=e;return(0,u.createElement)("div",nd(o,{__unstableIsHtml:n}),t)}const ld=(0,g.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:l,isSelectionEnabled:i,getTemplateLock:a,__unstableGetBlockWithoutInnerBlocks:s,canRemoveBlock:c,canMoveBlock:u}=e(To),d=s(n),p=r(n),m=a(o),g=c(n,o),f=u(n,o),{name:h,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:g,canMove:f,block:d,name:h,attributes:v,isValid:b,isSelected:p}})),id=(0,g.withDispatch)(((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:r,mergeBlocks:l,replaceBlocks:i,toggleSelection:s,__unstableMarkLastChangeAsPersistent:c,moveBlocksToPosition:u,removeBlock:d}=e(To);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select(To),l=r(),{clientId:i}=t,a=l.length?l:[i];o(a,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;r(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:l}=t,{getBlockIndex:i}=n.select(To),a=i(o);r(e,a+1,l)},onMerge(e){const{clientId:o,rootClientId:i}=t,{getPreviousBlockClientId:s,getNextBlockClientId:c,getBlock:p,getBlockAttributes:m,getBlockName:g,getBlockOrder:f,getBlockIndex:h,getBlockRootClientId:v,canInsertBlockType:b}=n.select(To);function k(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const o=v(e),l=f(e),[i]=l;if(1===l.length&&(0,a.isUnmodifiedBlock)(p(i)))d(e);else{if(b(g(i),o))u([i],e,o,h(e));else{const l=(0,a.switchToBlockType)(p(i),(0,a.getDefaultBlockName)());l&&l.length&&n.batch((()=>{r(l,h(e),o,t),d(i,!1)}))}!f(e).length&&(0,a.isUnmodifiedBlock)(p(e))&&d(e,!1)}}if(e){if(i){const e=c(i);if(e){if(g(i)!==g(e))return void l(i,e);{const t=m(i),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(f(e),e,i),d(e,!1)}))}}}const e=c(o);if(!e)return;f(e).length?k(e,!1):l(o,e)}else{const e=s(o);if(e)l(e,o);else if(i){const e=s(i);if(e&&g(i)===g(e)){const t=m(i),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(f(i),i,e),d(i,!1)}))}k(i)}}},onReplace(e,n,o){e.length&&!(0,a.isUnmodifiedDefaultBlock)(e[e.length-1])&&c(),i([t.clientId],e,n,o)},toggleSelection(e){s(e)}}}));var ad=(0,m.compose)(m.pure,ld,id,(0,m.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,h.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:r,canRemove:l,clientId:i,isSelected:s,isSelectionEnabled:c,className:d,__unstableLayoutClassNames:m,name:f,isValid:h,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const{themeSupportsLayout:S,hasContentLockedParent:w,isContentBlock:B,isContentLocking:I,isTemporarilyEditingAsBlocks:x}=(0,g.useSelect)((e=>{const{getSettings:t,__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=e(To),l=!!n(i);return{themeSupportsLayout:t().supportsLayout,isContentBlock:e(a.store).__experimentalHasContentRoleAttribute(f),hasContentLockedParent:l,isContentLocking:"contentOnly"===o(i)&&!l,isTemporarilyEditingAsBlocks:r()===i}}),[f,i]),{removeBlock:T}=(0,g.useDispatch)(To),M=(0,u.useCallback)((()=>T(i)),[i]),N=ci()||{};let P=(0,u.createElement)(Vi,{name:f,isSelected:s,attributes:v,setAttributes:k,insertBlocksAfter:r?void 0:y,onReplace:l?_:void 0,onRemove:l?M:void 0,mergeBlocks:l?E:void 0,clientId:i,isSelectionEnabled:c,toggleSelection:C,__unstableLayoutClassNames:m,__unstableParentLayout:Object.keys(N).length?N:void 0});const L=(0,a.getBlockType)(f);w&&!B&&(b={...b,tabIndex:-1}),null!=L&&L.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return null!=e&&e.className&&null!=t&&t.className&&(n.className=p()(e.className,t.className)),null!=e&&e.style&&null!=t&&t.style&&(n.style={...e.style,...t.style}),n}(b,L.getEditWrapperProps(v)));const R=b&&!!b["data-align"]&&!S;let A;if(R&&(P=(0,u.createElement)("div",{className:"wp-block","data-align":b["data-align"]},P)),h)A="html"===o?(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{style:{display:"none"}},P),(0,u.createElement)(rd,{isHtml:!0},(0,u.createElement)(Ji,{clientId:i}))):(null==L?void 0:L.apiVersion)>1?P:(0,u.createElement)(rd,b,P);else{const e=n?(0,a.serializeRawBlock)(n):(0,a.getSaveContent)(L,v);A=(0,u.createElement)(rd,{className:"has-warning"},(0,u.createElement)(Ki,{clientId:i}),(0,u.createElement)(u.RawHTML,null,(0,Ri.safeHTML)(e)))}const{"data-align":O,...D}=null!==(t=b)&&void 0!==t?t:{},z={clientId:i,className:p()({"is-content-locked":I,"is-content-locked-temporarily-editing-as-blocks":x,"is-content-block":w&&B},O&&S&&`align${O}`,d),wrapperProps:D,isAligned:R},F=(0,u.useMemo)((()=>z),Object.values(z));return(0,u.createElement)(od.Provider,{value:F},(0,u.createElement)(Qi,{fallback:(0,u.createElement)(rd,{className:"has-warning"},(0,u.createElement)(Yi,null))},A))})),sd=window.wp.htmlEntities;var cd=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const ud=[(0,u.createInterpolateElement)((0,_.__)("While writing, you can press / to quickly insert new blocks."),{kbd:(0,u.createElement)("kbd",null)}),(0,u.createInterpolateElement)((0,_.__)("Indent a list by pressing space at the beginning of a line."),{kbd:(0,u.createElement)("kbd",null)}),(0,u.createInterpolateElement)((0,_.__)("Outdent a list by pressing backspace at the beginning of a line."),{kbd:(0,u.createElement)("kbd",null)}),(0,_.__)("Drag files into the editor to automatically insert media blocks."),(0,_.__)("Change a block's type by pressing the block icon on the toolbar.")];var dd=function(){const[e]=(0,u.useState)(Math.floor(Math.random()*ud.length));return(0,u.createElement)(h.Tip,null,ud[e])};var pd=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));var md=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var gd=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"}));var fd=(0,u.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:r,context:l}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:gd});const i=(0,u.createElement)(h.Icon,{icon:n&&n.src?n.src:n,context:l}),a=o?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,u.createElement)("span",{style:a,className:p()("block-editor-block-icon",r,{"has-colors":o})},i)}));var hd=function(e){let{title:t,icon:n,description:o,blockType:r,className:l}=e;r&&(W()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r));const{parentNavBlockClientId:i}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e(To);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:a}=(0,g.useDispatch)(To);return(0,u.createElement)("div",{className:p()("block-editor-block-card",l)},i&&(0,u.createElement)(h.Button,{onClick:()=>a(i),label:(0,_.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,_.isRTL)()?pd:md,isSmall:!0}),(0,u.createElement)(fd,{icon:n,showColors:!0}),(0,u.createElement)("div",{className:"block-editor-block-card__content"},(0,u.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,u.createElement)("span",{className:"block-editor-block-card__description"},o)))};const vd=(0,m.createHigherOrderComponent)((e=>(0,g.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,u.createElement)(e,c({registry:o},r));const[l,i]=(0,u.useState)(null);return(0,u.useEffect)((()=>{const e=(0,g.createRegistry)({},o);e.registerStore(So,xo),i(e)}),[o]),l?(0,u.createElement)(g.RegistryProvider,{value:l},(0,u.createElement)(e,c({registry:l},r))):null}))),"withRegistryProvider");const bd=()=>{};function kd(e){let{clientId:t=null,value:n,selection:o,onChange:r=bd,onInput:l=bd}=e;const i=(0,g.useRegistry)(),{resetBlocks:s,resetSelection:c,replaceInnerBlocks:d,setHasControlledInnerBlocks:p,__unstableMarkNextChangeAsNotPersistent:m}=i.dispatch(To),{getBlockName:f,getBlocks:h}=i.select(To),v=(0,g.useSelect)((e=>!t||e(To).areInnerBlocksControlled(t)),[t]),b=(0,u.useRef)({incoming:null,outgoing:[]}),k=(0,u.useRef)(!1),_=()=>{n&&(m(),t?i.batch((()=>{p(t,!0);const e=n.map((e=>(0,a.cloneBlock)(e)));k.current&&(b.current.incoming=e),m(),d(t,e)})):(k.current&&(b.current.incoming=n),s(n)))},y=(0,u.useRef)(l),E=(0,u.useRef)(r);(0,u.useEffect)((()=>{y.current=l,E.current=r}),[l,r]),(0,u.useEffect)((()=>{b.current.outgoing.includes(n)?b.current.outgoing[b.current.outgoing.length-1]===n&&(b.current.outgoing=[]):h(t)!==n&&(b.current.outgoing=[],_(),o&&c(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,u.useEffect)((()=>{v||(b.current.outgoing=[],_())}),[v]),(0,u.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:a}=i.select(To);let s=h(t),c=r(),u=!1;k.current=!0;const d=i.subscribe((()=>{if(null!==t&&null===f(t))return;if(!(!t||a(t)))return;const i=r(),d=h(t),p=d!==s;if(s=d,p&&(b.current.incoming||l()))return b.current.incoming=null,void(c=i);if(p||u&&!p&&i&&!c){c=i,b.current.outgoing.push(s);(c?E.current:y.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})}u=p}));return()=>{k.current=!1,d()}}),[i,t])}const _d=vd((e=>{const{children:t,settings:n,stripExperimentalSettings:o=!1}=e,{__experimentalUpdateSettings:r}=Io((0,g.useDispatch)(To));return(0,u.useEffect)((()=>{r({...n,__internalIsInitialized:!0},o)}),[n]),kd(e),(0,u.createElement)(Xo,null,t)}));var yd=e=>(0,u.createElement)(_d,c({},e,{stripExperimentalSettings:!0}),e.children);function Ed(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,g.useSelect)(To),{clearSelectedBlock:o}=(0,g.useDispatch)(To),{clearBlockSelection:r}=e();return(0,m.useRefEffect)((e=>{if(r)return e.addEventListener("mousedown",l),()=>{e.removeEventListener("mousedown",l)};function l(r){(t()||n())&&r.target===e&&o()}}),[t,n,o,r])}function Cd(e){return(0,u.createElement)("div",c({ref:Ed()},e))}function Sd(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(To);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function wd(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,g.useSelect)(Sd,[]);return(0,m.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:a}=i;if(null==e)return;if(!o||t)return;const{length:s}=n;s<2||l&&(r.contentEditable=!0,r.focus(),a.getSelection().removeAllRanges())}),[o,t,n,r,e,l])}function Bd(e,t,n,o){let r,l=Ri.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),l.find((function(e){if(1!==e.children.length||!function(e,t){return e.closest(zu)===t.closest(zu)}(e,e.firstElementChild)||"true"!==e.firstElementChild.getAttribute("contenteditable")){if(!Ri.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}}))}function Id(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,g.useSelect)(To),{selectBlock:l}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((i=>{let a;function s(){a=null}function c(s){if(s.defaultPrevented)return;const{keyCode:c,target:u,shiftKey:d,ctrlKey:p,altKey:m,metaKey:g}=s,f=c===Qu.UP,h=c===Qu.DOWN,v=c===Qu.LEFT,b=c===Qu.RIGHT,k=f||v,_=v||b,y=f||h,E=_||y,C=d||p||m||g,S=y?Ri.isVerticalEdge:Ri.isHorizontalEdge,{ownerDocument:w}=i,{defaultView:B}=w;if(!E)return;if(o()){if(d)return;if(!r())return;return s.preventDefault(),void(k?l(e()):l(t(),-1))}if(!function(e,t,n){if((t===Qu.UP||t===Qu.DOWN)&&!n)return!0;const{tagName:o}=e;if("INPUT"===o)return["button","checkbox","color","file","image","radio","reset","submit"].includes(e.getAttribute("type"));return"TEXTAREA"!==o}(u,c,C))return;y?a||(a=(0,Ri.computeCaretRect)(B)):a=null;const I=(0,Ri.isRTL)(u)?!k:k,{keepCaretInsideBlock:x}=n();if(d)(function(e,t){const n=Bd(e,t,i);return n&&Gu(n)})(u,k)&&S(u,k)&&(i.contentEditable=!0,i.focus());else if(!y||!(0,Ri.isVerticalEdge)(u,k)||m&&!(0,Ri.isHorizontalEdge)(u,I)||x){if(_&&B.getSelection().isCollapsed&&(0,Ri.isHorizontalEdge)(u,I)&&!x){const e=Bd(u,I,i);(0,Ri.placeCaretAtHorizontalEdge)(e,k),s.preventDefault()}}else{const e=Bd(u,k,i,!0);e&&((0,Ri.placeCaretAtVerticalEdge)(e,m?!k:k,m?void 0:a),s.preventDefault())}}return i.addEventListener("mousedown",s),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",s),i.removeEventListener("keydown",c)}}),[])}var xd=window.wp.keyboardShortcuts;function Td(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,g.useSelect)(To),{multiSelect:o,selectBlock:r}=(0,g.useDispatch)(To),l=(0,xd.__unstableUseShortcutEventMatch)();return(0,m.useRefEffect)((i=>{function a(a){if(!l("core/block-editor/select-all",a))return;const s=t();if(s.length<2&&!(0,Ri.isEntirelySelected)(a.target))return;a.preventDefault();const[c]=s,u=n(c),d=e(u);s.length!==d.length?o(d[0],d[d.length-1]):u&&(i.ownerDocument.defaultView.getSelection().removeAllRanges(),r(u))}return i.addEventListener("keydown",a),()=>{i.removeEventListener("keydown",a)}}),[])}function Md(e,t){e.contentEditable=t,t&&e.focus()}function Nd(){const{startMultiSelect:e,stopMultiSelect:t}=(0,g.useDispatch)(To),{isSelectionEnabled:n,hasMultiSelection:o,isDraggingBlocks:r}=(0,g.useSelect)(To);return(0,m.useRefEffect)((l=>{const{ownerDocument:i}=l,{defaultView:a}=i;let s,c;function u(){t(),a.removeEventListener("mouseup",u),c=a.requestAnimationFrame((()=>{if(o())return;Md(l,!1);const e=a.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);s.contains(t)&&s.focus()}}))}function d(t){let{buttons:o,target:c}=t;r()||1===o&&c.getAttribute("contenteditable")&&n()&&(s=i.activeElement,e(),a.addEventListener("mouseup",u),Md(l,!0))}return l.addEventListener("mouseout",d),()=>{l.removeEventListener("mouseout",d),a.removeEventListener("mouseup",u),a.cancelAnimationFrame(c)}}),[e,t,n,o])}function Pd(e,t){e.contentEditable=t,t&&e.focus()}function Ld(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,g.useDispatch)(To),{getBlockParents:o,getBlockSelectionStart:r}=(0,g.useSelect)(To);return(0,m.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function a(l){const a=i.getSelection();if(!a.rangeCount)return;const s=l.shiftKey&&"mouseup"===l.type;if(a.isCollapsed&&!s)return void Pd(n,!1);let c=Gu(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(a)),u=Gu(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(a));if(s){const e=r(),t=Gu(l.target),n=t!==u;(c===u&&a.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0===c&&void 0===u)return void Pd(n,!1);if(c===u)t(c);else{const t=[...o(c),c],n=[...o(u),u],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}}function s(){l.addEventListener("selectionchange",a),i.addEventListener("mouseup",a)}function c(){l.removeEventListener("selectionchange",a),i.removeEventListener("mouseup",a)}function u(){c(),s()}return s(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,o])}function Rd(){const{selectBlock:e}=(0,g.useDispatch)(To),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,g.useSelect)(To);return(0,m.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),a=Gu(l.target);l.shiftKey?i!==a&&(r.contentEditable=!0,r.focus()):o()&&e(a)}return r.addEventListener("mousedown",l),()=>{r.removeEventListener("mousedown",l)}}),[e,t,n,o])}function Ad(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,g.useSelect)(To),{replaceBlocks:r,__unstableSplitSelection:l,removeBlocks:i,__unstableDeleteSelection:s,__unstableExpandSelection:c}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((u=>{function d(e){var t;o()&&null!==(t=e.inputType)&&void 0!==t&&t.startsWith("format")&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===Qu.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?r(t(),(0,a.createBlock)((0,a.getDefaultBlockName)())):l()):d.keyCode===Qu.BACKSPACE||d.keyCode===Qu.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?i(t()):n()?s(d.keyCode===Qu.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?s(d.keyCode===Qu.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function m(e){o()&&(u.contentEditable=!1,n()?s():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("beforeinput",d),u.addEventListener("keydown",p),u.addEventListener("compositionstart",m),()=>{u.removeEventListener("beforeinput",d),u.removeEventListener("keydown",p),u.removeEventListener("compositionstart",m)}}),[])}function Od(){const[e,t,n]=function(){const e=(0,u.useRef)(),t=(0,u.useRef)(),n=(0,u.useRef)(),o=(0,u.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,g.useSelect)(To),{setNavigationMode:a}=(0,g.useDispatch)(To),s=(0,g.useSelect)((e=>e(To).isNavigationMode()),[])?void 0:"0",c=(0,u.useRef)();function d(t){if(c.current)c.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";Ri.focus.tabbable[n](t.target).focus()}}const p=(0,u.createElement)("div",{ref:t,tabIndex:s,onFocus:d}),f=(0,u.createElement)("div",{ref:n,tabIndex:s,onFocus:d}),h=(0,m.useRefEffect)((s=>{function u(e){if(e.defaultPrevented)return;if(e.keyCode===Qu.ESCAPE)return e.preventDefault(),void a(!0);if(e.keyCode!==Qu.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,Ri.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,Ri.isFormElement)(Ri.focus.tabbable[i](e.target)))return;const u=o?t:n;c.current=!0,u.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){var r;if(o.keyCode!==Qu.TAB)return;if("region"===(null===(r=o.target)||void 0===r?void 0:r.getAttribute("role")))return;if(e.current===o.target)return;const l=o.shiftKey?"findPrevious":"findNext",i=Ri.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:g}=m;return g.addEventListener("keydown",p),s.addEventListener("keydown",u),s.addEventListener("focusout",d),()=>{g.removeEventListener("keydown",p),s.removeEventListener("keydown",u),s.removeEventListener("focusout",d)}}),[]);return[p,(0,m.useMergeRefs)([e,h]),f]}(),o=(0,g.useSelect)((e=>e(To).hasMultiSelection()),[]);return[e,(0,m.useMergeRefs)([t,Ad(),Nd(),Ld(),Rd(),wd(),Td(),Id(),(0,m.useRefEffect)((e=>{if(e.tabIndex=0,e.contentEditable=o,o)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,_.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[o])]),n]}var Dd=(0,u.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,i]=Od();return(0,u.createElement)(u.Fragment,null,r,(0,u.createElement)("div",c({},o,{ref:(0,m.useMergeRefs)([l,t]),className:p()(o.className,"block-editor-writing-flow")}),n),i)}));function zd(e){return(0,u.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}function Fd(e){let{contentRef:t,children:n,head:o,tabIndex:r=0,scale:l=1,frameSize:i=0,readonly:a,forwardedRef:s,...d}=e;const f=(0,g.useSelect)((e=>e(To).getSettings().__unstableResolvedAssets),[]),[,v]=(0,u.useReducer)((()=>({}))),[b,k]=(0,u.useState)(),[y,E]=(0,u.useState)([]),C=zd(null==f?void 0:f.styles),S=C.map((e=>e.id)),w=(0,u.useMemo)((()=>Array.from(document.styleSheets).reduce(((e,t)=>{try{t.cssRules}catch(t){return e}const{ownerNode:n,cssRules:o}=t;if(null===n)return e;if(!o)return e;if("LINK"!==n.tagName)return e;if("wp-reset-editor-styles-css"===n.id)return e;if(function e(t){return Array.from(t).find((t=>{let{selectorText:n,conditionText:o,cssRules:r}=t;return o?e(r):n&&(n.includes(".editor-styles-wrapper")||n.includes(".wp-block"))}))}(o)){e.push(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.push(o.cloneNode(!0))}return e}),[])),[]).filter((e=>!S.includes(e.id))),B=zd(null==f?void 0:f.scripts),I=Ed(),[x,T,M]=Od(),[N,{height:P}]=(0,m.useResizeObserver)(),L=(0,m.useRefEffect)((e=>{let t;function n(e){e.preventDefault()}function o(){const{contentDocument:o,ownerDocument:r}=e,{readyState:l,documentElement:i}=o;return t=o,("interactive"===l||"complete"===l)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(o),k(o),I(i),E(Array.from(r.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),o.dir=r.dir,i.removeChild(o.head),i.removeChild(o.body),t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1),!0)}return e.addEventListener("load",o),()=>{var r,l;e.removeEventListener("load",o),null===(r=t)||void 0===r||r.removeEventListener("dragover",n),null===(l=t)||void 0===l||l.removeEventListener("drop",n)}}),[]),R=(0,m.useRefEffect)((e=>{B.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,r)=>{const l=e.ownerDocument.createElement("script");l.id=n,o?(l.src=o,l.onload=()=>t(),l.onerror=()=>r()):t(),e.appendChild(l)}))}(e,n)))),Promise.resolve()).finally((()=>{v()}))}),[]),A=(0,m.useDisabled)({isDisabled:!a}),O=(0,m.useMergeRefs)([t,I,T,A]),D=(0,u.createElement)(u.Fragment,null,(0,u.createElement)("style",null,"html{height:auto!important;}body{margin:0}"),[...C,...w].map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,u.createElement)(a,{id:o,key:o},i):(0,u.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})}))),z=(0,u.useMemo)((()=>""+(0,u.renderToString)(D)),[]);return(0,u.createElement)(u.Fragment,null,r>=0&&x,(0,u.createElement)("iframe",c({},d,{ref:(0,m.useMergeRefs)([s,L]),tabIndex:r,srcDoc:z,title:(0,_.__)("Editor canvas")}),b&&(0,u.createPortal)((0,u.createElement)(u.Fragment,null,(0,u.createElement)("head",{ref:R},D,o,(0,u.createElement)("style",null,`html { transition: background 5s; ${i?"background: #2f2f2f; transition: background 0s;":""} }`)),(0,u.createElement)("body",{ref:O,className:p()("block-editor-iframe__body","editor-styles-wrapper",...y),style:{marginBottom:`-${P*(1-l)-i}px`,marginTop:i,transform:`scale( ${l} )`}},N,(0,u.createElement)(h.__experimentalStyleProvider,{document:b},n))),b.documentElement)),r>=0&&M)}var Vd=(0,u.forwardRef)((function(e,t){return(0,g.useSelect)((e=>e(To).getSettings().__internalIsInitialized),[])?(0,u.createElement)(Fd,c({},e,{forwardedRef:t})):null})),Hd={grad:.9,turn:360,rad:360/(2*Math.PI)},Gd=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Ud=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},$d=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},jd=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Wd=function(e){return{r:$d(e.r,0,255),g:$d(e.g,0,255),b:$d(e.b,0,255),a:$d(e.a)}},Kd=function(e){return{r:Ud(e.r),g:Ud(e.g),b:Ud(e.b),a:Ud(e.a,3)}},qd=/^#([0-9a-f]{3,8})$/i,Yd=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Zd=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=Math.max(t,n,o),i=l-Math.min(t,n,o),a=i?l===t?(n-o)/i:l===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(a<0?a+6:a),s:l?i/l*100:0,v:l/255*100,a:r}},Qd=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),i=o*(1-n),a=o*(1-(t-l)*n),s=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,a,i,i,s,o][c],g:255*[s,o,o,a,i,i][c],b:255*[i,i,s,o,o,a][c],a:r}},Xd=function(e){return{h:jd(e.h),s:$d(e.s,0,100),l:$d(e.l,0,100),a:$d(e.a)}},Jd=function(e){return{h:Ud(e.h),s:Ud(e.s),l:Ud(e.l),a:Ud(e.a,3)}},ep=function(e){return Qd((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},tp=function(e){return{h:(t=Zd(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},np=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,op=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,lp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ip={string:[[function(e){var t=qd.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?Ud(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?Ud(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=rp.exec(e)||lp.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Wd({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=np.exec(e)||op.exec(e);if(!t)return null;var n,o,r=Xd({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Hd[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return ep(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=void 0===r?1:r;return Gd(t)&&Gd(n)&&Gd(o)?Wd({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,l=void 0===r?1:r;if(!Gd(t)||!Gd(n)||!Gd(o))return null;var i=Xd({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return ep(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!Gd(t)||!Gd(n)||!Gd(o))return null;var i=function(e){return{h:jd(e.h),s:$d(e.s,0,100),v:$d(e.v,0,100),a:$d(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return Qd(i)},"hsv"]]},ap=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=Kd(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?Yd(Ud(255*r)):"","#"+Yd(t)+Yd(n)+Yd(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return Kd(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Kd(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return Jd(tp(this.rgba))},e.prototype.toHslString=function(){return t=(e=Jd(tp(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=Zd(this.rgba),{h:Ud(e.h),s:Ud(e.s),v:Ud(e.v),a:Ud(e.a,3)};var e},e.prototype.invert=function(){return mp({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),mp(cp(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),mp(cp(this.rgba,-e))},e.prototype.grayscale=function(){return mp(cp(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),mp(dp(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),mp(dp(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?mp({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Ud(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=tp(this.rgba);return"number"==typeof e?mp({h:e,s:t.s,l:t.l,a:t.a}):Ud(t.h)},e.prototype.isEqual=function(e){return this.toHex()===mp(e).toHex()},e}(),mp=function(e){return e instanceof pp?e:new pp(e)},gp=[],fp=function(e){e.forEach((function(e){gp.indexOf(e)<0&&(e(pp,ip),gp.push(e))}))};function hp(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,a=o[this.toHex()];if(a)return a;if(null==t?void 0:t.closest){var s=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=s,i=l[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));m(s=bp(i))?(a+.05)/(s+.05):(s+.05)/(a+.05),void 0===(o=2)&&(o=0),void 0===r&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===r&&"large"===i?3:4.5);var n,o,r,l,i}}var _p=n(3124),yp=n.n(_p);const Ep=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Cp(e,t){t=t||{};let n=1,o=1;function r(e){const t=e.match(/\n/g);t&&(n+=t.length);const r=e.lastIndexOf("\n");o=~r?e.length-r:o+e.length}function l(){const e={line:n,column:o};return function(t){return t.position=new i(e),m(),t}}function i(e){this.start=e,this.end={line:n,column:o},this.source=t.source}i.prototype.content=e;const a=[];function s(r){const l=new Error(t.source+":"+n+":"+o+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=o,l.source=e,!t.silent)throw l;a.push(l)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),g(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),g(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function g(e){let t;for(e=e||[];t=f();)!1!==t&&e.push(t);return e}function f(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return s("End of comment missing");const i=e.slice(2,n-2);return o+=2,r(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function h(){const e=p(/^([^{]+)/);if(e)return Sp(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function v(){const e=l();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=Sp(t[0]),!p(/^:\s*/))return s("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Ep,""),value:n?Sp(n[0]).replace(Ep,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return s("missing '{'");let t;for(g(e);t=v();)!1!==t&&(e.push(t),g(e));return u()?e:s("missing '}'")}function k(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const _=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return s("@keyframes missing name");const o=t[1];if(!c())return s("@keyframes missing '{'");let r,i=g();for(;r=k();)i.push(r),i=i.concat(g());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):s("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=Sp(t[1]);if(!c())return s("@media missing '{'");const o=g().concat(d());return u()?e({type:"media",media:n,rules:o}):s("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:Sp(t[1]),media:Sp(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Sp(t[1]);if(!c())return s("@supports missing '{'");const o=g().concat(d());return u()?e({type:"supports",supports:n,rules:o}):s("@supports missing '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Sp(t[1]),o=Sp(t[2]);if(!c())return s("@document missing '{'");const r=g().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):s("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=h()||[];if(!c())return s("@page missing '{'");let n,o=g();for(;n=v();)o.push(n),o=o.concat(g());return u()?e({type:"page",selectors:t,declarations:o}):s("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return s("@host missing '{'");const t=g().concat(d());return u()?e({type:"host",rules:t}):s("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return s("@font-face missing '{'");let t,n=g();for(;t=v();)n.push(t),n=n.concat(g());return u()?e({type:"font-face",declarations:n}):s("@font-face missing '}'")}()}function w(){const e=l(),t=h();return t?(g(),e({type:"rule",selectors:t,declarations:b()})):s("selector missing")}return wp(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function Sp(e){return e?e.replace(/^\s+|\s+$/g,""):""}function wp(e,t){const n=e&&"string"==typeof e.type,o=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){wp(e,o)})):n&&"object"==typeof n&&wp(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Bp=n(8575),Ip=n.n(Bp),xp=Tp;function Tp(e){this.options=e||{}}Tp.prototype.emit=function(e){return e},Tp.prototype.visit=function(e){return this[e.type](e)},Tp.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;ot=>{if("declaration"===t.type){const l=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const o=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};Ap(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+Op(e.value,r)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=l,o.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,o,r;return t};const zp=/^(body|html|:root).*$/;var Fp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>{const o=n=>t.includes(n.trim())?n:n.match(zp)?n.replace(/^(body|html|:root)/,e):e+" "+n;return"rule"===n.type?{...n,selectors:n.selectors.map(o)}:n}};var Vp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.values(null!=e?e:[]).map((e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(Fp(t)),o&&r.push(Dp(o)),r.length?Rp(n,(0,m.compose)(r)):n}))};const Hp=".editor-styles-wrapper";function Gp(e){return(0,u.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(Hp);let l;if(r)l=n.getComputedStyle(r,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),l=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=mp(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function Up(e){let{styles:t}=e;const n=(0,u.useMemo)((()=>Vp(t,Hp)),[t]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("style",{ref:Gp(t)}),n.map(((e,t)=>(0,u.createElement)("style",{key:t},e))))}function $p(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=mp(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)})),t}function jp(e){let{selector:t,id:n}=e;const o=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,u.createElement)("style",null,o)}function Wp(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,u.createElement)("style",null,n)}function Kp(e){let{id:t,colors:n}=e;const o=$p(n);return(0,u.createElement)(h.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,u.createElement)("defs",null,(0,u.createElement)("filter",{id:t},(0,u.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,u.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,u.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,u.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,u.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,u.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,u.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function qp(e){let{preset:t}=e;return(0,u.createElement)(Kp,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let Yp;fp([hp,kp]);const Zp=2e3;function Qp(e){let{viewportWidth:t,containerWidth:n,minHeight:o,additionalStyles:r=[]}=e;t||(t=n);const[l,{height:i}]=(0,m.useResizeObserver)(),{styles:a,duotone:s}=(0,g.useSelect)((e=>{var t,n;const o=e(To).getSettings();return{styles:o.styles,duotone:null===(t=o.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),c=(0,u.useMemo)((()=>a?[...a,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...r]:a),[a,r]),d=(0,u.useMemo)((()=>{var e,t;return[...null!==(e=null==s?void 0:s.default)&&void 0!==e?e:[],...null!==(t=null==s?void 0:s.theme)&&void 0!==t?t:[]]}),[s]);Yp=Yp||(0,m.pure)(Kv);const p=n/t;return(0,u.createElement)(h.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${p})`,height:i*p,maxHeight:i>Zp?Zp*p:void 0,minHeight:o}},(0,u.createElement)(Vd,{head:(0,u.createElement)(Up,{styles:c}),contentRef:(0,m.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:i,pointerEvents:"none",maxHeight:Zp,minHeight:0!==p&&p<1&&o?o/p:o}},l,d.map((e=>(0,u.createElement)(qp,{preset:e,key:e.slug}))),(0,u.createElement)(Yp,{renderAppender:!1})))}function Xp(e){const[t,{width:n}]=(0,m.useResizeObserver)();return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{style:{position:"relative",width:"100%",height:0}},t),(0,u.createElement)("div",{className:"block-editor-block-preview__container"},!!n&&(0,u.createElement)(Qp,c({},e,{containerWidth:n}))))}var Jp=(0,u.memo)((function(e){let{blocks:t,viewportWidth:n=1200,minHeight:o,additionalStyles:r=[],__experimentalMinHeight:l,__experimentalPadding:i}=e;l&&(o=l,W()("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),i&&(r=[...r,{css:`body { padding: ${i}px; }`}],W()("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const a=(0,g.useSelect)((e=>e(To).getSettings()),[]),s=(0,u.useMemo)((()=>({...a,__unstableIsPreviewMode:!0})),[a]),c=(0,u.useMemo)((()=>Array.isArray(t)?t:[t]),[t]);return t&&0!==t.length?(0,u.createElement)(_d,{value:c,settings:s},(0,u.createElement)(Xp,{viewportWidth:n,minHeight:o,additionalStyles:r})):null}));function em(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,g.useSelect)((e=>e(To).getSettings()),[]),l=(0,u.useMemo)((()=>({...r,__unstableIsPreviewMode:!0})),[r]),i=(0,m.useDisabled)(),a=(0,m.useMergeRefs)([n.ref,i]),s=(0,u.useMemo)((()=>Array.isArray(t)?t:[t]),[t]),c=(0,u.createElement)(_d,{value:s,settings:l},(0,u.createElement)(Yv,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:a,className:p()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?c:null}}var tm=function(e){var t;let{item:n}=e;const{name:o,title:r,icon:l,description:i,initialAttributes:s,example:c}=n,d=(0,a.isReusableBlock)(n);return(0,u.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,u.createElement)("div",{className:"block-editor-inserter__preview"},d||c?(0,u.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,u.createElement)(Jp,{blocks:c?(0,a.getBlockFromExample)(o,{attributes:{...c.attributes,...s},innerBlocks:c.innerBlocks}):(0,a.createBlock)(o,s),viewportWidth:null!==(t=null==c?void 0:c.viewportWidth)&&void 0!==t?t:500,additionalStyles:[{css:"body { padding: 16px; }"}]})):(0,u.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,_.__)("No Preview Available."))),!d&&(0,u.createElement)(hd,{title:r,icon:l,description:i}))};var nm=(0,u.createContext)();var om=(0,u.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const i=(0,u.useContext)(nm);return(0,u.createElement)(h.__unstableCompositeItem,c({ref:t,state:i,role:"option",focusable:!0},l),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,u.createElement)(o,t,r):"function"==typeof r?r(t):(0,u.createElement)(h.Button,t,r)}))}));var rm=(0,u.createElement)(G.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function lm(e){let{count:t,icon:n,isPattern:o}=e;const r=o&&(0,_.__)("Pattern");return(0,u.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,u.createElement)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip"},(0,u.createElement)(h.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,u.createElement)(h.FlexItem,null,n?(0,u.createElement)(fd,{icon:n}):r||(0,_.sprintf)((0,_._n)("%d block","%d blocks",t),t)),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(fd,{icon:rm})))))}var im=e=>{let{isEnabled:t,blocks:n,icon:o,children:r,isPattern:l}=e;const i={type:"inserter",blocks:n};return(0,u.createElement)(h.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:i,__experimentalDragComponent:(0,u.createElement)(lm,{count:n.length,icon:o,isPattern:l})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return r({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))};var am=(0,u.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:r,onHover:l,isDraggable:i,...s}=e;const d=(0,u.useRef)(!1),m=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},g=(0,u.useMemo)((()=>[(0,a.createBlock)(o.name,o.initialAttributes,(0,a.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]),f=(0,a.isReusableBlock)(o)||(0,a.isTemplatePart)(o);return(0,u.createElement)(im,{isEnabled:i&&!o.disabled,blocks:g,icon:o.icon},(e=>{let{draggable:i,onDragStart:a,onDragEnd:g}=e;return(0,u.createElement)("div",{className:p()("block-editor-block-types-list__list-item",{"is-synced":f}),draggable:i,onDragStart:e=>{d.current=!0,a&&(l(null),a(e))},onDragEnd:e=>{d.current=!1,g&&g(e)}},(0,u.createElement)(om,c({isFirst:n,className:p()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),r(o,(0,Qu.isAppleOS)()?e.metaKey:e.ctrlKey),l(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Qu.ENTER&&(e.preventDefault(),r(o,(0,Qu.isAppleOS)()?e.metaKey:e.ctrlKey),l(null))},onMouseEnter:()=>{d.current||l(o)},onMouseLeave:()=>l(null)},s),(0,u.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:m},(0,u.createElement)(fd,{icon:o.icon,showColors:!0})),(0,u.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,u.createElement)(h.__experimentalTruncate,{numberOfLines:3},o.title))))}))}));var sm=(0,u.forwardRef)((function(e,t){const[n,o]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{n&&(0,pn.speak)((0,_.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,u.createElement)("div",c({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)}},e))}));var cm=(0,u.forwardRef)((function(e,t){const n=(0,u.useContext)(nm);return(0,u.createElement)(h.__unstableCompositeGroup,c({state:n,role:"presentation",ref:t},e))}));var um=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:r,label:l,isDraggable:i=!0}=e;return(0,u.createElement)(sm,{className:"block-editor-block-types-list","aria-label":l},function(e,t){const n=[];for(let o=0,r=e.length;o(0,u.createElement)(cm,{key:t},e.map(((e,r)=>(0,u.createElement)(am,{key:e.id,item:e,className:(0,a.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:i&&!e.isDisabled,isFirst:0===t&&0===r})))))),r)};var dm=function(e){let{title:t,icon:n,children:o}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,u.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),(0,u.createElement)(h.Icon,{icon:n})),(0,u.createElement)("div",{className:"block-editor-inserter__panel-content"},o))};var pm=(e,t)=>{const{categories:n,collections:o,items:r}=(0,g.useSelect)((t=>{const{getInserterItems:n}=t(To),{getCategories:o,getCollections:r}=t(a.store);return{categories:o(),collections:r(),items:n(e)}}),[e]);return[r,n,o,(0,u.useCallback)(((e,n)=>{let{name:o,initialAttributes:r,innerBlocks:l}=e;const i=(0,a.createBlock)(o,r,(0,a.createBlocksFromInnerBlocksTemplate)(l));t(i,void 0,n)}),[t])]};var mm=function(e){let{children:t}=e;const n=(0,h.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,u.createElement)(nm.Provider,{value:n},t)};const gm=[];var fm=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,s]=pm(t,n),c=(0,u.useMemo)((()=>Y(l,"frecency","desc").slice(0,6)),[l]),d=(0,u.useMemo)((()=>l.filter((e=>!e.category))),[l]),p=(0,u.useMemo)((()=>(0,m.pipe)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,f.groupBy)(e,"category")))(l)),[l]),g=(0,u.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=l.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[l,a]);(0,u.useEffect)((()=>()=>o(null)),[]);const h=(0,m.useAsyncList)(i),v=i.length===h.length,b=(0,u.useMemo)((()=>Object.entries(a)),[a]),k=(0,m.useAsyncList)(v?b:gm);return(0,u.createElement)(mm,null,(0,u.createElement)("div",null,r&&!!c.length&&(0,u.createElement)(dm,{title:(0,_._x)("Most used","blocks")},(0,u.createElement)(um,{items:c,onSelect:s,onHover:o,label:(0,_._x)("Most used","blocks")})),h.map((e=>{const t=p[e.slug];return t&&t.length?(0,u.createElement)(dm,{key:e.slug,title:e.title,icon:e.icon},(0,u.createElement)(um,{items:t,onSelect:s,onHover:o,label:e.title})):null})),v&&d.length>0&&(0,u.createElement)(dm,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,_.__)("Uncategorized")},(0,u.createElement)(um,{items:d,onSelect:s,onHover:o,label:(0,_.__)("Uncategorized")})),k.map((e=>{let[t,n]=e;const r=g[t];return r&&r.length?(0,u.createElement)(dm,{key:t,title:n.title,icon:n.icon},(0,u.createElement)(um,{items:r,onSelect:s,onHover:o,label:n.title})):null}))))},hm=window.wp.notices;var vm=(e,t)=>{const{patternCategories:n,patterns:o}=(0,g.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(To);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:r}=(0,g.useDispatch)(hm.store),l=(0,u.useCallback)(((t,n)=>{e((null!=n?n:[]).map((e=>(0,a.cloneBlock)(e))),t.name),r((0,_.sprintf)((0,_.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[]);return[o,n,l]};const bm=e=>{let{showTooltip:t,title:n,children:o}=e;return t?(0,u.createElement)(h.Tooltip,{text:n},o):(0,u.createElement)(u.Fragment,null,o)};function km(e){let{isDraggable:t,pattern:n,onClick:o,onHover:r,composite:l,showTooltip:i}=e;const[a,s]=(0,u.useState)(!1),{blocks:d,viewportWidth:p}=n,g=`block-editor-block-patterns-list__item-description-${(0,m.useInstanceId)(km)}`;return(0,u.createElement)(im,{isEnabled:t,blocks:d,isPattern:!!n},(e=>{let{draggable:t,onDragStart:m,onDragEnd:f}=e;return(0,u.createElement)("div",{className:"block-editor-block-patterns-list__list-item",draggable:t,onDragStart:e=>{s(!0),m&&(null==r||r(null),m(e))},onDragEnd:e=>{s(!1),f&&f(e)}},(0,u.createElement)(bm,{showTooltip:i,title:n.title},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},l,{className:"block-editor-block-patterns-list__item",onClick:()=>{o(n,d),null==r||r(null)},onMouseEnter:()=>{a||null==r||r(n)},onMouseLeave:()=>null==r?void 0:r(null),"aria-label":n.title,"aria-describedby":n.description?g:void 0}),(0,u.createElement)(Jp,{blocks:d,viewportWidth:p}),!i&&(0,u.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,u.createElement)(h.VisuallyHidden,{id:g},n.description))))}))}function _m(){return(0,u.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var ym=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onHover:r,onClickPattern:l,orientation:i,label:a=(0,_.__)("Block Patterns"),showTitlesAsTooltip:s}=e;const d=(0,h.__unstableUseCompositeState)({orientation:i});return(0,u.createElement)(h.__unstableComposite,c({},d,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":a}),n.map((e=>o.includes(e)?(0,u.createElement)(km,{key:e.name,pattern:e,onClick:l,onHover:r,isDraggable:t,composite:d,showTooltip:s}):(0,u.createElement)(_m,{key:e.name}))))};function Em(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o}=e;const r="block-editor-block-patterns-explorer__sidebar";return(0,u.createElement)("div",{className:`${r}__categories-list`},n.map((e=>{let{name:n,label:l}=e;return(0,u.createElement)(h.Button,{key:n,label:l,className:`${r}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},l)})))}function Cm(e){let{filterValue:t,setFilterValue:n}=e;return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,u.createElement)(h.SearchControl,{__nextHasNoMarginBottom:!0,onChange:n,value:t,label:(0,_.__)("Search for patterns"),placeholder:(0,_.__)("Search")}))}var Sm=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,filterValue:r,setFilterValue:l}=e;return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,u.createElement)(Cm,{filterValue:r,setFilterValue:l}),!r&&(0,u.createElement)(Em,{selectedCategory:t,patternCategories:n,onClickCategory:o}))};var wm=function(){return(0,u.createElement)("div",{className:"block-editor-inserter__no-results"},(0,u.createElement)(Jl,{className:"block-editor-inserter__no-results-icon",icon:gd}),(0,u.createElement)("p",null,(0,_.__)("No results found.")))};var Bm=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:r,onSelect:l,shouldFocusBlock:i=!0,selectBlockOnInsert:s=!0}=e;const{getSelectedBlock:c}=(0,g.useSelect)(To),{destinationRootClientId:d,destinationIndex:p}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:l,getBlockRootClientId:i,getBlockIndex:a,getBlockOrder:s}=e(To),c=l();let u,d=t;return void 0!==n?u=n:o?u=a(o):!r&&c?(d=i(c),u=a(c)+1):u=s(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,r]),{replaceBlocks:m,insertBlocks:f,showInsertionPoint:h,hideInsertionPoint:v}=(0,g.useDispatch)(To),b=(0,u.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=c();!r&&o&&(0,a.isUnmodifiedDefaultBlock)(o)?m(o.clientId,e,null,i||n?0:null,t):f(e,p,d,s,i||n?0:null,t);const u=Array.isArray(e)?e.length:1,g=(0,_.sprintf)((0,_._n)("%d block added.","%d blocks added.",u),u);(0,pn.speak)(g),l&&l(e)}),[r,c,m,f,d,p,l,i]),k=(0,u.useCallback)((e=>{e?h(d,p):v()}),[h,v,d,p]);return[d,b,k]},Im=n(4793),xm=n.n(Im);function Tm(e){return e.toLowerCase()}var Mm=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Nm=/[^A-Z0-9]+/gi;function Pm(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?Mm:n,r=t.stripRegexp,l=void 0===r?Nm:r,i=t.transform,a=void 0===i?Tm:i,s=t.delimiter,c=void 0===s?" ":s,u=Lm(Lm(e,o,"$1\0$2"),l,"\0"),d=0,p=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(p-1);)p--;return u.slice(d,p).split("\0").map(a).join(c)}function Lm(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}const Rm=e=>e.name||"",Am=e=>e.title,Om=e=>e.description||"",Dm=e=>e.keywords||[],zm=e=>e.category,Fm=()=>null;function Vm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Pm(e,{splitRegexp:[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],stripRegexp:/(\p{C}|\p{P}|\p{S})+/giu}).split(" ").filter(Boolean)}function Hm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=xm()(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const Gm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Vm(Hm(e))},Um=(e,t)=>e.filter((e=>!Gm(t).some((t=>t.includes(e))))),$m=(e,t,n,o)=>{if(0===Gm(o).length)return e;return jm(e,o,{getCategory:e=>{var n;return null===(n=t.find((t=>{let{slug:n}=t;return n===e.category})))||void 0===n?void 0:n.title},getCollection:e=>{var t;return null===(t=n[e.name.split("/")[0]])||void 0===t?void 0:t.title}})},jm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=Gm(t);if(0===o.length)return e;const r=e.map((e=>[e,Wm(e,t,n)])).filter((e=>{let[,t]=e;return t>0}));return r.sort(((e,t)=>{let[,n]=e,[,o]=t;return o-n})),r.map((e=>{let[t]=e;return t}))};function Wm(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Rm,getTitle:r=Am,getDescription:l=Om,getKeywords:i=Dm,getCategory:a=zm,getCollection:s=Fm}=n,c=o(e),u=r(e),d=l(e),p=i(e),m=a(e),g=s(e),f=Hm(t),h=Hm(u);let v=0;if(f===h)v+=30;else if(h.startsWith(f))v+=20;else{const e=[c,u,d,...p,m,g].join(" "),t=Vm(f);0===Um(t,e).length&&(v+=10)}if(0!==v&&c.startsWith("core/")){v+=c!==e.id?1:2}return v}function Km(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,u.createElement)(h.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,_.sprintf)((0,_._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var qm=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,m.useDebounce)(pn.speak,500),[l,i]=Bm({shouldFocusBlock:!0}),[a,,s]=vm(i,l),c=(0,u.useMemo)((()=>o.map((e=>e.name))),[o]),d=(0,u.useMemo)((()=>t?jm(a,t):a.filter((e=>{var t,o;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every((e=>!c.includes(e))):null===(o=e.categories)||void 0===o?void 0:o.includes(n)}))),[t,n,a]);(0,u.useEffect)((()=>{if(!t)return;const e=d.length,n=(0,_.sprintf)((0,_._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const p=(0,m.useAsyncList)(d,{step:2}),g=!(null==d||!d.length);return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},g&&(0,u.createElement)(Km,{filterValue:t,filteredBlockPatternsLength:d.length}),(0,u.createElement)(mm,null,!g&&(0,u.createElement)(wm,null),g&&(0,u.createElement)(ym,{shownPatterns:p,blockPatterns:d,onClickPattern:s,isDraggable:!1})))};function Ym(e){let{initialCategory:t,patternCategories:n}=e;const[o,r]=(0,u.useState)(""),[l,i]=(0,u.useState)(null==t?void 0:t.name);return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,u.createElement)(Sm,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,u.createElement)(qm,{filterValue:o,selectedCategory:l,patternCategories:n}))}var Zm=function(e){let{onModalClose:t,...n}=e;return(0,u.createElement)(h.Modal,{title:(0,_.__)("Patterns"),onRequestClose:t,isFullScreen:!0},(0,u.createElement)(Ym,n))};function Qm(e){let{title:t}=e;return(0,u.createElement)(h.__experimentalVStack,{spacing:0},(0,u.createElement)(h.__experimentalView,null,(0,u.createElement)(h.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3},(0,u.createElement)(h.__experimentalHStack,{spacing:2},(0,u.createElement)(h.__experimentalNavigatorBackButton,{style:{minWidth:24,padding:0},icon:(0,_.isRTL)()?pd:md,isSmall:!0,"aria-label":(0,_.__)("Navigate to the previous view")}),(0,u.createElement)(h.__experimentalSpacer,null,(0,u.createElement)(h.__experimentalHeading,{level:5},t))))))}function Xm(e){let{categories:t,children:n}=e;return(0,u.createElement)(h.__experimentalNavigatorProvider,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation"},(0,u.createElement)(h.__experimentalNavigatorScreen,{path:"/"},(0,u.createElement)(h.__experimentalItemGroup,null,t.map((e=>(0,u.createElement)(h.__experimentalNavigatorButton,{key:e.name,path:`/category/${e.name}`,as:h.__experimentalItem,isAction:!0},(0,u.createElement)(h.__experimentalHStack,null,(0,u.createElement)(h.FlexBlock,null,e.label),(0,u.createElement)(Jl,{icon:(0,_.isRTL)()?md:pd}))))))),t.map((e=>(0,u.createElement)(h.__experimentalNavigatorScreen,{key:e.name,path:`/category/${e.name}`},(0,u.createElement)(Qm,{title:(0,_.__)("Back")}),n(e)))))}const Jm=()=>{},eg=["featured","posts","text","gallery","call-to-action","banner","header","footer"];function tg(e){const[t,n]=vm(void 0,e),o=(0,u.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>n.some((t=>t.name===e))))),[n]),r=(0,u.useMemo)((()=>{const e=n.filter((e=>t.some((t=>{var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)})))).sort(((e,t)=>{let{name:n}=e,{name:o}=t;return[n,o].some((e=>eg.includes(e)))?[n,o].every((e=>eg.includes(e)))?eg.indexOf(n)-eg.indexOf(o):eg.includes(n)?-1:1:0}));return t.some((e=>!o(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,_._x)("Uncategorized")}),e}),[t,n]);return r}function ng(e){let{rootClientId:t,onInsert:n,onHover:o,category:r,showTitlesAsTooltip:l}=e;const i=(0,u.useRef)();return(0,u.useEffect)((()=>{const e=setTimeout((()=>{const[e]=Ri.focus.tabbable.find(i.current);null==e||e.focus()}));return()=>clearTimeout(e)}),[r]),(0,u.createElement)("div",{ref:i,className:"block-editor-inserter__patterns-category-dialog"},(0,u.createElement)(og,{rootClientId:t,onInsert:n,onHover:o,category:r,showTitlesAsTooltip:l}))}function og(e){let{rootClientId:t,onInsert:n,onHover:o=Jm,category:r,showTitlesAsTooltip:l}=e;const[i,,a]=vm(n,t),s=tg(t),c=(0,u.useMemo)((()=>i.filter((e=>{var t,n,o;if("uncategorized"!==r.name)return null===(o=e.categories)||void 0===o?void 0:o.includes(r.name);return 0===(null!==(t=null===(n=e.categories)||void 0===n?void 0:n.filter((e=>s.find((t=>t.name===e)))))&&void 0!==t?t:[]).length}))),[i,r]),d=(0,m.useAsyncList)(c);return(0,u.useEffect)((()=>()=>o(null)),[]),c.length?(0,u.createElement)("div",{className:"block-editor-inserter__patterns-category-panel"},(0,u.createElement)("div",{className:"block-editor-inserter__patterns-category-panel-title"},r.label),(0,u.createElement)("p",null,r.description),(0,u.createElement)(ym,{shownPatterns:d,blockPatterns:c,onClickPattern:a,onHover:o,label:r.label,orientation:"vertical",category:r.label,isDraggable:!0,showTitlesAsTooltip:l})):null}var rg=function(e){let{onSelectCategory:t,selectedCategory:n,onInsert:o,rootClientId:r}=e;const[l,i]=(0,u.useState)(!1),a=tg(r),s=n||a[0],c=(0,m.useViewportMatch)("medium","<");return(0,u.createElement)(u.Fragment,null,!c&&(0,u.createElement)("div",{className:"block-editor-inserter__block-patterns-tabs-container"},(0,u.createElement)("nav",{"aria-label":(0,_.__)("Block pattern categories")},(0,u.createElement)(h.__experimentalItemGroup,{role:"list",className:"block-editor-inserter__block-patterns-tabs"},a.map((e=>(0,u.createElement)(h.__experimentalItem,{role:"listitem",key:e.name,onClick:()=>t(e),className:e===n?"block-editor-inserter__patterns-category block-editor-inserter__patterns-selected-category":"block-editor-inserter__patterns-category","aria-label":e.label,"aria-current":e===n?"true":void 0},(0,u.createElement)(h.__experimentalHStack,null,(0,u.createElement)(h.FlexBlock,null,e.label),(0,u.createElement)(Jl,{icon:pd}))))),(0,u.createElement)("div",{role:"listitem"},(0,u.createElement)(h.Button,{className:"block-editor-inserter__patterns-explore-button",onClick:()=>i(!0),variant:"secondary"},(0,_.__)("Explore all patterns")))))),c&&(0,u.createElement)(Xm,{categories:a},(e=>(0,u.createElement)(og,{onInsert:o,rootClientId:r,category:e,showTitlesAsTooltip:!1}))),l&&(0,u.createElement)(Zm,{initialCategory:s,patternCategories:a,onModalClose:()=>i(!1)}))},lg=window.wp.url;function ig(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=pm(o,n),i=(0,u.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,u.createElement)(wm,null):(0,u.createElement)(dm,{title:(0,_.__)("Reusable blocks")},(0,u.createElement)(um,{items:i,onSelect:l,onHover:t,label:(0,_.__)("Reusable blocks")}))}var ag=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(ig,{onHover:o,onInsert:n,rootClientId:t}),(0,u.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,u.createElement)(h.Button,{className:"block-editor-inserter__manage-reusable-blocks",variant:"secondary",href:(0,lg.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,_.__)("Manage Reusable blocks"))))};function sg(e){const[t,n]=(0,u.useState)([]),{canInsertImage:o,canInsertVideo:r,canInsertAudio:l}=(0,g.useSelect)((t=>{const{canInsertBlockType:n}=t(To);return{canInsertImage:n("core/image",e),canInsertVideo:n("core/video",e),canInsertAudio:n("core/audio",e)}}),[e]),i=function(){const{inserterMediaCategories:e,allowedMimeTypes:t,enableOpenverseMediaCategory:n}=(0,g.useSelect)((e=>{const t=e(To).getSettings();return{inserterMediaCategories:t.inserterMediaCategories,allowedMimeTypes:t.allowedMimeTypes,enableOpenverseMediaCategory:t.enableOpenverseMediaCategory}}),[]),o=(0,u.useMemo)((()=>{if(e&&t)return e.filter((e=>!(!n&&"openverse"===e.name)&&Object.values(t).some((t=>t.startsWith(`${e.mediaType}/`)))))}),[e,t,n]);return o}();return(0,u.useEffect)((()=>{(async()=>{const e=[];if(!i)return;const t=new Map(await Promise.all(i.map((async e=>{if(e.isExternalResource)return[e.name,!0];let t=[];try{t=await e.fetch({per_page:1})}catch(e){}return[e.name,!!t.length]})))),a={image:o,video:r,audio:l};i.forEach((n=>{a[n.mediaType]&&t.get(n.name)&&e.push(n)})),e.length&&n(e)})()}),[o,r,l,i]),t}var cg=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));var ug=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),dg=window.wp.blob;const pg={image:"img",video:"video",audio:"audio"};function mg(e,t){const n={id:e.id||void 0,caption:e.caption||void 0},o=e.url,r=e.alt||void 0;"image"===t?(n.url=o,n.alt=r):["video","audio"].includes(t)&&(n.src=o);const l=pg[t],i=(0,u.createElement)(l,{src:e.previewUrl||o,alt:r,controls:"audio"===t||void 0,inert:"true",onError:t=>{let{currentTarget:n}=t;n.src===e.previewUrl&&(n.src=o)}});return[(0,a.createBlock)(`core/${t}`,n),i]}const gg=["image"],fg={position:"bottom left",className:"block-editor-inserter__media-list__item-preview-options__popover"};function hg(e){let{category:t,media:n}=e;if(!t.getReportUrl)return null;const o=t.getReportUrl(n);return(0,u.createElement)(h.DropdownMenu,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,_.__)("Options"),popoverProps:fg,icon:cg},(()=>(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(h.MenuItem,{onClick:()=>window.open(o,"_blank").focus(),icon:ug},(0,_.sprintf)((0,_.__)("Report %s"),t.mediaType)))))}function vg(e){let{onClose:t,onSubmit:n}=e;return(0,u.createElement)(h.Modal,{title:(0,_.__)("Insert external image"),onRequestClose:t,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal"},(0,u.createElement)(h.__experimentalVStack,{spacing:3},(0,u.createElement)("p",null,(0,_.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")),(0,u.createElement)("p",null,(0,_.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation."))),(0,u.createElement)(h.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{variant:"tertiary",onClick:t},(0,_.__)("Cancel"))),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{variant:"primary",onClick:n},(0,_.__)("Insert")))))}function bg(e){var t;let{media:n,onClick:o,composite:r,category:l}=e;const[i,s]=(0,u.useState)(!1),[d,m]=(0,u.useState)(!1),[f,v]=(0,u.useState)(!1),[b,k]=(0,u.useMemo)((()=>mg(n,l.mediaType)),[n,l.mediaType]),{createErrorNotice:y,createSuccessNotice:E}=(0,g.useDispatch)(hm.store),C=(0,g.useSelect)((e=>e(To).getSettings().mediaUpload),[]),S=(0,u.useCallback)((e=>{if(f)return;const t=(0,a.cloneBlock)(e),{id:n,url:r,caption:l}=t.attributes;n?o(t):(v(!0),window.fetch(r).then((e=>e.blob())).then((e=>{C({filesList:[e],additionalData:{caption:l},onFileChange(e){let[n]=e;(0,dg.isBlobURL)(n.url)||(o({...t,attributes:{...t.attributes,id:n.id,url:n.url}}),E((0,_.__)("Image uploaded and inserted."),{type:"snackbar"}),v(!1))},allowedTypes:gg,onError(e){y(e,{type:"snackbar"}),v(!1)}})})).catch((()=>{s(!0),v(!1)})))}),[f,o,C,y,E]),w=(null===(t=n.title)||void 0===t?void 0:t.rendered)||n.title;let B;if(w.length>25){const e="...";B=w.slice(0,25-e.length)+e}const I=(0,u.useCallback)((()=>m(!0)),[]),x=(0,u.useCallback)((()=>m(!1)),[]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(im,{isEnabled:!0,blocks:[b]},(e=>{let{draggable:t,onDragStart:o,onDragEnd:i}=e;return(0,u.createElement)("div",{className:p()("block-editor-inserter__media-list__list-item",{"is-hovered":d}),draggable:t,onDragStart:o,onDragEnd:i},(0,u.createElement)(h.Tooltip,{text:B||w},(0,u.createElement)("div",{onMouseEnter:I,onMouseLeave:x},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},r,{className:"block-editor-inserter__media-list__item",onClick:()=>S(b),"aria-label":w}),(0,u.createElement)("div",{className:"block-editor-inserter__media-list__item-preview"},k,f&&(0,u.createElement)("div",{className:"block-editor-inserter__media-list__item-preview-spinner"},(0,u.createElement)(h.Spinner,null)))),!f&&(0,u.createElement)(hg,{category:l,media:n}))))})),i&&(0,u.createElement)(vg,{onClose:()=>s(!1),onSubmit:()=>{o((0,a.cloneBlock)(b)),E((0,_.__)("Image inserted."),{type:"snackbar"}),s(!1)}}))}var kg=function(e){let{mediaList:t,category:n,onClick:o,label:r=(0,_.__)("Media List")}=e;const l=(0,h.__unstableUseCompositeState)();return(0,u.createElement)(h.__unstableComposite,c({},l,{role:"listbox",className:"block-editor-inserter__media-list","aria-label":r}),t.map(((e,t)=>(0,u.createElement)(bg,{key:e.id||e.sourceId||t,media:e,category:n,onClick:o,composite:l}))))};function _g(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[t,n]=(0,u.useState)(e),[o,r]=(0,u.useState)(e),l=(0,m.useDebounce)(r,250);return(0,u.useEffect)((()=>{o!==t&&l(t)}),[o,t]),[t,n,o]}function yg(e){let{rootClientId:t,onInsert:n,category:o}=e;const r=(0,u.useRef)();return(0,u.useEffect)((()=>{const e=setTimeout((()=>{const[e]=Ri.focus.tabbable.find(r.current);null==e||e.focus()}));return()=>clearTimeout(e)}),[o]),(0,u.createElement)("div",{ref:r,className:"block-editor-inserter__media-dialog"},(0,u.createElement)(Eg,{rootClientId:t,onInsert:n,category:o}))}function Eg(e){let{rootClientId:t,onInsert:n,category:o}=e;const[r,l,i]=_g(),{mediaList:a,isLoading:s}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[n,o]=(0,u.useState)(),[r,l]=(0,u.useState)(!1),i=(0,u.useRef)();return(0,u.useEffect)((()=>{(async()=>{var n;const r=JSON.stringify({category:e.name,...t});i.current=r,l(!0),o([]);const a=await(null===(n=e.fetch)||void 0===n?void 0:n.call(e,t));r===i.current&&(o(a),l(!1))})()}),[e.name,...Object.values(t)]),{mediaList:n,isLoading:r}}(o,{per_page:i?20:10,search:i}),c="block-editor-inserter__media-panel",d=o.labels.search_items||(0,_.__)("Search");return(0,u.createElement)("div",{className:c},(0,u.createElement)(h.SearchControl,{className:`${c}-search`,onChange:l,value:r,label:d,placeholder:d}),s&&(0,u.createElement)("div",{className:`${c}-spinner`},(0,u.createElement)(h.Spinner,null)),!s&&!(null!=a&&a.length)&&(0,u.createElement)(wm,null),!s&&!(null==a||!a.length)&&(0,u.createElement)(kg,{rootClientId:t,onClick:n,mediaList:a,category:o}))}var Cg=function(e){let{fallback:t=null,children:n}=e;const o=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return!!t().mediaUpload}),[]);return o?n:t};var Sg=(0,h.withFilters)("editor.MediaUpload")((()=>null));const wg=["image","video","audio"];var Bg=function(e){let{rootClientId:t,selectedCategory:n,onSelectCategory:o,onInsert:r}=e;const l=sg(t),i=(0,m.useViewportMatch)("medium","<"),a="block-editor-inserter__media-tabs",s=(0,u.useCallback)((e=>{if(null==e||!e.url)return;const[t]=mg(e,e.type);r(t)}),[r]),c=(0,u.useMemo)((()=>l.map((e=>({...e,label:e.labels.name})))),[l]);return(0,u.createElement)(u.Fragment,null,!i&&(0,u.createElement)("div",{className:`${a}-container`},(0,u.createElement)("nav",{"aria-label":(0,_.__)("Media categories")},(0,u.createElement)(h.__experimentalItemGroup,{role:"list",className:a},l.map((e=>(0,u.createElement)(h.__experimentalItem,{role:"listitem",key:e.name,onClick:()=>o(e),className:p()(`${a}__media-category`,{"is-selected":n===e}),"aria-label":e.labels.name,"aria-current":e===n?"true":void 0},(0,u.createElement)(h.__experimentalHStack,null,(0,u.createElement)(h.FlexBlock,null,e.labels.name),(0,u.createElement)(Jl,{icon:pd}))))),(0,u.createElement)("div",{role:"listitem"},(0,u.createElement)(Cg,null,(0,u.createElement)(Sg,{multiple:!1,onSelect:s,allowedTypes:wg,render:e=>{let{open:t}=e;return(0,u.createElement)(h.Button,{onClick:e=>{e.target.focus(),t()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal"},(0,_.__)("Open Media Library"))}})))))),i&&(0,u.createElement)(Xm,{categories:c},(e=>(0,u.createElement)(Eg,{onInsert:r,rootClientId:t,category:e}))))};const{Fill:Ig,Slot:xg}=(0,h.createSlotFill)("__unstableInserterMenuExtension");Ig.Slot=xg;var Tg=Ig;const Mg=[];var Ng=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:s,maxBlockTypes:c,showBlockDirectory:d=!1,isDraggable:p=!0,shouldFocusBlock:g=!0,prioritizePatterns:f,selectBlockOnInsert:v,orderInitialBlockItems:b}=e;const k=(0,m.useDebounce)(pn.speak,500),[y,E]=Bm({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:g,selectBlockOnInsert:v}),[C,S,w,B]=pm(y,E),[I,,x]=vm(E,y),T=(0,u.useMemo)((()=>{if(0===s)return[];const e=jm(I,t);return void 0!==s?e.slice(0,s):e}),[t,I,s]);let M=c;f&&T.length>2&&(M=0);const N=(0,u.useMemo)((()=>{if(0===M)return[];let e=Y(C,"frecency","desc");!t&&b&&(e=b(e));const n=$m(e,S,w,t);return void 0!==M?n.slice(0,M):n}),[t,C,S,w,c,b]);(0,u.useEffect)((()=>{if(!t)return;const e=N.length+T.length,n=(0,_.sprintf)((0,_._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const P=(0,m.useAsyncList)(N,{step:9}),L=(0,m.useAsyncList)(P.length===N.length?T:Mg),R=N.length>0||T.length>0,A=!!N.length&&(0,u.createElement)(dm,{title:(0,u.createElement)(h.VisuallyHidden,null,(0,_.__)("Blocks"))},(0,u.createElement)(um,{items:P,onSelect:B,onHover:o,label:(0,_.__)("Blocks"),isDraggable:p})),O=!!T.length&&(0,u.createElement)(dm,{title:(0,u.createElement)(h.VisuallyHidden,null,(0,_.__)("Block Patterns"))},(0,u.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,u.createElement)(ym,{shownPatterns:L,blockPatterns:T,onClickPattern:x,onHover:o,isDraggable:p})));return(0,u.createElement)(mm,null,!d&&!R&&(0,u.createElement)(wm,null),f?O:A,!!N.length&&!!T.length&&(0,u.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),f?A:O,d&&(0,u.createElement)(Tg.Slot,{fillProps:{onSelect:B,onHover:o,filterValue:t,hasItems:R,rootClientId:y}},(e=>e.length?e:R?null:(0,u.createElement)(wm,null))))};const Pg={name:"blocks",title:(0,_.__)("Blocks")},Lg={name:"patterns",title:(0,_.__)("Patterns")},Rg={name:"reusable",title:(0,_.__)("Reusable"),icon:U},Ag={name:"media",title:(0,_.__)("Media")};var Og=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,showMedia:r=!1,onSelect:l,prioritizePatterns:i}=e;const a=(0,u.useMemo)((()=>{const e=[];return i&&n&&e.push(Lg),e.push(Pg),!i&&n&&e.push(Lg),r&&e.push(Ag),o&&e.push(Rg),e}),[i,Pg,n,Lg,o,r,Rg]);return(0,u.createElement)(h.TabPanel,{className:"block-editor-inserter__tabs",tabs:a,onSelect:l},t)};var Dg=(0,u.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,onSelect:i,showInserterHelpPanel:a,showMostUsedBlocks:s,__experimentalFilterValue:c="",shouldFocusBlock:d=!0,prioritizePatterns:m}=e;const[f,v,b]=_g(c),[k,y]=(0,u.useState)(null),[E,C]=(0,u.useState)(null),[S,w]=(0,u.useState)(null),[B,I]=(0,u.useState)(null),[x,T,M]=Bm({rootClientId:n,clientId:o,isAppender:r,insertionIndex:l,shouldFocusBlock:d}),{showPatterns:N,inserterItems:P}=(0,g.useSelect)((e=>{const{__experimentalGetAllowedPatterns:t,getInserterItems:n}=e(To);return{showPatterns:!!t(x).length,inserterItems:n(x)}}),[x]),L=(0,u.useMemo)((()=>P.some((e=>{let{category:t}=e;return"reusable"===t}))),[P]),R=!!sg(x).length,A=(0,u.useCallback)(((e,t,n)=>{T(e,t,n),i()}),[T,i]),O=(0,u.useCallback)(((e,t)=>{T(e,{patternName:t}),i()}),[T,i]),D=(0,u.useCallback)((e=>{M(!!e),y(e)}),[M,y]),z=(0,u.useCallback)((e=>{M(!!e)}),[M]),F=(0,u.useCallback)((e=>{C(e)}),[C]),V=(0,u.useMemo)((()=>(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"block-editor-inserter__block-list"},(0,u.createElement)(fm,{rootClientId:x,onInsert:A,onHover:D,showMostUsedBlocks:s})),a&&(0,u.createElement)("div",{className:"block-editor-inserter__tips"},(0,u.createElement)(h.VisuallyHidden,{as:"h2"},(0,_.__)("A tip for using the block editor")),(0,u.createElement)(dd,null)))),[x,A,D,b,s,a]),H=(0,u.useMemo)((()=>(0,u.createElement)(rg,{rootClientId:x,onInsert:O,onSelectCategory:F,selectedCategory:E})),[x,O,F,E]),G=(0,u.useMemo)((()=>(0,u.createElement)(ag,{rootClientId:x,onInsert:A,onHover:D})),[x,A,D]),U=(0,u.useMemo)((()=>(0,u.createElement)(Bg,{rootClientId:x,selectedCategory:S,onSelectCategory:w,onInsert:A})),[x,A,S,w]),$=(0,u.useCallback)((e=>"blocks"===e.name?V:"patterns"===e.name?H:"reusable"===e.name?G:"media"===e.name?U:void 0),[V,H,G,U]),j=(0,u.useRef)();(0,u.useImperativeHandle)(t,(()=>({focusSearch:()=>{j.current.focus()}})));const W="patterns"===B&&!b&&E,K=!b&&(N||L||R),q="media"===B&&!b&&S;return(0,u.createElement)("div",{className:"block-editor-inserter__menu"},(0,u.createElement)("div",{className:p()("block-editor-inserter__main-area",{"show-as-tabs":K})},(0,u.createElement)(h.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:e=>{k&&y(null),v(e)},value:f,label:(0,_.__)("Search for blocks and patterns"),placeholder:(0,_.__)("Search"),ref:j}),!!b&&(0,u.createElement)("div",{className:"block-editor-inserter__no-tab-container"},(0,u.createElement)(Ng,{filterValue:b,onSelect:i,onHover:D,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d})),K&&(0,u.createElement)(Og,{showPatterns:N,showReusableBlocks:L,showMedia:R,prioritizePatterns:m,onSelect:I},$),!b&&!K&&(0,u.createElement)("div",{className:"block-editor-inserter__no-tab-container"},V)),q&&(0,u.createElement)(yg,{rootClientId:x,onInsert:A,category:S}),a&&k&&(0,u.createElement)(tm,{item:k}),W&&(0,u.createElement)(ng,{rootClientId:x,onInsert:O,onHover:z,category:E,showTitlesAsTooltip:!0}))}));function zg(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:l,selectBlockOnInsert:i,orderInitialBlockItems:a}=e;const[s,c]=(0,u.useState)(""),[d,m]=Bm({onSelect:t,rootClientId:n,clientId:o,isAppender:r,selectBlockOnInsert:i}),[f]=pm(d,m),[v]=vm(m,d),{setInserterIsOpened:b,insertionIndex:k}=(0,g.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(To),l=t(),i=n(o),a=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?a:i}}),[o]),y=v.length&&(!!s||l),E=y&&v.length>6||f.length>6;(0,u.useEffect)((()=>{b&&b(!1)}),[b]);let C=0;return y&&(C=l?4:2),(0,u.createElement)("div",{className:p()("block-editor-inserter__quick-inserter",{"has-search":E,"has-expand":b})},E&&(0,u.createElement)(h.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",value:s,onChange:e=>{c(e)},label:(0,_.__)("Search for blocks and patterns"),placeholder:(0,_.__)("Search")}),(0,u.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,u.createElement)(Ng,{filterValue:s,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:C,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:l,selectBlockOnInsert:i,orderInitialBlockItems:a})),b&&(0,u.createElement)(h.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{b({rootClientId:n,insertionIndex:k,filterValue:s})},"aria-label":(0,_.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,_.__)("Browse all")))}const Fg=e=>{let{onToggle:t,disabled:n,isOpen:o,blockTitle:r,hasSingleBlockType:l,toggleProps:i={},prioritizePatterns:a}=e;const{as:s=h.Button,label:d,onClick:p,...m}=i;let g=d;return!g&&l?g=(0,_.sprintf)((0,_._x)("Add %s","directly add the only allowed block"),r):!g&&a?g=(0,_.__)("Add pattern"):g||(g=(0,_._x)("Add block","Generic label for block inserter button")),(0,u.createElement)(s,c({icon:cd,label:g,tooltipPosition:"bottom",onClick:function(e){t&&t(e),p&&p(e)},className:"block-editor-inserter__toggle","aria-haspopup":!l&&"true","aria-expanded":!l&&o,disabled:n},m))};class Vg extends u.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle(e){let{onToggle:t,isOpen:n}=e;const{disabled:o,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:a,hasItems:s,renderToggle:c=Fg,prioritizePatterns:u}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!s,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:a,prioritizePatterns:u})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,__experimentalIsQuick:i,prioritizePatterns:a,onSelectOrClose:s,selectBlockOnInsert:c,orderInitialBlockItems:d}=this.props;return i?(0,u.createElement)(zg,{onSelect:e=>{const n=Array.isArray(e)&&null!=e&&e.length?e[0]:e;s&&"function"==typeof s&&s(n),t()},rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:a,selectBlockOnInsert:c,orderInitialBlockItems:d}):(0,u.createElement)(Dg,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,prioritizePatterns:a})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,u.createElement)(h.Dropdown,{className:"block-editor-inserter",contentClassName:p()("block-editor-inserter__popover",{"is-quick":r}),popoverProps:{position:e,shift:!0},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,_.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}const Hg=(0,m.compose)([(0,g.withSelect)(((e,t)=>{var n;let{clientId:o,rootClientId:r,shouldDirectInsert:l=!0}=t;const{getBlockRootClientId:i,hasInserterItems:s,getAllowedBlocks:c,__experimentalGetDirectInsertBlock:u,getSettings:d}=e(To),{getBlockVariations:p}=e(a.store);r=r||i(o)||void 0;const m=c(r),g=l&&u(r),f=d(),h=1===(null==m?void 0:m.length)&&0===(null===(n=p(m[0].name,"inserter"))||void 0===n?void 0:n.length);let v=!1;return h&&(v=m[0]),{hasItems:s(r),hasSingleBlockType:h,blockTitle:v?v.title:"",allowedBlockType:v,directInsertBlock:g,rootClientId:r,prioritizePatterns:f.__experimentalPreferPatternsOnRoot&&!r}})),(0,g.withDispatch)(((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:r,isAppender:l,hasSingleBlockType:i,allowedBlockType:s,directInsertBlock:c,onSelectOrClose:u,selectBlockOnInsert:d}=t;if(!i&&!c)return;const{insertBlock:p}=e(To);let m;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:l}=o(To);if(!e||!r&&!n)return{};const i={};let a={};if(r){const e=t(r),n=t(l(r));(null==e?void 0:e.name)===(null==n?void 0:n.name)&&(a=(null==n?void 0:n.attributes)||{})}else{var s;const e=t(n);if(null!=e&&null!==(s=e.innerBlocks)&&void 0!==s&&s.length){const t=e.innerBlocks[e.innerBlocks.length-1];c&&(null==c?void 0:c.name)===t.name&&(a=t.attributes)}}return e.forEach((e=>{a.hasOwnProperty(e)&&(i[e]=a[e])})),i}(c.attributesToCopy);m=(0,a.createBlock)(c.name,{...c.attributes||{},...e})}else m=(0,a.createBlock)(s.name);var g;(p(m,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:i,getBlockRootClientId:a}=o(To);if(r)return e(r);const s=t();return!l&&s&&a(s)===n?e(s)+1:i(n).length}(),n,d),u)&&u({clientId:null===(g=m)||void 0===g?void 0:g.clientId});const f=(0,_.sprintf)((0,_.__)("%s block added"),s.title);(0,pn.speak)(f)}}})),(0,m.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(Vg);var Gg=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(Hg,c({ref:t},e,{orderInitialBlockItems:void 0}))));var Ug=(0,m.compose)((0,g.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(To),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,g.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(To);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:o,placeholder:r,rootClientId:l}=e;if(t)return null;const i=(0,sd.decodeEntities)(r)||(0,_.__)("Type / to choose a block");return(0,u.createElement)("div",{"data-root-client-id":l||"",className:p()("block-editor-default-block-appender",{"has-visible-prompt":o})},(0,u.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,_.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{Qu.ENTER!==e.keyCode&&Qu.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,u.createElement)(Gg,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function $g(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,u.createElement)(Gg,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:i,disabled:a,isOpen:s,blockTitle:c,hasSingleBlockType:d}=e;n=d?(0,_.sprintf)((0,_._x)("Add %s","directly add the only allowed block"),c):(0,_._x)("Add block","Generic label for block inserter button");const m=!d;let g=(0,u.createElement)(h.Button,{ref:t,onFocus:r,tabIndex:l,className:p()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":m?"true":void 0,"aria-expanded":m?s:void 0,disabled:a,label:n},!d&&(0,u.createElement)(h.VisuallyHidden,{as:"span"},n),(0,u.createElement)(Jl,{icon:cd}));return(m||d)&&(g=(0,u.createElement)(h.Tooltip,{text:n},g)),g},isAppender:!0})}const jg=(0,u.forwardRef)(((e,t)=>(W()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),$g(e,t))));var Wg=(0,u.forwardRef)($g);function Kg(e){let{rootClientId:t}=e;return(0,g.useSelect)((e=>e(To).canInsertBlockType((0,a.getDefaultBlockName)(),t)))?(0,u.createElement)(Ug,{rootClientId:t}):(0,u.createElement)(Wg,{rootClientId:t,className:"block-list-appender__toggle"})}var qg=function(e){let{rootClientId:t,renderAppender:n,className:o,tagName:r="div"}=e;const l=function(e,t){const{hideInserter:n,isParentSelected:o}=(0,g.useSelect)((t=>{const{getTemplateLock:n,getSelectedBlockClientId:o,__unstableGetEditorMode:r}=t(To),l=o();return{hideInserter:!!n(e)||"zoom-out"===r(),isParentSelected:e===l||!e&&!l}}),[e]);return n||!1===t?null:t?(0,u.createElement)(t,null):o?(0,u.createElement)(Kg,{rootClientId:e}):null}(t,n);return l?(0,u.createElement)(r,{tabIndex:-1,className:p()("block-list-appender wp-block",o),contentEditable:!1,"data-block":!0},l):null};const Yg=Number.MAX_SAFE_INTEGER;(0,u.createContext)();var Zg=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...i}=e;const[a,s]=(0,u.useReducer)((e=>(e+1)%Yg),0),{orientation:d,rootClientId:m,isVisible:f}=(0,g.useSelect)((e=>{var o;const{getBlockListSettings:r,getBlockRootClientId:l,isBlockVisible:i}=e(To),a=l(null!=t?t:n);return{orientation:(null===(o=r(a))||void 0===o?void 0:o.orientation)||"vertical",rootClientId:a,isVisible:i(t)&&i(n)}}),[t,n]),v=tr(t),b=tr(n),k="vertical"===d,y=(0,u.useMemo)((()=>{if(a<0||!v&&!b||!f)return{};const e=v?v.getBoundingClientRect():null,t=b?b.getBoundingClientRect():null;if(k)return{width:e?e.width:t.width,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,_.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:e?e.height:t.height}}),[v,b,k,a,f]),E=(0,u.useMemo)((()=>{if(a<0||!v&&!b||!f)return;const{ownerDocument:e}=v||b;return{ownerDocument:e,getBoundingClientRect(){const e=v?v.getBoundingClientRect():null,t=b?b.getBoundingClientRect():null;let n=0,o=0;return k?(o=e?e.bottom:t.top,n=(0,_.isRTL)()?e?e.right:t.right:e?e.left:t.left):(o=e?e.top:t.top,n=(0,_.isRTL)()?e?e.left:t.right:e?e.right:t.left),new window.DOMRect(n,o,0,0)}}}),[v,b,a,k,f]),C=qr(l);return(0,u.useLayoutEffect)((()=>{if(!v)return;const e=new window.MutationObserver(s);return e.observe(v,{attributes:!0}),()=>{e.disconnect()}}),[v]),(0,u.useLayoutEffect)((()=>{if(!b)return;const e=new window.MutationObserver(s);return e.observe(b,{attributes:!0}),()=>{e.disconnect()}}),[b]),(0,u.useLayoutEffect)((()=>{if(v)return v.ownerDocument.defaultView.addEventListener("resize",s),()=>{var e;null===(e=v.ownerDocument.defaultView)||void 0===e||e.removeEventListener("resize",s)}}),[v]),(v||b)&&f?(0,u.createElement)(h.Popover,c({ref:C,animate:!1,anchor:E,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+m},i,{className:p()("block-editor-block-popover","block-editor-block-popover__inbetween",i.className),resize:!1,flip:!1,placement:"bottom-start",variant:"unstyled"}),(0,u.createElement)("div",{className:"block-editor-block-popover__inbetween-container",style:y},o)):null};const Qg={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};var Xg=function(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{clientId:o}=(0,g.useSelect)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(To),o=n(),r=t(o.rootClientId);return r.length?{clientId:r[o.index]}:{}}),[]),r=(0,m.useReducedMotion)();return(0,u.createElement)(Zr,{clientId:o,__unstableCoverTarget:!0,__unstablePopoverSlot:t,__unstableContentRef:n,className:"block-editor-block-popover__drop-zone"},(0,u.createElement)(h.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:r?Qg.show:Qg.hide,animate:Qg.show,exit:r?Qg.show:Qg.exit,className:"block-editor-block-popover__drop-zone-foreground"}))};const Jg=(0,u.createContext)();function ef(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,g.useDispatch)(To),l=(0,u.useContext)(Jg),i=(0,u.useRef)(),{orientation:a,previousClientId:s,nextClientId:c,rootClientId:d,isInserterShown:f,isDistractionFree:v,isNavigationMode:b}=(0,g.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:a,getSettings:s,isNavigationMode:c}=e(To),u=r(),d=n(u.rootClientId);if(!d.length)return{};let p=d[u.index-1],m=d[u.index];for(;l(p);)p=i(p);for(;l(m);)m=a(m);const g=s();return{previousClientId:p,nextClientId:m,orientation:(null===(t=o(u.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:u.rootClientId,isNavigationMode:c(),isDistractionFree:g.isDistractionFree,isInserterShown:null==u?void 0:u.__unstableWithInserter}}),[]),k=(0,m.useReducedMotion)();const _={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:f?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},y={start:{scale:k?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(v&&!b)return null;const E=p()("block-editor-block-list__insertion-point","is-"+a);return(0,u.createElement)(Zg,{previousClientId:s,nextClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n},(0,u.createElement)(h.__unstableMotion.div,{layout:!k,initial:k?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&c&&o(c,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:p()(E,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==i.current||l.current||r()}},(0,u.createElement)(h.__unstableMotion.div,{variants:_,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),f&&(0,u.createElement)(h.__unstableMotion.div,{variants:y,className:p()("block-editor-block-list__insertion-point-inserter")},(0,u.createElement)(Gg,{position:"bottom center",clientId:c,rootClientId:d,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function tf(e){const{insertionPoint:t,isVisible:n}=(0,g.useSelect)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n}=e(To);return{insertionPoint:t(),isVisible:n()}}),[]);return n?"replace"===t.operation?(0,u.createElement)(Xg,c({key:`${t.rootClientId}-${t.index}`},e)):(0,u.createElement)(ef,e):null}function nf(){const e=(0,u.useContext)(Jg),t=(0,g.useSelect)((e=>e(To).getSettings().isDistractionFree||"zoom-out"===e(To).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:s,__unstableIsWithinBlockOverlay:c}=(0,g.useSelect)(To),{showInsertionPoint:d,hideInsertionPoint:p}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",l),()=>{o.removeEventListener("mousemove",l)};function l(t){var o;if(e.current)return;if(t.target.nodeType===t.target.TEXT_NODE)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void p();let l;if(!t.target.classList.contains("is-root-container")){l=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")}if(s(l))return;const u=(null===(o=n(l))||void 0===o?void 0:o.orientation)||"vertical",m=t.clientY,g=t.clientX;let f=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===u&&t.top>m||e.classList.contains("wp-block")&&"horizontal"===u&&t.left>g}));if(!f)return void p();if(!f.id&&(f=f.firstElementChild,!f))return void p();const h=f.id.slice("block-".length);if(!h||c(h))return;if(a().includes(h))return;const v=f.getBoundingClientRect();if("horizontal"===u&&(t.clientY>v.bottom||t.clientYv.right||t.clientX{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,rf="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function lf(e){return(0,g.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(To),{getBlockType:r,getActiveBlockVariation:l}=t(a.store),i=n(e),s=r(i);if(!s)return null;const c=o(e),u=l(i,c),d=(0,a.isReusableBlock)(s)||(0,a.isTemplatePart)(s),p={isSynced:d,title:s.title,icon:s.icon,description:s.description,anchor:null==c?void 0:c.anchor};return u?{isSynced:d,title:u.title||s.title,icon:u.icon||s.icon,description:u.description||s.description,anchor:null==c?void 0:c.anchor}:p}),[e])}function af(e){let{clientId:t,maximumLength:n,context:o}=e;const{attributes:r,name:l,reusableBlockTitle:i}=(0,g.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:r}=e(To),l=n(t);if(!l)return{};const i=(0,a.isReusableBlock)((0,a.getBlockType)(l));return{attributes:o(t),name:l,reusableBlockTitle:i&&r(o(t).ref)}}),[t]),s=lf(t);if(!l||!s)return null;const c=(0,a.getBlockType)(l),u=c?(0,a.__experimentalGetBlockLabel)(c,r,o):null,d=i||u,p=d&&d!==c.title?d:s.title;if(n&&n>0&&p.length>n){const e="...";return p.slice(0,n-e.length)+e}return p}function sf(e){let{clientId:t,maximumLength:n,context:o}=e;return af({clientId:t,maximumLength:n,context:o})}var cf=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:r,onDragEnd:l}=e;const{srcRootClientId:i,isDraggable:s,icon:c}=(0,g.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:r,getBlockName:l}=e(To),i=r(n[0]),s=l(n[0]);return{srcRootClientId:i,isDraggable:o(n,i),icon:null===(t=(0,a.getBlockType)(s))||void 0===t?void 0:t.icon}}),[n]),d=(0,u.useRef)(!1),[p,m,f]=function(){const e=(0,u.useRef)(null),t=(0,u.useRef)(null),n=(0,u.useRef)(null),o=(0,u.useRef)(null);return(0,u.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,u.useCallback)((r=>{e.current=r.clientY,n.current=(0,Ri.getScrollContainer)(r.target),o.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,u.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,l=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(r-l-50,0),n=Math.max(i-l-50,0)/e;t.current=25*n}else if(o.clientY{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,g.useDispatch)(To);if((0,u.useEffect)((()=>()=>{d.current&&b()}),[]),!s)return t({draggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:i};return(0,u.createElement)(h.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),d.current=!0,p(e),r&&r()},onDragOver:m,onDragEnd:()=>{b(),d.current=!1,f(),l&&l()},__experimentalDragComponent:(0,u.createElement)(lm,{count:n.length,icon:c})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))};var uf=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));var df=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const pf=(e,t)=>"up"===e?"horizontal"===t?(0,_.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,_.isRTL)()?"left":"right":"down":null;function mf(e,t,n,o,r,l,i){const a=n+1;if(e>1)return function(e,t,n,o,r,l){const i=t+1;if(n&&o)return(0,_.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=pf("down",l);if("down"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d down by one place"),e,i);if("left"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r>0&&o){const e=pf("down",l);if("down"===e)return(0,_.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,_.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,_.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const t=pf("up",l);if("up"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d up by one place"),e,i);if("left"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r<0&&n){const e=pf("up",l);if("up"===e)return(0,_.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,_.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,_.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,o,r,l,i);if(o&&r)return(0,_.sprintf)((0,_.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=pf("down",i);if("down"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d down to position %3$d"),t,a,a+1);if("left"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a+1);if("right"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a+1)}if(l>0&&r){const e=pf("down",i);if("down"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(l<0&&!o){const e=pf("up",i);if("up"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d up to position %3$d"),t,a,a-1);if("left"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a-1);if("right"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a-1)}if(l<0&&o){const e=pf("up",i);if("up"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}const gf=(e,t)=>"up"===e?"horizontal"===t?(0,_.isRTL)()?pd:md:uf:"down"===e?"horizontal"===t?(0,_.isRTL)()?md:pd:df:null,ff=(e,t)=>"up"===e?"horizontal"===t?(0,_.isRTL)()?(0,_.__)("Move right"):(0,_.__)("Move left"):(0,_.__)("Move up"):"down"===e?"horizontal"===t?(0,_.isRTL)()?(0,_.__)("Move left"):(0,_.__)("Move right"):(0,_.__)("Move down"):null,hf=(0,u.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:r,...l}=e;const i=(0,m.useInstanceId)(hf),s=Array.isArray(n)?n:[n],d=s.length,{blockType:f,isDisabled:v,rootClientId:b,isFirst:k,isLast:_,firstIndex:y,orientation:E="vertical"}=(0,g.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:n,getBlockOrder:l,getBlock:i,getBlockListSettings:c}=e(To),u=s[0],d=n(u),p=t(u),m=t(s[s.length-1]),g=l(d),f=i(u),h=0===p,v=m===g.length-1,{orientation:b}=c(d)||{};return{blockType:f?(0,a.getBlockType)(f.name):null,isDisabled:"up"===o?h:v,rootClientId:d,firstIndex:p,isFirst:h,isLast:v,orientation:r||b}}),[n,o]),{moveBlocksDown:C,moveBlocksUp:S}=(0,g.useDispatch)(To),w="up"===o?S:C,B=`block-editor-block-mover-button__description-${i}`;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Button,c({ref:t,className:p()("block-editor-block-mover-button",`is-${o}-button`),icon:gf(o,E),label:ff(o,E),"aria-describedby":B},l,{onClick:v?null:e=>{w(n,b),l.onClick&&l.onClick(e)},disabled:v,__experimentalIsFocusable:!0})),(0,u.createElement)(h.VisuallyHidden,{id:B},mf(d,f&&f.title,y,k,_,"up"===o?-1:1,E)))})),vf=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(hf,c({direction:"up",ref:t},e)))),bf=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(hf,c({direction:"down",ref:t},e))));var kf=function(e){let{clientIds:t,hideDragHandle:n}=e;const{canMove:o,rootClientId:r,isFirst:l,isLast:i,orientation:a}=(0,g.useSelect)((e=>{var n;const{getBlockIndex:o,getBlockListSettings:r,canMoveBlocks:l,getBlockOrder:i,getBlockRootClientId:a}=e(To),s=Array.isArray(t)?t:[t],c=s[0],u=a(c),d=o(c),p=o(s[s.length-1]),m=i(u);return{canMove:l(t,u),rootClientId:u,isFirst:0===d,isLast:p===m.length-1,orientation:null===(n=r(u))||void 0===n?void 0:n.orientation}}),[t]);if(!o||l&&i&&!r)return null;const s=(0,_.__)("Drag");return(0,u.createElement)(h.ToolbarGroup,{className:p()("block-editor-block-mover",{"is-horizontal":"horizontal"===a})},!n&&(0,u.createElement)(cf,{clientIds:t},(e=>(0,u.createElement)(h.Button,c({icon:rm,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:s,tabIndex:"-1"},e)))),(0,u.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(vf,c({clientIds:t},e)))),(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(bf,c({clientIds:t},e))))))};var _f=function(e){let{clientId:t,rootClientId:n}=e;const o=lf(t),r=(0,g.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:a,__unstableGetEditorMode:s}=e(To),c=l(t),{name:u,attributes:d}=r(t);return{index:c,name:u,attributes:d,blockMovingMode:i(),orientation:null===(o=a(n))||void 0===o?void 0:o.orientation,editorMode:s()}}),[t,n]),{index:l,name:i,attributes:s,blockMovingMode:d,orientation:m,editorMode:f}=r,{setNavigationMode:v,removeBlock:b}=(0,g.useDispatch)(To),k=(0,u.useRef)(),y=(0,a.getBlockType)(i),E=(0,a.__experimentalGetAccessibleBlockLabel)(y,s,l+1,m);(0,u.useEffect)((()=>{k.current.focus(),(0,pn.speak)(E)}),[E]);const C=tr(t),{hasBlockMovingClientId:S,getBlockIndex:w,getBlockRootClientId:B,getClientIdsOfDescendants:I,getSelectedBlockClientId:x,getMultiSelectedBlocksEndClientId:T,getPreviousBlockClientId:M,getNextBlockClientId:N}=(0,g.useSelect)(To),{selectBlock:P,clearSelectedBlock:L,setBlockMovingClientId:R,moveBlockToPosition:A}=(0,g.useDispatch)(To),O=p()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!d}),D=(0,_.__)("Drag");return(0,u.createElement)("div",{className:O},(0,u.createElement)(h.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(fd,{icon:null==o?void 0:o.icon,showColors:!0})),(0,u.createElement)(h.FlexItem,null,"zoom-out"===f&&(0,u.createElement)(kf,{clientIds:[t],hideDragHandle:!0}),"navigation"===f&&(0,u.createElement)(cf,{clientIds:[t]},(e=>(0,u.createElement)(h.Button,c({icon:rm,className:"block-selection-button_drag-handle","aria-hidden":"true",label:D,tabIndex:"-1"},e))))),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{ref:k,onClick:"navigation"===f?()=>v(!1):void 0,onKeyDown:function(e){const{keyCode:n}=e,o=n===Qu.UP,r=n===Qu.DOWN,l=n===Qu.LEFT,i=n===Qu.RIGHT,a=n===Qu.TAB,s=n===Qu.ESCAPE,c=n===Qu.ENTER,u=n===Qu.SPACE,d=e.shiftKey;if(n===Qu.BACKSPACE||n===Qu.DELETE)return b(t),void e.preventDefault();const p=x(),m=T(),g=M(m||p),f=N(m||p),h=a&&d||o,v=a&&!d||r,k=l,_=i;let y;if(h)y=g;else if(v)y=f;else if(k){var E;y=null!==(E=B(p))&&void 0!==E?E:p}else if(_){var O;y=null!==(O=I([p])[0])&&void 0!==O?O:p}const D=S();if(s&&D&&!e.defaultPrevented&&(R(null),e.preventDefault()),(c||u)&&D){const e=B(D),t=B(p),n=w(D);let o=w(p);n{!function(e){const[t]=Ri.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,xd.useShortcut)("core/block-editor/focus-toolbar",a),(0,u.useEffect)((()=>{l&&a()}),[n,l,a]),(0,u.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=yf(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=yf(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}var Cf=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const i=(0,u.useRef)(),a=function(e){const[t,n]=(0,u.useState)(!0),o=(0,u.useCallback)((()=>{const t=!Ri.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||W()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,u.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(i);return Ef(i,n,a,o,r),a?(0,u.createElement)(h.Toolbar,c({label:l["aria-label"],ref:i},l),t):(0,u.createElement)(h.NavigableMenu,c({orientation:"horizontal",role:"toolbar",ref:i},l),t)};const{clearTimeout:Sf,setTimeout:wf}=window,Bf=()=>{},If=200;function xf(e){let{ref:t,isFocused:n,debounceTimeout:o=If,onChange:r=Bf}=e;const[l,i]=(0,u.useState)(!1),a=(0,u.useRef)(),s=e=>{null!=t&&t.current&&i(e),r(e)},c=()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e},d=()=>{const e=a.current;e&&Sf&&Sf(e)};return(0,u.useEffect)((()=>()=>{s(!1),d()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),d(),l||s(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),d(),a.current=wf((()=>{c()&&s(!1)}),o)}}}function Tf(e){let{ref:t,debounceTimeout:n=If,onChange:o=Bf}=e;const[r,l]=(0,u.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:s}=xf({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),c=(0,u.useRef)(!1),d=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,u.useEffect)((()=>{const e=t.current,n=()=>{d()&&(l(!0),a())},o=()=>{d()||(l(!1),s())};return e&&!c.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),c.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,c,l,a,s]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:s}}}function Mf(){const{selectBlock:e,toggleBlockHighlight:t}=(0,g.useDispatch)(To),{firstParentClientId:n,shouldHide:o,isDistractionFree:r}=(0,g.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:r}=e(To),{hasBlockSupport:l}=e(a.store),i=n(o()),s=i[i.length-1],c=t(s),u=(0,a.getBlockType)(c),d=r();return{firstParentClientId:s,shouldHide:!l(u,"__experimentalParentSelector",!0),isDistractionFree:d.isDistractionFree}}),[]),l=lf(n),i=(0,u.useRef)(),{gestures:s}=Tf({ref:i,onChange(e){e&&r||t(n,e)}});return o||void 0===n?null:(0,u.createElement)("div",c({className:"block-editor-block-parent-selector",key:n,ref:i},s),(0,u.createElement)(h.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,_.sprintf)((0,_.__)("Select %s"),null==l?void 0:l.title),showTooltip:!0,icon:(0,u.createElement)(fd,{icon:null==l?void 0:l.icon})}))}var Nf=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"}));function Pf(e){let{blocks:t}=e;return(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,u.createElement)(h.Popover,{className:"block-editor-block-switcher__preview__popover",placement:"bottom-start",focusOnMount:!1},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,_.__)("Preview")),(0,u.createElement)(Jp,{viewportWidth:500,blocks:t})))))}function Lf(e){let{restTransformations:t,onSelect:n,setHoveredTransformItemName:o}=e;return t.map((e=>(0,u.createElement)(Rf,{key:e.name,item:e,onSelect:n,setHoveredTransformItemName:o})))}function Rf(e){let{item:t,onSelect:n,setHoveredTransformItemName:o}=e;const{name:r,icon:l,title:i,isDisabled:s}=t;return(0,u.createElement)(h.MenuItem,{className:(0,a.getBlockMenuDefaultClassName)(r),onClick:e=>{e.preventDefault(),n(r)},disabled:s,onMouseLeave:()=>o(null),onMouseEnter:()=>o(r)},(0,u.createElement)(fd,{icon:l,showColors:!0}),i)}var Af=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:r}=e;const[l,i]=(0,u.useState)(),{priorityTextTransformations:s,restTransformations:c}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,u.useMemo)((()=>{const n=Object.keys(t);return e.reduce(((e,t)=>{const{name:o}=t;return n.includes(o)?e.priorityTextTransformations.push(t):e.restTransformations.push(t),e}),{priorityTextTransformations:[],restTransformations:[]})}),[e]);return n.priorityTextTransformations.sort(((e,n)=>{let{name:o}=e,{name:r}=n;return t[o](0,u.createElement)(Rf,{key:e.name,item:e,onSelect:o,setHoveredTransformItemName:i}))),!d&&p),!!d&&(0,u.createElement)(h.MenuGroup,{className:t},p))};var Of=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),Df=window.wp.tokenList,zf=n.n(Df);function Ff(e,t,n){const o=new(zf())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function Vf(e){return null==e?void 0:e.find((e=>e.isDefault))}function Hf(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:r,blockType:l,className:i}=(0,g.useSelect)((e=>{const{getBlock:n}=e(To),o=n(t);if(!o)return{};const r=(0,a.getBlockType)(o.name),{getBlockStyles:l}=e(a.store);return{block:o,blockType:r,styles:l(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:s}=(0,g.useDispatch)(To),c=function(e){return e&&0!==e.length?Vf(e)?e:[{name:"default",label:(0,_._x)("Default","block style"),isDefault:!0},...e]:[]}(o),d=function(e,t){for(const n of new(zf())(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=null==e?void 0:e.find((e=>{let{name:n}=e;return n===t}));if(o)return o}return Vf(e)}(c,i),p=function(e,t){return(0,u.useMemo)((()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?(0,a.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,a.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(r,l);return{onSelect:e=>{const o=Ff(i,d,e);s(t,{className:o}),n()},stylesToRender:c,activeStyle:d,genericPreviewBlock:p,className:i}}const Gf=()=>{};function Uf(e){let{clientId:t,onSwitch:n=Gf}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=Hf({clientId:t,onSwitch:n});return r&&0!==r.length?(0,u.createElement)(u.Fragment,null,r.map((e=>{const t=e.label||e.name;return(0,u.createElement)(h.MenuItem,{key:e.name,icon:l.name===e.name?Of:null,onClick:()=>o(e)},(0,u.createElement)(h.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function $f(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,u.createElement)(h.MenuGroup,{label:(0,_.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,u.createElement)(Uf,{clientId:o,onSwitch:n}))}const jf=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const{clientId:o,name:r,innerBlocks:l=[]}=e;if(!n.has(o)){if(r===t)return e;for(const e of l){const o=jf(e,t,n);if(o)return o}}},Wf=(e,t)=>{const n=((e,t)=>{const n=(0,a.__experimentalGetBlockAttributesNamesByRole)(e,"content");return null!=n&&n.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};var Kf=(e,t)=>(0,u.useMemo)((()=>e.reduce(((e,n)=>{const o=((e,t)=>{const n=t.map((e=>(0,a.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=jf(r,t.name,o);if(n){e=!0,o.add(n.clientId),Wf(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]);function qf(e){let{patterns:t,onSelect:n}=e;return(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,u.createElement)(h.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,_.__)("Preview")),(0,u.createElement)(Yf,{patterns:t,onSelect:n})))))}function Yf(e){let{patterns:t,onSelect:n}=e;const o=(0,h.__unstableUseCompositeState)();return(0,u.createElement)(h.__unstableComposite,c({},o,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,_.__)("Patterns list")}),t.map((e=>(0,u.createElement)(Zf,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Zf(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,m.useInstanceId)(Zf,`${r}-list__item-description`);return(0,u.createElement)("div",{className:`${r}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?l:void 0},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},o,{className:`${r}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,u.createElement)(Jp,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,u.createElement)("div",{className:`${r}-list__item-title`},t.title)),!!t.description&&(0,u.createElement)(h.VisuallyHidden,{id:l},t.description))}var Qf=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[r,l]=(0,u.useState)(!1),i=Kf(n,t);return i.length?(0,u.createElement)(h.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},r&&(0,u.createElement)(qf,{patterns:i,onSelect:o}),(0,u.createElement)(h.MenuItem,{onClick:e=>{e.preventDefault(),l(!r)},icon:pd},(0,_.__)("Patterns"))):null};const Xf=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o,multiSelect:r}=(0,g.useDispatch)(To),l=lf(n[0].clientId),{possibleBlockTransformations:i,canRemove:s,hasBlockStyles:c,icon:d,patterns:p}=(0,g.useSelect)((e=>{const{getBlockRootClientId:o,getBlockTransformItems:r,__experimentalGetPatternTransformItems:i}=e(To),{getBlockStyles:s,getBlockType:c}=e(a.store),{canRemoveBlocks:u}=e(To),d=o(Array.isArray(t)?t[0]:t),[{name:p}]=n,m=1===n.length,g=m&&s(p);let f;if(m)f=null==l?void 0:l.icon;else{var h;f=1===new Set(n.map((e=>{let{name:t}=e;return t}))).size?null===(h=c(p))||void 0===h?void 0:h.icon:Nf}return{possibleBlockTransformations:r(n,d),canRemove:u(t,d),hasBlockStyles:!(null==g||!g.length),icon:f,patterns:i(n,d)}}),[t,n,null==l?void 0:l.icon]),m=af({clientId:Array.isArray(t)?t[0]:t,maximumLength:35}),f=1===n.length&&(0,a.isReusableBlock)(n[0]),v=1===n.length&&(0,a.isTemplatePart)(n[0]);function b(e){e.length>1&&r(e[0].clientId,e[e.length-1].clientId)}const k=!!i.length&&s&&!v,y=!(null==p||!p.length)&&s;if(!c&&!k)return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:m,icon:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(fd,{icon:d,showColors:!0}),(f||v)&&(0,u.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},m))}));const E=m,C=1===n.length?(0,_.sprintf)((0,_.__)("%s: Change block type or style"),m):(0,_.sprintf)((0,_._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),S=c||k||y;return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(h.DropdownMenu,{className:"block-editor-block-switcher",label:E,popoverProps:{position:"bottom right",variant:"toolbar",className:"block-editor-block-switcher__popover"},icon:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(fd,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(f||v)&&(0,u.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},m)),toggleProps:{describedBy:C,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:r}=e;return S&&(0,u.createElement)("div",{className:"block-editor-block-switcher__container"},y&&(0,u.createElement)(Qf,{blocks:n,patterns:p,onSelect:e=>{!function(e){o(t,e),b(e)}(e),r()}}),k&&(0,u.createElement)(Af,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,blocks:n,onSelect:e=>{!function(e){const r=(0,a.switchToBlockType)(n,e);o(t,r),b(r)}(e),r()}}),c&&(0,u.createElement)($f,{hoveredBlock:n[0],onSwitch:r}))})))))};var Jf=e=>{let{clientIds:t}=e;const n=(0,g.useSelect)((e=>e(To).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,u.createElement)(Xf,{clientIds:t,blocks:n})};const{Fill:eh,Slot:th}=(0,h.createSlotFill)("__unstableBlockToolbarLastItem");eh.Slot=th;var nh=eh;function oh(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;if(1!==(null===(n=t.match(e))||void 0===n?void 0:n.length))return!0;const o=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(o))return!0}return!1}function rh(){const{getBlockName:e}=(0,g.useSelect)(To),{getBlockType:t}=(0,g.useSelect)(a.store),{createSuccessNotice:n}=(0,g.useDispatch)(hm.store);return(0,u.useCallback)(((o,r)=>{let l="";if(1===r.length){var i;const n=r[0],a=null===(i=t(e(n)))||void 0===i?void 0:i.title;l="copy"===o?(0,_.sprintf)((0,_.__)('Copied "%s" to clipboard.'),a):(0,_.sprintf)((0,_.__)('Moved "%s" to clipboard.'),a)}else l="copy"===o?(0,_.sprintf)((0,_._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,_.sprintf)((0,_._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function lh(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:r,__unstableIsSelectionCollapsed:l,__unstableIsSelectionMergeable:i,__unstableGetSelectedBlocksWithPartialSelection:s,canInsertBlockType:c}=(0,g.useSelect)(To),{flashBlock:u,removeBlocks:d,replaceBlocks:p,__unstableDeleteSelection:f,__unstableExpandSelection:h,insertBlocks:v}=(0,g.useDispatch)(To),b=rh();return(0,m.useRefEffect)((m=>{function g(g){const k=t();if(0===k.length)return;if(!n()){const{target:e}=g,{ownerDocument:t}=e;if("copy"===g.type||"cut"===g.type?(0,Ri.documentHasUncollapsedSelection)(t):(0,Ri.documentHasSelection)(t))return}if(!m.contains(g.target.ownerDocument.activeElement))return;const _=g.defaultPrevented;g.preventDefault();const y=i(),E=l()||r(),C=!E&&!y;if("copy"===g.type||"cut"===g.type)if(1===k.length&&u(k[0]),C)h();else{let t;if(b(g.type,k),E)t=e(k);else{const[n,o]=s();t=[n,...e(k.slice(1,k.length-1)),o]}const n=g.clipboardData.getData("__unstableWrapperBlockName");n&&(t=(0,a.createBlock)(n,JSON.parse(g.clipboardData.getData("__unstableWrapperBlockAttributes")),t));const o=(0,a.serialize)(t);g.clipboardData.setData("text/plain",function(e){e=e.replace(/
/g,"\n");return(0,Ri.__unstableStripHTML)(e).trim().replace(/\n\n+/g,"\n\n")}(o)),g.clipboardData.setData("text/html",o)}if("cut"===g.type)E&&!C?d(k):f();else if("paste"===g.type){if(_)return;const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n,files:r}=function(e){let{clipboardData:t}=e,n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}const r=(0,Ri.getFilesFromDataTransfer)(t);return r.length&&!oh(r,o)?{files:r}:{html:o,plainText:n,files:[]}}(g);let l=[];if(r.length){const e=(0,a.getBlockTransforms)("from");l=r.reduce(((t,n)=>{const o=(0,a.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat()}else l=(0,a.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});if(1===k.length){const[e]=k;if(l.every((t=>c(t.name,e))))return void v(l,void 0,e)}p(k,l,l.length-1,-1)}}return m.ownerDocument.addEventListener("copy",g),m.ownerDocument.addEventListener("cut",g),m.ownerDocument.addEventListener("paste",g),()=>{m.ownerDocument.removeEventListener("copy",g),m.ownerDocument.removeEventListener("cut",g),m.ownerDocument.removeEventListener("paste",g)}}),[])}var ih=function(e){let{children:t}=e;return(0,u.createElement)("div",{ref:lh()},t)};const ah="align",sh="__experimentalBorder",ch="color",uh="customClassName",dh="typography.__experimentalFontFamily",ph="typography.fontSize",mh="__experimentalLayout",gh=[...["typography.lineHeight",ph,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",dh,"typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"],sh,ch,"spacing"];const fh={align:e=>(0,a.hasBlockSupport)(e,ah),borderColor:e=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==u.Platform.OS)return!1;const n=(0,a.getBlockSupport)(e,sh);return!!(!0===n||("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}(e,"color"),backgroundColor:e=>{const t=(0,a.getBlockSupport)(e,ch);return t&&!1!==t.background},textColor:e=>{const t=(0,a.getBlockSupport)(e,ch);return t&&!1!==t.text},gradient:e=>{const t=(0,a.getBlockSupport)(e,ch);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>(0,a.hasBlockSupport)(e,uh,!0),fontFamily:e=>(0,a.hasBlockSupport)(e,dh),fontSize:e=>(0,a.hasBlockSupport)(e,ph),layout:e=>(0,a.hasBlockSupport)(e,mh),style:e=>gh.some((t=>(0,a.hasBlockSupport)(e,t)))};function hh(e,t){return Object.entries(fh).reduce(((n,o)=>{let[r,l]=o;return l(e.name)&&l(t.name)&&(n[r]=e.attributes[r]),n}),{})}function vh(e,t,n){for(let o=0;o{let i="";try{if(!window.navigator.clipboard)return void r((0,_.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});i=await window.navigator.clipboard.readText()}catch(e){return void r((0,_.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"})}if(!i||!function(e){try{const t=(0,a.parse)(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return 1!==t.length||"core/freeform"!==t[0].name}catch(e){return!1}}(i))return void o((0,_.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});const s=(0,a.parse)(i);if(1===s.length?e.batch((()=>{vh(l,l.map((()=>s[0])),t)})):e.batch((()=>{vh(l,s,t)})),1===l.length){var c;const e=null===(c=(0,a.getBlockType)(l[0].name))||void 0===c?void 0:c.title;n((0,_.sprintf)((0,_.__)("Pasted styles to %s."),e),{type:"snackbar"})}else n((0,_.sprintf)((0,_.__)("Pasted styles to %d blocks."),l.length),{type:"snackbar"})}),[e.batch,t,n,o,r])}function kh(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:r,getBlockRootClientId:l,getBlocksByClientId:i,canMoveBlocks:s,canRemoveBlocks:c}=(0,g.useSelect)(To),{getDefaultBlockName:u,getGroupingBlockName:d}=(0,g.useSelect)(a.store),p=i(t),m=l(t[0]),f=p.every((e=>!!e&&(0,a.hasBlockSupport)(e.name,"multiple",!0)&&r(e.name,m))),h=r(u(),m),v=s(t,m),b=c(t,m),{removeBlocks:k,replaceBlocks:_,duplicateBlocks:y,insertAfterBlock:E,insertBeforeBlock:C,flashBlock:S,setBlockMovingClientId:w,setNavigationMode:B,selectBlock:I}=(0,g.useDispatch)(To),x=rh(),T=bh();return n({canDuplicate:f,canInsertDefaultBlock:h,canMove:v,canRemove:b,rootClientId:m,blocks:p,onDuplicate(){return y(t,o)},onRemove(){return k(t,o)},onInsertBefore(){const e=Array.isArray(t)?t[0]:e;C(e)},onInsertAfter(){const e=Array.isArray(t)?t[t.length-1]:e;E(e)},onMoveTo(){B(!0),I(t[0]),w(t[0])},onGroup(){if(!p.length)return;const e=d(),n=(0,a.switchToBlockType)(p,e);n&&_(t,n)},onUngroup(){if(!p.length)return;const e=p[0].innerBlocks;e.length&&_(t,e)},onCopy(){const e=p.map((e=>{let{clientId:t}=e;return t}));1===p.length&&S(e[0]),x("copy",e)},async onPasteStyles(){await T(p)}})}const _h=()=>{};var yh=(0,m.compose)([(0,g.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:r,getSettings:l}=e(To),i=o(n),s=l().codeEditingEnabled;return{mode:r(n),blockType:i?(0,a.getBlockType)(i.name):null,isCodeEditingEnabled:s}})),(0,g.withDispatch)(((e,t)=>{let{onToggle:n=_h,clientId:o}=t;return{onToggleMode(){e(To).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:r=!1,isCodeEditingEnabled:l=!0}=e;if(!t||!(0,a.hasBlockSupport)(t,"html",!0)||!l)return null;const i="visual"===n?(0,_.__)("Edit as HTML"):(0,_.__)("Edit visually");return(0,u.createElement)(h.MenuItem,{onClick:o},!r&&i)}));var Eh=(0,m.compose)((0,g.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(To).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,g.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(To).replaceBlocks(n.clientId,(0,a.rawHandler)({HTML:(0,a.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const r=(0,_.__)("Convert to Blocks");return(0,u.createElement)(h.MenuItem,{onClick:n},!o&&r)}));const{Fill:Ch,Slot:Sh}=(0,h.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Ch.Slot=Sh;var wh=Ch;function Bh(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}=(0,g.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:r,getSelectedBlockClientIds:l}=e(To),{getGroupingBlockName:i}=e(a.store),s=l(),c=i(),u=r(c,null!=s&&s.length?n(s[0]):void 0),d=o(s),p=1===d.length&&(null===(t=d[0])||void 0===t?void 0:t.name)===c;return{clientIds:s,isGroupable:u&&d.length,isUngroupable:p&&!!d[0].innerBlocks.length,blocksSelection:d,groupingBlockName:c}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}}function Ih(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:r,groupingBlockName:l,onClose:i=(()=>{})}=e;const{replaceBlocks:s}=(0,g.useDispatch)(To);return n||o?(0,u.createElement)(u.Fragment,null,n&&(0,u.createElement)(h.MenuItem,{onClick:()=>{(()=>{const e=(0,a.switchToBlockType)(r,l);e&&s(t,e)})(),i()}},(0,_._x)("Group","verb")),o&&(0,u.createElement)(h.MenuItem,{onClick:()=>{(()=>{const e=r[0].innerBlocks;e.length&&s(t,e)})(),i()}},(0,_._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function xh(e){return(0,g.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:a,getTemplateLock:s}=t(To),c=a(e),u=n(e),d=o(e,c),p=r(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:l(i(e)),isContentLocked:"contentOnly"===s(e),isLocked:!u||!d||!p}}),[e])}var Th=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"}));var Mh=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zM9.8 7c0-1.2 1-2.2 2.2-2.2 1.2 0 2.2 1 2.2 2.2v3H9.8V7zm6.7 11.5h-9v-7h9v7z"}));var Nh=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"}));const Ph=["core/block","core/navigation"];function Lh(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function Rh(e){let{clientId:t,onClose:n}=e;const[o,r]=(0,u.useState)({move:!1,remove:!1}),{canEdit:l,canMove:i,canRemove:s}=xh(t),{allowsEditLocking:c,templateLock:d,hasTemplateLock:p}=(0,g.useSelect)((e=>{var n,o;const{getBlockName:r,getBlockAttributes:l}=e(To),i=r(t),s=(0,a.getBlockType)(i);return{allowsEditLocking:Ph.includes(i),templateLock:null===(n=l(t))||void 0===n?void 0:n.templateLock,hasTemplateLock:!(null==s||null===(o=s.attributes)||void 0===o||!o.templateLock)}}),[t]),[f,v]=(0,u.useState)(!!d),{updateBlockAttributes:b}=(0,g.useDispatch)(To),k=lf(t),y=(0,m.useInstanceId)(Rh,"block-editor-block-lock-modal__options-title");(0,u.useEffect)((()=>{r({move:!i,remove:!s,...c?{edit:!l}:{}})}),[l,i,s,c]);const E=Object.values(o).every(Boolean),C=Object.values(o).some(Boolean)&&!E;return(0,u.createElement)(h.Modal,{title:(0,_.sprintf)((0,_.__)("Lock %s"),k.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:n},(0,u.createElement)("p",null,(0,_.__)("Choose specific attributes to restrict or lock all available options.")),(0,u.createElement)("form",{onSubmit:e=>{e.preventDefault(),b([t],{lock:o,templateLock:f?Lh(o):void 0}),n()}},(0,u.createElement)("div",{role:"group","aria-labelledby":y,className:"block-editor-block-lock-modal__options"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-title",label:(0,u.createElement)("span",{id:y},(0,_.__)("Lock all")),checked:E,indeterminate:C,onChange:e=>r({move:e,remove:e,...c?{edit:e}:{}})}),(0,u.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},c&&(0,u.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Restrict editing"),checked:!!o.edit,onChange:e=>r((t=>({...t,edit:e})))}),(0,u.createElement)(h.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.edit?Nh:Th})),(0,u.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Disable movement"),checked:o.move,onChange:e=>r((t=>({...t,move:e})))}),(0,u.createElement)(h.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.move?Nh:Th})),(0,u.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Prevent removal"),checked:o.remove,onChange:e=>r((t=>({...t,remove:e})))}),(0,u.createElement)(h.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.remove?Nh:Th}))),p&&(0,u.createElement)(h.ToggleControl,{className:"block-editor-block-lock-modal__template-lock",label:(0,_.__)("Apply to all blocks inside"),checked:f,disabled:o.move&&!o.remove,onChange:()=>v(!f)})),(0,u.createElement)(h.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{variant:"tertiary",onClick:n},(0,_.__)("Cancel"))),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{variant:"primary",type:"submit"},(0,_.__)("Apply"))))))}function Ah(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=xh(t),[r,l]=(0,u.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,_.__)("Unlock"):(0,_.__)("Lock");return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuItem,{icon:o?Th:Mh,onClick:l},i),r&&(0,u.createElement)(Rh,{clientId:t,onClose:l}))}const{Fill:Oh,Slot:Dh}=(0,h.createSlotFill)("BlockSettingsMenuControls");function zh(e){let{...t}=e;return(0,u.createElement)(h.__experimentalStyleProvider,{document:document},(0,u.createElement)(Oh,t))}zh.Slot=e=>{let{fillProps:t,clientIds:n=null,__unstableDisplayLocation:o}=e;const{selectedBlocks:r,selectedClientIds:l,canRemove:i}=(0,g.useSelect)((e=>{const{getBlockNamesByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e(To),l=null!==n?n:o();return{selectedBlocks:t(l),selectedClientIds:l,canRemove:r(l)}}),[n]),{canLock:a}=xh(l[0]),s=1===l.length&&a,d=Bh(),{isGroupable:p,isUngroupable:m}=d,f=(p||m)&&i;return(0,u.createElement)(Dh,{fillProps:{...t,__unstableDisplayLocation:o,selectedBlocks:r,selectedClientIds:l}},(e=>!(null!=e&&e.length)>0&&!f&&!s?null:(0,u.createElement)(h.MenuGroup,null,s&&(0,u.createElement)(Ah,{clientId:l[0]}),e,f&&(0,u.createElement)(Ih,c({},d,{onClose:null==t?void 0:t.onClose})))))};var Fh=zh;const Vh=()=>{},Hh={className:"block-editor-block-settings-menu__popover",position:"bottom right",variant:"toolbar"};function Gh(e){let{blocks:t,onCopy:n,label:o}=e;const r=(0,m.useCopyToClipboard)((()=>(0,a.serialize)(t)),n),l=t.length>1?(0,_.__)("Copy blocks"):(0,_.__)("Copy block"),i=o||l;return(0,u.createElement)(h.MenuItem,{ref:r},i)}var Uh=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,__unstableDisplayLocation:r,...l}=e;const i=Array.isArray(t)?t:[t],s=i.length,d=i[0],{firstParentClientId:p,isDistractionFree:f,onlyBlock:v,parentBlockType:b,previousBlockClientId:k,nextBlockClientId:y,selectedBlockClientIds:E}=(0,g.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:o,getPreviousBlockClientId:r,getNextBlockClientId:l,getSelectedBlockClientIds:i,getSettings:s,getBlockAttributes:c}=e(To),{getActiveBlockVariation:u}=e(a.store),p=o(d),m=p&&n(p);return{firstParentClientId:p,isDistractionFree:s().isDistractionFree,onlyBlock:1===t(p),parentBlockType:p&&(u(m,c(p))||(0,a.getBlockType)(m)),previousBlockClientId:r(d),nextBlockClientId:l(d),selectedBlockClientIds:i()}}),[d]),C=(0,g.useSelect)((e=>{const{getShortcutRepresentation:t}=e(xd.store);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),{selectBlock:S,toggleBlockHighlight:w}=(0,g.useDispatch)(To),B=(0,u.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:Vh,[n]),I=af({clientId:d,maximumLength:25}),x=(0,u.useCallback)(n?()=>{const e=k||y||p;e&&E.includes(d)&&!E.includes(e)&&n(e)}:Vh,[n,k,y,p,E]),T=(0,_.sprintf)((0,_.__)("Remove %s"),I),M=1===s?T:(0,_.__)("Remove blocks"),N=(0,u.useRef)(),{gestures:P}=Tf({ref:N,onChange(e){e&&f||w(p,e)}}),L=null==E?void 0:E.includes(p);return(0,u.createElement)(kh,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:i,canMove:a,canRemove:g,onDuplicate:f,onInsertAfter:k,onInsertBefore:y,onRemove:E,onCopy:w,onPasteStyles:I,onMoveTo:T,blocks:R}=e;return(0,u.createElement)(h.DropdownMenu,c({icon:cg,label:(0,_.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:Hh,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(wh.Slot,{fillProps:{onClose:l}}),!L&&!!p&&(0,u.createElement)(h.MenuItem,c({},P,{ref:N,icon:(0,u.createElement)(fd,{icon:b.icon}),onClick:()=>S(p)}),(0,_.sprintf)((0,_.__)("Select parent block (%s)"),b.title)),1===s&&(0,u.createElement)(Eh,{clientId:d}),(0,u.createElement)(Gh,{blocks:R,onCopy:w}),n&&(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,f,B),shortcut:C.duplicate},(0,_.__)("Duplicate")),i&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,y),shortcut:C.insertBefore},(0,_.__)("Insert before")),(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,k),shortcut:C.insertAfter},(0,_.__)("Insert after"))),a&&!v&&(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,T)},(0,_.__)("Move to")),1===s&&(0,u.createElement)(yh,{clientId:d,onToggle:l})),(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(Gh,{blocks:R,onCopy:w,label:(0,_.__)("Copy styles")}),(0,u.createElement)(h.MenuItem,{onClick:I},(0,_.__)("Paste styles"))),(0,u.createElement)(Fh.Slot,{fillProps:{onClose:l},clientIds:t,__unstableDisplayLocation:r}),"function"==typeof o?o({onClose:l}):u.Children.map((e=>(0,u.cloneElement)(e,{onClose:l}))),g&&(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,E,x),shortcut:C.remove},M)))}))}))};var $h=function(e){let{clientIds:t,...n}=e;return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(Uh,c({clientIds:t,toggleProps:e},n)))))};function jh(e){let{clientId:t}=e;const n=lf(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=xh(t),[a,s]=(0,u.useReducer)((e=>!e),!1);return i?o&&r&&l?null:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,u.createElement)(h.ToolbarButton,{icon:Nh,label:(0,_.sprintf)((0,_.__)("Unlock %s"),n.title),onClick:s})),a&&(0,u.createElement)(Rh,{clientId:t,onClose:s})):null}var Wh=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"}));var Kh=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"}));var qh=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"}));const Yh={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var Zh=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=Bh(),{replaceBlocks:r}=(0,g.useDispatch)(To),{canRemove:l,variations:i}=(0,g.useSelect)((e=>{const{canRemoveBlocks:o}=e(To),{getBlockVariations:r}=e(a.store);return{canRemove:o(t),variations:r(n,"transform")}}),[t,n]),s=o=>{const l=(0,a.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),l&&l.length>0&&(l[0].attributes.layout=Yh[o],r(t,l))};if(!o||!l)return null;const c=!!i.find((e=>{let{name:t}=e;return"group-row"===t})),d=!!i.find((e=>{let{name:t}=e;return"group-stack"===t}));return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{icon:Wh,label:(0,_._x)("Group","verb"),onClick:s}),c&&(0,u.createElement)(h.ToolbarButton,{icon:Kh,label:(0,_._x)("Row","single horizontal line"),onClick:()=>s("row")}),d&&(0,u.createElement)(h.ToolbarButton,{icon:qh,label:(0,_._x)("Stack","verb"),onClick:()=>s("stack")}))};function Qh(e){let{clientIds:t}=e;const n=1===t.length?t[0]:void 0,o=(0,g.useSelect)((e=>!!n&&"html"===e(To).getBlockMode(n)),[n]),{toggleBlockMode:r}=(0,g.useDispatch)(To);return o?(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{onClick:()=>{r(n)}},(0,_.__)("Edit visually"))):null}var Xh=(0,u.createContext)("");var Jh=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:r,hasFixedToolbar:l,isDistractionFree:i,isValid:s,isVisual:d,isContentLocked:f}=(0,g.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:r,getBlockRootClientId:l,getSettings:i,__unstableGetContentLockingParent:s}=e(To),c=o(),u=c[0],d=l(u),p=i();return{blockClientIds:c,blockClientId:u,blockType:u&&(0,a.getBlockType)(t(u)),hasFixedToolbar:p.hasFixedToolbar,isDistractionFree:p.isDistractionFree,rootClientId:d,isValid:c.every((e=>r(e))),isVisual:c.every((e=>"visual"===n(e))),isContentLocked:!!s(u)}}),[]),{toggleBlockHighlight:v}=(0,g.useDispatch)(To),b=(0,u.useRef)(),{showMovers:k,gestures:_}=Tf({ref:b,onChange(e){e&&i||v(o,e)}}),y=(0,m.useViewportMatch)("medium","<")||l;if(r&&!(0,a.hasBlockSupport)(r,"__experimentalToolbar",!0))return null;const E=y||k;if(0===n.length)return null;const C=s&&d,S=n.length>1,w=(0,a.isReusableBlock)(r)||(0,a.isTemplatePart)(r),B=p()("block-editor-block-toolbar",{"is-showing-movers":E,"is-synced":w});return(0,u.createElement)("div",{className:B},!S&&!y&&!f&&(0,u.createElement)(Mf,null),(0,u.createElement)("div",c({ref:b},_),(C||S)&&!f&&(0,u.createElement)(h.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,u.createElement)(Jf,{clientIds:n}),!S&&(0,u.createElement)(jh,{clientId:n[0]}),(0,u.createElement)(kf,{clientIds:n,hideDragHandle:t}))),C&&S&&(0,u.createElement)(Zh,null),C&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Vo.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Vo.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Vo.Slot,{className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Vo.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Vo.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Xh.Provider,{value:null==r?void 0:r.name},(0,u.createElement)(nh.Slot,null))),(0,u.createElement)(Qh,{clientIds:n}),!f&&(0,u.createElement)($h,{clientIds:n}))};var ev=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:r,hasParents:l,showParentSelector:i}=(0,g.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o,__unstableGetContentLockingParent:r}=e(To),{getBlockType:l}=e(a.store),i=o(),s=i[0],c=n(s),u=l(t(c[c.length-1]));return{blockType:s&&l(t(s)),hasParents:c.length,showParentSelector:u&&(0,a.hasBlockSupport)(u,"__experimentalParentSelector",!0)&&i.length<=1&&!r(s)}}),[]);if(r&&!(0,a.hasBlockSupport)(r,"__experimentalToolbar",!0))return null;const s=p()("block-editor-block-contextual-toolbar",{"has-parent":l&&i,"is-fixed":n});return(0,u.createElement)(Cf,c({focusOnMount:t,className:s,"aria-label":(0,_.__)("Block tools")},o),(0,u.createElement)(Jh,{hideDragHandle:n}))};const{CustomSelectControl:tv}=Io(h.privateApis),nv="position",ov="block-editor-hooks__position-selection__select-control__option",rv={key:"default",value:"",name:(0,_.__)("Default"),className:ov},lv={key:"sticky",value:"sticky",name:(0,_._x)("Sticky","Name for the value of the CSS position property"),className:ov,__experimentalHint:(0,_.__)("The block will stick to the top of the window instead of scrolling.")},iv={key:"fixed",value:"fixed",name:(0,_._x)("Fixed","Name for the value of the CSS position property"),className:ov,__experimentalHint:(0,_.__)("The block will not move when the page is scrolled.")},av=["top","right","bottom","left"],sv=["sticky","fixed"];function cv(e){return!!(0,a.getBlockSupport)(e,nv)}function uv(e){var t,n;const o=null===(t=e.style)||void 0===t||null===(n=t.position)||void 0===n?void 0:n.type;return"sticky"===o||"fixed"===o}function dv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=fr("position.fixed"),n=fr("position.sticky"),o=!t&&!n;return!cv(e)||o}function pv(e){var t;const{attributes:{style:n={}},clientId:o,name:r,setAttributes:l}=e,i=function(e){const t=(0,a.getBlockSupport)(e,nv);return!!(!0===t||null!=t&&t.fixed)}(r),s=function(e){const t=(0,a.getBlockSupport)(e,nv);return!!(!0===t||null!=t&&t.sticky)}(r),c=null==n||null===(t=n.position)||void 0===t?void 0:t.type,{hasParents:d}=(0,g.useSelect)((e=>{const{getBlockParents:t}=e(To);return{hasParents:t(o).length}}),[o]),p=(0,u.useMemo)((()=>{const e=[rv];return(s&&!d||c===lv.value)&&e.push(lv),(i||c===iv.value)&&e.push(iv),e}),[i,s,d,c]),m=c&&p.find((e=>e.value===c))||rv;return u.Platform.select({web:p.length>1?(0,u.createElement)(jr,{group:"position"},(0,u.createElement)(h.BaseControl,{className:"block-editor-hooks__position-selection"},(0,u.createElement)(tv,{__nextUnconstrainedWidth:!0,__next36pxDefaultSize:!0,className:"block-editor-hooks__position-selection__select-control",label:(0,_.__)("Position"),hideLabelFromVision:!0,describedBy:(0,_.sprintf)((0,_.__)("Currently selected position: %s"),m.name),options:p,value:m,__experimentalShowSelectedHint:!0,onChange:e=>{let{selectedItem:t}=e;(e=>{const t={...n,position:{...null==n?void 0:n.position,type:e,top:"sticky"===e||"fixed"===e?"0px":void 0}};l({style:Ar(t)})})(t.value)},size:"__unstable-large"}))):null,native:null})}const mv=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,a.hasBlockSupport)(n,nv)&&!dv(t)&&(0,u.createElement)(pv,c({key:"position"},t)),(0,u.createElement)(e,c({key:"edit"},t))]}),"withInspectorControls"),gv=(0,m.createHigherOrderComponent)((e=>t=>{var n,o,r,l;const{name:i,attributes:s}=t,d=(0,a.hasBlockSupport)(i,nv)&&!dv(t),g=(0,m.useInstanceId)(e),f=(0,u.useContext)(Kv.__unstableElementContext);let h;d&&(h=function(e){let{selector:t,style:n}=e,o="";const{type:r}=(null==n?void 0:n.position)||{};return sv.includes(r)?(o+=`${t} {`,o+=`position: ${r};`,av.forEach((e=>{var t;void 0!==(null==n||null===(t=n.position)||void 0===t?void 0:t[e])&&(o+=`${e}: ${n.position[e]};`)})),"sticky"!==r&&"fixed"!==r||(o+="z-index: 10"),o+="}",o):o}({selector:`.wp-container-${g}.wp-container-${g}`,style:null==s?void 0:s.style})||"");const v=p()(null==t?void 0:t.className,{[`wp-container-${g}`]:d&&!!h,[`is-position-${null==s||null===(n=s.style)||void 0===n||null===(o=n.position)||void 0===o?void 0:o.type}`]:d&&!!h&&!(null==s||null===(r=s.style)||void 0===r||null===(l=r.position)||void 0===l||!l.type)});return(0,u.createElement)(u.Fragment,null,d&&f&&!!h&&(0,u.createPortal)((0,u.createElement)("style",null,h),f),(0,u.createElement)(e,c({},t,{className:v})))}));(0,s.addFilter)("editor.BlockListBlock","core/editor/position/with-position-styles",gv),(0,s.addFilter)("editor.BlockEdit","core/editor/position/with-inspector-controls",mv);const fv={placement:"top-start"},hv={...fv,flip:!1,shift:!0},vv={...fv,flip:!0,shift:!1};function bv(e,t,n,o,r){if(!e||!t)return hv;const l=(null==n?void 0:n.scrollTop)||0,i=t.getBoundingClientRect(),a=l+e.getBoundingClientRect().top,s=e.ownerDocument.documentElement.clientHeight,c=a+o,u=i.top>c,d=i.height>s-o;return r||!u&&!d?vv:hv}function kv(e){const{__unstableGetEditorMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isBlockInterfaceHidden:l,getSettings:i,getLastMultiSelectedBlockClientId:a}=Io(e(To));return{editorMode:t(),hasMultiSelection:o(),isMultiSelecting:n(),isTyping:r(),isBlockInterfaceHidden:l(),hasFixedToolbar:i().hasFixedToolbar,isDistractionFree:i().isDistractionFree,lastClientId:o()?a():null}}function _v(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,showContents:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:a}=e;const{editorMode:s,hasMultiSelection:d,isMultiSelecting:f,isTyping:h,isBlockInterfaceHidden:v,hasFixedToolbar:b,isDistractionFree:k,lastClientId:_}=(0,g.useSelect)(kv,[]),y=(0,g.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(To);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),E=(0,m.useViewportMatch)("medium"),C=(0,u.useRef)(!1),{stopTyping:S}=(0,g.useDispatch)(To),w=!h&&"edit"===s&&o,B=!d&&("navigation"===s||"zoom-out"===s),I="edit"===s&&!b&&E&&!f&&!w&&!h&&!v,x=!("edit"!==s||I||b||k||o);(0,xd.useShortcut)("core/block-editor/focus-toolbar",(()=>{C.current=!0,S(!0)}),{isDisabled:!x}),(0,u.useEffect)((()=>{C.current=!1}));const T=(0,u.useRef)(),M=function(e){let{contentElement:t,clientId:n}=e;const o=tr(n),[r,l]=(0,u.useState)(0),{blockIndex:i,isSticky:a}=(0,g.useSelect)((e=>{const{getBlockIndex:t,getBlockAttributes:o}=e(To);return{blockIndex:t(n),isSticky:uv(o(n))}}),[n]),s=(0,u.useMemo)((()=>{if(t)return(0,Ri.getScrollContainer)(t)}),[t]),[c,d]=(0,u.useState)((()=>bv(t,o,s,r,a))),p=(0,m.useRefEffect)((e=>{l(e.offsetHeight)}),[]),f=(0,u.useCallback)((()=>d(bv(t,o,s,r,a))),[t,o,s,r]);return(0,u.useLayoutEffect)(f,[i,f]),(0,u.useLayoutEffect)((()=>{var e,n,r;if(!t||!o)return;const l=null==t||null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;let i;null==l||null===(n=l.addEventHandler)||void 0===n||n.call(l,"resize",f);const a=null==o||null===(r=o.ownerDocument)||void 0===r?void 0:r.defaultView;return a.ResizeObserver&&(i=new a.ResizeObserver(f),i.observe(o)),()=>{var e;null==l||null===(e=l.removeEventHandler)||void 0===e||e.call(l,"resize",f),i&&i.disconnect()}}),[f,t,o]),{...c,ref:p}}({contentElement:null==a?void 0:a.current,clientId:t});return w?(0,u.createElement)(Zr,c({clientId:l||t,__unstableCoverTarget:!0,bottomClientId:_,className:p()("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":y}),__unstablePopoverSlot:i,__unstableContentRef:a,resize:!1,shift:!1},M),(0,u.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,u.createElement)(Gg,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0}))):B||I?(0,u.createElement)(Zr,c({clientId:l||t,bottomClientId:_,className:p()("block-editor-block-list__block-popover",{"is-insertion-point-visible":y}),__unstablePopoverSlot:i,__unstableContentRef:a,resize:!1},M),I&&r&&(0,u.createElement)(ev,{focusOnMount:C.current,__experimentalInitialIndex:T.current,__experimentalOnIndexChange:e=>{T.current=e},key:t}),B&&(0,u.createElement)(_f,{clientId:t,rootClientId:n})):null}function yv(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:r,getBlockParents:l,getSettings:i,isNavigationMode:s,__experimentalGetBlockListSettingsForBlocks:c}=e(To),u=t()||n();if(!u)return;const{name:d,attributes:p={}}=r(u)||{},m=l(u),g=c(m),f=m.find((e=>{var t;return null===(t=g[e])||void 0===t?void 0:t.__experimentalCaptureToolbars})),h=i();return{clientId:u,rootClientId:o(u),name:d,isDistractionFree:h.isDistractionFree,isNavigationMode:s(),isEmptyDefaultBlock:d&&(0,a.isUnmodifiedDefaultBlock)({name:d,attributes:p}),capturingClientId:f}}function Ev(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,g.useSelect)(yv,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:a,capturingClientId:s,isDistractionFree:c,isNavigationMode:d}=o;return i?(0,u.createElement)(_v,{clientId:r,rootClientId:l,isEmptyDefaultBlock:a,showContents:!c||d,capturingClientId:s,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Cv(e){let{children:t}=e;const n=(0,u.useContext)(Jg),o=(0,u.useContext)(h.Disabled.Context);return n||o?t:(W()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8",version:"6.3"}),(0,u.createElement)(tf,{__unstablePopoverSlot:"block-toolbar"},(0,u.createElement)(Ev,{__unstablePopoverSlot:"block-toolbar"}),t))}var Sv=(0,m.createHigherOrderComponent)((e=>t=>{const{clientId:n}=Ro();return(0,u.createElement)(e,c({},t,{clientId:n}))}),"withClientId");var wv=Sv((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,u.createElement)(Wg,{className:p()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})}));var Bv=(0,m.compose)([Sv,(0,g.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(To),r=o(n);return{lastBlockClientId:r[r.length-1]}}))])((e=>{let{clientId:t}=e;return(0,u.createElement)(Ug,{rootClientId:t})}));const Iv=new WeakMap;function xv(e,t,n,o,r,l,i){return s=>{const{srcRootClientId:c,srcClientIds:u,type:d,blocks:p}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(s);if("inserter"===d){i();const e=p.map((e=>(0,a.cloneBlock)(e)));l(e,!0,null)}if("block"===d){const l=n(u[0]);if(c===e&&l===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,a=u.length;r(u,c,i&&l{if(!n)return;const i=(0,a.findTransform)((0,a.getBlockTransforms)("from"),(n=>"files"===n.type&&r(n.blockName,e)&&n.isMatch(t)));if(i){const e=i.transform(t,o);l(e)}}}function Mv(e,t,n){return e=>{const t=(0,a.pasteHandler)({HTML:e,mode:"BLOCKS"});t.length&&n(t)}}function Nv(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{operation:o="insert"}=n,r=(0,g.useSelect)((e=>e(To).getSettings().mediaUpload),[]),{canInsertBlockType:l,getBlockIndex:i,getClientIdsOfDescendants:a,getBlockOrder:s,getBlocksByClientId:c}=(0,g.useSelect)(To),{insertBlocks:d,moveBlocksToPosition:p,updateBlockAttributes:m,clearSelectedBlock:f,replaceBlocks:h,removeBlocks:v}=(0,g.useDispatch)(To),b=(0,g.useRegistry)(),k=(0,u.useCallback)((function(n){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if("replace"===o){const o=s(e)[t];h(o,n,void 0,l)}else d(n,t,e,r,l)}),[o,s,d,h,t,e]),_=(0,u.useCallback)(((n,r,l)=>{if("replace"===o){const o=c(n),r=s(e)[t];b.batch((()=>{v(n,!1),h(r,o,void 0,0)}))}else p(n,r,e,l)}),[o,s,c,d,p,v,t,e]),y=xv(e,t,i,a,_,k,f),E=Tv(e,0,r,m,l,k),C=Mv(0,0,k);return e=>{const t=(0,Ri.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?C(n):t.length?E(t):y(e)}}function Pv(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:l}=e,i=o?r:l,a=o?l:r,s=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=s&&i<=c?i:i2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=Pv(e,t,r);(void 0===n||l=e.x&&t.top<=e.y&&t.bottom>=e.y}function Av(e,t){var n,o;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertical";const l="horizontal"===r?["left","right"]:["top","bottom"],i=(0,_.isRTL)();let a=0,s="before",c=1/0;e.forEach((e=>{let{isUnmodifiedDefaultBlock:n,getBoundingClientRect:o,blockIndex:r}=e;const u=o();let[d,p]=Lv(t,u,l);n&&Rv(t,u)&&(d=0),d0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,u.useState)({index:null,operation:"insert"}),o=(0,g.useSelect)((t=>{const{getTemplateLock:n,__unstableIsWithinBlockOverlay:o,__unstableHasActiveBlockOverlayActive:r}=t(To),l=n(e);return["all","contentOnly"].some((e=>e===l))||r(e)||o(e)}),[e]),{getBlockListSettings:r,getBlocks:l,getBlockIndex:i}=(0,g.useSelect)(To),{showInsertionPoint:s,hideInsertionPoint:c}=(0,g.useDispatch)(To),d=Nv(e,t.index,{operation:t.operation}),p=(0,m.useThrottle)((0,u.useCallback)(((t,o)=>{var c;const u=l(e);if(0===u.length)return void n({index:0,operation:"insert"});const d=u.map((e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:(0,a.isUnmodifiedDefaultBlock)(e),getBoundingClientRect:()=>o.getElementById(`block-${t}`).getBoundingClientRect(),blockIndex:i(t)}})),[p,m]=Av(d,{x:t.clientX,y:t.clientY},null===(c=r(e))||void 0===c?void 0:c.orientation);n({index:p,operation:m}),s(e,p,{operation:m})}),[e]),200);return(0,m.__experimentalUseDropZone)({isDisabled:o,onDrop:d,onDragOver(e){p(e,e.currentTarget.ownerDocument)},onDragLeave(){p.cancel(),c()},onDragEnd(){p.cancel(),c()}})}const Dv={};function zv(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:r,template:l,templateLock:i,wrapperRef:s,templateInsertUpdatesSelection:c,__experimentalCaptureToolbars:d,__experimentalAppenderTagName:p,renderAppender:m,orientation:f,placeholder:h,layout:v}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:s}=(0,g.useDispatch)(To),c=(0,g.useRegistry)(),{blockListSettings:d,parentLock:p}=(0,g.useSelect)((t=>{const n=t(To).getBlockRootClientId(e);return{blockListSettings:t(To).getBlockListSettings(e),parentLock:t(To).getTemplateLock(n)}}),[e]),m=(0,u.useMemo)((()=>t),t);(0,u.useLayoutEffect)((()=>{const t={allowedBlocks:m,templateLock:void 0===r||"contentOnly"===p?p:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=li(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),Kr()(d,t)||(Iv.get(c)||Iv.set(c,[]),Iv.get(c).push([e,t]),window.queueMicrotask((()=>{var e;null!==(e=Iv.get(c))&&void 0!==e&&e.length&&c.batch((()=>{Iv.get(c).forEach((e=>{s(...e)})),Iv.set(c,[])}))})))}),[e,d,m,n,o,r,p,l,i,s,a,c])}(t,n,o,r,i,d,f,v),function(e,t,n,o){const{getBlocks:r,getSelectedBlocksInitialCaretPosition:l,isBlockSelected:i}=(0,g.useSelect)(To),{replaceInnerBlocks:s,__unstableMarkNextChangeAsNotPersistent:c}=(0,g.useDispatch)(To),{innerBlocks:d}=(0,g.useSelect)((t=>({innerBlocks:t(To).getBlocks(e)})),[e]),p=(0,u.useRef)(null);(0,u.useLayoutEffect)((()=>{let u=!1;return window.queueMicrotask((()=>{if(u)return;const d=r(e),m=0===d.length||"all"===n||"contentOnly"===n,g=!k()(t,p.current);if(!m||!g)return;p.current=t;const f=(0,a.synchronizeBlocksWithTemplate)(d,t);k()(f,d)||(c(),s(e,f,0===d.length&&o&&0!==f.length&&i(e),l()))})),()=>{u=!0}}),[d,t,n,e])}(t,l,i,c);const b=function(e){return(0,g.useSelect)((t=>{const n=t(To).getBlock(e);if(!n)return;const o=t(a.store).getBlockType(n.name);return o&&0!==Object.keys(o.providesContext).length?Object.fromEntries(Object.entries(o.providesContext).map((e=>{let[t,o]=e;return[t,n.attributes[o]]}))):void 0}),[e])}(t),_=(0,g.useSelect)((e=>{var n;return null===(n=e(To).getBlock(t))||void 0===n?void 0:n.name}),[t]),y=(0,a.getBlockSupport)(_,"__experimentalLayout")||Dv,{allowSizingOnChildren:E=!1}=y,C=fr("layout")||Dv,S=v||y,w=(0,u.useMemo)((()=>({...C,...S,...E&&{allowSizingOnChildren:!0}})),[C,S,E]);return(0,u.createElement)(Oi,{value:b},(0,u.createElement)(Yv,{rootClientId:t,renderAppender:m,__experimentalAppenderTagName:p,__experimentalLayout:w,wrapperRef:s,placeholder:h}))}function Fv(e){return kd(e),(0,u.createElement)(zv,e)}const Vv=(0,u.forwardRef)(((e,t)=>{const n=Hv({ref:t},e);return(0,u.createElement)("div",{className:"block-editor-inner-blocks"},(0,u.createElement)("div",n))}));function Hv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:o}=t,{clientId:r,layout:l=null,__unstableLayoutClassNames:i=""}=Ro(),s=(0,m.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:d,hasOverlay:f}=(0,g.useSelect)((e=>{if(!r)return{};const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:o,__unstableGetEditorMode:l}=e(To),i=t(r),c="navigation"===l()||s;return{__experimentalCaptureToolbars:e(a.store).hasBlockSupport(i,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==i&&!n(r)&&!o(r,!0)&&c}}),[r,s]),h=Ov({rootClientId:r}),v=(0,m.useMergeRefs)([e.ref,o?null:h]),b={__experimentalCaptureToolbars:d,layout:l,...t},k=b.value&&b.onChange?Fv:zv;return{...e,ref:v,className:p()(e.className,"block-editor-block-list__layout",n?"":i,{"has-overlay":f}),children:r?(0,u.createElement)(k,c({},b,{clientId:r})):(0,u.createElement)(Yv,t)}}Hv.save=a.__unstableGetInnerBlocksProps,Vv.DefaultBlockAppender=Bv,Vv.ButtonBlockAppender=wv,Vv.Content=()=>Hv.save().children;var Gv=Vv;const Uv=(0,u.createContext)(),$v=(0,u.createContext)(),jv=new WeakMap;function Wv(e){let{className:t,...n}=e;const[o,r]=(0,u.useState)(),l=(0,m.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,editorMode:s}=(0,g.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(To),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,editorMode:n()}}),[]),c=(0,g.useRegistry)(),{setBlockVisibility:d}=(0,g.useDispatch)(To),f=(0,m.useDebounce)((0,u.useCallback)((()=>{const e={};jv.get(c).forEach((t=>{let[n,o]=t;e[n]=o})),d(e)}),[c]),300,{trailing:!0}),h=(0,u.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{jv.get(c)||jv.set(c,[]);for(const t of e){const e=t.target.getAttribute("data-block");jv.get(c).push([e,t.isIntersecting])}f()}))}),[]),v=Hv({ref:(0,m.useMergeRefs)([Ed(),nf(),r]),className:p()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&l,"is-navigate-mode":"navigation"===s})},n);return(0,u.createElement)(Uv.Provider,{value:o},(0,u.createElement)($v.Provider,{value:h},(0,u.createElement)("div",v)))}function Kv(e){return function(){const{patterns:e,isPreviewMode:t}=(0,g.useSelect)((e=>{const{__experimentalBlockPatterns:t,__unstableIsPreviewMode:n}=e(To).getSettings();return{patterns:t,isPreviewMode:n}}),[]);(0,u.useEffect)((()=>{if(t)return;if(null==e||!e.length)return;let n,o=-1;const r=()=>{o++,o>=e.length||((0,g.select)(To).__experimentalGetParsedPattern(e[o].name),n=of(r))};return n=of(r),()=>rf(n)}),[e,t])}(),(0,u.createElement)(Cv,null,(0,u.createElement)(Lo,{value:No},(0,u.createElement)(Wv,e)))}function qv(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=ii}=e;const{order:i,selectedBlocks:a,visibleBlocks:s}=(0,g.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:r}=e(To);return{order:t(n),selectedBlocks:o(),visibleBlocks:r()}}),[n]);return(0,u.createElement)(si,{value:l},i.map((e=>(0,u.createElement)(g.AsyncModeProvider,{key:e,value:!s.has(e)&&!a.includes(e)},(0,u.createElement)(ad,{rootClientId:n,clientId:e})))),i.length<1&&t,(0,u.createElement)(qg,{tagName:r,rootClientId:n,renderAppender:o}))}function Yv(e){return(0,u.createElement)(g.AsyncModeProvider,{value:!1},(0,u.createElement)(qv,e))}function Zv(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Qv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{flat:t,...n}=e;return t||Zv(Object.values(n).filter(Boolean))||"px"}function Xv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,h.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=Zv(o),i=0===r||r?`${r}${l}`:void 0;return i}function Jv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Xv(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function eb(e){if(!e)return!1;if("string"==typeof e)return!0;return!!Object.values(e).filter((e=>!!e||0===e)).length}function tb(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e,i=Xv(r);void 0===i&&(i=Qv(n));const a=eb(r)&&Jv(r),s=a?(0,_.__)("Mixed"):null;return(0,u.createElement)(h.__experimentalUnitControl,c({},l,{"aria-label":(0,_.__)("Border radius"),disableUnits:a,isOnly:!0,value:i,onChange:e=>{const n=!isNaN(parseFloat(e));t(n?e:void 0)},onUnitChange:e=>{o({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:s,size:"__unstable-large"}))}Kv.__unstableElementContext=Uv;const nb={topLeft:(0,_.__)("Top left"),topRight:(0,_.__)("Top right"),bottomLeft:(0,_.__)("Bottom left"),bottomRight:(0,_.__)("Bottom right")};function ob(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e;const i=e=>n=>{if(!t)return;const o=!isNaN(parseFloat(n))?n:void 0;t({...a,[e]:o})},a="string"!=typeof r?r:{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r};return(0,u.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(nb).map((e=>{let[t,r]=e;const[s,d]=(0,h.__experimentalParseQuantityAndUnitFromRawValue)(a[t]),p=a[t]?d:n[t]||n.flat;return(0,u.createElement)(h.Tooltip,{text:r,position:"top",key:t},(0,u.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,u.createElement)(h.__experimentalUnitControl,c({},l,{"aria-label":r,value:[s,p].join(""),onChange:i(t),onUnitChange:(m=t,e=>{const t={...n};t[m]=e,o(t)}),size:"__unstable-large"}))));var m})))}function rb(e){let{isLinked:t,...n}=e;const o=t?(0,_.__)("Unlink radii"):(0,_.__)("Link radii");return(0,u.createElement)(h.Tooltip,{text:o},(0,u.createElement)("span",null,(0,u.createElement)(h.Button,c({},n,{className:"component-border-radius-control__linked-button",isSmall:!0,icon:t?Er:Cr,iconSize:24,"aria-label":o}))))}const lb={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},ib={px:100,em:20,rem:20};function ab(e){let{onChange:t,values:n}=e;const[o,r]=(0,u.useState)(!eb(n)||!Jv(n)),[l,i]=(0,u.useState)({flat:"string"==typeof n?(0,h.__experimentalParseQuantityAndUnitFromRawValue)(n)[1]:void 0,topLeft:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topLeft)[1],topRight:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topRight)[1],bottomLeft:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomLeft)[1],bottomRight:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomRight)[1]}),a=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["px","em","rem"]}),s=Qv(l),c=a&&a.find((e=>e.value===s)),d=(null==c?void 0:c.step)||1,[p]=(0,h.__experimentalParseQuantityAndUnitFromRawValue)(Xv(n));return(0,u.createElement)("fieldset",{className:"components-border-radius-control"},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},(0,_.__)("Radius")),(0,u.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,u.createElement)(u.Fragment,null,(0,u.createElement)(tb,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,units:a}),(0,u.createElement)(h.RangeControl,{label:(0,_.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=p?p:"",min:0,max:ib[s],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${s}`:void 0)},step:d,__nextHasNoMarginBottom:!0})):(0,u.createElement)(ob,{min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,values:n||lb,units:a}),(0,u.createElement)(rb,{onClick:()=>r(!o),isLinked:o})))}function sb(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(ab,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{const t=Ar({...n,border:{...null==n?void 0:n.border,radius:e}});o({style:t})}})}fp([hp,kp]);const cb=(e,t,n)=>{if(t){const n=null==e?void 0:e.find((e=>e.slug===t));if(n)return n}return{color:n}},ub=(e,t)=>null==e?void 0:e.find((e=>e.color===t));function db(e,t){if(e&&t)return`has-${(0,f.kebabCase)(t)}-${e}`}function pb(){const e={disableCustomColors:!fr("color.custom"),disableCustomGradients:!fr("color.customGradient")},t=fr("color.palette.custom"),n=fr("color.palette.theme"),o=fr("color.palette.default"),r=fr("color.defaultPalette");e.colors=(0,u.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,_._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,_._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,_._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=fr("color.gradients.custom"),i=fr("color.gradients.theme"),a=fr("color.gradients.default"),s=fr("color.defaultGradients");return e.gradients=(0,u.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,_._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),s&&a&&a.length&&e.push({name:(0,_._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,_._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}const mb="__experimentalBorder",gb=["top","right","bottom","left"],fb=e=>{var t,n;return{...e,borderColor:void 0,style:{...e.style,border:{radius:null===(t=e.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius}}}},hb=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},vb=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=hb(t,"slug",n);if(e)return e}if(!o)return{color:void 0};const r=hb(t,"color",o);return r||{color:o}};function bb(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function kb(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:r}=t,{colors:l}=pb(),i=_b(e.name),s=fr("border.color")&&_b(e.name,"color"),c=fr("border.radius")&&_b(e.name,"radius"),d=fr("border.style")&&_b(e.name,"style"),p=fr("border.width")&&_b(e.name,"width");if([!s,!c,!d,!p].every(Boolean)||!i)return null;const m=(0,a.getBlockSupport)(e.name,[mb,"__experimentalDefaultControls"]),g=(null==m?void 0:m.color)||(null==m?void 0:m.width),f=((e,t)=>{const{borderColor:n,style:o}=e,{border:r}=o||{};if(n){const{color:e}=vb({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return gb.forEach((e=>{var n;const o=bb(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=vb({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,l);return(0,u.createElement)(jr,{group:"border"},(p||s)&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return(0,h.__experimentalIsDefinedBorder)(null==n?void 0:n.border)||!!t})(e),label:(0,_.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:o}=e;const{style:r}=n;o({borderColor:void 0,style:{...r,border:Ar({radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:g,resetAllFilter:fb,panelId:n},(0,u.createElement)(h.__experimentalBorderBoxControl,{colors:l,enableAlpha:!0,enableStyle:d,onChange:e=>{var t;let n,i={...e};if((0,h.__experimentalHasSplitBorders)(e))i={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},gb.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=vb({colors:l,customColor:null===(o=e[t])||void 0===o?void 0:o.color});n.slug&&(i[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,o=vb({colors:l,customColor:t});o.slug&&(n=o.slug,i.color=void 0)}const a=Ar({...r,border:{radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius,...i}});o({style:a,borderColor:n})},popoverOffset:40,popoverPlacement:"left-start",size:"__unstable-large",value:f,__experimentalIsRenderedInSidebar:!0})),c&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;const o=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof o?Object.entries(o).some(Boolean):!!o}(e),label:(0,_.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:yb(o,"radius")})}(e),isShownByDefault:null==m?void 0:m.radius,resetAllFilter:e=>{var t;return{...e,style:{...e.style,border:{...null===(t=e.style)||void 0===t?void 0:t.border,radius:void 0}}}},panelId:n},(0,u.createElement)(sb,e)))}function _b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==u.Platform.OS)return!1;const n=(0,a.getBlockSupport)(e,mb);return!0===n||("any"===t?!!(null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style):!(null==n||!n[t]))}function yb(e,t){return Ar({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Eb(e,t,n){if(!_b(t,"color")||Fr(t,mb,"color"))return e;const o=Cb(n),r=p()(e.className,o);return e.className=r||void 0,e}function Cb(e){var t;const{borderColor:n,style:o}=e,r=db("border-color",n);return p()({"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color),[r]:!!r})}const Sb=(0,m.createHigherOrderComponent)((e=>t=>{var n,o,r,l,i,a,s,d,p;const{name:m,attributes:g}=t,{borderColor:f,style:h}=g,{colors:v}=pb();if(!_b(m,"color")||Fr(m,mb,"color"))return(0,u.createElement)(e,t);const{color:b}=vb({colors:v,namedColor:f}),{color:k}=vb({colors:v,namedColor:bb(null==h||null===(n=h.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:_}=vb({colors:v,namedColor:bb(null==h||null===(r=h.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=vb({colors:v,namedColor:bb(null==h||null===(i=h.border)||void 0===i||null===(a=i.bottom)||void 0===a?void 0:a.color)}),{color:E}=vb({colors:v,namedColor:bb(null==h||null===(s=h.border)||void 0===s||null===(d=s.left)||void 0===d?void 0:d.color)}),C={borderTopColor:k||b,borderRightColor:_||b,borderBottomColor:y||b,borderLeftColor:E||b};let S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,u.createElement)(e,c({},t,{wrapperProps:S}))}));function wb(e){if(e)return`has-${e}-gradient-background`}function Bb(e,t){const n=null==e?void 0:e.find((e=>e.slug===t));return n&&n.gradient}function Ib(e,t){const n=null==e?void 0:e.find((e=>e.gradient===t));return n}function xb(e,t){const n=Ib(e,t);return n&&n.slug}function Tb(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=Ro(),o=fr("color.gradients.custom"),r=fr("color.gradients.theme"),l=fr("color.gradients.default"),i=(0,u.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:s}=(0,g.useSelect)((o=>{const{getBlockAttributes:r}=o(To),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:c}=(0,g.useDispatch)(To),d=(0,u.useCallback)((o=>{const r=xb(i,o);c(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,c]),p=wb(a);let m;return m=a?Bb(i,a):s,{gradientClass:p,gradientValue:m,setGradient:d}}(0,s.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return _b(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Eb),(0,s.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!_b(e,"color")||Fr(e,mb,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Eb(o,e,n)},e})),(0,s.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Sb);const Mb=["colors","disableCustomColors","gradients","disableCustomGradients"],Nb={name:"color",title:"Solid",value:"color"},Pb={name:"gradient",title:"Gradient",value:"gradient"},Lb=[Nb,Pb];function Rb(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalIsRenderedInSidebar:l,className:i,label:a,onColorChange:s,onGradientChange:c,colorValue:d,gradientValue:m,clearable:g,showTitle:v=!0,enableAlpha:b}=e;const k=s&&(!(0,f.isEmpty)(t)||!o),_=c&&(!(0,f.isEmpty)(n)||!r);if(!k&&!_)return null;const y={[Nb.value]:(0,u.createElement)(h.ColorPalette,{value:d,onChange:_?e=>{s(e),c()}:s,colors:t,disableCustomColors:o,__experimentalIsRenderedInSidebar:l,clearable:g,enableAlpha:b}),[Pb.value]:(0,u.createElement)(h.GradientPicker,{__nextHasNoMargin:!0,value:m,onChange:k?e=>{c(e),s()}:c,gradients:n,disableCustomGradients:r,__experimentalIsRenderedInSidebar:l,clearable:g})},E=e=>(0,u.createElement)("div",{className:"block-editor-color-gradient-control__panel"},y[e]);return(0,u.createElement)(h.BaseControl,{__nextHasNoMarginBottom:!0,className:p()("block-editor-color-gradient-control",i)},(0,u.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,u.createElement)(h.__experimentalVStack,{spacing:1},v&&(0,u.createElement)("legend",null,(0,u.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,u.createElement)(h.BaseControl.VisualLabel,null,a))),k&&_&&(0,u.createElement)(h.TabPanel,{className:"block-editor-color-gradient-control__tabs",tabs:Lb,initialTabName:m?Pb.value:!!k&&Nb.value},(e=>E(e.value))),!_&&E(Nb.value),!k&&E(Pb.value))))}function Ab(e){const t={};return t.colors=fr("color.palette"),t.gradients=fr("color.gradients"),t.disableCustomColors=!fr("color.custom"),t.disableCustomGradients=!fr("color.customGradient"),(0,u.createElement)(Rb,c({},t,e))}var Ob=function(e){return Mb.every((t=>e.hasOwnProperty(t)))?(0,u.createElement)(Rb,e):(0,u.createElement)(Ab,e)};const Db=e=>{let{setting:t,children:n,panelId:o,...r}=e;return(0,u.createElement)(h.__experimentalToolsPanelItem,c({hasValue:()=>!!t.colorValue||!!t.gradientValue,label:t.label,onDeselect:()=>{t.colorValue?t.onColorChange():t.gradientValue&&t.onGradientChange()},isShownByDefault:void 0===t.isShownByDefault||t.isShownByDefault},r,{className:"block-editor-tools-panel-color-gradient-settings__item",panelId:o,resetAllFilter:t.resetAllFilter}),n)},zb=e=>{let{colorValue:t,label:n}=e;return(0,u.createElement)(h.__experimentalHStack,{justify:"flex-start"},(0,u.createElement)(h.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,u.createElement)(h.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:n},n))},Fb=e=>t=>{let{onToggle:n,isOpen:o}=t;const{colorValue:r,label:l}=e,i={onClick:n,className:p()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":o}),"aria-expanded":o};return(0,u.createElement)(h.Button,i,(0,u.createElement)(zb,{colorValue:r,label:l}))};function Vb(e){let t,{colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradients:i,settings:a,__experimentalIsRenderedInSidebar:s,...d}=e;return s&&(t={placement:"left-start",offset:36,shift:!0}),(0,u.createElement)(u.Fragment,null,a.map(((e,a)=>{var p;const m={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradientValue:e.gradientValue,gradients:i,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:s,...e},g={colorValue:null!==(p=e.gradientValue)&&void 0!==p?p:e.colorValue,label:e.label};return e&&(0,u.createElement)(Db,c({key:a,setting:e},d),(0,u.createElement)(h.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:Fb(g),renderContent:()=>(0,u.createElement)(h.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,u.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,u.createElement)(Ob,m)))}))})))}fp([hp,kp]);var Hb=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:a,linkColor:s,enableAlphaChecker:c=!1}=e;const d=t||n;if(!d)return null;const p=a||o,m=s||r;if(!p&&!m)return null;const g=[{color:p,description:(0,_.__)("text color")},{color:m,description:(0,_.__)("link color")}],f=mp(d),v=f.alpha()<1,b=f.brightness(),k={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of g){if(!e.color)continue;const t=mp(e.color),n=t.isReadable(f,k),o=t.alpha()<1;if(!n){if(v||o)continue;y=bnull==e?void 0:e.colorValue));(0,u.useEffect)((()=>{var e;if(!r)return;if(!g.length)return l&&i(),a&&s(),void(d&&s());if(!m.current)return;s(Gb(m.current).color);const t=null===(e=m.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&p(Gb(t).color);let n=m.current,o=Gb(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=Gb(n).backgroundColor;i(o)}));const f=pb();return(0,u.createElement)(jr,{group:"color"},(0,u.createElement)(Vb,c({enableAlpha:t,panelId:o,settings:n,__experimentalIsItemGroup:!1,__experimentalIsRenderedInSidebar:!0},f)),r&&(0,u.createElement)(Hb,{backgroundColor:l,textColor:a,enableAlphaChecker:t,linkColor:d}))}const $b="color",jb=e=>{const t=(0,a.getBlockSupport)(e,$b);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},Wb=e=>{if("web"!==u.Platform.OS)return!1;const t=(0,a.getBlockSupport)(e,$b);return null!==t&&"object"==typeof t&&!!t.link},Kb=e=>{const t=(0,a.getBlockSupport)(e,$b);return null!==t&&"object"==typeof t&&!!t.gradients},qb=e=>{const t=(0,a.getBlockSupport)(e,$b);return t&&!1!==t.background},Yb=e=>{const t=(0,a.getBlockSupport)(e,$b);return t&&!1!==t.text},Zb=(e,t)=>Ar(Dr(t,e,void 0)),Qb=e=>({textColor:void 0,style:Zb(["color","text"],e.style)}),Xb=e=>({style:Zb(["elements","link","color","text"],e.style)}),Jb=e=>{var t;return{backgroundColor:void 0,gradient:void 0,style:{...e.style,color:{...null===(t=e.style)||void 0===t?void 0:t.color,background:void 0,gradient:void 0}}}};function ek(e,t,n){var o,r,l,i,a,s;if(!jb(t)||Fr(t,$b))return e;const c=Kb(t),{backgroundColor:u,textColor:d,gradient:m,style:g}=n,f=e=>!Fr(t,$b,e),h=f("text")?db("color",d):void 0,v=f("gradients")?wb(m):void 0,b=f("background")?db("background-color",u):void 0,k=f("background")||f("gradients"),_=u||(null==g||null===(o=g.color)||void 0===o?void 0:o.background)||c&&(m||(null==g||null===(r=g.color)||void 0===r?void 0:r.gradient)),y=p()(e.className,h,v,{[b]:!(c&&null!=g&&null!==(l=g.color)&&void 0!==l&&l.gradient||!b),"has-text-color":f("text")&&(d||(null==g||null===(i=g.color)||void 0===i?void 0:i.text)),"has-background":k&&_,"has-link-color":f("link")&&(null==g||null===(a=g.elements)||void 0===a||null===(s=a.link)||void 0===s?void 0:s.color)});return e.className=y||void 0,e}const tk=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?cb(e,n[1]).color:t};function nk(e){var t,n,o,r,l,i;const{name:s,attributes:c}=e,d=fr("color.palette.custom"),p=fr("color.palette.theme"),m=fr("color.palette.default"),g=(0,u.useMemo)((()=>[...d||[],...p||[],...m||[]]),[d,p,m]),f=fr("color.gradients.custom"),h=fr("color.gradients.theme"),v=fr("color.gradients.default"),b=(0,u.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),k=fr("color.custom"),y=fr("color.customGradient"),E=fr("color.background"),C=fr("color.link"),S=fr("color.text"),w=k||!p||(null==p?void 0:p.length)>0,B=y||!h||(null==h?void 0:h.length)>0,I=(0,u.useRef)(c);if((0,u.useEffect)((()=>{I.current=c}),[c]),!jb(s))return null;const x=Wb(s)&&C&&w,T=Yb(s)&&S&&w,M=qb(s)&&E&&w,N=Kb(s)&&B;if(!(x||T||M||N))return null;const{style:P,textColor:L,backgroundColor:R,gradient:A}=c;let O;if(N&&A)O=Bb(b,A);else if(N){var D;O=null==P||null===(D=P.color)||void 0===D?void 0:D.gradient}const z=t=>n=>{var o,r;const l=ub(g,n),i=t+"Color",a={...I.current.style,color:{...null===(o=I.current)||void 0===o||null===(r=o.style)||void 0===r?void 0:r.color,[t]:null!=l&&l.slug?void 0:n}},s=null!=l&&l.slug?l.slug:void 0,c={style:Ar(a),[i]:s};e.setAttributes(c),I.current={...I.current,...c}},F=(0,a.getBlockSupport)(e.name,[$b,"__experimentalDefaultControls"]),V="web"===u.Platform.OS&&!A&&!(null!=P&&null!==(t=P.color)&&void 0!==t&&t.gradient)&&M&&(x||T)&&!1!==(0,a.getBlockSupport)(e.name,[$b,"enableContrastChecker"]);return(0,u.createElement)(Ub,{enableContrastChecking:V,clientId:e.clientId,enableAlpha:!0,settings:[...T?[{label:(0,_.__)("Text"),onColorChange:z("text"),colorValue:cb(g,L,null==P||null===(n=P.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==F?void 0:F.text,resetAllFilter:Qb}]:[],...M||N?[{label:(0,_.__)("Background"),onColorChange:M?z("background"):void 0,colorValue:cb(g,R,null==P||null===(o=P.color)||void 0===o?void 0:o.background).color,gradientValue:O,onGradientChange:N?t=>{const n=xb(b,t);let o;if(n){var r,l,i;const e={...null===(r=I.current)||void 0===r?void 0:r.style,color:{...null===(l=I.current)||void 0===l||null===(i=l.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:Ar(e),gradient:n}}else{var a,s,c;const e={...null===(a=I.current)||void 0===a?void 0:a.style,color:{...null===(s=I.current)||void 0===s||null===(c=s.style)||void 0===c?void 0:c.color,gradient:t}};o={style:Ar(e),gradient:void 0}}e.setAttributes(o),I.current={...I.current,...o}}:void 0,isShownByDefault:null==F?void 0:F.background,resetAllFilter:Jb}]:[],...x?[{label:(0,_.__)("Link"),onColorChange:t=>{var n;const o=ub(g,t),r=null!=o&&o.slug?`var:preset|color|${o.slug}`:t,l=Ar(Dr(null===(n=I.current)||void 0===n?void 0:n.style,["elements","link","color","text"],r));e.setAttributes({style:l}),I.current={...I.current,style:l}},colorValue:tk(g,null==P||null===(r=P.elements)||void 0===r||null===(l=r.link)||void 0===l||null===(i=l.color)||void 0===i?void 0:i.text),isShownByDefault:null==F?void 0:F.link,resetAllFilter:Xb}]:[]]})}const ok=(0,m.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:i}=r,a=fr("color.palette.custom"),s=fr("color.palette.theme"),d=fr("color.palette.default"),p=(0,u.useMemo)((()=>[...a||[],...s||[],...d||[]]),[a,s,d]);if(!jb(o)||Fr(o,$b))return(0,u.createElement)(e,t);const m={};var g,f;i&&!Fr(o,$b,"text")&&(m.color=null===(g=cb(p,i))||void 0===g?void 0:g.color);l&&!Fr(o,$b,"background")&&(m.backgroundColor=null===(f=cb(p,l))||void 0===f?void 0:f.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,u.createElement)(e,c({},t,{wrapperProps:h}))})),rk={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,s.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return jb(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Kb(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",ek),(0,s.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!jb(e)||Fr(e,$b))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),ek(o,e,n)},e})),(0,s.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",ok),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return zr({linkColor:Wb(r),textColor:Yb(r),backgroundColor:qb(r),gradient:Kb(r)},rk,e,t,n,o)}));const lk=[{name:(0,_._x)("Regular","font style"),value:"normal"},{name:(0,_._x)("Italic","font style"),value:"italic"}],ik=[{name:(0,_._x)("Thin","font weight"),value:"100"},{name:(0,_._x)("Extra Light","font weight"),value:"200"},{name:(0,_._x)("Light","font weight"),value:"300"},{name:(0,_._x)("Regular","font weight"),value:"400"},{name:(0,_._x)("Medium","font weight"),value:"500"},{name:(0,_._x)("Semi Bold","font weight"),value:"600"},{name:(0,_._x)("Bold","font weight"),value:"700"},{name:(0,_._x)("Extra Bold","font weight"),value:"800"},{name:(0,_._x)("Black","font weight"),value:"900"}],ak=(e,t)=>e?t?(0,_.__)("Appearance"):(0,_.__)("Font style"):(0,_.__)("Font weight");function sk(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l},...i}=e,a=n||o,s=ak(n,o),d={key:"default",name:(0,_.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},p=(0,u.useMemo)((()=>n&&o?(()=>{const e=[d];return lk.forEach((t=>{let{name:n,value:o}=t;ik.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,_.sprintf)((0,_.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[d];return lk.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[d];return ik.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),m=p.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||p[0];return a&&(0,u.createElement)(h.CustomSelectControl,c({},i,{className:"components-font-appearance-control",label:s,describedBy:m?n?o?(0,_.sprintf)((0,_.__)("Currently selected font appearance: %s"),m.name):(0,_.sprintf)((0,_.__)("Currently selected font style: %s"),m.name):(0,_.sprintf)((0,_.__)("Currently selected font weight: %s"),m.name):(0,_.__)("No selected font appearance"),options:p,value:m,onChange:e=>{let{selectedItem:n}=e;return t(n.style)},__nextUnconstrainedWidth:!0}))}const ck=1.5,uk=.1;var dk=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px",...l}=e;const i=function(e){return void 0!==e&&""!==e}(t),a=i?t:"";o||W()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const s=o?void 0:{marginBottom:24};return(0,u.createElement)("div",{className:"block-editor-line-height-control",style:s},(0,u.createElement)(h.__experimentalNumberControl,c({},l,{__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),r=((e,t)=>{if(i)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return ck;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,_.__)("Line height"),placeholder:ck,step:uk,value:a,min:0,spinControls:"custom"})))};const pk="typography.lineHeight";function mk(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(dk,{__unstableInputWidth:"100%",__nextHasNoMarginBottom:!0,value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};o({style:Ar(t)})},size:"__unstable-large"})}function gk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("typography.lineHeight");return!(0,a.hasBlockSupport)(e,pk)||t}const fk="typography.__experimentalFontStyle",hk="typography.__experimentalFontWeight";function vk(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!bk(e),i=!kk(e),a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,s=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return(0,u.createElement)(sk,{onChange:e=>{r({style:Ar({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:s},size:"__unstable-large"})}function bk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,a.hasBlockSupport)(e,fk),n=fr("typography.fontStyle");return!t||!n}function kk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,a.hasBlockSupport)(e,hk),n=fr("typography.fontWeight");return!t||!n}function _k(e){const t=bk(e),n=kk(e);return t&&n}function yk(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=fr("typography.fontFamilies");if(o||(o=l),!o||0===o.length)return null;const i=[{value:"",label:(0,_.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,u.createElement)(h.SelectControl,c({label:(0,_.__)("Font"),options:i,value:t,onChange:n,labelPosition:"top"},r))}const Ek="typography.__experimentalFontFamily";function Ck(e,t,n){if(!(0,a.hasBlockSupport)(t,Ek))return e;if(Fr(t,c_,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(zf())(e.className);o.add(`has-${(0,f.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const r=o.value;return e.className=r||void 0,e}function Sk(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=fr("typography.fontFamilies"),l=null==r||null===(t=r.find((e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,u.createElement)(yk,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=null==r?void 0:r.find((t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})},size:"__unstable-large",__nextHasNoMarginBottom:!0})}function wk(e){let{name:t}=e;const n=fr("typography.fontFamilies");return!n||0===n.length||!(0,a.hasBlockSupport)(t,Ek)}(0,s.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,a.hasBlockSupport)(e,Ek)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Ck),(0,s.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,a.hasBlockSupport)(e,Ek))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Ck(o,e,n)},e}));const Bk=(e,t,n)=>{if(t){const n=null==e?void 0:e.find((e=>{let{slug:n}=e;return n===t}));if(n)return n}return{size:n}};function Ik(e,t){const n=null==e?void 0:e.find((e=>{let{size:n}=e;return n===t}));return n||{size:t}}function xk(e){if(e)return`has-${(0,f.kebabCase)(e)}-font-size`}var Tk=function(e){const t=fr("typography.fontSizes"),n=!fr("typography.customFontSize");return(0,u.createElement)(h.FontSizePicker,c({},e,{fontSizes:t,disableCustomFontSizes:n}))};const Mk="1600px",Nk="768px",Pk=1,Lk=.75;function Rk(e){let{minimumFontSize:t,maximumFontSize:n,fontSize:o,minimumViewPortWidth:r=Nk,maximumViewPortWidth:l=Mk,scaleFactor:i=Pk,minimumFontSizeFactor:a=Lk,minimumFontSizeLimit:s}=e;if(s=Ak(s)?s:"14px",o){const e=Ak(o);if(null==e||!e.unit)return null;const r=Ak(s,{coerceTo:e.unit});if(null!=r&&r.value&&!t&&!n&&(null==e?void 0:e.value)<=(null==r?void 0:r.value))return null;if(n||(n=`${e.value}${e.unit}`),!t){const n=Ok(e.value*a,3);t=null!=r&&r.value&&n<(null==r?void 0:r.value)?`${r.value}${r.unit}`:`${n}${e.unit}`}}const c=Ak(t),u=(null==c?void 0:c.unit)||"rem",d=Ak(n,{coerceTo:u});if(!c||!d)return null;const p=Ak(t,{coerceTo:"rem"}),m=Ak(l,{coerceTo:u}),g=Ak(r,{coerceTo:u});if(!m||!g||!p)return null;const f=Ok(g.value/100,3),h=Ok(f,3)+u,v=Ok(((d.value-c.value)/(m.value-g.value)*100||1)*i,3);return`clamp(${t}, ${`${p.value}${p.unit} + ((1vw - ${h}) * ${v})`}, ${n})`}function Ak(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:o,acceptableUnits:r}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},l=null==r?void 0:r.join("|"),i=new RegExp(`^(\\d*\\.?\\d+)(${l}){1,1}$`),a=e.match(i);if(!a||a.length<3)return null;let[,s,c]=a,u=parseFloat(s);return"px"!==n||"em"!==c&&"rem"!==c||(u*=o,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=o,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),{value:Ok(u,3),unit:c}}function Ok(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}const Dk="typography.fontSize";function zk(e,t,n){if(!(0,a.hasBlockSupport)(t,Dk))return e;if(Fr(t,c_,"fontSize"))return e;const o=new(zf())(e.className);o.add(xk(n.fontSize));const r=o.value;return e.className=r||void 0,e}function Fk(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=fr("typography.fontSizes"),a=Bk(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),s=(null==a?void 0:a.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,u.createElement)(Tk,{onChange:e=>{const t=Ik(i,e).slug;l({style:Ar({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:s,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}function Vk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=fr("typography.fontSizes"),n=!(null==t||!t.length);return!(0,a.hasBlockSupport)(e,Dk)||!n}const Hk=(0,m.createHigherOrderComponent)((e=>t=>{var n,o;const r=fr("typography.fontSizes"),{name:l,attributes:{fontSize:i,style:s},wrapperProps:c}=t;if(!(0,a.hasBlockSupport)(l,Dk)||Fr(l,c_,"fontSize")||!i||null!=s&&null!==(n=s.typography)&&void 0!==n&&n.fontSize)return(0,u.createElement)(e,t);const d=Bk(r,i,null==s||null===(o=s.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...c,style:{fontSize:d,...null==c?void 0:c.style}}};return(0,u.createElement)(e,p)}),"withFontSizeInlineStyles"),Gk={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,s.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,a.hasBlockSupport)(e,Dk)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",zk),(0,s.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,a.hasBlockSupport)(e,Dk))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),zk(o,e,n)},e})),(0,s.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Hk),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const r=e.name;return zr({fontSize:(0,a.hasBlockSupport)(r,Dk)},Gk,e,t,n,o)})),(0,s.addFilter)("blocks.registerBlockType","core/font-size/addEditPropsForFluidCustomFontSizes",(function(e){if(!(0,a.hasBlockSupport)(e,Dk)||Fr(e,c_,"fontSize"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=e=>{var n,o,r;const l=t?t(e):{},i=null==l||null===(n=l.style)||void 0===n?void 0:n.fontSize,a=null===(o=(0,g.select)(To).getSettings().__experimentalFeatures)||void 0===o||null===(r=o.typography)||void 0===r?void 0:r.fluid,s="object"==typeof a?a:{},c=i&&a?Rk({fontSize:i,minimumFontSizeLimit:null==s?void 0:s.minFontSize}):null;return null===c?l:{...l,style:{...null==l?void 0:l.style,fontSize:c}}},e}),11);var Uk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M7 11.5h10V13H7z"}));var $k=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"}));var jk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));const Wk=[{name:(0,_.__)("None"),value:"none",icon:Uk},{name:(0,_.__)("Underline"),value:"underline",icon:$k},{name:(0,_.__)("Strikethrough"),value:"line-through",icon:jk}];function Kk(e){let{value:t,onChange:n,className:o}=e;return(0,u.createElement)("fieldset",{className:p()("block-editor-text-decoration-control",o)},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},(0,_.__)("Decoration")),(0,u.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},Wk.map((e=>(0,u.createElement)(h.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}const qk="typography.__experimentalTextDecoration";function Yk(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(Kk,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:Ar({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})},size:"__unstable-large"})}function Zk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,a.hasBlockSupport)(e,qk),n=fr("typography.textDecoration");return t||!n}var Qk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"}));var Xk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"}));var Jk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"}));const e_=[{name:(0,_.__)("None"),value:"none",icon:Uk},{name:(0,_.__)("Uppercase"),value:"uppercase",icon:Qk},{name:(0,_.__)("Lowercase"),value:"lowercase",icon:Xk},{name:(0,_.__)("Capitalize"),value:"capitalize",icon:Jk}];function t_(e){let{className:t,value:n,onChange:o}=e;return(0,u.createElement)("fieldset",{className:p()("block-editor-text-transform-control",t)},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},(0,_.__)("Letter case")),(0,u.createElement)("div",{className:"block-editor-text-transform-control__buttons"},e_.map((e=>(0,u.createElement)(h.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===n,onClick:()=>{o(e.value===n?void 0:e.value)}})))))}const n_="typography.__experimentalTextTransform";function o_(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(t_,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:Ar({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})},size:"__unstable-large"})}function r_(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,a.hasBlockSupport)(e,n_),n=fr("typography.textTransform");return t||!n}function l_(e){let{value:t,onChange:n,__unstableInputWidth:o="60px",...r}=e;const l=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,u.createElement)(h.__experimentalUnitControl,c({},r,{label:(0,_.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:l,onChange:n}))}const i_="typography.__experimentalLetterSpacing";function a_(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(l_,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:Ar({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%",size:"__unstable-large"})}function s_(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,a.hasBlockSupport)(e,i_),n=fr("typography.letterSpacing");return t||!n}const c_="typography",u_=[pk,Dk,fk,hk,Ek,qk,n_,i_];function d_(e){const{clientId:t}=e,n=wk(e),o=Vk(e),r=_k(e),l=gk(e),i=Zk(e),s=r_(e),c=s_(e),d=!bk(e),p=!kk(e),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[_k(e),Vk(e),gk(e),wk(e),Zk(e),r_(e),s_(e)];return t.filter(Boolean).length===t.length}(e),g=p_(e.name);if(m||!g)return null;const f=(0,a.getBlockSupport)(e.name,[c_,"__experimentalDefaultControls"]),v=e=>t=>{var n;return{...t,style:{...t.style,typography:{...null===(n=t.style)||void 0===n?void 0:n.typography,[e]:void 0}}}};return(0,u.createElement)(jr,{group:"typography"},!n&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,_.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==f?void 0:f.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,u.createElement)(Sk,e)),!o&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{fontSize:n,style:o}=e.attributes;return!!n||!(null==o||null===(t=o.typography)||void 0===t||!t.fontSize)}(e),label:(0,_.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:Ar({...o,typography:{...null==o?void 0:o.typography,fontSize:void 0}})})}(e),isShownByDefault:null==f?void 0:f.fontSize,resetAllFilter:e=>{var t;return{...e,fontSize:void 0,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontSize:void 0}}}},panelId:t},(0,u.createElement)(Fk,e)),!r&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t;const{fontStyle:n,fontWeight:o}=(null===(t=e.attributes.style)||void 0===t?void 0:t.typography)||{};return!!n||!!o}(e),label:ak(d,p),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ar({...o,typography:{...null==o?void 0:o.typography,fontStyle:void 0,fontWeight:void 0}})})}(e),isShownByDefault:null==f?void 0:f.fontAppearance,resetAllFilter:e=>{var t;return{...e,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontStyle:void 0,fontWeight:void 0}}}},panelId:t},(0,u.createElement)(vk,e)),!l&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.lineHeight)}(e),label:(0,_.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ar({...o,typography:{...null==o?void 0:o.typography,lineHeight:void 0}})})}(e),isShownByDefault:null==f?void 0:f.lineHeight,resetAllFilter:v("lineHeight"),panelId:t},(0,u.createElement)(mk,e)),!c&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.letterSpacing)}(e),label:(0,_.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ar({...o,typography:{...null==o?void 0:o.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==f?void 0:f.letterSpacing,resetAllFilter:v("letterSpacing"),panelId:t},(0,u.createElement)(a_,e)),!i&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textDecoration)}(e),label:(0,_.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ar({...o,typography:{...null==o?void 0:o.typography,textDecoration:void 0}})})}(e),isShownByDefault:null==f?void 0:f.textDecoration,resetAllFilter:v("textDecoration"),panelId:t},(0,u.createElement)(Yk,e)),!s&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e),label:(0,_.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ar({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==f?void 0:f.textTransform,resetAllFilter:v("textTransform"),panelId:t},(0,u.createElement)(o_,e)))}const p_=e=>u_.some((t=>(0,a.hasBlockSupport)(e,t)));const m_=[...u_,mb,$b,fl,hl],g_=e=>m_.some((t=>(0,a.hasBlockSupport)(e,t)));function f_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};return(0,ni.getCSSRules)(e).forEach((e=>{t[e.key]=e.value})),t}const h_={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[$b],[`${c_}.__experimentalSkipSerialization`]:[c_],[`${fl}.__experimentalSkipSerialization`]:[fl],[`${hl}.__experimentalSkipSerialization`]:[hl]},v_={...h_,[`${hl}`]:["spacing.blockGap"]},b_={gradients:"gradient"};function k_(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return e;let o=e;return n||(o=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach((e=>{if(Array.isArray(e)||(e=e.split(".")),e.length>1){const[t,...n]=e;k_(o[t],[n],!0)}else 1===e.length&&delete o[e[0]]})),o}function __(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:v_;if(!g_(t))return e;let{style:r}=n;return Object.entries(o).forEach((e=>{let[n,o]=e;const l=(0,a.getBlockSupport)(t,n);!0===l&&(r=k_(r,o)),Array.isArray(l)&&l.forEach((e=>{const t=b_[e]||e;r=k_(r,[[...o,t]])}))})),e.style={...f_(r),...e.style},e}const y_=(0,m.createHigherOrderComponent)((e=>t=>{const n=Ao();return(0,u.createElement)(u.Fragment,null,n&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(nk,t),(0,u.createElement)(d_,t),(0,u.createElement)(kb,t),(0,u.createElement)(_l,t)),(0,u.createElement)(e,t))}),"withToolbarControls"),E_=(0,m.createHigherOrderComponent)((e=>t=>{var n,o;const r=`wp-elements-${(0,m.useInstanceId)(e)}`,l=Fr(t.name,$b,"link"),i=(0,u.useMemo)((()=>{var e;const n=null===(e=t.attributes.style)||void 0===e?void 0:e.elements,o=[];if(n&&Object.keys(n).length>0){var i;const e={...n,link:{...n.link,color:l||null===(i=n.link)||void 0===i?void 0:i.color}};for(const[t,n]of Object.entries(e)){const e=(0,ni.compileCSS)(n,{selector:`.editor-styles-wrapper .${r} ${a.__EXPERIMENTAL_ELEMENTS[t]}`});e&&o.push(e)}}return o.length>0?o:void 0}),[null===(n=t.attributes.style)||void 0===n?void 0:n.elements]),s=(0,u.useContext)(Kv.__unstableElementContext);return(0,u.createElement)(u.Fragment,null,i&&s&&(0,u.createPortal)((0,u.createElement)("style",{dangerouslySetInnerHTML:{__html:i}}),s),(0,u.createElement)(e,c({},t,{className:null!==(o=t.attributes.style)&&void 0!==o&&o.elements?p()(t.className,r):t.className})))}));(0,s.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return g_(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",__),(0,s.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!g_(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),__(o,e,n,h_)},e})),(0,s.addFilter)("editor.BlockEdit","core/style/with-block-controls",y_),(0,s.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",E_);(0,s.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,a.hasBlockSupport)(n,"__experimentalSettings",!1)?(null!=e&&null!==(t=e.attributes)&&void 0!==t&&t.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));var C_=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"}));var S_=function(e){let t,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}=e;return t="unset"===i?(0,u.createElement)(h.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?(0,u.createElement)(h.DuotoneSwatch,{values:i}):(0,u.createElement)(Jl,{icon:C_}),(0,u.createElement)(h.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,_.__)("Duotone"),variant:"toolbar"},renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,u.createElement)(h.ToolbarButton,{showTooltip:!0,onClick:o,"aria-haspopup":"true","aria-expanded":n,onKeyDown:e=>{n||e.keyCode!==Qu.DOWN||(e.preventDefault(),o())},label:(0,_.__)("Apply duotone filter"),icon:t})},renderContent:()=>(0,u.createElement)(h.MenuGroup,{label:(0,_.__)("Duotone")},(0,u.createElement)("div",{className:"block-editor-duotone-control__description"},(0,_.__)("Create a two-tone color effect without losing your original image.")),(0,u.createElement)(h.DuotonePicker,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}))})};const w_=[];function B_(e){let{selector:t,id:n,colors:o}=e;return"unset"===o?(0,u.createElement)(Wp,{selector:t}):(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Kp,{id:n,colors:o}),(0,u.createElement)(jp,{id:n,selector:t}))}function I_(e){let{presetSetting:t,defaultSetting:n}=e;const o=!fr(n),r=fr(`${t}.custom`)||w_,l=fr(`${t}.theme`)||w_,i=fr(`${t}.default`)||w_;return(0,u.useMemo)((()=>[...r,...l,...o?w_:i]),[o,r,l,i])}function x_(e){var t;let{attributes:n,setAttributes:o}=e;const r=null==n?void 0:n.style,l=null==r||null===(t=r.color)||void 0===t?void 0:t.duotone,i=I_({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=I_({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),s=!fr("color.custom"),c=!fr("color.customDuotone")||0===(null==a?void 0:a.length)&&s;return 0===(null==i?void 0:i.length)&&c?null:(0,u.createElement)(Vo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,u.createElement)(S_,{duotonePalette:i,colorPalette:a,disableCustomDuotone:c,disableCustomColors:s,value:l,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}fp([hp]);const T_=(0,m.createHigherOrderComponent)((e=>t=>{const n=(0,a.hasBlockSupport)(t.name,"color.__experimentalDuotone"),o=(0,g.useSelect)((e=>e(To).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(e,t),n&&!o&&(0,u.createElement)(x_,t))}),"withDuotoneControls");const M_=(0,m.createHigherOrderComponent)((e=>t=>{var n,o,r;const l=(0,a.getBlockSupport)(t.name,"color.__experimentalDuotone"),i=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(r=o.color)||void 0===r?void 0:r.duotone;if(!l||!i)return(0,u.createElement)(e,t);const s=`wp-duotone-${(0,m.useInstanceId)(e)}`,d=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${s}`,l),g=p()(null==t?void 0:t.className,s),f=(0,u.useContext)(Kv.__unstableElementContext);return(0,u.createElement)(u.Fragment,null,f&&(0,u.createPortal)((0,u.createElement)(B_,{selector:d,id:s,colors:i}),f),(0,u.createElement)(e,c({},t,{className:g})))}),"withDuotoneStyles");(0,s.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,a.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,s.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",T_),(0,s.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",M_);const N_="__experimentalLayout";function P_(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=(0,g.useSelect)((e=>{var t;const{getSettings:n}=e(To);return null===(t=n().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments}),[]),r=fr("layout")||{},{attributes:l={},name:i}=n,{layout:s}=l,{default:c}=(0,a.getBlockSupport)(i,N_)||{},u=null!=s&&s.inherit||null!=s&&s.contentSize||null!=s&&s.wideSize?{...s,type:"constrained"}:s||c||{},d=[];var p,m;null!=r&&null!==(e=r.definitions)&&void 0!==e&&null!==(t=e[(null==u?void 0:u.type)||"default"])&&void 0!==t&&t.className&&d.push(null==r||null===(p=r.definitions)||void 0===p||null===(m=p[(null==u?void 0:u.type)||"default"])||void 0===m?void 0:m.className);return(null!=u&&u.inherit||null!=u&&u.contentSize||"constrained"===(null==u?void 0:u.type))&&o&&d.push("has-global-padding"),null!=u&&u.orientation&&d.push(`is-${(0,f.kebabCase)(u.orientation)}`),null!=u&&u.justifyContent&&d.push(`is-content-justification-${(0,f.kebabCase)(u.justifyContent)}`),null!=u&&u.flexWrap&&"nowrap"===u.flexWrap&&d.push("is-nowrap"),d}function L_(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const{attributes:o={},name:r}=t,{layout:l={},style:i={}}=o,a=null!=l&&l.inherit||null!=l&&l.contentSize||null!=l&&l.wideSize?{...l,type:"constrained"}:l||{},s=li((null==a?void 0:a.type)||"default"),c=fr("layout")||{},u=fr("spacing.blockGap"),d=null!==u,p=null==s||null===(e=s.getLayoutStyle)||void 0===e?void 0:e.call(s,{blockName:r,selector:n,layout:l,layoutDefinitions:null==c?void 0:c.definitions,style:i,hasBlockGapSupport:d});return p}function R_(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:r}=n,l=fr("layout"),i=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return t().supportsLayout}),[]),s=(0,a.getBlockSupport)(o,N_,{}),{allowSwitching:c,allowEditing:d=!0,allowInheriting:p=!0,default:m}=s;if(!d)return null;const f=!(!p||!l||null!=r&&r.type&&"default"!==(null==r?void 0:r.type)&&"constrained"!==(null==r?void 0:r.type)&&(null==r||!r.inherit)),v=r||m||{},{inherit:b=!1,type:k="default",contentSize:y=null}=v;if(("default"===k||"constrained"===k)&&!i)return null;const E=li(k),C=li("constrained"),S=!v.type&&(y||b),w=!!b||!!y,B=e=>t({layout:e});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(jr,null,(0,u.createElement)(h.PanelBody,{title:(0,_.__)("Layout")},f&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ToggleControl,{className:"block-editor-hooks__toggle-control",label:(0,_.__)("Inner blocks use content width"),checked:"constrained"===(null==E?void 0:E.name)||w,onChange:()=>t({layout:{type:"constrained"===(null==E?void 0:E.name)||w?"default":"constrained"}}),help:"constrained"===(null==E?void 0:E.name)||w?(0,_.__)("Nested blocks use content width with options for full and wide widths."):(0,_.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})),!b&&c&&(0,u.createElement)(A_,{type:k,onChange:e=>t({layout:{type:e}})}),E&&"default"!==E.name&&(0,u.createElement)(E.inspectorControls,{layout:v,onChange:B,layoutBlockSupport:s}),C&&S&&(0,u.createElement)(C.inspectorControls,{layout:v,onChange:B,layoutBlockSupport:s}))),!b&&E&&(0,u.createElement)(E.toolBarControls,{layout:v,onChange:B,layoutBlockSupport:s}))}function A_(e){let{type:t,onChange:n}=e;return(0,u.createElement)(h.ButtonGroup,null,ri.map((e=>{let{name:o,label:r}=e;return(0,u.createElement)(h.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const O_=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,a.hasBlockSupport)(n,N_)&&(0,u.createElement)(R_,c({key:"layout"},t)),(0,u.createElement)(e,c({key:"edit"},t))]}),"withInspectorControls"),D_=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o,block:r}=t,l=(0,a.hasBlockSupport)(n,N_),i=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return!!t().disableLayoutStyles})),s=l&&!i,d=(0,m.useInstanceId)(e),f=fr("layout")||{},h=(0,u.useContext)(Kv.__unstableElementContext),{layout:v}=o,{default:b}=(0,a.getBlockSupport)(n,N_)||{},k=null!=v&&v.inherit||null!=v&&v.contentSize||null!=v&&v.wideSize?{...v,type:"constrained"}:v||b||{},_=l?P_(r):null,y=`.wp-container-${d}.wp-container-${d}`,E=null!==fr("spacing.blockGap");let C;if(s){var S;const e=li((null==k?void 0:k.type)||"default");C=null==e||null===(S=e.getLayoutStyle)||void 0===S?void 0:S.call(e,{blockName:n,selector:y,layout:k,layoutDefinitions:null==f?void 0:f.definitions,style:null==o?void 0:o.style,hasBlockGapSupport:E})}const w=p()({[`wp-container-${d}`]:s&&!!C},_);return(0,u.createElement)(u.Fragment,null,s&&h&&!!C&&(0,u.createPortal)((0,u.createElement)(ui,{blockName:n,selector:y,css:C,layout:k,style:null==o?void 0:o.style}),h),(0,u.createElement)(e,c({},t,{__unstableLayoutClassNames:w})))})),z_=(0,m.createHigherOrderComponent)((e=>t=>{const{attributes:n}=t,{style:{layout:o={}}={}}=n,{selfStretch:r,flexSize:l}=o,i=r||l,a=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return!!t().disableLayoutStyles})),s=i&&!a,d=(0,u.useContext)(Kv.__unstableElementContext),f=(0,m.useInstanceId)(e),h=`.wp-container-content-${f}`;let v="";"fixed"===r&&l?v+=`${h} {\n\t\t\t\tflex-basis: ${l};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===r&&(v+=`${h} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`);const b=p()(null==t?void 0:t.className,{[`wp-container-content-${f}`]:s&&!!v});return(0,u.createElement)(u.Fragment,null,s&&d&&!!v&&(0,u.createPortal)((0,u.createElement)("style",null,v),d),(0,u.createElement)(e,c({},t,{className:b})))}));function F_(e){let{clientId:t,stopEditingAsBlock:n}=e;const o=(0,g.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=e(To);return n(t)||o(t,!0)}),[t]);return(0,u.useEffect)((()=>{o||n()}),[o]),null}(0,s.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.layout)&&void 0!==t?t:{})||(0,a.hasBlockSupport)(e,N_)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,s.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",D_),(0,s.addFilter)("editor.BlockListBlock","core/editor/layout/with-child-layout-styles",z_),(0,s.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",O_);const V_=(0,m.createHigherOrderComponent)((e=>t=>{const{getBlockListSettings:n,getSettings:o}=(0,g.useSelect)(To),r=(0,u.useRef)(),{templateLock:l,isLockedByParent:i,isEditingAsBlocks:a}=(0,g.useSelect)((e=>{const{__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=e(To);return{templateLock:o(t.clientId),isLockedByParent:!!n(t.clientId),isEditingAsBlocks:r()===t.clientId}}),[t.clientId]),{updateSettings:s,updateBlockListSettings:d,__unstableSetTemporarilyEditingAsBlocks:m}=(0,g.useDispatch)(To),f=!i&&"contentOnly"===l,{__unstableMarkNextChangeAsNotPersistent:v,updateBlockAttributes:b}=(0,g.useDispatch)(To),k=(0,u.useCallback)((()=>{v(),b(t.clientId,{templateLock:"contentOnly"}),d(t.clientId,{...n(t.clientId),templateLock:"contentOnly"}),s({focusMode:r.current}),m()}),[t.clientId,r,s,d,n,v,b,m]);return f||a?(0,u.createElement)(u.Fragment,null,a&&!f&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(F_,{clientId:t.clientId,stopEditingAsBlock:k}),(0,u.createElement)(Vo,{group:"other"},(0,u.createElement)(h.ToolbarButton,{onClick:()=>{k()}},(0,_.__)("Done")))),!a&&f&&t.isSelected&&(0,u.createElement)(Fh,null,(e=>{let{onClose:l}=e;return(0,u.createElement)(h.MenuItem,{onClick:()=>{v(),b(t.clientId,{templateLock:void 0}),d(t.clientId,{...n(t.clientId),templateLock:!1}),r.current=o().focusMode,s({focusMode:!0}),m(t.clientId),l()}},(0,_.__)("Modify"))})),(0,u.createElement)(e,c({},t,{className:p()(t.className,a&&"is-content-locked-editing-as-blocks")}))):(0,u.createElement)(e,t)}),"withToolbarControls");(0,s.addFilter)("editor.BlockEdit","core/content-lock-ui/with-block-controls",V_);const H_="metadata";function G_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e.name.startsWith("core/"))return!1;const n=(0,a.getBlockSupport)(e,"__experimentalMetadata");return!!(!0===n||null!=n&&n[t])}function U_(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:Cb(e)||void 0,style:f_({border:n})}}function $_(e){const{colors:t}=pb(),n=U_(e),{borderColor:o}=e;if(o){const e=vb({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function j_(e){var t,n,o,r,l,i;const{backgroundColor:a,textColor:s,gradient:c,style:u}=e,d=db("background-color",a),m=db("color",s),g=wb(c),f=g||(null==u||null===(t=u.color)||void 0===t?void 0:t.gradient);return{className:p()(m,g,{[d]:!f&&!!d,"has-text-color":s||(null==u||null===(n=u.color)||void 0===n?void 0:n.text),"has-background":a||(null==u||null===(o=u.color)||void 0===o?void 0:o.background)||c||(null==u||null===(r=u.color)||void 0===r?void 0:r.gradient),"has-link-color":null==u||null===(l=u.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:f_({color:(null==u?void 0:u.color)||{}})}}(0,s.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.metadata)&&void 0!==n&&n.type||G_(e,"name")&&(e.attributes={...e.attributes,[H_]:{type:"object"}}),e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/metadata/save-props",(function(e,t,n){return G_(t)&&(e.metadata=n.metadata),e})),(0,s.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||G_(e,"name",!1)&&(e.__experimentalLabel=(e,t)=>{let{context:n}=t;const{metadata:o}=e;if("list-view"===n&&null!=o&&o.name)return o.name}),e}));const W_={};function K_(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=fr("color.palette.custom"),l=fr("color.palette.theme"),i=fr("color.palette.default"),a=fr("color.gradients")||W_,s=(0,u.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),c=(0,u.useMemo)((()=>[...(null==a?void 0:a.custom)||[],...(null==a?void 0:a.theme)||[],...(null==a?void 0:a.default)||[]]),[a]),d=j_(e);if(t){const e=cb(s,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Bb(c,o)),n){const e=cb(s,n);d.style.color=e.color}return d}function q_(e){const{style:t}=e;return{style:f_({spacing:(null==t?void 0:t.spacing)||{}})}}function Y_(e,t){var n;let o=(null==e||null===(n=e.style)||void 0===n?void 0:n.typography)||{};if(t&&(!0===t||0!==Object.keys(t).length)){var r,l,i,a;const n=Rk({fontSize:null==e||null===(r=e.style)||void 0===r||null===(l=r.typography)||void 0===l?void 0:l.fontSize,minimumFontSizeLimit:null==t?void 0:t.minFontSize})||(null==e||null===(i=e.style)||void 0===i||null===(a=i.typography)||void 0===a?void 0:a.fontSize);o={...o,fontSize:n}}const s=f_({typography:o}),c=null!=e&&e.fontFamily?`has-${(0,f.kebabCase)(e.fontFamily)}-font-family`:"";return{className:p()(c,xk(null==e?void 0:e.fontSize)),style:s}}function Z_(e){const[t,n]=(0,u.useState)(e);return(0,u.useEffect)((()=>{e&&n(e)}),[e]),t}const Q_=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},X_=e=>(0,m.createHigherOrderComponent)((t=>n=>(0,u.createElement)(t,c({},n,{colors:e}))),"withCustomColorPalette"),J_=()=>(0,m.createHigherOrderComponent)((e=>t=>{const n=fr("color.palette.custom"),o=fr("color.palette.theme"),r=fr("color.palette.default"),l=(0,u.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,u.createElement)(e,c({},t,{colors:l}))}),"withEditorColorPalette");function ey(e,t){const n=e.reduce(((e,t)=>({...e,..."string"==typeof t?{[t]:(0,f.kebabCase)(t)}:t})),{});return(0,m.compose)([t,e=>class extends u.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=mp(t),o=e=>{let{color:t}=e;return n.contrast(t)},r=Math.max(...e.map(o));return e.find((e=>o(e)===r)).color}(t,e)}createSetters(){return Object.keys(n).reduce(((e,t)=>{const n=Q_(t),o=`custom${n}`;return e[`set${n}`]=this.createSetColor(t,o),e}),{})}createSetColor(e,t){return n=>{const o=ub(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:o,colors:r}=e;return Object.entries(n).reduce(((e,n)=>{let[l,i]=n;const a=cb(r,o[l],o[`custom${Q_(l)}`]),s=t[l];return(null==s?void 0:s.color)===a.color&&s?e[l]=s:e[l]={...a,class:db(i,a.slug)},e}),{})}render(){return(0,u.createElement)(e,c({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function ty(e){return function(){const t=X_(e);for(var n=arguments.length,o=new Array(n),r=0;r{let[t,...n]=e;return t.toUpperCase()+n.join("")};var ly=function(){for(var e=arguments.length,t=new Array(e),n=0;n(e[t]=`custom${ry(t)}`,e)),{});return(0,m.createHigherOrderComponent)((0,m.compose)([(0,m.createHigherOrderComponent)((e=>t=>{const n=fr("typography.fontSizes")||oy;return(0,u.createElement)(e,c({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends u.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return Object.entries(o).reduce(((e,t)=>{let[n,o]=t;return e[`set${ry(n)}`]=this.createSetFontSize(n,o),e}),{})}createSetFontSize(e,t){return n=>{var o;const r=null===(o=this.props.fontSizes)||void 0===o?void 0:o.find((e=>{let{size:t}=e;return t===Number(n)}));this.props.setAttributes({[e]:r&&r.slug?r.slug:void 0,[t]:r&&r.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:r}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!Object.values(o).some(l))return null;const i=Object.entries(o).filter((e=>{let[t,n]=e;return l(n,t)})).reduce(((e,t)=>{let[o,l]=t;const i=n[o],a=Bk(r,i,n[l]);return e[o]={...a,class:xk(i)},e}),{});return{...t,...i}}render(){return(0,u.createElement)(e,c({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")};var iy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"}));var ay=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"}));var sy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const cy=[{icon:iy,title:(0,_.__)("Align text left"),align:"left"},{icon:ay,title:(0,_.__)("Align text center"),align:"center"},{icon:sy,title:(0,_.__)("Align text right"),align:"right"}],uy={position:"bottom right",variant:"toolbar"};var dy=function(e){let{value:t,onChange:n,alignmentControls:o=cy,label:r=(0,_.__)("Align text"),describedBy:l=(0,_.__)("Change text alignment"),isCollapsed:i=!0,isToolbar:a}=e;function s(e){return()=>n(t===e?void 0:e)}const d=o.find((e=>e.align===t)),p=a?h.ToolbarGroup:h.ToolbarDropdownMenu,m=a?{isCollapsed:i}:{toggleProps:{describedBy:l},popoverProps:uy};return(0,u.createElement)(p,c({icon:d?d.icon:(0,_.isRTL)()?sy:iy,label:r,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:i?"menuitemradio":void 0,onClick:s(n)}}))},m))};const py=e=>(0,u.createElement)(dy,c({},e,{isToolbar:!1})),my=e=>(0,u.createElement)(dy,c({},e,{isToolbar:!0})),gy=()=>{};var fy={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(To),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=pm(t,gy),i=(0,u.useMemo)((()=>(e.trim()?$m(o,r,l,e):Y(o,"frecency","desc")).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]),a=(0,u.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(fd,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i]);return[a]},allowContext(e,t){return!(/\S/.test(e)||/\S/.test(t))},getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,a.createBlock)(t,n,(0,a.createBlocksFromInnerBlocksTemplate)(o))}}},hy=window.wp.apiFetch,vy=n.n(hy);var by=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"}));var ky=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"}));var _y={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await vy()({path:(0,lg.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords(e){return[...e.title.split(/\s+/)]},getOptionLabel(e){return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Jl,{key:"icon",icon:"page"===e.subtype?by:ky}),e.title)},getOptionCompletion(e){return(0,u.createElement)("a",{href:e.url},e.title)}};const yy=[];function Ey(e){let{completers:t=yy}=e;const{name:n}=Ro();return(0,u.useMemo)((()=>{let e=[...t,_y];return(n===(0,a.getDefaultBlockName)()||(0,a.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=[...e,fy]),(0,s.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map((e=>({...e})))),e=(0,s.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}var Cy=function(e){return(0,u.createElement)(h.Autocomplete,c({},e,{completers:Ey(e)}))};var Sy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"}));var wy=function(e){let{isActive:t,label:n=(0,_.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,u.createElement)(h.ToolbarButton,{isActive:t,icon:Sy,label:n,onClick:()=>o(!t),disabled:r})};const By=()=>{};var Iy=function(e){const{label:t=(0,_.__)("Change matrix alignment"),onChange:n=By,value:o="center",isDisabled:r}=e,l=(0,u.createElement)(h.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,u.createElement)(h.Dropdown,{popoverProps:{variant:"toolbar",placement:"bottom-start"},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,u.createElement)(h.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==Qu.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,u.createElement)(h.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})};var xy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"}));var Ty=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,g.useDispatch)(To),{clientId:r,parents:l,hasSelection:i}=(0,g.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(To),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,_.__)("Document");return(0,u.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,_.__)("Block breadcrumb")},(0,u.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,u.createElement)(h.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,u.createElement)(Jl,{icon:xy,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,u.createElement)("li",{key:e},(0,u.createElement)(h.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,u.createElement)(sf,{clientId:e,maximumLength:35})),(0,u.createElement)(Jl,{icon:xy,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,u.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,u.createElement)(sf,{clientId:r,maximumLength:35})))};const My=()=>(0,u.createElement)(h.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,u.createElement)(h.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),Ny=e=>{let{style:t,className:n}=e;return(0,u.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,u.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,u.createElement)(My,null)))},Py=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,_.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==Qu.DOWN||(e.preventDefault(),o())},icon:(0,u.createElement)(n,null,(0,u.createElement)(t,null,(0,u.createElement)(Ny,null)))}))}};var Ly=e=>{let{children:t,...n}=e;return W()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,u.createElement)(h.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:Py(n),renderContent:()=>t})};var Ry=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const Ay=Ru(h.__experimentalTreeGridRow);var Oy=(0,u.forwardRef)(((e,t)=>{let{isSelected:n,position:o,level:r,rowCount:l,children:i,className:a,path:s,...d}=e;const g=Du({isSelected:n,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:s}),f=(0,m.useMergeRefs)([t,g]);return(0,u.createElement)(Ay,c({ref:f,className:p()("block-editor-list-view-leaf",a),level:r,positionInSet:o,setSize:l},d),i)}));var Dy=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"}));var zy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"}));function Fy(e){let{onClick:t}=e;return(0,u.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,u.createElement)(Jl,{icon:(0,_.isRTL)()?zy:xy}))}var Vy=(0,u.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:a,onDragStart:s,onDragEnd:c,draggable:d}=e;const m=lf(o),g=af({clientId:o,context:"list-view"}),{isLocked:f}=xh(o);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Button,{className:p()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==Qu.ENTER&&e.keyCode!==Qu.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),null==s||s(e)},onDragEnd:c,draggable:d,href:`#block-${o}`,"aria-hidden":!0},(0,u.createElement)(Fy,{onClick:l}),(0,u.createElement)(fd,{icon:null==m?void 0:m.icon,showColors:!0}),(0,u.createElement)(h.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,u.createElement)(h.__experimentalTruncate,{ellipsizeMode:"auto"},g)),(null==m?void 0:m.anchor)&&(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper"},(0,u.createElement)(h.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto"},m.anchor)),f&&(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,u.createElement)(Jl,{icon:Dy})))))}));const Hy=(0,u.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:i,siblingBlockCount:a,level:s,isExpanded:d,selectedClientIds:m,...f}=e;const{clientId:h}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,g.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(To);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[h]),k=v&&b===h,_=p()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=m.includes(h)?m:[h];return(0,u.createElement)(cf,{clientIds:y},(e=>{let{draggable:p,onDragStart:m,onDragEnd:g}=e;return(0,u.createElement)(Vy,c({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:i,siblingBlockCount:a,level:s,draggable:p,onDragStart:m,onDragEnd:g,isExpanded:d},f))}))}));var Gy=Hy;const Uy=(0,u.createContext)({}),$y=()=>(0,u.useContext)(Uy);var jy=(0,u.memo)((function e(t){let{block:n,isDragged:o,isSelected:r,isBranchSelected:l,selectBlock:i,position:s,level:c,rowCount:d,siblingBlockCount:f,showBlockMovers:v,path:b,isExpanded:k,selectedClientIds:y,preventAnnouncement:E,isSyncedBranch:C}=t;const S=(0,u.useRef)(null),w=(0,u.useRef)(null),[B,I]=(0,u.useState)(!1),{clientId:x}=n,{isLocked:T,isContentLocked:M,canEdit:N}=xh(x),P=(0,g.useSelect)((e=>!r&&(!!M&&e(To).hasSelectedInnerBlock(x,!0))),[M,x,r]),L=!M&&N,R=P||r&&y[0]===x,A=P||r&&y[y.length-1]===x,{toggleBlockHighlight:O}=(0,g.useDispatch)(To),D=lf(x),z=(0,g.useSelect)((e=>e(To).getBlockName(x)),[x]),F=(0,a.hasBlockSupport)(z,"__experimentalToolbar",!0),V=`list-view-block-select-button__${(0,m.useInstanceId)(e)}`,H=((e,t,n)=>(0,_.sprintf)((0,_.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(s,f,c);let G=(0,_.__)("Link");D&&(G=T?(0,_.sprintf)((0,_.__)("%s link (locked)"),D.title):(0,_.sprintf)((0,_.__)("%s link"),D.title));const U=D?(0,_.sprintf)((0,_.__)("Options for %s block"),D.title):(0,_.__)("Options"),{isTreeGridMounted:$,expand:j,collapse:W}=$y(),K=v&&f>0,q=p()("block-editor-list-view-block__mover-cell",{"is-visible":B||r}),Y=p()("block-editor-list-view-block__menu-cell",{"is-visible":B||R});(0,u.useEffect)((()=>{!$&&r&&S.current.focus()}),[]);const Z=(0,u.useCallback)((()=>{I(!0),O(x,!0)}),[x,I,O]),Q=(0,u.useCallback)((()=>{I(!1),O(x,!1)}),[x,I,O]),X=(0,u.useCallback)((e=>{i(e,x),e.preventDefault()}),[x,i]),J=(0,u.useCallback)((e=>{i(void 0,e)}),[i]),ee=(0,u.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?W(x):!1===k&&j(x)}),[x,j,W,k]);let te;K?te=2:F||(te=3);const ne=p()({"is-selected":r||P,"is-first-selected":R,"is-last-selected":A,"is-branch-selected":l,"is-synced-branch":C,"is-dragging":o,"has-single-cell":!F,"is-synced":null==D?void 0:D.isSynced}),oe=y.includes(x)?y:[x];return function(e){let{isSelected:t,selectedClientIds:n,rowItemRef:o}=e;const r=1===n.length;(0,u.useLayoutEffect)((()=>{if(!t||!r||!o.current)return;const e=(0,Ri.getScrollContainer)(o.current),{ownerDocument:n}=o.current;if(e===n.body||e===n.documentElement||!e)return;const l=o.current.getBoundingClientRect(),i=e.getBoundingClientRect();(l.topi.bottom)&&o.current.scrollIntoView()}),[t,r,o])}({isSelected:r,rowItemRef:w,selectedClientIds:y}),(0,u.createElement)(Oy,{className:ne,onMouseEnter:Z,onMouseLeave:Q,onFocus:Z,onBlur:Q,level:c,position:s,rowCount:d,path:b,id:`list-view-block-${x}`,"data-block":x,isExpanded:L?k:void 0,"aria-selected":!!r||P,ref:w},(0,u.createElement)(h.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:te,ref:S,"aria-label":G,"aria-selected":!!r||P,"aria-expanded":L?k:void 0,"aria-describedby":V},(e=>{let{ref:t,tabIndex:o,onFocus:l}=e;return(0,u.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,u.createElement)(Gy,{block:n,onClick:X,onToggleExpanded:ee,isSelected:r,position:s,siblingBlockCount:f,level:c,ref:t,tabIndex:o,onFocus:l,isExpanded:k,selectedClientIds:y,preventAnnouncement:E}),(0,u.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:V},H))})),K&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalTreeGridCell,{className:q,withoutGridItem:!0},(0,u.createElement)(h.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,u.createElement)(vf,{orientation:"vertical",clientIds:[x],ref:t,tabIndex:n,onFocus:o})})),(0,u.createElement)(h.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,u.createElement)(bf,{orientation:"vertical",clientIds:[x],ref:t,tabIndex:n,onFocus:o})})))),F&&(0,u.createElement)(h.__experimentalTreeGridCell,{className:Y,"aria-selected":!!r||P},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,u.createElement)(Uh,{clientIds:oe,icon:cg,label:U,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:J})})))}));function Wy(e,t,n,o){var r;if(null==n?void 0:n.includes(e.clientId))return 0;return(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(Ky(t,n,o),0):1}const Ky=(e,t,n)=>(o,r)=>{var l;if(null==t?void 0:t.includes(r.clientId))return o;return(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+Wy(r,e,t,n):o+1},qy=()=>{};var Yy=(0,u.memo)((function e(t){const{blocks:n,selectBlock:o=qy,showBlockMovers:r,selectedClientIds:l,level:i=1,path:a="",isBranchSelected:s=!1,listPosition:c=0,fixedListWindow:d,isExpanded:p,parentId:m,shouldShowInnerBlocks:f=!0,isSyncedBranch:h=!1}=t,v=lf(m),b=h||!(null==v||!v.isSynced),k=(0,g.useSelect)((e=>{if(!m)return!0;const t="contentOnly"===e(To).getTemplateLock(m),n=e(To).canEditBlock(m);return!t&&n}),[m]),{expandedState:_,draggedClientIds:y}=$y();if(!k)return null;const E=n.filter(Boolean),C=E.length;let S=c;return(0,u.createElement)(u.Fragment,null,E.map(((t,n)=>{var c;const{clientId:m,innerBlocks:h}=t;n>0&&(S+=Wy(E[n-1],_,y,p));const{itemInView:v}=d,k=v(S),w=n+1,B=a.length>0?`${a}_${w}`:`${w}`,I=!(null==h||!h.length),x=I&&f?null!==(c=_[m])&&void 0!==c?c:p:void 0,T=!(null==y||!y.includes(m)),M=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(m,l),N=s||M&&I,P=T||k||M;return(0,u.createElement)(g.AsyncModeProvider,{key:m,value:!M},P&&(0,u.createElement)(jy,{block:t,selectBlock:o,isSelected:M,isBranchSelected:N,isDragged:T,level:i,position:w,rowCount:C,siblingBlockCount:C,showBlockMovers:r,path:B,isExpanded:x,listPosition:S,selectedClientIds:l,isSyncedBranch:b}),!P&&(0,u.createElement)("tr",null,(0,u.createElement)("td",{className:"block-editor-list-view-placeholder"})),I&&x&&!T&&(0,u.createElement)(e,{parentId:m,blocks:h,selectBlock:o,showBlockMovers:r,level:i+1,path:B,listPosition:S+1,fixedListWindow:d,isBranchSelected:N,selectedClientIds:l,isExpanded:p,isSyncedBranch:b}))})))}));function Zy(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,a]=(0,u.useMemo)((()=>{if(!t.current)return[];return[o?t.current.querySelector(`[data-block="${o}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]}),[o,r]),s=a||i,c=(0,u.useCallback)((()=>{if(!i)return 0;const e=s.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,s]),d=(0,u.useMemo)((()=>{if(!s)return{};const e=c();return{width:s.offsetWidth-e}}),[c,s]),p=(0,u.useMemo)((()=>{if(s&&("top"===l||"bottom"===l||"inside"===l))return{ownerDocument:s.ownerDocument,getBoundingClientRect(){const e=s.getBoundingClientRect(),t=c(),n=e.left+t,o=e.right;let r=0,i=0;"top"===l?(r=e.top,i=e.top):(r=e.bottom,i=e.bottom);const a=o-n,u=i-r;return new window.DOMRect(n,r,a,u)}}}),[s,l,c]);return s?(0,u.createElement)(h.Popover,{animate:!1,anchor:p,focusOnMount:!1,className:"block-editor-list-view-drop-indicator",variant:"unstyled"},(0,u.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}function Qy(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,g.useDispatch)(To),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:l,getBlockSelectionEnd:i,getSelectedBlockClientIds:s,hasMultiSelection:c,hasSelectedBlock:d}=(0,g.useSelect)(To),{getBlockType:p}=(0,g.useSelect)(a.store);return{updateBlockSelection:(0,u.useCallback)((async(i,a,u)=>{if(null==i||!i.shiftKey)return void n(a);i.preventDefault();const m="keydown"===i.type&&(i.keyCode===Qu.UP||i.keyCode===Qu.DOWN||i.keyCode===Qu.HOME||i.keyCode===Qu.END);if(!m&&!d()&&!c())return void n(a,null);const g=s(),f=[...r(a),a];m&&!g.some((e=>f.includes(e)))&&await e();let h=l(),v=a;m&&(d()||c()||(h=a),u&&(v=u));const b=r(h),k=r(v),{start:y,end:E}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(h,v,b,k);await t(y,E,null);const C=s();if((i.keyCode===Qu.HOME||i.keyCode===Qu.END)&&C.length>1)return;const S=g.filter((e=>!C.includes(e)));let w;if(1===S.length){var B;const e=null===(B=p(o(S[0])))||void 0===B?void 0:B.title;e&&(w=(0,_.sprintf)((0,_.__)("%s deselected."),e))}else S.length>1&&(w=(0,_.sprintf)((0,_.__)("%s blocks deselected."),S.length));w&&(0,pn.speak)(w)}),[e,o,p,r,l,i,s,c,d,t,n])}}const Xy=["top","bottom"];function Jy(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,g.useSelect)(To),[l,i]=(0,u.useState)(),{rootClientId:a,blockIndex:s}=l||{},c=Nv(a,s),d=o(),p=(0,m.useThrottle)((0,u.useCallback)(((o,l)=>{const a={x:o.clientX,y:o.clientY},s=!(null==d||!d.length),c=function(e,t){let n,o,r,l;for(const i of e){if(i.isDraggedBlock)continue;const a=i.element.getBoundingClientRect(),[s,c]=Lv(t,a,Xy),u=Rv(t,a);if(void 0===r||s0||function(e,t){const n=t.left+t.width/2;return e.x>n}(t,l)))return{rootClientId:o.clientId,blockIndex:0,dropPosition:"inside"};if(!o.canInsertDraggedBlocksAsSibling)return;const a=i?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+a,dropPosition:n}}(Array.from(l.querySelectorAll("[data-block]")).map((o=>{const l=o.dataset.block,i=e(l);return{clientId:l,rootClientId:i,blockIndex:t(l),element:o,isDraggedBlock:!!s&&d.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!s||r(d,i),canInsertDraggedBlocksAsChild:!s||r(d,l)}})),a);c&&i(c)}),[d]),200);return{ref:(0,m.__experimentalUseDropZone)({onDrop:c,onDragOver(e){p(e,e.currentTarget)},onDragEnd(){p.cancel(),i(null)}}),target:l}}const eE=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var tE=(0,u.forwardRef)((function(e,t){let{id:n,blocks:o,showBlockMovers:r=!1,isExpanded:l=!1}=e;const{clientIdsTree:i,draggedClientIds:a,selectedClientIds:s}=function(e){return(0,g.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(To);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(o),{visibleBlockCount:c,shouldShowInnerBlocks:d}=(0,g.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n,__unstableGetEditorMode:o}=e(To),r=(null==a?void 0:a.length)>0?n(a).length+1:0;return{visibleBlockCount:t()-r,shouldShowInnerBlocks:"zoom-out"!==o()}}),[a]),{updateBlockSelection:p}=Qy(),[f,v]=(0,u.useReducer)(eE,{}),{ref:b,target:k}=Jy(),y=(0,u.useRef)(),E=(0,m.useMergeRefs)([y,b,t]),C=(0,u.useRef)(!1),{setSelectedTreeId:S}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,u.useState)(null),{selectedBlockParentClientIds:l}=(0,g.useSelect)((e=>{const{getBlockParents:n}=e(To);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,u.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:s[0],setExpandedState:v}),w=(0,u.useCallback)(((e,t)=>{p(e,t),S(t)}),[S,p]);(0,u.useEffect)((()=>{C.current=!0}),[]);const[B]=(0,m.__experimentalUseFixedWindowList)(y,36,c,{useWindowing:!0,windowOverscan:40}),I=(0,u.useCallback)((e=>{e&&v({type:"expand",clientIds:[e]})}),[v]),x=(0,u.useCallback)((e=>{e&&v({type:"collapse",clientIds:[e]})}),[v]),T=(0,u.useCallback)((e=>{var t;I(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[I]),M=(0,u.useCallback)((e=>{var t;x(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[x]),N=(0,u.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&p(e,null==t||null===(o=t.dataset)||void 0===o?void 0:o.block,null==n||null===(r=n.dataset)||void 0===r?void 0:r.block)}),[p]),P=(0,u.useMemo)((()=>({isTreeGridMounted:C.current,draggedClientIds:a,expandedState:f,expand:I,collapse:x})),[C.current,a,f,I,x]);return(0,u.createElement)(g.AsyncModeProvider,{value:!0},(0,u.createElement)(Zy,{listViewRef:y,blockDropTarget:k}),(0,u.createElement)(h.__experimentalTreeGrid,{id:n,className:"block-editor-list-view-tree","aria-label":(0,_.__)("Block navigation structure"),ref:E,onCollapseRow:M,onExpandRow:T,onFocusRow:N,applicationAriaLabel:(0,_.__)("Block navigation structure")},(0,u.createElement)(Uy.Provider,{value:P},(0,u.createElement)(Yy,{blocks:i,selectBlock:w,showBlockMovers:r,fixedListWindow:B,selectedClientIds:s,isExpanded:l,shouldShowInnerBlocks:d}))))}));function nE(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,u.createElement)(h.Button,c({},l,{ref:r,icon:Ry,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0,label:(0,_.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var oE=(0,u.forwardRef)((function(e,t){let{isDisabled:n,...o}=e;W()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const r=(0,g.useSelect)((e=>!!e(To).getBlockCount()),[])&&!n;return(0,u.createElement)(h.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:e=>{let{isOpen:n,onToggle:l}=e;return(0,u.createElement)(nE,c({},o,{innerRef:t,isOpen:n,onToggle:l,isEnabled:r}))},renderContent:()=>(0,u.createElement)("div",{className:"block-editor-block-navigation__container"},(0,u.createElement)("p",{className:"block-editor-block-navigation__label"},(0,_.__)("List view")),(0,u.createElement)(tE,null))})}));function rE(e){var t;let{genericPreviewBlock:n,style:o,className:r,activeStyle:l}=e;const i=null===(t=(0,a.getBlockType)(n.name))||void 0===t?void 0:t.example,s=Ff(r,l,o),c=(0,u.useMemo)((()=>({...n,title:o.label||o.name,description:o.description,initialAttributes:{...n.attributes,className:s+" block-editor-block-styles__block-preview-container"},example:i})),[n,s]);return(0,u.createElement)(tm,{item:c,isStylePreview:!0})}const lE=()=>{};function iE(e){let{clientId:t,onSwitch:n=lE,onHoverClassName:o=lE}=e;const{onSelect:r,stylesToRender:l,activeStyle:i,genericPreviewBlock:a,className:s}=Hf({clientId:t,onSwitch:n}),[c,d]=(0,u.useState)(null),g=(0,m.useViewportMatch)("medium","<");if(!l||0===l.length)return null;const f=(0,m.debounce)(d,250),v=e=>{var t;c!==e?(f(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):f.cancel()};return(0,u.createElement)("div",{className:"block-editor-block-styles"},(0,u.createElement)("div",{className:"block-editor-block-styles__variants"},l.map((e=>{const t=e.isDefault?(0,_.__)("Default"):e.label||e.name;return(0,u.createElement)(h.Button,{className:p()("block-editor-block-styles__item",{"is-active":i.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>v(e),onFocus:()=>v(e),onMouseLeave:()=>v(null),onBlur:()=>v(null),onClick:()=>(e=>{r(e),o(null),d(null),f.cancel()})(e),"aria-current":i.name===e.name},(0,u.createElement)(h.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text"},t))}))),c&&!g&&(0,u.createElement)(h.Popover,{placement:"left-start",offset:20},(0,u.createElement)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>v(null)},(0,u.createElement)(rE,{activeStyle:i,className:s,genericPreviewBlock:a,style:c}))))}var aE=iE;iE.Slot=()=>(W()("BlockStyles.Slot",{version:"6.4",since:"6.2"}),null);var sE=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));var cE=function(e){let{icon:t=sE,label:n=(0,_.__)("Choose variation"),instructions:o=(0,_.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const a=p()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,u.createElement)(h.Placeholder,{icon:t,label:n,instructions:o,className:a},(0,u.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,_.__)("Block variations")},r.map((e=>(0,u.createElement)("li",{key:e.name},(0,u.createElement)(h.Button,{variant:"secondary",icon:e.icon&&e.icon.src?e.icon.src:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,u.createElement)("span",{className:"block-editor-block-variation-picker__variation-label"},e.title))))),i&&(0,u.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,u.createElement)(h.Button,{variant:"link",onClick:()=>l()},(0,_.__)("Skip"))))};var uE=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"}));const dE={carousel:"carousel",grid:"grid"},pE=e=>{let{onBlockPatternSelect:t}=e;return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,u.createElement)(h.Button,{variant:"primary",onClick:t},(0,_.__)("Choose")))},mE=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,u.createElement)(h.Button,{icon:md,label:(0,_.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,u.createElement)(h.Button,{icon:pd,label:(0,_.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var gE=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a}=e;const s=t===dE.carousel,c=(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,u.createElement)(h.Button,{icon:bi,label:(0,_.__)("Carousel view"),onClick:()=>n(dE.carousel),isPressed:s}),(0,u.createElement)(h.Button,{icon:uE,label:(0,_.__)("Grid view"),onClick:()=>n(dE.grid),isPressed:t===dE.grid}));return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},s&&(0,u.createElement)(mE,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),c,s&&(0,u.createElement)(pE,{onBlockPatternSelect:a}))};var fE=function(e,t,n){return(0,g.useSelect)((o=>{const{getBlockRootClientId:r,getPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(To),a=r(e);return n?i(a).filter(n):l(t,a)}),[e,t,n])};const hE=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r,showTitles:l}=e;const i=(0,h.__unstableUseCompositeState)(),a="block-editor-block-pattern-setup__container";if(t===dE.carousel){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__carousel"},(0,u.createElement)("div",{className:a},(0,u.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,u.createElement)(bE,{className:e.get(n)||"",key:t.name,pattern:t}))))))}return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__grid"},(0,u.createElement)(h.__unstableComposite,c({},i,{role:"listbox",className:a,"aria-label":(0,_.__)("Patterns list")}),o.map((e=>(0,u.createElement)(vE,{key:e.name,pattern:e,onSelect:r,composite:i,showTitles:l})))))};function vE(e){let{pattern:t,onSelect:n,composite:o,showTitles:r}=e;const l="block-editor-block-pattern-setup-list",{blocks:i,description:a,viewportWidth:s=700}=t,d=(0,m.useInstanceId)(vE,`${l}__item-description`);return(0,u.createElement)("div",{className:`${l}__list-item`,"aria-label":t.title,"aria-describedby":t.description?d:void 0},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},o,{className:`${l}__item`,onClick:()=>n(i)}),(0,u.createElement)(Jp,{blocks:i,viewportWidth:s}),r&&(0,u.createElement)("div",{className:`${l}__item-title`},t.title),!!a&&(0,u.createElement)(h.VisuallyHidden,{id:d},a)))}function bE(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,a=(0,m.useInstanceId)(bE,"block-editor-block-pattern-setup-list__item-description");return(0,u.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":l,"aria-describedby":i?a:void 0},(0,u.createElement)(Jp,{blocks:r,minHeight:o}),!!i&&(0,u.createElement)(h.VisuallyHidden,{id:a},i))}var kE=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,onBlockPatternSelect:r,initialViewMode:l=dE.carousel,showTitles:i=!1}=e;const[s,c]=(0,u.useState)(l),[d,p]=(0,u.useState)(0),{replaceBlock:m}=(0,g.useDispatch)(To),f=fE(t,n,o);if(null==f||!f.length)return null;const h=r||(e=>{const n=e.map((e=>(0,a.cloneBlock)(e)));m(t,n)});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${s}`},(0,u.createElement)(hE,{viewMode:s,activeSlide:d,patterns:f,onBlockPatternSelect:h,showTitles:i}),(0,u.createElement)(gE,{viewMode:s,setViewMode:c,activeSlide:d,totalSlides:f.length,handleNext:()=>{p((e=>e+1))},handlePrevious:()=>{p((e=>e-1))},onBlockPatternSelect:()=>{h(f[d].blocks)}})))};function _E(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;return(0,u.createElement)("fieldset",{className:t},(0,u.createElement)(h.VisuallyHidden,{as:"legend"},(0,_.__)("Transform to variation")),r.map((e=>(0,u.createElement)(h.Button,{key:e.name,icon:(0,u.createElement)(fd,{icon:e.icon,showColors:!0}),isPressed:o===e.name,label:o===e.name?e.title:(0,_.sprintf)((0,_.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function yE(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;const l=r.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}}));return(0,u.createElement)(h.DropdownMenu,{className:t,label:(0,_.__)("Transform to variation"),text:(0,_.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:df,toggleProps:{iconPosition:"right"}},(()=>(0,u.createElement)("div",{className:`${t}__container`},(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(h.MenuItemsChoice,{choices:l,value:o,onSelect:n})))))}var EE=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,g.useDispatch)(To),{activeBlockVariation:o,variations:r}=(0,g.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(a.store),{getBlockName:r,getBlockAttributes:l}=e(To),i=t&&r(t);return{activeBlockVariation:n(i,l(t)),variations:i&&o(i,"transform")}}),[t]),l=null==o?void 0:o.name,i=(0,u.useMemo)((()=>{const e=new Set;return!!r&&(r.forEach((t=>{var n;t.icon&&e.add((null===(n=t.icon)||void 0===n?void 0:n.src)||t.icon)})),e.size===r.length)}),[r]);if(null==r||!r.length)return null;const s=i?_E:yE;return(0,u.createElement)(s,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...r.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:l,variations:r})},CE=(0,m.createHigherOrderComponent)((e=>t=>{const n=fr("color.palette"),o=!fr("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,i=!(0,f.isEmpty)(r)||!l;return(0,u.createElement)(e,c({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:i}))}),"withColorContext"),SE=CE(h.ColorPalette);function wE(e){let{onChange:t,value:n,...o}=e;return(0,u.createElement)(Ob,c({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var BE=window.wp.date;const IE=new Date(2022,0,25);function xE(e){let{format:t,defaultFormat:n,onChange:o}=e;return(0,u.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,u.createElement)(h.VisuallyHidden,{as:"legend"},(0,_.__)("Date format")),(0,u.createElement)(h.ToggleControl,{label:(0,u.createElement)(u.Fragment,null,(0,_.__)("Default format"),(0,u.createElement)("span",{className:"block-editor-date-format-picker__default-format-toggle-control__hint"},(0,BE.dateI18n)(n,IE))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,u.createElement)(TE,{format:t,onChange:o}))}function TE(e){var t;let{format:n,onChange:o}=e;const r=[...new Set(["Y-m-d",(0,_._x)("n/j/Y","short date format"),(0,_._x)("n/j/Y g:i A","short date format with time"),(0,_._x)("M j, Y","medium date format"),(0,_._x)("M j, Y g:i A","medium date format with time"),(0,_._x)("F j, Y","long date format"),(0,_._x)("M j","short date format without the year")])],l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,BE.dateI18n)(e,IE),format:e}))),i={key:"custom",name:(0,_.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,_.__)("Enter your own date format")},[a,s]=(0,u.useState)((()=>!!n&&!r.includes(n)));return(0,u.createElement)(h.__experimentalVStack,null,(0,u.createElement)(h.CustomSelectControl,{__nextUnconstrainedWidth:!0,label:(0,_.__)("Choose a format"),options:[...l,i],value:a?i:null!==(t=l.find((e=>e.format===n)))&&void 0!==t?t:i,onChange:e=>{let{selectedItem:t}=e;t===i?s(!0):(s(!1),o(t.format))}}),a&&(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Custom format"),hideLabelFromVision:!0,help:(0,u.createInterpolateElement)((0,_.__)("Enter a date or time format string."),{Link:(0,u.createElement)(h.ExternalLink,{href:(0,_.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}const ME=["colors","disableCustomColors","gradients","disableCustomGradients"],NE=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:i,settings:a,title:s,showTitle:c=!0,__experimentalIsRenderedInSidebar:d,enableAlpha:v}=e;const b=(0,m.useInstanceId)(NE),{batch:k}=(0,g.useRegistry)();return(0,f.isEmpty)(n)&&(0,f.isEmpty)(o)&&r&&l&&null!=a&&a.every((e=>(0,f.isEmpty)(e.colors)&&(0,f.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?null:(0,u.createElement)(h.__experimentalToolsPanel,{className:p()("block-editor-panel-color-gradient-settings",t),label:c?s:void 0,resetAll:()=>{k((()=>{a.forEach((e=>{let{colorValue:t,gradientValue:n,onColorChange:o,onGradientChange:r}=e;t?o():n&&r()}))}))},panelId:b,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,u.createElement)(Vb,{settings:a,panelId:b,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalIsRenderedInSidebar:d,enableAlpha:v}),!!i&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalSpacer,{marginY:4})," ",i))},PE=e=>{const t=pb();return(0,u.createElement)(NE,c({},t,e))};var LE=e=>ME.every((t=>e.hasOwnProperty(t)))?(0,u.createElement)(NE,e):(0,u.createElement)(PE,e);const RE=(0,u.createContext)({}),AE=()=>(0,u.useContext)(RE);function OE(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,onFinishEditing:l,onSaveImage:i,children:a}=e;const c=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,l]=(0,u.useState)(),[i,a]=(0,u.useState)(),[c,d]=(0,u.useState)({x:0,y:0}),[p,m]=(0,u.useState)(100),[g,f]=(0,u.useState)(0),h=n/o,[v,b]=(0,u.useState)(h),k=(0,u.useCallback)((()=>{const e=(g+90)%360;let n=h;if(g%180==90&&(n=1/h),0===e)return l(),f(e),b(h),void d({x:-c.y*n,y:c.x*n});const o=new window.Image;o.src=t,o.onload=function(t){const o=document.createElement("canvas");let r=0,i=0;e%180?(o.width=t.target.height,o.height=t.target.width):(o.width=t.target.width,o.height=t.target.height),90!==e&&180!==e||(r=o.width),270!==e&&180!==e||(i=o.height);const a=o.getContext("2d");a.translate(r,i),a.rotate(e*Math.PI/180),a.drawImage(t.target,0,0),o.toBlob((t=>{l(URL.createObjectURL(t)),f(e),b(o.width/o.height),d({x:-c.y*n,y:c.x*n})}))};const r=(0,s.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof r&&(o.crossOrigin=r)}),[g,h]);return(0,u.useMemo)((()=>({editedUrl:r,setEditedUrl:l,crop:i,setCrop:a,position:c,setPosition:d,zoom:p,setZoom:m,rotation:g,setRotation:f,rotateClockwise:k,aspect:v,setAspect:b,defaultAspect:h})),[r,i,c,p,g,k,v,h])}({url:n,naturalWidth:o,naturalHeight:r}),d=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:a,onSaveImage:s,onFinishEditing:c}=e;const{createErrorNotice:d}=(0,g.useDispatch)(hm.store),[p,m]=(0,u.useState)(!1),f=(0,u.useCallback)((()=>{m(!1),c()}),[m,c]),h=(0,u.useCallback)((()=>{m(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,vy()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{s({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{d((0,_.sprintf)((0,_.__)("Could not edit image. %s"),(0,Ri.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{m(!1),c()}))}),[m,t,n,o,r,l,i,s,d,m,c]);return(0,u.useMemo)((()=>({isInProgress:p,apply:h,cancel:f})),[p,h,f])}({id:t,url:n,onSaveImage:i,onFinishEditing:l,...c}),p=(0,u.useMemo)((()=>({...c,...d})),[c,d]);return(0,u.createElement)(RE.Provider,{value:p},a)} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -38,4 +38,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -var OE=function(e,t){return OE=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},OE(e,t)};var DE=function(){return DE=Object.assign||function(e){for(var t,n=1,o=arguments.length;nu*r?{width:u*r,height:u}:{width:c,height:c/r}}function HE(e,t,n,o,r){void 0===r&&(r=0);var l=QE(t.width,t.height,r),i=l.width,a=l.height;return{x:GE(e.x,i,n.width,o),y:GE(e.y,a,n.height,o)}}function GE(e,t,n,o){var r=t*o/2-n/2;return XE(e,-r,r)}function UE(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function $E(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function jE(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var a=i?WE:KE,s=QE(t.width,t.height,l),c=QE(t.naturalWidth,t.naturalHeight,l),u={x:a(100,((s.width-n.width/r)/2-e.x/r)/s.width*100),y:a(100,((s.height-n.height/r)/2-e.y/r)/s.height*100),width:a(100,n.width/s.width*100/r),height:a(100,n.height/s.height*100/r)},d=Math.round(a(c.width,u.width*c.width/100)),p=Math.round(a(c.height,u.height*c.height/100)),m=c.width>=c.height*o?{width:Math.round(p*o),height:p}:{width:d,height:Math.round(d/o)};return{croppedAreaPercentages:u,croppedAreaPixels:DE(DE({},m),{x:Math.round(a(c.width-m.width,u.x*c.width/100)),y:Math.round(a(c.height-m.height,u.y*c.height/100))})}}function WE(e,t){return Math.min(e,Math.max(0,t))}function KE(e,t){return t}function qE(e,t,n,o,r,l){var i=QE(t.width,t.height,n),a=XE(o.width/i.width*(100/e.width),r,l);return{crop:{x:a*i.width/2-o.width/2-i.width*a*(e.x/100),y:a*i.height/2-o.height/2-i.height*a*(e.y/100)},zoom:a}}function YE(e,t,n,o,r,l){void 0===n&&(n=0);var i=QE(t.naturalWidth,t.naturalHeight,n),a=XE(function(e,t,n){var o=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*o):n.width/(e.width*o)}(e,t,o),r,l),s=o.height>o.width?o.height/e.height:o.width/e.width;return{crop:{x:((i.width-e.width)/2-e.x)*s,y:((i.height-e.height)/2-e.y)*s},zoom:a}}function ZE(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function QE(e,t,n){var o=n*Math.PI/180;return{width:Math.abs(Math.cos(o)*e)+Math.abs(Math.sin(o)*t),height:Math.abs(Math.sin(o)*e)+Math.abs(Math.cos(o)*t)}}function XE(e,t,n){return Math.min(Math.max(e,t),n)}function JE(){for(var e=[],t=0;t0})).join(" ").trim()}var eC=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=ka().createRef(),n.videoRef=ka().createRef(),n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc="undefined"!=typeof document?document:null,n.currentWindow="undefined"!=typeof window?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&n.containerRef){var e=!0;n.resizeObserver=new window.ResizeObserver((function(t){e?e=!1:n.computeSizes()})),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=qE(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),o=t.crop,r=t.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}else if(n.props.initialCroppedAreaPixels){var l=YE(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);o=l.crop,r=l.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}},n.computeSizes=function(){var e,t,o,r,l,i,a=n.imageRef.current||n.videoRef.current;if(a&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect();var s=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(o=n.imageRef.current)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef.current)||void 0===r?void 0:r.videoHeight)||0,d=c/u,p=void 0;if(a.offsetWidthd?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":p={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":p={width:n.containerRect.height*d,height:n.containerRect.height};break;case"auto-cover":p=c>u?{width:n.containerRect.width,height:n.containerRect.width/d}:{width:n.containerRect.height*d,height:n.containerRect.height}}else p={width:a.offsetWidth,height:a.offsetHeight};n.mediaSize=DE(DE({},p),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var m=n.props.cropSize?n.props.cropSize:VE(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(l=n.state.cropSize)||void 0===l?void 0:l.height)===m.height&&(null===(i=n.state.cropSize)||void 0===i?void 0:i.width)===m.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(m),n.setState({cropSize:m},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(m),m}},n.onMouseDown=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e)))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){n.currentDoc&&(n.isTouching=!0,n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var o=t.getMousePoint(e),r=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(r,o,{shouldUpdatePosition:!0}),n.props.onRotationChange){var l=n.gestureRotationStart+e.rotation;n.props.onRotationChange(l)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=DE({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?HE(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}})))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(n.currentWindow&&(!n.props.onWheelRequest||n.props.onWheelRequest(e))){e.preventDefault();var o=t.getMousePoint(e),r=FE()(e).pixelY,l=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(l,o,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t,o){var r=(void 0===o?{}:o).shouldUpdatePosition,l=void 0===r||r;if(n.state.cropSize&&n.props.onZoomChange){var i=XE(e,n.props.minZoom,n.props.maxZoom);if(l){var a=n.getPointOnContainer(t),s=n.getPointOnMedia(a),c={x:s.x*i-a.x,y:s.y*i-a.y},u=n.props.restrictPosition?HE(c,n.mediaSize,n.state.cropSize,i,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(i)}},n.getCropData=function(){return n.state.cropSize?jE(n.props.restrictPosition?HE(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?HE(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function n(){this.constructor=e}OE(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(e){var t,n,o,r,l,i,a,s,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(o=e.cropSize)||void 0===o?void 0:o.width)!==(null===(r=this.props.cropSize)||void 0===r?void 0:r.width)?this.computeSizes():(null===(l=e.crop)||void 0===l?void 0:l.x)===(null===(i=this.props.crop)||void 0===i?void 0:i.x)&&(null===(a=e.crop)||void 0===a?void 0:a.y)===(null===(s=this.props.crop)||void 0===s?void 0:s.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef.current)||void 0===c||c.load())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=UE(n,o),this.lastPinchRotation=$E(n,o),this.onDragStart(ZE(n,o))},t.prototype.onPinchMove=function(e){var n=this;if(this.currentDoc&&this.currentWindow){var o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=ZE(o,r);this.onDrag(l),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=UE(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var i=$E(o,r),a=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(a),n.lastPinchRotation=i}))}},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.transform,i=t.crop,a=i.x,s=i.y,c=t.rotation,u=t.zoom,d=t.cropShape,p=t.showGrid,m=t.style,g=m.containerStyle,f=m.cropAreaStyle,h=m.mediaStyle,v=t.classes,b=v.containerClassName,k=v.cropAreaClassName,_=v.mediaClassName,y=t.objectFit;return ka().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:g,className:JE("reactEasyCrop_Container",b)},n?ka().createElement("img",DE({alt:"",className:JE("reactEasyCrop_Image","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical","auto-cover"===y&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),_)},r,{src:n,ref:this.imageRef,style:DE(DE({},h),{transform:l||"translate(".concat(a,"px, ").concat(s,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),onLoad:this.onMediaLoad})):o&&ka().createElement("video",DE({autoPlay:!0,loop:!0,muted:!0,className:JE("reactEasyCrop_Video","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical","auto-cover"===y&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),_)},r,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:DE(DE({},h),{transform:l||"translate(".concat(a,"px, ").concat(s,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return ka().createElement("source",DE({key:e.src},e))}))),this.state.cropSize&&ka().createElement("div",{style:DE(DE({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:JE("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",k)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(ka().Component);const tC={placement:"bottom-start",variant:"toolbar"};function nC(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i,borderProps:a}=e;const{isInProgress:s,editedUrl:c,position:d,zoom:m,aspect:g,setPosition:f,setCrop:v,setZoom:b,rotation:k}=RE();let _=o||r*l/i;return k%180==90&&(_=r*i/l),(0,u.createElement)("div",{className:p()("wp-block-image__crop-area",null==a?void 0:a.className,{"is-applying":s}),style:{...null==a?void 0:a.style,width:n||r,height:_}},(0,u.createElement)(eC,{image:c||t,disabled:s,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:g,onCropChange:e=>{f(e)},onCropComplete:e=>{v(e)},onZoomChange:e=>{b(100*e)}}),s&&(0,u.createElement)(h.Spinner,null))}var oC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));function rC(){const{isInProgress:e,zoom:t,setZoom:n}=RE();return(0,u.createElement)(h.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:tC,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,u.createElement)(h.ToolbarButton,{icon:oC,label:(0,_.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,u.createElement)(h.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var lC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function iC(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:l}=e;return(0,u.createElement)(h.MenuGroup,{label:o},t.map((e=>{let{title:t,aspect:o}=e;return(0,u.createElement)(h.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===l,icon:o===l?Af:void 0},t)})))}function aC(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=RE();return(0,u.createElement)(h.DropdownMenu,{icon:lC,label:(0,_.__)("Aspect Ratio"),popoverProps:tC,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(iC,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,_.__)("Original"),aspect:l},{title:(0,_.__)("Square"),aspect:1}]}),(0,u.createElement)(iC,{label:(0,_.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,_.__)("16:10"),aspect:1.6},{title:(0,_.__)("16:9"),aspect:16/9},{title:(0,_.__)("4:3"),aspect:4/3},{title:(0,_.__)("3:2"),aspect:1.5}]}),(0,u.createElement)(iC,{label:(0,_.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,_.__)("10:16"),aspect:.625},{title:(0,_.__)("9:16"),aspect:9/16},{title:(0,_.__)("3:4"),aspect:3/4},{title:(0,_.__)("2:3"),aspect:2/3}]}))}))}var sC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function cC(){const{isInProgress:e,rotateClockwise:t}=RE();return(0,u.createElement)(h.ToolbarButton,{icon:sC,label:(0,_.__)("Rotate"),onClick:t,disabled:e})}function uC(){const{isInProgress:e,apply:t,cancel:n}=RE();return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ToolbarButton,{onClick:t,disabled:e},(0,_.__)("Apply")),(0,u.createElement)(h.ToolbarButton,{onClick:n},(0,_.__)("Cancel")))}function dC(e){let{id:t,url:n,width:o,height:r,clientWidth:l,naturalHeight:i,naturalWidth:a,onSaveImage:s,onFinishEditing:c,borderProps:d}=e;return(0,u.createElement)(AE,{id:t,url:n,naturalWidth:a,naturalHeight:i,onSaveImage:s,onFinishEditing:c},(0,u.createElement)(nC,{borderProps:d,url:n,width:o,height:r,clientWidth:l,naturalHeight:i,naturalWidth:a}),(0,u.createElement)(Vo,null,(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(rC,null),(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(aC,{toggleProps:e}))),(0,u.createElement)(cC,null)),(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(uC,null))))}const pC=[25,50,75,100],mC=()=>{};function gC(e){let{imageSizeHelp:t,imageWidth:n,imageHeight:o,imageSizeOptions:r=[],isResizable:l=!0,slug:i,width:a,height:s,onChange:c,onChangeImage:d=mC}=e;const{currentHeight:p,currentWidth:m,updateDimension:g,updateDimensions:f}=function(e,t,n,o,r){var l,i;const[a,s]=(0,u.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[c,d]=(0,u.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,u.useEffect)((()=>{void 0===t&&void 0!==o&&s(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,u.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&s(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(c)&&d(e)}),[t,e]),{currentHeight:c,currentWidth:a,updateDimension:(e,t)=>{"width"===e?s(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),s(null!=t?t:o),r({height:e,width:t})}}}(s,a,o,n,c);return(0,u.createElement)(u.Fragment,null,r&&r.length>0&&(0,u.createElement)(h.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Image size"),value:i,options:r,onChange:d,help:t}),l&&(0,u.createElement)("div",{className:"block-editor-image-size-control"},(0,u.createElement)("p",{className:"block-editor-image-size-control__row"},(0,_.__)("Image dimensions")),(0,u.createElement)("div",{className:"block-editor-image-size-control__row"},(0,u.createElement)(h.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,_.__)("Width"),value:m,min:1,onChange:e=>g("width",e)}),(0,u.createElement)(h.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,_.__)("Height"),value:p,min:1,onChange:e=>g("height",e)})),(0,u.createElement)("div",{className:"block-editor-image-size-control__row"},(0,u.createElement)(h.ButtonGroup,{"aria-label":(0,_.__)("Image size presets")},pC.map((e=>{const t=Math.round(n*(e/100)),r=Math.round(o*(e/100)),l=m===t&&p===r;return(0,u.createElement)(h.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>f(r,t)},e,"%")}))),(0,u.createElement)(h.Button,{isSmall:!0,onClick:()=>f()},(0,_.__)("Reset")))))}var fC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,u.createElement)(G.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"}));const hC=()=>{};var vC=e=>{let{value:t,onChange:n=hC,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,u.createElement)(h.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,u.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,u.createElement)(h.VisuallyHidden,{as:"legend"},(0,_.__)("Currently selected link settings")),l)},bC=n(5425),kC=n.n(bC);function _C(e){return"function"==typeof e}class yC extends u.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,u.createRef)(),this.inputRef=(0,u.createRef)(),this.updateSuggestions=(0,m.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,isUpdatingSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,kC()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||this.state.isUpdatingSuggestions||(null!=o&&o.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!(null!==(e=t)&&void 0!==e&&e.length);var l,i;if(t=t.trim(),!r&&(t.length<2||!o&&(0,rg.isURL)(t)))return null===(l=this.suggestionsRequest)||void 0===l||null===(i=l.cancel)||void 0===i||i.call(l),this.suggestionsRequest=null,void this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:t,selectedSuggestion:null,loading:!1});this.setState({isUpdatingSuggestions:!0,selectedSuggestion:null,loading:!0});const a=n(t,{isInitialSuggestions:r});a.then((e=>{this.suggestionsRequest===a&&(this.setState({suggestions:e,isUpdatingSuggestions:!1,suggestionsValue:t,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,_.sprintf)((0,_._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak((0,_.__)("No results."),"assertive"))})).catch((()=>{this.suggestionsRequest===a&&this.setState({isUpdatingSuggestions:!1,loading:!1})})),this.suggestionsRequest=a}onChange(e){this.props.onChange(e.target.value)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.state.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case Qu.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case Qu.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case Qu.ENTER:e.preventDefault(),this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Qu.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case Qu.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case Qu.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,_.__)("Link selected.")));break;case Qu.ENTER:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(l),this.props.onSubmit&&this.props.onSubmit(l,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps(e,t){let{value:n,instanceId:o,disableSuggestions:r,__experimentalShowInitialSuggestions:l=!1}=e,{showSuggestions:i}=t,a=i;const s=n&&n.length;return l||s||(a=!1),!0===r&&(a=!1),{showSuggestions:a,suggestionsListboxId:`block-editor-url-input-suggestions-${o}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${o}`}}render(){return(0,u.createElement)(u.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{__nextHasNoMarginBottom:e=!1,label:t=null,className:n,isFullWidth:o,instanceId:r,placeholder:l=(0,_.__)("Paste URL or type to search"),__experimentalRenderControl:i,value:a=""}=this.props,{loading:s,showSuggestions:d,selectedSuggestion:m,suggestionsListboxId:g,suggestionOptionIdPrefix:f}=this.state,v=`url-input-control-${r}`,b={id:v,label:t,className:p()("block-editor-url-input",n,{"is-full-width":o})},k={id:v,value:a,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:l,onKeyDown:this.onKeyDown,role:"combobox","aria-label":t?void 0:(0,_.__)("URL"),"aria-expanded":d,"aria-autocomplete":"list","aria-controls":g,"aria-activedescendant":null!==m?`${f}-${m}`:void 0,ref:this.inputRef};return i?i(b,k,s):(e||W()("Bottom margin styles for wp.blockEditor.URLInput",{since:"6.2",version:"6.5",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,u.createElement)(h.BaseControl,c({__nextHasNoMarginBottom:e},b),(0,u.createElement)("input",k),s&&(0,u.createElement)(h.Spinner,null)))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:o,suggestionsValue:r,selectedSuggestion:l,suggestionsListboxId:i,suggestionOptionIdPrefix:a,loading:s}=this.state;if(!n||0===o.length)return null;const d={id:i,ref:this.autocompleteRef,role:"listbox"},m=(e,t)=>({role:"option",tabIndex:"-1",id:`${a}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===l});return _C(t)?t({suggestions:o,selectedSuggestion:l,suggestionsListProps:d,buildSuggestionItemProps:m,isLoading:s,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!(null!=r&&r.length),currentInputValue:r}):(0,u.createElement)(h.Popover,{placement:"bottom",focusOnMount:!1},(0,u.createElement)("div",c({},d,{className:p()("block-editor-url-input__suggestions",`${e}__suggestions`)}),o.map(((e,t)=>(0,u.createElement)(h.Button,c({},m(0,t),{key:e.id,className:p()("block-editor-url-input__suggestion",{"is-selected":t===l}),onClick:()=>this.handleOnClick(e)}),e.title)))))}}var EC=(0,m.compose)(m.withSafeTimeout,h.withSpokenMessages,m.withInstanceId,(0,g.withSelect)(((e,t)=>{if(_C(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(To);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(yC);var CC=e=>{let t,{searchTerm:n,onClick:o,itemProps:r,isSelected:l,buttonText:i}=e;return n?(t=i?"function"==typeof i?i(n):i:(0,u.createInterpolateElement)((0,_.sprintf)((0,_.__)("Create: %s"),n),{mark:(0,u.createElement)("mark",null)}),(0,u.createElement)(h.Button,c({},r,{className:p()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":l}),onClick:o}),(0,u.createElement)(Jl,{className:"block-editor-link-control__search-item-icon",icon:cd}),(0,u.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,u.createElement)("span",{className:"block-editor-link-control__search-item-title"},t)))):null};var SC=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z"}));var wC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"}));var BC=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"}));var IC=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5z"}));var xC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"}));const TC={post:SC,page:vy,post_tag:wC,category:BC,attachment:IC};function MC(e){let{isURL:t,suggestion:n}=e,o=null;return t?o=xC:n.type in TC&&(o=TC[n.type]),o?(0,u.createElement)(Jl,{className:"block-editor-link-control__search-item-icon",icon:o}):null}var NC=e=>{let{itemProps:t,suggestion:n,isSelected:o=!1,onClick:r,isURL:l=!1,searchTerm:i="",shouldShowType:a=!1}=e;return(0,u.createElement)(h.Button,c({},t,{onClick:r,className:p()("block-editor-link-control__search-item",{"is-selected":o,"is-url":l,"is-entity":!l})}),(0,u.createElement)(MC,{suggestion:n,isURL:l}),(0,u.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,u.createElement)("span",{className:"block-editor-link-control__search-item-title"},(0,u.createElement)(h.TextHighlight,{text:n.title,highlight:i})),(0,u.createElement)("span",{"aria-hidden":!l,className:"block-editor-link-control__search-item-info"},!l&&((0,rg.filterURLForDisplay)((0,rg.safeDecodeURI)(n.url))||""),l&&(0,_.__)("Press ENTER to add this link"))),a&&n.type&&(0,u.createElement)("span",{className:"block-editor-link-control__search-item-type"},function(e){if(e.isFrontPage)return"front page";return"post_tag"===e.type?"tag":e.type}(n)))};const PC="__CREATE__",LC="mailto",RC="internal",AC=["URL",LC,"tel",RC],OC=[{id:"opensInNewTab",title:(0,_.__)("Open in new tab")}];function DC(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:l,buildSuggestionItemProps:i,suggestions:a,selectedSuggestion:s,isLoading:d,isInitialSuggestions:m,createSuggestionButtonText:g,suggestionsQuery:f}=e;const v=p()("block-editor-link-control__search-results",{"is-loading":d}),b=1===a.length&&AC.includes(a[0].type),k=n&&!b&&!m,y=!(null!=f&&f.type),E=`block-editor-link-control-search-results-label-${t}`,C=m?(0,_.__)("Recently updated"):(0,_.sprintf)((0,_.__)('Search results for "%s"'),o),S=(0,u.createElement)(m?u.Fragment:h.VisuallyHidden,{},(0,u.createElement)("span",{className:"block-editor-link-control__search-results-label",id:E},C));return(0,u.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},S,(0,u.createElement)("div",c({},l,{className:v,"aria-labelledby":E}),a.map(((e,t)=>k&&PC===e.type?(0,u.createElement)(CC,{searchTerm:o,buttonText:g,onClick:()=>r(e),key:e.type,itemProps:i(e,t),isSelected:t===s}):PC===e.type?null:(0,u.createElement)(NC,{key:`${e.id}-${e.type}`,itemProps:i(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===s,isURL:AC.includes(e.type),searchTerm:o,shouldShowType:y,isFrontPage:null==e?void 0:e.isFrontPage})))))}function zC(e){const t=null==e?void 0:e.startsWith("#");return(0,rg.isURL)(e)||e&&e.includes("www.")||t}const FC=()=>Promise.resolve([]),VC=e=>{let t="URL";const n=(0,rg.getProtocol)(e)||"";return n.includes("mailto")&&(t=LC),n.includes("tel")&&(t="tel"),null!=e&&e.startsWith("#")&&(t=RC),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,rg.prependHTTP)(e):e,type:t}])};function HC(e,t,n,o){const{fetchSearchSuggestions:r,pageOnFront:l}=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?VC:FC;return(0,u.useCallback)(((t,a)=>{let{isInitialSuggestions:s}=a;return zC(t)?i(t,{isInitialSuggestions:s}):(async(e,t,n,o,r,l,i)=>{const{isInitialSuggestions:a}=t;let s=!1,c=await Promise.all([n(e,t),o(e)]);c[0]=c[0].map((e=>Number(e.id)===i?(s=!0,e.isFrontPage=!0,e):e));const u=!e.includes(" ");return c=!s&&u&&l&&!a?c[0].concat(c[1]):c[0],a||zC(e)||!r?c:c.concat({title:e,url:e,type:PC})})(t,{...e,isInitialSuggestions:s},r,i,n,o,l)}),[i,r,n])}const GC=()=>Promise.resolve([]),UC=()=>{},$C=(0,u.forwardRef)(((e,t)=>{let{value:n,children:o,currentLink:r={},className:l=null,placeholder:i=null,withCreateSuggestion:a=!1,onCreateSuggestion:s=UC,onChange:c=UC,onSelect:d=UC,showSuggestions:g=!0,renderSuggestions:f=(e=>(0,u.createElement)(DC,e)),fetchSuggestions:h=null,allowDirectEntry:v=!0,showInitialSuggestions:b=!1,suggestionsQuery:k={},withURLSuggestion:y=!0,createSuggestionButtonText:E,useLabel:C=!1}=e;const S=HC(k,v,a,y),w=g?h||S:GC,B=(0,m.useInstanceId)($C),[I,x]=(0,u.useState)(),T=async e=>{let t=e;if(PC!==e.type){if(v||t&&Object.keys(t).length>=1){const{id:e,url:n,...o}=null!=r?r:{};d({...o,...t},t)}}else try{var n;t=await s(e.title),null!==(n=t)&&void 0!==n&&n.url&&d(t)}catch(e){}},M=p()(l,{"has-no-label":!C});return(0,u.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,u.createElement)(EC,{__nextHasNoMarginBottom:!0,label:C?"URL":void 0,className:M,value:n,onChange:(e,t)=>{c(e),x(t)},placeholder:null!=i?i:(0,_.__)("Search or type url"),__experimentalRenderSuggestions:g?e=>f({...e,instanceId:B,withCreateSuggestion:a,createSuggestionButtonText:E,suggestionsQuery:k,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),T(t)}}):null,__experimentalFetchLinkSuggestions:w,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:b,onSubmit:(e,t)=>{var o;const r=e||I;r||null!=n&&null!==(o=n.trim())&&void 0!==o&&o.length?T(r||{url:n}):t.preventDefault()},ref:t}),o)}));var jC=$C;var WC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));var KC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));const{Slot:qC,Fill:YC}=(0,h.createSlotFill)("BlockEditorLinkControlViewer");function ZC(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}var QC=function(e){const[t,n]=(0,u.useReducer)(ZC,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,u.useEffect)((()=>{if(null!=e&&e.length&&o&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,r=t.signal;return o(e,{signal:r}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{r.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t};function XC(e){var t;let{value:n,onEditClick:o,hasRichPreviews:r=!1,hasUnlinkControl:l=!1,onRemove:i}=e;const a=r?null==n?void 0:n.url:null,{richData:s,isFetching:c}=QC(a),d=s&&Object.keys(s).length,m=n&&(0,rg.filterURLForDisplay)((0,rg.safeDecodeURI)(n.url),16)||"",g=(null==s?void 0:s.title)||(null==n?void 0:n.title)||m,f=!(null!=n&&null!==(t=n.url)&&void 0!==t&&t.length);let v;return v=null!=s&&s.icon?(0,u.createElement)("img",{src:null==s?void 0:s.icon,alt:""}):f?(0,u.createElement)(Jl,{icon:WC,size:32}):(0,u.createElement)(Jl,{icon:xC}),(0,u.createElement)("div",{"aria-label":(0,_.__)("Currently selected"),className:p()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":d,"is-fetching":!!c,"is-preview":!0,"is-error":f})},(0,u.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,u.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,u.createElement)("span",{className:p()("block-editor-link-control__search-item-icon",{"is-image":null==s?void 0:s.icon})},v),(0,u.createElement)("span",{className:"block-editor-link-control__search-item-details"},f?(0,u.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,_.__)("Link is empty")):(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ExternalLink,{className:"block-editor-link-control__search-item-title",href:n.url},(0,Ri.__unstableStripHTML)(g)),(null==n?void 0:n.url)&&(0,u.createElement)("span",{className:"block-editor-link-control__search-item-info"},m)))),(0,u.createElement)(h.Button,{icon:KC,label:(0,_.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:o,iconSize:24}),l&&(0,u.createElement)(h.Button,{icon:Cr,label:(0,_.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:i,iconSize:24}),(0,u.createElement)(qC,{fillProps:n})),!!(d&&(null!=s&&s.image||null!=s&&s.description)||c)&&(0,u.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==s?void 0:s.image)||c)&&(0,u.createElement)("div",{"aria-hidden":!(null!=s&&s.image),className:p()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=s&&s.image)})},(null==s?void 0:s.image)&&(0,u.createElement)("img",{src:null==s?void 0:s.image,alt:""})),((null==s?void 0:s.description)||c)&&(0,u.createElement)("div",{"aria-hidden":!(null!=s&&s.description),className:p()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=s&&s.description)})},(null==s?void 0:s.description)&&(0,u.createElement)(h.__experimentalText,{truncate:!0,numberOfLines:"2"},s.description))))}const JC=e=>{let t=!1;return{promise:new Promise(((n,o)=>{e.then((e=>t?o({isCanceled:!0}):n(e)),(e=>o(t?{isCanceled:!0}:e)))})),cancel(){t=!0}}};function eS(e){const[t,n]=(0,u.useState)(e||"");return(0,u.useEffect)((()=>{e&&e!==t&&n(e)}),[e]),[t,n]}const tS=()=>{};function nS(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=OC,onChange:a=tS,onRemove:s,noDirectEntry:c=!1,showSuggestions:d=!0,showInitialSuggestions:m,forceIsEditingLink:g,createSuggestion:f,withCreateSuggestion:v,inputValue:b="",suggestionsQuery:k={},noURLSuggestion:y=!1,createSuggestionButtonText:E,hasRichPreviews:C=!1,hasTextControl:S=!1,renderControlBottom:w=null}=e;void 0===v&&f&&(v=!0);const B=(0,u.useRef)(!0),I=(0,u.useRef)(),x=(0,u.useRef)(),T=(0,u.useRef)(!1),[M,N]=eS((null==l?void 0:l.url)||""),[P,L]=eS((null==l?void 0:l.title)||""),[R,A]=(0,u.useState)(void 0!==g?g:!l||!l.url),{createPage:O,isCreatingPage:D,errorMessage:z}=function(e){const t=(0,u.useRef)(),[n,o]=(0,u.useState)(!1),[r,l]=(0,u.useState)(null);return(0,u.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),l(null);try{return t.current=JC(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,_.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(f);(0,u.useEffect)((()=>{void 0!==g&&g!==R&&A(g)}),[g]),(0,u.useEffect)((()=>{if(B.current)return void(B.current=!1);const e=null!=x&&x.current?1:0;(Ri.focus.focusable.find(I.current)[e]||I.current).focus(),T.current=!1}),[R,D]);const F=()=>{var e;T.current=!(null===(e=I.current)||void 0===e||!e.contains(I.current.ownerDocument.activeElement)),A(!1)},V=()=>{H===(null==l?void 0:l.url)&&P===(null==l?void 0:l.title)||a({...l,url:H,title:P}),F()},H=b||M,G=!(null!=H&&null!==(t=H.trim())&&void 0!==t&&t.length),U=s&&l&&!R&&!D,$=!(null==i||!i.length),j=(null==l||null===(n=l.url)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.length)>0&&S;return(0,u.createElement)("div",{tabIndex:-1,ref:I,className:"block-editor-link-control"},D&&(0,u.createElement)("div",{className:"block-editor-link-control__loading"},(0,u.createElement)(h.Spinner,null)," ",(0,_.__)("Creating"),"…"),(R||!l)&&!D&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:p()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":j})},j&&(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,ref:x,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:P,onChange:L,onKeyDown:e=>{const{keyCode:t}=e;t!==Qu.ENTER||G||(e.preventDefault(),V())}}),(0,u.createElement)(jC,{currentLink:l,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:H,withCreateSuggestion:v,onCreateSuggestion:O,onChange:N,onSelect:e=>{a({...e,title:P||(null==e?void 0:e.title)}),F()},showInitialSuggestions:m,allowDirectEntry:!c,showSuggestions:d,suggestionsQuery:k,withURLSuggestion:!y,createSuggestionButtonText:E,useLabel:j},(0,u.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,u.createElement)(h.Button,{onClick:V,label:(0,_.__)("Submit"),icon:fC,className:"block-editor-link-control__search-submit",disabled:G})))),z&&(0,u.createElement)(h.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},z)),l&&!R&&!D&&(0,u.createElement)(XC,{key:null==l?void 0:l.url,value:l,onEditClick:()=>A(!0),hasRichPreviews:C,hasUnlinkControl:U,onRemove:s}),$&&(0,u.createElement)("div",{className:"block-editor-link-control__tools"},(0,u.createElement)(vC,{value:l,settings:i,onChange:a})),w&&w())}nS.ViewerFill=YC;var oS=nS;var rS=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"}));var lS=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"}));var iS=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"}));const aS=()=>{};let sS=0;var cS=(0,m.compose)([(0,g.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(hm.store);return{createNotice:t,removeNotice:n}})),(0,h.withFilters)("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,mediaIds:o,allowedTypes:r,accept:l,onError:i,onSelect:a,onSelectURL:s,onToggleFeaturedImage:c,useFeaturedImage:d,onFilesUpload:p=aS,name:m=(0,_.__)("Replace"),createNotice:f,removeNotice:v,children:b,multiple:k=!1,addToGallery:y,handleUpload:E=!0}=e;const C=(0,g.useSelect)((e=>e(To).getSettings().mediaUpload),[]),S=(0,u.useRef)(),w="block-editor/media-replace-flow/error-notice/"+ ++sS,B=e=>{const t=(0,Ri.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{f("error",t,{speak:!0,id:w,isDismissible:!0})}),1e3)},I=(e,t)=>{d&&c&&c(),t(),a(e),(0,pn.speak)((0,_.__)("The media file has been replaced")),v(w)},x=e=>{e.keyCode===Qu.DOWN&&(e.preventDefault(),e.target.click())},T=k&&!(!r||0===r.length)&&r.every((e=>"image"===e||e.startsWith("image/")));return(0,u.createElement)(h.Dropdown,{popoverProps:{variant:"toolbar"},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,u.createElement)(h.ToolbarButton,{ref:S,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:x},m)},renderContent:e=>{let{onClose:i}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Cg,{gallery:T,addToGallery:y,multiple:k,value:k?o:n,onSelect:e=>I(e,i),allowedTypes:r,render:e=>{let{open:t}=e;return(0,u.createElement)(h.MenuItem,{icon:rS,onClick:t},(0,_.__)("Open Media Library"))}}),(0,u.createElement)(Eg,null,(0,u.createElement)(h.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!E)return t(),a(n);p(n),C({allowedTypes:r,filesList:n,onFileChange:e=>{let[n]=e;I(n,t)},onError:B})})(e,i)},accept:l,multiple:k,render:e=>{let{openFileDialog:t}=e;return(0,u.createElement)(h.MenuItem,{icon:lS,onClick:()=>{t()}},(0,_.__)("Upload"))}}))),c&&(0,u.createElement)(h.MenuItem,{icon:iS,onClick:c,isPressed:d},(0,_.__)("Use featured image")),b),s&&(0,u.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,u.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,_.__)("Current media URL:")),(0,u.createElement)(h.Tooltip,{text:t,position:"bottom"},(0,u.createElement)("div",null,(0,u.createElement)(oS,{value:{url:t},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;s(t),S.current.focus()}})))))}})}));function uS(e){let{url:t,urlLabel:n,className:o}=e;const r=p()(o,"block-editor-url-popover__link-viewer-url");return t?(0,u.createElement)(h.ExternalLink,{className:r,href:t},n||(0,rg.filterURLForDisplay)((0,rg.safeDecodeURI)(t))):(0,u.createElement)("span",{className:r})}const{__experimentalPopoverLegacyPositionToPlacement:dS}=Io(h.privateApis);function pS(e){let t,{additionalControls:n,children:o,renderSettings:r,placement:l,focusOnMount:i="firstElement",position:a,...s}=e;void 0!==a&&W()("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"}),void 0!==l?t=l:void 0!==a&&(t=dS(a)),t=t||"bottom";const[d,p]=(0,u.useState)(!1),m=!!r&&d;return(0,u.createElement)(h.Popover,c({className:"block-editor-url-popover",focusOnMount:i,placement:t,shift:!0},s),(0,u.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,u.createElement)("div",{className:"block-editor-url-popover__row"},o,!!r&&(0,u.createElement)(h.Button,{className:"block-editor-url-popover__settings-toggle",icon:uf,label:(0,_.__)("Link settings"),onClick:()=>{p(!d)},"aria-expanded":d})),m&&(0,u.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},r())),n&&!m&&(0,u.createElement)("div",{className:"block-editor-url-popover__additional-controls"},n))}pS.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:o,value:r,...l}=e;return(0,u.createElement)("form",c({className:p()("block-editor-url-popover__link-editor",n)},l),(0,u.createElement)(EC,{__nextHasNoMarginBottom:!0,value:r,onChange:o,autocompleteRef:t}),(0,u.createElement)(h.Button,{icon:fC,label:(0,_.__)("Apply"),type:"submit"}))},pS.LinkViewer=function(e){let{className:t,linkClassName:n,onEditLinkClick:o,url:r,urlLabel:l,...i}=e;return(0,u.createElement)("div",c({className:p()("block-editor-url-popover__link-viewer",t)},i),(0,u.createElement)(uS,{url:r,urlLabel:l,className:n}),o&&(0,u.createElement)(h.Button,{icon:KC,label:(0,_.__)("Edit"),onClick:o}))};var mS=pS;const gS=()=>{},fS=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,u.createElement)(mS,{onClose:r},(0,u.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o},(0,u.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,_.__)("URL"),placeholder:(0,_.__)("Paste or type URL"),onChange:n,value:t}),(0,u.createElement)(h.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:fC,label:(0,_.__)("Apply"),type:"submit"})))};var hS=(0,h.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:l={},mediaPreview:i,notices:a,isAppender:s,accept:c,addToGallery:d,multiple:m=!1,handleUpload:f=!0,disableDropZone:v,disableMediaButtons:b,onError:k,onSelect:y,onCancel:E,onSelectURL:C,onToggleFeaturedImage:S,onDoubleClick:w,onFilesPreUpload:B=gS,onHTMLDrop:I=gS,children:x,mediaLibraryButton:T,placeholder:M,style:N}=e;const P=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return t().mediaUpload}),[]),[L,R]=(0,u.useState)(""),[A,O]=(0,u.useState)(!1);(0,u.useEffect)((()=>{var e;R(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const D=e=>{R(e.target.value)},z=()=>{O(!0)},F=()=>{O(!1)},V=e=>{e.preventDefault(),L&&C&&(C(L),F())},H=e=>{if(!f)return y(e);let o;if(B(e),m)if(d){let e=[];o=n=>{const o=(null!=t?t:[]).filter((t=>t.id?!e.some((e=>{let{id:n}=e;return Number(n)===Number(t.id)})):!e.some((e=>{let{urlSlug:n}=e;return t.url.includes(n)}))));y(o.concat(n)),e=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else o=y;else o=e=>{let[t]=e;return y(t)};P({allowedTypes:n,filesList:e,onFileChange:o,onError:k})},G=e=>{H(e.target.files)},U=null!=M?M:e=>{let{instructions:t,title:c}=l;if(P||C||(t=(0,_.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===c){const e=null!=n?n:[],[o]=e,r=1===e.length,l=r&&"audio"===o,i=r&&"image"===o,a=r&&"video"===o;void 0===t&&P&&(t=(0,_.__)("Upload a media file or pick one from your media library."),l?t=(0,_.__)("Upload an audio file, pick one from your media library, or add one with a URL."):i?t=(0,_.__)("Upload an image file, pick one from your media library, or add one with a URL."):a&&(t=(0,_.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===c&&(c=(0,_.__)("Media"),l?c=(0,_.__)("Audio"):i?c=(0,_.__)("Image"):a&&(c=(0,_.__)("Video")))}const d=p()("block-editor-media-placeholder",o,{"is-appender":s});return(0,u.createElement)(h.Placeholder,{icon:r,label:c,instructions:t,className:d,notices:a,onDoubleClick:w,preview:i,style:N},e,x)},$=()=>v?null:(0,u.createElement)(h.DropZone,{onFilesDrop:H,onHTMLDrop:I}),j=()=>E&&(0,u.createElement)(h.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,_.__)("Cancel"),variant:"link",onClick:E},(0,_.__)("Cancel")),W=()=>C&&(0,u.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,u.createElement)(h.Button,{className:"block-editor-media-placeholder__button",onClick:z,isPressed:A,variant:"tertiary"},(0,_.__)("Insert from URL")),A&&(0,u.createElement)(fS,{src:L,onChange:D,onSubmit:V,onClose:F})),K=()=>S&&(0,u.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,u.createElement)(h.Button,{className:"block-editor-media-placeholder__button",onClick:S,variant:"tertiary"},(0,_.__)("Use featured image")));return b?(0,u.createElement)(Eg,null,$()):(0,u.createElement)(Eg,{fallback:U(W())},(()=>{const e=null!=T?T:e=>{let{open:t}=e;return(0,u.createElement)(h.Button,{variant:"tertiary",onClick:()=>{t()}},(0,_.__)("Media Library"))},o=(0,u.createElement)(Cg,{addToGallery:d,gallery:m&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:m,onSelect:y,allowedTypes:n,mode:"browse",value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(P&&s)return(0,u.createElement)(u.Fragment,null,$(),(0,u.createElement)(h.FormFileUpload,{onChange:G,accept:c,multiple:m,render:e=>{let{openFileDialog:t}=e;const n=(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Button,{variant:"primary",className:p()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,_.__)("Upload")),o,W(),K(),j());return U(n)}}));if(P){const e=(0,u.createElement)(u.Fragment,null,$(),(0,u.createElement)(h.FormFileUpload,{variant:"primary",className:p()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:G,accept:c,multiple:m},(0,_.__)("Upload")),o,W(),K(),j());return U(e)}return U(o)})())}));var vS=e=>{let{colorSettings:t,...n}=e;const o=t.map((e=>{if(!e)return e;const{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}}));return(0,u.createElement)(PE,c({settings:o,gradients:[],disableCustomGradients:!0},n))};const bS={position:"bottom right",variant:"toolbar"};var kS=()=>(0,u.createElement)(u.Fragment,null,["bold","italic","link","unknown"].map((e=>(0,u.createElement)(h.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,u.createElement)(h.Slot,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((e=>{let[{props:t}]=e;return t})).some((e=>{let{isActive:t}=e;return t}));return(0,u.createElement)(h.ToolbarItem,null,(n=>(0,u.createElement)(h.DropdownMenu,{icon:uf,label:(0,_.__)("More"),toggleProps:{...n,className:p()(n.className,{"is-pressed":t}),describedBy:(0,_.__)("Displays more block tools")},controls:Y(e.map((e=>{let[{props:t}]=e;return t})),"title"),popoverProps:bS})))})));function _S(e){let{value:t,editableContentElement:n,activeFormats:o}=e;const r=o[o.length-1],l=null==r?void 0:r.type,i=(0,g.useSelect)((e=>e($.store).getFormatType(l)),[l]),a=(0,$.useAnchor)({editableContentElement:n,value:t,settings:i});return(0,u.createElement)(yS,{popoverAnchor:a})}function yS(e){let{popoverAnchor:t}=e;return(0,u.createElement)(h.Popover,{placement:"top",focusOnMount:!1,anchor:t,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,u.createElement)(Ef,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,_.__)("Format tools")},(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(kS,null))))}var ES=e=>{let{inline:t,editableContentElement:n,value:o}=e;const r=(0,g.useSelect)((e=>e(To).getSettings().hasInlineToolbar),[]);if(t)return(0,u.createElement)(yS,{popoverAnchor:n});if(r){const e=(0,$.getActiveFormats)(o);return(0,$.isCollapsed)(o)&&!e.length?null:(0,u.createElement)(_S,{editableContentElement:n,value:o,activeFormats:e})}return(0,u.createElement)(Vo,{group:"inline"},(0,u.createElement)(kS,null))};function CS(){const{didAutomaticChange:e,getSettings:t}=(0,g.useSelect)(To);return(0,m.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;if(n.defaultPrevented)return;if(o!==Qu.DELETE&&o!==Qu.BACKSPACE&&o!==Qu.ESCAPE)return;const{__experimentalUndo:r}=t();r&&e()&&(n.preventDefault(),r())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}var SS=window.wp.shortcode;function wS(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function BS(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function IS(e){let{allowedFormats:t,disableFormats:n}=e;return n?IS.EMPTY_ARRAY:t}IS.EMPTY_ARRAY=[];function xS(e){let{value:t,pastedBlocks:n=[],onReplace:o,onSplit:r,onSplitMiddle:l,multilineTag:i}=e;if(!o||!r)return;const{start:a=0,end:s=0}=t,c={...t,start:a,end:s},u=[],[d,p]=(0,$.split)(c),m=n.length>0;let g=-1;const f=(0,$.isEmpty)(d)&&!(0,$.isEmpty)(p);m&&(0,$.isEmpty)(d)||(u.push(r((0,$.toHTMLString)({value:d,multilineTag:i}),!f)),g+=1),m?(u.push(...n),g+=n.length):l&&u.push(l()),(m||l)&&(0,$.isEmpty)(p)||u.push(r((0,$.toHTMLString)({value:p,multilineTag:i}),f));o(u,m?g:1,m?-1:0)}function TS(e,t){return t?(0,$.replace)(e,/\n+/g,$.__UNSTABLE_LINE_SEPARATOR):(0,$.replace)(e,new RegExp($.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function MS(e){const t=(0,u.useRef)(e);return t.current=e,(0,m.useRefEffect)((e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:r,value:l,formatTypes:i,tagName:s,onReplace:c,onSplit:u,onSplitMiddle:d,__unstableEmbedURLOnPaste:p,multilineTag:m,preserveWhiteSpace:g,pastePlainText:f}=t.current;if(!n)return;const{clipboardData:h}=e;let v="",b="";try{v=h.getData("text/plain"),b=h.getData("text/html")}catch(e){try{b=h.getData("Text")}catch(e){return}}if(b=function(e){const t="\x3c!--StartFragment--\x3e",n=e.indexOf(t);if(!(n>-1))return e;e=e.substring(n+t.length);const o="\x3c!--EndFragment--\x3e",r=e.indexOf(o);r>-1&&(e=e.substring(0,r));return e}(b),b=function(e){const t="";if(e.startsWith(t))return e.slice(t.length);return e}(b),e.preventDefault(),window.console.log("Received HTML:\n\n",b),window.console.log("Received plain text:\n\n",v),o)return void r((0,$.insert)(l,v));const k=i.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===l&&(e=n(l,{html:b,plainText:v})),e}),l);if(k!==l)return void r(k);const _=[...(0,Ri.getFilesFromDataTransfer)(h)];if("true"===h.getData("rich-text")){const e=h.getData("rich-text-multi-line-tag")||void 0;let t=(0,$.create)({html:b,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:g});return t=TS(t,!!m),wS(t,l.activeFormats),void r((0,$.insert)(l,t))}if(f)return void r((0,$.insert)(l,(0,$.create)({text:v})));if(null!=_&&_.length&&window.console.log("Received items:\n\n",_),null!=_&&_.length&&!nh(_,b)){const e=(0,a.getBlockTransforms)("from"),t=_.reduce(((t,n)=>{const o=(0,a.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat();if(!t.length)return;return void(c&&(0,$.isEmpty)(l)?c(t):xS({value:l,pastedBlocks:t,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}let y=c&&u?"AUTO":"INLINE";var E;"AUTO"===y&&(0,$.isEmpty)(l)&&(E=v,(0,SS.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,$.isEmpty)(l)&&(0,rg.isURL)(v.trim())&&(y="BLOCKS");const C=(0,a.pasteHandler)({HTML:b,plainText:v,mode:y,tagName:s,preserveWhiteSpace:g});if("string"==typeof C){let e=(0,$.create)({html:C});e=TS(e,!!m),wS(e,l.activeFormats),r((0,$.insert)(l,e))}else C.length>0&&(c&&(0,$.isEmpty)(l)?c(C,C.length-1,-1):xS({value:l,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}const NS=["`",'"',"'","“”","‘’"];function PS(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,g.useDispatch)(To),o=(0,u.useRef)(e);return o.current=e,(0,m.useRefEffect)((e=>{function r(r){const{inputType:l,data:i}=r,{value:a,onChange:c}=o.current;if("insertText"!==l)return;if((0,$.isCollapsed)(a))return;const u=(0,s.applyFilters)("blockEditor.wrapSelectionSettings",NS).find((e=>{let[t,n]=e;return t===i||n===i}));if(!u)return;const[d,p=d]=u,m=a.start,g=a.end+d.length;let f=(0,$.insert)(a,d,m,m);f=(0,$.insert)(f,p,g,g),t(),c(f),n();const h={};for(const e in r)h[e]=r[e];h.data=p;const{ownerDocument:v}=e,{defaultView:b}=v,k=new b.InputEvent("input",h);window.queueMicrotask((()=>{r.target.dispatchEvent(k)})),r.preventDefault()}return e.addEventListener("beforeinput",r),()=>{e.removeEventListener("beforeinput",r)}}),[])}function LS(e){let t=e.length;for(;t--;){const n=gn(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].replace(mn,""),e[t].clientId;const o=LS(e[t].innerBlocks);if(o)return o}}function RS(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,g.useDispatch)(To),o=(0,u.useRef)(e);return o.current=e,(0,m.useRefEffect)((e=>{function r(){const{value:e,onReplace:t,selectionChange:r}=o.current;if(!t)return;const{start:l,text:i}=e;if(" "!==i.slice(l-1,l))return;const s=i.slice(0,l).trim(),c=(0,a.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"prefix"===t})),u=(0,a.findTransform)(c,(e=>{let{prefix:t}=e;return s===t}));if(!u)return;const d=(0,$.toHTMLString)({value:(0,$.insert)(e,mn,0,l)}),p=u.transform(d);r(LS([p])),t([p]),n()}function l(e){const{inputType:l,type:i}=e,{value:a,onChange:s,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==l&&"compositionend"!==i)return;c&&r&&r();const d=u.reduce(((e,t)=>{let{__unstableInputRule:n}=t;return n&&(e=n(e)),e}),function(e){const t="tales of gutenberg",{start:n,text:o}=e;return n{e.removeEventListener("input",l),e.removeEventListener("compositionend",l)}}),[])}function AS(e){const{__unstableMarkAutomaticChange:t}=(0,g.useDispatch)(To),n=(0,u.useRef)(e);return n.current=e,(0,m.useRefEffect)((e=>{function o(e){if(e.defaultPrevented)return;if(e.keyCode!==Qu.ENTER)return;const{removeEditorOnlyFormats:o,value:r,onReplace:l,onSplit:i,onSplitMiddle:s,multilineTag:c,onChange:u,disableLineBreaks:d,onSplitAtEnd:p}=n.current;e.preventDefault();const m={...r};m.formats=o(r);const g=l&&i;if(l){const e=(0,a.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"enter"===t})),n=(0,a.findTransform)(e,(e=>e.regExp.test(m.text)));n&&(l([n.transform({content:m.text})]),t())}if(c)e.shiftKey?d||u((0,$.insert)(m,"\n")):g&&(0,$.__unstableIsEmptyLine)(m)?xS({value:m,onReplace:l,onSplit:i,onSplitMiddle:s,multilineTag:c}):u((0,$.__unstableInsertLineSeparator)(m));else{const{text:t,start:n,end:o}=m,r=p&&n===o&&o===t.length;e.shiftKey||!g&&!r?d||u((0,$.insert)(m,"\n")):!g&&r?p():g&&xS({value:m,onReplace:l,onSplit:i,onSplitMiddle:s,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function OS(e){return e($.store).getFormatTypes()}const DS=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function zS(e,t){return e[t]?e[t]:Object.keys(e).filter((e=>e.startsWith(t+"."))).reduce(((n,o)=>(n[o.slice(t.length+1)]=e[o],n)),{})}function FS(e){return(0,m.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function VS(e){return(0,m.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function HS(){const{__unstableMarkLastChangeAsPersistent:e}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((t=>{function n(t){"insertReplacementText"===t.inputType&&e()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}}),[])}function GS(){const{isMultiSelecting:e}=(0,g.useSelect)(To);return(0,m.useRefEffect)((t=>{function n(){if(!e())return;const n=t.parentElement.closest('[contenteditable="true"]');n&&n.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}),[])}function US(e){let{formatTypes:t,onChange:n,onFocus:o,value:r,forwardedRef:l}=e;return t.map((e=>{const{name:t,edit:i}=e;if(!i)return null;const a=(0,$.getActiveFormat)(r,t);let s=void 0!==a;const c=(0,$.getActiveObject)(r),d=void 0!==c&&c.type===t;if("core/link"===t&&!(0,$.isCollapsed)(r)){var p,m;const e=r.formats,t=null===(p=e[r.start])||void 0===p?void 0:p.find((e=>{let{type:t}=e;return"core/link"===t})),n=null===(m=e[r.end-1])||void 0===m?void 0:m.find((e=>{let{type:t}=e;return"core/link"===t}));t&&n&&t===n||(s=!1)}return(0,u.createElement)(i,{key:t,isActive:s,activeAttributes:s&&a.attributes||{},isObjectActive:d,activeObjectAttributes:d&&c.attributes||{},value:r,onChange:n,onFocus:o,contentRef:l})}))}const $S=(0,u.createContext)(),jS=(0,u.createContext)();const WS=(0,u.forwardRef)((function e(t,n){let{children:o,tagName:r="div",value:l="",onChange:i,isSelected:s,multiline:d,inlineToolbar:f,wrapperClassName:v,autocompleters:b,onReplace:k,placeholder:_,allowedFormats:y,withoutInteractiveFormatting:E,onRemove:C,onMerge:S,onSplit:w,__unstableOnSplitAtEnd:B,__unstableOnSplitMiddle:I,identifier:x,preserveWhiteSpace:T,__unstablePastePlainText:M,__unstableEmbedURLOnPaste:N,__unstableDisableFormats:P,disableLineBreaks:L,unstableOnFocus:R,__unstableAllowPrefixTransformations:A,...O}=t;d&&W()("wp.blockEditor.RichText multiline prop",{since:"6.1",version:"6.3",alternative:"nested blocks (InnerBlocks)",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"});const D=(0,m.useInstanceId)(e);x=x||D,O=function(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:o,textAlign:r,selectionColor:l,tagsToEliminate:i,rootTagsToEliminate:a,disableEditingMenu:s,fontSize:c,fontFamily:u,fontWeight:d,fontStyle:p,minWidth:m,maxWidth:g,setRef:f,disableSuggestions:h,disableAutocorrection:v,...b}=e;return b}(O);const z=(0,u.useRef)(),{clientId:F}=Ro(),{selectionStart:V,selectionEnd:H,isSelected:G}=(0,g.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n}=e(To),o=t(),r=n();let l;return void 0===s?l=o.clientId===F&&r.clientId===F&&o.attributeKey===x:s&&(l=o.clientId===F),{selectionStart:l?o.offset:void 0,selectionEnd:l?r.offset:void 0,isSelected:l}})),{getSelectionStart:U,getSelectionEnd:j,getBlockRootClientId:K}=(0,g.useSelect)(To),{selectionChange:q}=(0,g.useDispatch)(To),Y=BS(d),Z=IS({allowedFormats:y,disableFormats:P}),Q=!Z||Z.length>0;let X=l,J=i;Array.isArray(l)&&(W()("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),X=a.children.toHTML(l),J=e=>i(a.children.fromDOM((0,$.__unstableCreateElement)(document,e).childNodes)));const ee=(0,u.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t;if("number"==typeof e||o){if(void 0===t&&K(F)!==K(j().clientId))return;n.start={clientId:F,attributeKey:x,offset:e}}if("number"==typeof t||o){if(void 0===e&&K(F)!==K(U().clientId))return;n.end={clientId:F,attributeKey:x,offset:t}}q(n)}),[F,x]),{formatTypes:te,prepareHandlers:ne,valueHandlers:oe,changeHandlers:re,dependencies:le}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:o,allowedFormats:r}=e;const l=(0,g.useSelect)(OS,[]),i=(0,u.useMemo)((()=>l.filter((e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t)||o&&DS.has(n))}))),[l,r,DS]),a=(0,g.useSelect)((e=>i.reduce(((o,r)=>{return r.__experimentalGetPropsForEditableTreePreparation?{...o,...(l=r.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t}),i=r.name,"object"!=typeof l?{[i]:l}:Object.fromEntries(Object.entries(l).map((e=>{let[t,n]=e;return[`${i}.${t}`,n]}))))}:o;var l,i}),{})),[i,t,n]),s=(0,g.useDispatch)(),c=[],d=[],p=[],m=[];for(const e in a)m.push(a[e]);return i.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const o=e.__experimentalCreatePrepareEditableTree(zS(a,e.name),{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(o):c.push(o)}if(e.__experimentalCreateOnChangeEditableValue){let o={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(o=e.__experimentalGetPropsForEditableTreeChangeHandler(s,{richTextIdentifier:n,blockClientId:t}));const r=zS(a,e.name);p.push(e.__experimentalCreateOnChangeEditableValue({..."object"==typeof r?r:{},...o},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:i,prepareHandlers:c,valueHandlers:d,changeHandlers:p,dependencies:m}}({clientId:F,identifier:x,withoutInteractiveFormatting:E,allowedFormats:Z});function ie(e){return te.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,$.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:ae,onChange:se,ref:ce}=(0,$.__unstableUseRichText)({value:X,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;J(e),Object.values(re).forEach((e=>{e(n,o)}))},selectionStart:V,selectionEnd:H,onSelectionChange:ee,placeholder:_,__unstableIsSelected:G,__unstableMultilineTag:Y,__unstableDisableFormats:P,preserveWhiteSpace:T,__unstableDependencies:[...le,r],__unstableAfterParse:function(e){return oe.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:ie,__unstableAddInvisibleFormats:function(e){return ne.reduce(((t,n)=>n(t,e.text)),e.formats)}}),ue=function(e){return(0,h.__unstableUseAutocompleteProps)({...e,completers:yy(e)})}({onReplace:k,completers:b,record:ae,onChange:se});!function(e){let{html:t,value:n}=e;const o=(0,u.useRef)(),r=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:l}=(0,g.useDispatch)(To);(0,u.useLayoutEffect)((()=>{if(o.current){if(o.current!==n.text){const e=window.setTimeout((()=>{l()}),1e3);return o.current=n.text,()=>{window.clearTimeout(e)}}l()}else o.current=n.text}),[t,r])}({html:X,value:ae});const de=(0,u.useRef)(new Set),pe=(0,u.useRef)(new Set);function me(){var e;null===(e=z.current)||void 0===e||e.focus()}const ge=r;return(0,u.createElement)(u.Fragment,null,G&&(0,u.createElement)($S.Provider,{value:de},(0,u.createElement)(jS.Provider,{value:pe},(0,u.createElement)(h.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},o&&o({value:ae,onChange:se,onFocus:me}),(0,u.createElement)(US,{value:ae,onChange:se,onFocus:me,formatTypes:te,forwardedRef:z})))),G&&Q&&(0,u.createElement)(ES,{inline:f,editableContentElement:z.current,value:ae}),(0,u.createElement)(ge,c({role:"textbox","aria-multiline":!L,"aria-label":_},O,ue,{ref:(0,m.useMergeRefs)([n,ue.ref,O.ref,ce,PS({value:ae,onChange:se}),RS({value:ae,onChange:se,__unstableAllowPrefixTransformations:A,formatTypes:te,onReplace:k,selectionChange:q}),HS(),(0,m.useRefEffect)((e=>{function t(e){(Qu.isKeyboardEvent.primary(e,"z")||Qu.isKeyboardEvent.primary(e,"y")||Qu.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),FS(de),VS(pe),CS(),MS({isSelected:G,disableFormats:P,onChange:se,value:ae,formatTypes:te,tagName:r,onReplace:k,onSplit:w,onSplitMiddle:I,__unstableEmbedURLOnPaste:N,multilineTag:Y,preserveWhiteSpace:T,pastePlainText:M}),AS({removeEditorOnlyFormats:ie,value:ae,onReplace:k,onSplit:w,onSplitMiddle:I,multilineTag:Y,onChange:se,disableLineBreaks:L,onSplitAtEnd:B}),GS(),z]),contentEditable:!0,suppressContentEditableWarning:!0,className:p()("block-editor-rich-text__editable",O.className,"rich-text"),onFocus:R,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===Qu.DELETE||t===Qu.BACKSPACE)){const{start:n,end:o,text:r}=ae,l=t===Qu.BACKSPACE,i=ae.activeFormats&&!!ae.activeFormats.length;if(!(0,$.isCollapsed)(ae)||i||l&&0!==n||!l&&o!==r.length)return;S&&S(!l),C&&(0,$.isEmpty)(ae)&&l&&C(!l),e.preventDefault()}}})))}));WS.Content=e=>{let{value:t,tagName:n,multiline:o,...r}=e;Array.isArray(t)&&(W()("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),t=a.children.toHTML(t));const l=BS(o);!t&&l&&(t=`<${l}>`);const i=(0,u.createElement)(u.RawHTML,null,t);if(n){const{format:e,...t}=r;return(0,u.createElement)(n,t,i)}return i},WS.isEmpty=e=>!e||0===e.length;var KS=WS;const qS=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(KS,c({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));qS.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return(0,u.createElement)(n,o,t)};var YS=qS;var ZS=(0,u.forwardRef)(((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return(0,u.createElement)(YS,c({ref:t},o));const{className:r,onChange:l,...i}=o;return(0,u.createElement)(Xi.Z,c({ref:t,className:p()("block-editor-plain-text",r),onChange:e=>l(e.target.value)},i))}));function QS(e){let{property:t,viewport:n,desc:o}=e;const r=(0,m.useInstanceId)(QS),l=o||(0,_.sprintf)((0,_._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),t,n.label);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("span",{"aria-describedby":`rbc-desc-${r}`},n.label),(0,u.createElement)(h.VisuallyHidden,{as:"span",id:`rbc-desc-${r}`},l))}var XS=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:l,renderResponsiveControls:i,isResponsive:a=!1,defaultLabel:s={id:"all",label:(0,_.__)("All")},viewports:c=[{id:"small",label:(0,_.__)("Small screens")},{id:"medium",label:(0,_.__)("Medium screens")},{id:"large",label:(0,_.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const d=o||(0,_.sprintf)((0,_.__)("Use the same %s on all screensizes."),n),m=(0,_.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),g=l((0,u.createElement)(QS,{property:n,viewport:s}),s);return(0,u.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,u.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,u.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,u.createElement)(h.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:d,checked:!a,onChange:r,help:m}),(0,u.createElement)("div",{className:p()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&g,a&&(i?i(c):c.map((e=>(0,u.createElement)(u.Fragment,{key:e.id},l((0,u.createElement)(QS,{property:n,viewport:e}),e))))))))};function JS(e){let{character:t,type:n,onUse:o}=e;const r=(0,u.useContext)($S),l=(0,u.useRef)();return l.current=o,(0,u.useEffect)((()=>{function e(e){Qu.isKeyboardEvent[n](e,t)&&(l.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}}),[t,n]),null}function ew(e){let t,{name:n,shortcutType:o,shortcutCharacter:r,...l}=e,i="RichText.ToolbarControls";return n&&(i+=`.${n}`),o&&r&&(t=Qu.displayShortcut[o](r)),(0,u.createElement)(h.Fill,{name:i},(0,u.createElement)(h.ToolbarButton,c({},l,{shortcut:t})))}function tw(e){let{inputType:t,onInput:n}=e;const o=(0,u.useContext)(jS),r=(0,u.useRef)();return r.current=n,(0,u.useEffect)((()=>{function e(e){e.inputType===t&&(r.current(),e.preventDefault())}return o.current.add(e),()=>{o.current.delete(e)}}),[t]),null}const nw=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z"}));var ow=(0,u.forwardRef)((function(e,t){const n=(0,g.useSelect)((e=>e(To).__unstableGetEditorMode()),[]),{__unstableSetEditorMode:o}=(0,g.useDispatch)(To);return(0,u.createElement)(h.Dropdown,{renderToggle:o=>{let{isOpen:r,onToggle:l}=o;return(0,u.createElement)(h.Button,c({},e,{ref:t,icon:"navigation"===n?nw:KC,"aria-expanded":r,"aria-haspopup":"true",onClick:l,label:(0,_.__)("Tools")}))},popoverProps:{placement:"bottom-start"},renderContent:()=>(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.NavigableMenu,{role:"menu","aria-label":(0,_.__)("Tools")},(0,u.createElement)(h.MenuItemsChoice,{value:"navigation"===n?"navigation":"edit",onSelect:o,choices:[{value:"edit",label:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Jl,{icon:KC}),(0,_.__)("Edit"))},{value:"navigation",label:(0,u.createElement)(u.Fragment,null,nw,(0,_.__)("Select"))}]})),(0,u.createElement)("div",{className:"block-editor-tool-selector__help"},(0,_.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function rw(e){let{units:t,...n}=e;const o=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vw"],units:t});return(0,u.createElement)(h.__experimentalUnitControl,c({units:o},n))}var lw=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"}));class iw extends u.Component{constructor(){super(...arguments),this.toggle=this.toggle.bind(this),this.submitLink=this.submitLink.bind(this),this.state={expanded:!1}}toggle(){this.setState({expanded:!this.state.expanded})}submitLink(e){e.preventDefault(),this.toggle()}render(){const{url:e,onChange:t}=this.props,{expanded:n}=this.state,o=e?(0,_.__)("Edit link"):(0,_.__)("Insert link");return(0,u.createElement)("div",{className:"block-editor-url-input__button"},(0,u.createElement)(h.Button,{icon:Er,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,u.createElement)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink},(0,u.createElement)("div",{className:"block-editor-url-input__button-modal-line"},(0,u.createElement)(h.Button,{className:"block-editor-url-input__back",icon:lw,label:(0,_.__)("Close"),onClick:this.toggle}),(0,u.createElement)(EC,{__nextHasNoMarginBottom:!0,value:e||"",onChange:t}),(0,u.createElement)(h.Button,{icon:fC,label:(0,_.__)("Submit"),type:"submit"}))))}}var aw=iw;var sw=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));const cw="none",uw="custom",dw="media",pw="attachment",mw=["noreferrer","noopener"],gw=(0,u.createElement)(h.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(h.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,u.createElement)(h.Path,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,u.createElement)(h.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),fw=e=>{let{linkDestination:t,onChangeUrl:n,url:o,mediaType:r="image",mediaUrl:l,mediaLink:i,linkTarget:a,linkClass:s,rel:c}=e;const[d,p]=(0,u.useState)(!1),[m,g]=(0,u.useState)(null),f=(0,u.useCallback)((()=>{p(!0)})),[v,b]=(0,u.useState)(!1),[k,y]=(0,u.useState)(null),E=(0,u.useRef)(null),C=(0,u.useCallback)((()=>{t!==dw&&t!==pw||y(""),b(!0)})),S=(0,u.useCallback)((()=>{b(!1)})),w=(0,u.useCallback)((()=>{y(null),S(),p(!1)})),B=(0,u.useCallback)((()=>e=>{const t=E.current;t&&t.contains(e.target)||(p(!1),y(null),S())})),I=(0,u.useCallback)((()=>e=>{if(k){var t;const e=(null===(t=T().find((e=>e.url===k)))||void 0===t?void 0:t.linkDestination)||uw;n({href:k,linkDestination:e})}S(),y(null),e.preventDefault()})),x=(0,u.useCallback)((()=>{n({linkDestination:cw,href:""})})),T=()=>{const e=[{linkDestination:dw,title:(0,_.__)("Media File"),url:"image"===r?l:void 0,icon:gw}];return"image"===r&&i&&e.push({linkDestination:pw,title:(0,_.__)("Attachment Page"),url:"image"===r?i:void 0,icon:(0,u.createElement)(h.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(h.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,u.createElement)(h.Path,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))}),e},M=(0,u.createElement)(h.__experimentalVStack,{spacing:"3"},(0,u.createElement)(h.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Open in new tab"),onChange:e=>{const t=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=c?c:"").split(" ");mw.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=c?c:"").split(" ").filter((e=>!1===mw.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===a}),(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Link rel"),value:null!=c?c:"",onChange:e=>{n({rel:e})}}),(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Link CSS Class"),value:s||"",onChange:e=>{n({linkClass:e})}})),N=null!==k?k:o,P=(T().find((e=>e.linkDestination===t))||{}).title;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ToolbarButton,{icon:Er,className:"components-toolbar__control",label:o?(0,_.__)("Edit link"):(0,_.__)("Insert link"),"aria-expanded":d,onClick:f,ref:g}),d&&(0,u.createElement)(mS,{anchor:m,onFocusOutside:B(),onClose:w,renderSettings:()=>M,additionalControls:!N&&(0,u.createElement)(h.NavigableMenu,null,T().map((e=>(0,u.createElement)(h.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{y(null),(e=>{const t=T();let o;o=e?(t.find((t=>t.url===e))||{linkDestination:uw}).linkDestination:cw,n({linkDestination:o,href:e})})(e.url),S()}},e.title))))},(!o||v)&&(0,u.createElement)(mS.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:N,onChangeInputValue:y,onSubmit:I(),autocompleteRef:E}),o&&!v&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(mS.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:C,urlLabel:P}),(0,u.createElement)(h.Button,{icon:sw,label:(0,_.__)("Remove link"),onClick:x}))))};function hw(e){let{children:t,viewLabel:n,className:o,isEnabled:r=!0,deviceType:l,setDeviceType:i}=e;if((0,m.useViewportMatch)("small","<"))return null;const a={className:p()(o,"block-editor-post-preview__dropdown-content"),position:"bottom left"},s={variant:"tertiary",className:"block-editor-post-preview__button-toggle",disabled:!r,children:n},c={"aria-label":(0,_.__)("View options")};return(0,u.createElement)(h.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:a,toggleProps:s,menuProps:c,icon:null},(()=>(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(h.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>i("Desktop"),icon:"Desktop"===l&&Af},(0,_.__)("Desktop")),(0,u.createElement)(h.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>i("Tablet"),icon:"Tablet"===l&&Af},(0,_.__)("Tablet")),(0,u.createElement)(h.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>i("Mobile"),icon:"Mobile"===l&&Af},(0,_.__)("Mobile"))),t)))}function vw(e){const[t,n]=(0,u.useState)(window.innerWidth);(0,u.useEffect)((()=>{if("Desktop"===e)return;const t=()=>n(window.innerWidth);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[e]);const o=e=>{let n;switch(e){case"Tablet":n=780;break;case"Mobile":n=360;break;default:return null}return n{const t="Mobile"===e?"768px":"1024px";switch(e){case"Tablet":case"Mobile":return{width:o(e),margin:(window.innerHeight<800?36:72)+"px auto",height:t,borderRadius:"2px 2px 2px 2px",border:"1px solid #ddd",overflowY:"auto"};default:return null}})(e)}var bw=(0,g.withSelect)((e=>({selectedBlockClientId:e(To).getBlockSelectionStart()})))((e=>{let{selectedBlockClientId:t}=e;const n=er(t);return t?(0,u.createElement)(h.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},(0,_.__)("Skip to the selected block")):null})),kw=window.wp.wordcount;var _w=(0,g.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(To);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=(0,kw.count)((0,a.serialize)(t),"words");return(0,u.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,u.createElement)(fd,{icon:Mf,showColors:!0}),(0,u.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,u.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,_.sprintf)((0,_._n)("%d block","%d blocks",t.length),t.length)),(0,u.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,_.sprintf)((0,_._n)("%d word","%d words",n),n))))}));function yw(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:o,styles:r}=(0,g.useSelect)((e=>{var n,o;const r=e(To).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==r||null===(n=r.value)||void 0===n?void 0:n[t],onUpdatePreferredStyleVariations:null!==(o=null==r?void 0:r.onChange)&&void 0!==o?o:null,styles:e(a.store).getBlockStyles(t)}}),[t]),l=(0,u.useMemo)((()=>[{label:(0,_.__)("Not set"),value:""},...r.map((e=>{let{label:t,name:n}=e;return{label:t,value:n}}))]),[r]),i=(0,u.useMemo)((()=>{var e;return null===(e=Ff(r))||void 0===e?void 0:e.name}),[r]),s=(0,u.useCallback)((e=>{o(t,e)}),[t,o]);return n&&n!==i?o&&(0,u.createElement)("div",{className:"default-style-picker__default-switcher"},(0,u.createElement)(h.SelectControl,{__nextHasNoMarginBottom:!0,options:l,value:n||"",label:(0,_.__)("Default Style"),onChange:s})):null}var Ew=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"}));const Cw=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"}));const Sw={name:"settings",title:"Settings",value:"settings",icon:Ew,className:"block-editor-block-inspector__tab-item"},ww={name:"styles",title:"Styles",value:"styles",icon:Cw,className:"block-editor-block-inspector__tab-item"},Bw={name:"list",title:"List View",value:"list-view",icon:Ly,className:"block-editor-block-inspector__tab-item"};var Iw=()=>{const e=(0,h.__experimentalUseSlotFills)($r.slotName);return Boolean(e&&e.length)?(0,u.createElement)(h.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,_.__)("Advanced"),initialOpen:!1},(0,u.createElement)(jr.Slot,{group:"advanced"})):null};var xw=()=>{const e=(0,h.__experimentalUseSlotFills)(Lr.position.Slot.__unstableName);return Boolean(e&&e.length)?(0,u.createElement)(h.PanelBody,{className:"block-editor-block-inspector__position",title:(0,_.__)("Position"),initialOpen:!1},(0,u.createElement)(jr.Slot,{group:"position"})):null},Tw=window.wp.preferences;const Mw="isInspectorControlsTabsHintVisible";function Nw(){const e=(0,g.useSelect)((e=>{var t;return null===(t=e(Tw.store).get("core",Mw))||void 0===t||t}),[]),t=(0,u.useRef)(),{set:n}=(0,g.useDispatch)(Tw.store);return e?(0,u.createElement)("div",{ref:t,className:"block-editor-inspector-controls-tabs__hint"},(0,u.createElement)("div",{className:"block-editor-inspector-controls-tabs__hint-content"},(0,_.__)("Looking for other block settings? They've moved to the styles tab.")),(0,u.createElement)(h.Button,{className:"block-editor-inspector-controls-tabs__hint-dismiss",icon:sw,iconSize:"16",label:(0,_.__)("Dismiss hint"),onClick:()=>{const e=Ri.focus.tabbable.findPrevious(t.current);null==e||e.focus(),n("core",Mw,!1)},showTooltip:!1})):null}var Pw=e=>{let{showAdvancedControls:t=!1}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(jr.Slot,null),(0,u.createElement)(xw,null),t&&(0,u.createElement)("div",null,(0,u.createElement)(Iw,null)),(0,u.createElement)(Nw,null))};var Lw=e=>{let{blockName:t,clientId:n,hasBlockStyles:o}=e;return(0,u.createElement)(u.Fragment,null,o&&(0,u.createElement)("div",null,(0,u.createElement)(h.PanelBody,{title:(0,_.__)("Styles")},(0,u.createElement)(iE,{clientId:n}),(0,a.hasBlockSupport)(t,"defaultStylePicker",!0)&&(0,u.createElement)(yw,{blockName:t}))),(0,u.createElement)(jr.Slot,{group:"color",label:(0,_.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,u.createElement)(jr.Slot,{group:"typography",label:(0,_.__)("Typography")}),(0,u.createElement)(jr.Slot,{group:"dimensions",label:(0,_.__)("Dimensions")}),(0,u.createElement)(jr.Slot,{group:"border",label:(0,_.__)("Border")}),(0,u.createElement)(jr.Slot,{group:"styles"}))};const Rw=["core/navigation"];var Aw=e=>!Rw.includes(e);function Ow(e){let{blockName:t,clientId:n,hasBlockStyles:o,tabs:r}=e;const l=Aw(t)?void 0:Bw.name;return(0,u.createElement)(h.TabPanel,{className:"block-editor-block-inspector__tabs",tabs:r,initialTabName:l,key:n},(e=>e.name===Sw.name?(0,u.createElement)(Pw,{showAdvancedControls:!!t}):e.name===ww.name?(0,u.createElement)(Lw,{blockName:t,clientId:n,hasBlockStyles:o}):e.name===Bw.name?(0,u.createElement)(jr.Slot,{group:"list"}):void 0))}const Dw=[];function zw(e){const t=[],{border:n,color:o,default:r,dimensions:l,list:i,position:a,styles:s,typography:c}=Lr,u=Aw(e),d=(0,h.__experimentalUseSlotFills)(i.Slot.__unstableName),p=!u&&!!d&&d.length,m=[...(0,h.__experimentalUseSlotFills)(n.Slot.__unstableName)||[],...(0,h.__experimentalUseSlotFills)(o.Slot.__unstableName)||[],...(0,h.__experimentalUseSlotFills)(l.Slot.__unstableName)||[],...(0,h.__experimentalUseSlotFills)(s.Slot.__unstableName)||[],...(0,h.__experimentalUseSlotFills)(c.Slot.__unstableName)||[]].length,f=(0,h.__experimentalUseSlotFills)($r.slotName)||[],v=[...(0,h.__experimentalUseSlotFills)(r.Slot.__unstableName)||[],...(0,h.__experimentalUseSlotFills)(a.Slot.__unstableName)||[],...p&&m>1?f:[]];p&&t.push(Bw),v.length&&t.push(Sw),m&&t.push(ww);const b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return void 0!==t[e]?t[e]:void 0===t.default||t.default}(e,(0,g.useSelect)((e=>e(To).getSettings().blockInspectorTabs),[]));return b?t:Dw}function Fw(e,t){const n=(0,u.useMemo)((()=>e.reduce(((e,t)=>("core/list-item"!==t.name&&Object.entries(t.attributes).some((e=>{let[,{__experimentalRole:t}]=e;return"content"===t}))&&(e[t.name]=!0),e)),{})),[e]),o=(0,u.useCallback)((e=>!!n[e]),[n]);return(0,u.useMemo)((()=>Vw([t],o)),[t,o])}function Vw(e,t){const n=[];for(const o of e)t(o.name)&&n.push(o),n.push(...Vw(o.innerBlocks,t));return n}function Hw(e){let{blockTypes:t,block:n,selectedBlock:o}=e;const{selectBlock:r}=(0,g.useDispatch)(To),l=t.find((e=>{let{name:t}=e;return t===n.name})),i=o&&o.clientId===n.clientId;return(0,u.createElement)(h.Button,{isPressed:i,onClick:()=>r(n.clientId)},(0,u.createElement)(h.__experimentalHStack,{justify:"flex-start"},(0,u.createElement)(fd,{icon:l.icon}),(0,u.createElement)(h.FlexItem,null,l.title)))}function Gw(e){let{topLevelLockedBlock:t}=e;const{blockTypes:n,block:o,selectedBlock:r}=(0,g.useSelect)((e=>({blockTypes:e(a.store).getBlockTypes(),block:e(To).getBlock(t),selectedBlock:e(To).getSelectedBlock()})),[t]),l=rf(t),i=Fw(n,o);return(0,u.createElement)("div",{className:"block-editor-block-inspector"},(0,u.createElement)(hd,c({},l,{className:l.isSynced&&"is-synced"})),(0,u.createElement)(yE,{blockClientId:t}),(0,u.createElement)(h.__experimentalVStack,{spacing:1,padding:4,className:"block-editor-block-inspector__block-buttons-container"},(0,u.createElement)("h2",{className:"block-editor-block-card__title"},(0,_.__)("Content")),i.map((e=>(0,u.createElement)(Hw,{selectedBlock:r,key:e.clientId,block:e,blockTypes:n})))))}const Uw=e=>{let{animate:t,wrapper:n,children:o}=e;return t?n(o):o},$w=e=>{let{blockInspectorAnimationSettings:t,selectedBlockClientId:n,children:o}=e;const r=t&&"leftToRight"===t.enterDirection?-50:50;return(0,u.createElement)(h.__unstableMotion.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:r,opacity:0},key:n},o)},jw=e=>{let{clientId:t,blockName:n}=e;const o=zw(n),r=(null==o?void 0:o.length)>1,l=(0,g.useSelect)((e=>{const{getBlockStyles:t}=e(a.store),o=t(n);return o&&o.length>0}),[n]),i=rf(t);return(0,u.createElement)("div",{className:"block-editor-block-inspector"},(0,u.createElement)(hd,c({},i,{className:i.isSynced&&"is-synced"})),(0,u.createElement)(yE,{blockClientId:t}),r&&(0,u.createElement)(Ow,{hasBlockStyles:l,clientId:t,blockName:n,tabs:o}),!r&&(0,u.createElement)(u.Fragment,null,l&&(0,u.createElement)("div",null,(0,u.createElement)(h.PanelBody,{title:(0,_.__)("Styles")},(0,u.createElement)(iE,{clientId:t}),(0,a.hasBlockSupport)(n,"defaultStylePicker",!0)&&(0,u.createElement)(yw,{blockName:n}))),(0,u.createElement)(jr.Slot,null),(0,u.createElement)(jr.Slot,{group:"color",label:(0,_.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,u.createElement)(jr.Slot,{group:"typography",label:(0,_.__)("Typography")}),(0,u.createElement)(jr.Slot,{group:"dimensions",label:(0,_.__)("Dimensions")}),(0,u.createElement)(jr.Slot,{group:"border",label:(0,_.__)("Border")}),(0,u.createElement)(jr.Slot,{group:"styles"}),(0,u.createElement)(xw,null),(0,u.createElement)("div",null,(0,u.createElement)(Iw,null))),(0,u.createElement)(bw,{key:"back"}))};var Ww=e=>{let{showNoBlockSelectedMessage:t=!0}=e;const{count:n,selectedBlockName:o,selectedBlockClientId:r,blockType:l,topLevelLockedBlock:i}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o,__unstableGetContentLockingParent:r,getTemplateLock:l}=e(To),i=t(),s=i&&o(i),c=s&&(0,a.getBlockType)(s);return{count:n(),selectedBlockClientId:i,selectedBlockName:s,blockType:c,topLevelLockedBlock:r(i)||("contentOnly"===l(i)?i:void 0)}}),[]),s=zw(null==l?void 0:l.name),c=(null==s?void 0:s.length)>1,d=function(e,t){return(0,g.useSelect)((t=>{if(e){const n=t(To).getSettings().blockInspectorAnimation,o=null==n?void 0:n.animationParent,{getSelectedBlockClientId:r,getBlockParentsByBlockName:l}=t(To);return l(r(),o,!0)[0]||e.name===o?null==n?void 0:n[e.name]:null}return null}),[t,e])}(l,r);if(n>1)return(0,u.createElement)("div",{className:"block-editor-block-inspector"},(0,u.createElement)(_w,null),c?(0,u.createElement)(Ow,{tabs:s}):(0,u.createElement)(u.Fragment,null,(0,u.createElement)(jr.Slot,null),(0,u.createElement)(jr.Slot,{group:"color",label:(0,_.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,u.createElement)(jr.Slot,{group:"typography",label:(0,_.__)("Typography")}),(0,u.createElement)(jr.Slot,{group:"dimensions",label:(0,_.__)("Dimensions")}),(0,u.createElement)(jr.Slot,{group:"border",label:(0,_.__)("Border")}),(0,u.createElement)(jr.Slot,{group:"styles"})));const p=o===(0,a.getUnregisteredTypeHandlerName)();return l&&r&&!p?i?(0,u.createElement)(Gw,{topLevelLockedBlock:i}):(0,u.createElement)(Uw,{animate:d,wrapper:e=>(0,u.createElement)($w,{blockInspectorAnimationSettings:d,selectedBlockClientId:r},e)},(0,u.createElement)(jw,{clientId:r,blockName:l.name})):t?(0,u.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,_.__)("No block selected.")):null};var Kw=function(e){let{__unstableContentRef:t}=e;const[n,o]=(0,u.useState)(!1),r=(0,g.useSelect)((e=>e(To).getBlockOrder()),[]);return(0,u.useEffect)((()=>{const e=setTimeout((()=>{o(!0)}),500);return()=>{clearTimeout(e)}}),[]),n?r.map(((e,n)=>n===r.length-1?null:(0,u.createElement)(Yg,{key:e,previousClientId:e,nextClientId:r[n+1],__unstableContentRef:t},(0,u.createElement)("div",{className:"block-editor-block-list__insertion-point-inserter is-with-inserter"},(0,u.createElement)(Hg,{position:"bottom center",clientId:r[n+1],__experimentalIsQuick:!0}))))):null};function qw(e){const{__unstableGetEditorMode:t,getSettings:n,isTyping:o}=e(To);return{isZoomOutMode:"zoom-out"===t(),hasFixedToolbar:n().hasFixedToolbar,isTyping:o()}}function Yw(e){let{children:t,__unstableContentRef:n,...o}=e;const r=(0,m.useViewportMatch)("medium"),{hasFixedToolbar:l,isZoomOutMode:i,isTyping:a}=(0,g.useSelect)(qw,[]),s=(0,xd.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:d,getBlockRootClientId:p}=(0,g.useSelect)(To),{duplicateBlocks:f,removeBlocks:v,insertAfterBlock:b,insertBeforeBlock:k,clearSelectedBlock:_,moveBlocksUp:y,moveBlocksDown:E}=(0,g.useDispatch)(To);const C=qr(n),S=qr(n);return(0,u.createElement)("div",c({},o,{onKeyDown:function(e){if(!e.defaultPrevented)if(s("core/block-editor/move-up",e)){const t=d();if(t.length){e.preventDefault();const n=p(t[0]);y(t,n)}}else if(s("core/block-editor/move-down",e)){const t=d();if(t.length){e.preventDefault();const n=p(t[0]);E(t,n)}}else if(s("core/block-editor/duplicate",e)){const t=d();t.length&&(e.preventDefault(),f(t))}else if(s("core/block-editor/remove",e)){const t=d();t.length&&(e.preventDefault(),v(t))}else if(s("core/block-editor/insert-after",e)){const t=d();t.length&&(e.preventDefault(),b(t[t.length-1]))}else if(s("core/block-editor/insert-before",e)){const t=d();t.length&&(e.preventDefault(),k(t[0]))}else if(s("core/block-editor/unselect",e)){d().length&&(e.preventDefault(),_(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges(),null==n||n.current.focus())}}}),(0,u.createElement)(Xg.Provider,{value:(0,u.useRef)(!1)},!a&&(0,u.createElement)(ef,{__unstableContentRef:n}),!i&&(l||!r)&&(0,u.createElement)(Jh,{isFixed:!0}),(0,u.createElement)(yv,{__unstableContentRef:n}),(0,u.createElement)(h.Popover.Slot,{name:"block-toolbar",ref:C}),t,(0,u.createElement)(h.Popover.Slot,{name:"__unstable-block-tools-after",ref:S}),i&&(0,u.createElement)(Kw,{__unstableContentRef:n})))}const Zw=()=>{};var Qw=(0,u.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i=!1,__experimentalInsertionIndex:a,__experimentalFilterValue:s,onSelect:c=Zw,shouldFocusBlock:d=!1}=e;const{destinationRootClientId:p,prioritizePatterns:m}=(0,g.useSelect)((e=>{const{getBlockRootClientId:t,getSettings:r}=e(To);return{destinationRootClientId:n||t(o)||void 0,prioritizePatterns:r().__experimentalPreferPatternsOnRoot}}),[o,n]);return(0,u.createElement)(Og,{onSelect:c,rootClientId:p,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalInsertionIndex:a,__experimentalFilterValue:s,shouldFocusBlock:d,prioritizePatterns:m,ref:t})}));function Xw(){return null}Xw.Register=function(){const{registerShortcut:e}=(0,g.useDispatch)(xd.store);return(0,u.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,_.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,_.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,_.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,_.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,_.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,_.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,_.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,_.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,_.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,_.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var Jw=Xw;function eB(){return W()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const tB=new Set([Qu.UP,Qu.RIGHT,Qu.DOWN,Qu.LEFT,Qu.ENTER,Qu.BACKSPACE]);function nB(){const e=(0,g.useSelect)((e=>e(To).isTyping()),[]),{stopTyping:t}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,l;function i(e){const{clientX:n,clientY:o}=e;r&&l&&(r!==n||l!==o)&&t(),r=n,l=o}return o.addEventListener("mousemove",i),()=>{o.removeEventListener("mousemove",i)}}),[e,t])}function oB(){const{isTyping:e,hasInlineToolbar:t}=(0,g.useSelect)((e=>{const{isTyping:t,getSettings:n}=e(To);return{isTyping:t(),hasInlineToolbar:n().hasInlineToolbar}}),[]),{startTyping:n,stopTyping:o}=(0,g.useDispatch)(To),r=nB(),l=(0,m.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l,a=i.getSelection();if(e){let c;function u(e){const{target:t}=e;c=i.setTimeout((()=>{(0,Ri.isTextField)(t)||o()}))}function d(e){const{keyCode:t}=e;t!==Qu.ESCAPE&&t!==Qu.TAB||o()}function p(){a.isCollapsed||o()}return r.addEventListener("focus",u),r.addEventListener("keydown",d),t||l.addEventListener("selectionchange",p),()=>{i.clearTimeout(c),r.removeEventListener("focus",u),r.removeEventListener("keydown",d),l.removeEventListener("selectionchange",p)}}function s(e){const{type:t,target:o}=e;(0,Ri.isTextField)(o)&&r.contains(o)&&("keydown"!==t||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&tB.has(t)}(e))&&n()}return r.addEventListener("keypress",s),r.addEventListener("keydown",s),()=>{r.removeEventListener("keypress",s),r.removeEventListener("keydown",s)}}),[e,t,n,o]);return(0,m.useMergeRefs)([r,l])}var rB=function(e){let{children:t}=e;return(0,u.createElement)("div",{ref:oB()},t)};const lB=-1!==window.navigator.userAgent.indexOf("Trident"),iB=new Set([Qu.UP,Qu.DOWN,Qu.LEFT,Qu.RIGHT]);function aB(){const e=(0,g.useSelect)((e=>e(To).hasSelectedBlock()),[]);return(0,m.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,l,i;function a(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function s(e){l&&o.cancelAnimationFrame(l),l=o.requestAnimationFrame((()=>{c(e),l=null}))}function c(e){let{keyCode:r}=e;if(!m())return;const l=(0,Ri.computeCaretRect)(o);if(!l)return;if(!i)return void(i=l);if(iB.has(r))return void(i=l);const a=l.top-i.top;if(0===a)return;const s=(0,Ri.getScrollContainer)(t);if(!s)return;const c=s===n.body||s===n.documentElement,u=c?o.scrollY:s.scrollTop,d=c?0:s.getBoundingClientRect().top,p=c?i.top/o.innerHeight:(i.top-d)/(o.innerHeight-d);if(0===u&&p<.75&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=l);const g=c?o.innerHeight:s.clientHeight;i.top+i.height>d+g||i.top{o.removeEventListener("scroll",a,!0),o.removeEventListener("resize",a,!0),t.removeEventListener("keydown",s),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(l)}}),[e])}var sB=lB?e=>e.children:function(e){let{children:t}=e;return(0,u.createElement)("div",{ref:aB(),className:"block-editor__typewriter"},t)};const cB=(0,u.createContext)({});function uB(e){let{children:t,uniqueId:n,blockName:o=""}=e;const r=(0,u.useContext)(cB),{name:l}=Ro();o=o||l;const i=(0,u.useMemo)((()=>function(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}(r,o,n)),[r,o,n]);return(0,u.createElement)(cB.Provider,{value:i},t)}function dB(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=(0,u.useContext)(cB),{name:r}=Ro();return n=n||r,Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e))}var pB=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));function mB(e){let{title:t,help:n,actions:o=[],onClose:r}=e;return(0,u.createElement)(h.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4},(0,u.createElement)(h.__experimentalHStack,{alignment:"center"},(0,u.createElement)(h.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13},t),(0,u.createElement)(h.__experimentalSpacer,null),o.map((e=>{let{label:t,icon:n,onClick:o}=e;return(0,u.createElement)(h.Button,{key:t,className:"block-editor-inspector-popover-header__action",label:t,icon:n,variant:!n&&"tertiary",onClick:o},!n&&t)})),r&&(0,u.createElement)(h.Button,{className:"block-editor-inspector-popover-header__action",label:(0,_.__)("Close"),icon:pB,onClick:r})),n&&(0,u.createElement)(h.__experimentalText,null,n))}var gB=(0,u.forwardRef)((function(e,t){let{onClose:n,onChange:o,...r}=e;return(0,u.createElement)("div",{ref:t,className:"block-editor-publish-date-time-picker"},(0,u.createElement)(mB,{title:(0,_.__)("Publish"),actions:[{label:(0,_.__)("Now"),onClick:()=>null==o?void 0:o(null)}],onClose:n}),(0,u.createElement)(h.DateTimePicker,c({startOfWeek:(0,wE.getSettings)().l10n.startOfWeek,__nextRemoveHelpButton:!0,__nextRemoveResetButton:!0,onChange:o},r)))}));const fB={button:"wp-element-button",caption:"wp-element-caption"},hB=e=>fB[e]?fB[e]:"";function vB(e,t){return Object.entries(t).every((t=>{let[n,o]=t;return"object"==typeof o&&"object"==typeof e[n]?vB(e[n],o):e[n]===o}))}const bB=(e,t)=>{if(!t||!e)return;const n=t.filter((t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&vB(e,n)}));return 1===n.length?n[0]:void 0};function kB(e){const t=null==e?void 0:e.trim().match(/^(0?[-.]?\d*\.?\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/);return isNaN(e)||isNaN(parseFloat(e))?t?{value:parseFloat(t[1])||t[1],unit:t[2]}:{value:e,unit:void 0}:{value:parseFloat(e),unit:"px"}}function _B(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>kB(wB(e,t)).value)).filter(Boolean);switch(n[0]){case"min":return Math.min(...o)+"px";case"max":return Math.max(...o)+"px";case"clamp":return 3!==o.length?null:o[1]o[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function yB(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=_B(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return kB(e)}function EB(e){for(let t=0;tr.height?r.width:r.height)*o,"%":("font"===r.type?r.fontSize:r.width)*o,ch:8,ex:7.15625,lh:r.lineHeight},i={in:n,cm:37.79527559055118,mm:3.7795275590551185,pt:1.3333333333333333,pc:16,px:1,Q:.9448818897637794};return l[e.unit]?(l[e.unit]*e.value).toFixed(0)+"px":i[e.unit]?(i[e.unit]*e.value).toFixed(0)+"px":null}function wB(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number.isFinite(e))return e.toFixed(0)+"px";if(void 0===e)return null;let n=kB(e);return n.unit||(n=yB(e)),EB(e)&&!n.unit?CB(e):SB(n,t)}const BB={};function IB(e){let t="";return e.hasOwnProperty("fontSize")&&(t=":"+e.width),e.hasOwnProperty("lineHeight")&&(t=":"+e.lineHeight),e.hasOwnProperty("width")&&(t=":"+e.width),e.hasOwnProperty("height")&&(t=":"+e.height),e.hasOwnProperty("type")&&(t=":"+e.type),t}var xB=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e+IB(t);return BB[n]||(BB[n]=wB(e,t)),BB[n]};function TB(e,t){var n,o;const{size:r}=e;if(!r||"0"===r)return r;if(null==t||!t.fluid||"object"==typeof(null==t?void 0:t.fluid)&&0===Object.keys(t.fluid).length)return r;if(!1===(null==e?void 0:e.fluid))return r;const l="object"==typeof(null==t?void 0:t.fluid)?null==t?void 0:t.fluid:{},i=Lk({minimumFontSize:null==e||null===(n=e.fluid)||void 0===n?void 0:n.min,maximumFontSize:null==e||null===(o=e.fluid)||void 0===o?void 0:o.max,fontSize:r,minimumFontSizeLimit:null==l?void 0:l.minFontSize});return i||r}const MB="body",NB=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],cssVarInfix:"duotone",valueFunc:e=>{let{slug:t}=e;return`url( '#wp-duotone-${t}' )`},classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>{let{typography:n}=t;return TB(e,n)},valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:e=>{let{size:t}=e;return t},classes:[]}],PB={"color.background":"color","color.text":"color","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient",shadow:"shadow","typography.fontSize":"font-size","typography.fontFamily":"font-family"};function LB(e,t,n,o,r){const l=[(0,f.get)(e,["blocks",t,...n]),(0,f.get)(e,n)];for(const i of l)if(i){const l=["custom","theme","default"];for(const a of l){const l=i[a];if(l){const i=l.find((e=>e[o]===r));if(i){if("slug"===o)return i;return LB(e,t,n,"slug",i.slug)[o]===i[o]?i:void 0}}}}}function RB(e,t,n,o){if(!o)return o;const r=PB[n],l=NB.find((e=>e.cssVarInfix===r));if(!l)return o;const{valueKey:i,path:a}=l,s=LB(e,t,a,i,o);return s?`var:preset|${r}|${s.slug}`:o}function AB(e,t,n){if(!n||"string"!=typeof n){var o,r;if(null===(o=n)||void 0===o||!o.ref||"string"!=typeof(null===(r=n)||void 0===r?void 0:r.ref))return n;{var l;const t=n.ref.split(".");if(!(n=(0,f.get)(e,t))||null!==(l=n)&&void 0!==l&&l.ref)return n}}const i="var:",a="var(--wp--";let s;if(n.startsWith(i))s=n.slice(i.length).split("|");else{if(!n.startsWith(a)||!n.endsWith(")"))return n;s=n.slice(a.length,-")".length).split("--")}const[c,...u]=s;return"preset"===c?function(e,t,n,o){let[r,l]=o;const i=NB.find((e=>e.cssVarInfix===r));if(!i)return n;const a=LB(e.settings,t,i.path,"slug",l);if(a){const{valueKey:n}=i;return AB(e,t,a[n])}return n}(e,t,n,u):"custom"===c?function(e,t,n,o){var r;const l=null!==(r=(0,f.get)(e.settings,["blocks",t,"custom",...o]))&&void 0!==r?r:(0,f.get)(e.settings,["custom",...o]);return l?AB(e,t,l):n}(e,t,n,u):n}const OB=(0,u.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),DB={settings:{},styles:{}},zB=()=>{const{user:e,setUserConfig:t}=(0,u.useContext)(OB);return[!!e&&!k()(e,DB),(0,u.useCallback)((()=>t((()=>DB))),[t])]};function FB(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all";const{merged:r,base:l,user:i,setUserConfig:a}=(0,u.useContext)(OB),s=t?`settings.blocks.${t}.${e}`:`settings.${e}`,c=e=>{a((t=>{const n=JSON.parse(JSON.stringify(t));return(0,f.set)(n,s,e),n}))},d=t=>{const n=t?`settings.blocks.${t}.${e}`:`settings.${e}`;let a;switch(o){case"all":a=(0,f.get)(r,n);break;case"user":a=(0,f.get)(i,n);break;case"base":a=(0,f.get)(l,n);break;default:throw"Unsupported source"}return a},p=null!==(n=d(t))&&void 0!==n?n:d();return[p,c]}function VB(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all";const{merged:r,base:l,user:i,setUserConfig:a}=(0,u.useContext)(OB),s=t?`styles.blocks.${t}.${e}`:`styles.${e}`,c=n=>{a((o=>{const l=JSON.parse(JSON.stringify(o));return(0,f.set)(l,s,RB(r.settings,t,e,n)),l}))};let d;switch(o){case"all":d=AB(r,t,"styles.css"===s?(0,f.get)(i,s):null!==(n=(0,f.get)(i,s))&&void 0!==n?n:(0,f.get)(l,s));break;case"user":d=AB(r,t,(0,f.get)(i,s));break;case"base":d=AB(l,t,(0,f.get)(l,s));break;default:throw"Unsupported source"}return[d,c]}const HB={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"};function GB(e){var t;const n="var:";if(null!=e&&null!==(t=e.startsWith)&&void 0!==t&&t.call(e,n)){return`var(--wp--${e.slice(n.length).split("|").join("--")})`}return e}function UB(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return NB.reduce(((n,o)=>{let{path:r,cssVarInfix:l,classes:i}=o;if(!i)return n;const a=(0,f.get)(t,r,[]);return["default","theme","custom"].forEach((t=>{a[t]&&a[t].forEach((t=>{let{slug:o}=t;i.forEach((t=>{let{classSuffix:r,propertyName:i}=t;const a=`.has-${(0,f.kebabCase)(o)}-${r}`,s=e.split(",").map((e=>`${e}${a}`)).join(","),c=`var(--wp--preset--${l}--${(0,f.kebabCase)(o)})`;n+=`${s}{${i}: ${c} !important;}`}))}))})),n}),"")}function $B(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=[];return Object.keys(e).forEach((r=>{const l=t+(0,f.kebabCase)(r.replace("/","-")),i=e[r];if(i instanceof Object){const e=l+n;o=[...o,...$B(i,e,n)]}else o.push(`${l}: ${i}`)})),o}function jB(e,t){const n=e.split(","),o=[];return n.forEach((e=>{o.push(`${t.trim()}${e.trim()}`)})),o.join(", ")}function WB(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=MB===t,l=Object.entries(a.__EXPERIMENTAL_STYLE_PROPERTY).reduce(((t,o)=>{let[l,{value:i,properties:a,useEngine:s,rootOnly:c}]=o;if(c&&!r)return t;const u=i;if("elements"===u[0]||s)return t;const d=(0,f.get)(e,u);if("--wp--style--root--padding"===l&&("string"==typeof d||!n))return t;if(a&&"string"!=typeof d)Object.entries(a).forEach((e=>{const[n,o]=e;if(!(0,f.get)(d,[o],!1))return;const r=n.startsWith("--")?n:(0,f.kebabCase)(n);t.push(`${r}: ${GB((0,f.get)(d,[o]))}`)}));else if((0,f.get)(e,u,!1)){const n=l.startsWith("--")?l:(0,f.kebabCase)(l);t.push(`${n}: ${GB((0,f.get)(e,u))}`)}return t}),[]),i=(0,ni.getCSSRules)(e);return i.forEach((e=>{var t;if(r&&n&&e.key.startsWith("padding"))return;const i=e.key.startsWith("--")?e.key:(0,f.kebabCase)(e.key);let a=e.value;if("string"!=typeof a&&null!==(t=a)&&void 0!==t&&t.ref){var s;const e=a.ref.split(".");if(a=(0,f.get)(o,e),!a||null!==(s=a)&&void 0!==s&&s.ref)return}var c;"font-size"===i&&(a=TB({size:a},null==o||null===(c=o.settings)||void 0===c?void 0:c.typography));l.push(`${i}: ${a}`)})),l}function KB(e){var t,n,o,r,l;let{tree:i,style:a,selector:s,hasBlockGapSupport:c,hasFallbackGapSupport:u,fallbackGapValue:d}=e,p="",m=c?Bl(null==a||null===(t=a.spacing)||void 0===t?void 0:t.blockGap):"";if(u&&(s===MB?m=m||"0.5em":!c&&d&&(m=d)),m&&null!=i&&null!==(n=i.settings)&&void 0!==n&&null!==(o=n.layout)&&void 0!==o&&o.definitions&&(Object.values(i.settings.layout.definitions).forEach((e=>{let{className:t,name:n,spacingStyles:o}=e;(c||"flex"===n)&&null!=o&&o.length&&o.forEach((e=>{const n=[];if(e.rules&&Object.entries(e.rules).forEach((e=>{let[t,o]=e;n.push(`${t}: ${o||m}`)})),n.length){let o="";o=c?s===MB?`${s} .${t}${(null==e?void 0:e.selector)||""}`:`${s}.${t}${(null==e?void 0:e.selector)||""}`:s===MB?`:where(.${t}${(null==e?void 0:e.selector)||""})`:`:where(${s}.${t}${(null==e?void 0:e.selector)||""})`,p+=`${o} { ${n.join("; ")}; }`}}))})),s===MB&&c&&(p+=`${s} { --wp--style--block-gap: ${m}; }`)),s===MB&&null!=i&&null!==(r=i.settings)&&void 0!==r&&null!==(l=r.layout)&&void 0!==l&&l.definitions){const e=["block","flex","grid"];Object.values(i.settings.layout.definitions).forEach((t=>{let{className:n,displayMode:o,baseStyles:r}=t;o&&e.includes(o)&&(p+=`${s} .${n} { display:${o}; }`),null!=r&&r.length&&r.forEach((e=>{const t=[];if(e.rules&&Object.entries(e.rules).forEach((e=>{let[n,o]=e;t.push(`${n}: ${o}`)})),t.length){const o=`${s} .${n}${(null==e?void 0:e.selector)||""}`;p+=`${o} { ${t.join("; ")}; }`}}))}))}return p}const qB=(e,t)=>{var n,o;const r=[];if(null==e||!e.styles)return r;const l=e=>Object.fromEntries(Object.entries(null!=e?e:{}).filter((e=>{let[t]=e;return["border","color","dimensions","spacing","typography","filter","outline","shadow"].includes(t)}))),i=l(e.styles);return i&&r.push({styles:i,selector:MB}),Object.entries(a.__EXPERIMENTAL_ELEMENTS).forEach((t=>{var n;let[o,l]=t;var i;null!==(n=e.styles)&&void 0!==n&&n.elements[o]&&r.push({styles:null===(i=e.styles)||void 0===i?void 0:i.elements[o],selector:l})})),Object.entries(null!==(n=null===(o=e.styles)||void 0===o?void 0:o.blocks)&&void 0!==n?n:{}).forEach((e=>{var n,o;let[i,s]=e;const c=l(s);if(null!=s&&s.variations){const e={};Object.keys(s.variations).forEach((t=>{e[t]=l(s.variations[t])})),c.variations=e}c&&null!=t&&null!==(n=t[i])&&void 0!==n&&n.selector&&r.push({duotoneSelector:t[i].duotoneSelector,fallbackGapValue:t[i].fallbackGapValue,hasLayoutSupport:t[i].hasLayoutSupport,selector:t[i].selector,styles:c,featureSelectors:t[i].featureSelectors,styleVariationSelectors:t[i].styleVariationSelectors}),Object.entries(null!==(o=null==s?void 0:s.elements)&&void 0!==o?o:{}).forEach((e=>{let[n,o]=e;o&&null!=t&&t[i]&&null!==a.__EXPERIMENTAL_ELEMENTS&&void 0!==a.__EXPERIMENTAL_ELEMENTS&&a.__EXPERIMENTAL_ELEMENTS[n]&&r.push({styles:o,selector:t[i].selector.split(",").map((e=>a.__EXPERIMENTAL_ELEMENTS[n].split(",").map((t=>e+" "+t)))).join(",")})}))})),r},YB=(e,t)=>{var n,o,r;const l=[];if(null==e||!e.settings)return l;const i=e=>{const t={};return NB.forEach((n=>{let{path:o}=n;const r=(0,f.get)(e,o,!1);!1!==r&&(0,f.set)(t,o,r)})),t},a=i(e.settings),s=null===(n=e.settings)||void 0===n?void 0:n.custom;return(0,f.isEmpty)(a)&&!s||l.push({presets:a,custom:s,selector:MB}),Object.entries(null!==(o=null===(r=e.settings)||void 0===r?void 0:r.blocks)&&void 0!==o?o:{}).forEach((e=>{let[n,o]=e;const r=i(o),a=o.custom;(0,f.isEmpty)(r)&&!a||l.push({presets:r,custom:a,selector:t[n].selector})})),l},ZB=(e,t)=>{const n=YB(e,t);let o="";return n.forEach((t=>{let{presets:n,custom:r,selector:l}=t;const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return NB.reduce(((n,o)=>{let{path:r,valueKey:l,valueFunc:i,cssVarInfix:a}=o;const s=(0,f.get)(e,r,[]);return["default","theme","custom"].forEach((e=>{s[e]&&s[e].forEach((e=>{l&&!i?n.push(`--wp--preset--${a}--${(0,f.kebabCase)(e.slug)}: ${e[l]}`):i&&"function"==typeof i&&n.push(`--wp--preset--${a}--${(0,f.kebabCase)(e.slug)}: ${i(e,t)}`)}))})),n}),[])}(n,null==e?void 0:e.settings),a=$B(r,"--wp--custom--","--");a.length>0&&i.push(...a),i.length>0&&(o+=`${l}{${i.join(";")};}`)})),o};function QB(e,t){return YB(e,t).flatMap((e=>{let{presets:t}=e;return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return NB.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=(0,f.get)(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>(0,u.createElement)(qp,{preset:e,key:e.slug})))))}))}(t)}))}const XB=(e,t)=>{let n="";return e.split("&").forEach((e=>{n+=e.includes("{")?t+e:t+"{"+e+"}"})),n};function JB(){let{merged:e}=(0,u.useContext)(OB);const[t]=FB("spacing.blockGap"),n=null!==t,o=!n,r=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return!!t().disableLayoutStyles})),l=(0,g.useSelect)((e=>e(a.store).getBlockStyles),[]);return(0,u.useMemo)((()=>{var t,i,s,c,u,d,p,m,g,h,v,b;if(null===(t=e)||void 0===t||!t.styles||null===(i=e)||void 0===i||!i.settings)return[];e=!(null===(u=(c=e).styles)||void 0===u?void 0:u.blocks["core/separator"])||!(null===(d=c.styles)||void 0===d||null===(p=d.blocks["core/separator"].color)||void 0===p?void 0:p.background)||null!==(m=c.styles)&&void 0!==m&&null!==(g=m.blocks["core/separator"].color)&&void 0!==g&&g.text||null!==(h=c.styles)&&void 0!==h&&null!==(v=h.blocks["core/separator"].border)&&void 0!==v&&v.color?c:{...c,styles:{...c.styles,blocks:{...c.styles.blocks,"core/separator":{...c.styles.blocks["core/separator"],color:{...c.styles.blocks["core/separator"].color,text:null===(b=c.styles)||void 0===b?void 0:b.blocks["core/separator"].color.background}}}}};const k=((e,t)=>{const n={};return e.forEach((e=>{var o,r,l,i,a,s,c,u,d;const p=e.name,m=null!==(o=null==e||null===(r=e.supports)||void 0===r?void 0:r.__experimentalSelector)&&void 0!==o?o:".wp-block-"+p.replace("core/","").replace("/","-"),g=null!==(l=null==e||null===(i=e.supports)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.__experimentalDuotone)&&void 0!==l?l:null,f=!(null==e||null===(s=e.supports)||void 0===s||!s.__experimentalLayout),h=null==e||null===(c=e.supports)||void 0===c||null===(u=c.spacing)||void 0===u||null===(d=u.blockGap)||void 0===d?void 0:d.__experimentalDefault,v=t(p),b={};null!=v&&v.length&&v.forEach((e=>{const t=`.is-style-${e.name}${m}`;b[e.name]=t}));const k={};Object.entries(HB).forEach((t=>{var n,o;let[r,l]=t;const i=null==e||null===(n=e.supports)||void 0===n||null===(o=n[r])||void 0===o?void 0:o.__experimentalSelector;i&&(k[l]=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(m,i))})),n[p]={duotoneSelector:g,fallbackGapValue:h,featureSelectors:Object.keys(k).length?k:void 0,hasLayoutSupport:f,name:p,selector:m,styleVariationSelectors:Object.keys(b).length?b:void 0}})),n})((0,a.getBlockTypes)(),l),_=ZB(e,k),y=function(e,t,n,o){var r,l;let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const a=qB(e,t),s=YB(e,t),c=null==e||null===(r=e.settings)||void 0===r?void 0:r.useRootPaddingAwareAlignments,{contentSize:u,wideSize:d}=(null==e||null===(l=e.settings)||void 0===l?void 0:l.layout)||{};let p="body {margin: 0;";if(u&&(p+=` --wp--style--global--content-size: ${u};`),d&&(p+=` --wp--style--global--wide-size: ${d};`),c&&(p+='padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) { padding-right: 0; padding-left: 0; }\n\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull { margin-right: 0; margin-left: 0; }\n\t\t\t.has-global-padding > .alignfull:where(:not(.has-global-padding)) > :where([class*="wp-block-"]:not(.alignfull):not([class*="__"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where([class*="wp-block-"]:not(.alignfull):not([class*="__"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0;'),p+="}",a.forEach((t=>{let{selector:r,duotoneSelector:l,styles:a,fallbackGapValue:s,hasLayoutSupport:u,featureSelectors:d,styleVariationSelectors:m}=t;d&&Object.entries(d).forEach((e=>{let[t,n]=e;if(null!=a&&a[t]){const e=WB({[t]:a[t]});delete a[t],e.length&&(p+=`${n}{${e.join(";")} }`)}})),m&&Object.entries(m).forEach((t=>{var n;let[o,r]=t;if(null!=a&&null!==(n=a.variations)&&void 0!==n&&n[o]){var l;d&&Object.entries(d).forEach((e=>{var t,n;let[l,i]=e;if(null!=a&&null!==(t=a.variations)&&void 0!==t&&null!==(n=t[o])&&void 0!==n&&n[l]){const e=WB({[l]:a.variations[o][l]});delete a.variations[o][l],e.length&&(p+=`${jB(i,r)}{${e.join(";")} }`)}}));const t=WB(null==a||null===(l=a.variations)||void 0===l?void 0:l[o],r,c,e);t.length&&(p+=`${r}{${t.join(";")}}`)}}));const g={};if(null!=a&&a.filter&&(g.filter=a.filter,delete a.filter),l){const e=WB(g);e.length>0&&(p+=`${l}{${e.join(";")};}`)}i||MB!==r&&!u||(p+=KB({tree:e,style:a,selector:r,hasBlockGapSupport:n,hasFallbackGapSupport:o,fallbackGapValue:s}));const f=WB(a,r,c,e);null!=f&&f.length&&(p+=`${r}{${f.join(";")};}`);const h=Object.entries(a).filter((e=>{let[t]=e;return t.startsWith(":")}));null!=h&&h.length&&h.forEach((e=>{let[t,n]=e;const o=WB(n);if(null==o||!o.length)return;const l=`${r.split(",").map((e=>e+t)).join(",")}{${o.join(";")};}`;p+=l}))})),p+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",p+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",p+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }",n){var m,g;const t=Bl(null==e||null===(m=e.styles)||void 0===m||null===(g=m.spacing)||void 0===g?void 0:g.blockGap)||"0.5em";p+=".wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }",p+=`.wp-site-blocks > * + * { margin-block-start: ${t}; }`}return s.forEach((e=>{let{selector:t,presets:n}=e;MB===t&&(t="");const o=UB(t,n);(0,f.isEmpty)(o)||(p+=o)})),p}(e,k,n,o,r),E=QB(e,k),C=[{css:_,isGlobalStyles:!0},{css:y,isGlobalStyles:!0},{css:null!==(s=e.styles.css)&&void 0!==s?s:"",isGlobalStyles:!0}];return(0,a.getBlockTypes)().forEach((t=>{var n;if(null!==(n=e.styles.blocks[t.name])&&void 0!==n&&n.css){var o;const n=k[t.name].selector;C.push({css:XB(null===(o=e.styles.blocks[t.name])||void 0===o?void 0:o.css,n),isGlobalStyles:!0})}})),[C,e.settings,E]}),[n,o,e,r])}const eI=["core/navigation-link/page","core/navigation-link"],tI=(0,u.forwardRef)(((e,t)=>{let{nestingLevel:n,blockCount:o,...r}=e;const[l,i]=(0,u.useState)(null),a=(0,m.useInstanceId)(tI),{hideInserter:s,clientId:d}=(0,g.useSelect)((e=>{const{getTemplateLock:t,__unstableGetEditorMode:n,getSelectedBlockClientId:o}=e(To),r=o();return{clientId:o(),hideInserter:!!t(r)||"zoom-out"===n()}}),[]),p=lf({clientId:d,context:"list-view"}),f=lf({clientId:null==l?void 0:l.clientId,context:"list-view"});(0,u.useEffect)((()=>{null!=f&&f.length&&(0,pn.speak)((0,_.sprintf)((0,_.__)("%s block inserted"),f),"assertive")}),[f]);const h=(0,u.useCallback)((e=>(e.sort(((e,t)=>{let{id:n}=e,{id:o}=t,r=eI.indexOf(n),l=eI.indexOf(o);return r<0&&(r=eI.length),l<0&&(l=eI.length),r-l})),e)),[]);if(s)return null;const{PrivateInserter:v}=Io(MI),b=`off-canvas-editor-appender__${a}`,k=(0,_.sprintf)((0,_.__)("Append to %1$s block at position %2$d, Level %3$d"),p,o+1,n);return(0,u.createElement)("div",{className:"offcanvas-editor-appender"},(0,u.createElement)(v,c({ref:t,rootClientId:d,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:!1,__experimentalIsQuick:!0},r,{toggleProps:{"aria-describedby":b},onSelectOrClose:e=>{null!=e&&e.clientId&&i(e)},orderInitialBlockItems:h})),(0,u.createElement)("div",{className:"offcanvas-editor-appender__description",id:b},k))})),nI=Ru(h.__experimentalTreeGridRow);function oI(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:i,path:a,...s}=e;const d=Du({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:a});return(0,u.createElement)(nI,c({ref:d,className:p()("block-editor-list-view-leaf","offcanvas-editor-list-view-leaf",i),level:o,positionInSet:n,setSize:r},s),l)}function rI(e){let{onClick:t}=e;return(0,u.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,u.createElement)(Jl,{icon:(0,_.isRTL)()?Dy:Iy}))}var lI=(0,u.forwardRef)((function(e,t){let{className:n,block:o,onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:a,onDragStart:s,onDragEnd:c,draggable:d}=e;const{clientId:m}=o,g=rf(m),f=lf({clientId:m,context:"list-view"}),{isLocked:v}=Ih(m),b=g?(0,_.sprintf)((0,_.__)("Edit %s block"),g.title):(0,_.__)("Edit");return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Button,{className:p()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==Qu.ENTER&&e.keyCode!==Qu.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),null==s||s(e)},onDragEnd:c,draggable:d,href:`#block-${m}`,"aria-hidden":!0,title:b},(0,u.createElement)(rI,{onClick:l}),(0,u.createElement)(fd,{icon:null==g?void 0:g.icon,showColors:!0,context:"list-view"}),(0,u.createElement)(h.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,u.createElement)(h.__experimentalTruncate,{ellipsizeMode:"auto"},f)),(null==g?void 0:g.anchor)&&(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper"},(0,u.createElement)(h.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto"},g.anchor)),v&&(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,u.createElement)(Jl,{icon:Oy})))))})),iI=window.wp.escapeHtml;function aI(e,t){switch(e){case"post":case"page":return{type:"post",subtype:e};case"category":return{type:"term",subtype:"category"};case"tag":return{type:"term",subtype:"post_tag"};case"post_format":return{type:"post-format"};default:return"taxonomy"===t?{type:"term",subtype:e}:"post-type"===t?{type:"post",subtype:e}:{}}}function sI(e){let{clientId:t}=e;const{getBlock:n,blockTransforms:o}=(0,g.useSelect)((e=>{const{getBlock:n,getBlockRootClientId:o,getBlockTransformItems:r}=e(To);return{getBlock:n,blockTransforms:r(n(t),o(t))}}),[t]),{replaceBlock:r}=(0,g.useDispatch)(To),l=["core/page-list","core/site-logo","core/social-links","core/search"],i=o.filter((e=>l.includes(e.name)));return null!=i&&i.length&&t?(0,u.createElement)("div",{className:"link-control-transform"},(0,u.createElement)("h3",{className:"link-control-transform__subheading"},(0,_.__)("Transform")),(0,u.createElement)("div",{className:"link-control-transform__items"},i.map((e=>(0,u.createElement)(h.Button,{key:`transform-${e.name}`,onClick:()=>r(t,(0,a.switchToBlockType)(n(t),e.name)),className:"link-control-transform__item"},(0,u.createElement)(fd,{icon:e.icon}),e.title))))):null}function cI(e){const{label:t,url:n,opensInNewTab:o,type:r,kind:l}=e.link,i={url:n,opensInNewTab:o,title:t&&(0,Ri.__unstableStripHTML)(t)};return(0,u.createElement)(h.Popover,{placement:"bottom",onClose:e.onClose,anchor:e.anchor,shift:!0},(0,u.createElement)(oS,{hasTextControl:!0,hasRichPreviews:!0,className:e.className,value:i,showInitialSuggestions:!0,withCreateSuggestion:e.hasCreateSuggestion,noDirectEntry:!!r,noURLSuggestion:!!r,suggestionsQuery:aI(r,l),onChange:e.onChange,onRemove:e.onRemove,renderControlBottom:n?null:()=>(0,u.createElement)(sI,{clientId:e.clientId})}))}const uI=["core/navigation-link","core/navigation-submenu"],dI=(0,u.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:i,siblingBlockCount:a,level:s,isExpanded:d,selectedClientIds:m,...f}=e;const{clientId:h}=r,[v,b]=(0,u.useState)(),{blockMovingClientId:k,selectedBlockInBlockEditor:_,lastInsertedBlockClientId:y}=(0,g.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n,getLastInsertedBlocksClientIds:o}=Io(e(To)),r=o();return{blockMovingClientId:t(),selectedBlockInBlockEditor:n(),lastInsertedBlockClientId:r&&r[0]}}),[h]),{insertedBlockAttributes:E,insertedBlockName:C,setInsertedBlockAttributes:S}=(e=>{const{insertedBlockAttributes:t,insertedBlockName:n}=(0,g.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(To);return{insertedBlockAttributes:o(e),insertedBlockName:n(e)}}),[e]),{updateBlockAttributes:o}=(0,g.useDispatch)(To),r=t=>{e&&o(e,t)};return e?{insertedBlockAttributes:t,insertedBlockName:n,setInsertedBlockAttributes:r}:{insertedBlockAttributes:void 0,insertedBlockName:void 0,setInsertedBlockAttributes:r}})(y),w=null==E?void 0:E.url;(0,u.useEffect)((()=>{h===y&&null!=uI&&uI.includes(C)&&!w&&b(!0)}),[y,h,C,w]);const B=k&&_===h,I=p()("block-editor-list-view-block-contents",{"is-dropping-before":B}),x=m.includes(h)?m:[h];return(0,u.createElement)(u.Fragment,null,v&&(0,u.createElement)(cI,{clientId:y,link:E,onClose:()=>b(!1),hasCreateSuggestion:!1,onChange:e=>{!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{label:o="",kind:r="",type:l=""}=n,{title:i="",url:a="",opensInNewTab:s,id:c,kind:u=r,type:d=l}=e,p=i.replace(/http(s?):\/\//gi,""),m=a.replace(/http(s?):\/\//gi,""),g=i&&i!==o&&p!==m?(0,iI.escapeHTML)(i):o||(0,iI.escapeHTML)(m),f="post_tag"===d?"tag":d.replace("-","_"),h=["post","page","tag","category"].indexOf(f)>-1,v=!u&&!h||"custom"===u?"custom":u;t({...a&&{url:encodeURI((0,rg.safeDecodeURI)(a))},...g&&{label:g},...void 0!==s&&{opensInNewTab:s},...c&&Number.isInteger(c)&&{id:c},...v&&{kind:v},...f&&"URL"!==f&&{type:f}})}(e,S,E),b(!1)}}),(0,u.createElement)(sf,{clientIds:x},(e=>{let{draggable:p,onDragStart:m,onDragEnd:g}=e;return(0,u.createElement)(lI,c({ref:t,className:I,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:i,siblingBlockCount:a,level:s,draggable:p,onDragStart:m,onDragEnd:g,isExpanded:d},f))})))}));var pI=dI;const mI=(0,u.createContext)({}),gI=()=>(0,u.useContext)(mI);var fI=(0,u.memo)((function e(t){let{block:{clientId:n},isDragged:o,isSelected:r,isBranchSelected:l,selectBlock:i,position:s,level:c,rowCount:d,siblingBlockCount:f,showBlockMovers:v,path:b,isExpanded:k,selectedClientIds:y,preventAnnouncement:E}=t;const C=(0,u.useRef)(null),[S,w]=(0,u.useState)(!1),{isLocked:B,isContentLocked:I}=Ih(n),x=(0,g.useSelect)((e=>!r&&(!!I&&e(To).hasSelectedInnerBlock(n,!0))),[I,n,r]),T=x||r&&y[0]===n,M=x||r&&y[y.length-1]===n,{toggleBlockHighlight:N}=(0,g.useDispatch)(To),P=rf(n),L=(0,g.useSelect)((e=>e(To).getBlock(n)),[n]);(0,u.useEffect)((()=>{!z&&r&&C.current.focus()}),[]);const R=(0,u.useCallback)((()=>{w(!0),N(n,!0)}),[n,w,N]),A=(0,u.useCallback)((()=>{w(!1),N(n,!1)}),[n,w,N]),O=(0,u.useCallback)((e=>{i(e,n),e.preventDefault()}),[n,i]),D=(0,u.useCallback)((e=>{i(void 0,e)}),[i]),{isTreeGridMounted:z,expand:F,collapse:V,LeafMoreMenu:H}=gI(),G=(0,u.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?V(n):!1===k&&F(n)}),[n,F,V,k]),U=(0,m.useInstanceId)(e);if(!L)return null;const $=!!L&&(0,a.hasBlockSupport)(L.name,"__experimentalToolbar",!0),j=`list-view-block-select-button__${U}`,W=((e,t,n)=>(0,_.sprintf)((0,_.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(s,f,c);let K=(0,_.__)("Link");P&&(K=B?(0,_.sprintf)((0,_.__)("%s link (locked)"),P.title):(0,_.sprintf)((0,_.__)("%s link"),P.title));const q=P?(0,_.sprintf)((0,_.__)("Options for %s block"),P.title):(0,_.__)("Options"),Y=v&&f>0,Z=p()("block-editor-list-view-block__mover-cell",{"is-visible":S||r}),Q=p()("block-editor-list-view-block__menu-cell",{"is-visible":S||T});let X;Y?X=1:$||(X=2);const J=p()({"is-selected":r||x,"is-first-selected":T,"is-last-selected":M,"is-branch-selected":l,"is-dragging":o,"has-single-cell":!$}),ee=y.includes(n)?y:[n],te=H||Gh;return(0,u.createElement)(oI,{className:J,onMouseEnter:R,onMouseLeave:A,onFocus:R,onBlur:A,level:c,position:s,rowCount:d,path:b,id:`list-view-block-${n}`,"data-block":n,isExpanded:I?void 0:k,"aria-selected":!!r||x},(0,u.createElement)(h.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:X,ref:C,"aria-label":K,"aria-selected":!!r||x,"aria-expanded":I?void 0:k,"aria-describedby":j},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,u.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,u.createElement)(pI,{block:L,onClick:O,onToggleExpanded:G,isSelected:r,position:s,siblingBlockCount:f,level:c,ref:t,tabIndex:n,onFocus:o,isExpanded:k,selectedClientIds:y,preventAnnouncement:E}),(0,u.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:j},W))})),Y&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalTreeGridCell,{className:Z,withoutGridItem:!0},(0,u.createElement)(h.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,u.createElement)(hf,{orientation:"vertical",clientIds:[n],ref:t,tabIndex:o,onFocus:r})})),(0,u.createElement)(h.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,u.createElement)(vf,{orientation:"vertical",clientIds:[n],ref:t,tabIndex:o,onFocus:r})})))),$&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalTreeGridCell,{className:Q,"aria-selected":!!r||x},(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(te,{clientIds:ee,block:L,clientId:n,icon:sg,label:q,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:o,onFocus:r},disableOpenOnArrowDown:!0,__experimentalSelectBlock:D}))}))))}));function hI(e,t,n,o){var r;if(null==n?void 0:n.includes(e.clientId))return 0;return(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(vI(t,n,o),0):1}const vI=(e,t,n)=>(o,r)=>{var l;if(null==t?void 0:t.includes(r.clientId))return o;return(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+hI(r,e,t,n):o+1},bI=()=>{};var kI=(0,u.memo)((function e(t){const{blocks:n,selectBlock:o=bI,showBlockMovers:r,selectedClientIds:l,level:i=1,path:a="",isBranchSelected:s=!1,listPosition:d=0,fixedListWindow:p,isExpanded:m,parentId:f,shouldShowInnerBlocks:v=!0,showAppender:b=!0}=t,k=(0,g.useSelect)((e=>!(!f||"contentOnly"!==e(To).getTemplateLock(f))),[f]),{expandedState:_,draggedClientIds:y}=gI();if(k)return null;const E=b&&1===i,C=n.filter(Boolean),S=C.length,w=E?S+1:S;let B=d;return(0,u.createElement)(u.Fragment,null,C.map(((t,n)=>{var c;const{clientId:d,innerBlocks:f}=t;n>0&&(B+=hI(C[n-1],_,y,m));const{itemInView:h}=p,k=h(B),E=n+1,I=a.length>0?`${a}_${E}`:`${E}`,x=!(null==f||!f.length),T=x&&v?null!==(c=_[d])&&void 0!==c?c:m:void 0,M=!(null==y||!y.includes(d)),N=M||k,P=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(d,l),L=s||P&&x;return(0,u.createElement)(g.AsyncModeProvider,{key:d,value:!P},N&&(0,u.createElement)(fI,{block:t,selectBlock:o,isSelected:P,isBranchSelected:L,isDragged:M,level:i,position:E,rowCount:w,siblingBlockCount:S,showBlockMovers:r,path:I,isExpanded:T,listPosition:B,selectedClientIds:l}),!N&&(0,u.createElement)("tr",null,(0,u.createElement)("td",{className:"block-editor-list-view-placeholder"})),x&&T&&!M&&(0,u.createElement)(e,{parentId:d,blocks:f,selectBlock:o,showBlockMovers:r,level:i+1,path:I,listPosition:B+1,fixedListWindow:p,isBranchSelected:L,selectedClientIds:l,isExpanded:m,showAppender:b}))})),E&&(0,u.createElement)(h.__experimentalTreeGridRow,{level:i,setSize:w,positionInSet:w,isExpanded:!0},(0,u.createElement)(h.__experimentalTreeGridCell,null,(e=>(0,u.createElement)(tI,c({nestingLevel:i,blockCount:S},e))))))}));function _I(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,a]=(0,u.useMemo)((()=>{if(!t.current)return[];return[o?t.current.querySelector(`[data-block="${o}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]}),[o,r]),s=a||i,c=(0,u.useCallback)((()=>{if(!i)return 0;const e=s.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,s]),d=(0,u.useMemo)((()=>{if(!s)return{};const e=c();return{width:s.offsetWidth-e}}),[c,s]),p=(0,u.useMemo)((()=>{if(s&&("top"===l||"bottom"===l||"inside"===l))return{ownerDocument:s.ownerDocument,getBoundingClientRect(){const e=s.getBoundingClientRect(),t=c(),n=e.left+t,o=e.right;let r=0,i=0;"top"===l?(r=e.top,i=e.top):(r=e.bottom,i=e.bottom);const a=o-n,u=i-r;return new window.DOMRect(n,r,a,u)}}}),[s,l,c]);return s?(0,u.createElement)(h.Popover,{animate:!1,anchor:p,focusOnMount:!1,className:"block-editor-list-view-drop-indicator",variant:"unstyled"},(0,u.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}function yI(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,g.useDispatch)(To),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:l,getBlockSelectionEnd:i,getSelectedBlockClientIds:s,hasMultiSelection:c,hasSelectedBlock:d}=(0,g.useSelect)(To),{getBlockType:p}=(0,g.useSelect)(a.store);return{updateBlockSelection:(0,u.useCallback)((async(i,a,u)=>{if(null==i||!i.shiftKey)return void n(a);i.preventDefault();const m="keydown"===i.type&&(i.keyCode===Qu.UP||i.keyCode===Qu.DOWN||i.keyCode===Qu.HOME||i.keyCode===Qu.END);if(!m&&!d()&&!c())return void n(a,null);const g=s(),f=[...r(a),a];m&&!g.some((e=>f.includes(e)))&&await e();let h=l(),v=a;m&&(d()||c()||(h=a),u&&(v=u));const b=r(h),k=r(v),{start:y,end:E}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(h,v,b,k);await t(y,E,null);const C=s();if((i.keyCode===Qu.HOME||i.keyCode===Qu.END)&&C.length>1)return;const S=g.filter((e=>!C.includes(e)));let w;if(1===S.length){var B;const e=null===(B=p(o(S[0])))||void 0===B?void 0:B.title;e&&(w=(0,_.sprintf)((0,_.__)("%s deselected."),e))}else S.length>1&&(w=(0,_.sprintf)((0,_.__)("%s blocks deselected."),S.length));w&&(0,pn.speak)(w)}),[e,o,p,r,l,i,s,c,d,t,n])}}const EI=["top","bottom"];function CI(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,g.useSelect)(To),[l,i]=(0,u.useState)(),{rootClientId:a,blockIndex:s}=l||{},c=Mv(a,s),d=o(),p=(0,m.useThrottle)((0,u.useCallback)(((o,l)=>{const a={x:o.clientX,y:o.clientY},s=!(null==d||!d.length),c=function(e,t){let n,o,r,l;for(const i of e){if(i.isDraggedBlock)continue;const a=i.element.getBoundingClientRect(),[s,c]=Pv(t,a,EI),u=Lv(t,a);if(void 0===r||s0||function(e,t){const n=t.left+t.width/2;return e.x>n}(t,l)))return{rootClientId:o.clientId,blockIndex:0,dropPosition:"inside"};if(!o.canInsertDraggedBlocksAsSibling)return;const a=i?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+a,dropPosition:n}}(Array.from(l.querySelectorAll("[data-block]")).map((o=>{const l=o.dataset.block,i=e(l);return{clientId:l,rootClientId:i,blockIndex:t(l),element:o,isDraggedBlock:!!s&&d.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!s||r(d,i),canInsertDraggedBlocksAsChild:!s||r(d,l)}})),a);c&&i(c)}),[d]),200);return{ref:(0,m.__experimentalUseDropZone)({onDrop:c,onDragOver(e){p(e,e.currentTarget)},onDragEnd(){p.cancel(),i(null)}}),target:l}}const SI=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var wI=(0,u.forwardRef)((function(e,t){let{id:n,parentClientId:o,blocks:r,showBlockMovers:l=!1,isExpanded:i=!1,showAppender:a=!0,LeafMoreMenu:s,description:c=(0,_.__)("Block navigation structure"),onSelect:d}=e;const{getBlock:p}=(0,g.useSelect)(To),{clientIdsTree:f,draggedClientIds:v,selectedClientIds:b}=function(e){return(0,g.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(To);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(r),{visibleBlockCount:k,shouldShowInnerBlocks:y}=(0,g.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n,__unstableGetEditorMode:o}=e(To),r=(null==v?void 0:v.length)>0?n(v).length+1:0;return{visibleBlockCount:t()-r,shouldShowInnerBlocks:"zoom-out"!==o()}}),[v]),{updateBlockSelection:E}=yI(),[C,S]=(0,u.useReducer)(SI,{}),{ref:w,target:B}=CI(),I=(0,u.useRef)(),x=(0,m.useMergeRefs)([I,w,t]),T=(0,u.useRef)(!1),{setSelectedTreeId:M}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,u.useState)(null),{selectedBlockParentClientIds:l}=(0,g.useSelect)((e=>{const{getBlockParents:n}=e(To);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,u.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:b[0],setExpandedState:S}),N=(0,u.useCallback)(((e,t)=>{E(e,t),M(t),d&&d(p(t))}),[M,E,d,p]);(0,u.useEffect)((()=>{T.current=!0}),[]);const[P]=(0,m.__experimentalUseFixedWindowList)(I,36,k,{useWindowing:!0,windowOverscan:40}),L=(0,u.useCallback)((e=>{e&&S({type:"expand",clientIds:[e]})}),[S]),R=(0,u.useCallback)((e=>{e&&S({type:"collapse",clientIds:[e]})}),[S]),A=(0,u.useCallback)((e=>{var t;L(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[L]),O=(0,u.useCallback)((e=>{var t;R(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[R]),D=(0,u.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&E(e,null==t||null===(o=t.dataset)||void 0===o?void 0:o.block,null==n||null===(r=n.dataset)||void 0===r?void 0:r.block)}),[E]),z=(0,u.useMemo)((()=>({isTreeGridMounted:T.current,draggedClientIds:v,expandedState:C,expand:L,collapse:R,LeafMoreMenu:s})),[T.current,v,C,L,R,s]);return(0,u.createElement)(g.AsyncModeProvider,{value:!0},(0,u.createElement)(_I,{listViewRef:I,blockDropTarget:B}),(0,u.createElement)("div",{className:"offcanvas-editor-list-view-tree-wrapper"},(0,u.createElement)(h.__experimentalTreeGrid,{id:n,className:"block-editor-list-view-tree","aria-label":(0,_.__)("Block navigation structure"),ref:x,onCollapseRow:O,onExpandRow:A,onFocusRow:D,"aria-description":c},(0,u.createElement)(mI.Provider,{value:z},(0,u.createElement)(kI,{parentId:o,blocks:f,selectBlock:N,showBlockMovers:l,fixedListWindow:P,selectedClientIds:b,isExpanded:i,shouldShowInnerBlocks:y,showAppender:a}),(0,u.createElement)(h.__experimentalTreeGridRow,{level:1,setSize:1,positionInSet:1,isExpanded:!0},!f.length&&(0,u.createElement)(h.__experimentalTreeGridCell,{withoutGridItem:!0},(0,u.createElement)("div",{className:"offcanvas-editor-list-view-is-empty"},(0,_.__)("Your menu is currently empty. Add your first menu item to get started."))))))))}));var BI=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z"}));const II={className:"block-editor-block-settings-menu__popover",position:"bottom right",variant:"toolbar"},xI=["core/navigation-link","core/navigation-submenu"];function TI(e){let{block:t,onClose:n}=e;const{expandedState:o,expand:r}=gI(),{insertBlock:l,replaceBlock:i,replaceInnerBlocks:s}=(0,g.useDispatch)(To),c=t.clientId,d=!xI.includes(t.name);return(0,u.createElement)(h.MenuItem,{icon:BI,disabled:d,onClick:()=>{const e=(0,a.createBlock)("core/navigation-link");if("core/navigation-submenu"===t.name)l(e,t.innerBlocks.length,c,false);else{const n=(0,a.createBlock)("core/navigation-submenu",t.attributes,t.innerBlocks);i(c,n),s(n.clientId,[e],false)}o[t.clientId]||r(t.clientId),n()}},(0,_.__)("Add submenu link"))}const MI={};Bo(MI,{...i,ExperimentalBlockEditorProvider:_d,LeafMoreMenu:function(e){const{clientId:t,block:n}=e,{removeBlocks:o}=(0,g.useDispatch)(To),r=(0,_.sprintf)((0,_.__)("Remove %s"),af({clientId:t,maximumLength:25}));return(0,u.createElement)(h.DropdownMenu,c({icon:sg,label:(0,_.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:II,noIcons:!0},e),(e=>{let{onClose:l}=e;return(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(TI,{block:n,onClose:l}),(0,u.createElement)(h.MenuItem,{onClick:()=>{o([t],!1),l()}},r))}))},OffCanvasEditor:wI,PrivateInserter:Vg})}(),(window.wp=window.wp||{}).blockEditor=o}(); \ No newline at end of file +var DE=function(e,t){return DE=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},DE(e,t)};var zE=function(){return zE=Object.assign||function(e){for(var t,n=1,o=arguments.length;nu*r?{width:u*r,height:u}:{width:c,height:c/r}}function GE(e,t,n,o,r){void 0===r&&(r=0);var l=XE(t.width,t.height,r),i=l.width,a=l.height;return{x:UE(e.x,i,n.width,o),y:UE(e.y,a,n.height,o)}}function UE(e,t,n,o){var r=t*o/2-n/2;return JE(e,-r,r)}function $E(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function jE(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function WE(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var a=i?KE:qE,s=XE(t.width,t.height,l),c=XE(t.naturalWidth,t.naturalHeight,l),u={x:a(100,((s.width-n.width/r)/2-e.x/r)/s.width*100),y:a(100,((s.height-n.height/r)/2-e.y/r)/s.height*100),width:a(100,n.width/s.width*100/r),height:a(100,n.height/s.height*100/r)},d=Math.round(a(c.width,u.width*c.width/100)),p=Math.round(a(c.height,u.height*c.height/100)),m=c.width>=c.height*o?{width:Math.round(p*o),height:p}:{width:d,height:Math.round(d/o)};return{croppedAreaPercentages:u,croppedAreaPixels:zE(zE({},m),{x:Math.round(a(c.width-m.width,u.x*c.width/100)),y:Math.round(a(c.height-m.height,u.y*c.height/100))})}}function KE(e,t){return Math.min(e,Math.max(0,t))}function qE(e,t){return t}function YE(e,t,n,o,r,l){var i=XE(t.width,t.height,n),a=JE(o.width/i.width*(100/e.width),r,l);return{crop:{x:a*i.width/2-o.width/2-i.width*a*(e.x/100),y:a*i.height/2-o.height/2-i.height*a*(e.y/100)},zoom:a}}function ZE(e,t,n,o,r,l){void 0===n&&(n=0);var i=XE(t.naturalWidth,t.naturalHeight,n),a=JE(function(e,t,n){var o=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*o):n.width/(e.width*o)}(e,t,o),r,l),s=o.height>o.width?o.height/e.height:o.width/e.width;return{crop:{x:((i.width-e.width)/2-e.x)*s,y:((i.height-e.height)/2-e.y)*s},zoom:a}}function QE(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function XE(e,t,n){var o=n*Math.PI/180;return{width:Math.abs(Math.cos(o)*e)+Math.abs(Math.sin(o)*t),height:Math.abs(Math.sin(o)*e)+Math.abs(Math.cos(o)*t)}}function JE(e,t,n){return Math.min(Math.max(e,t),n)}function eC(){for(var e=[],t=0;t0})).join(" ").trim()}var tC=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=ka().createRef(),n.videoRef=ka().createRef(),n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc="undefined"!=typeof document?document:null,n.currentWindow="undefined"!=typeof window?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&n.containerRef){var e=!0;n.resizeObserver=new window.ResizeObserver((function(t){e?e=!1:n.computeSizes()})),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=YE(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),o=t.crop,r=t.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}else if(n.props.initialCroppedAreaPixels){var l=ZE(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);o=l.crop,r=l.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}},n.computeSizes=function(){var e,t,o,r,l,i,a=n.imageRef.current||n.videoRef.current;if(a&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect();var s=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(o=n.imageRef.current)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef.current)||void 0===r?void 0:r.videoHeight)||0,d=c/u,p=void 0;if(a.offsetWidthd?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":p={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":p={width:n.containerRect.height*d,height:n.containerRect.height};break;case"auto-cover":p=c>u?{width:n.containerRect.width,height:n.containerRect.width/d}:{width:n.containerRect.height*d,height:n.containerRect.height}}else p={width:a.offsetWidth,height:a.offsetHeight};n.mediaSize=zE(zE({},p),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var m=n.props.cropSize?n.props.cropSize:HE(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(l=n.state.cropSize)||void 0===l?void 0:l.height)===m.height&&(null===(i=n.state.cropSize)||void 0===i?void 0:i.width)===m.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(m),n.setState({cropSize:m},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(m),m}},n.onMouseDown=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e)))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){n.currentDoc&&(n.isTouching=!0,n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var o=t.getMousePoint(e),r=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(r,o,{shouldUpdatePosition:!0}),n.props.onRotationChange){var l=n.gestureRotationStart+e.rotation;n.props.onRotationChange(l)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=zE({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?GE(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}})))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(n.currentWindow&&(!n.props.onWheelRequest||n.props.onWheelRequest(e))){e.preventDefault();var o=t.getMousePoint(e),r=VE()(e).pixelY,l=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(l,o,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t,o){var r=(void 0===o?{}:o).shouldUpdatePosition,l=void 0===r||r;if(n.state.cropSize&&n.props.onZoomChange){var i=JE(e,n.props.minZoom,n.props.maxZoom);if(l){var a=n.getPointOnContainer(t),s=n.getPointOnMedia(a),c={x:s.x*i-a.x,y:s.y*i-a.y},u=n.props.restrictPosition?GE(c,n.mediaSize,n.state.cropSize,i,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(i)}},n.getCropData=function(){return n.state.cropSize?WE(n.props.restrictPosition?GE(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?GE(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function n(){this.constructor=e}DE(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(e){var t,n,o,r,l,i,a,s,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(o=e.cropSize)||void 0===o?void 0:o.width)!==(null===(r=this.props.cropSize)||void 0===r?void 0:r.width)?this.computeSizes():(null===(l=e.crop)||void 0===l?void 0:l.x)===(null===(i=this.props.crop)||void 0===i?void 0:i.x)&&(null===(a=e.crop)||void 0===a?void 0:a.y)===(null===(s=this.props.crop)||void 0===s?void 0:s.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef.current)||void 0===c||c.load())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=$E(n,o),this.lastPinchRotation=jE(n,o),this.onDragStart(QE(n,o))},t.prototype.onPinchMove=function(e){var n=this;if(this.currentDoc&&this.currentWindow){var o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=QE(o,r);this.onDrag(l),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=$E(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var i=jE(o,r),a=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(a),n.lastPinchRotation=i}))}},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.transform,i=t.crop,a=i.x,s=i.y,c=t.rotation,u=t.zoom,d=t.cropShape,p=t.showGrid,m=t.style,g=m.containerStyle,f=m.cropAreaStyle,h=m.mediaStyle,v=t.classes,b=v.containerClassName,k=v.cropAreaClassName,_=v.mediaClassName,y=t.objectFit;return ka().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:g,className:eC("reactEasyCrop_Container",b)},n?ka().createElement("img",zE({alt:"",className:eC("reactEasyCrop_Image","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical","auto-cover"===y&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),_)},r,{src:n,ref:this.imageRef,style:zE(zE({},h),{transform:l||"translate(".concat(a,"px, ").concat(s,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),onLoad:this.onMediaLoad})):o&&ka().createElement("video",zE({autoPlay:!0,loop:!0,muted:!0,className:eC("reactEasyCrop_Video","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical","auto-cover"===y&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),_)},r,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:zE(zE({},h),{transform:l||"translate(".concat(a,"px, ").concat(s,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return ka().createElement("source",zE({key:e.src},e))}))),this.state.cropSize&&ka().createElement("div",{style:zE(zE({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:eC("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",k)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(ka().Component);const nC={placement:"bottom-start",variant:"toolbar"};function oC(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i,borderProps:a}=e;const{isInProgress:s,editedUrl:c,position:d,zoom:m,aspect:g,setPosition:f,setCrop:v,setZoom:b,rotation:k}=AE();let _=o||r*l/i;return k%180==90&&(_=r*i/l),(0,u.createElement)("div",{className:p()("wp-block-image__crop-area",null==a?void 0:a.className,{"is-applying":s}),style:{...null==a?void 0:a.style,width:n||r,height:_}},(0,u.createElement)(tC,{image:c||t,disabled:s,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:g,onCropChange:e=>{f(e)},onCropComplete:e=>{v(e)},onZoomChange:e=>{b(100*e)}}),s&&(0,u.createElement)(h.Spinner,null))}var rC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));function lC(){const{isInProgress:e,zoom:t,setZoom:n}=AE();return(0,u.createElement)(h.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:nC,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,u.createElement)(h.ToolbarButton,{icon:rC,label:(0,_.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,u.createElement)(h.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var iC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function aC(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:l}=e;return(0,u.createElement)(h.MenuGroup,{label:o},t.map((e=>{let{title:t,aspect:o}=e;return(0,u.createElement)(h.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===l,icon:o===l?Of:void 0},t)})))}function sC(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=AE();return(0,u.createElement)(h.DropdownMenu,{icon:iC,label:(0,_.__)("Aspect Ratio"),popoverProps:nC,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(aC,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,_.__)("Original"),aspect:l},{title:(0,_.__)("Square"),aspect:1}]}),(0,u.createElement)(aC,{label:(0,_.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,_.__)("16:10"),aspect:1.6},{title:(0,_.__)("16:9"),aspect:16/9},{title:(0,_.__)("4:3"),aspect:4/3},{title:(0,_.__)("3:2"),aspect:1.5}]}),(0,u.createElement)(aC,{label:(0,_.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,_.__)("10:16"),aspect:.625},{title:(0,_.__)("9:16"),aspect:9/16},{title:(0,_.__)("3:4"),aspect:3/4},{title:(0,_.__)("2:3"),aspect:2/3}]}))}))}var cC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function uC(){const{isInProgress:e,rotateClockwise:t}=AE();return(0,u.createElement)(h.ToolbarButton,{icon:cC,label:(0,_.__)("Rotate"),onClick:t,disabled:e})}function dC(){const{isInProgress:e,apply:t,cancel:n}=AE();return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ToolbarButton,{onClick:t,disabled:e},(0,_.__)("Apply")),(0,u.createElement)(h.ToolbarButton,{onClick:n},(0,_.__)("Cancel")))}function pC(e){let{id:t,url:n,width:o,height:r,clientWidth:l,naturalHeight:i,naturalWidth:a,onSaveImage:s,onFinishEditing:c,borderProps:d}=e;return(0,u.createElement)(OE,{id:t,url:n,naturalWidth:a,naturalHeight:i,onSaveImage:s,onFinishEditing:c},(0,u.createElement)(oC,{borderProps:d,url:n,width:o,height:r,clientWidth:l,naturalHeight:i,naturalWidth:a}),(0,u.createElement)(Vo,null,(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(lC,null),(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(sC,{toggleProps:e}))),(0,u.createElement)(uC,null)),(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(dC,null))))}const mC=[25,50,75,100],gC=()=>{};function fC(e){let{imageSizeHelp:t,imageWidth:n,imageHeight:o,imageSizeOptions:r=[],isResizable:l=!0,slug:i,width:a,height:s,onChange:c,onChangeImage:d=gC}=e;const{currentHeight:p,currentWidth:m,updateDimension:g,updateDimensions:f}=function(e,t,n,o,r){var l,i;const[a,s]=(0,u.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[c,d]=(0,u.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,u.useEffect)((()=>{void 0===t&&void 0!==o&&s(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,u.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&s(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(c)&&d(e)}),[t,e]),{currentHeight:c,currentWidth:a,updateDimension:(e,t)=>{"width"===e?s(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),s(null!=t?t:o),r({height:e,width:t})}}}(s,a,o,n,c);return(0,u.createElement)(u.Fragment,null,r&&r.length>0&&(0,u.createElement)(h.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Image size"),value:i,options:r,onChange:d,help:t}),l&&(0,u.createElement)("div",{className:"block-editor-image-size-control"},(0,u.createElement)("p",{className:"block-editor-image-size-control__row"},(0,_.__)("Image dimensions")),(0,u.createElement)("div",{className:"block-editor-image-size-control__row"},(0,u.createElement)(h.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,_.__)("Width"),value:m,min:1,onChange:e=>g("width",e)}),(0,u.createElement)(h.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,_.__)("Height"),value:p,min:1,onChange:e=>g("height",e)})),(0,u.createElement)("div",{className:"block-editor-image-size-control__row"},(0,u.createElement)(h.ButtonGroup,{"aria-label":(0,_.__)("Image size presets")},mC.map((e=>{const t=Math.round(n*(e/100)),r=Math.round(o*(e/100)),l=m===t&&p===r;return(0,u.createElement)(h.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>f(r,t)},e,"%")}))),(0,u.createElement)(h.Button,{isSmall:!0,onClick:()=>f()},(0,_.__)("Reset")))))}var hC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,u.createElement)(G.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"}));const vC=()=>{};var bC=e=>{let{value:t,onChange:n=vC,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,u.createElement)(h.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,u.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,u.createElement)(h.VisuallyHidden,{as:"legend"},(0,_.__)("Currently selected link settings")),l)},kC=n(5425),_C=n.n(kC);function yC(e){return"function"==typeof e}class EC extends u.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,u.createRef)(),this.inputRef=(0,u.createRef)(),this.updateSuggestions=(0,m.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,isUpdatingSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,_C()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||this.state.isUpdatingSuggestions||(null!=o&&o.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!(null!==(e=t)&&void 0!==e&&e.length);var l,i;if(t=t.trim(),!r&&(t.length<2||!o&&(0,lg.isURL)(t)))return null===(l=this.suggestionsRequest)||void 0===l||null===(i=l.cancel)||void 0===i||i.call(l),this.suggestionsRequest=null,void this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:t,selectedSuggestion:null,loading:!1});this.setState({isUpdatingSuggestions:!0,selectedSuggestion:null,loading:!0});const a=n(t,{isInitialSuggestions:r});a.then((e=>{this.suggestionsRequest===a&&(this.setState({suggestions:e,isUpdatingSuggestions:!1,suggestionsValue:t,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,_.sprintf)((0,_._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak((0,_.__)("No results."),"assertive"))})).catch((()=>{this.suggestionsRequest===a&&this.setState({isUpdatingSuggestions:!1,loading:!1})})),this.suggestionsRequest=a}onChange(e){this.props.onChange(e.target.value)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.state.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case Qu.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case Qu.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case Qu.ENTER:e.preventDefault(),this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Qu.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case Qu.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case Qu.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,_.__)("Link selected.")));break;case Qu.ENTER:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(l),this.props.onSubmit&&this.props.onSubmit(l,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps(e,t){let{value:n,instanceId:o,disableSuggestions:r,__experimentalShowInitialSuggestions:l=!1}=e,{showSuggestions:i}=t,a=i;const s=n&&n.length;return l||s||(a=!1),!0===r&&(a=!1),{showSuggestions:a,suggestionsListboxId:`block-editor-url-input-suggestions-${o}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${o}`}}render(){return(0,u.createElement)(u.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{__nextHasNoMarginBottom:e=!1,label:t=null,className:n,isFullWidth:o,instanceId:r,placeholder:l=(0,_.__)("Paste URL or type to search"),__experimentalRenderControl:i,value:a=""}=this.props,{loading:s,showSuggestions:d,selectedSuggestion:m,suggestionsListboxId:g,suggestionOptionIdPrefix:f}=this.state,v=`url-input-control-${r}`,b={id:v,label:t,className:p()("block-editor-url-input",n,{"is-full-width":o})},k={id:v,value:a,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:l,onKeyDown:this.onKeyDown,role:"combobox","aria-label":t?void 0:(0,_.__)("URL"),"aria-expanded":d,"aria-autocomplete":"list","aria-controls":g,"aria-activedescendant":null!==m?`${f}-${m}`:void 0,ref:this.inputRef};return i?i(b,k,s):(e||W()("Bottom margin styles for wp.blockEditor.URLInput",{since:"6.2",version:"6.5",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,u.createElement)(h.BaseControl,c({__nextHasNoMarginBottom:e},b),(0,u.createElement)("input",k),s&&(0,u.createElement)(h.Spinner,null)))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:o,suggestionsValue:r,selectedSuggestion:l,suggestionsListboxId:i,suggestionOptionIdPrefix:a,loading:s}=this.state;if(!n||0===o.length)return null;const d={id:i,ref:this.autocompleteRef,role:"listbox"},m=(e,t)=>({role:"option",tabIndex:"-1",id:`${a}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===l});return yC(t)?t({suggestions:o,selectedSuggestion:l,suggestionsListProps:d,buildSuggestionItemProps:m,isLoading:s,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!(null!=r&&r.length),currentInputValue:r}):(0,u.createElement)(h.Popover,{placement:"bottom",focusOnMount:!1},(0,u.createElement)("div",c({},d,{className:p()("block-editor-url-input__suggestions",`${e}__suggestions`)}),o.map(((e,t)=>(0,u.createElement)(h.Button,c({},m(0,t),{key:e.id,className:p()("block-editor-url-input__suggestion",{"is-selected":t===l}),onClick:()=>this.handleOnClick(e)}),e.title)))))}}var CC=(0,m.compose)(m.withSafeTimeout,h.withSpokenMessages,m.withInstanceId,(0,g.withSelect)(((e,t)=>{if(yC(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(To);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(EC);var SC=e=>{let t,{searchTerm:n,onClick:o,itemProps:r,isSelected:l,buttonText:i}=e;return n?(t=i?"function"==typeof i?i(n):i:(0,u.createInterpolateElement)((0,_.sprintf)((0,_.__)("Create: %s"),n),{mark:(0,u.createElement)("mark",null)}),(0,u.createElement)(h.Button,c({},r,{className:p()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":l}),onClick:o}),(0,u.createElement)(Jl,{className:"block-editor-link-control__search-item-icon",icon:cd}),(0,u.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,u.createElement)("span",{className:"block-editor-link-control__search-item-title"},t)))):null};var wC=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z"}));var BC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"}));var IC=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"}));var xC=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5z"}));var TC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"}));const MC={post:wC,page:by,post_tag:BC,category:IC,attachment:xC};function NC(e){let{isURL:t,suggestion:n}=e,o=null;return t?o=TC:n.type in MC&&(o=MC[n.type]),o?(0,u.createElement)(Jl,{className:"block-editor-link-control__search-item-icon",icon:o}):null}var PC=e=>{let{itemProps:t,suggestion:n,isSelected:o=!1,onClick:r,isURL:l=!1,searchTerm:i="",shouldShowType:a=!1}=e;return(0,u.createElement)(h.Button,c({},t,{onClick:r,className:p()("block-editor-link-control__search-item",{"is-selected":o,"is-url":l,"is-entity":!l})}),(0,u.createElement)(NC,{suggestion:n,isURL:l}),(0,u.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,u.createElement)("span",{className:"block-editor-link-control__search-item-title"},(0,u.createElement)(h.TextHighlight,{text:n.title,highlight:i})),(0,u.createElement)("span",{"aria-hidden":!l,className:"block-editor-link-control__search-item-info"},!l&&((0,lg.filterURLForDisplay)((0,lg.safeDecodeURI)(n.url))||""),l&&(0,_.__)("Press ENTER to add this link"))),a&&n.type&&(0,u.createElement)("span",{className:"block-editor-link-control__search-item-type"},function(e){if(e.isFrontPage)return"front page";return"post_tag"===e.type?"tag":e.type}(n)))};const LC="__CREATE__",RC="mailto",AC="internal",OC=["URL",RC,"tel",AC],DC=[{id:"opensInNewTab",title:(0,_.__)("Open in new tab")}];function zC(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:l,buildSuggestionItemProps:i,suggestions:a,selectedSuggestion:s,isLoading:d,isInitialSuggestions:m,createSuggestionButtonText:g,suggestionsQuery:f}=e;const v=p()("block-editor-link-control__search-results",{"is-loading":d}),b=1===a.length&&OC.includes(a[0].type),k=n&&!b&&!m,y=!(null!=f&&f.type),E=`block-editor-link-control-search-results-label-${t}`,C=m?(0,_.__)("Recently updated"):(0,_.sprintf)((0,_.__)('Search results for "%s"'),o),S=(0,u.createElement)(m?u.Fragment:h.VisuallyHidden,{},(0,u.createElement)("span",{className:"block-editor-link-control__search-results-label",id:E},C));return(0,u.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},S,(0,u.createElement)("div",c({},l,{className:v,"aria-labelledby":E}),a.map(((e,t)=>k&&LC===e.type?(0,u.createElement)(SC,{searchTerm:o,buttonText:g,onClick:()=>r(e),key:e.type,itemProps:i(e,t),isSelected:t===s}):LC===e.type?null:(0,u.createElement)(PC,{key:`${e.id}-${e.type}`,itemProps:i(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===s,isURL:OC.includes(e.type),searchTerm:o,shouldShowType:y,isFrontPage:null==e?void 0:e.isFrontPage})))))}function FC(e){const t=null==e?void 0:e.startsWith("#");return(0,lg.isURL)(e)||e&&e.includes("www.")||t}const VC=()=>Promise.resolve([]),HC=e=>{let t="URL";const n=(0,lg.getProtocol)(e)||"";return n.includes("mailto")&&(t=RC),n.includes("tel")&&(t="tel"),null!=e&&e.startsWith("#")&&(t=AC),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,lg.prependHTTP)(e):e,type:t}])};function GC(e,t,n,o){const{fetchSearchSuggestions:r,pageOnFront:l}=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?HC:VC;return(0,u.useCallback)(((t,a)=>{let{isInitialSuggestions:s}=a;return FC(t)?i(t,{isInitialSuggestions:s}):(async(e,t,n,o,r,l,i)=>{const{isInitialSuggestions:a}=t;let s=!1,c=await Promise.all([n(e,t),o(e)]);c[0]=c[0].map((e=>Number(e.id)===i?(s=!0,e.isFrontPage=!0,e):e));const u=!e.includes(" ");return c=!s&&u&&l&&!a?c[0].concat(c[1]):c[0],a||FC(e)||!r?c:c.concat({title:e,url:e,type:LC})})(t,{...e,isInitialSuggestions:s},r,i,n,o,l)}),[i,r,n])}const UC=()=>Promise.resolve([]),$C=()=>{},jC=(0,u.forwardRef)(((e,t)=>{let{value:n,children:o,currentLink:r={},className:l=null,placeholder:i=null,withCreateSuggestion:a=!1,onCreateSuggestion:s=$C,onChange:c=$C,onSelect:d=$C,showSuggestions:g=!0,renderSuggestions:f=(e=>(0,u.createElement)(zC,e)),fetchSuggestions:h=null,allowDirectEntry:v=!0,showInitialSuggestions:b=!1,suggestionsQuery:k={},withURLSuggestion:y=!0,createSuggestionButtonText:E,useLabel:C=!1}=e;const S=GC(k,v,a,y),w=g?h||S:UC,B=(0,m.useInstanceId)(jC),[I,x]=(0,u.useState)(),T=async e=>{let t=e;if(LC!==e.type){if(v||t&&Object.keys(t).length>=1){const{id:e,url:n,...o}=null!=r?r:{};d({...o,...t},t)}}else try{var n;t=await s(e.title),null!==(n=t)&&void 0!==n&&n.url&&d(t)}catch(e){}},M=p()(l,{"has-no-label":!C});return(0,u.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,u.createElement)(CC,{__nextHasNoMarginBottom:!0,label:C?"URL":void 0,className:M,value:n,onChange:(e,t)=>{c(e),x(t)},placeholder:null!=i?i:(0,_.__)("Search or type url"),__experimentalRenderSuggestions:g?e=>f({...e,instanceId:B,withCreateSuggestion:a,createSuggestionButtonText:E,suggestionsQuery:k,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),T(t)}}):null,__experimentalFetchLinkSuggestions:w,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:b,onSubmit:(e,t)=>{var o;const r=e||I;r||null!=n&&null!==(o=n.trim())&&void 0!==o&&o.length?T(r||{url:n}):t.preventDefault()},ref:t}),o)}));var WC=jC;var KC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));var qC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));const{Slot:YC,Fill:ZC}=(0,h.createSlotFill)("BlockEditorLinkControlViewer");function QC(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}var XC=function(e){const[t,n]=(0,u.useReducer)(QC,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,u.useEffect)((()=>{if(null!=e&&e.length&&o&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,r=t.signal;return o(e,{signal:r}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{r.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t};function JC(e){var t;let{value:n,onEditClick:o,hasRichPreviews:r=!1,hasUnlinkControl:l=!1,onRemove:i}=e;const a=r?null==n?void 0:n.url:null,{richData:s,isFetching:c}=XC(a),d=s&&Object.keys(s).length,m=n&&(0,lg.filterURLForDisplay)((0,lg.safeDecodeURI)(n.url),16)||"",g=(null==s?void 0:s.title)||(null==n?void 0:n.title)||m,f=!(null!=n&&null!==(t=n.url)&&void 0!==t&&t.length);let v;return v=null!=s&&s.icon?(0,u.createElement)("img",{src:null==s?void 0:s.icon,alt:""}):f?(0,u.createElement)(Jl,{icon:KC,size:32}):(0,u.createElement)(Jl,{icon:TC}),(0,u.createElement)("div",{"aria-label":(0,_.__)("Currently selected"),className:p()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":d,"is-fetching":!!c,"is-preview":!0,"is-error":f})},(0,u.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,u.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,u.createElement)("span",{className:p()("block-editor-link-control__search-item-icon",{"is-image":null==s?void 0:s.icon})},v),(0,u.createElement)("span",{className:"block-editor-link-control__search-item-details"},f?(0,u.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,_.__)("Link is empty")):(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ExternalLink,{className:"block-editor-link-control__search-item-title",href:n.url},(0,Ri.__unstableStripHTML)(g)),(null==n?void 0:n.url)&&(0,u.createElement)("span",{className:"block-editor-link-control__search-item-info"},m)))),(0,u.createElement)(h.Button,{icon:qC,label:(0,_.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:o,iconSize:24}),l&&(0,u.createElement)(h.Button,{icon:Cr,label:(0,_.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:i,iconSize:24}),(0,u.createElement)(YC,{fillProps:n})),!!(d&&(null!=s&&s.image||null!=s&&s.description)||c)&&(0,u.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==s?void 0:s.image)||c)&&(0,u.createElement)("div",{"aria-hidden":!(null!=s&&s.image),className:p()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=s&&s.image)})},(null==s?void 0:s.image)&&(0,u.createElement)("img",{src:null==s?void 0:s.image,alt:""})),((null==s?void 0:s.description)||c)&&(0,u.createElement)("div",{"aria-hidden":!(null!=s&&s.description),className:p()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=s&&s.description)})},(null==s?void 0:s.description)&&(0,u.createElement)(h.__experimentalText,{truncate:!0,numberOfLines:"2"},s.description))))}const eS=e=>{let t=!1;return{promise:new Promise(((n,o)=>{e.then((e=>t?o({isCanceled:!0}):n(e)),(e=>o(t?{isCanceled:!0}:e)))})),cancel(){t=!0}}};function tS(e){const[t,n]=(0,u.useState)(e||"");return(0,u.useEffect)((()=>{e&&e!==t&&n(e)}),[e]),[t,n]}const nS=()=>{};function oS(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=DC,onChange:a=nS,onRemove:s,noDirectEntry:c=!1,showSuggestions:d=!0,showInitialSuggestions:m,forceIsEditingLink:g,createSuggestion:f,withCreateSuggestion:v,inputValue:b="",suggestionsQuery:k={},noURLSuggestion:y=!1,createSuggestionButtonText:E,hasRichPreviews:C=!1,hasTextControl:S=!1,renderControlBottom:w=null}=e;void 0===v&&f&&(v=!0);const B=(0,u.useRef)(!0),I=(0,u.useRef)(),x=(0,u.useRef)(),T=(0,u.useRef)(!1),[M,N]=tS((null==l?void 0:l.url)||""),[P,L]=tS((null==l?void 0:l.title)||""),[R,A]=(0,u.useState)(void 0!==g?g:!l||!l.url),{createPage:O,isCreatingPage:D,errorMessage:z}=function(e){const t=(0,u.useRef)(),[n,o]=(0,u.useState)(!1),[r,l]=(0,u.useState)(null);return(0,u.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),l(null);try{return t.current=eS(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,_.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(f);(0,u.useEffect)((()=>{void 0!==g&&g!==R&&A(g)}),[g]),(0,u.useEffect)((()=>{if(B.current)return void(B.current=!1);const e=null!=x&&x.current?1:0;(Ri.focus.focusable.find(I.current)[e]||I.current).focus(),T.current=!1}),[R,D]);const F=()=>{var e;T.current=!(null===(e=I.current)||void 0===e||!e.contains(I.current.ownerDocument.activeElement)),A(!1)},V=()=>{H===(null==l?void 0:l.url)&&P===(null==l?void 0:l.title)||a({...l,url:H,title:P}),F()},H=b||M,G=!(null!=H&&null!==(t=H.trim())&&void 0!==t&&t.length),U=s&&l&&!R&&!D,$=!(null==i||!i.length),j=(null==l||null===(n=l.url)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.length)>0&&S;return(0,u.createElement)("div",{tabIndex:-1,ref:I,className:"block-editor-link-control"},D&&(0,u.createElement)("div",{className:"block-editor-link-control__loading"},(0,u.createElement)(h.Spinner,null)," ",(0,_.__)("Creating"),"…"),(R||!l)&&!D&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:p()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":j})},j&&(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,ref:x,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:P,onChange:L,onKeyDown:e=>{const{keyCode:t}=e;t!==Qu.ENTER||G||(e.preventDefault(),V())}}),(0,u.createElement)(WC,{currentLink:l,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:H,withCreateSuggestion:v,onCreateSuggestion:O,onChange:N,onSelect:e=>{a({...e,title:P||(null==e?void 0:e.title)}),F()},showInitialSuggestions:m,allowDirectEntry:!c,showSuggestions:d,suggestionsQuery:k,withURLSuggestion:!y,createSuggestionButtonText:E,useLabel:j},(0,u.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,u.createElement)(h.Button,{onClick:V,label:(0,_.__)("Submit"),icon:hC,className:"block-editor-link-control__search-submit",disabled:G})))),z&&(0,u.createElement)(h.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},z)),l&&!R&&!D&&(0,u.createElement)(JC,{key:null==l?void 0:l.url,value:l,onEditClick:()=>A(!0),hasRichPreviews:C,hasUnlinkControl:U,onRemove:s}),$&&(0,u.createElement)("div",{className:"block-editor-link-control__tools"},(0,u.createElement)(bC,{value:l,settings:i,onChange:a})),w&&w())}oS.ViewerFill=ZC;var rS=oS;var lS=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"}));var iS=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"}));var aS=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"}));const sS=()=>{};let cS=0;var uS=(0,m.compose)([(0,g.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(hm.store);return{createNotice:t,removeNotice:n}})),(0,h.withFilters)("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,mediaIds:o,allowedTypes:r,accept:l,onError:i,onSelect:a,onSelectURL:s,onToggleFeaturedImage:c,useFeaturedImage:d,onFilesUpload:p=sS,name:m=(0,_.__)("Replace"),createNotice:f,removeNotice:v,children:b,multiple:k=!1,addToGallery:y,handleUpload:E=!0}=e;const C=(0,g.useSelect)((e=>e(To).getSettings().mediaUpload),[]),S=(0,u.useRef)(),w="block-editor/media-replace-flow/error-notice/"+ ++cS,B=e=>{const t=(0,Ri.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{f("error",t,{speak:!0,id:w,isDismissible:!0})}),1e3)},I=(e,t)=>{d&&c&&c(),t(),a(e),(0,pn.speak)((0,_.__)("The media file has been replaced")),v(w)},x=e=>{e.keyCode===Qu.DOWN&&(e.preventDefault(),e.target.click())},T=k&&!(!r||0===r.length)&&r.every((e=>"image"===e||e.startsWith("image/")));return(0,u.createElement)(h.Dropdown,{popoverProps:{variant:"toolbar"},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,u.createElement)(h.ToolbarButton,{ref:S,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:x},m)},renderContent:e=>{let{onClose:i}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Sg,{gallery:T,addToGallery:y,multiple:k,value:k?o:n,onSelect:e=>I(e,i),allowedTypes:r,render:e=>{let{open:t}=e;return(0,u.createElement)(h.MenuItem,{icon:lS,onClick:t},(0,_.__)("Open Media Library"))}}),(0,u.createElement)(Cg,null,(0,u.createElement)(h.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!E)return t(),a(n);p(n),C({allowedTypes:r,filesList:n,onFileChange:e=>{let[n]=e;I(n,t)},onError:B})})(e,i)},accept:l,multiple:k,render:e=>{let{openFileDialog:t}=e;return(0,u.createElement)(h.MenuItem,{icon:iS,onClick:()=>{t()}},(0,_.__)("Upload"))}}))),c&&(0,u.createElement)(h.MenuItem,{icon:aS,onClick:c,isPressed:d},(0,_.__)("Use featured image")),b),s&&(0,u.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,u.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,_.__)("Current media URL:")),(0,u.createElement)(h.Tooltip,{text:t,position:"bottom"},(0,u.createElement)("div",null,(0,u.createElement)(rS,{value:{url:t},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;s(t),S.current.focus()}})))))}})}));function dS(e){let{url:t,urlLabel:n,className:o}=e;const r=p()(o,"block-editor-url-popover__link-viewer-url");return t?(0,u.createElement)(h.ExternalLink,{className:r,href:t},n||(0,lg.filterURLForDisplay)((0,lg.safeDecodeURI)(t))):(0,u.createElement)("span",{className:r})}const{__experimentalPopoverLegacyPositionToPlacement:pS}=Io(h.privateApis);function mS(e){let t,{additionalControls:n,children:o,renderSettings:r,placement:l,focusOnMount:i="firstElement",position:a,...s}=e;void 0!==a&&W()("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"}),void 0!==l?t=l:void 0!==a&&(t=pS(a)),t=t||"bottom";const[d,p]=(0,u.useState)(!1),m=!!r&&d;return(0,u.createElement)(h.Popover,c({className:"block-editor-url-popover",focusOnMount:i,placement:t,shift:!0},s),(0,u.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,u.createElement)("div",{className:"block-editor-url-popover__row"},o,!!r&&(0,u.createElement)(h.Button,{className:"block-editor-url-popover__settings-toggle",icon:df,label:(0,_.__)("Link settings"),onClick:()=>{p(!d)},"aria-expanded":d})),m&&(0,u.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},r())),n&&!m&&(0,u.createElement)("div",{className:"block-editor-url-popover__additional-controls"},n))}mS.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:o,value:r,...l}=e;return(0,u.createElement)("form",c({className:p()("block-editor-url-popover__link-editor",n)},l),(0,u.createElement)(CC,{__nextHasNoMarginBottom:!0,value:r,onChange:o,autocompleteRef:t}),(0,u.createElement)(h.Button,{icon:hC,label:(0,_.__)("Apply"),type:"submit"}))},mS.LinkViewer=function(e){let{className:t,linkClassName:n,onEditLinkClick:o,url:r,urlLabel:l,...i}=e;return(0,u.createElement)("div",c({className:p()("block-editor-url-popover__link-viewer",t)},i),(0,u.createElement)(dS,{url:r,urlLabel:l,className:n}),o&&(0,u.createElement)(h.Button,{icon:qC,label:(0,_.__)("Edit"),onClick:o}))};var gS=mS;const fS=()=>{},hS=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,u.createElement)(gS,{onClose:r},(0,u.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o},(0,u.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,_.__)("URL"),placeholder:(0,_.__)("Paste or type URL"),onChange:n,value:t}),(0,u.createElement)(h.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:hC,label:(0,_.__)("Apply"),type:"submit"})))};var vS=(0,h.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:l={},mediaPreview:i,notices:a,isAppender:s,accept:c,addToGallery:d,multiple:m=!1,handleUpload:f=!0,disableDropZone:v,disableMediaButtons:b,onError:k,onSelect:y,onCancel:E,onSelectURL:C,onToggleFeaturedImage:S,onDoubleClick:w,onFilesPreUpload:B=fS,onHTMLDrop:I=fS,children:x,mediaLibraryButton:T,placeholder:M,style:N}=e;const P=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return t().mediaUpload}),[]),[L,R]=(0,u.useState)(""),[A,O]=(0,u.useState)(!1);(0,u.useEffect)((()=>{var e;R(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const D=e=>{R(e.target.value)},z=()=>{O(!0)},F=()=>{O(!1)},V=e=>{e.preventDefault(),L&&C&&(C(L),F())},H=e=>{if(!f)return y(e);let o;if(B(e),m)if(d){let e=[];o=n=>{const o=(null!=t?t:[]).filter((t=>t.id?!e.some((e=>{let{id:n}=e;return Number(n)===Number(t.id)})):!e.some((e=>{let{urlSlug:n}=e;return t.url.includes(n)}))));y(o.concat(n)),e=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else o=y;else o=e=>{let[t]=e;return y(t)};P({allowedTypes:n,filesList:e,onFileChange:o,onError:k})},G=e=>{H(e.target.files)},U=null!=M?M:e=>{let{instructions:t,title:c}=l;if(P||C||(t=(0,_.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===c){const e=null!=n?n:[],[o]=e,r=1===e.length,l=r&&"audio"===o,i=r&&"image"===o,a=r&&"video"===o;void 0===t&&P&&(t=(0,_.__)("Upload a media file or pick one from your media library."),l?t=(0,_.__)("Upload an audio file, pick one from your media library, or add one with a URL."):i?t=(0,_.__)("Upload an image file, pick one from your media library, or add one with a URL."):a&&(t=(0,_.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===c&&(c=(0,_.__)("Media"),l?c=(0,_.__)("Audio"):i?c=(0,_.__)("Image"):a&&(c=(0,_.__)("Video")))}const d=p()("block-editor-media-placeholder",o,{"is-appender":s});return(0,u.createElement)(h.Placeholder,{icon:r,label:c,instructions:t,className:d,notices:a,onDoubleClick:w,preview:i,style:N},e,x)},$=()=>v?null:(0,u.createElement)(h.DropZone,{onFilesDrop:H,onHTMLDrop:I}),j=()=>E&&(0,u.createElement)(h.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,_.__)("Cancel"),variant:"link",onClick:E},(0,_.__)("Cancel")),W=()=>C&&(0,u.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,u.createElement)(h.Button,{className:"block-editor-media-placeholder__button",onClick:z,isPressed:A,variant:"tertiary"},(0,_.__)("Insert from URL")),A&&(0,u.createElement)(hS,{src:L,onChange:D,onSubmit:V,onClose:F})),K=()=>S&&(0,u.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,u.createElement)(h.Button,{className:"block-editor-media-placeholder__button",onClick:S,variant:"tertiary"},(0,_.__)("Use featured image")));return b?(0,u.createElement)(Cg,null,$()):(0,u.createElement)(Cg,{fallback:U(W())},(()=>{const e=null!=T?T:e=>{let{open:t}=e;return(0,u.createElement)(h.Button,{variant:"tertiary",onClick:()=>{t()}},(0,_.__)("Media Library"))},o=(0,u.createElement)(Sg,{addToGallery:d,gallery:m&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:m,onSelect:y,allowedTypes:n,mode:"browse",value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(P&&s)return(0,u.createElement)(u.Fragment,null,$(),(0,u.createElement)(h.FormFileUpload,{onChange:G,accept:c,multiple:m,render:e=>{let{openFileDialog:t}=e;const n=(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Button,{variant:"primary",className:p()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,_.__)("Upload")),o,W(),K(),j());return U(n)}}));if(P){const e=(0,u.createElement)(u.Fragment,null,$(),(0,u.createElement)(h.FormFileUpload,{variant:"primary",className:p()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:G,accept:c,multiple:m},(0,_.__)("Upload")),o,W(),K(),j());return U(e)}return U(o)})())}));var bS=e=>{let{colorSettings:t,...n}=e;const o=t.map((e=>{if(!e)return e;const{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}}));return(0,u.createElement)(LE,c({settings:o,gradients:[],disableCustomGradients:!0},n))};const kS={position:"bottom right",variant:"toolbar"};var _S=()=>(0,u.createElement)(u.Fragment,null,["bold","italic","link","unknown"].map((e=>(0,u.createElement)(h.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,u.createElement)(h.Slot,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((e=>{let[{props:t}]=e;return t})).some((e=>{let{isActive:t}=e;return t}));return(0,u.createElement)(h.ToolbarItem,null,(n=>(0,u.createElement)(h.DropdownMenu,{icon:df,label:(0,_.__)("More"),toggleProps:{...n,className:p()(n.className,{"is-pressed":t}),describedBy:(0,_.__)("Displays more block tools")},controls:Y(e.map((e=>{let[{props:t}]=e;return t})),"title"),popoverProps:kS})))})));function yS(e){let{value:t,editableContentElement:n,activeFormats:o}=e;const r=o[o.length-1],l=null==r?void 0:r.type,i=(0,g.useSelect)((e=>e($.store).getFormatType(l)),[l]),a=(0,$.useAnchor)({editableContentElement:n,value:t,settings:i});return(0,u.createElement)(ES,{popoverAnchor:a})}function ES(e){let{popoverAnchor:t}=e;return(0,u.createElement)(h.Popover,{placement:"top",focusOnMount:!1,anchor:t,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,u.createElement)(Cf,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,_.__)("Format tools")},(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(_S,null))))}var CS=e=>{let{inline:t,editableContentElement:n,value:o}=e;const r=(0,g.useSelect)((e=>e(To).getSettings().hasInlineToolbar),[]);if(t)return(0,u.createElement)(ES,{popoverAnchor:n});if(r){const e=(0,$.getActiveFormats)(o);return(0,$.isCollapsed)(o)&&!e.length?null:(0,u.createElement)(yS,{editableContentElement:n,value:o,activeFormats:e})}return(0,u.createElement)(Vo,{group:"inline"},(0,u.createElement)(_S,null))};function SS(){const{didAutomaticChange:e,getSettings:t}=(0,g.useSelect)(To);return(0,m.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;if(n.defaultPrevented)return;if(o!==Qu.DELETE&&o!==Qu.BACKSPACE&&o!==Qu.ESCAPE)return;const{__experimentalUndo:r}=t();r&&e()&&(n.preventDefault(),r())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}var wS=window.wp.shortcode;function BS(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function IS(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function xS(e){let{allowedFormats:t,disableFormats:n}=e;return n?xS.EMPTY_ARRAY:t}xS.EMPTY_ARRAY=[];function TS(e){let{value:t,pastedBlocks:n=[],onReplace:o,onSplit:r,onSplitMiddle:l,multilineTag:i}=e;if(!o||!r)return;const{start:a=0,end:s=0}=t,c={...t,start:a,end:s},u=[],[d,p]=(0,$.split)(c),m=n.length>0;let g=-1;const f=(0,$.isEmpty)(d)&&!(0,$.isEmpty)(p);m&&(0,$.isEmpty)(d)||(u.push(r((0,$.toHTMLString)({value:d,multilineTag:i}),!f)),g+=1),m?(u.push(...n),g+=n.length):l&&u.push(l()),(m||l)&&(0,$.isEmpty)(p)||u.push(r((0,$.toHTMLString)({value:p,multilineTag:i}),f));o(u,m?g:1,m?-1:0)}function MS(e,t){return t?(0,$.replace)(e,/\n+/g,$.__UNSTABLE_LINE_SEPARATOR):(0,$.replace)(e,new RegExp($.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function NS(e){const t=(0,u.useRef)(e);return t.current=e,(0,m.useRefEffect)((e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:r,value:l,formatTypes:i,tagName:s,onReplace:c,onSplit:u,onSplitMiddle:d,__unstableEmbedURLOnPaste:p,multilineTag:m,preserveWhiteSpace:g,pastePlainText:f}=t.current;if(!n)return;const{clipboardData:h}=e;let v="",b="";try{v=h.getData("text/plain"),b=h.getData("text/html")}catch(e){try{b=h.getData("Text")}catch(e){return}}if(b=function(e){const t="\x3c!--StartFragment--\x3e",n=e.indexOf(t);if(!(n>-1))return e;e=e.substring(n+t.length);const o="\x3c!--EndFragment--\x3e",r=e.indexOf(o);r>-1&&(e=e.substring(0,r));return e}(b),b=function(e){const t="";if(e.startsWith(t))return e.slice(t.length);return e}(b),e.preventDefault(),window.console.log("Received HTML:\n\n",b),window.console.log("Received plain text:\n\n",v),o)return void r((0,$.insert)(l,v));const k=i.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===l&&(e=n(l,{html:b,plainText:v})),e}),l);if(k!==l)return void r(k);const _=[...(0,Ri.getFilesFromDataTransfer)(h)];if("true"===h.getData("rich-text")){const e=h.getData("rich-text-multi-line-tag")||void 0;let t=(0,$.create)({html:b,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:g});return t=MS(t,!!m),BS(t,l.activeFormats),void r((0,$.insert)(l,t))}if(f)return void r((0,$.insert)(l,(0,$.create)({text:v})));if(null!=_&&_.length&&window.console.log("Received items:\n\n",_),null!=_&&_.length&&!oh(_,b)){const e=(0,a.getBlockTransforms)("from"),t=_.reduce(((t,n)=>{const o=(0,a.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat();if(!t.length)return;return void(c&&(0,$.isEmpty)(l)?c(t):TS({value:l,pastedBlocks:t,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}let y=c&&u?"AUTO":"INLINE";var E;"AUTO"===y&&(0,$.isEmpty)(l)&&(E=v,(0,wS.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,$.isEmpty)(l)&&(0,lg.isURL)(v.trim())&&(y="BLOCKS");const C=(0,a.pasteHandler)({HTML:b,plainText:v,mode:y,tagName:s,preserveWhiteSpace:g});if("string"==typeof C){let e=(0,$.create)({html:C});e=MS(e,!!m),BS(e,l.activeFormats),r((0,$.insert)(l,e))}else C.length>0&&(c&&(0,$.isEmpty)(l)?c(C,C.length-1,-1):TS({value:l,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}const PS=["`",'"',"'","“”","‘’"];function LS(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,g.useDispatch)(To),o=(0,u.useRef)(e);return o.current=e,(0,m.useRefEffect)((e=>{function r(r){const{inputType:l,data:i}=r,{value:a,onChange:c}=o.current;if("insertText"!==l)return;if((0,$.isCollapsed)(a))return;const u=(0,s.applyFilters)("blockEditor.wrapSelectionSettings",PS).find((e=>{let[t,n]=e;return t===i||n===i}));if(!u)return;const[d,p=d]=u,m=a.start,g=a.end+d.length;let f=(0,$.insert)(a,d,m,m);f=(0,$.insert)(f,p,g,g),t(),c(f),n();const h={};for(const e in r)h[e]=r[e];h.data=p;const{ownerDocument:v}=e,{defaultView:b}=v,k=new b.InputEvent("input",h);window.queueMicrotask((()=>{r.target.dispatchEvent(k)})),r.preventDefault()}return e.addEventListener("beforeinput",r),()=>{e.removeEventListener("beforeinput",r)}}),[])}function RS(e){let t=e.length;for(;t--;){const n=gn(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].replace(mn,""),e[t].clientId;const o=RS(e[t].innerBlocks);if(o)return o}}function AS(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,g.useDispatch)(To),o=(0,u.useRef)(e);return o.current=e,(0,m.useRefEffect)((e=>{function r(){const{getValue:e,onReplace:t,selectionChange:r}=o.current;if(!t)return;const l=e(),{start:i,text:s}=l;if(" "!==s.slice(i-1,i))return;const c=s.slice(0,i).trim(),u=(0,a.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"prefix"===t})),d=(0,a.findTransform)(u,(e=>{let{prefix:t}=e;return c===t}));if(!d)return;const p=(0,$.toHTMLString)({value:(0,$.insert)(l,mn,0,i)}),m=d.transform(p);r(RS([m])),t([m]),n()}function l(e){const{inputType:l,type:i}=e,{getValue:a,onChange:s,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==l&&"compositionend"!==i)return;c&&r&&r();const d=a(),p=u.reduce(((e,t)=>{let{__unstableInputRule:n}=t;return n&&(e=n(e)),e}),function(e){const t="tales of gutenberg",{start:n,text:o}=e;return n{e.removeEventListener("input",l),e.removeEventListener("compositionend",l)}}),[])}function OS(e){const{__unstableMarkAutomaticChange:t}=(0,g.useDispatch)(To),n=(0,u.useRef)(e);return n.current=e,(0,m.useRefEffect)((e=>{function o(e){if(e.defaultPrevented)return;if(e.keyCode!==Qu.ENTER)return;const{removeEditorOnlyFormats:o,value:r,onReplace:l,onSplit:i,onSplitMiddle:s,multilineTag:c,onChange:u,disableLineBreaks:d,onSplitAtEnd:p}=n.current;e.preventDefault();const m={...r};m.formats=o(r);const g=l&&i;if(l){const e=(0,a.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"enter"===t})),n=(0,a.findTransform)(e,(e=>e.regExp.test(m.text)));n&&(l([n.transform({content:m.text})]),t())}if(c)e.shiftKey?d||u((0,$.insert)(m,"\n")):g&&(0,$.__unstableIsEmptyLine)(m)?TS({value:m,onReplace:l,onSplit:i,onSplitMiddle:s,multilineTag:c}):u((0,$.__unstableInsertLineSeparator)(m));else{const{text:t,start:n,end:o}=m,r=p&&n===o&&o===t.length;e.shiftKey||!g&&!r?d||u((0,$.insert)(m,"\n")):!g&&r?p():g&&TS({value:m,onReplace:l,onSplit:i,onSplitMiddle:s,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function DS(e){return e($.store).getFormatTypes()}const zS=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function FS(e,t){return e[t]?e[t]:Object.keys(e).filter((e=>e.startsWith(t+"."))).reduce(((n,o)=>(n[o.slice(t.length+1)]=e[o],n)),{})}function VS(e){return(0,m.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function HS(e){return(0,m.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function GS(){const{__unstableMarkLastChangeAsPersistent:e}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((t=>{function n(t){"insertReplacementText"===t.inputType&&e()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}}),[])}function US(){const{isMultiSelecting:e}=(0,g.useSelect)(To);return(0,m.useRefEffect)((t=>{function n(){if(!e())return;const n=t.parentElement.closest('[contenteditable="true"]');n&&n.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}),[])}function $S(e){let{formatTypes:t,onChange:n,onFocus:o,value:r,forwardedRef:l}=e;return t.map((e=>{const{name:t,edit:i}=e;if(!i)return null;const a=(0,$.getActiveFormat)(r,t);let s=void 0!==a;const c=(0,$.getActiveObject)(r),d=void 0!==c&&c.type===t;if("core/link"===t&&!(0,$.isCollapsed)(r)){var p,m;const e=r.formats,t=null===(p=e[r.start])||void 0===p?void 0:p.find((e=>{let{type:t}=e;return"core/link"===t})),n=null===(m=e[r.end-1])||void 0===m?void 0:m.find((e=>{let{type:t}=e;return"core/link"===t}));t&&n&&t===n||(s=!1)}return(0,u.createElement)(i,{key:t,isActive:s,activeAttributes:s&&a.attributes||{},isObjectActive:d,activeObjectAttributes:d&&c.attributes||{},value:r,onChange:n,onFocus:o,contentRef:l})}))}const jS=(0,u.createContext)(),WS=(0,u.createContext)();const KS=(0,u.forwardRef)((function e(t,n){let{children:o,tagName:r="div",value:l="",onChange:i,isSelected:s,multiline:d,inlineToolbar:f,wrapperClassName:v,autocompleters:b,onReplace:k,placeholder:_,allowedFormats:y,withoutInteractiveFormatting:E,onRemove:C,onMerge:S,onSplit:w,__unstableOnSplitAtEnd:B,__unstableOnSplitMiddle:I,identifier:x,preserveWhiteSpace:T,__unstablePastePlainText:M,__unstableEmbedURLOnPaste:N,__unstableDisableFormats:P,disableLineBreaks:L,unstableOnFocus:R,__unstableAllowPrefixTransformations:A,...O}=t;d&&W()("wp.blockEditor.RichText multiline prop",{since:"6.1",version:"6.3",alternative:"nested blocks (InnerBlocks)",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"});const D=(0,m.useInstanceId)(e);x=x||D,O=function(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:o,textAlign:r,selectionColor:l,tagsToEliminate:i,rootTagsToEliminate:a,disableEditingMenu:s,fontSize:c,fontFamily:u,fontWeight:d,fontStyle:p,minWidth:m,maxWidth:g,setRef:f,disableSuggestions:h,disableAutocorrection:v,...b}=e;return b}(O);const z=(0,u.useRef)(),{clientId:F}=Ro(),{selectionStart:V,selectionEnd:H,isSelected:G}=(0,g.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n}=e(To),o=t(),r=n();let l;return void 0===s?l=o.clientId===F&&r.clientId===F&&o.attributeKey===x:s&&(l=o.clientId===F),{selectionStart:l?o.offset:void 0,selectionEnd:l?r.offset:void 0,isSelected:l}})),{getSelectionStart:U,getSelectionEnd:j,getBlockRootClientId:K}=(0,g.useSelect)(To),{selectionChange:q}=(0,g.useDispatch)(To),Y=IS(d),Z=xS({allowedFormats:y,disableFormats:P}),Q=!Z||Z.length>0;let X=l,J=i;Array.isArray(l)&&(W()("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),X=a.children.toHTML(l),J=e=>i(a.children.fromDOM((0,$.__unstableCreateElement)(document,e).childNodes)));const ee=(0,u.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t;if("number"==typeof e||o){if(void 0===t&&K(F)!==K(j().clientId))return;n.start={clientId:F,attributeKey:x,offset:e}}if("number"==typeof t||o){if(void 0===e&&K(F)!==K(U().clientId))return;n.end={clientId:F,attributeKey:x,offset:t}}q(n)}),[F,x]),{formatTypes:te,prepareHandlers:ne,valueHandlers:oe,changeHandlers:re,dependencies:le}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:o,allowedFormats:r}=e;const l=(0,g.useSelect)(DS,[]),i=(0,u.useMemo)((()=>l.filter((e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t)||o&&zS.has(n))}))),[l,r,zS]),a=(0,g.useSelect)((e=>i.reduce(((o,r)=>{return r.__experimentalGetPropsForEditableTreePreparation?{...o,...(l=r.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t}),i=r.name,"object"!=typeof l?{[i]:l}:Object.fromEntries(Object.entries(l).map((e=>{let[t,n]=e;return[`${i}.${t}`,n]}))))}:o;var l,i}),{})),[i,t,n]),s=(0,g.useDispatch)(),c=[],d=[],p=[],m=[];for(const e in a)m.push(a[e]);return i.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const o=e.__experimentalCreatePrepareEditableTree(FS(a,e.name),{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(o):c.push(o)}if(e.__experimentalCreateOnChangeEditableValue){let o={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(o=e.__experimentalGetPropsForEditableTreeChangeHandler(s,{richTextIdentifier:n,blockClientId:t}));const r=FS(a,e.name);p.push(e.__experimentalCreateOnChangeEditableValue({..."object"==typeof r?r:{},...o},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:i,prepareHandlers:c,valueHandlers:d,changeHandlers:p,dependencies:m}}({clientId:F,identifier:x,withoutInteractiveFormatting:E,allowedFormats:Z});function ie(e){return te.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,$.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:ae,getValue:se,onChange:ce,ref:ue}=(0,$.__unstableUseRichText)({value:X,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;J(e),Object.values(re).forEach((e=>{e(n,o)}))},selectionStart:V,selectionEnd:H,onSelectionChange:ee,placeholder:_,__unstableIsSelected:G,__unstableMultilineTag:Y,__unstableDisableFormats:P,preserveWhiteSpace:T,__unstableDependencies:[...le,r],__unstableAfterParse:function(e){return oe.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:ie,__unstableAddInvisibleFormats:function(e){return ne.reduce(((t,n)=>n(t,e.text)),e.formats)}}),de=function(e){return(0,h.__unstableUseAutocompleteProps)({...e,completers:Ey(e)})}({onReplace:k,completers:b,record:ae,onChange:ce});!function(e){let{html:t,value:n}=e;const o=(0,u.useRef)(),r=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:l}=(0,g.useDispatch)(To);(0,u.useLayoutEffect)((()=>{if(o.current){if(o.current!==n.text){const e=window.setTimeout((()=>{l()}),1e3);return o.current=n.text,()=>{window.clearTimeout(e)}}l()}else o.current=n.text}),[t,r])}({html:X,value:ae});const pe=(0,u.useRef)(new Set),me=(0,u.useRef)(new Set);function ge(){var e;null===(e=z.current)||void 0===e||e.focus()}const fe=r;return(0,u.createElement)(u.Fragment,null,G&&(0,u.createElement)(jS.Provider,{value:pe},(0,u.createElement)(WS.Provider,{value:me},(0,u.createElement)(h.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},o&&o({value:ae,onChange:ce,onFocus:ge}),(0,u.createElement)($S,{value:ae,onChange:ce,onFocus:ge,formatTypes:te,forwardedRef:z})))),G&&Q&&(0,u.createElement)(CS,{inline:f,editableContentElement:z.current,value:ae}),(0,u.createElement)(fe,c({role:"textbox","aria-multiline":!L,"aria-label":_},O,de,{ref:(0,m.useMergeRefs)([n,de.ref,O.ref,ue,LS({value:ae,onChange:ce}),AS({getValue:se,onChange:ce,__unstableAllowPrefixTransformations:A,formatTypes:te,onReplace:k,selectionChange:q}),GS(),(0,m.useRefEffect)((e=>{function t(e){(Qu.isKeyboardEvent.primary(e,"z")||Qu.isKeyboardEvent.primary(e,"y")||Qu.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),VS(pe),HS(me),SS(),NS({isSelected:G,disableFormats:P,onChange:ce,value:ae,formatTypes:te,tagName:r,onReplace:k,onSplit:w,onSplitMiddle:I,__unstableEmbedURLOnPaste:N,multilineTag:Y,preserveWhiteSpace:T,pastePlainText:M}),OS({removeEditorOnlyFormats:ie,value:ae,onReplace:k,onSplit:w,onSplitMiddle:I,multilineTag:Y,onChange:ce,disableLineBreaks:L,onSplitAtEnd:B}),US(),z]),contentEditable:!0,suppressContentEditableWarning:!0,className:p()("block-editor-rich-text__editable",O.className,"rich-text"),onFocus:R,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===Qu.DELETE||t===Qu.BACKSPACE)){const{start:n,end:o,text:r}=ae,l=t===Qu.BACKSPACE,i=ae.activeFormats&&!!ae.activeFormats.length;if(!(0,$.isCollapsed)(ae)||i||l&&0!==n||!l&&o!==r.length)return;S&&S(!l),C&&(0,$.isEmpty)(ae)&&l&&C(!l),e.preventDefault()}}})))}));KS.Content=e=>{let{value:t,tagName:n,multiline:o,...r}=e;Array.isArray(t)&&(W()("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),t=a.children.toHTML(t));const l=IS(o);!t&&l&&(t=`<${l}>`);const i=(0,u.createElement)(u.RawHTML,null,t);if(n){const{format:e,...t}=r;return(0,u.createElement)(n,t,i)}return i},KS.isEmpty=e=>!e||0===e.length;var qS=KS;const YS=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(qS,c({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));YS.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return(0,u.createElement)(n,o,t)};var ZS=YS;var QS=(0,u.forwardRef)(((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return(0,u.createElement)(ZS,c({ref:t},o));const{className:r,onChange:l,...i}=o;return(0,u.createElement)(Xi.Z,c({ref:t,className:p()("block-editor-plain-text",r),onChange:e=>l(e.target.value)},i))}));function XS(e){let{property:t,viewport:n,desc:o}=e;const r=(0,m.useInstanceId)(XS),l=o||(0,_.sprintf)((0,_._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),t,n.label);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("span",{"aria-describedby":`rbc-desc-${r}`},n.label),(0,u.createElement)(h.VisuallyHidden,{as:"span",id:`rbc-desc-${r}`},l))}var JS=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:l,renderResponsiveControls:i,isResponsive:a=!1,defaultLabel:s={id:"all",label:(0,_.__)("All")},viewports:c=[{id:"small",label:(0,_.__)("Small screens")},{id:"medium",label:(0,_.__)("Medium screens")},{id:"large",label:(0,_.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const d=o||(0,_.sprintf)((0,_.__)("Use the same %s on all screensizes."),n),m=(0,_.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),g=l((0,u.createElement)(XS,{property:n,viewport:s}),s);return(0,u.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,u.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,u.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,u.createElement)(h.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:d,checked:!a,onChange:r,help:m}),(0,u.createElement)("div",{className:p()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&g,a&&(i?i(c):c.map((e=>(0,u.createElement)(u.Fragment,{key:e.id},l((0,u.createElement)(XS,{property:n,viewport:e}),e))))))))};function ew(e){let{character:t,type:n,onUse:o}=e;const r=(0,u.useContext)(jS),l=(0,u.useRef)();return l.current=o,(0,u.useEffect)((()=>{function e(e){Qu.isKeyboardEvent[n](e,t)&&(l.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}}),[t,n]),null}function tw(e){let t,{name:n,shortcutType:o,shortcutCharacter:r,...l}=e,i="RichText.ToolbarControls";return n&&(i+=`.${n}`),o&&r&&(t=Qu.displayShortcut[o](r)),(0,u.createElement)(h.Fill,{name:i},(0,u.createElement)(h.ToolbarButton,c({},l,{shortcut:t})))}function nw(e){let{inputType:t,onInput:n}=e;const o=(0,u.useContext)(WS),r=(0,u.useRef)();return r.current=n,(0,u.useEffect)((()=>{function e(e){e.inputType===t&&(r.current(),e.preventDefault())}return o.current.add(e),()=>{o.current.delete(e)}}),[t]),null}const ow=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z"}));var rw=(0,u.forwardRef)((function(e,t){const n=(0,g.useSelect)((e=>e(To).__unstableGetEditorMode()),[]),{__unstableSetEditorMode:o}=(0,g.useDispatch)(To);return(0,u.createElement)(h.Dropdown,{renderToggle:o=>{let{isOpen:r,onToggle:l}=o;return(0,u.createElement)(h.Button,c({},e,{ref:t,icon:"navigation"===n?ow:qC,"aria-expanded":r,"aria-haspopup":"true",onClick:l,label:(0,_.__)("Tools")}))},popoverProps:{placement:"bottom-start"},renderContent:()=>(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.NavigableMenu,{role:"menu","aria-label":(0,_.__)("Tools")},(0,u.createElement)(h.MenuItemsChoice,{value:"navigation"===n?"navigation":"edit",onSelect:o,choices:[{value:"edit",label:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Jl,{icon:qC}),(0,_.__)("Edit"))},{value:"navigation",label:(0,u.createElement)(u.Fragment,null,ow,(0,_.__)("Select"))}]})),(0,u.createElement)("div",{className:"block-editor-tool-selector__help"},(0,_.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function lw(e){let{units:t,...n}=e;const o=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vw"],units:t});return(0,u.createElement)(h.__experimentalUnitControl,c({units:o},n))}var iw=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"}));class aw extends u.Component{constructor(){super(...arguments),this.toggle=this.toggle.bind(this),this.submitLink=this.submitLink.bind(this),this.state={expanded:!1}}toggle(){this.setState({expanded:!this.state.expanded})}submitLink(e){e.preventDefault(),this.toggle()}render(){const{url:e,onChange:t}=this.props,{expanded:n}=this.state,o=e?(0,_.__)("Edit link"):(0,_.__)("Insert link");return(0,u.createElement)("div",{className:"block-editor-url-input__button"},(0,u.createElement)(h.Button,{icon:Er,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,u.createElement)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink},(0,u.createElement)("div",{className:"block-editor-url-input__button-modal-line"},(0,u.createElement)(h.Button,{className:"block-editor-url-input__back",icon:iw,label:(0,_.__)("Close"),onClick:this.toggle}),(0,u.createElement)(CC,{__nextHasNoMarginBottom:!0,value:e||"",onChange:t}),(0,u.createElement)(h.Button,{icon:hC,label:(0,_.__)("Submit"),type:"submit"}))))}}var sw=aw;var cw=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));const uw="none",dw="custom",pw="media",mw="attachment",gw=["noreferrer","noopener"],fw=(0,u.createElement)(h.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(h.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,u.createElement)(h.Path,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,u.createElement)(h.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),hw=e=>{let{linkDestination:t,onChangeUrl:n,url:o,mediaType:r="image",mediaUrl:l,mediaLink:i,linkTarget:a,linkClass:s,rel:c}=e;const[d,p]=(0,u.useState)(!1),[m,g]=(0,u.useState)(null),f=(0,u.useCallback)((()=>{p(!0)})),[v,b]=(0,u.useState)(!1),[k,y]=(0,u.useState)(null),E=(0,u.useRef)(null),C=(0,u.useCallback)((()=>{t!==pw&&t!==mw||y(""),b(!0)})),S=(0,u.useCallback)((()=>{b(!1)})),w=(0,u.useCallback)((()=>{y(null),S(),p(!1)})),B=(0,u.useCallback)((()=>e=>{const t=E.current;t&&t.contains(e.target)||(p(!1),y(null),S())})),I=(0,u.useCallback)((()=>e=>{if(k){var t;const e=(null===(t=T().find((e=>e.url===k)))||void 0===t?void 0:t.linkDestination)||dw;n({href:k,linkDestination:e})}S(),y(null),e.preventDefault()})),x=(0,u.useCallback)((()=>{n({linkDestination:uw,href:""})})),T=()=>{const e=[{linkDestination:pw,title:(0,_.__)("Media File"),url:"image"===r?l:void 0,icon:fw}];return"image"===r&&i&&e.push({linkDestination:mw,title:(0,_.__)("Attachment Page"),url:"image"===r?i:void 0,icon:(0,u.createElement)(h.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(h.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,u.createElement)(h.Path,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))}),e},M=(0,u.createElement)(h.__experimentalVStack,{spacing:"3"},(0,u.createElement)(h.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Open in new tab"),onChange:e=>{const t=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=c?c:"").split(" ");gw.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=c?c:"").split(" ").filter((e=>!1===gw.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===a}),(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Link rel"),value:null!=c?c:"",onChange:e=>{n({rel:e})}}),(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Link CSS Class"),value:s||"",onChange:e=>{n({linkClass:e})}})),N=null!==k?k:o,P=(T().find((e=>e.linkDestination===t))||{}).title;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ToolbarButton,{icon:Er,className:"components-toolbar__control",label:o?(0,_.__)("Edit link"):(0,_.__)("Insert link"),"aria-expanded":d,onClick:f,ref:g}),d&&(0,u.createElement)(gS,{anchor:m,onFocusOutside:B(),onClose:w,renderSettings:()=>M,additionalControls:!N&&(0,u.createElement)(h.NavigableMenu,null,T().map((e=>(0,u.createElement)(h.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{y(null),(e=>{const t=T();let o;o=e?(t.find((t=>t.url===e))||{linkDestination:dw}).linkDestination:uw,n({linkDestination:o,href:e})})(e.url),S()}},e.title))))},(!o||v)&&(0,u.createElement)(gS.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:N,onChangeInputValue:y,onSubmit:I(),autocompleteRef:E}),o&&!v&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(gS.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:C,urlLabel:P}),(0,u.createElement)(h.Button,{icon:cw,label:(0,_.__)("Remove link"),onClick:x}))))};function vw(e){let{children:t,viewLabel:n,className:o,isEnabled:r=!0,deviceType:l,setDeviceType:i}=e;if((0,m.useViewportMatch)("small","<"))return null;const a={className:p()(o,"block-editor-post-preview__dropdown-content"),position:"bottom left"},s={variant:"tertiary",className:"block-editor-post-preview__button-toggle",disabled:!r,children:n},c={"aria-label":(0,_.__)("View options")};return(0,u.createElement)(h.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:a,toggleProps:s,menuProps:c,icon:null},(()=>(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(h.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>i("Desktop"),icon:"Desktop"===l&&Of},(0,_.__)("Desktop")),(0,u.createElement)(h.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>i("Tablet"),icon:"Tablet"===l&&Of},(0,_.__)("Tablet")),(0,u.createElement)(h.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>i("Mobile"),icon:"Mobile"===l&&Of},(0,_.__)("Mobile"))),t)))}function bw(e){const[t,n]=(0,u.useState)(window.innerWidth);(0,u.useEffect)((()=>{if("Desktop"===e)return;const t=()=>n(window.innerWidth);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[e]);const o=e=>{let n;switch(e){case"Tablet":n=780;break;case"Mobile":n=360;break;default:return null}return n{const t="Mobile"===e?"768px":"1024px";switch(e){case"Tablet":case"Mobile":return{width:o(e),margin:(window.innerHeight<800?36:72)+"px auto",height:t,borderRadius:"2px 2px 2px 2px",border:"1px solid #ddd",overflowY:"auto"};default:return null}})(e)}var kw=(0,g.withSelect)((e=>({selectedBlockClientId:e(To).getBlockSelectionStart()})))((e=>{let{selectedBlockClientId:t}=e;const n=er(t);return t?(0,u.createElement)(h.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},(0,_.__)("Skip to the selected block")):null})),_w=window.wp.wordcount;var yw=(0,g.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(To);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=(0,_w.count)((0,a.serialize)(t),"words");return(0,u.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,u.createElement)(fd,{icon:Nf,showColors:!0}),(0,u.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,u.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,_.sprintf)((0,_._n)("%d block","%d blocks",t.length),t.length)),(0,u.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,_.sprintf)((0,_._n)("%d word","%d words",n),n))))}));function Ew(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:o,styles:r}=(0,g.useSelect)((e=>{var n,o;const r=e(To).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==r||null===(n=r.value)||void 0===n?void 0:n[t],onUpdatePreferredStyleVariations:null!==(o=null==r?void 0:r.onChange)&&void 0!==o?o:null,styles:e(a.store).getBlockStyles(t)}}),[t]),l=(0,u.useMemo)((()=>[{label:(0,_.__)("Not set"),value:""},...r.map((e=>{let{label:t,name:n}=e;return{label:t,value:n}}))]),[r]),i=(0,u.useMemo)((()=>{var e;return null===(e=Vf(r))||void 0===e?void 0:e.name}),[r]),s=(0,u.useCallback)((e=>{o(t,e)}),[t,o]);return n&&n!==i?o&&(0,u.createElement)("div",{className:"default-style-picker__default-switcher"},(0,u.createElement)(h.SelectControl,{__nextHasNoMarginBottom:!0,options:l,value:n||"",label:(0,_.__)("Default Style"),onChange:s})):null}var Cw=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"}));const Sw=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"}));const ww={name:"settings",title:"Settings",value:"settings",icon:Cw,className:"block-editor-block-inspector__tab-item"},Bw={name:"styles",title:"Styles",value:"styles",icon:Sw,className:"block-editor-block-inspector__tab-item"},Iw={name:"list",title:"List View",value:"list-view",icon:Ry,className:"block-editor-block-inspector__tab-item"};var xw=()=>{const e=(0,h.__experimentalUseSlotFills)($r.slotName);return Boolean(e&&e.length)?(0,u.createElement)(h.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,_.__)("Advanced"),initialOpen:!1},(0,u.createElement)(jr.Slot,{group:"advanced"})):null};var Tw=()=>{const e=(0,h.__experimentalUseSlotFills)(Lr.position.Slot.__unstableName);return Boolean(e&&e.length)?(0,u.createElement)(h.PanelBody,{className:"block-editor-block-inspector__position",title:(0,_.__)("Position"),initialOpen:!1},(0,u.createElement)(jr.Slot,{group:"position"})):null},Mw=window.wp.preferences;const Nw="isInspectorControlsTabsHintVisible";function Pw(){const e=(0,g.useSelect)((e=>{var t;return null===(t=e(Mw.store).get("core",Nw))||void 0===t||t}),[]),t=(0,u.useRef)(),{set:n}=(0,g.useDispatch)(Mw.store);return e?(0,u.createElement)("div",{ref:t,className:"block-editor-inspector-controls-tabs__hint"},(0,u.createElement)("div",{className:"block-editor-inspector-controls-tabs__hint-content"},(0,_.__)("Looking for other block settings? They've moved to the styles tab.")),(0,u.createElement)(h.Button,{className:"block-editor-inspector-controls-tabs__hint-dismiss",icon:cw,iconSize:"16",label:(0,_.__)("Dismiss hint"),onClick:()=>{const e=Ri.focus.tabbable.findPrevious(t.current);null==e||e.focus(),n("core",Nw,!1)},showTooltip:!1})):null}var Lw=e=>{let{showAdvancedControls:t=!1}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(jr.Slot,null),(0,u.createElement)(Tw,null),t&&(0,u.createElement)("div",null,(0,u.createElement)(xw,null)),(0,u.createElement)(Pw,null))};var Rw=e=>{let{blockName:t,clientId:n,hasBlockStyles:o}=e;return(0,u.createElement)(u.Fragment,null,o&&(0,u.createElement)("div",null,(0,u.createElement)(h.PanelBody,{title:(0,_.__)("Styles")},(0,u.createElement)(aE,{clientId:n}),(0,a.hasBlockSupport)(t,"defaultStylePicker",!0)&&(0,u.createElement)(Ew,{blockName:t}))),(0,u.createElement)(jr.Slot,{group:"color",label:(0,_.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,u.createElement)(jr.Slot,{group:"typography",label:(0,_.__)("Typography")}),(0,u.createElement)(jr.Slot,{group:"dimensions",label:(0,_.__)("Dimensions")}),(0,u.createElement)(jr.Slot,{group:"border",label:(0,_.__)("Border")}),(0,u.createElement)(jr.Slot,{group:"styles"}))};const Aw=["core/navigation"];var Ow=e=>!Aw.includes(e);function Dw(e){let{blockName:t,clientId:n,hasBlockStyles:o,tabs:r}=e;const l=Ow(t)?void 0:Iw.name;return(0,u.createElement)(h.TabPanel,{className:"block-editor-block-inspector__tabs",tabs:r,initialTabName:l,key:n},(e=>e.name===ww.name?(0,u.createElement)(Lw,{showAdvancedControls:!!t}):e.name===Bw.name?(0,u.createElement)(Rw,{blockName:t,clientId:n,hasBlockStyles:o}):e.name===Iw.name?(0,u.createElement)(jr.Slot,{group:"list"}):void 0))}const zw=[];function Fw(e){const t=[],{border:n,color:o,default:r,dimensions:l,list:i,position:a,styles:s,typography:c}=Lr,u=Ow(e),d=(0,h.__experimentalUseSlotFills)(i.Slot.__unstableName),p=!u&&!!d&&d.length,m=[...(0,h.__experimentalUseSlotFills)(n.Slot.__unstableName)||[],...(0,h.__experimentalUseSlotFills)(o.Slot.__unstableName)||[],...(0,h.__experimentalUseSlotFills)(l.Slot.__unstableName)||[],...(0,h.__experimentalUseSlotFills)(s.Slot.__unstableName)||[],...(0,h.__experimentalUseSlotFills)(c.Slot.__unstableName)||[]].length,f=(0,h.__experimentalUseSlotFills)($r.slotName)||[],v=[...(0,h.__experimentalUseSlotFills)(r.Slot.__unstableName)||[],...(0,h.__experimentalUseSlotFills)(a.Slot.__unstableName)||[],...p&&m>1?f:[]];p&&t.push(Iw),v.length&&t.push(ww),m&&t.push(Bw);const b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return void 0!==t[e]?t[e]:void 0===t.default||t.default}(e,(0,g.useSelect)((e=>e(To).getSettings().blockInspectorTabs),[]));return b?t:zw}function Vw(e,t){const n=(0,u.useMemo)((()=>e.reduce(((e,t)=>("core/list-item"!==t.name&&Object.entries(t.attributes).some((e=>{let[,{__experimentalRole:t}]=e;return"content"===t}))&&(e[t.name]=!0),e)),{})),[e]),o=(0,u.useCallback)((e=>!!n[e]),[n]);return(0,u.useMemo)((()=>Hw([t],o)),[t,o])}function Hw(e,t){const n=[];for(const o of e)t(o.name)&&n.push(o),n.push(...Hw(o.innerBlocks,t));return n}function Gw(e){let{blockTypes:t,block:n,selectedBlock:o}=e;const{selectBlock:r}=(0,g.useDispatch)(To),l=t.find((e=>{let{name:t}=e;return t===n.name})),i=o&&o.clientId===n.clientId;return(0,u.createElement)(h.Button,{isPressed:i,onClick:()=>r(n.clientId)},(0,u.createElement)(h.__experimentalHStack,{justify:"flex-start"},(0,u.createElement)(fd,{icon:l.icon}),(0,u.createElement)(h.FlexItem,null,l.title)))}function Uw(e){let{topLevelLockedBlock:t}=e;const{blockTypes:n,block:o,selectedBlock:r}=(0,g.useSelect)((e=>({blockTypes:e(a.store).getBlockTypes(),block:e(To).getBlock(t),selectedBlock:e(To).getSelectedBlock()})),[t]),l=lf(t),i=Vw(n,o);return(0,u.createElement)("div",{className:"block-editor-block-inspector"},(0,u.createElement)(hd,c({},l,{className:l.isSynced&&"is-synced"})),(0,u.createElement)(EE,{blockClientId:t}),(0,u.createElement)(h.__experimentalVStack,{spacing:1,padding:4,className:"block-editor-block-inspector__block-buttons-container"},(0,u.createElement)("h2",{className:"block-editor-block-card__title"},(0,_.__)("Content")),i.map((e=>(0,u.createElement)(Gw,{selectedBlock:r,key:e.clientId,block:e,blockTypes:n})))))}const $w=e=>{let{animate:t,wrapper:n,children:o}=e;return t?n(o):o},jw=e=>{let{blockInspectorAnimationSettings:t,selectedBlockClientId:n,children:o}=e;const r=t&&"leftToRight"===t.enterDirection?-50:50;return(0,u.createElement)(h.__unstableMotion.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:r,opacity:0},key:n},o)},Ww=e=>{let{clientId:t,blockName:n}=e;const o=Fw(n),r=(null==o?void 0:o.length)>1,l=(0,g.useSelect)((e=>{const{getBlockStyles:t}=e(a.store),o=t(n);return o&&o.length>0}),[n]),i=lf(t);return(0,u.createElement)("div",{className:"block-editor-block-inspector"},(0,u.createElement)(hd,c({},i,{className:i.isSynced&&"is-synced"})),(0,u.createElement)(EE,{blockClientId:t}),r&&(0,u.createElement)(Dw,{hasBlockStyles:l,clientId:t,blockName:n,tabs:o}),!r&&(0,u.createElement)(u.Fragment,null,l&&(0,u.createElement)("div",null,(0,u.createElement)(h.PanelBody,{title:(0,_.__)("Styles")},(0,u.createElement)(aE,{clientId:t}),(0,a.hasBlockSupport)(n,"defaultStylePicker",!0)&&(0,u.createElement)(Ew,{blockName:n}))),(0,u.createElement)(jr.Slot,null),(0,u.createElement)(jr.Slot,{group:"color",label:(0,_.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,u.createElement)(jr.Slot,{group:"typography",label:(0,_.__)("Typography")}),(0,u.createElement)(jr.Slot,{group:"dimensions",label:(0,_.__)("Dimensions")}),(0,u.createElement)(jr.Slot,{group:"border",label:(0,_.__)("Border")}),(0,u.createElement)(jr.Slot,{group:"styles"}),(0,u.createElement)(Tw,null),(0,u.createElement)("div",null,(0,u.createElement)(xw,null))),(0,u.createElement)(kw,{key:"back"}))};var Kw=e=>{let{showNoBlockSelectedMessage:t=!0}=e;const{count:n,selectedBlockName:o,selectedBlockClientId:r,blockType:l,topLevelLockedBlock:i}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o,__unstableGetContentLockingParent:r,getTemplateLock:l}=e(To),i=t(),s=i&&o(i),c=s&&(0,a.getBlockType)(s);return{count:n(),selectedBlockClientId:i,selectedBlockName:s,blockType:c,topLevelLockedBlock:r(i)||("contentOnly"===l(i)?i:void 0)}}),[]),s=Fw(null==l?void 0:l.name),c=(null==s?void 0:s.length)>1,d=function(e,t){return(0,g.useSelect)((t=>{if(e){const n=t(To).getSettings().blockInspectorAnimation,o=null==n?void 0:n.animationParent,{getSelectedBlockClientId:r,getBlockParentsByBlockName:l}=t(To);return l(r(),o,!0)[0]||e.name===o?null==n?void 0:n[e.name]:null}return null}),[t,e])}(l,r);if(n>1)return(0,u.createElement)("div",{className:"block-editor-block-inspector"},(0,u.createElement)(yw,null),c?(0,u.createElement)(Dw,{tabs:s}):(0,u.createElement)(u.Fragment,null,(0,u.createElement)(jr.Slot,null),(0,u.createElement)(jr.Slot,{group:"color",label:(0,_.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,u.createElement)(jr.Slot,{group:"typography",label:(0,_.__)("Typography")}),(0,u.createElement)(jr.Slot,{group:"dimensions",label:(0,_.__)("Dimensions")}),(0,u.createElement)(jr.Slot,{group:"border",label:(0,_.__)("Border")}),(0,u.createElement)(jr.Slot,{group:"styles"})));const p=o===(0,a.getUnregisteredTypeHandlerName)();return l&&r&&!p?i?(0,u.createElement)(Uw,{topLevelLockedBlock:i}):(0,u.createElement)($w,{animate:d,wrapper:e=>(0,u.createElement)(jw,{blockInspectorAnimationSettings:d,selectedBlockClientId:r},e)},(0,u.createElement)(Ww,{clientId:r,blockName:l.name})):t?(0,u.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,_.__)("No block selected.")):null};var qw=function(e){let{__unstableContentRef:t}=e;const[n,o]=(0,u.useState)(!1),r=(0,g.useSelect)((e=>e(To).getBlockOrder()),[]);return(0,u.useEffect)((()=>{const e=setTimeout((()=>{o(!0)}),500);return()=>{clearTimeout(e)}}),[]),n?r.map(((e,n)=>n===r.length-1?null:(0,u.createElement)(Zg,{key:e,previousClientId:e,nextClientId:r[n+1],__unstableContentRef:t},(0,u.createElement)("div",{className:"block-editor-block-list__insertion-point-inserter is-with-inserter"},(0,u.createElement)(Gg,{position:"bottom center",clientId:r[n+1],__experimentalIsQuick:!0}))))):null};function Yw(e){const{__unstableGetEditorMode:t,getSettings:n,isTyping:o}=e(To);return{isZoomOutMode:"zoom-out"===t(),hasFixedToolbar:n().hasFixedToolbar,isTyping:o()}}function Zw(e){let{children:t,__unstableContentRef:n,...o}=e;const r=(0,m.useViewportMatch)("medium"),{hasFixedToolbar:l,isZoomOutMode:i,isTyping:a}=(0,g.useSelect)(Yw,[]),s=(0,xd.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:d,getBlockRootClientId:p}=(0,g.useSelect)(To),{duplicateBlocks:f,removeBlocks:v,insertAfterBlock:b,insertBeforeBlock:k,clearSelectedBlock:_,moveBlocksUp:y,moveBlocksDown:E}=(0,g.useDispatch)(To);const C=qr(n),S=qr(n);return(0,u.createElement)("div",c({},o,{onKeyDown:function(e){if(!e.defaultPrevented)if(s("core/block-editor/move-up",e)){const t=d();if(t.length){e.preventDefault();const n=p(t[0]);y(t,n)}}else if(s("core/block-editor/move-down",e)){const t=d();if(t.length){e.preventDefault();const n=p(t[0]);E(t,n)}}else if(s("core/block-editor/duplicate",e)){const t=d();t.length&&(e.preventDefault(),f(t))}else if(s("core/block-editor/remove",e)){const t=d();t.length&&(e.preventDefault(),v(t))}else if(s("core/block-editor/insert-after",e)){const t=d();t.length&&(e.preventDefault(),b(t[t.length-1]))}else if(s("core/block-editor/insert-before",e)){const t=d();t.length&&(e.preventDefault(),k(t[0]))}else if(s("core/block-editor/unselect",e)){d().length&&(e.preventDefault(),_(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges(),null==n||n.current.focus())}}}),(0,u.createElement)(Jg.Provider,{value:(0,u.useRef)(!1)},!a&&(0,u.createElement)(tf,{__unstableContentRef:n}),!i&&(l||!r)&&(0,u.createElement)(ev,{isFixed:!0}),(0,u.createElement)(Ev,{__unstableContentRef:n}),(0,u.createElement)(h.Popover.Slot,{name:"block-toolbar",ref:C}),t,(0,u.createElement)(h.Popover.Slot,{name:"__unstable-block-tools-after",ref:S}),i&&(0,u.createElement)(qw,{__unstableContentRef:n})))}const Qw=()=>{};var Xw=(0,u.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i=!1,__experimentalInsertionIndex:a,__experimentalFilterValue:s,onSelect:c=Qw,shouldFocusBlock:d=!1}=e;const{destinationRootClientId:p,prioritizePatterns:m}=(0,g.useSelect)((e=>{const{getBlockRootClientId:t,getSettings:r}=e(To);return{destinationRootClientId:n||t(o)||void 0,prioritizePatterns:r().__experimentalPreferPatternsOnRoot}}),[o,n]);return(0,u.createElement)(Dg,{onSelect:c,rootClientId:p,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalInsertionIndex:a,__experimentalFilterValue:s,shouldFocusBlock:d,prioritizePatterns:m,ref:t})}));function Jw(){return null}Jw.Register=function(){const{registerShortcut:e}=(0,g.useDispatch)(xd.store);return(0,u.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,_.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,_.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,_.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,_.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,_.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,_.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,_.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,_.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,_.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,_.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var eB=Jw;function tB(){return W()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const nB=new Set([Qu.UP,Qu.RIGHT,Qu.DOWN,Qu.LEFT,Qu.ENTER,Qu.BACKSPACE]);function oB(){const e=(0,g.useSelect)((e=>e(To).isTyping()),[]),{stopTyping:t}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,l;function i(e){const{clientX:n,clientY:o}=e;r&&l&&(r!==n||l!==o)&&t(),r=n,l=o}return o.addEventListener("mousemove",i),()=>{o.removeEventListener("mousemove",i)}}),[e,t])}function rB(){const{isTyping:e,hasInlineToolbar:t}=(0,g.useSelect)((e=>{const{isTyping:t,getSettings:n}=e(To);return{isTyping:t(),hasInlineToolbar:n().hasInlineToolbar}}),[]),{startTyping:n,stopTyping:o}=(0,g.useDispatch)(To),r=oB(),l=(0,m.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l,a=i.getSelection();if(e){let c;function u(e){const{target:t}=e;c=i.setTimeout((()=>{(0,Ri.isTextField)(t)||o()}))}function d(e){const{keyCode:t}=e;t!==Qu.ESCAPE&&t!==Qu.TAB||o()}function p(){a.isCollapsed||o()}return r.addEventListener("focus",u),r.addEventListener("keydown",d),t||l.addEventListener("selectionchange",p),()=>{i.clearTimeout(c),r.removeEventListener("focus",u),r.removeEventListener("keydown",d),l.removeEventListener("selectionchange",p)}}function s(e){const{type:t,target:o}=e;(0,Ri.isTextField)(o)&&r.contains(o)&&("keydown"!==t||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&nB.has(t)}(e))&&n()}return r.addEventListener("keypress",s),r.addEventListener("keydown",s),()=>{r.removeEventListener("keypress",s),r.removeEventListener("keydown",s)}}),[e,t,n,o]);return(0,m.useMergeRefs)([r,l])}var lB=function(e){let{children:t}=e;return(0,u.createElement)("div",{ref:rB()},t)};const iB=-1!==window.navigator.userAgent.indexOf("Trident"),aB=new Set([Qu.UP,Qu.DOWN,Qu.LEFT,Qu.RIGHT]);function sB(){const e=(0,g.useSelect)((e=>e(To).hasSelectedBlock()),[]);return(0,m.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,l,i;function a(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function s(e){l&&o.cancelAnimationFrame(l),l=o.requestAnimationFrame((()=>{c(e),l=null}))}function c(e){let{keyCode:r}=e;if(!m())return;const l=(0,Ri.computeCaretRect)(o);if(!l)return;if(!i)return void(i=l);if(aB.has(r))return void(i=l);const a=l.top-i.top;if(0===a)return;const s=(0,Ri.getScrollContainer)(t);if(!s)return;const c=s===n.body||s===n.documentElement,u=c?o.scrollY:s.scrollTop,d=c?0:s.getBoundingClientRect().top,p=c?i.top/o.innerHeight:(i.top-d)/(o.innerHeight-d);if(0===u&&p<.75&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=l);const g=c?o.innerHeight:s.clientHeight;i.top+i.height>d+g||i.top{o.removeEventListener("scroll",a,!0),o.removeEventListener("resize",a,!0),t.removeEventListener("keydown",s),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(l)}}),[e])}var cB=iB?e=>e.children:function(e){let{children:t}=e;return(0,u.createElement)("div",{ref:sB(),className:"block-editor__typewriter"},t)};const uB=(0,u.createContext)({});function dB(e){let{children:t,uniqueId:n,blockName:o=""}=e;const r=(0,u.useContext)(uB),{name:l}=Ro();o=o||l;const i=(0,u.useMemo)((()=>function(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}(r,o,n)),[r,o,n]);return(0,u.createElement)(uB.Provider,{value:i},t)}function pB(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=(0,u.useContext)(uB),{name:r}=Ro();return n=n||r,Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e))}var mB=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));function gB(e){let{title:t,help:n,actions:o=[],onClose:r}=e;return(0,u.createElement)(h.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4},(0,u.createElement)(h.__experimentalHStack,{alignment:"center"},(0,u.createElement)(h.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13},t),(0,u.createElement)(h.__experimentalSpacer,null),o.map((e=>{let{label:t,icon:n,onClick:o}=e;return(0,u.createElement)(h.Button,{key:t,className:"block-editor-inspector-popover-header__action",label:t,icon:n,variant:!n&&"tertiary",onClick:o},!n&&t)})),r&&(0,u.createElement)(h.Button,{className:"block-editor-inspector-popover-header__action",label:(0,_.__)("Close"),icon:mB,onClick:r})),n&&(0,u.createElement)(h.__experimentalText,null,n))}var fB=(0,u.forwardRef)((function(e,t){let{onClose:n,onChange:o,...r}=e;return(0,u.createElement)("div",{ref:t,className:"block-editor-publish-date-time-picker"},(0,u.createElement)(gB,{title:(0,_.__)("Publish"),actions:[{label:(0,_.__)("Now"),onClick:()=>null==o?void 0:o(null)}],onClose:n}),(0,u.createElement)(h.DateTimePicker,c({startOfWeek:(0,BE.getSettings)().l10n.startOfWeek,__nextRemoveHelpButton:!0,__nextRemoveResetButton:!0,onChange:o},r)))}));const hB={button:"wp-element-button",caption:"wp-element-caption"},vB=e=>hB[e]?hB[e]:"";function bB(e,t){return Object.entries(t).every((t=>{let[n,o]=t;return"object"==typeof o&&"object"==typeof e[n]?bB(e[n],o):e[n]===o}))}const kB=(e,t)=>{if(!t||!e)return;const n=t.filter((t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&bB(e,n)}));return 1===n.length?n[0]:void 0};function _B(e){const t=null==e?void 0:e.trim().match(/^(0?[-.]?\d*\.?\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/);return isNaN(e)||isNaN(parseFloat(e))?t?{value:parseFloat(t[1])||t[1],unit:t[2]}:{value:e,unit:void 0}:{value:parseFloat(e),unit:"px"}}function yB(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>_B(BB(e,t)).value)).filter(Boolean);switch(n[0]){case"min":return Math.min(...o)+"px";case"max":return Math.max(...o)+"px";case"clamp":return 3!==o.length?null:o[1]o[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function EB(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=yB(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return _B(e)}function CB(e){for(let t=0;tr.height?r.width:r.height)*o,"%":("font"===r.type?r.fontSize:r.width)*o,ch:8,ex:7.15625,lh:r.lineHeight},i={in:n,cm:37.79527559055118,mm:3.7795275590551185,pt:1.3333333333333333,pc:16,px:1,Q:.9448818897637794};return l[e.unit]?(l[e.unit]*e.value).toFixed(0)+"px":i[e.unit]?(i[e.unit]*e.value).toFixed(0)+"px":null}function BB(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number.isFinite(e))return e.toFixed(0)+"px";if(void 0===e)return null;let n=_B(e);return n.unit||(n=EB(e)),CB(e)&&!n.unit?SB(e):wB(n,t)}const IB={};function xB(e){let t="";return e.hasOwnProperty("fontSize")&&(t=":"+e.width),e.hasOwnProperty("lineHeight")&&(t=":"+e.lineHeight),e.hasOwnProperty("width")&&(t=":"+e.width),e.hasOwnProperty("height")&&(t=":"+e.height),e.hasOwnProperty("type")&&(t=":"+e.type),t}var TB=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e+xB(t);return IB[n]||(IB[n]=BB(e,t)),IB[n]};function MB(e,t){var n,o;const{size:r}=e;if(!r||"0"===r)return r;if(null==t||!t.fluid||"object"==typeof(null==t?void 0:t.fluid)&&0===Object.keys(t.fluid).length)return r;if(!1===(null==e?void 0:e.fluid))return r;const l="object"==typeof(null==t?void 0:t.fluid)?null==t?void 0:t.fluid:{},i=Rk({minimumFontSize:null==e||null===(n=e.fluid)||void 0===n?void 0:n.min,maximumFontSize:null==e||null===(o=e.fluid)||void 0===o?void 0:o.max,fontSize:r,minimumFontSizeLimit:null==l?void 0:l.minFontSize});return i||r}const NB="body",PB=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],cssVarInfix:"duotone",valueFunc:e=>{let{slug:t}=e;return`url( '#wp-duotone-${t}' )`},classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>{let{typography:n}=t;return MB(e,n)},valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:e=>{let{size:t}=e;return t},classes:[]}],LB={"color.background":"color","color.text":"color","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient",shadow:"shadow","typography.fontSize":"font-size","typography.fontFamily":"font-family"};function RB(e,t,n,o,r){const l=[(0,f.get)(e,["blocks",t,...n]),(0,f.get)(e,n)];for(const i of l)if(i){const l=["custom","theme","default"];for(const a of l){const l=i[a];if(l){const i=l.find((e=>e[o]===r));if(i){if("slug"===o)return i;return RB(e,t,n,"slug",i.slug)[o]===i[o]?i:void 0}}}}}function AB(e,t,n,o){if(!o)return o;const r=LB[n],l=PB.find((e=>e.cssVarInfix===r));if(!l)return o;const{valueKey:i,path:a}=l,s=RB(e,t,a,i,o);return s?`var:preset|${r}|${s.slug}`:o}function OB(e,t,n){if(!n||"string"!=typeof n){var o,r;if(null===(o=n)||void 0===o||!o.ref||"string"!=typeof(null===(r=n)||void 0===r?void 0:r.ref))return n;{var l;const t=n.ref.split(".");if(!(n=(0,f.get)(e,t))||null!==(l=n)&&void 0!==l&&l.ref)return n}}const i="var:",a="var(--wp--";let s;if(n.startsWith(i))s=n.slice(i.length).split("|");else{if(!n.startsWith(a)||!n.endsWith(")"))return n;s=n.slice(a.length,-")".length).split("--")}const[c,...u]=s;return"preset"===c?function(e,t,n,o){let[r,l]=o;const i=PB.find((e=>e.cssVarInfix===r));if(!i)return n;const a=RB(e.settings,t,i.path,"slug",l);if(a){const{valueKey:n}=i;return OB(e,t,a[n])}return n}(e,t,n,u):"custom"===c?function(e,t,n,o){var r;const l=null!==(r=(0,f.get)(e.settings,["blocks",t,"custom",...o]))&&void 0!==r?r:(0,f.get)(e.settings,["custom",...o]);return l?OB(e,t,l):n}(e,t,n,u):n}const DB=(0,u.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),zB={settings:{},styles:{}},FB=()=>{const{user:e,setUserConfig:t}=(0,u.useContext)(DB);return[!!e&&!k()(e,zB),(0,u.useCallback)((()=>t((()=>zB))),[t])]};function VB(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all";const{merged:r,base:l,user:i,setUserConfig:a}=(0,u.useContext)(DB),s=t?`settings.blocks.${t}.${e}`:`settings.${e}`,c=e=>{a((t=>{const n=JSON.parse(JSON.stringify(t));return(0,f.set)(n,s,e),n}))},d=t=>{const n=t?`settings.blocks.${t}.${e}`:`settings.${e}`;let a;switch(o){case"all":a=(0,f.get)(r,n);break;case"user":a=(0,f.get)(i,n);break;case"base":a=(0,f.get)(l,n);break;default:throw"Unsupported source"}return a},p=null!==(n=d(t))&&void 0!==n?n:d();return[p,c]}function HB(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all";const{merged:r,base:l,user:i,setUserConfig:a}=(0,u.useContext)(DB),s=t?`styles.blocks.${t}.${e}`:`styles.${e}`,c=n=>{a((o=>{const l=JSON.parse(JSON.stringify(o));return(0,f.set)(l,s,AB(r.settings,t,e,n)),l}))};let d;switch(o){case"all":d=OB(r,t,"styles.css"===s?(0,f.get)(i,s):null!==(n=(0,f.get)(i,s))&&void 0!==n?n:(0,f.get)(l,s));break;case"user":d=OB(r,t,(0,f.get)(i,s));break;case"base":d=OB(l,t,(0,f.get)(l,s));break;default:throw"Unsupported source"}return[d,c]}const GB={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"};function UB(e){var t;const n="var:";if(null!=e&&null!==(t=e.startsWith)&&void 0!==t&&t.call(e,n)){return`var(--wp--${e.slice(n.length).split("|").join("--")})`}return e}function $B(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return PB.reduce(((n,o)=>{let{path:r,cssVarInfix:l,classes:i}=o;if(!i)return n;const a=(0,f.get)(t,r,[]);return["default","theme","custom"].forEach((t=>{a[t]&&a[t].forEach((t=>{let{slug:o}=t;i.forEach((t=>{let{classSuffix:r,propertyName:i}=t;const a=`.has-${(0,f.kebabCase)(o)}-${r}`,s=e.split(",").map((e=>`${e}${a}`)).join(","),c=`var(--wp--preset--${l}--${(0,f.kebabCase)(o)})`;n+=`${s}{${i}: ${c} !important;}`}))}))})),n}),"")}function jB(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=[];return Object.keys(e).forEach((r=>{const l=t+(0,f.kebabCase)(r.replace("/","-")),i=e[r];if(i instanceof Object){const e=l+n;o=[...o,...jB(i,e,n)]}else o.push(`${l}: ${i}`)})),o}function WB(e,t){const n=e.split(","),o=[];return n.forEach((e=>{o.push(`${t.trim()}${e.trim()}`)})),o.join(", ")}function KB(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=NB===t,l=Object.entries(a.__EXPERIMENTAL_STYLE_PROPERTY).reduce(((t,o)=>{let[l,{value:i,properties:a,useEngine:s,rootOnly:c}]=o;if(c&&!r)return t;const u=i;if("elements"===u[0]||s)return t;const d=(0,f.get)(e,u);if("--wp--style--root--padding"===l&&("string"==typeof d||!n))return t;if(a&&"string"!=typeof d)Object.entries(a).forEach((e=>{const[n,o]=e;if(!(0,f.get)(d,[o],!1))return;const r=n.startsWith("--")?n:(0,f.kebabCase)(n);t.push(`${r}: ${UB((0,f.get)(d,[o]))}`)}));else if((0,f.get)(e,u,!1)){const n=l.startsWith("--")?l:(0,f.kebabCase)(l);t.push(`${n}: ${UB((0,f.get)(e,u))}`)}return t}),[]),i=(0,ni.getCSSRules)(e);return i.forEach((e=>{var t;if(r&&n&&e.key.startsWith("padding"))return;const i=e.key.startsWith("--")?e.key:(0,f.kebabCase)(e.key);let a=e.value;if("string"!=typeof a&&null!==(t=a)&&void 0!==t&&t.ref){var s;const e=a.ref.split(".");if(a=(0,f.get)(o,e),!a||null!==(s=a)&&void 0!==s&&s.ref)return}var c;"font-size"===i&&(a=MB({size:a},null==o||null===(c=o.settings)||void 0===c?void 0:c.typography));l.push(`${i}: ${a}`)})),l}function qB(e){var t,n,o,r,l;let{tree:i,style:a,selector:s,hasBlockGapSupport:c,hasFallbackGapSupport:u,fallbackGapValue:d}=e,p="",m=c?Bl(null==a||null===(t=a.spacing)||void 0===t?void 0:t.blockGap):"";if(u&&(s===NB?m=m||"0.5em":!c&&d&&(m=d)),m&&null!=i&&null!==(n=i.settings)&&void 0!==n&&null!==(o=n.layout)&&void 0!==o&&o.definitions&&(Object.values(i.settings.layout.definitions).forEach((e=>{let{className:t,name:n,spacingStyles:o}=e;(c||"flex"===n)&&null!=o&&o.length&&o.forEach((e=>{const n=[];if(e.rules&&Object.entries(e.rules).forEach((e=>{let[t,o]=e;n.push(`${t}: ${o||m}`)})),n.length){let o="";o=c?s===NB?`${s} .${t}${(null==e?void 0:e.selector)||""}`:`${s}.${t}${(null==e?void 0:e.selector)||""}`:s===NB?`:where(.${t}${(null==e?void 0:e.selector)||""})`:`:where(${s}.${t}${(null==e?void 0:e.selector)||""})`,p+=`${o} { ${n.join("; ")}; }`}}))})),s===NB&&c&&(p+=`${s} { --wp--style--block-gap: ${m}; }`)),s===NB&&null!=i&&null!==(r=i.settings)&&void 0!==r&&null!==(l=r.layout)&&void 0!==l&&l.definitions){const e=["block","flex","grid"];Object.values(i.settings.layout.definitions).forEach((t=>{let{className:n,displayMode:o,baseStyles:r}=t;o&&e.includes(o)&&(p+=`${s} .${n} { display:${o}; }`),null!=r&&r.length&&r.forEach((e=>{const t=[];if(e.rules&&Object.entries(e.rules).forEach((e=>{let[n,o]=e;t.push(`${n}: ${o}`)})),t.length){const o=`${s} .${n}${(null==e?void 0:e.selector)||""}`;p+=`${o} { ${t.join("; ")}; }`}}))}))}return p}const YB=(e,t)=>{var n,o;const r=[];if(null==e||!e.styles)return r;const l=e=>Object.fromEntries(Object.entries(null!=e?e:{}).filter((e=>{let[t]=e;return["border","color","dimensions","spacing","typography","filter","outline","shadow"].includes(t)}))),i=l(e.styles);return i&&r.push({styles:i,selector:NB}),Object.entries(a.__EXPERIMENTAL_ELEMENTS).forEach((t=>{var n;let[o,l]=t;var i;null!==(n=e.styles)&&void 0!==n&&n.elements[o]&&r.push({styles:null===(i=e.styles)||void 0===i?void 0:i.elements[o],selector:l})})),Object.entries(null!==(n=null===(o=e.styles)||void 0===o?void 0:o.blocks)&&void 0!==n?n:{}).forEach((e=>{var n,o;let[i,s]=e;const c=l(s);if(null!=s&&s.variations){const e={};Object.keys(s.variations).forEach((t=>{e[t]=l(s.variations[t])})),c.variations=e}c&&null!=t&&null!==(n=t[i])&&void 0!==n&&n.selector&&r.push({duotoneSelector:t[i].duotoneSelector,fallbackGapValue:t[i].fallbackGapValue,hasLayoutSupport:t[i].hasLayoutSupport,selector:t[i].selector,styles:c,featureSelectors:t[i].featureSelectors,styleVariationSelectors:t[i].styleVariationSelectors}),Object.entries(null!==(o=null==s?void 0:s.elements)&&void 0!==o?o:{}).forEach((e=>{let[n,o]=e;o&&null!=t&&t[i]&&null!==a.__EXPERIMENTAL_ELEMENTS&&void 0!==a.__EXPERIMENTAL_ELEMENTS&&a.__EXPERIMENTAL_ELEMENTS[n]&&r.push({styles:o,selector:t[i].selector.split(",").map((e=>a.__EXPERIMENTAL_ELEMENTS[n].split(",").map((t=>e+" "+t)))).join(",")})}))})),r},ZB=(e,t)=>{var n,o,r;const l=[];if(null==e||!e.settings)return l;const i=e=>{const t={};return PB.forEach((n=>{let{path:o}=n;const r=(0,f.get)(e,o,!1);!1!==r&&(0,f.set)(t,o,r)})),t},a=i(e.settings),s=null===(n=e.settings)||void 0===n?void 0:n.custom;return(0,f.isEmpty)(a)&&!s||l.push({presets:a,custom:s,selector:NB}),Object.entries(null!==(o=null===(r=e.settings)||void 0===r?void 0:r.blocks)&&void 0!==o?o:{}).forEach((e=>{let[n,o]=e;const r=i(o),a=o.custom;(0,f.isEmpty)(r)&&!a||l.push({presets:r,custom:a,selector:t[n].selector})})),l},QB=(e,t)=>{const n=ZB(e,t);let o="";return n.forEach((t=>{let{presets:n,custom:r,selector:l}=t;const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return PB.reduce(((n,o)=>{let{path:r,valueKey:l,valueFunc:i,cssVarInfix:a}=o;const s=(0,f.get)(e,r,[]);return["default","theme","custom"].forEach((e=>{s[e]&&s[e].forEach((e=>{l&&!i?n.push(`--wp--preset--${a}--${(0,f.kebabCase)(e.slug)}: ${e[l]}`):i&&"function"==typeof i&&n.push(`--wp--preset--${a}--${(0,f.kebabCase)(e.slug)}: ${i(e,t)}`)}))})),n}),[])}(n,null==e?void 0:e.settings),a=jB(r,"--wp--custom--","--");a.length>0&&i.push(...a),i.length>0&&(o+=`${l}{${i.join(";")};}`)})),o};function XB(e,t){return ZB(e,t).flatMap((e=>{let{presets:t}=e;return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return PB.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=(0,f.get)(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>(0,u.createElement)(qp,{preset:e,key:e.slug})))))}))}(t)}))}const JB=(e,t)=>{let n="";return e.split("&").forEach((e=>{n+=e.includes("{")?t+e:t+"{"+e+"}"})),n};function eI(){let{merged:e}=(0,u.useContext)(DB);const[t]=VB("spacing.blockGap"),n=null!==t,o=!n,r=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return!!t().disableLayoutStyles})),l=(0,g.useSelect)((e=>e(a.store).getBlockStyles),[]);return(0,u.useMemo)((()=>{var t,i,s,c,u,d,p,m,g,h,v,b;if(null===(t=e)||void 0===t||!t.styles||null===(i=e)||void 0===i||!i.settings)return[];e=!(null===(u=(c=e).styles)||void 0===u?void 0:u.blocks["core/separator"])||!(null===(d=c.styles)||void 0===d||null===(p=d.blocks["core/separator"].color)||void 0===p?void 0:p.background)||null!==(m=c.styles)&&void 0!==m&&null!==(g=m.blocks["core/separator"].color)&&void 0!==g&&g.text||null!==(h=c.styles)&&void 0!==h&&null!==(v=h.blocks["core/separator"].border)&&void 0!==v&&v.color?c:{...c,styles:{...c.styles,blocks:{...c.styles.blocks,"core/separator":{...c.styles.blocks["core/separator"],color:{...c.styles.blocks["core/separator"].color,text:null===(b=c.styles)||void 0===b?void 0:b.blocks["core/separator"].color.background}}}}};const k=((e,t)=>{const n={};return e.forEach((e=>{var o,r,l,i,a,s,c,u,d;const p=e.name,m=null!==(o=null==e||null===(r=e.supports)||void 0===r?void 0:r.__experimentalSelector)&&void 0!==o?o:".wp-block-"+p.replace("core/","").replace("/","-"),g=null!==(l=null==e||null===(i=e.supports)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.__experimentalDuotone)&&void 0!==l?l:null,f=!(null==e||null===(s=e.supports)||void 0===s||!s.__experimentalLayout),h=null==e||null===(c=e.supports)||void 0===c||null===(u=c.spacing)||void 0===u||null===(d=u.blockGap)||void 0===d?void 0:d.__experimentalDefault,v=t(p),b={};null!=v&&v.length&&v.forEach((e=>{const t=`.is-style-${e.name}${m}`;b[e.name]=t}));const k={};Object.entries(GB).forEach((t=>{var n,o;let[r,l]=t;const i=null==e||null===(n=e.supports)||void 0===n||null===(o=n[r])||void 0===o?void 0:o.__experimentalSelector;i&&(k[l]=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(m,i))})),n[p]={duotoneSelector:g,fallbackGapValue:h,featureSelectors:Object.keys(k).length?k:void 0,hasLayoutSupport:f,name:p,selector:m,styleVariationSelectors:Object.keys(b).length?b:void 0}})),n})((0,a.getBlockTypes)(),l),_=QB(e,k),y=function(e,t,n,o){var r,l;let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const a=YB(e,t),s=ZB(e,t),c=null==e||null===(r=e.settings)||void 0===r?void 0:r.useRootPaddingAwareAlignments,{contentSize:u,wideSize:d}=(null==e||null===(l=e.settings)||void 0===l?void 0:l.layout)||{};let p="body {margin: 0;";if(u&&(p+=` --wp--style--global--content-size: ${u};`),d&&(p+=` --wp--style--global--wide-size: ${d};`),c&&(p+='padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) { padding-right: 0; padding-left: 0; }\n\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull { margin-right: 0; margin-left: 0; }\n\t\t\t.has-global-padding > .alignfull:where(:not(.has-global-padding)) > :where([class*="wp-block-"]:not(.alignfull):not([class*="__"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where([class*="wp-block-"]:not(.alignfull):not([class*="__"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0;'),p+="}",a.forEach((t=>{let{selector:r,duotoneSelector:l,styles:a,fallbackGapValue:s,hasLayoutSupport:u,featureSelectors:d,styleVariationSelectors:m}=t;d&&Object.entries(d).forEach((e=>{let[t,n]=e;if(null!=a&&a[t]){const e=KB({[t]:a[t]});delete a[t],e.length&&(p+=`${n}{${e.join(";")} }`)}})),m&&Object.entries(m).forEach((t=>{var n;let[o,r]=t;if(null!=a&&null!==(n=a.variations)&&void 0!==n&&n[o]){var l;d&&Object.entries(d).forEach((e=>{var t,n;let[l,i]=e;if(null!=a&&null!==(t=a.variations)&&void 0!==t&&null!==(n=t[o])&&void 0!==n&&n[l]){const e=KB({[l]:a.variations[o][l]});delete a.variations[o][l],e.length&&(p+=`${WB(i,r)}{${e.join(";")} }`)}}));const t=KB(null==a||null===(l=a.variations)||void 0===l?void 0:l[o],r,c,e);t.length&&(p+=`${r}{${t.join(";")}}`)}}));const g={};if(null!=a&&a.filter&&(g.filter=a.filter,delete a.filter),l){const e=KB(g);e.length>0&&(p+=`${l}{${e.join(";")};}`)}i||NB!==r&&!u||(p+=qB({tree:e,style:a,selector:r,hasBlockGapSupport:n,hasFallbackGapSupport:o,fallbackGapValue:s}));const f=KB(a,r,c,e);null!=f&&f.length&&(p+=`${r}{${f.join(";")};}`);const h=Object.entries(a).filter((e=>{let[t]=e;return t.startsWith(":")}));null!=h&&h.length&&h.forEach((e=>{let[t,n]=e;const o=KB(n);if(null==o||!o.length)return;const l=`${r.split(",").map((e=>e+t)).join(",")}{${o.join(";")};}`;p+=l}))})),p+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",p+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",p+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }",n){var m,g;const t=Bl(null==e||null===(m=e.styles)||void 0===m||null===(g=m.spacing)||void 0===g?void 0:g.blockGap)||"0.5em";p+=".wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }",p+=`.wp-site-blocks > * + * { margin-block-start: ${t}; }`}return s.forEach((e=>{let{selector:t,presets:n}=e;NB===t&&(t="");const o=$B(t,n);(0,f.isEmpty)(o)||(p+=o)})),p}(e,k,n,o,r),E=XB(e,k),C=[{css:_,isGlobalStyles:!0},{css:y,isGlobalStyles:!0},{css:null!==(s=e.styles.css)&&void 0!==s?s:"",isGlobalStyles:!0}];return(0,a.getBlockTypes)().forEach((t=>{var n;if(null!==(n=e.styles.blocks[t.name])&&void 0!==n&&n.css){var o;const n=k[t.name].selector;C.push({css:JB(null===(o=e.styles.blocks[t.name])||void 0===o?void 0:o.css,n),isGlobalStyles:!0})}})),[C,e.settings,E]}),[n,o,e,r])}const tI=["core/navigation-link/page","core/navigation-link"],nI=(0,u.forwardRef)(((e,t)=>{let{nestingLevel:n,blockCount:o,...r}=e;const[l,i]=(0,u.useState)(null),a=(0,m.useInstanceId)(nI),{hideInserter:s,clientId:d}=(0,g.useSelect)((e=>{const{getTemplateLock:t,__unstableGetEditorMode:n,getSelectedBlockClientId:o}=e(To),r=o();return{clientId:o(),hideInserter:!!t(r)||"zoom-out"===n()}}),[]),p=af({clientId:d,context:"list-view"}),f=af({clientId:null==l?void 0:l.clientId,context:"list-view"});(0,u.useEffect)((()=>{null!=f&&f.length&&(0,pn.speak)((0,_.sprintf)((0,_.__)("%s block inserted"),f),"assertive")}),[f]);const h=(0,u.useCallback)((e=>(e.sort(((e,t)=>{let{id:n}=e,{id:o}=t,r=tI.indexOf(n),l=tI.indexOf(o);return r<0&&(r=tI.length),l<0&&(l=tI.length),r-l})),e)),[]);if(s)return null;const{PrivateInserter:v}=Io(NI),b=`off-canvas-editor-appender__${a}`,k=(0,_.sprintf)((0,_.__)("Append to %1$s block at position %2$d, Level %3$d"),p,o+1,n);return(0,u.createElement)("div",{className:"offcanvas-editor-appender"},(0,u.createElement)(v,c({ref:t,rootClientId:d,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:!1,__experimentalIsQuick:!0},r,{toggleProps:{"aria-describedby":b},onSelectOrClose:e=>{null!=e&&e.clientId&&i(e)},orderInitialBlockItems:h})),(0,u.createElement)("div",{className:"offcanvas-editor-appender__description",id:b},k))})),oI=Ru(h.__experimentalTreeGridRow);function rI(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:i,path:a,...s}=e;const d=Du({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:a});return(0,u.createElement)(oI,c({ref:d,className:p()("block-editor-list-view-leaf","offcanvas-editor-list-view-leaf",i),level:o,positionInSet:n,setSize:r},s),l)}function lI(e){let{onClick:t}=e;return(0,u.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,u.createElement)(Jl,{icon:(0,_.isRTL)()?zy:xy}))}var iI=(0,u.forwardRef)((function(e,t){let{className:n,block:o,onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:a,onDragStart:s,onDragEnd:c,draggable:d}=e;const{clientId:m}=o,g=lf(m),f=af({clientId:m,context:"list-view"}),{isLocked:v}=xh(m),b=g?(0,_.sprintf)((0,_.__)("Edit %s block"),g.title):(0,_.__)("Edit");return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Button,{className:p()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==Qu.ENTER&&e.keyCode!==Qu.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),null==s||s(e)},onDragEnd:c,draggable:d,href:`#block-${m}`,"aria-hidden":!0,title:b},(0,u.createElement)(lI,{onClick:l}),(0,u.createElement)(fd,{icon:null==g?void 0:g.icon,showColors:!0,context:"list-view"}),(0,u.createElement)(h.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,u.createElement)(h.__experimentalTruncate,{ellipsizeMode:"auto"},f)),(null==g?void 0:g.anchor)&&(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper"},(0,u.createElement)(h.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto"},g.anchor)),v&&(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,u.createElement)(Jl,{icon:Dy})))))})),aI=window.wp.escapeHtml;function sI(e,t){switch(e){case"post":case"page":return{type:"post",subtype:e};case"category":return{type:"term",subtype:"category"};case"tag":return{type:"term",subtype:"post_tag"};case"post_format":return{type:"post-format"};default:return"taxonomy"===t?{type:"term",subtype:e}:"post-type"===t?{type:"post",subtype:e}:{}}}function cI(e){let{clientId:t}=e;const{getBlock:n,blockTransforms:o}=(0,g.useSelect)((e=>{const{getBlock:n,getBlockRootClientId:o,getBlockTransformItems:r}=e(To);return{getBlock:n,blockTransforms:r(n(t),o(t))}}),[t]),{replaceBlock:r}=(0,g.useDispatch)(To),l=["core/page-list","core/site-logo","core/social-links","core/search"],i=o.filter((e=>l.includes(e.name)));return null!=i&&i.length&&t?(0,u.createElement)("div",{className:"link-control-transform"},(0,u.createElement)("h3",{className:"link-control-transform__subheading"},(0,_.__)("Transform")),(0,u.createElement)("div",{className:"link-control-transform__items"},i.map((e=>(0,u.createElement)(h.Button,{key:`transform-${e.name}`,onClick:()=>r(t,(0,a.switchToBlockType)(n(t),e.name)),className:"link-control-transform__item"},(0,u.createElement)(fd,{icon:e.icon}),e.title))))):null}function uI(e){const{label:t,url:n,opensInNewTab:o,type:r,kind:l}=e.link,i={url:n,opensInNewTab:o,title:t&&(0,Ri.__unstableStripHTML)(t)};return(0,u.createElement)(h.Popover,{placement:"bottom",onClose:e.onClose,anchor:e.anchor,shift:!0},(0,u.createElement)(rS,{hasTextControl:!0,hasRichPreviews:!0,className:e.className,value:i,showInitialSuggestions:!0,withCreateSuggestion:e.hasCreateSuggestion,noDirectEntry:!!r,noURLSuggestion:!!r,suggestionsQuery:sI(r,l),onChange:e.onChange,onRemove:e.onRemove,renderControlBottom:n?null:()=>(0,u.createElement)(cI,{clientId:e.clientId})}))}const dI=["core/navigation-link","core/navigation-submenu"],pI=(0,u.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:i,siblingBlockCount:a,level:s,isExpanded:d,selectedClientIds:m,...f}=e;const{clientId:h}=r,[v,b]=(0,u.useState)(),{blockMovingClientId:k,selectedBlockInBlockEditor:_,lastInsertedBlockClientId:y}=(0,g.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n,getLastInsertedBlocksClientIds:o}=Io(e(To)),r=o();return{blockMovingClientId:t(),selectedBlockInBlockEditor:n(),lastInsertedBlockClientId:r&&r[0]}}),[h]),{insertedBlockAttributes:E,insertedBlockName:C,setInsertedBlockAttributes:S}=(e=>{const{insertedBlockAttributes:t,insertedBlockName:n}=(0,g.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(To);return{insertedBlockAttributes:o(e),insertedBlockName:n(e)}}),[e]),{updateBlockAttributes:o}=(0,g.useDispatch)(To),r=t=>{e&&o(e,t)};return e?{insertedBlockAttributes:t,insertedBlockName:n,setInsertedBlockAttributes:r}:{insertedBlockAttributes:void 0,insertedBlockName:void 0,setInsertedBlockAttributes:r}})(y),w=null==E?void 0:E.url;(0,u.useEffect)((()=>{h===y&&null!=dI&&dI.includes(C)&&!w&&b(!0)}),[y,h,C,w]);const B=k&&_===h,I=p()("block-editor-list-view-block-contents",{"is-dropping-before":B}),x=m.includes(h)?m:[h];return(0,u.createElement)(u.Fragment,null,v&&(0,u.createElement)(uI,{clientId:y,link:E,onClose:()=>b(!1),hasCreateSuggestion:!1,onChange:e=>{!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{label:o="",kind:r="",type:l=""}=n,{title:i="",url:a="",opensInNewTab:s,id:c,kind:u=r,type:d=l}=e,p=i.replace(/http(s?):\/\//gi,""),m=a.replace(/http(s?):\/\//gi,""),g=i&&i!==o&&p!==m?(0,aI.escapeHTML)(i):o||(0,aI.escapeHTML)(m),f="post_tag"===d?"tag":d.replace("-","_"),h=["post","page","tag","category"].indexOf(f)>-1,v=!u&&!h||"custom"===u?"custom":u;t({...a&&{url:encodeURI((0,lg.safeDecodeURI)(a))},...g&&{label:g},...void 0!==s&&{opensInNewTab:s},...c&&Number.isInteger(c)&&{id:c},...v&&{kind:v},...f&&"URL"!==f&&{type:f}})}(e,S,E),b(!1)}}),(0,u.createElement)(cf,{clientIds:x},(e=>{let{draggable:p,onDragStart:m,onDragEnd:g}=e;return(0,u.createElement)(iI,c({ref:t,className:I,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:i,siblingBlockCount:a,level:s,draggable:p,onDragStart:m,onDragEnd:g,isExpanded:d},f))})))}));var mI=pI;const gI=(0,u.createContext)({}),fI=()=>(0,u.useContext)(gI);var hI=(0,u.memo)((function e(t){let{block:{clientId:n},isDragged:o,isSelected:r,isBranchSelected:l,selectBlock:i,position:s,level:c,rowCount:d,siblingBlockCount:f,showBlockMovers:v,path:b,isExpanded:k,selectedClientIds:y,preventAnnouncement:E}=t;const C=(0,u.useRef)(null),[S,w]=(0,u.useState)(!1),{isLocked:B,isContentLocked:I}=xh(n),x=(0,g.useSelect)((e=>!r&&(!!I&&e(To).hasSelectedInnerBlock(n,!0))),[I,n,r]),T=x||r&&y[0]===n,M=x||r&&y[y.length-1]===n,{toggleBlockHighlight:N}=(0,g.useDispatch)(To),P=lf(n),L=(0,g.useSelect)((e=>e(To).getBlock(n)),[n]);(0,u.useEffect)((()=>{!z&&r&&C.current.focus()}),[]);const R=(0,u.useCallback)((()=>{w(!0),N(n,!0)}),[n,w,N]),A=(0,u.useCallback)((()=>{w(!1),N(n,!1)}),[n,w,N]),O=(0,u.useCallback)((e=>{i(e,n),e.preventDefault()}),[n,i]),D=(0,u.useCallback)((e=>{i(void 0,e)}),[i]),{isTreeGridMounted:z,expand:F,collapse:V,LeafMoreMenu:H}=fI(),G=(0,u.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?V(n):!1===k&&F(n)}),[n,F,V,k]),U=(0,m.useInstanceId)(e);if(!L)return null;const $=!!L&&(0,a.hasBlockSupport)(L.name,"__experimentalToolbar",!0),j=`list-view-block-select-button__${U}`,W=((e,t,n)=>(0,_.sprintf)((0,_.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(s,f,c);let K=(0,_.__)("Link");P&&(K=B?(0,_.sprintf)((0,_.__)("%s link (locked)"),P.title):(0,_.sprintf)((0,_.__)("%s link"),P.title));const q=P?(0,_.sprintf)((0,_.__)("Options for %s block"),P.title):(0,_.__)("Options"),Y=v&&f>0,Z=p()("block-editor-list-view-block__mover-cell",{"is-visible":S||r}),Q=p()("block-editor-list-view-block__menu-cell",{"is-visible":S||T});let X;Y?X=1:$||(X=2);const J=p()({"is-selected":r||x,"is-first-selected":T,"is-last-selected":M,"is-branch-selected":l,"is-dragging":o,"has-single-cell":!$}),ee=y.includes(n)?y:[n],te=H||Uh;return(0,u.createElement)(rI,{className:J,onMouseEnter:R,onMouseLeave:A,onFocus:R,onBlur:A,level:c,position:s,rowCount:d,path:b,id:`list-view-block-${n}`,"data-block":n,isExpanded:I?void 0:k,"aria-selected":!!r||x},(0,u.createElement)(h.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:X,ref:C,"aria-label":K,"aria-selected":!!r||x,"aria-expanded":I?void 0:k,"aria-describedby":j},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,u.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,u.createElement)(mI,{block:L,onClick:O,onToggleExpanded:G,isSelected:r,position:s,siblingBlockCount:f,level:c,ref:t,tabIndex:n,onFocus:o,isExpanded:k,selectedClientIds:y,preventAnnouncement:E}),(0,u.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:j},W))})),Y&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalTreeGridCell,{className:Z,withoutGridItem:!0},(0,u.createElement)(h.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,u.createElement)(vf,{orientation:"vertical",clientIds:[n],ref:t,tabIndex:o,onFocus:r})})),(0,u.createElement)(h.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,u.createElement)(bf,{orientation:"vertical",clientIds:[n],ref:t,tabIndex:o,onFocus:r})})))),$&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalTreeGridCell,{className:Q,"aria-selected":!!r||x},(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(te,{clientIds:ee,block:L,clientId:n,icon:cg,label:q,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:o,onFocus:r},disableOpenOnArrowDown:!0,__experimentalSelectBlock:D}))}))))}));function vI(e,t,n,o){var r;if(null==n?void 0:n.includes(e.clientId))return 0;return(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(bI(t,n,o),0):1}const bI=(e,t,n)=>(o,r)=>{var l;if(null==t?void 0:t.includes(r.clientId))return o;return(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+vI(r,e,t,n):o+1},kI=()=>{};var _I=(0,u.memo)((function e(t){const{blocks:n,selectBlock:o=kI,showBlockMovers:r,selectedClientIds:l,level:i=1,path:a="",isBranchSelected:s=!1,listPosition:d=0,fixedListWindow:p,isExpanded:m,parentId:f,shouldShowInnerBlocks:v=!0,showAppender:b=!0}=t,k=(0,g.useSelect)((e=>!(!f||"contentOnly"!==e(To).getTemplateLock(f))),[f]),{expandedState:_,draggedClientIds:y}=fI();if(k)return null;const E=b&&1===i,C=n.filter(Boolean),S=C.length,w=E?S+1:S;let B=d;return(0,u.createElement)(u.Fragment,null,C.map(((t,n)=>{var c;const{clientId:d,innerBlocks:f}=t;n>0&&(B+=vI(C[n-1],_,y,m));const{itemInView:h}=p,k=h(B),E=n+1,I=a.length>0?`${a}_${E}`:`${E}`,x=!(null==f||!f.length),T=x&&v?null!==(c=_[d])&&void 0!==c?c:m:void 0,M=!(null==y||!y.includes(d)),N=M||k,P=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(d,l),L=s||P&&x;return(0,u.createElement)(g.AsyncModeProvider,{key:d,value:!P},N&&(0,u.createElement)(hI,{block:t,selectBlock:o,isSelected:P,isBranchSelected:L,isDragged:M,level:i,position:E,rowCount:w,siblingBlockCount:S,showBlockMovers:r,path:I,isExpanded:T,listPosition:B,selectedClientIds:l}),!N&&(0,u.createElement)("tr",null,(0,u.createElement)("td",{className:"block-editor-list-view-placeholder"})),x&&T&&!M&&(0,u.createElement)(e,{parentId:d,blocks:f,selectBlock:o,showBlockMovers:r,level:i+1,path:I,listPosition:B+1,fixedListWindow:p,isBranchSelected:L,selectedClientIds:l,isExpanded:m,showAppender:b}))})),E&&(0,u.createElement)(h.__experimentalTreeGridRow,{level:i,setSize:w,positionInSet:w,isExpanded:!0},(0,u.createElement)(h.__experimentalTreeGridCell,null,(e=>(0,u.createElement)(nI,c({nestingLevel:i,blockCount:S},e))))))}));function yI(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,a]=(0,u.useMemo)((()=>{if(!t.current)return[];return[o?t.current.querySelector(`[data-block="${o}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]}),[o,r]),s=a||i,c=(0,u.useCallback)((()=>{if(!i)return 0;const e=s.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,s]),d=(0,u.useMemo)((()=>{if(!s)return{};const e=c();return{width:s.offsetWidth-e}}),[c,s]),p=(0,u.useMemo)((()=>{if(s&&("top"===l||"bottom"===l||"inside"===l))return{ownerDocument:s.ownerDocument,getBoundingClientRect(){const e=s.getBoundingClientRect(),t=c(),n=e.left+t,o=e.right;let r=0,i=0;"top"===l?(r=e.top,i=e.top):(r=e.bottom,i=e.bottom);const a=o-n,u=i-r;return new window.DOMRect(n,r,a,u)}}}),[s,l,c]);return s?(0,u.createElement)(h.Popover,{animate:!1,anchor:p,focusOnMount:!1,className:"block-editor-list-view-drop-indicator",variant:"unstyled"},(0,u.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}function EI(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,g.useDispatch)(To),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:l,getBlockSelectionEnd:i,getSelectedBlockClientIds:s,hasMultiSelection:c,hasSelectedBlock:d}=(0,g.useSelect)(To),{getBlockType:p}=(0,g.useSelect)(a.store);return{updateBlockSelection:(0,u.useCallback)((async(i,a,u)=>{if(null==i||!i.shiftKey)return void n(a);i.preventDefault();const m="keydown"===i.type&&(i.keyCode===Qu.UP||i.keyCode===Qu.DOWN||i.keyCode===Qu.HOME||i.keyCode===Qu.END);if(!m&&!d()&&!c())return void n(a,null);const g=s(),f=[...r(a),a];m&&!g.some((e=>f.includes(e)))&&await e();let h=l(),v=a;m&&(d()||c()||(h=a),u&&(v=u));const b=r(h),k=r(v),{start:y,end:E}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(h,v,b,k);await t(y,E,null);const C=s();if((i.keyCode===Qu.HOME||i.keyCode===Qu.END)&&C.length>1)return;const S=g.filter((e=>!C.includes(e)));let w;if(1===S.length){var B;const e=null===(B=p(o(S[0])))||void 0===B?void 0:B.title;e&&(w=(0,_.sprintf)((0,_.__)("%s deselected."),e))}else S.length>1&&(w=(0,_.sprintf)((0,_.__)("%s blocks deselected."),S.length));w&&(0,pn.speak)(w)}),[e,o,p,r,l,i,s,c,d,t,n])}}const CI=["top","bottom"];function SI(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,g.useSelect)(To),[l,i]=(0,u.useState)(),{rootClientId:a,blockIndex:s}=l||{},c=Nv(a,s),d=o(),p=(0,m.useThrottle)((0,u.useCallback)(((o,l)=>{const a={x:o.clientX,y:o.clientY},s=!(null==d||!d.length),c=function(e,t){let n,o,r,l;for(const i of e){if(i.isDraggedBlock)continue;const a=i.element.getBoundingClientRect(),[s,c]=Lv(t,a,CI),u=Rv(t,a);if(void 0===r||s0||function(e,t){const n=t.left+t.width/2;return e.x>n}(t,l)))return{rootClientId:o.clientId,blockIndex:0,dropPosition:"inside"};if(!o.canInsertDraggedBlocksAsSibling)return;const a=i?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+a,dropPosition:n}}(Array.from(l.querySelectorAll("[data-block]")).map((o=>{const l=o.dataset.block,i=e(l);return{clientId:l,rootClientId:i,blockIndex:t(l),element:o,isDraggedBlock:!!s&&d.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!s||r(d,i),canInsertDraggedBlocksAsChild:!s||r(d,l)}})),a);c&&i(c)}),[d]),200);return{ref:(0,m.__experimentalUseDropZone)({onDrop:c,onDragOver(e){p(e,e.currentTarget)},onDragEnd(){p.cancel(),i(null)}}),target:l}}const wI=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var BI=(0,u.forwardRef)((function(e,t){let{id:n,parentClientId:o,blocks:r,showBlockMovers:l=!1,isExpanded:i=!1,showAppender:a=!0,LeafMoreMenu:s,description:c=(0,_.__)("Block navigation structure"),onSelect:d}=e;const{getBlock:p}=(0,g.useSelect)(To),{clientIdsTree:f,draggedClientIds:v,selectedClientIds:b}=function(e){return(0,g.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(To);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(r),{visibleBlockCount:k,shouldShowInnerBlocks:y}=(0,g.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n,__unstableGetEditorMode:o}=e(To),r=(null==v?void 0:v.length)>0?n(v).length+1:0;return{visibleBlockCount:t()-r,shouldShowInnerBlocks:"zoom-out"!==o()}}),[v]),{updateBlockSelection:E}=EI(),[C,S]=(0,u.useReducer)(wI,{}),{ref:w,target:B}=SI(),I=(0,u.useRef)(),x=(0,m.useMergeRefs)([I,w,t]),T=(0,u.useRef)(!1),{setSelectedTreeId:M}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,u.useState)(null),{selectedBlockParentClientIds:l}=(0,g.useSelect)((e=>{const{getBlockParents:n}=e(To);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,u.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:b[0],setExpandedState:S}),N=(0,u.useCallback)(((e,t)=>{E(e,t),M(t),d&&d(p(t))}),[M,E,d,p]);(0,u.useEffect)((()=>{T.current=!0}),[]);const[P]=(0,m.__experimentalUseFixedWindowList)(I,36,k,{useWindowing:!0,windowOverscan:40}),L=(0,u.useCallback)((e=>{e&&S({type:"expand",clientIds:[e]})}),[S]),R=(0,u.useCallback)((e=>{e&&S({type:"collapse",clientIds:[e]})}),[S]),A=(0,u.useCallback)((e=>{var t;L(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[L]),O=(0,u.useCallback)((e=>{var t;R(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[R]),D=(0,u.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&E(e,null==t||null===(o=t.dataset)||void 0===o?void 0:o.block,null==n||null===(r=n.dataset)||void 0===r?void 0:r.block)}),[E]),z=(0,u.useMemo)((()=>({isTreeGridMounted:T.current,draggedClientIds:v,expandedState:C,expand:L,collapse:R,LeafMoreMenu:s})),[T.current,v,C,L,R,s]);return(0,u.createElement)(g.AsyncModeProvider,{value:!0},(0,u.createElement)(yI,{listViewRef:I,blockDropTarget:B}),(0,u.createElement)("div",{className:"offcanvas-editor-list-view-tree-wrapper"},(0,u.createElement)(h.__experimentalTreeGrid,{id:n,className:"block-editor-list-view-tree","aria-label":(0,_.__)("Block navigation structure"),ref:x,onCollapseRow:O,onExpandRow:A,onFocusRow:D,"aria-description":c},(0,u.createElement)(gI.Provider,{value:z},(0,u.createElement)(_I,{parentId:o,blocks:f,selectBlock:N,showBlockMovers:l,fixedListWindow:P,selectedClientIds:b,isExpanded:i,shouldShowInnerBlocks:y,showAppender:a}),(0,u.createElement)(h.__experimentalTreeGridRow,{level:1,setSize:1,positionInSet:1,isExpanded:!0},!f.length&&(0,u.createElement)(h.__experimentalTreeGridCell,{withoutGridItem:!0},(0,u.createElement)("div",{className:"offcanvas-editor-list-view-is-empty"},(0,_.__)("Your menu is currently empty. Add your first menu item to get started."))))))))}));var II=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z"}));const xI={className:"block-editor-block-settings-menu__popover",position:"bottom right",variant:"toolbar"},TI=["core/navigation-link","core/navigation-submenu"];function MI(e){let{block:t,onClose:n}=e;const{expandedState:o,expand:r}=fI(),{insertBlock:l,replaceBlock:i,replaceInnerBlocks:s}=(0,g.useDispatch)(To),c=t.clientId,d=!TI.includes(t.name);return(0,u.createElement)(h.MenuItem,{icon:II,disabled:d,onClick:()=>{const e=(0,a.createBlock)("core/navigation-link");if("core/navigation-submenu"===t.name)l(e,t.innerBlocks.length,c,false);else{const n=(0,a.createBlock)("core/navigation-submenu",t.attributes,t.innerBlocks);i(c,n),s(n.clientId,[e],false)}o[t.clientId]||r(t.clientId),n()}},(0,_.__)("Add submenu link"))}const NI={};Bo(NI,{...i,ExperimentalBlockEditorProvider:_d,LeafMoreMenu:function(e){const{clientId:t,block:n}=e,{removeBlocks:o}=(0,g.useDispatch)(To),r=(0,_.sprintf)((0,_.__)("Remove %s"),sf({clientId:t,maximumLength:25}));return(0,u.createElement)(h.DropdownMenu,c({icon:cg,label:(0,_.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:xI,noIcons:!0},e),(e=>{let{onClose:l}=e;return(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(MI,{block:n,onClose:l}),(0,u.createElement)(h.MenuItem,{onClick:()=>{o([t],!1),l()}},r))}))},OffCanvasEditor:BI,PrivateInserter:Hg})}(),(window.wp=window.wp||{}).blockEditor=o}(); \ No newline at end of file diff --git a/wp-includes/js/dist/components.js b/wp-includes/js/dist/components.js index da3fdd5275..b3a95934cd 100644 --- a/wp-includes/js/dist/components.js +++ b/wp-includes/js/dist/components.js @@ -3199,7 +3199,7 @@ function normalizePropsAreEqual(propsAreEqual) { -function createComponent_forwardRef(component) { +function forwardRef(component) { return /*#__PURE__*/(0,external_React_.forwardRef)(component); } @@ -3267,7 +3267,7 @@ function createComponent(_ref) { if (false) {} - Comp = createComponent_forwardRef(Comp); + Comp = forwardRef(Comp); if (shouldMemo) { Comp = memo(Comp, propsAreEqual && normalizePropsAreEqual(propsAreEqual)); @@ -5086,10 +5086,10 @@ var CompositeItem = createComponent({ ;// CONCATENATED MODULE: ./node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs -function t(t){return t.split("-")[1]}function floating_ui_core_browser_min_e(t){return"y"===t?"height":"width"}function floating_ui_core_browser_min_n(t){return t.split("-")[0]}function floating_ui_core_browser_min_o(t){return["top","bottom"].includes(floating_ui_core_browser_min_n(t))?"x":"y"}function i(i,r,a){let{reference:l,floating:s}=i;const c=l.x+l.width/2-s.width/2,f=l.y+l.height/2-s.height/2,m=floating_ui_core_browser_min_o(r),u=floating_ui_core_browser_min_e(m),g=l[u]/2-s[u]/2,d="x"===m;let p;switch(floating_ui_core_browser_min_n(r)){case"top":p={x:c,y:l.y-s.height};break;case"bottom":p={x:c,y:l.y+l.height};break;case"right":p={x:l.x+l.width,y:f};break;case"left":p={x:l.x-s.width,y:f};break;default:p={x:l.x,y:l.y}}switch(t(r)){case"start":p[m]-=g*(a&&d?-1:1);break;case"end":p[m]+=g*(a&&d?-1:1)}return p}const floating_ui_core_browser_min_r=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:a=[],platform:l}=n,s=a.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(e));let f=await l.getElementRects({reference:t,floating:e,strategy:r}),{x:m,y:u}=i(f,o,c),g=o,d={},p=0;for(let n=0;n({name:"arrow",options:n,async fn(i){const{element:r,padding:l=0}=n||{},{x:s,y:c,placement:f,rects:u,platform:g,elements:d}=i;if(null==r)return{};const p=floating_ui_core_browser_min_a(l),h={x:s,y:c},y=floating_ui_core_browser_min_o(f),x=floating_ui_core_browser_min_e(y),w=await g.getDimensions(r),v="y"===y,b=v?"top":"left",R=v?"bottom":"right",A=v?"clientHeight":"clientWidth",P=u.reference[x]+u.reference[y]-h[y]-u.floating[x],T=h[y]-u.reference[y],O=await(null==g.getOffsetParent?void 0:g.getOffsetParent(r));let E=O?O[A]:0;E&&await(null==g.isElement?void 0:g.isElement(O))||(E=d.floating[A]||u.floating[x]);const D=P/2-T/2,L=p[b],k=E-w[x]-p[R],B=E/2-w[x]/2+D,C=m(L,B,k),H=null!=t(f)&&B!=C&&u.reference[x]/2-(Bt.concat(e,e+"-start",e+"-end")),[]),p={left:"right",right:"left",bottom:"top",top:"bottom"};function h(t){return t.replace(/left|right|bottom|top/g,(t=>p[t]))}function y(n,i,r){void 0===r&&(r=!1);const a=t(n),l=floating_ui_core_browser_min_o(n),s=floating_ui_core_browser_min_e(l);let c="x"===l?a===(r?"end":"start")?"right":"left":"start"===a?"bottom":"top";return i.reference[s]>i.floating[s]&&(c=h(c)),{main:c,cross:h(c)}}const x={start:"end",end:"start"};function w(t){return t.replace(/start|end/g,(t=>x[t]))}const v=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(o){var i,r,a;const{rects:l,middlewareData:c,placement:f,platform:m,elements:u}=o,{crossAxis:g=!1,alignment:p,allowedPlacements:h=d,autoAlignment:x=!0,...v}=e,b=void 0!==p||h===d?function(e,o,i){return(e?[...i.filter((n=>t(n)===e)),...i.filter((n=>t(n)!==e))]:i.filter((t=>floating_ui_core_browser_min_n(t)===t))).filter((n=>!e||t(n)===e||!!o&&w(n)!==n))}(p||null,x,h):h,R=await s(o,v),A=(null==(i=c.autoPlacement)?void 0:i.index)||0,P=b[A];if(null==P)return{};const{main:T,cross:O}=y(P,l,await(null==m.isRTL?void 0:m.isRTL(u.floating)));if(f!==P)return{reset:{placement:b[0]}};const E=[R[floating_ui_core_browser_min_n(P)],R[T],R[O]],D=[...(null==(r=c.autoPlacement)?void 0:r.overflows)||[],{placement:P,overflows:E}],L=b[A+1];if(L)return{data:{index:A+1,overflows:D},reset:{placement:L}};const k=D.map((e=>{const n=t(e.placement);return[e.placement,n&&g?e.overflows.slice(0,2).reduce(((t,e)=>t+e),0):e.overflows[0],e.overflows]})).sort(((t,e)=>t[1]-e[1])),B=(null==(a=k.filter((e=>e[2].slice(0,t(e[0])?2:3).every((t=>t<=0))))[0])?void 0:a[0])||k[0][0];return B!==f?{data:{index:A+1,overflows:D},reset:{placement:B}}:{}}}};const b=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(o){var i;const{placement:r,middlewareData:a,rects:l,initialPlacement:c,platform:f,elements:m}=o,{mainAxis:u=!0,crossAxis:g=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,...b}=e,R=floating_ui_core_browser_min_n(r),A=floating_ui_core_browser_min_n(c)===c,P=await(null==f.isRTL?void 0:f.isRTL(m.floating)),T=d||(A||!v?[h(c)]:function(t){const e=h(t);return[w(t),e,w(e)]}(c));d||"none"===x||T.push(...function(e,o,i,r){const a=t(e);let l=function(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:a;default:return[]}}(floating_ui_core_browser_min_n(e),"start"===i,r);return a&&(l=l.map((t=>t+"-"+a)),o&&(l=l.concat(l.map(w)))),l}(c,v,x,P));const O=[c,...T],E=await s(o,b),D=[];let L=(null==(i=a.flip)?void 0:i.overflows)||[];if(u&&D.push(E[R]),g){const{main:t,cross:e}=y(r,l,P);D.push(E[t],E[e])}if(L=[...L,{placement:r,overflows:D}],!D.every((t=>t<=0))){var k,B;const t=((null==(k=a.flip)?void 0:k.index)||0)+1,e=O[t];if(e)return{data:{index:t,overflows:L},reset:{placement:e}};let n=null==(B=L.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:B.placement;if(!n)switch(p){case"bestFit":{var C;const t=null==(C=L.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:C[0];t&&(n=t);break}case"initialPlacement":n=c}if(r!==n)return{reset:{placement:n}}}return{}}}};function R(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function A(t){return g.some((e=>t[e]>=0))}const P=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{strategy:n="referenceHidden",...o}=t,{rects:i}=e;switch(n){case"referenceHidden":{const t=R(await s(e,{...o,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:A(t)}}}case"escaped":{const t=R(await s(e,{...o,altBoundary:!0}),i.floating);return{data:{escapedOffsets:t,escaped:A(t)}}}default:return{}}}}},T=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:i,elements:r,rects:s,platform:m,strategy:u}=e,{padding:g=2,x:d,y:p}=t,h=floating_ui_core_browser_min_l(m.convertOffsetParentRelativeRectToViewportRelativeRect?await m.convertOffsetParentRelativeRectToViewportRelativeRect({rect:s.reference,offsetParent:await(null==m.getOffsetParent?void 0:m.getOffsetParent(r.floating)),strategy:u}):s.reference),y=await(null==m.getClientRects?void 0:m.getClientRects(r.reference))||[],x=floating_ui_core_browser_min_a(g);const w=await m.getElementRects({reference:{getBoundingClientRect:function(){if(2===y.length&&y[0].left>y[1].right&&null!=d&&null!=p)return y.find((t=>d>t.left-x.left&&dt.top-x.top&&p=2){if("x"===floating_ui_core_browser_min_o(i)){const t=y[0],e=y[y.length-1],o="top"===floating_ui_core_browser_min_n(i),r=t.top,a=e.bottom,l=o?t.left:e.left,s=o?t.right:e.right;return{top:r,bottom:a,left:l,right:s,width:s-l,height:a-r,x:l,y:r}}const t="left"===floating_ui_core_browser_min_n(i),e=f(...y.map((t=>t.right))),r=c(...y.map((t=>t.left))),a=y.filter((n=>t?n.left===r:n.right===e)),l=a[0].top,s=a[a.length-1].bottom;return{top:l,bottom:s,left:r,right:e,width:e-r,height:s-l,x:r,y:l}}return h}},floating:r.floating,strategy:u});return s.reference.x!==w.reference.x||s.reference.y!==w.reference.y||s.reference.width!==w.reference.width||s.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}};const O=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(i){const{x:r,y:a}=i,l=await async function(e,i){const{placement:r,platform:a,elements:l}=e,s=await(null==a.isRTL?void 0:a.isRTL(l.floating)),c=floating_ui_core_browser_min_n(r),f=t(r),m="x"===floating_ui_core_browser_min_o(r),u=["left","top"].includes(c)?-1:1,g=s&&m?-1:1,d="function"==typeof i?i(e):i;let{mainAxis:p,crossAxis:h,alignmentAxis:y}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return f&&"number"==typeof y&&(h="end"===f?-1*y:y),m?{x:h*g,y:p*u}:{x:p*u,y:h*g}}(i,e);return{x:r+l.x,y:a+l.y,data:l}}}};function E(t){return"x"===t?"y":"x"}const D=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:r,placement:a}=e,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...u}=t,g={x:i,y:r},d=await s(e,u),p=floating_ui_core_browser_min_o(floating_ui_core_browser_min_n(a)),h=E(p);let y=g[p],x=g[h];if(l){const t="y"===p?"bottom":"right";y=m(y+d["y"===p?"top":"left"],y,y-d[t])}if(c){const t="y"===h?"bottom":"right";x=m(x+d["y"===h?"top":"left"],x,x-d[t])}const w=f.fn({...e,[p]:y,[h]:x});return{...w,data:{x:w.x-i,y:w.y-r}}}}},L=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:i,y:r,placement:a,rects:l,middlewareData:s}=e,{offset:c=0,mainAxis:f=!0,crossAxis:m=!0}=t,u={x:i,y:r},g=floating_ui_core_browser_min_o(a),d=E(g);let p=u[g],h=u[d];const y="function"==typeof c?c(e):c,x="number"==typeof y?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(f){const t="y"===g?"height":"width",e=l.reference[g]-l.floating[t]+x.mainAxis,n=l.reference[g]+l.reference[t]-x.mainAxis;pn&&(p=n)}if(m){var w,v;const t="y"===g?"width":"height",e=["top","left"].includes(floating_ui_core_browser_min_n(a)),o=l.reference[d]-l.floating[t]+(e&&(null==(w=s.offset)?void 0:w[d])||0)+(e?0:x.crossAxis),i=l.reference[d]+l.reference[t]+(e?0:(null==(v=s.offset)?void 0:v[d])||0)-(e?x.crossAxis:0);hi&&(h=i)}return{[g]:p,[d]:h}}}},k=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(i){const{placement:r,rects:a,platform:l,elements:m}=i,{apply:u=(()=>{}),...g}=e,d=await s(i,g),p=floating_ui_core_browser_min_n(r),h=t(r),y="x"===floating_ui_core_browser_min_o(r),{width:x,height:w}=a.floating;let v,b;"top"===p||"bottom"===p?(v=p,b=h===(await(null==l.isRTL?void 0:l.isRTL(m.floating))?"start":"end")?"left":"right"):(b=p,v="end"===h?"top":"bottom");const R=w-d[v],A=x-d[b];let P=R,T=A;if(y?T=c(x-d.right-d.left,A):P=c(w-d.bottom-d.top,R),!i.middlewareData.shift&&!h){const t=f(d.left,0),e=f(d.right,0),n=f(d.top,0),o=f(d.bottom,0);y?T=x-2*(0!==t||0!==e?t+e:f(d.left,d.right)):P=w-2*(0!==n||0!==o?n+o:f(d.top,d.bottom))}await u({...i,availableWidth:T,availableHeight:P});const O=await l.getDimensions(m.floating);return x!==O.width||w!==O.height?{reset:{rects:!0}}:{}}}}; +function t(t){return t.split("-")[1]}function floating_ui_core_browser_min_e(t){return"y"===t?"height":"width"}function floating_ui_core_browser_min_n(t){return t.split("-")[0]}function floating_ui_core_browser_min_o(t){return["top","bottom"].includes(floating_ui_core_browser_min_n(t))?"x":"y"}function i(i,r,a){let{reference:l,floating:s}=i;const c=l.x+l.width/2-s.width/2,f=l.y+l.height/2-s.height/2,m=floating_ui_core_browser_min_o(r),u=floating_ui_core_browser_min_e(m),g=l[u]/2-s[u]/2,d="x"===m;let p;switch(floating_ui_core_browser_min_n(r)){case"top":p={x:c,y:l.y-s.height};break;case"bottom":p={x:c,y:l.y+l.height};break;case"right":p={x:l.x+l.width,y:f};break;case"left":p={x:l.x-s.width,y:f};break;default:p={x:l.x,y:l.y}}switch(t(r)){case"start":p[m]-=g*(a&&d?-1:1);break;case"end":p[m]+=g*(a&&d?-1:1)}return p}const floating_ui_core_browser_min_r=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:a=[],platform:l}=n,s=a.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(e));let f=await l.getElementRects({reference:t,floating:e,strategy:r}),{x:m,y:u}=i(f,o,c),g=o,d={},p=0;for(let n=0;n({name:"arrow",options:n,async fn(i){const{element:r,padding:l=0}=n||{},{x:s,y:c,placement:f,rects:u,platform:g,elements:d}=i;if(null==r)return{};const p=floating_ui_core_browser_min_a(l),h={x:s,y:c},y=floating_ui_core_browser_min_o(f),x=floating_ui_core_browser_min_e(y),w=await g.getDimensions(r),v="y"===y,b=v?"top":"left",A=v?"bottom":"right",R=v?"clientHeight":"clientWidth",P=u.reference[x]+u.reference[y]-h[y]-u.floating[x],E=h[y]-u.reference[y],T=await(null==g.getOffsetParent?void 0:g.getOffsetParent(r));let D=T?T[R]:0;D&&await(null==g.isElement?void 0:g.isElement(T))||(D=d.floating[R]||u.floating[x]);const L=P/2-E/2,k=p[b],O=D-w[x]-p[A],B=D/2-w[x]/2+L,C=m(k,B,O),H=null!=t(f)&&B!=C&&u.reference[x]/2-(Bt.concat(e,e+"-start",e+"-end")),[]),p={left:"right",right:"left",bottom:"top",top:"bottom"};function h(t){return t.replace(/left|right|bottom|top/g,(t=>p[t]))}function y(n,i,r){void 0===r&&(r=!1);const a=t(n),l=floating_ui_core_browser_min_o(n),s=floating_ui_core_browser_min_e(l);let c="x"===l?a===(r?"end":"start")?"right":"left":"start"===a?"bottom":"top";return i.reference[s]>i.floating[s]&&(c=h(c)),{main:c,cross:h(c)}}const x={start:"end",end:"start"};function w(t){return t.replace(/start|end/g,(t=>x[t]))}const v=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(o){var i,r,a;const{rects:l,middlewareData:c,placement:f,platform:m,elements:u}=o,{crossAxis:g=!1,alignment:p,allowedPlacements:h=d,autoAlignment:x=!0,...v}=e,b=void 0!==p||h===d?function(e,o,i){return(e?[...i.filter((n=>t(n)===e)),...i.filter((n=>t(n)!==e))]:i.filter((t=>floating_ui_core_browser_min_n(t)===t))).filter((n=>!e||t(n)===e||!!o&&w(n)!==n))}(p||null,x,h):h,A=await s(o,v),R=(null==(i=c.autoPlacement)?void 0:i.index)||0,P=b[R];if(null==P)return{};const{main:E,cross:T}=y(P,l,await(null==m.isRTL?void 0:m.isRTL(u.floating)));if(f!==P)return{reset:{placement:b[0]}};const D=[A[floating_ui_core_browser_min_n(P)],A[E],A[T]],L=[...(null==(r=c.autoPlacement)?void 0:r.overflows)||[],{placement:P,overflows:D}],k=b[R+1];if(k)return{data:{index:R+1,overflows:L},reset:{placement:k}};const O=L.map((e=>{const n=t(e.placement);return[e.placement,n&&g?e.overflows.slice(0,2).reduce(((t,e)=>t+e),0):e.overflows[0],e.overflows]})).sort(((t,e)=>t[1]-e[1])),B=(null==(a=O.filter((e=>e[2].slice(0,t(e[0])?2:3).every((t=>t<=0))))[0])?void 0:a[0])||O[0][0];return B!==f?{data:{index:R+1,overflows:L},reset:{placement:B}}:{}}}};const b=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(o){var i;const{placement:r,middlewareData:a,rects:l,initialPlacement:c,platform:f,elements:m}=o,{mainAxis:u=!0,crossAxis:g=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,...b}=e,A=floating_ui_core_browser_min_n(r),R=floating_ui_core_browser_min_n(c)===c,P=await(null==f.isRTL?void 0:f.isRTL(m.floating)),E=d||(R||!v?[h(c)]:function(t){const e=h(t);return[w(t),e,w(e)]}(c));d||"none"===x||E.push(...function(e,o,i,r){const a=t(e);let l=function(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:a;default:return[]}}(floating_ui_core_browser_min_n(e),"start"===i,r);return a&&(l=l.map((t=>t+"-"+a)),o&&(l=l.concat(l.map(w)))),l}(c,v,x,P));const T=[c,...E],D=await s(o,b),L=[];let k=(null==(i=a.flip)?void 0:i.overflows)||[];if(u&&L.push(D[A]),g){const{main:t,cross:e}=y(r,l,P);L.push(D[t],D[e])}if(k=[...k,{placement:r,overflows:L}],!L.every((t=>t<=0))){var O,B;const t=((null==(O=a.flip)?void 0:O.index)||0)+1,e=T[t];if(e)return{data:{index:t,overflows:k},reset:{placement:e}};let n=null==(B=k.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:B.placement;if(!n)switch(p){case"bestFit":{var C;const t=null==(C=k.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:C[0];t&&(n=t);break}case"initialPlacement":n=c}if(r!==n)return{reset:{placement:n}}}return{}}}};function A(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function R(t){return g.some((e=>t[e]>=0))}const P=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{strategy:n="referenceHidden",...o}=t,{rects:i}=e;switch(n){case"referenceHidden":{const t=A(await s(e,{...o,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:R(t)}}}case"escaped":{const t=A(await s(e,{...o,altBoundary:!0}),i.floating);return{data:{escapedOffsets:t,escaped:R(t)}}}default:return{}}}}};function E(t){const e=c(...t.map((t=>t.left))),n=c(...t.map((t=>t.top)));return{x:e,y:n,width:f(...t.map((t=>t.right)))-e,height:f(...t.map((t=>t.bottom)))-n}}const T=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:i,elements:r,rects:s,platform:m,strategy:u}=e,{padding:g=2,x:d,y:p}=t,h=Array.from(await(null==m.getClientRects?void 0:m.getClientRects(r.reference))||[]),y=function(t){const e=t.slice().sort(((t,e)=>t.y-e.y)),n=[];let o=null;for(let t=0;to.height/2?n.push([i]):n[n.length-1].push(i),o=i}return n.map((t=>floating_ui_core_browser_min_l(E(t))))}(h),x=floating_ui_core_browser_min_l(E(h)),w=floating_ui_core_browser_min_a(g);const v=await m.getElementRects({reference:{getBoundingClientRect:function(){if(2===y.length&&y[0].left>y[1].right&&null!=d&&null!=p)return y.find((t=>d>t.left-w.left&&dt.top-w.top&&p=2){if("x"===floating_ui_core_browser_min_o(i)){const t=y[0],e=y[y.length-1],o="top"===floating_ui_core_browser_min_n(i),r=t.top,a=e.bottom,l=o?t.left:e.left,s=o?t.right:e.right;return{top:r,bottom:a,left:l,right:s,width:s-l,height:a-r,x:l,y:r}}const t="left"===floating_ui_core_browser_min_n(i),e=f(...y.map((t=>t.right))),r=c(...y.map((t=>t.left))),a=y.filter((n=>t?n.left===r:n.right===e)),l=a[0].top,s=a[a.length-1].bottom;return{top:l,bottom:s,left:r,right:e,width:e-r,height:s-l,x:r,y:l}}return x}},floating:r.floating,strategy:u});return s.reference.x!==v.reference.x||s.reference.y!==v.reference.y||s.reference.width!==v.reference.width||s.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}};const D=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(i){const{x:r,y:a}=i,l=await async function(e,i){const{placement:r,platform:a,elements:l}=e,s=await(null==a.isRTL?void 0:a.isRTL(l.floating)),c=floating_ui_core_browser_min_n(r),f=t(r),m="x"===floating_ui_core_browser_min_o(r),u=["left","top"].includes(c)?-1:1,g=s&&m?-1:1,d="function"==typeof i?i(e):i;let{mainAxis:p,crossAxis:h,alignmentAxis:y}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return f&&"number"==typeof y&&(h="end"===f?-1*y:y),m?{x:h*g,y:p*u}:{x:p*u,y:h*g}}(i,e);return{x:r+l.x,y:a+l.y,data:l}}}};function L(t){return"x"===t?"y":"x"}const k=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:r,placement:a}=e,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...u}=t,g={x:i,y:r},d=await s(e,u),p=floating_ui_core_browser_min_o(floating_ui_core_browser_min_n(a)),h=L(p);let y=g[p],x=g[h];if(l){const t="y"===p?"bottom":"right";y=m(y+d["y"===p?"top":"left"],y,y-d[t])}if(c){const t="y"===h?"bottom":"right";x=m(x+d["y"===h?"top":"left"],x,x-d[t])}const w=f.fn({...e,[p]:y,[h]:x});return{...w,data:{x:w.x-i,y:w.y-r}}}}},O=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:i,y:r,placement:a,rects:l,middlewareData:s}=e,{offset:c=0,mainAxis:f=!0,crossAxis:m=!0}=t,u={x:i,y:r},g=floating_ui_core_browser_min_o(a),d=L(g);let p=u[g],h=u[d];const y="function"==typeof c?c(e):c,x="number"==typeof y?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(f){const t="y"===g?"height":"width",e=l.reference[g]-l.floating[t]+x.mainAxis,n=l.reference[g]+l.reference[t]-x.mainAxis;pn&&(p=n)}if(m){var w,v;const t="y"===g?"width":"height",e=["top","left"].includes(floating_ui_core_browser_min_n(a)),o=l.reference[d]-l.floating[t]+(e&&(null==(w=s.offset)?void 0:w[d])||0)+(e?0:x.crossAxis),i=l.reference[d]+l.reference[t]+(e?0:(null==(v=s.offset)?void 0:v[d])||0)-(e?x.crossAxis:0);hi&&(h=i)}return{[g]:p,[d]:h}}}},B=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(i){const{placement:r,rects:a,platform:l,elements:m}=i,{apply:u=(()=>{}),...g}=e,d=await s(i,g),p=floating_ui_core_browser_min_n(r),h=t(r),y="x"===floating_ui_core_browser_min_o(r),{width:x,height:w}=a.floating;let v,b;"top"===p||"bottom"===p?(v=p,b=h===(await(null==l.isRTL?void 0:l.isRTL(m.floating))?"start":"end")?"left":"right"):(b=p,v="end"===h?"top":"bottom");const A=w-d[v],R=x-d[b],P=!i.middlewareData.shift;let E=A,T=R;if(y){const t=x-d.left-d.right;T=h||P?c(R,t):t}else{const t=w-d.top-d.bottom;E=h||P?c(A,t):t}if(P&&!h){const t=f(d.left,0),e=f(d.right,0),n=f(d.top,0),o=f(d.bottom,0);y?T=x-2*(0!==t||0!==e?t+e:f(d.left,d.right)):E=w-2*(0!==n||0!==o?n+o:f(d.top,d.bottom))}await u({...i,availableWidth:T,availableHeight:E});const D=await l.getDimensions(m.floating);return x!==D.width||w!==D.height?{reset:{rects:!0}}:{}}}}; ;// CONCATENATED MODULE: ./node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.mjs -function floating_ui_dom_browser_min_n(t){var e;return(null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function floating_ui_dom_browser_min_o(t){return floating_ui_dom_browser_min_n(t).getComputedStyle(t)}const floating_ui_dom_browser_min_i=Math.min,r=Math.max,l=Math.round;function floating_ui_dom_browser_min_c(t){const e=floating_ui_dom_browser_min_o(t);let n=parseFloat(e.width),i=parseFloat(e.height);const r=t.offsetWidth,c=t.offsetHeight,s=l(n)!==r||l(i)!==c;return s&&(n=r,i=c),{width:n,height:i,fallback:s}}function floating_ui_dom_browser_min_s(t){return floating_ui_dom_browser_min_h(t)?(t.nodeName||"").toLowerCase():""}let floating_ui_dom_browser_min_f;function floating_ui_dom_browser_min_u(){if(floating_ui_dom_browser_min_f)return floating_ui_dom_browser_min_f;const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?(floating_ui_dom_browser_min_f=t.brands.map((t=>t.brand+"/"+t.version)).join(" "),floating_ui_dom_browser_min_f):navigator.userAgent}function floating_ui_dom_browser_min_a(t){return t instanceof floating_ui_dom_browser_min_n(t).HTMLElement}function floating_ui_dom_browser_min_d(t){return t instanceof floating_ui_dom_browser_min_n(t).Element}function floating_ui_dom_browser_min_h(t){return t instanceof floating_ui_dom_browser_min_n(t).Node}function floating_ui_dom_browser_min_p(t){if("undefined"==typeof ShadowRoot)return!1;return t instanceof floating_ui_dom_browser_min_n(t).ShadowRoot||t instanceof ShadowRoot}function floating_ui_dom_browser_min_g(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=floating_ui_dom_browser_min_o(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(r)}function floating_ui_dom_browser_min_m(t){return["table","td","th"].includes(floating_ui_dom_browser_min_s(t))}function floating_ui_dom_browser_min_y(t){const e=/firefox/i.test(floating_ui_dom_browser_min_u()),n=floating_ui_dom_browser_min_o(t),i=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!i&&"none"!==i||e&&"filter"===n.willChange||e&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((t=>n.willChange.includes(t)))||["paint","layout","strict","content"].some((t=>{const e=n.contain;return null!=e&&e.includes(t)}))}function floating_ui_dom_browser_min_x(){return/^((?!chrome|android).)*safari/i.test(floating_ui_dom_browser_min_u())}function floating_ui_dom_browser_min_w(t){return["html","body","#document"].includes(floating_ui_dom_browser_min_s(t))}function floating_ui_dom_browser_min_v(t){return floating_ui_dom_browser_min_d(t)?t:t.contextElement}const floating_ui_dom_browser_min_b={x:1,y:1};function floating_ui_dom_browser_min_L(t){const e=floating_ui_dom_browser_min_v(t);if(!floating_ui_dom_browser_min_a(e))return floating_ui_dom_browser_min_b;const n=e.getBoundingClientRect(),{width:o,height:i,fallback:r}=floating_ui_dom_browser_min_c(e);let s=(r?l(n.width):n.width)/o,f=(r?l(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),f&&Number.isFinite(f)||(f=1),{x:s,y:f}}function floating_ui_dom_browser_min_E(e,o,i,r){var l,c;void 0===o&&(o=!1),void 0===i&&(i=!1);const s=e.getBoundingClientRect(),f=floating_ui_dom_browser_min_v(e);let u=floating_ui_dom_browser_min_b;o&&(r?floating_ui_dom_browser_min_d(r)&&(u=floating_ui_dom_browser_min_L(r)):u=floating_ui_dom_browser_min_L(e));const a=f?floating_ui_dom_browser_min_n(f):window,h=floating_ui_dom_browser_min_x()&&i;let p=(s.left+(h&&(null==(l=a.visualViewport)?void 0:l.offsetLeft)||0))/u.x,g=(s.top+(h&&(null==(c=a.visualViewport)?void 0:c.offsetTop)||0))/u.y,m=s.width/u.x,y=s.height/u.y;if(f){const t=floating_ui_dom_browser_min_n(f),e=r&&floating_ui_dom_browser_min_d(r)?floating_ui_dom_browser_min_n(r):r;let o=t.frameElement;for(;o&&r&&e!==t;){const t=floating_ui_dom_browser_min_L(o),e=o.getBoundingClientRect(),i=getComputedStyle(o);e.x+=(o.clientLeft+parseFloat(i.paddingLeft))*t.x,e.y+=(o.clientTop+parseFloat(i.paddingTop))*t.y,p*=t.x,g*=t.y,m*=t.x,y*=t.y,p+=e.x,g+=e.y,o=floating_ui_dom_browser_min_n(o).frameElement}}return floating_ui_core_browser_min_l({width:m,height:y,x:p,y:g})}function floating_ui_dom_browser_min_R(t){return((floating_ui_dom_browser_min_h(t)?t.ownerDocument:t.document)||window.document).documentElement}function floating_ui_dom_browser_min_T(t){return floating_ui_dom_browser_min_d(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function C(t){return floating_ui_dom_browser_min_E(floating_ui_dom_browser_min_R(t)).left+floating_ui_dom_browser_min_T(t).scrollLeft}function F(t){if("html"===floating_ui_dom_browser_min_s(t))return t;const e=t.assignedSlot||t.parentNode||floating_ui_dom_browser_min_p(t)&&t.host||floating_ui_dom_browser_min_R(t);return floating_ui_dom_browser_min_p(e)?e.host:e}function W(t){const e=F(t);return floating_ui_dom_browser_min_w(e)?e.ownerDocument.body:floating_ui_dom_browser_min_a(e)&&floating_ui_dom_browser_min_g(e)?e:W(e)}function floating_ui_dom_browser_min_D(t,e){var o;void 0===e&&(e=[]);const i=W(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=floating_ui_dom_browser_min_n(i);return r?e.concat(l,l.visualViewport||[],floating_ui_dom_browser_min_g(i)?i:[]):e.concat(i,floating_ui_dom_browser_min_D(i))}function S(e,i,l){let c;if("viewport"===i)c=function(t,e){const o=floating_ui_dom_browser_min_n(t),i=floating_ui_dom_browser_min_R(t),r=o.visualViewport;let l=i.clientWidth,c=i.clientHeight,s=0,f=0;if(r){l=r.width,c=r.height;const t=floating_ui_dom_browser_min_x();(!t||t&&"fixed"===e)&&(s=r.offsetLeft,f=r.offsetTop)}return{width:l,height:c,x:s,y:f}}(e,l);else if("document"===i)c=function(t){const e=floating_ui_dom_browser_min_R(t),n=floating_ui_dom_browser_min_T(t),i=t.ownerDocument.body,l=r(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),c=r(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let s=-n.scrollLeft+C(t);const f=-n.scrollTop;return"rtl"===floating_ui_dom_browser_min_o(i).direction&&(s+=r(e.clientWidth,i.clientWidth)-l),{width:l,height:c,x:s,y:f}}(floating_ui_dom_browser_min_R(e));else if(floating_ui_dom_browser_min_d(i))c=function(t,e){const n=floating_ui_dom_browser_min_E(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=floating_ui_dom_browser_min_a(t)?floating_ui_dom_browser_min_L(t):{x:1,y:1};return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(i,l);else{const t={...i};if(floating_ui_dom_browser_min_x()){var s,f;const o=floating_ui_dom_browser_min_n(e);t.x-=(null==(s=o.visualViewport)?void 0:s.offsetLeft)||0,t.y-=(null==(f=o.visualViewport)?void 0:f.offsetTop)||0}c=t}return floating_ui_core_browser_min_l(c)}function floating_ui_dom_browser_min_A(t,e){return floating_ui_dom_browser_min_a(t)&&"fixed"!==floating_ui_dom_browser_min_o(t).position?e?e(t):t.offsetParent:null}function H(t,e){const i=floating_ui_dom_browser_min_n(t);if(!floating_ui_dom_browser_min_a(t))return i;let r=floating_ui_dom_browser_min_A(t,e);for(;r&&floating_ui_dom_browser_min_m(r)&&"static"===floating_ui_dom_browser_min_o(r).position;)r=floating_ui_dom_browser_min_A(r,e);return r&&("html"===floating_ui_dom_browser_min_s(r)||"body"===floating_ui_dom_browser_min_s(r)&&"static"===floating_ui_dom_browser_min_o(r).position&&!floating_ui_dom_browser_min_y(r))?i:r||function(t){let e=F(t);for(;floating_ui_dom_browser_min_a(e)&&!floating_ui_dom_browser_min_w(e);){if(floating_ui_dom_browser_min_y(e))return e;e=F(e)}return null}(t)||i}function V(t,e,n){const o=floating_ui_dom_browser_min_a(e),i=floating_ui_dom_browser_min_R(e),r=floating_ui_dom_browser_min_E(t,!0,"fixed"===n,e);let l={scrollLeft:0,scrollTop:0};const c={x:0,y:0};if(o||!o&&"fixed"!==n)if(("body"!==floating_ui_dom_browser_min_s(e)||floating_ui_dom_browser_min_g(i))&&(l=floating_ui_dom_browser_min_T(e)),floating_ui_dom_browser_min_a(e)){const t=floating_ui_dom_browser_min_E(e,!0);c.x=t.x+e.clientLeft,c.y=t.y+e.clientTop}else i&&(c.x=C(i));return{x:r.left+l.scrollLeft-c.x,y:r.top+l.scrollTop-c.y,width:r.width,height:r.height}}const floating_ui_dom_browser_min_O={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:l,strategy:c}=t;const f="clippingAncestors"===n?function(t,e){const n=e.get(t);if(n)return n;let i=floating_ui_dom_browser_min_D(t).filter((t=>floating_ui_dom_browser_min_d(t)&&"body"!==floating_ui_dom_browser_min_s(t))),r=null;const l="fixed"===floating_ui_dom_browser_min_o(t).position;let c=l?F(t):t;for(;floating_ui_dom_browser_min_d(c)&&!floating_ui_dom_browser_min_w(c);){const t=floating_ui_dom_browser_min_o(c),e=floating_ui_dom_browser_min_y(c);"fixed"===t.position?r=null:(l?e||r:e||"static"!==t.position||!r||!["absolute","fixed"].includes(r.position))?r=t:i=i.filter((t=>t!==c)),c=F(c)}return e.set(t,i),i}(e,this._c):[].concat(n),u=[...f,l],a=u[0],h=u.reduce(((t,n)=>{const o=S(e,n,c);return t.top=r(o.top,t.top),t.right=floating_ui_dom_browser_min_i(o.right,t.right),t.bottom=floating_ui_dom_browser_min_i(o.bottom,t.bottom),t.left=r(o.left,t.left),t}),S(e,a,c));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=floating_ui_dom_browser_min_a(n),r=floating_ui_dom_browser_min_R(n);if(n===r)return e;let l={scrollLeft:0,scrollTop:0},c={x:1,y:1};const f={x:0,y:0};if((i||!i&&"fixed"!==o)&&(("body"!==floating_ui_dom_browser_min_s(n)||floating_ui_dom_browser_min_g(r))&&(l=floating_ui_dom_browser_min_T(n)),floating_ui_dom_browser_min_a(n))){const t=floating_ui_dom_browser_min_E(n);c=floating_ui_dom_browser_min_L(n),f.x=t.x+n.clientLeft,f.y=t.y+n.clientTop}return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+f.x,y:e.y*c.y-l.scrollTop*c.y+f.y}},isElement:floating_ui_dom_browser_min_d,getDimensions:function(t){return floating_ui_dom_browser_min_a(t)?floating_ui_dom_browser_min_c(t):t.getBoundingClientRect()},getOffsetParent:H,getDocumentElement:floating_ui_dom_browser_min_R,getScale:floating_ui_dom_browser_min_L,async getElementRects(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||H,r=this.getDimensions;return{reference:V(e,await i(n),o),floating:{x:0,y:0,...await r(n)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===floating_ui_dom_browser_min_o(t).direction};function floating_ui_dom_browser_min_P(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=!0,animationFrame:c=!1}=o,s=i&&!c,f=s||r?[...floating_ui_dom_browser_min_d(t)?floating_ui_dom_browser_min_D(t):t.contextElement?floating_ui_dom_browser_min_D(t.contextElement):[],...floating_ui_dom_browser_min_D(e)]:[];f.forEach((t=>{s&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)}));let u,a=null;if(l){let o=!0;a=new ResizeObserver((()=>{o||n(),o=!1})),floating_ui_dom_browser_min_d(t)&&!c&&a.observe(t),floating_ui_dom_browser_min_d(t)||!t.contextElement||c||a.observe(t.contextElement),a.observe(e)}let h=c?floating_ui_dom_browser_min_E(t):null;return c&&function e(){const o=floating_ui_dom_browser_min_E(t);!h||o.x===h.x&&o.y===h.y&&o.width===h.width&&o.height===h.height||n();h=o,u=requestAnimationFrame(e)}(),n(),()=>{var t;f.forEach((t=>{s&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),null==(t=a)||t.disconnect(),a=null,c&&cancelAnimationFrame(u)}}const z=(t,n,o)=>{const i=new Map,r={platform:floating_ui_dom_browser_min_O,...o},l={...r.platform,_c:i};return floating_ui_core_browser_min_r(t,n,{...r,platform:l})}; +function floating_ui_dom_browser_min_n(t){var e;return(null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function floating_ui_dom_browser_min_o(t){return floating_ui_dom_browser_min_n(t).getComputedStyle(t)}function floating_ui_dom_browser_min_i(t){return t instanceof floating_ui_dom_browser_min_n(t).Node}function r(t){return floating_ui_dom_browser_min_i(t)?(t.nodeName||"").toLowerCase():""}let l;function floating_ui_dom_browser_min_c(){if(l)return l;const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?(l=t.brands.map((t=>t.brand+"/"+t.version)).join(" "),l):navigator.userAgent}function floating_ui_dom_browser_min_s(t){return t instanceof floating_ui_dom_browser_min_n(t).HTMLElement}function floating_ui_dom_browser_min_f(t){return t instanceof floating_ui_dom_browser_min_n(t).Element}function floating_ui_dom_browser_min_u(t){if("undefined"==typeof ShadowRoot)return!1;return t instanceof floating_ui_dom_browser_min_n(t).ShadowRoot||t instanceof ShadowRoot}function floating_ui_dom_browser_min_a(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=floating_ui_dom_browser_min_o(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(r)}function floating_ui_dom_browser_min_d(t){return["table","td","th"].includes(r(t))}function floating_ui_dom_browser_min_h(t){const e=/firefox/i.test(floating_ui_dom_browser_min_c()),n=floating_ui_dom_browser_min_o(t),i=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!i&&"none"!==i||e&&"filter"===n.willChange||e&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((t=>n.willChange.includes(t)))||["paint","layout","strict","content"].some((t=>{const e=n.contain;return null!=e&&e.includes(t)}))}function floating_ui_dom_browser_min_p(){return/^((?!chrome|android).)*safari/i.test(floating_ui_dom_browser_min_c())}function floating_ui_dom_browser_min_g(t){return["html","body","#document"].includes(r(t))}const floating_ui_dom_browser_min_m=Math.min,floating_ui_dom_browser_min_y=Math.max,floating_ui_dom_browser_min_x=Math.round;function floating_ui_dom_browser_min_w(t){const e=floating_ui_dom_browser_min_o(t);let n=parseFloat(e.width),i=parseFloat(e.height);const r=floating_ui_dom_browser_min_s(t),l=r?t.offsetWidth:n,c=r?t.offsetHeight:i,f=floating_ui_dom_browser_min_x(n)!==l||floating_ui_dom_browser_min_x(i)!==c;return f&&(n=l,i=c),{width:n,height:i,fallback:f}}function floating_ui_dom_browser_min_v(t){return floating_ui_dom_browser_min_f(t)?t:t.contextElement}const floating_ui_dom_browser_min_b={x:1,y:1};function floating_ui_dom_browser_min_L(t){const e=floating_ui_dom_browser_min_v(t);if(!floating_ui_dom_browser_min_s(e))return floating_ui_dom_browser_min_b;const n=e.getBoundingClientRect(),{width:o,height:i,fallback:r}=floating_ui_dom_browser_min_w(e);let l=(r?floating_ui_dom_browser_min_x(n.width):n.width)/o,c=(r?floating_ui_dom_browser_min_x(n.height):n.height)/i;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}function floating_ui_dom_browser_min_E(e,o,i,r){var l,c;void 0===o&&(o=!1),void 0===i&&(i=!1);const s=e.getBoundingClientRect(),u=floating_ui_dom_browser_min_v(e);let a=floating_ui_dom_browser_min_b;o&&(r?floating_ui_dom_browser_min_f(r)&&(a=floating_ui_dom_browser_min_L(r)):a=floating_ui_dom_browser_min_L(e));const d=u?floating_ui_dom_browser_min_n(u):window,h=floating_ui_dom_browser_min_p()&&i;let g=(s.left+(h&&(null==(l=d.visualViewport)?void 0:l.offsetLeft)||0))/a.x,m=(s.top+(h&&(null==(c=d.visualViewport)?void 0:c.offsetTop)||0))/a.y,y=s.width/a.x,x=s.height/a.y;if(u){const t=floating_ui_dom_browser_min_n(u),e=r&&floating_ui_dom_browser_min_f(r)?floating_ui_dom_browser_min_n(r):r;let o=t.frameElement;for(;o&&r&&e!==t;){const t=floating_ui_dom_browser_min_L(o),e=o.getBoundingClientRect(),i=getComputedStyle(o);e.x+=(o.clientLeft+parseFloat(i.paddingLeft))*t.x,e.y+=(o.clientTop+parseFloat(i.paddingTop))*t.y,g*=t.x,m*=t.y,y*=t.x,x*=t.y,g+=e.x,m+=e.y,o=floating_ui_dom_browser_min_n(o).frameElement}}return floating_ui_core_browser_min_l({width:y,height:x,x:g,y:m})}function floating_ui_dom_browser_min_T(t){return((floating_ui_dom_browser_min_i(t)?t.ownerDocument:t.document)||window.document).documentElement}function floating_ui_dom_browser_min_R(t){return floating_ui_dom_browser_min_f(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function C(t){return floating_ui_dom_browser_min_E(floating_ui_dom_browser_min_T(t)).left+floating_ui_dom_browser_min_R(t).scrollLeft}function F(t){if("html"===r(t))return t;const e=t.assignedSlot||t.parentNode||floating_ui_dom_browser_min_u(t)&&t.host||floating_ui_dom_browser_min_T(t);return floating_ui_dom_browser_min_u(e)?e.host:e}function S(t){const e=F(t);return floating_ui_dom_browser_min_g(e)?e.ownerDocument.body:floating_ui_dom_browser_min_s(e)&&floating_ui_dom_browser_min_a(e)?e:S(e)}function W(t,e){var o;void 0===e&&(e=[]);const i=S(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=floating_ui_dom_browser_min_n(i);return r?e.concat(l,l.visualViewport||[],floating_ui_dom_browser_min_a(i)?i:[]):e.concat(i,W(i))}function floating_ui_dom_browser_min_D(e,i,r){let l;if("viewport"===i)l=function(t,e){const o=floating_ui_dom_browser_min_n(t),i=floating_ui_dom_browser_min_T(t),r=o.visualViewport;let l=i.clientWidth,c=i.clientHeight,s=0,f=0;if(r){l=r.width,c=r.height;const t=floating_ui_dom_browser_min_p();(!t||t&&"fixed"===e)&&(s=r.offsetLeft,f=r.offsetTop)}return{width:l,height:c,x:s,y:f}}(e,r);else if("document"===i)l=function(t){const e=floating_ui_dom_browser_min_T(t),n=floating_ui_dom_browser_min_R(t),i=t.ownerDocument.body,r=floating_ui_dom_browser_min_y(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),l=floating_ui_dom_browser_min_y(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let c=-n.scrollLeft+C(t);const s=-n.scrollTop;return"rtl"===floating_ui_dom_browser_min_o(i).direction&&(c+=floating_ui_dom_browser_min_y(e.clientWidth,i.clientWidth)-r),{width:r,height:l,x:c,y:s}}(floating_ui_dom_browser_min_T(e));else if(floating_ui_dom_browser_min_f(i))l=function(t,e){const n=floating_ui_dom_browser_min_E(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=floating_ui_dom_browser_min_s(t)?floating_ui_dom_browser_min_L(t):{x:1,y:1};return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(i,r);else{const t={...i};if(floating_ui_dom_browser_min_p()){var c,u;const o=floating_ui_dom_browser_min_n(e);t.x-=(null==(c=o.visualViewport)?void 0:c.offsetLeft)||0,t.y-=(null==(u=o.visualViewport)?void 0:u.offsetTop)||0}l=t}return floating_ui_core_browser_min_l(l)}function V(t,e){const n=F(t);return!(n===e||!floating_ui_dom_browser_min_f(n)||floating_ui_dom_browser_min_g(n))&&("fixed"===floating_ui_dom_browser_min_o(n).position||V(n,e))}function floating_ui_dom_browser_min_A(t,e){return floating_ui_dom_browser_min_s(t)&&"fixed"!==floating_ui_dom_browser_min_o(t).position?e?e(t):t.offsetParent:null}function H(t,e){const i=floating_ui_dom_browser_min_n(t);if(!floating_ui_dom_browser_min_s(t))return i;let l=floating_ui_dom_browser_min_A(t,e);for(;l&&floating_ui_dom_browser_min_d(l)&&"static"===floating_ui_dom_browser_min_o(l).position;)l=floating_ui_dom_browser_min_A(l,e);return l&&("html"===r(l)||"body"===r(l)&&"static"===floating_ui_dom_browser_min_o(l).position&&!floating_ui_dom_browser_min_h(l))?i:l||function(t){let e=F(t);for(;floating_ui_dom_browser_min_s(e)&&!floating_ui_dom_browser_min_g(e);){if(floating_ui_dom_browser_min_h(e))return e;e=F(e)}return null}(t)||i}function floating_ui_dom_browser_min_O(t,e,n){const o=floating_ui_dom_browser_min_s(e),i=floating_ui_dom_browser_min_T(e),l=floating_ui_dom_browser_min_E(t,!0,"fixed"===n,e);let c={scrollLeft:0,scrollTop:0};const f={x:0,y:0};if(o||!o&&"fixed"!==n)if(("body"!==r(e)||floating_ui_dom_browser_min_a(i))&&(c=floating_ui_dom_browser_min_R(e)),floating_ui_dom_browser_min_s(e)){const t=floating_ui_dom_browser_min_E(e,!0);f.x=t.x+e.clientLeft,f.y=t.y+e.clientTop}else i&&(f.x=C(i));return{x:l.left+c.scrollLeft-f.x,y:l.top+c.scrollTop-f.y,width:l.width,height:l.height}}const floating_ui_dom_browser_min_P={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:i,strategy:l}=t;const c="clippingAncestors"===n?function(t,e){const n=e.get(t);if(n)return n;let i=W(t).filter((t=>floating_ui_dom_browser_min_f(t)&&"body"!==r(t))),l=null;const c="fixed"===floating_ui_dom_browser_min_o(t).position;let s=c?F(t):t;for(;floating_ui_dom_browser_min_f(s)&&!floating_ui_dom_browser_min_g(s);){const e=floating_ui_dom_browser_min_o(s),n=floating_ui_dom_browser_min_h(s);n||"fixed"!==e.position||(l=null),(c?!n&&!l:!n&&"static"===e.position&&l&&["absolute","fixed"].includes(l.position)||floating_ui_dom_browser_min_a(s)&&!n&&V(t,s))?i=i.filter((t=>t!==s)):l=e,s=F(s)}return e.set(t,i),i}(e,this._c):[].concat(n),s=[...c,i],u=s[0],d=s.reduce(((t,n)=>{const o=floating_ui_dom_browser_min_D(e,n,l);return t.top=floating_ui_dom_browser_min_y(o.top,t.top),t.right=floating_ui_dom_browser_min_m(o.right,t.right),t.bottom=floating_ui_dom_browser_min_m(o.bottom,t.bottom),t.left=floating_ui_dom_browser_min_y(o.left,t.left),t}),floating_ui_dom_browser_min_D(e,u,l));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=floating_ui_dom_browser_min_s(n),l=floating_ui_dom_browser_min_T(n);if(n===l)return e;let c={scrollLeft:0,scrollTop:0},f={x:1,y:1};const u={x:0,y:0};if((i||!i&&"fixed"!==o)&&(("body"!==r(n)||floating_ui_dom_browser_min_a(l))&&(c=floating_ui_dom_browser_min_R(n)),floating_ui_dom_browser_min_s(n))){const t=floating_ui_dom_browser_min_E(n);f=floating_ui_dom_browser_min_L(n),u.x=t.x+n.clientLeft,u.y=t.y+n.clientTop}return{width:e.width*f.x,height:e.height*f.y,x:e.x*f.x-c.scrollLeft*f.x+u.x,y:e.y*f.y-c.scrollTop*f.y+u.y}},isElement:floating_ui_dom_browser_min_f,getDimensions:function(t){return floating_ui_dom_browser_min_w(t)},getOffsetParent:H,getDocumentElement:floating_ui_dom_browser_min_T,getScale:floating_ui_dom_browser_min_L,async getElementRects(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||H,r=this.getDimensions;return{reference:floating_ui_dom_browser_min_O(e,await i(n),o),floating:{x:0,y:0,...await r(n)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===floating_ui_dom_browser_min_o(t).direction};function z(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=!0,animationFrame:c=!1}=o,s=i||r?[...floating_ui_dom_browser_min_f(t)?W(t):t.contextElement?W(t.contextElement):[],...W(e)]:[];s.forEach((t=>{const e=!floating_ui_dom_browser_min_f(t)&&t.toString().includes("V");!i||c&&!e||t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)}));let u,a=null;l&&(a=new ResizeObserver((()=>{n()})),floating_ui_dom_browser_min_f(t)&&!c&&a.observe(t),floating_ui_dom_browser_min_f(t)||!t.contextElement||c||a.observe(t.contextElement),a.observe(e));let d=c?floating_ui_dom_browser_min_E(t):null;return c&&function e(){const o=floating_ui_dom_browser_min_E(t);!d||o.x===d.x&&o.y===d.y&&o.width===d.width&&o.height===d.height||n();d=o,u=requestAnimationFrame(e)}(),n(),()=>{var t;s.forEach((t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),null==(t=a)||t.disconnect(),a=null,c&&cancelAnimationFrame(u)}}const floating_ui_dom_browser_min_k=(t,n,o)=>{const i=new Map,r={platform:floating_ui_dom_browser_min_P,...o},l={...r.platform,_c:i};return floating_ui_core_browser_min_r(t,n,{...r,platform:l})}; ;// CONCATENATED MODULE: external "ReactDOM" var external_ReactDOM_namespaceObject = window["ReactDOM"]; @@ -5222,7 +5222,7 @@ function useFloating(_temp) { return; } - z(reference.current, floating.current, { + floating_ui_dom_browser_min_k(reference.current, floating.current, { middleware: latestMiddleware, placement, strategy @@ -15891,6 +15891,7 @@ var Enum_KEYFRAMES = '@keyframes' var FONT_FACE = '@font-face' var COUNTER_STYLE = '@counter-style' var FONT_FEATURE_VALUES = '@font-feature-values' +var LAYER = '@layer' ;// CONCATENATED MODULE: ./node_modules/stylis/src/Serializer.js @@ -15920,6 +15921,7 @@ function Serializer_serialize (children, callback) { */ function stringify (element, index, children, callback) { switch (element.type) { + case LAYER: if (element.children.length) break case IMPORT: case Enum_DECLARATION: return element.return = element.return || element.value case COMMENT: return '' case Enum_KEYFRAMES: return element.return = element.value + '{' + Serializer_serialize(element.children, callback) + '}' @@ -16121,7 +16123,7 @@ function Parser_parse (value, root, parent, rule, rules, rulesets, pseudo, point // \0 } case 0: case 125: scanning = 0 // ; - case 59 + offset: + case 59 + offset: if (ampersand == -1) characters = Utility_replace(characters, /\f/g, '') if (property > 0 && (Utility_strlen(characters) - length)) Utility_append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(Utility_replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations) break @@ -16136,8 +16138,8 @@ function Parser_parse (value, root, parent, rule, rules, rulesets, pseudo, point Parser_parse(characters, root, reference, reference, props, rulesets, length, points, children) else switch (atrule === 99 && Utility_charat(characters, 3) === 110 ? 100 : atrule) { - // d m s - case 100: case 109: case 115: + // d l m s + case 100: case 108: case 109: case 115: Parser_parse(value, reference, reference, rule && Utility_append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children) break default: @@ -16374,7 +16376,7 @@ var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) { var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g); if (unsafePseudoClasses) { - var isNested = element.parent === children[0]; // in nested rules comments become children of the "auto-inserted" rule + var isNested = !!element.parent; // in nested rules comments become children of the "auto-inserted" rule and that's always the `element.parent` // // considering this input: // .a { @@ -16390,7 +16392,7 @@ var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) { // .b {} // } - var commentContainer = isNested ? children[0].children : // global rule at the root level + var commentContainer = isNested ? element.parent.children : // global rule at the root level children; for (var i = commentContainer.length - 1; i >= 0; i--) { @@ -16690,7 +16692,7 @@ var createCache = function createCache(options) { if (false) {} - if ( key === 'css') { + if (key === 'css') { var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be) // note this very very intentionally targets all style elements regardless of the key to ensure @@ -16785,7 +16787,7 @@ var createCache = function createCache(options) { return cache; }; -/* harmony default export */ var emotion_cache_browser_esm = (createCache); + ;// CONCATENATED MODULE: ./node_modules/@emotion/hash/dist/emotion-hash.esm.js /* eslint-disable */ @@ -16842,11 +16844,12 @@ function murmur2(str) { return ((h ^ h >>> 15) >>> 0).toString(36); } -/* harmony default export */ var emotion_hash_esm = (murmur2); + ;// CONCATENATED MODULE: ./node_modules/@emotion/unitless/dist/emotion-unitless.esm.js var unitlessKeys = { animationIterationCount: 1, + aspectRatio: 1, borderImageOutset: 1, borderImageSlice: 1, borderImageWidth: 1, @@ -16894,7 +16897,7 @@ var unitlessKeys = { strokeWidth: 1 }; -/* harmony default export */ var emotion_unitless_esm = (unitlessKeys); + ;// CONCATENATED MODULE: ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js function memoize(fn) { @@ -16905,7 +16908,7 @@ function memoize(fn) { }; } -/* harmony default export */ var emotion_memoize_esm = (memoize); + ;// CONCATENATED MODULE: ./node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js @@ -16925,7 +16928,7 @@ var isProcessableValue = function isProcessableValue(value) { return value != null && typeof value !== 'boolean'; }; -var processStyleName = /* #__PURE__ */emotion_memoize_esm(function (styleName) { +var processStyleName = /* #__PURE__ */memoize(function (styleName) { return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase(); }); @@ -16947,7 +16950,7 @@ var processStyleValue = function processStyleValue(key, value) { } } - if (emotion_unitless_esm[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) { + if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) { return value + 'px'; } @@ -17143,7 +17146,7 @@ var emotion_serialize_browser_esm_serializeStyles = function serializeStyles(arg match[1]; } - var name = emotion_hash_esm(styles) + identifierName; + var name = murmur2(styles) + identifierName; if (false) {} @@ -17159,18 +17162,17 @@ var emotion_serialize_browser_esm_serializeStyles = function serializeStyles(arg ;// CONCATENATED MODULE: ./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js - var syncFallback = function syncFallback(create) { return create(); }; var useInsertionEffect = external_React_['useInsertion' + 'Effect'] ? external_React_['useInsertion' + 'Effect'] : false; -var emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback; +var emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback; var emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectWithLayoutFallback = useInsertionEffect || external_React_.useLayoutEffect; -;// CONCATENATED MODULE: ./node_modules/@emotion/react/dist/emotion-element-6a883da9.browser.esm.js +;// CONCATENATED MODULE: ./node_modules/@emotion/react/dist/emotion-element-c39617d8.browser.esm.js @@ -17180,15 +17182,17 @@ var emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectWi -var emotion_element_6a883da9_browser_esm_hasOwnProperty = {}.hasOwnProperty; -var EmotionCacheContext = /* #__PURE__ */(0,external_React_.createContext)( // we're doing this to avoid preconstruct's dead code elimination in this one case +var emotion_element_c39617d8_browser_esm_isBrowser = "object" !== 'undefined'; +var emotion_element_c39617d8_browser_esm_hasOwnProperty = {}.hasOwnProperty; + +var EmotionCacheContext = /* #__PURE__ */external_React_.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case // because this module is primarily intended for the browser and node // but it's also required in react native and similar environments sometimes // and we could have a special build just for that // but this is much easier and the native packages // might use a different theme context in the future anyway -typeof HTMLElement !== 'undefined' ? /* #__PURE__ */emotion_cache_browser_esm({ +typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({ key: 'css' }) : null); @@ -17199,7 +17203,7 @@ var __unsafe_useEmotionCache = function useEmotionCache() { return (0,external_React_.useContext)(EmotionCacheContext); }; -var emotion_element_6a883da9_browser_esm_withEmotionCache = function withEmotionCache(func) { +var emotion_element_c39617d8_browser_esm_withEmotionCache = function withEmotionCache(func) { // $FlowFixMe return /*#__PURE__*/(0,external_React_.forwardRef)(function (props, ref) { // the cache will never be null in the browser @@ -17208,12 +17212,36 @@ var emotion_element_6a883da9_browser_esm_withEmotionCache = function withEmotion }); }; -var emotion_element_6a883da9_browser_esm_ThemeContext = /* #__PURE__ */(0,external_React_.createContext)({}); +if (!emotion_element_c39617d8_browser_esm_isBrowser) { + emotion_element_c39617d8_browser_esm_withEmotionCache = function withEmotionCache(func) { + return function (props) { + var cache = (0,external_React_.useContext)(EmotionCacheContext); + + if (cache === null) { + // yes, we're potentially creating this on every render + // it doesn't actually matter though since it's only on the server + // so there will only every be a single render + // that could change in the future because of suspense and etc. but for now, + // this works and i don't want to optimise for a future thing that we aren't sure about + cache = createCache({ + key: 'css' + }); + return /*#__PURE__*/external_React_.createElement(EmotionCacheContext.Provider, { + value: cache + }, func(props, cache)); + } else { + return func(props, cache); + } + }; + }; +} + +var emotion_element_c39617d8_browser_esm_ThemeContext = /* #__PURE__ */external_React_.createContext({}); if (false) {} var useTheme = function useTheme() { - return useContext(emotion_element_6a883da9_browser_esm_ThemeContext); + return React.useContext(emotion_element_c39617d8_browser_esm_ThemeContext); }; var getTheme = function getTheme(outerTheme, theme) { @@ -17236,13 +17264,13 @@ var createCacheWithTheme = /* #__PURE__ */(/* unused pure expression or super */ }); }))); var ThemeProvider = function ThemeProvider(props) { - var theme = useContext(emotion_element_6a883da9_browser_esm_ThemeContext); + var theme = React.useContext(emotion_element_c39617d8_browser_esm_ThemeContext); if (props.theme !== theme) { theme = createCacheWithTheme(theme)(props.theme); } - return /*#__PURE__*/createElement(emotion_element_6a883da9_browser_esm_ThemeContext.Provider, { + return /*#__PURE__*/React.createElement(emotion_element_c39617d8_browser_esm_ThemeContext.Provider, { value: theme }, props.children); }; @@ -17250,15 +17278,15 @@ function withTheme(Component) { var componentName = Component.displayName || Component.name || 'Component'; var render = function render(props, ref) { - var theme = useContext(emotion_element_6a883da9_browser_esm_ThemeContext); - return /*#__PURE__*/createElement(Component, _extends({ + var theme = React.useContext(emotion_element_c39617d8_browser_esm_ThemeContext); + return /*#__PURE__*/React.createElement(Component, _extends({ theme: theme, ref: ref }, props)); }; // $FlowFixMe - var WithTheme = /*#__PURE__*/forwardRef(render); + var WithTheme = /*#__PURE__*/React.forwardRef(render); WithTheme.displayName = "WithTheme(" + componentName + ")"; return hoistNonReactStatics(WithTheme, Component); } @@ -17308,13 +17336,13 @@ var getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) { var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__'; var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__'; -var emotion_element_6a883da9_browser_esm_createEmotionProps = function createEmotionProps(type, props) { +var emotion_element_c39617d8_browser_esm_createEmotionProps = function createEmotionProps(type, props) { if (false) {} var newProps = {}; for (var key in props) { - if (emotion_element_6a883da9_browser_esm_hasOwnProperty.call(props, key)) { + if (emotion_element_c39617d8_browser_esm_hasOwnProperty.call(props, key)) { newProps[key] = props[key]; } } @@ -17332,14 +17360,14 @@ var Insertion = function Insertion(_ref) { serialized = _ref.serialized, isStringTag = _ref.isStringTag; registerStyles(cache, serialized, isStringTag); - var rules = useInsertionEffectAlwaysWithSyncFallback(function () { + useInsertionEffectAlwaysWithSyncFallback(function () { return insertStyles(cache, serialized, isStringTag); }); return null; }; -var emotion_element_6a883da9_browser_esm_Emotion = /* #__PURE__ */(/* unused pure expression or super */ null && (emotion_element_6a883da9_browser_esm_withEmotionCache(function (props, cache, ref) { +var emotion_element_c39617d8_browser_esm_Emotion = /* #__PURE__ */(/* unused pure expression or super */ null && (emotion_element_c39617d8_browser_esm_withEmotionCache(function (props, cache, ref) { var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works // not passing the registered cache to serializeStyles because it would // make certain babel optimisations not possible @@ -17358,7 +17386,7 @@ var emotion_element_6a883da9_browser_esm_Emotion = /* #__PURE__ */(/* unused pur className = props.className + " "; } - var serialized = serializeStyles(registeredStyles, undefined, useContext(emotion_element_6a883da9_browser_esm_ThemeContext)); + var serialized = serializeStyles(registeredStyles, undefined, React.useContext(emotion_element_c39617d8_browser_esm_ThemeContext)); if (false) { var labelFromStack; } @@ -17366,22 +17394,24 @@ var emotion_element_6a883da9_browser_esm_Emotion = /* #__PURE__ */(/* unused pur var newProps = {}; for (var key in props) { - if (emotion_element_6a883da9_browser_esm_hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ( true || 0)) { + if (emotion_element_c39617d8_browser_esm_hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ( true || 0)) { newProps[key] = props[key]; } } newProps.ref = ref; newProps.className = className; - return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion, { + return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, { cache: cache, serialized: serialized, isStringTag: typeof WrappedComponent === 'string' - }), /*#__PURE__*/createElement(WrappedComponent, newProps)); + }), /*#__PURE__*/React.createElement(WrappedComponent, newProps)); }))); if (false) {} +var Emotion$1 = (/* unused pure expression or super */ null && (emotion_element_c39617d8_browser_esm_Emotion)); + ;// CONCATENATED MODULE: ./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js @@ -17421,7 +17451,7 @@ var emotion_utils_browser_esm_insertStyles = function insertStyles(cache, serial var current = serialized; do { - var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true); + cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true); current = current.next; } while (current !== undefined); @@ -17453,7 +17483,7 @@ function merge(registered, css, className) { } var createEmotion = function createEmotion(options) { - var cache = emotion_cache_browser_esm(options); // $FlowFixMe + var cache = createCache(options); // $FlowFixMe cache.sheet.speedy = function (value) { if (false) {} @@ -17572,7 +17602,7 @@ var emotion_css_create_instance_esm_classnames = function classnames(args) { return cls; }; -/* harmony default export */ var emotion_css_create_instance_esm = (createEmotion); + ;// CONCATENATED MODULE: ./node_modules/@emotion/css/dist/emotion-css.esm.js @@ -17580,7 +17610,7 @@ var emotion_css_create_instance_esm_classnames = function classnames(args) { -var _createEmotion = emotion_css_create_instance_esm({ +var _createEmotion = createEmotion({ key: 'css' }), flush = _createEmotion.flush, @@ -17877,7 +17907,7 @@ const visuallyHidden = { var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23 -var isPropValid = /* #__PURE__ */emotion_memoize_esm(function (prop) { +var isPropValid = /* #__PURE__ */memoize(function (prop) { return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 /* o */ && prop.charCodeAt(1) === 110 @@ -17887,7 +17917,7 @@ var isPropValid = /* #__PURE__ */emotion_memoize_esm(function (prop) { /* Z+1 */ ); -/* harmony default export */ var emotion_is_prop_valid_esm = (isPropValid); + ;// CONCATENATED MODULE: ./node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js @@ -17898,7 +17928,7 @@ var isPropValid = /* #__PURE__ */emotion_memoize_esm(function (prop) { -var testOmitPropsOnStringTag = emotion_is_prop_valid_esm; +var testOmitPropsOnStringTag = isPropValid; var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) { return key !== 'theme'; @@ -17934,7 +17964,7 @@ var emotion_styled_base_browser_esm_Insertion = function Insertion(_ref) { serialized = _ref.serialized, isStringTag = _ref.isStringTag; emotion_utils_browser_esm_registerStyles(cache, serialized, isStringTag); - var rules = emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectAlwaysWithSyncFallback(function () { + emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectAlwaysWithSyncFallback(function () { return emotion_utils_browser_esm_insertStyles(cache, serialized, isStringTag); }); @@ -17982,7 +18012,7 @@ var createStyled = function createStyled(tag, options) { } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class - var Styled = emotion_element_6a883da9_browser_esm_withEmotionCache(function (props, cache, ref) { + var Styled = emotion_element_c39617d8_browser_esm_withEmotionCache(function (props, cache, ref) { var FinalTag = shouldUseAs && props.as || baseTag; var className = ''; var classInterpolations = []; @@ -17995,7 +18025,7 @@ var createStyled = function createStyled(tag, options) { mergedProps[key] = props[key]; } - mergedProps.theme = (0,external_React_.useContext)(emotion_element_6a883da9_browser_esm_ThemeContext); + mergedProps.theme = external_React_.useContext(emotion_element_c39617d8_browser_esm_ThemeContext); } if (typeof props.className === 'string') { @@ -18025,11 +18055,11 @@ var createStyled = function createStyled(tag, options) { newProps.className = className; newProps.ref = ref; - return /*#__PURE__*/(0,external_React_.createElement)(external_React_.Fragment, null, /*#__PURE__*/(0,external_React_.createElement)(emotion_styled_base_browser_esm_Insertion, { + return /*#__PURE__*/external_React_.createElement(external_React_.Fragment, null, /*#__PURE__*/external_React_.createElement(emotion_styled_base_browser_esm_Insertion, { cache: cache, serialized: serialized, isStringTag: typeof FinalTag === 'string' - }), /*#__PURE__*/(0,external_React_.createElement)(FinalTag, newProps)); + }), /*#__PURE__*/external_React_.createElement(FinalTag, newProps)); }); Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")"; Styled.defaultProps = tag.defaultProps; @@ -18056,7 +18086,7 @@ var createStyled = function createStyled(tag, options) { }; }; -/* harmony default export */ var emotion_styled_base_browser_esm = (createStyled); + ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/view/component.js @@ -18083,7 +18113,7 @@ var createStyled = function createStyled(tag, options) { * ``` */ // @ts-expect-error -const View = emotion_styled_base_browser_esm("div", true ? { +const View = createStyled("div", true ? { target: "e19lxcc00" } : 0)( true ? "" : 0); View.selector = '.components-view'; @@ -19733,7 +19763,7 @@ const memoizedCreateCacheWithContainer = memize_default()(container => { } uuidCache.add(key); - return emotion_cache_browser_esm({ + return createCache({ container, key }); @@ -20808,7 +20838,7 @@ const UnforwardedPopover = (props, forwardedRef) => { }; } - }, O(offsetProp), computedFlipProp ? b() : undefined, computedResizeProp ? k({ + }, D(offsetProp), computedFlipProp ? b() : undefined, computedResizeProp ? B({ apply(sizeProps) { var _refs$floating$curren; @@ -20824,7 +20854,7 @@ const UnforwardedPopover = (props, forwardedRef) => { }); } - }) : undefined, shift ? D({ + }) : undefined, shift ? k({ crossAxis: true, limiter: limitShift(), padding: 1 // Necessary to avoid flickering at the edge of the viewport. @@ -20876,7 +20906,7 @@ const UnforwardedPopover = (props, forwardedRef) => { } = useFloating({ placement: normalizedPlacementFromProps, middleware, - whileElementsMounted: (referenceParam, floatingParam, updateParam) => floating_ui_dom_browser_min_P(referenceParam, floatingParam, updateParam, { + whileElementsMounted: (referenceParam, floatingParam, updateParam) => z(referenceParam, floatingParam, updateParam, { animationFrame: true }) }); @@ -21441,7 +21471,7 @@ var hoist_non_react_statics_cjs = __webpack_require__(1281); var pkg = { name: "@emotion/react", - version: "11.10.6", + version: "11.11.0", main: "dist/emotion-react.cjs.js", module: "dist/emotion-react.esm.js", browser: { @@ -21454,6 +21484,7 @@ var pkg = { browser: "./dist/emotion-react.browser.esm.js", "default": "./dist/emotion-react.esm.js" }, + "import": "./dist/emotion-react.cjs.mjs", "default": "./dist/emotion-react.cjs.js" }, "./jsx-runtime": { @@ -21462,6 +21493,7 @@ var pkg = { browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js", "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js" }, + "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs", "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js" }, "./_isolated-hnrs": { @@ -21470,6 +21502,7 @@ var pkg = { browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js", "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js" }, + "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs", "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js" }, "./jsx-dev-runtime": { @@ -21478,11 +21511,18 @@ var pkg = { browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js", "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js" }, + "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs", "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js" }, "./package.json": "./package.json", "./types/css-prop": "./types/css-prop.d.ts", - "./macro": "./macro.js" + "./macro": { + types: { + "import": "./macro.d.mts", + "default": "./macro.d.ts" + }, + "default": "./macro.js" + } }, types: "types/index.d.ts", files: [ @@ -21492,9 +21532,7 @@ var pkg = { "jsx-dev-runtime", "_isolated-hnrs", "types/*.d.ts", - "macro.js", - "macro.d.ts", - "macro.js.flow" + "macro.*" ], sideEffects: false, author: "Emotion Contributors", @@ -21504,12 +21542,12 @@ var pkg = { }, dependencies: { "@babel/runtime": "^7.18.3", - "@emotion/babel-plugin": "^11.10.6", - "@emotion/cache": "^11.10.5", - "@emotion/serialize": "^1.1.1", - "@emotion/use-insertion-effect-with-fallbacks": "^1.0.0", - "@emotion/utils": "^1.2.0", - "@emotion/weak-memoize": "^0.3.0", + "@emotion/babel-plugin": "^11.11.0", + "@emotion/cache": "^11.11.0", + "@emotion/serialize": "^1.1.2", + "@emotion/use-insertion-effect-with-fallbacks": "^1.0.1", + "@emotion/utils": "^1.2.1", + "@emotion/weak-memoize": "^0.3.1", "hoist-non-react-statics": "^3.3.1" }, peerDependencies: { @@ -21522,10 +21560,10 @@ var pkg = { }, devDependencies: { "@definitelytyped/dtslint": "0.0.112", - "@emotion/css": "11.10.6", - "@emotion/css-prettifier": "1.1.1", - "@emotion/server": "11.10.0", - "@emotion/styled": "11.10.6", + "@emotion/css": "11.11.0", + "@emotion/css-prettifier": "1.1.3", + "@emotion/server": "11.11.0", + "@emotion/styled": "11.11.0", "html-tag-names": "^1.1.2", react: "16.14.0", "svg-tag-names": "^1.1.1", @@ -21551,7 +21589,13 @@ var pkg = { ], extra: { "./types/css-prop": "./types/css-prop.d.ts", - "./macro": "./macro.js" + "./macro": { + types: { + "import": "./macro.d.mts", + "default": "./macro.d.ts" + }, + "default": "./macro.js" + } } } } @@ -21562,7 +21606,7 @@ var jsx = function jsx(type, props) { if (props == null || !hasOwnProperty.call(props, 'css')) { // $FlowFixMe - return createElement.apply(undefined, args); + return React.createElement.apply(undefined, args); } var argsLength = args.length; @@ -21575,7 +21619,7 @@ var jsx = function jsx(type, props) { } // $FlowFixMe - return createElement.apply(null, createElementArgArray); + return React.createElement.apply(null, createElementArgArray); }; var warnedAboutCssPropForGlobal = false; // maintain place over rerenders. @@ -21586,13 +21630,41 @@ var Global = /* #__PURE__ */(/* unused pure expression or super */ null && (with if (false) {} var styles = props.styles; - var serialized = serializeStyles([styles], undefined, useContext(ThemeContext)); + var serialized = serializeStyles([styles], undefined, React.useContext(ThemeContext)); + + if (!isBrowser$1) { + var _ref; + + var serializedNames = serialized.name; + var serializedStyles = serialized.styles; + var next = serialized.next; + + while (next !== undefined) { + serializedNames += ' ' + next.name; + serializedStyles += next.styles; + next = next.next; + } + + var shouldCache = cache.compat === true; + var rules = cache.insert("", { + name: serializedNames, + styles: serializedStyles + }, cache.sheet, shouldCache); + + if (shouldCache) { + return null; + } + + return /*#__PURE__*/React.createElement("style", (_ref = {}, _ref["data-emotion"] = cache.key + "-global " + serializedNames, _ref.dangerouslySetInnerHTML = { + __html: rules + }, _ref.nonce = cache.sheet.nonce, _ref)); + } // yes, i know these hooks are used conditionally // but it is based on a constant that will never change at runtime // it's effectively like having two implementations and switching them out // so it's not actually breaking anything - var sheetRef = useRef(); + var sheetRef = React.useRef(); useInsertionEffectWithLayoutFallback(function () { var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675 @@ -21736,10 +21808,10 @@ function emotion_react_browser_esm_merge(registered, css, className) { var emotion_react_browser_esm_Insertion = function Insertion(_ref) { var cache = _ref.cache, serializedArr = _ref.serializedArr; - var rules = useInsertionEffectAlwaysWithSyncFallback(function () { + useInsertionEffectAlwaysWithSyncFallback(function () { for (var i = 0; i < serializedArr.length; i++) { - var res = insertStyles(cache, serializedArr[i], false); + insertStyles(cache, serializedArr[i], false); } }); @@ -21777,11 +21849,11 @@ var ClassNames = /* #__PURE__ */(/* unused pure expression or super */ null && ( var content = { css: css, cx: cx, - theme: useContext(ThemeContext) + theme: React.useContext(ThemeContext) }; var ele = props.children(content); hasRendered = true; - return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(emotion_react_browser_esm_Insertion, { + return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(emotion_react_browser_esm_Insertion, { cache: cache, serializedArr: serializedArr }), ele); @@ -21953,10 +22025,10 @@ const rootSize = _ref2 => { return /*#__PURE__*/emotion_react_browser_esm_css("grid-template-rows:repeat( 3, calc( ", size, "px / 3 ) );width:", size, "px;" + ( true ? "" : 0), true ? "" : 0); }; -const Root = emotion_styled_base_browser_esm("div", true ? { +const Root = createStyled("div", true ? { target: "ecapk1j3" } : 0)(rootBase, ";border:1px solid transparent;cursor:pointer;grid-template-columns:auto;", rootSize, ";" + ( true ? "" : 0)); -const Row = emotion_styled_base_browser_esm("div", true ? { +const Row = createStyled("div", true ? { target: "ecapk1j2" } : 0)( true ? { name: "1x5gbbj", @@ -21976,10 +22048,10 @@ const pointActive = _ref3 => { const pointBase = props => { return /*#__PURE__*/emotion_react_browser_esm_css("background:currentColor;box-sizing:border-box;display:grid;margin:auto;transition:all 120ms linear;", reduceMotion('transition'), " ", pointActive(props), ";" + ( true ? "" : 0), true ? "" : 0); }; -const Point = emotion_styled_base_browser_esm("span", true ? { +const Point = createStyled("span", true ? { target: "ecapk1j1" } : 0)("height:6px;width:6px;", pointBase, ";" + ( true ? "" : 0)); -const Cell = emotion_styled_base_browser_esm("span", true ? { +const Cell = createStyled("span", true ? { target: "ecapk1j0" } : 0)( true ? { name: "rjf3ub", @@ -23695,13 +23767,13 @@ const rootPointerEvents = _ref => { }, true ? "" : 0, true ? "" : 0); }; -const Wrapper = emotion_styled_base_browser_esm("div", true ? { +const Wrapper = createStyled("div", true ? { target: "erowt52" } : 0)( true ? { name: "ogl07i", styles: "box-sizing:border-box;padding:2px" } : 0); -const alignment_matrix_control_icon_styles_Root = emotion_styled_base_browser_esm("div", true ? { +const alignment_matrix_control_icon_styles_Root = createStyled("div", true ? { target: "erowt51" } : 0)("transform-origin:top left;height:100%;width:100%;", rootBase, ";", alignment_matrix_control_icon_styles_rootSize, ";", rootPointerEvents, ";" + ( true ? "" : 0)); @@ -23713,7 +23785,7 @@ const alignment_matrix_control_icon_styles_pointActive = _ref2 => { return /*#__PURE__*/emotion_react_browser_esm_css("box-shadow:", boxShadow, ";color:currentColor;*:hover>&{color:currentColor;}" + ( true ? "" : 0), true ? "" : 0); }; -const alignment_matrix_control_icon_styles_Point = emotion_styled_base_browser_esm("span", true ? { +const alignment_matrix_control_icon_styles_Point = createStyled("span", true ? { target: "erowt50" } : 0)("height:2px;width:2px;", pointBase, ";", alignment_matrix_control_icon_styles_pointActive, ";" + ( true ? "" : 0)); const alignment_matrix_control_icon_styles_Cell = Cell; @@ -25790,7 +25862,7 @@ const rootFocusedStyles = _ref3 => { return _ref2; }; -const input_control_styles_Root = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? { +const input_control_styles_Root = /*#__PURE__*/createStyled(flex_component, true ? { target: "em5sgkm7" } : 0)("box-sizing:border-box;position:relative;border-radius:2px;padding-top:0;", rootFocusedStyles, ";" + ( true ? "" : 0)); @@ -25828,7 +25900,7 @@ const containerWidthStyles = _ref5 => { }, true ? "" : 0, true ? "" : 0); }; -const Container = emotion_styled_base_browser_esm("div", true ? { +const Container = createStyled("div", true ? { target: "em5sgkm6" } : 0)("align-items:center;box-sizing:border-box;border-radius:inherit;display:flex;flex:1;position:relative;", containerDisabledStyles, " ", containerWidthStyles, ";" + ( true ? "" : 0)); @@ -25936,18 +26008,18 @@ const dragStyles = _ref10 => { // https://github.com/WordPress/gutenberg/issues/18483 -const Input = emotion_styled_base_browser_esm("input", true ? { +const Input = createStyled("input", true ? { target: "em5sgkm5" } : 0)("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:", COLORS.gray[900], ";display:block;font-family:inherit;margin:0;outline:none;width:100%;", dragStyles, " ", disabledStyles, " ", fontSizeStyles, " ", sizeStyles, " ", customPaddings, " &::-webkit-input-placeholder{line-height:normal;}}" + ( true ? "" : 0)); -const BaseLabel = /*#__PURE__*/emotion_styled_base_browser_esm(text_component, true ? { +const BaseLabel = /*#__PURE__*/createStyled(text_component, true ? { target: "em5sgkm4" } : 0)("&&&{", baseLabelTypography, ";box-sizing:border-box;display:block;padding-top:0;padding-bottom:0;max-width:100%;z-index:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}" + ( true ? "" : 0)); const Label = props => (0,external_wp_element_namespaceObject.createElement)(BaseLabel, extends_extends({}, props, { as: "label" })); -const LabelWrapper = /*#__PURE__*/emotion_styled_base_browser_esm(flex_item_component, true ? { +const LabelWrapper = /*#__PURE__*/createStyled(flex_item_component, true ? { target: "em5sgkm3" } : 0)( true ? { name: "1b6uupn", @@ -25978,18 +26050,18 @@ const backdropFocusedStyles = _ref11 => { }, true ? "" : 0, true ? "" : 0); }; -const BackdropUI = emotion_styled_base_browser_esm("div", true ? { +const BackdropUI = createStyled("div", true ? { target: "em5sgkm2" } : 0)("&&&{box-sizing:border-box;border-radius:inherit;bottom:0;left:0;margin:0;padding:0;pointer-events:none;position:absolute;right:0;top:0;", backdropFocusedStyles, " ", rtl({ paddingLeft: 2 }), ";}" + ( true ? "" : 0)); -const Prefix = emotion_styled_base_browser_esm("span", true ? { +const Prefix = createStyled("span", true ? { target: "em5sgkm1" } : 0)( true ? { name: "pvvbxf", styles: "box-sizing:border-box;display:block" } : 0); -const Suffix = emotion_styled_base_browser_esm("span", true ? { +const Suffix = createStyled("span", true ? { target: "em5sgkm0" } : 0)( true ? { name: "jgf79h", @@ -26217,7 +26289,7 @@ function computeRubberband(bounds, [Vx, Vy], [Rx, Ry]) { -;// CONCATENATED MODULE: ./node_modules/@use-gesture/core/dist/actions-b1cc53c2.esm.js +;// CONCATENATED MODULE: ./node_modules/@use-gesture/core/dist/actions-94b581a0.esm.js function _toPrimitive(input, hint) { @@ -26236,7 +26308,7 @@ function _toPropertyKey(arg) { return typeof key === "symbol" ? key : String(key); } -function actions_b1cc53c2_esm_defineProperty(obj, key, value) { +function actions_94b581a0_esm_defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { @@ -26251,7 +26323,7 @@ function actions_b1cc53c2_esm_defineProperty(obj, key, value) { return obj; } -function actions_b1cc53c2_esm_ownKeys(object, enumerableOnly) { +function actions_94b581a0_esm_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); @@ -26261,12 +26333,12 @@ function actions_b1cc53c2_esm_ownKeys(object, enumerableOnly) { } return keys; } -function actions_b1cc53c2_esm_objectSpread2(target) { +function actions_94b581a0_esm_objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; - i % 2 ? actions_b1cc53c2_esm_ownKeys(Object(source), !0).forEach(function (key) { - actions_b1cc53c2_esm_defineProperty(target, key, source[key]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : actions_b1cc53c2_esm_ownKeys(Object(source)).forEach(function (key) { + i % 2 ? actions_94b581a0_esm_ownKeys(Object(source), !0).forEach(function (key) { + actions_94b581a0_esm_defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : actions_94b581a0_esm_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } @@ -26348,18 +26420,21 @@ function getValueEvent(event) { return isTouch(event) ? getTouchList(event)[0] : event; } function distanceAngle(P1, P2) { - const dx = P2.clientX - P1.clientX; - const dy = P2.clientY - P1.clientY; - const cx = (P2.clientX + P1.clientX) / 2; - const cy = (P2.clientY + P1.clientY) / 2; - const distance = Math.hypot(dx, dy); - const angle = -(Math.atan2(dx, dy) * 180) / Math.PI; - const origin = [cx, cy]; - return { - angle, - distance, - origin - }; + try { + const dx = P2.clientX - P1.clientX; + const dy = P2.clientY - P1.clientY; + const cx = (P2.clientX + P1.clientX) / 2; + const cy = (P2.clientY + P1.clientY) / 2; + const distance = Math.hypot(dx, dy); + const angle = -(Math.atan2(dx, dy) * 180) / Math.PI; + const origin = [cx, cy]; + return { + angle, + distance, + origin + }; + } catch (_unused) {} + return null; } function touchIds(event) { return getCurrentTargetTouchList(event).map(touch => touch.identifier); @@ -26430,9 +26505,9 @@ function call(v, ...args) { return v; } } -function actions_b1cc53c2_esm_noop() {} +function actions_94b581a0_esm_noop() {} function chain(...fns) { - if (fns.length === 0) return actions_b1cc53c2_esm_noop; + if (fns.length === 0) return actions_94b581a0_esm_noop; if (fns.length === 1) return fns[0]; return function () { let result; @@ -26502,7 +26577,7 @@ class Engine { state.args = args; state.axis = undefined; state.memo = undefined; - state.elapsedTime = 0; + state.elapsedTime = state.timeDelta = 0; state.direction = [0, 0]; state.distance = [0, 0]; state.overflow = [0, 0]; @@ -26523,8 +26598,8 @@ class Engine { state.currentTarget = event.currentTarget; state.lastOffset = config.from ? call(config.from, state) : state.offset; state.offset = state.lastOffset; + state.startTime = state.timeStamp = event.timeStamp; } - state.startTime = state.timeStamp = event.timeStamp; } computeValues(values) { const state = this.state; @@ -26618,6 +26693,7 @@ class Engine { state._direction = state._delta.map(Math.sign); if (!state.first && dt > 0) { state.velocity = [absoluteDelta[0] / dt, absoluteDelta[1] / dt]; + state.timeDelta = dt; } } } @@ -26627,7 +26703,7 @@ class Engine { const config = this.config; if (!state._active) this.clean(); if ((state._blocked || !state.intentional) && !state._force && !config.triggerAllEvents) return; - const memo = this.handler(actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, shared), state), {}, { + const memo = this.handler(actions_94b581a0_esm_objectSpread2(actions_94b581a0_esm_objectSpread2(actions_94b581a0_esm_objectSpread2({}, shared), state), {}, { [this.aliasKey]: state.values })); if (memo !== undefined) state.memo = memo; @@ -26652,7 +26728,7 @@ function selectAxis([dx, dy], threshold) { class CoordinatesEngine extends Engine { constructor(...args) { super(...args); - actions_b1cc53c2_esm_defineProperty(this, "aliasKey", 'xy'); + actions_94b581a0_esm_defineProperty(this, "aliasKey", 'xy'); } reset() { super.reset(); @@ -26698,7 +26774,7 @@ const commonConfigResolver = { return value; }, eventOptions(value, _k, config) { - return actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, config.shared.eventOptions), value); + return actions_94b581a0_esm_objectSpread2(actions_94b581a0_esm_objectSpread2({}, config.shared.eventOptions), value); }, preventDefault(value = false) { return value; @@ -26733,7 +26809,7 @@ const commonConfigResolver = { if (false) {} const DEFAULT_AXIS_THRESHOLD = 0; -const coordinatesConfigResolver = actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, commonConfigResolver), {}, { +const coordinatesConfigResolver = actions_94b581a0_esm_objectSpread2(actions_94b581a0_esm_objectSpread2({}, commonConfigResolver), {}, { axis(_v, _k, { axis }) { @@ -26772,7 +26848,7 @@ const KEYS_DELTA_MAP = { class DragEngine extends CoordinatesEngine { constructor(...args) { super(...args); - actions_b1cc53c2_esm_defineProperty(this, "ingKey", 'dragging'); + actions_94b581a0_esm_defineProperty(this, "ingKey", 'dragging'); } reset() { super.reset(); @@ -26918,15 +26994,16 @@ class DragEngine extends CoordinatesEngine { if (state.tap && config.filterTaps) { state._force = true; } else { - const [dirx, diry] = state.direction; - const [vx, vy] = state.velocity; - const [mx, my] = state.movement; + const [_dx, _dy] = state._delta; + const [_mx, _my] = state._movement; const [svx, svy] = config.swipe.velocity; const [sx, sy] = config.swipe.distance; const sdt = config.swipe.duration; if (state.elapsedTime < sdt) { - if (Math.abs(vx) > svx && Math.abs(mx) > sx) state.swipe[0] = dirx; - if (Math.abs(vy) > svy && Math.abs(my) > sy) state.swipe[1] = diry; + const _vx = Math.abs(_dx / state.timeDelta); + const _vy = Math.abs(_dy / state.timeDelta); + if (_vx > svx && Math.abs(_mx) > sx) state.swipe[0] = Math.sign(_dx); + if (_vy > svy && Math.abs(_my) > sy) state.swipe[1] = Math.sign(_dy); } } this.emit(); @@ -27022,18 +27099,18 @@ function persistEvent(event) { 'persist' in event && typeof event.persist === 'function' && event.persist(); } -const actions_b1cc53c2_esm_isBrowser = typeof window !== 'undefined' && window.document && window.document.createElement; -function actions_b1cc53c2_esm_supportsTouchEvents() { - return actions_b1cc53c2_esm_isBrowser && 'ontouchstart' in window; +const actions_94b581a0_esm_isBrowser = typeof window !== 'undefined' && window.document && window.document.createElement; +function actions_94b581a0_esm_supportsTouchEvents() { + return actions_94b581a0_esm_isBrowser && 'ontouchstart' in window; } function isTouchScreen() { - return actions_b1cc53c2_esm_supportsTouchEvents() || actions_b1cc53c2_esm_isBrowser && window.navigator.maxTouchPoints > 1; + return actions_94b581a0_esm_supportsTouchEvents() || actions_94b581a0_esm_isBrowser && window.navigator.maxTouchPoints > 1; } -function actions_b1cc53c2_esm_supportsPointerEvents() { - return actions_b1cc53c2_esm_isBrowser && 'onpointerdown' in window; +function actions_94b581a0_esm_supportsPointerEvents() { + return actions_94b581a0_esm_isBrowser && 'onpointerdown' in window; } function supportsPointerLock() { - return actions_b1cc53c2_esm_isBrowser && 'exitPointerLock' in window.document; + return actions_94b581a0_esm_isBrowser && 'exitPointerLock' in window.document; } function supportsGestureEvents() { try { @@ -27043,11 +27120,11 @@ function supportsGestureEvents() { } } const SUPPORT = { - isBrowser: actions_b1cc53c2_esm_isBrowser, + isBrowser: actions_94b581a0_esm_isBrowser, gesture: supportsGestureEvents(), touch: isTouchScreen(), touchscreen: isTouchScreen(), - pointer: actions_b1cc53c2_esm_supportsPointerEvents(), + pointer: actions_94b581a0_esm_supportsPointerEvents(), pointerLock: supportsPointerLock() }; @@ -27062,7 +27139,7 @@ const DEFAULT_DRAG_AXIS_THRESHOLD = { touch: 0, pen: 8 }; -const dragConfigResolver = actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, coordinatesConfigResolver), {}, { +const dragConfigResolver = actions_94b581a0_esm_objectSpread2(actions_94b581a0_esm_objectSpread2({}, coordinatesConfigResolver), {}, { device(_v, _k, { pointer: { touch = false, @@ -27128,7 +27205,7 @@ const dragConfigResolver = actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_e }, axisThreshold(value) { if (!value) return DEFAULT_DRAG_AXIS_THRESHOLD; - return actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, DEFAULT_DRAG_AXIS_THRESHOLD), value); + return actions_94b581a0_esm_objectSpread2(actions_94b581a0_esm_objectSpread2({}, DEFAULT_DRAG_AXIS_THRESHOLD), value); }, keyboardDisplacement(value = DEFAULT_KEYBOARD_DISPLACEMENT) { return value; @@ -27153,8 +27230,8 @@ const PINCH_WHEEL_RATIO = 100; class PinchEngine extends Engine { constructor(...args) { super(...args); - actions_b1cc53c2_esm_defineProperty(this, "ingKey", 'pinching'); - actions_b1cc53c2_esm_defineProperty(this, "aliasKey", 'da'); + actions_94b581a0_esm_defineProperty(this, "ingKey", 'pinching'); + actions_94b581a0_esm_defineProperty(this, "aliasKey", 'da'); } init() { this.state.offset = [1, 0]; @@ -27222,6 +27299,7 @@ class PinchEngine extends Engine { this.start(event); state._touchIds = Array.from(ctrlTouchIds).slice(0, 2); const payload = touchDistanceAngle(event, state._touchIds); + if (!payload) return; this.pinchStart(event, payload); } pointerStart(event) { @@ -27240,6 +27318,7 @@ class PinchEngine extends Engine { if (state._pointerEvents.size < 2) return; this.start(event); const payload = distanceAngle(...Array.from(_pointerEvents.values())); + if (!payload) return; this.pinchStart(event, payload); } pinchStart(event, payload) { @@ -27253,6 +27332,7 @@ class PinchEngine extends Engine { touchMove(event) { if (!this.state._active) return; const payload = touchDistanceAngle(event, this.state._touchIds); + if (!payload) return; this.pinchMove(event, payload); } pointerMove(event) { @@ -27262,6 +27342,7 @@ class PinchEngine extends Engine { } if (!this.state._active) return; const payload = distanceAngle(...Array.from(_pointerEvents.values())); + if (!payload) return; this.pinchMove(event, payload); } pinchMove(event, payload) { @@ -27378,7 +27459,7 @@ class PinchEngine extends Engine { } } -const pinchConfigResolver = actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, commonConfigResolver), {}, { +const pinchConfigResolver = actions_94b581a0_esm_objectSpread2(actions_94b581a0_esm_objectSpread2({}, commonConfigResolver), {}, { device(_v, _k, { shared, pointer: { @@ -27431,7 +27512,7 @@ const pinchConfigResolver = actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_ class MoveEngine extends CoordinatesEngine { constructor(...args) { super(...args); - actions_b1cc53c2_esm_defineProperty(this, "ingKey", 'moving'); + actions_94b581a0_esm_defineProperty(this, "ingKey", 'moving'); } move(event) { if (this.config.mouseOnly && event.pointerType !== 'mouse') return; @@ -27467,14 +27548,14 @@ class MoveEngine extends CoordinatesEngine { } } -const moveConfigResolver = actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, coordinatesConfigResolver), {}, { +const moveConfigResolver = actions_94b581a0_esm_objectSpread2(actions_94b581a0_esm_objectSpread2({}, coordinatesConfigResolver), {}, { mouseOnly: (value = true) => value }); class ScrollEngine extends CoordinatesEngine { constructor(...args) { super(...args); - actions_b1cc53c2_esm_defineProperty(this, "ingKey", 'scrolling'); + actions_94b581a0_esm_defineProperty(this, "ingKey", 'scrolling'); } scroll(event) { if (!this.state._active) this.start(event); @@ -27507,7 +27588,7 @@ const scrollConfigResolver = coordinatesConfigResolver; class WheelEngine extends CoordinatesEngine { constructor(...args) { super(...args); - actions_b1cc53c2_esm_defineProperty(this, "ingKey", 'wheeling'); + actions_94b581a0_esm_defineProperty(this, "ingKey", 'wheeling'); } wheel(event) { if (!this.state._active) this.start(event); @@ -27538,7 +27619,7 @@ const wheelConfigResolver = coordinatesConfigResolver; class HoverEngine extends CoordinatesEngine { constructor(...args) { super(...args); - actions_b1cc53c2_esm_defineProperty(this, "ingKey", 'hovering'); + actions_94b581a0_esm_defineProperty(this, "ingKey", 'hovering'); } enter(event) { if (this.config.mouseOnly && event.pointerType !== 'mouse') return; @@ -27565,42 +27646,42 @@ class HoverEngine extends CoordinatesEngine { } } -const hoverConfigResolver = actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, coordinatesConfigResolver), {}, { +const hoverConfigResolver = actions_94b581a0_esm_objectSpread2(actions_94b581a0_esm_objectSpread2({}, coordinatesConfigResolver), {}, { mouseOnly: (value = true) => value }); -const actions_b1cc53c2_esm_EngineMap = new Map(); +const actions_94b581a0_esm_EngineMap = new Map(); const ConfigResolverMap = new Map(); -function actions_b1cc53c2_esm_registerAction(action) { - actions_b1cc53c2_esm_EngineMap.set(action.key, action.engine); +function actions_94b581a0_esm_registerAction(action) { + actions_94b581a0_esm_EngineMap.set(action.key, action.engine); ConfigResolverMap.set(action.key, action.resolver); } -const actions_b1cc53c2_esm_dragAction = { +const actions_94b581a0_esm_dragAction = { key: 'drag', engine: DragEngine, resolver: dragConfigResolver }; -const actions_b1cc53c2_esm_hoverAction = { +const actions_94b581a0_esm_hoverAction = { key: 'hover', engine: HoverEngine, resolver: hoverConfigResolver }; -const actions_b1cc53c2_esm_moveAction = { +const actions_94b581a0_esm_moveAction = { key: 'move', engine: MoveEngine, resolver: moveConfigResolver }; -const actions_b1cc53c2_esm_pinchAction = { +const actions_94b581a0_esm_pinchAction = { key: 'pinch', engine: PinchEngine, resolver: pinchConfigResolver }; -const actions_b1cc53c2_esm_scrollAction = { +const actions_94b581a0_esm_scrollAction = { key: 'scroll', engine: ScrollEngine, resolver: scrollConfigResolver }; -const actions_b1cc53c2_esm_wheelAction = { +const actions_94b581a0_esm_wheelAction = { key: 'wheel', engine: WheelEngine, resolver: wheelConfigResolver @@ -27707,14 +27788,14 @@ function use_gesture_core_esm_parse(newConfig, gestureKey, _config = {}) { }, sharedConfigResolver); if (gestureKey) { const resolver = ConfigResolverMap.get(gestureKey); - _config[gestureKey] = resolveWith(actions_b1cc53c2_esm_objectSpread2({ + _config[gestureKey] = resolveWith(actions_94b581a0_esm_objectSpread2({ shared: _config.shared }, rest), resolver); } else { for (const key in rest) { const resolver = ConfigResolverMap.get(key); if (resolver) { - _config[key] = resolveWith(actions_b1cc53c2_esm_objectSpread2({ + _config[key] = resolveWith(actions_94b581a0_esm_objectSpread2({ shared: _config.shared }, rest[key]), resolver); } else if (false) {} @@ -27725,7 +27806,7 @@ function use_gesture_core_esm_parse(newConfig, gestureKey, _config = {}) { class EventStore { constructor(ctrl, gestureKey) { - actions_b1cc53c2_esm_defineProperty(this, "_listeners", new Set()); + actions_94b581a0_esm_defineProperty(this, "_listeners", new Set()); this._ctrl = ctrl; this._gestureKey = gestureKey; } @@ -27733,7 +27814,7 @@ class EventStore { const listeners = this._listeners; const type = toDomEventType(device, action); const _options = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {}; - const eventOptions = actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, _options), options); + const eventOptions = actions_94b581a0_esm_objectSpread2(actions_94b581a0_esm_objectSpread2({}, _options), options); element.addEventListener(type, handler, eventOptions); const remove = () => { element.removeEventListener(type, handler, eventOptions); @@ -27750,7 +27831,7 @@ class EventStore { class TimeoutStore { constructor() { - actions_b1cc53c2_esm_defineProperty(this, "_timeouts", new Map()); + actions_94b581a0_esm_defineProperty(this, "_timeouts", new Map()); } add(key, callback, ms = 140, ...args) { this.remove(key); @@ -27768,15 +27849,15 @@ class TimeoutStore { class Controller { constructor(handlers) { - actions_b1cc53c2_esm_defineProperty(this, "gestures", new Set()); - actions_b1cc53c2_esm_defineProperty(this, "_targetEventStore", new EventStore(this)); - actions_b1cc53c2_esm_defineProperty(this, "gestureEventStores", {}); - actions_b1cc53c2_esm_defineProperty(this, "gestureTimeoutStores", {}); - actions_b1cc53c2_esm_defineProperty(this, "handlers", {}); - actions_b1cc53c2_esm_defineProperty(this, "config", {}); - actions_b1cc53c2_esm_defineProperty(this, "pointerIds", new Set()); - actions_b1cc53c2_esm_defineProperty(this, "touchIds", new Set()); - actions_b1cc53c2_esm_defineProperty(this, "state", { + actions_94b581a0_esm_defineProperty(this, "gestures", new Set()); + actions_94b581a0_esm_defineProperty(this, "_targetEventStore", new EventStore(this)); + actions_94b581a0_esm_defineProperty(this, "gestureEventStores", {}); + actions_94b581a0_esm_defineProperty(this, "gestureTimeoutStores", {}); + actions_94b581a0_esm_defineProperty(this, "handlers", {}); + actions_94b581a0_esm_defineProperty(this, "config", {}); + actions_94b581a0_esm_defineProperty(this, "pointerIds", new Set()); + actions_94b581a0_esm_defineProperty(this, "touchIds", new Set()); + actions_94b581a0_esm_defineProperty(this, "state", { shared: { shiftKey: false, metaKey: false, @@ -27826,13 +27907,13 @@ class Controller { const gestureConfig = this.config[gestureKey]; const bindFunction = bindToProps(props, gestureConfig.eventOptions, !!target); if (gestureConfig.enabled) { - const Engine = actions_b1cc53c2_esm_EngineMap.get(gestureKey); + const Engine = actions_94b581a0_esm_EngineMap.get(gestureKey); new Engine(this, args, gestureKey).bind(bindFunction); } } const nativeBindFunction = bindToProps(props, sharedConfig.eventOptions, !!target); for (const eventKey in this.nativeHandlers) { - nativeBindFunction(eventKey, '', event => this.nativeHandlers[eventKey](actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, this.state.shared), {}, { + nativeBindFunction(eventKey, '', event => this.nativeHandlers[eventKey](actions_94b581a0_esm_objectSpread2(actions_94b581a0_esm_objectSpread2({}, this.state.shared), {}, { event, args })), undefined, true); @@ -27952,7 +28033,7 @@ function useRecognizers(handlers, config = {}, gestureKey, nativeHandlers) { } function use_gesture_react_esm_useDrag(handler, config) { - actions_b1cc53c2_esm_registerAction(actions_b1cc53c2_esm_dragAction); + actions_94b581a0_esm_registerAction(actions_94b581a0_esm_dragAction); return useRecognizers({ drag: handler }, config || {}, 'drag'); @@ -27987,7 +28068,7 @@ function useMove(handler, config) { } function useHover(handler, config) { - actions_b1cc53c2_esm_registerAction(actions_b1cc53c2_esm_hoverAction); + actions_94b581a0_esm_registerAction(actions_94b581a0_esm_hoverAction); return useRecognizers({ hover: handler }, config || {}, 'hover'); @@ -28686,7 +28767,7 @@ function base_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have -const base_control_styles_Wrapper = emotion_styled_base_browser_esm("div", true ? { +const base_control_styles_Wrapper = createStyled("div", true ? { target: "ej5x27r4" } : 0)("font-family:", font('default.fontFamily'), ";font-size:", font('default.fontSize'), ";", boxSizingReset, ";" + ( true ? "" : 0)); @@ -28697,11 +28778,11 @@ const deprecatedMarginField = _ref2 => { return !__nextHasNoMarginBottom && /*#__PURE__*/emotion_react_browser_esm_css("margin-bottom:", space(2), ";" + ( true ? "" : 0), true ? "" : 0); }; -const StyledField = emotion_styled_base_browser_esm("div", true ? { +const StyledField = createStyled("div", true ? { target: "ej5x27r3" } : 0)(deprecatedMarginField, " .components-panel__row &{margin-bottom:inherit;}" + ( true ? "" : 0)); const labelStyles = /*#__PURE__*/emotion_react_browser_esm_css(baseLabelTypography, ";display:inline-block;margin-bottom:", space(2), ";padding:0;" + ( true ? "" : 0), true ? "" : 0); -const StyledLabel = emotion_styled_base_browser_esm("label", true ? { +const StyledLabel = createStyled("label", true ? { target: "ej5x27r2" } : 0)(labelStyles, ";" + ( true ? "" : 0)); @@ -28717,10 +28798,10 @@ const deprecatedMarginHelp = _ref3 => { return !__nextHasNoMarginBottom && base_control_styles_ref; }; -const StyledHelp = emotion_styled_base_browser_esm("p", true ? { +const StyledHelp = createStyled("p", true ? { target: "ej5x27r1" } : 0)("margin-top:", space(2), ";margin-bottom:0;font-size:", font('helpText.fontSize'), ";font-style:normal;color:", COLORS.gray[700], ";", deprecatedMarginHelp, ";" + ( true ? "" : 0)); -const StyledVisualLabel = emotion_styled_base_browser_esm("span", true ? { +const StyledVisualLabel = createStyled("span", true ? { target: "ej5x27r0" } : 0)(labelStyles, ";" + ( true ? "" : 0)); @@ -28988,7 +29069,7 @@ const htmlArrowStyles = _ref2 => { return number_control_styles_ref; }; -const number_control_styles_Input = /*#__PURE__*/emotion_styled_base_browser_esm(input_control, true ? { +const number_control_styles_Input = /*#__PURE__*/createStyled(input_control, true ? { target: "ep09it41" } : 0)(htmlArrowStyles, ";" + ( true ? "" : 0)); @@ -29004,7 +29085,7 @@ const spinButtonSizeStyles = _ref3 => { return /*#__PURE__*/emotion_react_browser_esm_css("width:", space(5), ";min-width:", space(5), ";height:", space(5), ";" + ( true ? "" : 0), true ? "" : 0); }; -const SpinButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_button, true ? { +const SpinButton = /*#__PURE__*/createStyled(build_module_button, true ? { target: "ep09it40" } : 0)("&&&&&{color:", COLORS.ui.theme, ";", spinButtonSizeStyles, ";}" + ( true ? "" : 0)); @@ -29714,19 +29795,19 @@ const deprecatedBottomMargin = _ref => { return !__nextHasNoMarginBottom ? /*#__PURE__*/emotion_react_browser_esm_css("margin-bottom:", space(2), ";" + ( true ? "" : 0), true ? "" : 0) : ''; }; -const angle_picker_control_styles_Root = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? { +const angle_picker_control_styles_Root = /*#__PURE__*/createStyled(flex_component, true ? { target: "e65ony43" } : 0)(deprecatedBottomMargin, ";" + ( true ? "" : 0)); -const CircleRoot = emotion_styled_base_browser_esm("div", true ? { +const CircleRoot = createStyled("div", true ? { target: "e65ony42" } : 0)("border-radius:50%;border:", config_values.borderWidth, " solid ", COLORS.ui.border, ";box-sizing:border-box;cursor:grab;height:", CIRCLE_SIZE, "px;overflow:hidden;width:", CIRCLE_SIZE, "px;" + ( true ? "" : 0)); -const CircleIndicatorWrapper = emotion_styled_base_browser_esm("div", true ? { +const CircleIndicatorWrapper = createStyled("div", true ? { target: "e65ony41" } : 0)( true ? { name: "1r307gh", styles: "box-sizing:border-box;position:relative;width:100%;height:100%;:focus-visible{outline:none;}" } : 0); -const CircleIndicator = emotion_styled_base_browser_esm("div", true ? { +const CircleIndicator = createStyled("div", true ? { target: "e65ony40" } : 0)("background:", COLORS.ui.theme, ";border-radius:50%;border:", INNER_CIRCLE_SIZE, "px solid ", COLORS.ui.theme, ";bottom:0;box-sizing:border-box;display:block;height:0px;left:0;margin:auto;position:absolute;right:0;top:-", CIRCLE_SIZE / 2, "px;width:0px;" + ( true ? "" : 0)); @@ -30947,7 +31028,7 @@ const lineDotted = (0,external_wp_element_namespaceObject.createElement)(externa // TODO: Resolve need to use &&& to increase specificity // https://github.com/WordPress/gutenberg/issues/18483 -const ValueInput = /*#__PURE__*/emotion_styled_base_browser_esm(number_control, true ? { +const ValueInput = /*#__PURE__*/createStyled(number_control, true ? { target: "e1bagdl32" } : 0)("&&&{input{display:block;width:100%;}", BackdropUI, "{transition:box-shadow 0.1s linear;}}" + ( true ? "" : 0)); @@ -30962,7 +31043,7 @@ const baseUnitLabelStyles = _ref => { return selectSize === '__unstable-large' ? sizes.large : sizes.default; }; -const UnitLabel = emotion_styled_base_browser_esm("div", true ? { +const UnitLabel = createStyled("div", true ? { target: "e1bagdl31" } : 0)("&&&{pointer-events:none;", baseUnitLabelStyles, ";color:", COLORS.gray[900], ";}" + ( true ? "" : 0)); @@ -30980,7 +31061,7 @@ const unitSelectSizes = _ref2 => { return selectSize === '__unstable-large' ? sizes.large : sizes.default; }; -const UnitSelect = emotion_styled_base_browser_esm("select", true ? { +const UnitSelect = createStyled("select", true ? { target: "e1bagdl30" } : 0)("&&&{appearance:none;background:transparent;border-radius:2px;border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;", baseUnitLabelStyles, ";", unitSelectSizes, ";&:not( :disabled ){cursor:pointer;}}" + ( true ? "" : 0)); @@ -31549,13 +31630,13 @@ const overflowStyles = _ref5 => { // https://github.com/WordPress/gutenberg/issues/18483 -const Select = emotion_styled_base_browser_esm("select", true ? { +const Select = createStyled("select", true ? { target: "e1mv6sxx2" } : 0)("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:", COLORS.gray[900], ";display:block;font-family:inherit;margin:0;width:100%;max-width:none;cursor:pointer;white-space:nowrap;text-overflow:ellipsis;", select_control_styles_disabledStyles, ";", select_control_styles_fontSizeStyles, ";", select_control_styles_sizeStyles, ";", sizePaddings, ";", overflowStyles, ";}" + ( true ? "" : 0)); -const DownArrowWrapper = emotion_styled_base_browser_esm("div", true ? { +const DownArrowWrapper = createStyled("div", true ? { target: "e1mv6sxx1" } : 0)("margin-inline-end:", space(-1), ";line-height:0;" + ( true ? "" : 0)); -const InputControlSuffixWrapperWithClickThrough = /*#__PURE__*/emotion_styled_base_browser_esm(input_suffix_wrapper, true ? { +const InputControlSuffixWrapperWithClickThrough = /*#__PURE__*/createStyled(input_suffix_wrapper, true ? { target: "e1mv6sxx0" } : 0)("position:absolute;pointer-events:none;", rtl({ right: 0 @@ -31966,7 +32047,7 @@ const rangeHeight = () => /*#__PURE__*/emotion_react_browser_esm_css({ }, true ? "" : 0, true ? "" : 0); const thumbSize = 12; -const range_control_styles_Root = emotion_styled_base_browser_esm("div", true ? { +const range_control_styles_Root = createStyled("div", true ? { target: "e1epgpqk14" } : 0)( true ? { name: "1se47kl", @@ -31997,15 +32078,15 @@ const wrapperMargin = _ref4 => { return ''; }; -const range_control_styles_Wrapper = emotion_styled_base_browser_esm("div", true ? { +const range_control_styles_Wrapper = createStyled("div", true ? { target: "e1epgpqk13" } : 0)("display:block;flex:1;position:relative;width:100%;", wrapperColor, ";", rangeHeight, ";", wrapperMargin, ";" + ( true ? "" : 0)); -const BeforeIconWrapper = emotion_styled_base_browser_esm("span", true ? { +const BeforeIconWrapper = createStyled("span", true ? { target: "e1epgpqk12" } : 0)("display:flex;margin-top:", railHeight, "px;", rtl({ marginRight: 6 }), ";" + ( true ? "" : 0)); -const AfterIconWrapper = emotion_styled_base_browser_esm("span", true ? { +const AfterIconWrapper = createStyled("span", true ? { target: "e1epgpqk11" } : 0)("display:flex;margin-top:", railHeight, "px;", rtl({ marginLeft: 6 @@ -32027,7 +32108,7 @@ const railBackgroundColor = _ref5 => { }, true ? "" : 0, true ? "" : 0); }; -const Rail = emotion_styled_base_browser_esm("span", true ? { +const Rail = createStyled("span", true ? { target: "e1epgpqk10" } : 0)("background-color:", COLORS.gray[300], ";left:0;pointer-events:none;right:0;display:block;height:", railHeight, "px;position:absolute;margin-top:", (rangeHeightValue - railHeight) / 2, "px;top:0;border-radius:", railHeight, "px;", railBackgroundColor, ";" + ( true ? "" : 0)); @@ -32047,10 +32128,10 @@ const trackBackgroundColor = _ref6 => { }, true ? "" : 0, true ? "" : 0); }; -const Track = emotion_styled_base_browser_esm("span", true ? { +const Track = createStyled("span", true ? { target: "e1epgpqk9" } : 0)("background-color:currentColor;border-radius:", railHeight, "px;height:", railHeight, "px;pointer-events:none;display:block;position:absolute;margin-top:", (rangeHeightValue - railHeight) / 2, "px;top:0;", trackBackgroundColor, ";" + ( true ? "" : 0)); -const MarksWrapper = emotion_styled_base_browser_esm("span", true ? { +const MarksWrapper = createStyled("span", true ? { target: "e1epgpqk8" } : 0)( true ? { name: "l7tjj5", @@ -32073,7 +32154,7 @@ const markFill = _ref7 => { }, true ? "" : 0, true ? "" : 0); }; -const Mark = emotion_styled_base_browser_esm("span", true ? { +const Mark = createStyled("span", true ? { target: "e1epgpqk7" } : 0)("height:", thumbSize, "px;left:0;position:absolute;top:-4px;width:1px;", markFill, ";" + ( true ? "" : 0)); @@ -32086,7 +32167,7 @@ const markLabelFill = _ref8 => { }, true ? "" : 0, true ? "" : 0); }; -const MarkLabel = emotion_styled_base_browser_esm("span", true ? { +const MarkLabel = createStyled("span", true ? { target: "e1epgpqk6" } : 0)("color:", COLORS.gray[300], ";left:0;font-size:11px;position:absolute;top:12px;transform:translateX( -50% );white-space:nowrap;", markLabelFill, ";" + ( true ? "" : 0)); @@ -32097,7 +32178,7 @@ const thumbColor = _ref9 => { return disabled ? /*#__PURE__*/emotion_react_browser_esm_css("background-color:", COLORS.gray[400], ";" + ( true ? "" : 0), true ? "" : 0) : /*#__PURE__*/emotion_react_browser_esm_css("background-color:", COLORS.ui.theme, ";" + ( true ? "" : 0), true ? "" : 0); }; -const ThumbWrapper = emotion_styled_base_browser_esm("span", true ? { +const ThumbWrapper = createStyled("span", true ? { target: "e1epgpqk5" } : 0)("align-items:center;display:flex;height:", thumbSize, "px;justify-content:center;margin-top:", (rangeHeightValue - thumbSize) / 2, "px;outline:0;pointer-events:none;position:absolute;top:0;user-select:none;width:", thumbSize, "px;border-radius:50%;", thumbColor, ";", rtl({ marginLeft: -10 @@ -32114,10 +32195,10 @@ const thumbFocus = _ref10 => { return isFocused ? /*#__PURE__*/emotion_react_browser_esm_css("&::before{content:' ';position:absolute;background-color:", COLORS.ui.theme, ";opacity:0.4;border-radius:50%;height:", thumbSize + 8, "px;width:", thumbSize + 8, "px;top:-4px;left:-4px;}" + ( true ? "" : 0), true ? "" : 0) : ''; }; -const Thumb = emotion_styled_base_browser_esm("span", true ? { +const Thumb = createStyled("span", true ? { target: "e1epgpqk4" } : 0)("align-items:center;border-radius:50%;height:100%;outline:0;position:absolute;user-select:none;width:100%;", thumbColor, ";", thumbFocus, ";" + ( true ? "" : 0)); -const InputRange = emotion_styled_base_browser_esm("input", true ? { +const InputRange = createStyled("input", true ? { target: "e1epgpqk3" } : 0)("box-sizing:border-box;cursor:pointer;display:block;height:100%;left:0;margin:0 -", thumbSize / 2, "px;opacity:0;outline:none;position:absolute;right:0;top:0;width:calc( 100% + ", thumbSize, "px );" + ( true ? "" : 0)); @@ -32153,7 +32234,7 @@ const tooltipPosition = _ref12 => { return range_control_styles_ref; }; -const range_control_styles_Tooltip = emotion_styled_base_browser_esm("span", true ? { +const range_control_styles_Tooltip = createStyled("span", true ? { target: "e1epgpqk2" } : 0)("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;color:white;display:inline-block;font-size:12px;min-width:32px;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;transition:opacity 120ms ease;user-select:none;line-height:1.4;", tooltipShow, ";", tooltipPosition, ";", reduceMotion('transition'), ";", rtl({ transform: 'translateX(-50%)' @@ -32162,12 +32243,12 @@ const range_control_styles_Tooltip = emotion_styled_base_browser_esm("span", tr }), ";" + ( true ? "" : 0)); // @todo: Refactor RangeControl with latest HStack configuration // @wordpress/components/ui/hstack. -const InputNumber = /*#__PURE__*/emotion_styled_base_browser_esm(number_control, true ? { +const InputNumber = /*#__PURE__*/createStyled(number_control, true ? { target: "e1epgpqk1" } : 0)("display:inline-block;font-size:13px;margin-top:0;width:", space(16), "!important;input[type='number']&{", rangeHeight, ";}", rtl({ marginLeft: `${space(4)} !important` }), ";" + ( true ? "" : 0)); -const ActionRightWrapper = emotion_styled_base_browser_esm("span", true ? { +const ActionRightWrapper = createStyled("span", true ? { target: "e1epgpqk0" } : 0)("display:block;margin-top:0;button,button.is-small{margin-left:0;", rangeHeight, ";}", rtl({ marginLeft: 8 @@ -32742,13 +32823,13 @@ const RangeControl = (0,external_wp_element_namespaceObject.forwardRef)(Unforwar -const NumberControlWrapper = /*#__PURE__*/emotion_styled_base_browser_esm(number_control, true ? { +const NumberControlWrapper = /*#__PURE__*/createStyled(number_control, true ? { target: "ez9hsf47" } : 0)(Container, "{width:", space(24), ";}" + ( true ? "" : 0)); -const styles_SelectControl = /*#__PURE__*/emotion_styled_base_browser_esm(select_control, true ? { +const styles_SelectControl = /*#__PURE__*/createStyled(select_control, true ? { target: "ez9hsf46" } : 0)("margin-left:", space(-2), ";width:5em;", BackdropUI, "{display:none;}" + ( true ? "" : 0)); -const styles_RangeControl = /*#__PURE__*/emotion_styled_base_browser_esm(range_control, true ? { +const styles_RangeControl = /*#__PURE__*/createStyled(range_control, true ? { target: "ez9hsf45" } : 0)("flex:1;margin-right:", space(2), ";" + ( true ? "" : 0)); // Make the Hue circle picker not go out of the bar. @@ -32757,19 +32838,19 @@ const interactiveHueStyles = ` width: calc( 100% - ${space(2)} ); margin-left: ${space(1)}; }`; -const AuxiliaryColorArtefactWrapper = emotion_styled_base_browser_esm("div", true ? { +const AuxiliaryColorArtefactWrapper = createStyled("div", true ? { target: "ez9hsf44" } : 0)("padding-top:", space(2), ";padding-right:0;padding-left:0;padding-bottom:0;" + ( true ? "" : 0)); -const AuxiliaryColorArtefactHStackHeader = /*#__PURE__*/emotion_styled_base_browser_esm(h_stack_component, true ? { +const AuxiliaryColorArtefactHStackHeader = /*#__PURE__*/createStyled(h_stack_component, true ? { target: "ez9hsf43" } : 0)("padding-left:", space(4), ";padding-right:", space(4), ";" + ( true ? "" : 0)); -const ColorInputWrapper = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? { +const ColorInputWrapper = /*#__PURE__*/createStyled(flex_component, true ? { target: "ez9hsf42" } : 0)("padding-top:", space(4), ";padding-left:", space(4), ";padding-right:", space(3), ";padding-bottom:", space(5), ";" + ( true ? "" : 0)); -const ColorfulWrapper = emotion_styled_base_browser_esm("div", true ? { +const ColorfulWrapper = createStyled("div", true ? { target: "ez9hsf41" } : 0)(boxSizingReset, ";width:216px;.react-colorful{display:flex;flex-direction:column;align-items:center;width:216px;height:auto;overflow:hidden;}.react-colorful__saturation{width:100%;border-radius:0;height:216px;margin-bottom:", space(4), ";border-bottom:none;}.react-colorful__hue,.react-colorful__alpha{width:184px;height:16px;border-radius:16px;margin-bottom:", space(2), ";}.react-colorful__pointer{height:16px;width:16px;border:none;box-shadow:0 0 2px 0 rgba( 0, 0, 0, 0.25 );outline:2px solid transparent;}.react-colorful__pointer-fill{box-shadow:inset 0 0 0 ", config_values.borderWidthFocus, " #fff;}", interactiveHueStyles, ";" + ( true ? "" : 0)); -const CopyButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_button, true ? { +const CopyButton = /*#__PURE__*/createStyled(build_module_button, true ? { target: "ez9hsf40" } : 0)("&&&&&{min-width:", space(6), ";padding:0;>svg{margin-right:0;}}" + ( true ? "" : 0)); @@ -32833,7 +32914,7 @@ var round = Math.round; function getUAString() { var uaData = navigator.userAgentData; - if (uaData != null && uaData.brands) { + if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) { return uaData.brands.map(function (item) { return item.brand + "/" + item.version; }).join(' '); @@ -33688,10 +33769,9 @@ var unsetSides = { // Zooming can change the DPR, but it seems to report a value that will // cleanly divide the values into the appropriate subpixels. -function roundOffsetsByDPR(_ref) { +function roundOffsetsByDPR(_ref, win) { var x = _ref.x, y = _ref.y; - var win = window; var dpr = win.devicePixelRatio || 1; return { x: round(x * dpr) / dpr || 0, @@ -33774,7 +33854,7 @@ function mapToStyles(_ref2) { var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ x: x, y: y - }) : { + }, getWindow_getWindow(popper)) : { x: x, y: y }; @@ -35652,14 +35732,14 @@ function tooltip_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have trie const TooltipContent = /*#__PURE__*/emotion_react_browser_esm_css("z-index:", z_index_Tooltip, ";box-sizing:border-box;opacity:0;outline:none;transform-origin:top center;transition:opacity ", config_values.transitionDurationFastest, " ease;font-size:", config_values.fontSize, ";&[data-enter]{opacity:1;}" + ( true ? "" : 0), true ? "" : 0); -const TooltipPopoverView = emotion_styled_base_browser_esm("div", true ? { +const TooltipPopoverView = createStyled("div", true ? { target: "e7tfjmw1" } : 0)("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;box-shadow:0 0 0 1px rgba( 255, 255, 255, 0.04 );color:", COLORS.white, ";padding:4px 8px;" + ( true ? "" : 0)); const noOutline = true ? { name: "12mkfdx", styles: "outline:none" } : 0; -const TooltipShortcut = /*#__PURE__*/emotion_styled_base_browser_esm(shortcut_component, true ? { +const TooltipShortcut = /*#__PURE__*/createStyled(shortcut_component, true ? { target: "e7tfjmw0" } : 0)("display:inline-block;margin-left:", space(1), ";" + ( true ? "" : 0)); @@ -36211,7 +36291,7 @@ const ColorInput = _ref => { }; ;// CONCATENATED MODULE: ./node_modules/react-colorful/dist/index.mjs -function dist_u(){return(dist_u=Object.assign||function(e){for(var r=1;r=0||(o[t]=e[t]);return o}function dist_i(e){var t=(0,external_React_.useRef)(e),n=(0,external_React_.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var dist_s=function(e,r,t){return void 0===r&&(r=0),void 0===t&&(t=1),e>t?t:e0:e.buttons>0)&&m.current?g(dist_d(m.current,e,b.current)):t(!1)},r=function(){return t(!1)};function t(t){var n=_.current,o=dist_v(m.current),a=t?o.addEventListener:o.removeEventListener;a(n?"touchmove":"mousemove",e),a(n?"touchend":"mouseup",r)}return[function(e){var r=e.nativeEvent,n=m.current;if(n&&(dist_h(r),!function(e,r){return r&&!dist_f(e)}(r,_.current)&&n)){if(dist_f(r)){_.current=!0;var o=r.changedTouches||[];o.length&&(b.current=o[0].identifier)}n.focus(),g(dist_d(n,r,b.current)),t(!0)}},function(e){var r=e.which||e.keyCode;r<37||r>40||(e.preventDefault(),p({left:39===r?.05:37===r?-.05:0,top:40===r?.05:38===r?-.05:0}))},t]},[p,g]),C=x[0],E=x[1],H=x[2];return (0,external_React_.useEffect)(function(){return H},[H]),external_React_.createElement("div",dist_u({},s,{onTouchStart:C,onMouseDown:C,className:"react-colorful__interactive",ref:m,onKeyDown:E,tabIndex:0,role:"slider"}))}),dist_g=function(e){return e.filter(Boolean).join(" ")},dist_p=function(r){var t=r.color,n=r.left,o=r.top,a=void 0===o?.5:o,l=dist_g(["react-colorful__pointer",r.className]);return external_React_.createElement("div",{className:l,style:{top:100*a+"%",left:100*n+"%"}},external_React_.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},dist_b=function(e,r,t){return void 0===r&&(r=0),void 0===t&&(t=Math.pow(10,r)),Math.round(t*e)/t},_={grad:.9,turn:360,rad:360/(2*Math.PI)},dist_x=function(e){return dist_L(dist_C(e))},dist_C=function(e){return"#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?dist_b(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?dist_b(parseInt(e.substring(6,8),16)/255,2):1}},dist_E=function(e,r){return void 0===r&&(r="deg"),Number(e)*(_[r]||1)},dist_H=function(e){var r=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return r?dist_N({h:dist_E(r[1],r[2]),s:Number(r[3]),l:Number(r[4]),a:void 0===r[5]?1:Number(r[5])/(r[6]?100:1)}):{h:0,s:0,v:0,a:1}},dist_M=dist_H,dist_N=function(e){var r=e.s,t=e.l;return{h:e.h,s:(r*=(t<50?t:100-t)/100)>0?2*r/(t+r)*100:0,v:t+r,a:e.a}},dist_w=function(e){return K(dist_I(e))},dist_y=function(e){var r=e.s,t=e.v,n=e.a,o=(200-r)*t/100;return{h:dist_b(e.h),s:dist_b(o>0&&o<200?r*t/100/(o<=100?o:200-o)*100:0),l:dist_b(o/2),a:dist_b(n,2)}},q=function(e){var r=dist_y(e);return"hsl("+r.h+", "+r.s+"%, "+r.l+"%)"},dist_k=function(e){var r=dist_y(e);return"hsla("+r.h+", "+r.s+"%, "+r.l+"%, "+r.a+")"},dist_I=function(e){var r=e.h,t=e.s,n=e.v,o=e.a;r=r/360*6,t/=100,n/=100;var a=Math.floor(r),l=n*(1-t),u=n*(1-(r-a)*t),c=n*(1-(1-r+a)*t),i=a%6;return{r:dist_b(255*[n,u,l,l,c,n][i]),g:dist_b(255*[c,n,n,u,l,l][i]),b:dist_b(255*[l,l,c,n,n,u][i]),a:dist_b(o,2)}},dist_O=function(e){var r=/hsva?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return r?dist_A({h:dist_E(r[1],r[2]),s:Number(r[3]),v:Number(r[4]),a:void 0===r[5]?1:Number(r[5])/(r[6]?100:1)}):{h:0,s:0,v:0,a:1}},dist_j=dist_O,dist_z=function(e){var r=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return r?dist_L({r:Number(r[1])/(r[2]?100/255:1),g:Number(r[3])/(r[4]?100/255:1),b:Number(r[5])/(r[6]?100/255:1),a:void 0===r[7]?1:Number(r[7])/(r[8]?100:1)}):{h:0,s:0,v:0,a:1}},B=dist_z,dist_D=function(e){var r=e.toString(16);return r.length<2?"0"+r:r},K=function(e){var r=e.r,t=e.g,n=e.b,o=e.a,a=o<1?dist_D(dist_b(255*o)):"";return"#"+dist_D(r)+dist_D(t)+dist_D(n)+a},dist_L=function(e){var r=e.r,t=e.g,n=e.b,o=e.a,a=Math.max(r,t,n),l=a-Math.min(r,t,n),u=l?a===r?(t-n)/l:a===t?2+(n-r)/l:4+(r-t)/l:0;return{h:dist_b(60*(u<0?u+6:u)),s:dist_b(a?l/a*100:0),v:dist_b(a/255*100),a:o}},dist_A=function(e){return{h:dist_b(e.h),s:dist_b(e.s),v:dist_b(e.v),a:dist_b(e.a,2)}},dist_S=external_React_.memo(function(r){var t=r.hue,n=r.onChange,o=dist_g(["react-colorful__hue",r.className]);return external_React_.createElement("div",{className:o},external_React_.createElement(dist_m,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:dist_s(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":dist_b(t),"aria-valuemax":"360","aria-valuemin":"0"},external_React_.createElement(dist_p,{className:"react-colorful__hue-pointer",left:t/360,color:q({h:t,s:100,v:100,a:1})})))}),dist_T=external_React_.memo(function(r){var t=r.hsva,n=r.onChange,o={backgroundColor:q({h:t.h,s:100,v:100,a:1})};return external_React_.createElement("div",{className:"react-colorful__saturation",style:o},external_React_.createElement(dist_m,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:dist_s(t.s+100*e.left,0,100),v:dist_s(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+dist_b(t.s)+"%, Brightness "+dist_b(t.v)+"%"},external_React_.createElement(dist_p,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:q(t)})))}),dist_F=function(e,r){if(e===r)return!0;for(var t in e)if(e[t]!==r[t])return!1;return!0},dist_P=function(e,r){return e.replace(/\s/g,"")===r.replace(/\s/g,"")},X=function(e,r){return e.toLowerCase()===r.toLowerCase()||dist_F(dist_C(e),dist_C(r))};function Y(e,t,l){var u=dist_i(l),c=(0,external_React_.useState)(function(){return e.toHsva(t)}),s=c[0],f=c[1],v=(0,external_React_.useRef)({color:t,hsva:s});(0,external_React_.useEffect)(function(){if(!e.equal(t,v.current.color)){var r=e.toHsva(t);v.current={hsva:r,color:t},f(r)}},[t,e]),(0,external_React_.useEffect)(function(){var r;dist_F(s,v.current.hsva)||e.equal(r=e.fromHsva(s),v.current.color)||(v.current={hsva:s,color:r},u(r))},[s,e,u]);var d=(0,external_React_.useCallback)(function(e){f(function(r){return Object.assign({},r,e)})},[]);return[s,d]}var dist_R,dist_V="undefined"!=typeof window?external_React_.useLayoutEffect:external_React_.useEffect,dist_$=function(){return dist_R||( true?__webpack_require__.nc:0)},G=function(e){dist_R=e},J=new Map,Q=function(e){dist_V(function(){var r=e.current?e.current.ownerDocument:document;if(void 0!==r&&!J.has(r)){var t=r.createElement("style");t.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',J.set(r,t);var n=dist_$();n&&t.setAttribute("nonce",n),r.head.appendChild(t)}},[])},U=function(t){var n=t.className,o=t.colorModel,a=t.color,l=void 0===a?o.defaultColor:a,i=t.onChange,s=dist_c(t,["className","colorModel","color","onChange"]),f=(0,external_React_.useRef)(null);Q(f);var v=Y(o,l,i),d=v[0],h=v[1],m=dist_g(["react-colorful",n]);return external_React_.createElement("div",dist_u({},s,{ref:f,className:m}),external_React_.createElement(dist_T,{hsva:d,onChange:h}),external_React_.createElement(dist_S,{hue:d.h,onChange:h,className:"react-colorful__last-control"}))},dist_W={defaultColor:"000",toHsva:dist_x,fromHsva:function(e){return dist_w({h:e.h,s:e.s,v:e.v,a:1})},equal:X},Z=function(r){return e.createElement(U,dist_u({},r,{colorModel:dist_W}))},ee=function(r){var t=r.className,n=r.hsva,o=r.onChange,a={backgroundImage:"linear-gradient(90deg, "+dist_k(Object.assign({},n,{a:0}))+", "+dist_k(Object.assign({},n,{a:1}))+")"},l=dist_g(["react-colorful__alpha",t]),u=dist_b(100*n.a);return external_React_.createElement("div",{className:l},external_React_.createElement("div",{className:"react-colorful__alpha-gradient",style:a}),external_React_.createElement(dist_m,{onMove:function(e){o({a:e.left})},onKey:function(e){o({a:dist_s(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":u+"%","aria-valuenow":u,"aria-valuemin":"0","aria-valuemax":"100"},external_React_.createElement(dist_p,{className:"react-colorful__alpha-pointer",left:n.a,color:dist_k(n)})))},re=function(t){var n=t.className,o=t.colorModel,a=t.color,l=void 0===a?o.defaultColor:a,i=t.onChange,s=dist_c(t,["className","colorModel","color","onChange"]),f=(0,external_React_.useRef)(null);Q(f);var v=Y(o,l,i),d=v[0],h=v[1],m=dist_g(["react-colorful",n]);return external_React_.createElement("div",dist_u({},s,{ref:f,className:m}),external_React_.createElement(dist_T,{hsva:d,onChange:h}),external_React_.createElement(dist_S,{hue:d.h,onChange:h}),external_React_.createElement(ee,{hsva:d,onChange:h,className:"react-colorful__last-control"}))},te={defaultColor:"0001",toHsva:dist_x,fromHsva:dist_w,equal:X},ne=function(r){return e.createElement(re,dist_u({},r,{colorModel:te}))},oe={defaultColor:{h:0,s:0,l:0,a:1},toHsva:dist_N,fromHsva:dist_y,equal:dist_F},ae=function(r){return e.createElement(re,dist_u({},r,{colorModel:oe}))},le={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:dist_H,fromHsva:dist_k,equal:dist_P},ue=function(r){return e.createElement(re,dist_u({},r,{colorModel:le}))},ce={defaultColor:{h:0,s:0,l:0},toHsva:function(e){return dist_N({h:e.h,s:e.s,l:e.l,a:1})},fromHsva:function(e){return{h:(r=dist_y(e)).h,s:r.s,l:r.l};var r},equal:dist_F},ie=function(r){return e.createElement(U,dist_u({},r,{colorModel:ce}))},se={defaultColor:"hsl(0, 0%, 0%)",toHsva:dist_M,fromHsva:q,equal:dist_P},fe=function(r){return e.createElement(U,dist_u({},r,{colorModel:se}))},ve={defaultColor:{h:0,s:0,v:0,a:1},toHsva:function(e){return e},fromHsva:dist_A,equal:dist_F},de=function(r){return e.createElement(re,dist_u({},r,{colorModel:ve}))},he={defaultColor:"hsva(0, 0%, 0%, 1)",toHsva:dist_O,fromHsva:function(e){var r=dist_A(e);return"hsva("+r.h+", "+r.s+"%, "+r.v+"%, "+r.a+")"},equal:dist_P},me=function(r){return e.createElement(re,dist_u({},r,{colorModel:he}))},ge={defaultColor:{h:0,s:0,v:0},toHsva:function(e){return{h:e.h,s:e.s,v:e.v,a:1}},fromHsva:function(e){var r=dist_A(e);return{h:r.h,s:r.s,v:r.v}},equal:dist_F},pe=function(r){return e.createElement(U,dist_u({},r,{colorModel:ge}))},be={defaultColor:"hsv(0, 0%, 0%)",toHsva:dist_j,fromHsva:function(e){var r=dist_A(e);return"hsv("+r.h+", "+r.s+"%, "+r.v+"%)"},equal:dist_P},_e=function(r){return e.createElement(U,dist_u({},r,{colorModel:be}))},xe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:dist_L,fromHsva:dist_I,equal:dist_F},Ce=function(r){return e.createElement(re,dist_u({},r,{colorModel:xe}))},Ee={defaultColor:"rgba(0, 0, 0, 1)",toHsva:dist_z,fromHsva:function(e){var r=dist_I(e);return"rgba("+r.r+", "+r.g+", "+r.b+", "+r.a+")"},equal:dist_P},He=function(r){return external_React_.createElement(re,dist_u({},r,{colorModel:Ee}))},Me={defaultColor:{r:0,g:0,b:0},toHsva:function(e){return dist_L({r:e.r,g:e.g,b:e.b,a:1})},fromHsva:function(e){return{r:(r=dist_I(e)).r,g:r.g,b:r.b};var r},equal:dist_F},Ne=function(r){return e.createElement(U,dist_u({},r,{colorModel:Me}))},we={defaultColor:"rgb(0, 0, 0)",toHsva:B,fromHsva:function(e){var r=dist_I(e);return"rgb("+r.r+", "+r.g+", "+r.b+")"},equal:dist_P},ye=function(r){return external_React_.createElement(U,dist_u({},r,{colorModel:we}))},qe=/^#?([0-9A-F]{3,8})$/i,ke=function(r){var t=r.color,l=void 0===t?"":t,s=r.onChange,f=r.onBlur,v=r.escape,d=r.validate,h=r.format,m=r.process,g=dist_c(r,["color","onChange","onBlur","escape","validate","format","process"]),p=o(function(){return v(l)}),b=p[0],_=p[1],x=dist_i(s),C=dist_i(f),E=a(function(e){var r=v(e.target.value);_(r),d(r)&&x(m?m(r):r)},[v,m,d,x]),H=a(function(e){d(e.target.value)||_(v(l)),C(e)},[l,v,d,C]);return n(function(){_(v(l))},[l,v]),e.createElement("input",dist_u({},g,{value:h?h(b):b,spellCheck:"false",onChange:E,onBlur:H}))},Ie=function(e){return"#"+e},Oe=function(r){var t=r.prefixed,n=r.alpha,o=dist_c(r,["prefixed","alpha"]),l=a(function(e){return e.replace(/([^0-9A-F]+)/gi,"").substring(0,n?8:6)},[n]),i=a(function(e){return function(e,r){var t=qe.exec(e),n=t?t[1].length:0;return 3===n||6===n||!!r&&4===n||!!r&&8===n}(e,n)},[n]);return e.createElement(ke,dist_u({},o,{escape:l,format:t?Ie:void 0,process:Ie,validate:i}))}; +function dist_u(){return(dist_u=Object.assign||function(e){for(var r=1;r=0||(o[t]=e[t]);return o}function dist_i(e){var t=(0,external_React_.useRef)(e),n=(0,external_React_.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var dist_s=function(e,r,t){return void 0===r&&(r=0),void 0===t&&(t=1),e>t?t:e0:e.buttons>0)&&m.current?g(dist_d(m.current,e,b.current)):t(!1)},r=function(){return t(!1)};function t(t){var n=_.current,o=dist_v(m.current),a=t?o.addEventListener:o.removeEventListener;a(n?"touchmove":"mousemove",e),a(n?"touchend":"mouseup",r)}return[function(e){var r=e.nativeEvent,n=m.current;if(n&&(dist_h(r),!function(e,r){return r&&!dist_f(e)}(r,_.current)&&n)){if(dist_f(r)){_.current=!0;var o=r.changedTouches||[];o.length&&(b.current=o[0].identifier)}n.focus(),g(dist_d(n,r,b.current)),t(!0)}},function(e){var r=e.which||e.keyCode;r<37||r>40||(e.preventDefault(),p({left:39===r?.05:37===r?-.05:0,top:40===r?.05:38===r?-.05:0}))},t]},[p,g]),C=x[0],E=x[1],H=x[2];return (0,external_React_.useEffect)(function(){return H},[H]),external_React_.createElement("div",dist_u({},s,{onTouchStart:C,onMouseDown:C,className:"react-colorful__interactive",ref:m,onKeyDown:E,tabIndex:0,role:"slider"}))}),dist_g=function(e){return e.filter(Boolean).join(" ")},dist_p=function(r){var t=r.color,n=r.left,o=r.top,a=void 0===o?.5:o,l=dist_g(["react-colorful__pointer",r.className]);return external_React_.createElement("div",{className:l,style:{top:100*a+"%",left:100*n+"%"}},external_React_.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},dist_b=function(e,r,t){return void 0===r&&(r=0),void 0===t&&(t=Math.pow(10,r)),Math.round(t*e)/t},_={grad:.9,turn:360,rad:360/(2*Math.PI)},dist_x=function(e){return dist_L(dist_C(e))},dist_C=function(e){return"#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?dist_b(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?dist_b(parseInt(e.substring(6,8),16)/255,2):1}},dist_E=function(e,r){return void 0===r&&(r="deg"),Number(e)*(_[r]||1)},dist_H=function(e){var r=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return r?dist_N({h:dist_E(r[1],r[2]),s:Number(r[3]),l:Number(r[4]),a:void 0===r[5]?1:Number(r[5])/(r[6]?100:1)}):{h:0,s:0,v:0,a:1}},dist_M=dist_H,dist_N=function(e){var r=e.s,t=e.l;return{h:e.h,s:(r*=(t<50?t:100-t)/100)>0?2*r/(t+r)*100:0,v:t+r,a:e.a}},dist_w=function(e){return K(dist_I(e))},dist_y=function(e){var r=e.s,t=e.v,n=e.a,o=(200-r)*t/100;return{h:dist_b(e.h),s:dist_b(o>0&&o<200?r*t/100/(o<=100?o:200-o)*100:0),l:dist_b(o/2),a:dist_b(n,2)}},q=function(e){var r=dist_y(e);return"hsl("+r.h+", "+r.s+"%, "+r.l+"%)"},dist_k=function(e){var r=dist_y(e);return"hsla("+r.h+", "+r.s+"%, "+r.l+"%, "+r.a+")"},dist_I=function(e){var r=e.h,t=e.s,n=e.v,o=e.a;r=r/360*6,t/=100,n/=100;var a=Math.floor(r),l=n*(1-t),u=n*(1-(r-a)*t),c=n*(1-(1-r+a)*t),i=a%6;return{r:dist_b(255*[n,u,l,l,c,n][i]),g:dist_b(255*[c,n,n,u,l,l][i]),b:dist_b(255*[l,l,c,n,n,u][i]),a:dist_b(o,2)}},dist_O=function(e){var r=/hsva?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return r?dist_A({h:dist_E(r[1],r[2]),s:Number(r[3]),v:Number(r[4]),a:void 0===r[5]?1:Number(r[5])/(r[6]?100:1)}):{h:0,s:0,v:0,a:1}},dist_j=dist_O,dist_z=function(e){var r=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return r?dist_L({r:Number(r[1])/(r[2]?100/255:1),g:Number(r[3])/(r[4]?100/255:1),b:Number(r[5])/(r[6]?100/255:1),a:void 0===r[7]?1:Number(r[7])/(r[8]?100:1)}):{h:0,s:0,v:0,a:1}},dist_B=dist_z,dist_D=function(e){var r=e.toString(16);return r.length<2?"0"+r:r},K=function(e){var r=e.r,t=e.g,n=e.b,o=e.a,a=o<1?dist_D(dist_b(255*o)):"";return"#"+dist_D(r)+dist_D(t)+dist_D(n)+a},dist_L=function(e){var r=e.r,t=e.g,n=e.b,o=e.a,a=Math.max(r,t,n),l=a-Math.min(r,t,n),u=l?a===r?(t-n)/l:a===t?2+(n-r)/l:4+(r-t)/l:0;return{h:dist_b(60*(u<0?u+6:u)),s:dist_b(a?l/a*100:0),v:dist_b(a/255*100),a:o}},dist_A=function(e){return{h:dist_b(e.h),s:dist_b(e.s),v:dist_b(e.v),a:dist_b(e.a,2)}},dist_S=external_React_.memo(function(r){var t=r.hue,n=r.onChange,o=dist_g(["react-colorful__hue",r.className]);return external_React_.createElement("div",{className:o},external_React_.createElement(dist_m,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:dist_s(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":dist_b(t),"aria-valuemax":"360","aria-valuemin":"0"},external_React_.createElement(dist_p,{className:"react-colorful__hue-pointer",left:t/360,color:q({h:t,s:100,v:100,a:1})})))}),dist_T=external_React_.memo(function(r){var t=r.hsva,n=r.onChange,o={backgroundColor:q({h:t.h,s:100,v:100,a:1})};return external_React_.createElement("div",{className:"react-colorful__saturation",style:o},external_React_.createElement(dist_m,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:dist_s(t.s+100*e.left,0,100),v:dist_s(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+dist_b(t.s)+"%, Brightness "+dist_b(t.v)+"%"},external_React_.createElement(dist_p,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:q(t)})))}),dist_F=function(e,r){if(e===r)return!0;for(var t in e)if(e[t]!==r[t])return!1;return!0},dist_P=function(e,r){return e.replace(/\s/g,"")===r.replace(/\s/g,"")},X=function(e,r){return e.toLowerCase()===r.toLowerCase()||dist_F(dist_C(e),dist_C(r))};function Y(e,t,l){var u=dist_i(l),c=(0,external_React_.useState)(function(){return e.toHsva(t)}),s=c[0],f=c[1],v=(0,external_React_.useRef)({color:t,hsva:s});(0,external_React_.useEffect)(function(){if(!e.equal(t,v.current.color)){var r=e.toHsva(t);v.current={hsva:r,color:t},f(r)}},[t,e]),(0,external_React_.useEffect)(function(){var r;dist_F(s,v.current.hsva)||e.equal(r=e.fromHsva(s),v.current.color)||(v.current={hsva:s,color:r},u(r))},[s,e,u]);var d=(0,external_React_.useCallback)(function(e){f(function(r){return Object.assign({},r,e)})},[]);return[s,d]}var dist_R,dist_V="undefined"!=typeof window?external_React_.useLayoutEffect:external_React_.useEffect,dist_$=function(){return dist_R||( true?__webpack_require__.nc:0)},G=function(e){dist_R=e},J=new Map,Q=function(e){dist_V(function(){var r=e.current?e.current.ownerDocument:document;if(void 0!==r&&!J.has(r)){var t=r.createElement("style");t.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',J.set(r,t);var n=dist_$();n&&t.setAttribute("nonce",n),r.head.appendChild(t)}},[])},U=function(t){var n=t.className,o=t.colorModel,a=t.color,l=void 0===a?o.defaultColor:a,i=t.onChange,s=dist_c(t,["className","colorModel","color","onChange"]),f=(0,external_React_.useRef)(null);Q(f);var v=Y(o,l,i),d=v[0],h=v[1],m=dist_g(["react-colorful",n]);return external_React_.createElement("div",dist_u({},s,{ref:f,className:m}),external_React_.createElement(dist_T,{hsva:d,onChange:h}),external_React_.createElement(dist_S,{hue:d.h,onChange:h,className:"react-colorful__last-control"}))},dist_W={defaultColor:"000",toHsva:dist_x,fromHsva:function(e){return dist_w({h:e.h,s:e.s,v:e.v,a:1})},equal:X},Z=function(r){return e.createElement(U,dist_u({},r,{colorModel:dist_W}))},ee=function(r){var t=r.className,n=r.hsva,o=r.onChange,a={backgroundImage:"linear-gradient(90deg, "+dist_k(Object.assign({},n,{a:0}))+", "+dist_k(Object.assign({},n,{a:1}))+")"},l=dist_g(["react-colorful__alpha",t]),u=dist_b(100*n.a);return external_React_.createElement("div",{className:l},external_React_.createElement("div",{className:"react-colorful__alpha-gradient",style:a}),external_React_.createElement(dist_m,{onMove:function(e){o({a:e.left})},onKey:function(e){o({a:dist_s(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":u+"%","aria-valuenow":u,"aria-valuemin":"0","aria-valuemax":"100"},external_React_.createElement(dist_p,{className:"react-colorful__alpha-pointer",left:n.a,color:dist_k(n)})))},re=function(t){var n=t.className,o=t.colorModel,a=t.color,l=void 0===a?o.defaultColor:a,i=t.onChange,s=dist_c(t,["className","colorModel","color","onChange"]),f=(0,external_React_.useRef)(null);Q(f);var v=Y(o,l,i),d=v[0],h=v[1],m=dist_g(["react-colorful",n]);return external_React_.createElement("div",dist_u({},s,{ref:f,className:m}),external_React_.createElement(dist_T,{hsva:d,onChange:h}),external_React_.createElement(dist_S,{hue:d.h,onChange:h}),external_React_.createElement(ee,{hsva:d,onChange:h,className:"react-colorful__last-control"}))},te={defaultColor:"0001",toHsva:dist_x,fromHsva:dist_w,equal:X},ne=function(r){return e.createElement(re,dist_u({},r,{colorModel:te}))},oe={defaultColor:{h:0,s:0,l:0,a:1},toHsva:dist_N,fromHsva:dist_y,equal:dist_F},ae=function(r){return e.createElement(re,dist_u({},r,{colorModel:oe}))},le={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:dist_H,fromHsva:dist_k,equal:dist_P},ue=function(r){return e.createElement(re,dist_u({},r,{colorModel:le}))},ce={defaultColor:{h:0,s:0,l:0},toHsva:function(e){return dist_N({h:e.h,s:e.s,l:e.l,a:1})},fromHsva:function(e){return{h:(r=dist_y(e)).h,s:r.s,l:r.l};var r},equal:dist_F},ie=function(r){return e.createElement(U,dist_u({},r,{colorModel:ce}))},se={defaultColor:"hsl(0, 0%, 0%)",toHsva:dist_M,fromHsva:q,equal:dist_P},fe=function(r){return e.createElement(U,dist_u({},r,{colorModel:se}))},ve={defaultColor:{h:0,s:0,v:0,a:1},toHsva:function(e){return e},fromHsva:dist_A,equal:dist_F},de=function(r){return e.createElement(re,dist_u({},r,{colorModel:ve}))},he={defaultColor:"hsva(0, 0%, 0%, 1)",toHsva:dist_O,fromHsva:function(e){var r=dist_A(e);return"hsva("+r.h+", "+r.s+"%, "+r.v+"%, "+r.a+")"},equal:dist_P},me=function(r){return e.createElement(re,dist_u({},r,{colorModel:he}))},ge={defaultColor:{h:0,s:0,v:0},toHsva:function(e){return{h:e.h,s:e.s,v:e.v,a:1}},fromHsva:function(e){var r=dist_A(e);return{h:r.h,s:r.s,v:r.v}},equal:dist_F},pe=function(r){return e.createElement(U,dist_u({},r,{colorModel:ge}))},be={defaultColor:"hsv(0, 0%, 0%)",toHsva:dist_j,fromHsva:function(e){var r=dist_A(e);return"hsv("+r.h+", "+r.s+"%, "+r.v+"%)"},equal:dist_P},_e=function(r){return e.createElement(U,dist_u({},r,{colorModel:be}))},xe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:dist_L,fromHsva:dist_I,equal:dist_F},Ce=function(r){return e.createElement(re,dist_u({},r,{colorModel:xe}))},Ee={defaultColor:"rgba(0, 0, 0, 1)",toHsva:dist_z,fromHsva:function(e){var r=dist_I(e);return"rgba("+r.r+", "+r.g+", "+r.b+", "+r.a+")"},equal:dist_P},He=function(r){return external_React_.createElement(re,dist_u({},r,{colorModel:Ee}))},Me={defaultColor:{r:0,g:0,b:0},toHsva:function(e){return dist_L({r:e.r,g:e.g,b:e.b,a:1})},fromHsva:function(e){return{r:(r=dist_I(e)).r,g:r.g,b:r.b};var r},equal:dist_F},Ne=function(r){return e.createElement(U,dist_u({},r,{colorModel:Me}))},we={defaultColor:"rgb(0, 0, 0)",toHsva:dist_B,fromHsva:function(e){var r=dist_I(e);return"rgb("+r.r+", "+r.g+", "+r.b+")"},equal:dist_P},ye=function(r){return external_React_.createElement(U,dist_u({},r,{colorModel:we}))},qe=/^#?([0-9A-F]{3,8})$/i,ke=function(r){var t=r.color,l=void 0===t?"":t,s=r.onChange,f=r.onBlur,v=r.escape,d=r.validate,h=r.format,m=r.process,g=dist_c(r,["color","onChange","onBlur","escape","validate","format","process"]),p=o(function(){return v(l)}),b=p[0],_=p[1],x=dist_i(s),C=dist_i(f),E=a(function(e){var r=v(e.target.value);_(r),d(r)&&x(m?m(r):r)},[v,m,d,x]),H=a(function(e){d(e.target.value)||_(v(l)),C(e)},[l,v,d,C]);return n(function(){_(v(l))},[l,v]),e.createElement("input",dist_u({},g,{value:h?h(b):b,spellCheck:"false",onChange:E,onBlur:H}))},Ie=function(e){return"#"+e},Oe=function(r){var t=r.prefixed,n=r.alpha,o=dist_c(r,["prefixed","alpha"]),l=a(function(e){return e.replace(/([^0-9A-F]+)/gi,"").substring(0,n?8:6)},[n]),i=a(function(e){return function(e,r){var t=qe.exec(e),n=t?t[1].length:0;return 3===n||6===n||!!r&&4===n||!!r&&8===n}(e,n)},[n]);return e.createElement(ke,dist_u({},o,{escape:l,format:t?Ie:void 0,process:Ie,validate:i}))}; //# sourceMappingURL=index.module.js.map ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/picker.js @@ -36770,7 +36850,7 @@ function color_palette_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You hav * Internal dependencies */ -const ColorHeading = /*#__PURE__*/emotion_styled_base_browser_esm(heading_component, true ? { +const ColorHeading = /*#__PURE__*/createStyled(heading_component, true ? { target: "ev9wop70" } : 0)( true ? { name: "13lxv2o", @@ -36802,7 +36882,7 @@ const padding = _ref => { return /*#__PURE__*/emotion_react_browser_esm_css("padding:", paddingValues[paddingSize] || paddingValues.small, ";" + ( true ? "" : 0), true ? "" : 0); }; -const DropdownContentWrapperDiv = emotion_styled_base_browser_esm("div", true ? { +const DropdownContentWrapperDiv = createStyled("div", true ? { target: "eovvns30" } : 0)("margin-left:", space(-2), ";margin-right:", space(-2), ";&:first-of-type{margin-top:", space(-2), ";}&:last-of-type{margin-bottom:", space(-2), ";}", padding, ";" + ( true ? "" : 0)); @@ -39156,37 +39236,37 @@ function box_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have -const box_control_styles_Root = emotion_styled_base_browser_esm("div", true ? { +const box_control_styles_Root = createStyled("div", true ? { target: "e7pk0lh6" } : 0)( true ? { name: "14bvcyk", styles: "box-sizing:border-box;max-width:235px;padding-bottom:12px;width:100%" } : 0); -const Header = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? { +const Header = /*#__PURE__*/createStyled(flex_component, true ? { target: "e7pk0lh5" } : 0)( true ? { name: "5bhc30", styles: "margin-bottom:8px" } : 0); -const HeaderControlWrapper = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? { +const HeaderControlWrapper = /*#__PURE__*/createStyled(flex_component, true ? { target: "e7pk0lh4" } : 0)( true ? { name: "aujtid", styles: "min-height:30px;gap:0" } : 0); -const UnitControlWrapper = emotion_styled_base_browser_esm("div", true ? { +const UnitControlWrapper = createStyled("div", true ? { target: "e7pk0lh3" } : 0)( true ? { name: "112jwab", styles: "box-sizing:border-box;max-width:80px" } : 0); -const LayoutContainer = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? { +const LayoutContainer = /*#__PURE__*/createStyled(flex_component, true ? { target: "e7pk0lh2" } : 0)( true ? { name: "xy18ro", styles: "justify-content:center;padding-top:8px" } : 0); -const Layout = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? { +const Layout = /*#__PURE__*/createStyled(flex_component, true ? { target: "e7pk0lh1" } : 0)( true ? { name: "3tw5wk", @@ -39242,7 +39322,7 @@ const unitControlMarginStyles = _ref4 => { })(); }; -const box_control_styles_UnitControl = /*#__PURE__*/emotion_styled_base_browser_esm(unit_control, true ? { +const box_control_styles_UnitControl = /*#__PURE__*/createStyled(unit_control, true ? { target: "e7pk0lh0" } : 0)("max-width:60px;", unitControlBorderRadiusStyles, ";", unitControlMarginStyles, ";" + ( true ? "" : 0)); @@ -39892,13 +39972,13 @@ function box_control_icon_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You * External dependencies */ -const box_control_icon_styles_Root = emotion_styled_base_browser_esm("span", true ? { +const box_control_icon_styles_Root = createStyled("span", true ? { target: "eaw9yqk8" } : 0)( true ? { name: "1w884gc", styles: "box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px" } : 0); -const Viewbox = emotion_styled_base_browser_esm("span", true ? { +const Viewbox = createStyled("span", true ? { target: "eaw9yqk7" } : 0)( true ? { name: "i6vjox", @@ -39915,43 +39995,43 @@ const strokeFocus = _ref => { }, true ? "" : 0, true ? "" : 0); }; -const Stroke = emotion_styled_base_browser_esm("span", true ? { +const Stroke = createStyled("span", true ? { target: "eaw9yqk6" } : 0)("box-sizing:border-box;display:block;pointer-events:none;position:absolute;", strokeFocus, ";" + ( true ? "" : 0)); -const VerticalStroke = /*#__PURE__*/emotion_styled_base_browser_esm(Stroke, true ? { +const VerticalStroke = /*#__PURE__*/createStyled(Stroke, true ? { target: "eaw9yqk5" } : 0)( true ? { name: "1k2w39q", styles: "bottom:3px;top:3px;width:2px" } : 0); -const HorizontalStroke = /*#__PURE__*/emotion_styled_base_browser_esm(Stroke, true ? { +const HorizontalStroke = /*#__PURE__*/createStyled(Stroke, true ? { target: "eaw9yqk4" } : 0)( true ? { name: "1q9b07k", styles: "height:2px;left:3px;right:3px" } : 0); -const TopStroke = /*#__PURE__*/emotion_styled_base_browser_esm(HorizontalStroke, true ? { +const TopStroke = /*#__PURE__*/createStyled(HorizontalStroke, true ? { target: "eaw9yqk3" } : 0)( true ? { name: "abcix4", styles: "top:0" } : 0); -const RightStroke = /*#__PURE__*/emotion_styled_base_browser_esm(VerticalStroke, true ? { +const RightStroke = /*#__PURE__*/createStyled(VerticalStroke, true ? { target: "eaw9yqk2" } : 0)( true ? { name: "1wf8jf", styles: "right:0" } : 0); -const BottomStroke = /*#__PURE__*/emotion_styled_base_browser_esm(HorizontalStroke, true ? { +const BottomStroke = /*#__PURE__*/createStyled(HorizontalStroke, true ? { target: "eaw9yqk1" } : 0)( true ? { name: "8tapst", styles: "bottom:0" } : 0); -const LeftStroke = /*#__PURE__*/emotion_styled_base_browser_esm(VerticalStroke, true ? { +const LeftStroke = /*#__PURE__*/createStyled(VerticalStroke, true ? { target: "eaw9yqk0" } : 0)( true ? { name: "1ode3cm", @@ -41012,7 +41092,7 @@ const renderSize = _ref5 => { }, true ? "" : 0, true ? "" : 0); }; -const DividerView = emotion_styled_base_browser_esm("hr", true ? { +const DividerView = createStyled("hr", true ? { target: "e19on6iw0" } : 0)("border:0;margin:0;", renderDisplay, " ", renderBorder, " ", renderSize, " ", renderMargin, ";" + ( true ? "" : 0)); @@ -42539,13 +42619,13 @@ function custom_gradient_picker_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return * Internal dependencies */ -const SelectWrapper = /*#__PURE__*/emotion_styled_base_browser_esm(flex_block_component, true ? { +const SelectWrapper = /*#__PURE__*/createStyled(flex_block_component, true ? { target: "e99xvul1" } : 0)( true ? { name: "1gvx10y", styles: "flex-grow:5" } : 0); -const AccessoryWrapper = /*#__PURE__*/emotion_styled_base_browser_esm(flex_block_component, true ? { +const AccessoryWrapper = /*#__PURE__*/createStyled(flex_block_component, true ? { target: "e99xvul0" } : 0)( true ? { name: "1gvx10y", @@ -43307,37 +43387,37 @@ function palette_edit_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have -const IndicatorStyled = /*#__PURE__*/emotion_styled_base_browser_esm(CircularOptionPicker.Option, true ? { +const IndicatorStyled = /*#__PURE__*/createStyled(CircularOptionPicker.Option, true ? { target: "e5bw3229" } : 0)("width:", space(6), ";height:", space(6), ";pointer-events:none;" + ( true ? "" : 0)); -const NameInputControl = /*#__PURE__*/emotion_styled_base_browser_esm(input_control, true ? { +const NameInputControl = /*#__PURE__*/createStyled(input_control, true ? { target: "e5bw3228" } : 0)(Container, "{background:", COLORS.gray[100], ";border-radius:", config_values.controlBorderRadius, ";", Input, Input, Input, Input, "{height:", space(8), ";}", BackdropUI, BackdropUI, BackdropUI, "{border-color:transparent;box-shadow:none;}}" + ( true ? "" : 0)); -const PaletteItem = /*#__PURE__*/emotion_styled_base_browser_esm(component, true ? { +const PaletteItem = /*#__PURE__*/createStyled(component, true ? { target: "e5bw3227" } : 0)("padding:3px 0 3px ", space(3), ";height:calc( 40px - ", config_values.borderWidth, " );border:1px solid ", config_values.surfaceBorderColor, ";border-bottom-color:transparent;&:first-of-type{border-top-left-radius:", config_values.controlBorderRadius, ";border-top-right-radius:", config_values.controlBorderRadius, ";}&:last-of-type{border-bottom-left-radius:", config_values.controlBorderRadius, ";border-bottom-right-radius:", config_values.controlBorderRadius, ";border-bottom-color:", config_values.surfaceBorderColor, ";}&.is-selected+&{border-top-color:transparent;}&.is-selected{border-color:", COLORS.ui.theme, ";}" + ( true ? "" : 0)); -const NameContainer = emotion_styled_base_browser_esm("div", true ? { +const NameContainer = createStyled("div", true ? { target: "e5bw3226" } : 0)("line-height:", space(8), ";margin-left:", space(2), ";margin-right:", space(2), ";white-space:nowrap;overflow:hidden;", PaletteItem, ":hover &{color:", COLORS.ui.theme, ";}" + ( true ? "" : 0)); -const PaletteHeading = /*#__PURE__*/emotion_styled_base_browser_esm(heading_component, true ? { +const PaletteHeading = /*#__PURE__*/createStyled(heading_component, true ? { target: "e5bw3225" } : 0)("text-transform:uppercase;line-height:", space(6), ";font-weight:500;&&&{font-size:11px;margin-bottom:0;}" + ( true ? "" : 0)); -const PaletteActionsContainer = /*#__PURE__*/emotion_styled_base_browser_esm(component, true ? { +const PaletteActionsContainer = /*#__PURE__*/createStyled(component, true ? { target: "e5bw3224" } : 0)("height:", space(6), ";display:flex;" + ( true ? "" : 0)); -const PaletteHStackHeader = /*#__PURE__*/emotion_styled_base_browser_esm(h_stack_component, true ? { +const PaletteHStackHeader = /*#__PURE__*/createStyled(h_stack_component, true ? { target: "e5bw3223" } : 0)("margin-bottom:", space(2), ";" + ( true ? "" : 0)); -const PaletteEditStyles = /*#__PURE__*/emotion_styled_base_browser_esm(component, true ? { +const PaletteEditStyles = /*#__PURE__*/createStyled(component, true ? { target: "e5bw3222" } : 0)( true ? { name: "u6wnko", styles: "&&&{.components-button.has-icon{min-width:0;padding:0;}}" } : 0); -const DoneButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_button, true ? { +const DoneButton = /*#__PURE__*/createStyled(build_module_button, true ? { target: "e5bw3221" } : 0)("&&{color:", COLORS.ui.theme, ";}" + ( true ? "" : 0)); -const RemoveButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_button, true ? { +const RemoveButton = /*#__PURE__*/createStyled(build_module_button, true ? { target: "e5bw3220" } : 0)("&&{margin-top:", space(1), ";}" + ( true ? "" : 0)); @@ -43730,7 +43810,7 @@ const deprecatedDefaultSize = _ref => { return !__next36pxDefaultSize && /*#__PURE__*/emotion_react_browser_esm_css("height:28px;padding-left:", space(1), ";padding-right:", space(1), ";" + ( true ? "" : 0), true ? "" : 0); }; -const InputWrapperFlex = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? { +const InputWrapperFlex = /*#__PURE__*/createStyled(flex_component, true ? { target: "evuatpg0" } : 0)("height:34px;padding-left:", space(2), ";padding-right:", space(2), ";", deprecatedDefaultSize, ";" + ( true ? "" : 0)); @@ -49029,7 +49109,7 @@ function useMultipleSelection(userProps) { const backCompatMinWidth = props => !props.__nextUnconstrainedWidth ? /*#__PURE__*/emotion_react_browser_esm_css(Container, "{min-width:130px;}" + ( true ? "" : 0), true ? "" : 0) : ''; -const InputBaseWithBackCompatMinWidth = /*#__PURE__*/emotion_styled_base_browser_esm(input_base, true ? { +const InputBaseWithBackCompatMinWidth = /*#__PURE__*/createStyled(input_base, true ? { target: "eswuck60" } : 0)(backCompatMinWidth, ";" + ( true ? "" : 0)); @@ -50285,6 +50365,16 @@ var useLilius = function (_a) { +;// CONCATENATED MODULE: ./node_modules/date-fns/node_modules/@babel/runtime/helpers/esm/typeof.js +function _typeof(obj) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }, _typeof(obj); +} ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/_lib/requiredArgs/index.js function requiredArgs_requiredArgs(required, args) { if (args.length < required) { @@ -50292,7 +50382,6 @@ function requiredArgs_requiredArgs(required, args) { } } ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/toDate/index.js -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } /** @@ -50325,11 +50414,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi * const result = toDate(1392098430000) * //=> Tue Feb 11 2014 11:30:30 */ - function toDate_toDate(argument) { requiredArgs_requiredArgs(1, arguments); - var argStr = Object.prototype.toString.call(argument); // Clone the date + var argStr = Object.prototype.toString.call(argument); + // Clone the date if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') { // Prevent the date to lose the milliseconds when passed to new Date() in IE10 return new Date(argument.getTime()); @@ -50338,11 +50427,10 @@ function toDate_toDate(argument) { } else { if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') { // eslint-disable-next-line no-console - console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"); // eslint-disable-next-line no-console - + console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"); + // eslint-disable-next-line no-console console.warn(new Error().stack); } - return new Date(NaN); } } @@ -50367,7 +50455,6 @@ function toDate_toDate(argument) { * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 02 2014 00:00:00 */ - function startOfDay_startOfDay(dirtyDate) { requiredArgs_requiredArgs(1, arguments); var date = toDate_toDate(dirtyDate); @@ -50379,13 +50466,10 @@ function toInteger_toInteger(dirtyNumber) { if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) { return NaN; } - var number = Number(dirtyNumber); - if (isNaN(number)) { return number; } - return number < 0 ? Math.ceil(number) : Math.floor(number); } ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/addMonths/index.js @@ -50410,22 +50494,20 @@ function toInteger_toInteger(dirtyNumber) { * const result = addMonths(new Date(2014, 8, 1), 5) * //=> Sun Feb 01 2015 00:00:00 */ - function addMonths_addMonths(dirtyDate, dirtyAmount) { requiredArgs_requiredArgs(2, arguments); var date = toDate_toDate(dirtyDate); var amount = toInteger_toInteger(dirtyAmount); - if (isNaN(amount)) { return new Date(NaN); } - if (!amount) { // If 0 months, no-op to avoid changing times in the hour before end of DST return date; } + var dayOfMonth = date.getDate(); - var dayOfMonth = date.getDate(); // The JS Date object supports date math by accepting out-of-bounds values for + // The JS Date object supports date math by accepting out-of-bounds values for // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we // want except that dates will wrap around the end of a month, meaning that @@ -50433,11 +50515,9 @@ function addMonths_addMonths(dirtyDate, dirtyAmount) { // we'll default to the end of the desired month by adding 1 to the desired // month and using a date of 0 to back up one day to the end of the desired // month. - var endOfDesiredMonth = new Date(date.getTime()); endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0); var daysInMonth = endOfDesiredMonth.getDate(); - if (dayOfMonth >= daysInMonth) { // If we're already at the end of the month, then this is the correct date // and we're done. @@ -50476,14 +50556,12 @@ function addMonths_addMonths(dirtyDate, dirtyAmount) { * const result = subMonths(new Date(2015, 1, 1), 5) * //=> Mon Sep 01 2014 00:00:00 */ - function subMonths_subMonths(dirtyDate, dirtyAmount) { requiredArgs_requiredArgs(2, arguments); var amount = toInteger_toInteger(dirtyAmount); return addMonths_addMonths(dirtyDate, -amount); } ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/isDate/index.js -function isDate_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { isDate_typeof = function _typeof(obj) { return typeof obj; }; } else { isDate_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return isDate_typeof(obj); } /** @@ -50518,10 +50596,9 @@ function isDate_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === " * const result = isDate({}) * //=> false */ - function isDate(value) { requiredArgs_requiredArgs(1, arguments); - return value instanceof Date || isDate_typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]'; + return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]'; } ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/isValid/index.js @@ -50558,14 +50635,11 @@ function isDate(value) { * const result = isValid(new Date('')) * //=> false */ - function isValid(dirtyDate) { requiredArgs_requiredArgs(1, arguments); - if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') { return false; } - var date = toDate_toDate(dirtyDate); return !isNaN(Number(date)); } @@ -50591,7 +50665,6 @@ function isValid(dirtyDate) { * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) * //=> Thu Jul 10 2014 12:45:30.750 */ - function addMilliseconds(dirtyDate, dirtyAmount) { requiredArgs_requiredArgs(2, arguments); var timestamp = toDate_toDate(dirtyDate).getTime(); @@ -50620,7 +50693,6 @@ function addMilliseconds(dirtyDate, dirtyAmount) { * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) * //=> Thu Jul 10 2014 12:45:29.250 */ - function subMilliseconds(dirtyDate, dirtyAmount) { requiredArgs_requiredArgs(2, arguments); var amount = toInteger_toInteger(dirtyAmount); @@ -50669,7 +50741,6 @@ function getUTCISOWeekYear(dirtyDate) { fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4); fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0); var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear); - if (date.getTime() >= startOfNextYear.getTime()) { return year + 1; } else if (date.getTime() >= startOfThisYear.getTime()) { @@ -50700,10 +50771,11 @@ var MILLISECONDS_IN_WEEK = 604800000; function getUTCISOWeek(dirtyDate) { requiredArgs_requiredArgs(1, arguments); var date = toDate_toDate(dirtyDate); - var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer + var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); + + // Round the number of days to the nearest integer // because the number of milliseconds in a week is not constant // (e.g. it's different in the week of the daylight saving time clock shift) - return Math.round(diff / MILLISECONDS_IN_WEEK) + 1; } ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/_lib/defaultOptions/index.js @@ -50721,15 +50793,14 @@ function setDefaultOptions(newOptions) { function startOfUTCWeek(dirtyDate, options) { var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; - requiredArgs_requiredArgs(1, arguments); var defaultOptions = defaultOptions_getDefaultOptions(); - var weekStartsOn = toInteger_toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN + var weekStartsOn = toInteger_toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); + // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } - var date = toDate_toDate(dirtyDate); var day = date.getUTCDay(); var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; @@ -50745,17 +50816,16 @@ function startOfUTCWeek(dirtyDate, options) { function getUTCWeekYear(dirtyDate, options) { var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; - requiredArgs_requiredArgs(1, arguments); var date = toDate_toDate(dirtyDate); var year = date.getUTCFullYear(); var defaultOptions = defaultOptions_getDefaultOptions(); - var firstWeekContainsDate = toInteger_toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN + var firstWeekContainsDate = toInteger_toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); + // Test if weekStartsOn is between 1 and 7 _and_ is not NaN if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) { throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively'); } - var firstWeekOfNextYear = new Date(0); firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate); firstWeekOfNextYear.setUTCHours(0, 0, 0, 0); @@ -50764,7 +50834,6 @@ function getUTCWeekYear(dirtyDate, options) { firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate); firstWeekOfThisYear.setUTCHours(0, 0, 0, 0); var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options); - if (date.getTime() >= startOfNextYear.getTime()) { return year + 1; } else if (date.getTime() >= startOfThisYear.getTime()) { @@ -50781,7 +50850,6 @@ function getUTCWeekYear(dirtyDate, options) { function startOfUTCWeekYear(dirtyDate, options) { var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; - requiredArgs_requiredArgs(1, arguments); var defaultOptions = defaultOptions_getDefaultOptions(); var firstWeekContainsDate = toInteger_toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); @@ -50801,21 +50869,20 @@ var getUTCWeek_MILLISECONDS_IN_WEEK = 604800000; function getUTCWeek(dirtyDate, options) { requiredArgs_requiredArgs(1, arguments); var date = toDate_toDate(dirtyDate); - var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer + var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); + + // Round the number of days to the nearest integer // because the number of milliseconds in a week is not constant // (e.g. it's different in the week of the daylight saving time clock shift) - return Math.round(diff / getUTCWeek_MILLISECONDS_IN_WEEK) + 1; } ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/_lib/addLeadingZeros/index.js function addLeadingZeros(number, targetLength) { var sign = number < 0 ? '-' : ''; var output = Math.abs(number).toString(); - while (output.length < targetLength) { output = '0' + output; } - return sign + output; } ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/_lib/format/lightFormatters/index.js @@ -50832,7 +50899,6 @@ function addLeadingZeros(number, targetLength) { * * Letters marked by * are not implemented but reserved by Unicode standard. */ - var formatters = { // Year y: function y(date, token) { @@ -50844,8 +50910,9 @@ var formatters = { // | AD 123 | 123 | 23 | 123 | 0123 | 00123 | // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 | // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 | - var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript) + var signedYear = date.getUTCFullYear(); + // Returns 1 for 1 BC (which is year 0 in JavaScript) var year = signedYear > 0 ? signedYear : 1 - signedYear; return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length); }, @@ -50861,18 +50928,14 @@ var formatters = { // AM or PM a: function a(date, token) { var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am'; - switch (token) { case 'a': case 'aa': return dayPeriodEnumValue.toUpperCase(); - case 'aaa': return dayPeriodEnumValue; - case 'aaaaa': return dayPeriodEnumValue[0]; - case 'aaaa': default: return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.'; @@ -50921,7 +50984,6 @@ var dayPeriodEnum = { evening: 'evening', night: 'night' }; - /* * | | Unit | | Unit | * |-----|--------------------------------|-----|--------------------------------| @@ -50967,11 +51029,11 @@ var dayPeriodEnum = { * - `P` is long localized date format * - `p` is long localized time format */ + var formatters_formatters = { // Era G: function G(date, token, localize) { var era = date.getUTCFullYear() > 0 ? 1 : 0; - switch (token) { // AD, BC case 'G': @@ -50981,13 +51043,11 @@ var formatters_formatters = { width: 'abbreviated' }); // A, B - case 'GGGGG': return localize.era(era, { width: 'narrow' }); // Anno Domini, Before Christ - case 'GGGG': default: return localize.era(era, { @@ -50999,41 +51059,42 @@ var formatters_formatters = { y: function y(date, token, localize) { // Ordinal number if (token === 'yo') { - var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript) - + var signedYear = date.getUTCFullYear(); + // Returns 1 for 1 BC (which is year 0 in JavaScript) var year = signedYear > 0 ? signedYear : 1 - signedYear; return localize.ordinalNumber(year, { unit: 'year' }); } - return lightFormatters.y(date, token); }, // Local week-numbering year Y: function Y(date, token, localize, options) { - var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript) - - var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year + var signedWeekYear = getUTCWeekYear(date, options); + // Returns 1 for 1 BC (which is year 0 in JavaScript) + var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; + // Two digit year if (token === 'YY') { var twoDigitYear = weekYear % 100; return addLeadingZeros(twoDigitYear, 2); - } // Ordinal number - + } + // Ordinal number if (token === 'Yo') { return localize.ordinalNumber(weekYear, { unit: 'year' }); - } // Padding - + } + // Padding return addLeadingZeros(weekYear, token.length); }, // ISO week-numbering year R: function R(date, token) { - var isoWeekYear = getUTCISOWeekYear(date); // Padding + var isoWeekYear = getUTCISOWeekYear(date); + // Padding return addLeadingZeros(isoWeekYear, token.length); }, // Extended year. This is a single number designating the year of this calendar system. @@ -51052,37 +51113,31 @@ var formatters_formatters = { // Quarter Q: function Q(date, token, localize) { var quarter = Math.ceil((date.getUTCMonth() + 1) / 3); - switch (token) { // 1, 2, 3, 4 case 'Q': return String(quarter); // 01, 02, 03, 04 - case 'QQ': return addLeadingZeros(quarter, 2); // 1st, 2nd, 3rd, 4th - case 'Qo': return localize.ordinalNumber(quarter, { unit: 'quarter' }); // Q1, Q2, Q3, Q4 - case 'QQQ': return localize.quarter(quarter, { width: 'abbreviated', context: 'formatting' }); // 1, 2, 3, 4 (narrow quarter; could be not numerical) - case 'QQQQQ': return localize.quarter(quarter, { width: 'narrow', context: 'formatting' }); // 1st quarter, 2nd quarter, ... - case 'QQQQ': default: return localize.quarter(quarter, { @@ -51094,37 +51149,31 @@ var formatters_formatters = { // Stand-alone quarter q: function q(date, token, localize) { var quarter = Math.ceil((date.getUTCMonth() + 1) / 3); - switch (token) { // 1, 2, 3, 4 case 'q': return String(quarter); // 01, 02, 03, 04 - case 'qq': return addLeadingZeros(quarter, 2); // 1st, 2nd, 3rd, 4th - case 'qo': return localize.ordinalNumber(quarter, { unit: 'quarter' }); // Q1, Q2, Q3, Q4 - case 'qqq': return localize.quarter(quarter, { width: 'abbreviated', context: 'standalone' }); // 1, 2, 3, 4 (narrow quarter; could be not numerical) - case 'qqqqq': return localize.quarter(quarter, { width: 'narrow', context: 'standalone' }); // 1st quarter, 2nd quarter, ... - case 'qqqq': default: return localize.quarter(quarter, { @@ -51136,33 +51185,28 @@ var formatters_formatters = { // Month M: function M(date, token, localize) { var month = date.getUTCMonth(); - switch (token) { case 'M': case 'MM': return lightFormatters.M(date, token); // 1st, 2nd, ..., 12th - case 'Mo': return localize.ordinalNumber(month + 1, { unit: 'month' }); // Jan, Feb, ..., Dec - case 'MMM': return localize.month(month, { width: 'abbreviated', context: 'formatting' }); // J, F, ..., D - case 'MMMMM': return localize.month(month, { width: 'narrow', context: 'formatting' }); // January, February, ..., December - case 'MMMM': default: return localize.month(month, { @@ -51174,37 +51218,31 @@ var formatters_formatters = { // Stand-alone month L: function L(date, token, localize) { var month = date.getUTCMonth(); - switch (token) { // 1, 2, ..., 12 case 'L': return String(month + 1); // 01, 02, ..., 12 - case 'LL': return addLeadingZeros(month + 1, 2); // 1st, 2nd, ..., 12th - case 'Lo': return localize.ordinalNumber(month + 1, { unit: 'month' }); // Jan, Feb, ..., Dec - case 'LLL': return localize.month(month, { width: 'abbreviated', context: 'standalone' }); // J, F, ..., D - case 'LLLLL': return localize.month(month, { width: 'narrow', context: 'standalone' }); // January, February, ..., December - case 'LLLL': default: return localize.month(month, { @@ -51216,25 +51254,21 @@ var formatters_formatters = { // Local week of year w: function w(date, token, localize, options) { var week = getUTCWeek(date, options); - if (token === 'wo') { return localize.ordinalNumber(week, { unit: 'week' }); } - return addLeadingZeros(week, token.length); }, // ISO week of year I: function I(date, token, localize) { var isoWeek = getUTCISOWeek(date); - if (token === 'Io') { return localize.ordinalNumber(isoWeek, { unit: 'week' }); } - return addLeadingZeros(isoWeek, token.length); }, // Day of the month @@ -51244,25 +51278,21 @@ var formatters_formatters = { unit: 'date' }); } - return lightFormatters.d(date, token); }, // Day of year D: function D(date, token, localize) { var dayOfYear = getUTCDayOfYear(date); - if (token === 'Do') { return localize.ordinalNumber(dayOfYear, { unit: 'dayOfYear' }); } - return addLeadingZeros(dayOfYear, token.length); }, // Day of week E: function E(date, token, localize) { var dayOfWeek = date.getUTCDay(); - switch (token) { // Tue case 'E': @@ -51273,21 +51303,18 @@ var formatters_formatters = { context: 'formatting' }); // T - case 'EEEEE': return localize.day(dayOfWeek, { width: 'narrow', context: 'formatting' }); // Tu - case 'EEEEEE': return localize.day(dayOfWeek, { width: 'short', context: 'formatting' }); // Tuesday - case 'EEEE': default: return localize.day(dayOfWeek, { @@ -51300,43 +51327,36 @@ var formatters_formatters = { e: function e(date, token, localize, options) { var dayOfWeek = date.getUTCDay(); var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; - switch (token) { // Numerical value (Nth day of week with current locale or weekStartsOn) case 'e': return String(localDayOfWeek); // Padded numerical value - case 'ee': return addLeadingZeros(localDayOfWeek, 2); // 1st, 2nd, ..., 7th - case 'eo': return localize.ordinalNumber(localDayOfWeek, { unit: 'day' }); - case 'eee': return localize.day(dayOfWeek, { width: 'abbreviated', context: 'formatting' }); // T - case 'eeeee': return localize.day(dayOfWeek, { width: 'narrow', context: 'formatting' }); // Tu - case 'eeeeee': return localize.day(dayOfWeek, { width: 'short', context: 'formatting' }); // Tuesday - case 'eeee': default: return localize.day(dayOfWeek, { @@ -51349,43 +51369,36 @@ var formatters_formatters = { c: function c(date, token, localize, options) { var dayOfWeek = date.getUTCDay(); var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; - switch (token) { // Numerical value (same as in `e`) case 'c': return String(localDayOfWeek); // Padded numerical value - case 'cc': return addLeadingZeros(localDayOfWeek, token.length); // 1st, 2nd, ..., 7th - case 'co': return localize.ordinalNumber(localDayOfWeek, { unit: 'day' }); - case 'ccc': return localize.day(dayOfWeek, { width: 'abbreviated', context: 'standalone' }); // T - case 'ccccc': return localize.day(dayOfWeek, { width: 'narrow', context: 'standalone' }); // Tu - case 'cccccc': return localize.day(dayOfWeek, { width: 'short', context: 'standalone' }); // Tuesday - case 'cccc': default: return localize.day(dayOfWeek, { @@ -51398,44 +51411,37 @@ var formatters_formatters = { i: function i(date, token, localize) { var dayOfWeek = date.getUTCDay(); var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek; - switch (token) { // 2 case 'i': return String(isoDayOfWeek); // 02 - case 'ii': return addLeadingZeros(isoDayOfWeek, token.length); // 2nd - case 'io': return localize.ordinalNumber(isoDayOfWeek, { unit: 'day' }); // Tue - case 'iii': return localize.day(dayOfWeek, { width: 'abbreviated', context: 'formatting' }); // T - case 'iiiii': return localize.day(dayOfWeek, { width: 'narrow', context: 'formatting' }); // Tu - case 'iiiiii': return localize.day(dayOfWeek, { width: 'short', context: 'formatting' }); // Tuesday - case 'iiii': default: return localize.day(dayOfWeek, { @@ -51448,7 +51454,6 @@ var formatters_formatters = { a: function a(date, token, localize) { var hours = date.getUTCHours(); var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am'; - switch (token) { case 'a': case 'aa': @@ -51456,19 +51461,16 @@ var formatters_formatters = { width: 'abbreviated', context: 'formatting' }); - case 'aaa': return localize.dayPeriod(dayPeriodEnumValue, { width: 'abbreviated', context: 'formatting' }).toLowerCase(); - case 'aaaaa': return localize.dayPeriod(dayPeriodEnumValue, { width: 'narrow', context: 'formatting' }); - case 'aaaa': default: return localize.dayPeriod(dayPeriodEnumValue, { @@ -51481,7 +51483,6 @@ var formatters_formatters = { b: function b(date, token, localize) { var hours = date.getUTCHours(); var dayPeriodEnumValue; - if (hours === 12) { dayPeriodEnumValue = dayPeriodEnum.noon; } else if (hours === 0) { @@ -51489,7 +51490,6 @@ var formatters_formatters = { } else { dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am'; } - switch (token) { case 'b': case 'bb': @@ -51497,19 +51497,16 @@ var formatters_formatters = { width: 'abbreviated', context: 'formatting' }); - case 'bbb': return localize.dayPeriod(dayPeriodEnumValue, { width: 'abbreviated', context: 'formatting' }).toLowerCase(); - case 'bbbbb': return localize.dayPeriod(dayPeriodEnumValue, { width: 'narrow', context: 'formatting' }); - case 'bbbb': default: return localize.dayPeriod(dayPeriodEnumValue, { @@ -51522,7 +51519,6 @@ var formatters_formatters = { B: function B(date, token, localize) { var hours = date.getUTCHours(); var dayPeriodEnumValue; - if (hours >= 17) { dayPeriodEnumValue = dayPeriodEnum.evening; } else if (hours >= 12) { @@ -51532,7 +51528,6 @@ var formatters_formatters = { } else { dayPeriodEnumValue = dayPeriodEnum.night; } - switch (token) { case 'B': case 'BB': @@ -51541,13 +51536,11 @@ var formatters_formatters = { width: 'abbreviated', context: 'formatting' }); - case 'BBBBB': return localize.dayPeriod(dayPeriodEnumValue, { width: 'narrow', context: 'formatting' }); - case 'BBBB': default: return localize.dayPeriod(dayPeriodEnumValue, { @@ -51565,7 +51558,6 @@ var formatters_formatters = { unit: 'hour' }); } - return lightFormatters.h(date, token); }, // Hour [0-23] @@ -51575,32 +51567,27 @@ var formatters_formatters = { unit: 'hour' }); } - return lightFormatters.H(date, token); }, // Hour [0-11] K: function K(date, token, localize) { var hours = date.getUTCHours() % 12; - if (token === 'Ko') { return localize.ordinalNumber(hours, { unit: 'hour' }); } - return addLeadingZeros(hours, token.length); }, // Hour [1-24] k: function k(date, token, localize) { var hours = date.getUTCHours(); if (hours === 0) hours = 24; - if (token === 'ko') { return localize.ordinalNumber(hours, { unit: 'hour' }); } - return addLeadingZeros(hours, token.length); }, // Minute @@ -51610,7 +51597,6 @@ var formatters_formatters = { unit: 'minute' }); } - return lightFormatters.m(date, token); }, // Second @@ -51620,7 +51606,6 @@ var formatters_formatters = { unit: 'second' }); } - return lightFormatters.s(date, token); }, // Fraction of second @@ -51631,30 +51616,27 @@ var formatters_formatters = { X: function X(date, token, _localize, options) { var originalDate = options._originalDate || date; var timezoneOffset = originalDate.getTimezoneOffset(); - if (timezoneOffset === 0) { return 'Z'; } - switch (token) { // Hours and optional minutes case 'X': return formatTimezoneWithOptionalMinutes(timezoneOffset); + // Hours, minutes and optional seconds without `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `XX` - case 'XXXX': case 'XX': // Hours and minutes without `:` delimiter return formatTimezone(timezoneOffset); + // Hours, minutes and optional seconds with `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `XXX` - case 'XXXXX': case 'XXX': // Hours and minutes with `:` delimiter - default: return formatTimezone(timezoneOffset, ':'); } @@ -51663,26 +51645,24 @@ var formatters_formatters = { x: function x(date, token, _localize, options) { var originalDate = options._originalDate || date; var timezoneOffset = originalDate.getTimezoneOffset(); - switch (token) { // Hours and optional minutes case 'x': return formatTimezoneWithOptionalMinutes(timezoneOffset); + // Hours, minutes and optional seconds without `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `xx` - case 'xxxx': case 'xx': // Hours and minutes without `:` delimiter return formatTimezone(timezoneOffset); + // Hours, minutes and optional seconds with `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `xxx` - case 'xxxxx': case 'xxx': // Hours and minutes with `:` delimiter - default: return formatTimezone(timezoneOffset, ':'); } @@ -51691,7 +51671,6 @@ var formatters_formatters = { O: function O(date, token, _localize, options) { var originalDate = options._originalDate || date; var timezoneOffset = originalDate.getTimezoneOffset(); - switch (token) { // Short case 'O': @@ -51699,7 +51678,6 @@ var formatters_formatters = { case 'OOO': return 'GMT' + formatTimezoneShort(timezoneOffset, ':'); // Long - case 'OOOO': default: return 'GMT' + formatTimezone(timezoneOffset, ':'); @@ -51709,7 +51687,6 @@ var formatters_formatters = { z: function z(date, token, _localize, options) { var originalDate = options._originalDate || date; var timezoneOffset = originalDate.getTimezoneOffset(); - switch (token) { // Short case 'z': @@ -51717,7 +51694,6 @@ var formatters_formatters = { case 'zzz': return 'GMT' + formatTimezoneShort(timezoneOffset, ':'); // Long - case 'zzzz': default: return 'GMT' + formatTimezone(timezoneOffset, ':'); @@ -51736,30 +51712,24 @@ var formatters_formatters = { return addLeadingZeros(timestamp, token.length); } }; - function formatTimezoneShort(offset, dirtyDelimiter) { var sign = offset > 0 ? '-' : '+'; var absOffset = Math.abs(offset); var hours = Math.floor(absOffset / 60); var minutes = absOffset % 60; - if (minutes === 0) { return sign + String(hours); } - var delimiter = dirtyDelimiter || ''; return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2); } - function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) { if (offset % 60 === 0) { var sign = offset > 0 ? '-' : '+'; return sign + addLeadingZeros(Math.abs(offset) / 60, 2); } - return formatTimezone(offset, dirtyDelimiter); } - function formatTimezone(offset, dirtyDelimiter) { var delimiter = dirtyDelimiter || ''; var sign = offset > 0 ? '-' : '+'; @@ -51768,7 +51738,6 @@ function formatTimezone(offset, dirtyDelimiter) { var minutes = addLeadingZeros(absOffset % 60, 2); return sign + hours + delimiter + minutes; } - /* harmony default export */ var format_formatters = (formatters_formatters); ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/_lib/format/longFormatters/index.js var dateLongFormatter = function dateLongFormatter(pattern, formatLong) { @@ -51777,17 +51746,14 @@ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) { return formatLong.date({ width: 'short' }); - case 'PP': return formatLong.date({ width: 'medium' }); - case 'PPP': return formatLong.date({ width: 'long' }); - case 'PPPP': default: return formatLong.date({ @@ -51795,24 +51761,20 @@ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) { }); } }; - var timeLongFormatter = function timeLongFormatter(pattern, formatLong) { switch (pattern) { case 'p': return formatLong.time({ width: 'short' }); - case 'pp': return formatLong.time({ width: 'medium' }); - case 'ppp': return formatLong.time({ width: 'long' }); - case 'pppp': default: return formatLong.time({ @@ -51820,37 +51782,30 @@ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) { }); } }; - var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) { var matchResult = pattern.match(/(P+)(p+)?/) || []; var datePattern = matchResult[1]; var timePattern = matchResult[2]; - if (!timePattern) { return dateLongFormatter(pattern, formatLong); } - var dateTimeFormat; - switch (datePattern) { case 'P': dateTimeFormat = formatLong.dateTime({ width: 'short' }); break; - case 'PP': dateTimeFormat = formatLong.dateTime({ width: 'medium' }); break; - case 'PPP': dateTimeFormat = formatLong.dateTime({ width: 'long' }); break; - case 'PPPP': default: dateTimeFormat = formatLong.dateTime({ @@ -51858,10 +51813,8 @@ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) }); break; } - return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong)); }; - var longFormatters = { p: timeLongFormatter, P: dateTimeLongFormatter @@ -51968,11 +51921,9 @@ var formatDistanceLocale = { other: 'almost {{count}} years' } }; - var formatDistance = function formatDistance(token, count, options) { var result; var tokenValue = formatDistanceLocale[token]; - if (typeof tokenValue === 'string') { result = tokenValue; } else if (count === 1) { @@ -51980,7 +51931,6 @@ var formatDistance = function formatDistance(token, count, options) { } else { result = tokenValue.other.replace('{{count}}', count.toString()); } - if (options !== null && options !== void 0 && options.addSuffix) { if (options.comparison && options.comparison > 0) { return 'in ' + result; @@ -51988,10 +51938,8 @@ var formatDistance = function formatDistance(token, count, options) { return result + ' ago'; } } - return result; }; - /* harmony default export */ var _lib_formatDistance = (formatDistance); ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js function buildFormatLongFn(args) { @@ -52047,32 +51995,26 @@ var formatRelativeLocale = { nextWeek: "eeee 'at' p", other: 'P' }; - var formatRelative = function formatRelative(token, _date, _baseDate, _options) { return formatRelativeLocale[token]; }; - /* harmony default export */ var _lib_formatRelative = (formatRelative); ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js function buildLocalizeFn(args) { return function (dirtyIndex, options) { var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone'; var valuesArray; - if (context === 'formatting' && args.formattingValues) { var defaultWidth = args.defaultFormattingWidth || args.defaultWidth; var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth; valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth]; } else { var _defaultWidth = args.defaultWidth; - var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth; - valuesArray = args.values[_width] || args.values[_defaultWidth]; } - - var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it! - + var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; + // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it! return valuesArray[index]; }; } @@ -52087,11 +52029,12 @@ var quarterValues = { narrow: ['1', '2', '3', '4'], abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'], wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter'] -}; // Note: in English, the names of days of the week and months are capitalized. +}; + +// Note: in English, the names of days of the week and months are capitalized. // If you are making a new locale based on this one, check if the same is true for the language you're working on. // Generally, formatted dates should look like they are in the middle of a sentence, // e.g. in Spanish language the weekdays and months should be in the lowercase. - var monthValues = { narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'], abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], @@ -52167,9 +52110,10 @@ var formattingDayPeriodValues = { night: 'at night' } }; - var ordinalNumber = function ordinalNumber(dirtyNumber, _options) { - var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example, + var number = Number(dirtyNumber); + + // If ordinal numbers depend on context, for example, // if they are different for different grammatical genders, // use `options.unit`. // @@ -52177,23 +52121,18 @@ var ordinalNumber = function ordinalNumber(dirtyNumber, _options) { // 'day', 'hour', 'minute', 'second'. var rem100 = number % 100; - if (rem100 > 20 || rem100 < 10) { switch (rem100 % 10) { case 1: return number + 'st'; - case 2: return number + 'nd'; - case 3: return number + 'rd'; } } - return number + 'th'; }; - var localize = { ordinalNumber: ordinalNumber, era: buildLocalizeFn({ @@ -52230,11 +52169,9 @@ function buildMatchFn(args) { var width = options.width; var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth]; var matchResult = string.match(matchPattern); - if (!matchResult) { return null; } - var matchedString = matchResult[0]; var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth]; var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) { @@ -52252,24 +52189,20 @@ function buildMatchFn(args) { }; }; } - function findKey(object, predicate) { for (var key in object) { if (object.hasOwnProperty(key) && predicate(object[key])) { return key; } } - return undefined; } - function findIndex(array, predicate) { for (var key = 0; key < array.length; key++) { if (predicate(array[key])) { return key; } } - return undefined; } ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js @@ -52395,7 +52328,6 @@ var match_match = { - /** * @type {Locale} * @category Locales @@ -52413,9 +52345,7 @@ var locale = { localize: _lib_localize, match: _lib_match, options: { - weekStartsOn: 0 - /* Sunday */ - , + weekStartsOn: 0 /* Sunday */, firstWeekContainsDate: 1 } }; @@ -52445,14 +52375,15 @@ var locale = { // If there is no matching single quote // then the sequence will continue until the end of the string. // - . matches any single character unmatched by previous parts of the RegExps +var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; -var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also +// This RegExp catches symbols escaped by quotes, and also // sequences of symbols P, p, and the combinations like `PPPPPPPppppp` - var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g; var escapedStringRegExp = /^'([^]*?)'?$/; var doubleQuoteRegExp = /''/g; var unescapedLatinCharacterRegExp = /[a-zA-Z]/; + /** * @name format * @category Common Helpers @@ -52747,40 +52678,36 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/; function format(dirtyDate, dirtyFormatStr, options) { var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4; - requiredArgs_requiredArgs(2, arguments); var formatStr = String(dirtyFormatStr); var defaultOptions = defaultOptions_getDefaultOptions(); var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : defaultLocale; - var firstWeekContainsDate = toInteger_toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN + var firstWeekContainsDate = toInteger_toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1); + // Test if weekStartsOn is between 1 and 7 _and_ is not NaN if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) { throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively'); } + var weekStartsOn = toInteger_toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0); - var weekStartsOn = toInteger_toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN - + // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } - if (!locale.localize) { throw new RangeError('locale must contain localize property'); } - if (!locale.formatLong) { throw new RangeError('locale must contain formatLong property'); } - var originalDate = toDate_toDate(dirtyDate); - if (!isValid(originalDate)) { throw new RangeError('Invalid time value'); - } // Convert the date in system timezone to the same date in UTC+00:00 timezone. + } + + // Convert the date in system timezone to the same date in UTC+00:00 timezone. // This ensures that when UTC functions will be implemented, locales will be compatible with them. // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376 - - var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate); var utcDate = subMilliseconds(originalDate, timezoneOffset); var formatterOptions = { @@ -52791,55 +52718,42 @@ function format(dirtyDate, dirtyFormatStr, options) { }; var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) { var firstCharacter = substring[0]; - if (firstCharacter === 'p' || firstCharacter === 'P') { var longFormatter = format_longFormatters[firstCharacter]; return longFormatter(substring, locale.formatLong); } - return substring; }).join('').match(formattingTokensRegExp).map(function (substring) { // Replace two single quote characters with one single quote character if (substring === "''") { return "'"; } - var firstCharacter = substring[0]; - if (firstCharacter === "'") { return cleanEscapedString(substring); } - var formatter = format_formatters[firstCharacter]; - if (formatter) { if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) { throwProtectedError(substring, dirtyFormatStr, String(dirtyDate)); } - if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) { throwProtectedError(substring, dirtyFormatStr, String(dirtyDate)); } - return formatter(utcDate, substring, locale.localize, formatterOptions); } - if (firstCharacter.match(unescapedLatinCharacterRegExp)) { throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`'); } - return substring; }).join(''); return result; } - function cleanEscapedString(input) { var matched = input.match(escapedStringRegExp); - if (!matched) { return input; } - return matched[1].replace(doubleQuoteRegExp, "'"); } ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/isSameMonth/index.js @@ -52868,7 +52782,6 @@ function cleanEscapedString(input) { * const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25)) * //=> false */ - function isSameMonth(dirtyDateLeft, dirtyDateRight) { requiredArgs_requiredArgs(2, arguments); var dateLeft = toDate_toDate(dirtyDateLeft); @@ -52899,7 +52812,6 @@ function isSameMonth(dirtyDateLeft, dirtyDateRight) { * ) * //=> false */ - function isEqual_isEqual(dirtyLeftDate, dirtyRightDate) { requiredArgs_requiredArgs(2, arguments); var dateLeft = toDate_toDate(dirtyLeftDate); @@ -52937,7 +52849,6 @@ function isEqual_isEqual(dirtyLeftDate, dirtyRightDate) { * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4)) * //=> false */ - function isSameDay(dirtyDateLeft, dirtyDateRight) { requiredArgs_requiredArgs(2, arguments); var dateLeftStartOfDay = startOfDay_startOfDay(dirtyDateLeft); @@ -52966,21 +52877,17 @@ function isSameDay(dirtyDateLeft, dirtyDateRight) { * const result = addDays(new Date(2014, 8, 1), 10) * //=> Thu Sep 11 2014 00:00:00 */ - function addDays_addDays(dirtyDate, dirtyAmount) { requiredArgs_requiredArgs(2, arguments); var date = toDate_toDate(dirtyDate); var amount = toInteger_toInteger(dirtyAmount); - if (isNaN(amount)) { return new Date(NaN); } - if (!amount) { // If 0 days, no-op to avoid changing times in the hour before end of DST return date; } - date.setDate(date.getDate() + amount); return date; } @@ -53006,7 +52913,6 @@ function addDays_addDays(dirtyDate, dirtyAmount) { * const result = addWeeks(new Date(2014, 8, 1), 4) * //=> Mon Sep 29 2014 00:00:00 */ - function addWeeks_addWeeks(dirtyDate, dirtyAmount) { requiredArgs_requiredArgs(2, arguments); var amount = toInteger_toInteger(dirtyAmount); @@ -53035,7 +52941,6 @@ function addWeeks_addWeeks(dirtyDate, dirtyAmount) { * const result = subWeeks(new Date(2014, 8, 1), 4) * //=> Mon Aug 04 2014 00:00:00 */ - function subWeeks(dirtyDate, dirtyAmount) { requiredArgs_requiredArgs(2, arguments); var amount = toInteger_toInteger(dirtyAmount); @@ -53073,18 +52978,16 @@ function subWeeks(dirtyDate, dirtyAmount) { * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 }) * //=> Mon Sep 01 2014 00:00:00 */ - function startOfWeek_startOfWeek(dirtyDate, options) { var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; - requiredArgs_requiredArgs(1, arguments); var defaultOptions = defaultOptions_getDefaultOptions(); - var weekStartsOn = toInteger_toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN + var weekStartsOn = toInteger_toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); + // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } - var date = toDate_toDate(dirtyDate); var day = date.getDay(); var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; @@ -53097,7 +53000,6 @@ function startOfWeek_startOfWeek(dirtyDate, options) { - /** * @name endOfWeek * @category Week Helpers @@ -53127,15 +53029,14 @@ function startOfWeek_startOfWeek(dirtyDate, options) { */ function endOfWeek_endOfWeek(dirtyDate, options) { var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; - requiredArgs_requiredArgs(1, arguments); var defaultOptions = defaultOptions_getDefaultOptions(); - var weekStartsOn = toInteger_toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN + var weekStartsOn = toInteger_toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); + // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } - var date = toDate_toDate(dirtyDate); var day = date.getDay(); var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn); @@ -53192,25 +53093,25 @@ function date_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried t -const styles_Wrapper = emotion_styled_base_browser_esm("div", true ? { +const styles_Wrapper = createStyled("div", true ? { target: "e105ri6r5" } : 0)( true ? { name: "1khn195", styles: "box-sizing:border-box" } : 0); -const Navigator = /*#__PURE__*/emotion_styled_base_browser_esm(h_stack_component, true ? { +const Navigator = /*#__PURE__*/createStyled(h_stack_component, true ? { target: "e105ri6r4" } : 0)("margin-bottom:", space(4), ";" + ( true ? "" : 0)); -const NavigatorHeading = /*#__PURE__*/emotion_styled_base_browser_esm(heading_component, true ? { +const NavigatorHeading = /*#__PURE__*/createStyled(heading_component, true ? { target: "e105ri6r3" } : 0)("font-size:", config_values.fontSize, ";font-weight:", config_values.fontWeight, ";strong{font-weight:", config_values.fontWeightHeading, ";}" + ( true ? "" : 0)); -const Calendar = emotion_styled_base_browser_esm("div", true ? { +const Calendar = createStyled("div", true ? { target: "e105ri6r2" } : 0)("column-gap:", space(2), ";display:grid;grid-template-columns:0.5fr repeat( 5, 1fr ) 0.5fr;justify-items:center;row-gap:", space(2), ";" + ( true ? "" : 0)); -const DayOfWeek = emotion_styled_base_browser_esm("div", true ? { +const DayOfWeek = createStyled("div", true ? { target: "e105ri6r1" } : 0)("color:", COLORS.gray[700], ";font-size:", config_values.fontSize, ";line-height:", config_values.fontLineHeightBase, ";&:nth-of-type( 1 ){justify-self:start;}&:nth-of-type( 7 ){justify-self:end;}" + ( true ? "" : 0)); -const DayButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_button, true ? { +const DayButton = /*#__PURE__*/createStyled(build_module_button, true ? { shouldForwardProp: prop => !['column', 'isSelected', 'isToday', 'hasEvents'].includes(prop), target: "e105ri6r0" } : 0)("grid-column:", props => props.column, ";position:relative;justify-content:center;", props => props.column === 1 && ` @@ -53528,7 +53429,6 @@ function getDayLabel(date, isSelected, numEvents) { * const result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400)) * //=> Mon Dec 01 2014 22:15:00 */ - function startOfMinute(dirtyDate) { requiredArgs_requiredArgs(1, arguments); var date = toDate_toDate(dirtyDate); @@ -53555,7 +53455,6 @@ function startOfMinute(dirtyDate) { * const result = getDaysInMonth(new Date(2000, 1)) * //=> 29 */ - function getDaysInMonth_getDaysInMonth(dirtyDate) { requiredArgs_requiredArgs(1, arguments); var date = toDate_toDate(dirtyDate); @@ -53589,7 +53488,6 @@ function getDaysInMonth_getDaysInMonth(dirtyDate) { * const result = setMonth(new Date(2014, 8, 1), 1) * //=> Sat Feb 01 2014 00:00:00 */ - function setMonth_setMonth(dirtyDate, dirtyMonth) { requiredArgs_requiredArgs(2, arguments); var date = toDate_toDate(dirtyDate); @@ -53599,15 +53497,13 @@ function setMonth_setMonth(dirtyDate, dirtyMonth) { var dateWithDesiredMonth = new Date(0); dateWithDesiredMonth.setFullYear(year, month, 15); dateWithDesiredMonth.setHours(0, 0, 0, 0); - var daysInMonth = getDaysInMonth_getDaysInMonth(dateWithDesiredMonth); // Set the last day of the new month + var daysInMonth = getDaysInMonth_getDaysInMonth(dateWithDesiredMonth); + // Set the last day of the new month // if the original date was the last day of the longer month - date.setMonth(month, Math.min(day, daysInMonth)); return date; } ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/set/index.js -function set_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { set_typeof = function _typeof(obj) { return typeof obj; }; } else { set_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return set_typeof(obj); } - @@ -53653,45 +53549,36 @@ function set_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "fun */ function set_set(dirtyDate, values) { requiredArgs_requiredArgs(2, arguments); - - if (set_typeof(values) !== 'object' || values === null) { + if (_typeof(values) !== 'object' || values === null) { throw new RangeError('values parameter must be an object'); } + var date = toDate_toDate(dirtyDate); - var date = toDate_toDate(dirtyDate); // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date - + // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date if (isNaN(date.getTime())) { return new Date(NaN); } - if (values.year != null) { date.setFullYear(values.year); } - if (values.month != null) { date = setMonth_setMonth(date, values.month); } - if (values.date != null) { date.setDate(toInteger_toInteger(values.date)); } - if (values.hours != null) { date.setHours(toInteger_toInteger(values.hours)); } - if (values.minutes != null) { date.setMinutes(toInteger_toInteger(values.minutes)); } - if (values.seconds != null) { date.setSeconds(toInteger_toInteger(values.seconds)); } - if (values.milliseconds != null) { date.setMilliseconds(toInteger_toInteger(values.milliseconds)); } - return date; } ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/setHours/index.js @@ -53716,7 +53603,6 @@ function set_set(dirtyDate, values) { * const result = setHours(new Date(2014, 8, 1, 11, 30), 4) * //=> Mon Sep 01 2014 04:30:00 */ - function setHours(dirtyDate, dirtyHours) { requiredArgs_requiredArgs(2, arguments); var date = toDate_toDate(dirtyDate); @@ -53743,46 +53629,46 @@ function time_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried t -const time_styles_Wrapper = emotion_styled_base_browser_esm("div", true ? { +const time_styles_Wrapper = createStyled("div", true ? { target: "evcr23110" } : 0)("box-sizing:border-box;font-size:", config_values.fontSize, ";" + ( true ? "" : 0)); -const Fieldset = emotion_styled_base_browser_esm("fieldset", true ? { +const Fieldset = createStyled("fieldset", true ? { target: "evcr2319" } : 0)("border:0;margin:0 0 ", space(2 * 2), " 0;padding:0;&:last-child{margin-bottom:0;}" + ( true ? "" : 0)); -const TimeWrapper = emotion_styled_base_browser_esm("div", true ? { +const TimeWrapper = createStyled("div", true ? { target: "evcr2318" } : 0)( true ? { name: "pd0mhc", styles: "direction:ltr;display:flex" } : 0); const baseInput = /*#__PURE__*/emotion_react_browser_esm_css("&&& ", Input, "{padding-left:", space(2), ";padding-right:", space(2), ";text-align:center;}" + ( true ? "" : 0), true ? "" : 0); -const HoursInput = /*#__PURE__*/emotion_styled_base_browser_esm(number_control, true ? { +const HoursInput = /*#__PURE__*/createStyled(number_control, true ? { target: "evcr2317" } : 0)(baseInput, " width:", space(9), ";&&& ", Input, "{padding-right:0;}&&& ", BackdropUI, "{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;}" + ( true ? "" : 0)); -const TimeSeparator = emotion_styled_base_browser_esm("span", true ? { +const TimeSeparator = createStyled("span", true ? { target: "evcr2316" } : 0)("border-top:", config_values.borderWidth, " solid ", COLORS.gray[700], ";border-bottom:", config_values.borderWidth, " solid ", COLORS.gray[700], ";line-height:calc(\n\t\t", config_values.controlHeight, " - ", config_values.borderWidth, " * 2\n\t);display:inline-block;" + ( true ? "" : 0)); -const MinutesInput = /*#__PURE__*/emotion_styled_base_browser_esm(number_control, true ? { +const MinutesInput = /*#__PURE__*/createStyled(number_control, true ? { target: "evcr2315" } : 0)(baseInput, " width:", space(9), ";&&& ", Input, "{padding-left:0;}&&& ", BackdropUI, "{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;}" + ( true ? "" : 0)); // Ideally we wouldn't need a wrapper, but can't otherwise target the // in -const MonthSelectWrapper = emotion_styled_base_browser_esm("div", true ? { +const MonthSelectWrapper = createStyled("div", true ? { target: "evcr2314" } : 0)( true ? { name: "1ff36h2", styles: "flex-grow:1" } : 0); -const MonthSelect = /*#__PURE__*/emotion_styled_base_browser_esm(select_control, true ? { +const MonthSelect = /*#__PURE__*/createStyled(select_control, true ? { target: "evcr2313" } : 0)("height:36px;", Select, "{line-height:30px;}" + ( true ? "" : 0)); -const DayInput = /*#__PURE__*/emotion_styled_base_browser_esm(number_control, true ? { +const DayInput = /*#__PURE__*/createStyled(number_control, true ? { target: "evcr2312" } : 0)(baseInput, " width:", space(9), ";" + ( true ? "" : 0)); -const YearInput = /*#__PURE__*/emotion_styled_base_browser_esm(number_control, true ? { +const YearInput = /*#__PURE__*/createStyled(number_control, true ? { target: "evcr2311" } : 0)(baseInput, " width:", space(14), ";" + ( true ? "" : 0)); -const TimeZone = emotion_styled_base_browser_esm("div", true ? { +const TimeZone = createStyled("div", true ? { target: "evcr2310" } : 0)( true ? { name: "ebu3jh", @@ -54156,13 +54042,13 @@ function date_time_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tr * Internal dependencies */ -const date_time_styles_Wrapper = /*#__PURE__*/emotion_styled_base_browser_esm(v_stack_component, true ? { +const date_time_styles_Wrapper = /*#__PURE__*/createStyled(v_stack_component, true ? { target: "e1p5onf01" } : 0)( true ? { name: "1khn195", styles: "box-sizing:border-box" } : 0); -const CalendarHelp = emotion_styled_base_browser_esm("div", true ? { +const CalendarHelp = createStyled("div", true ? { target: "e1p5onf00" } : 0)( true ? { name: "l0rwn2", @@ -55373,7 +55259,7 @@ function external_link_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You hav * WordPress dependencies */ -const StyledIcon = /*#__PURE__*/emotion_styled_base_browser_esm(icons_build_module_icon, true ? { +const StyledIcon = /*#__PURE__*/createStyled(icons_build_module_icon, true ? { target: "esh4a730" } : 0)( true ? { name: "rvs7bx", @@ -55523,22 +55409,22 @@ function focal_point_picker_style_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You -const MediaWrapper = emotion_styled_base_browser_esm("div", true ? { +const MediaWrapper = createStyled("div", true ? { target: "eeew7dm8" } : 0)( true ? { name: "w0nf6b", styles: "background-color:transparent;text-align:center;width:100%" } : 0); -const MediaContainer = emotion_styled_base_browser_esm("div", true ? { +const MediaContainer = createStyled("div", true ? { target: "eeew7dm7" } : 0)( true ? { name: "megach", styles: "align-items:center;box-shadow:0 0 0 1px rgba( 0, 0, 0, 0.2 );cursor:pointer;display:inline-flex;justify-content:center;margin:auto;position:relative;height:100%;img,video{box-sizing:border-box;display:block;height:auto;margin:0;max-height:100%;max-width:100%;pointer-events:none;user-select:none;width:auto;}" } : 0); -const MediaPlaceholder = emotion_styled_base_browser_esm("div", true ? { +const MediaPlaceholder = createStyled("div", true ? { target: "eeew7dm6" } : 0)("background:", COLORS.gray[100], ";box-sizing:border-box;height:", INITIAL_BOUNDS.height, "px;max-width:280px;min-width:", INITIAL_BOUNDS.width, "px;width:100%;" + ( true ? "" : 0)); -const StyledUnitControl = /*#__PURE__*/emotion_styled_base_browser_esm(unit_control, true ? { +const StyledUnitControl = /*#__PURE__*/createStyled(unit_control, true ? { target: "eeew7dm5" } : 0)( true ? { name: "1pzk433", @@ -55569,10 +55455,10 @@ const extraHelpTextMargin = _ref4 => { return hasHelpText ? focal_point_picker_style_ref : undefined; }; -const ControlWrapper = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? { +const ControlWrapper = /*#__PURE__*/createStyled(flex_component, true ? { target: "eeew7dm4" } : 0)("max-width:320px;padding-top:1em;", extraHelpTextMargin, " ", focal_point_picker_style_deprecatedBottomMargin, ";" + ( true ? "" : 0)); -const GridView = emotion_styled_base_browser_esm("div", true ? { +const GridView = createStyled("div", true ? { target: "eeew7dm3" } : 0)("left:50%;overflow:hidden;pointer-events:none;position:absolute;top:50%;transform:translate3d( -50%, -50%, 0 );transition:opacity 120ms linear;z-index:1;opacity:", _ref5 => { let { @@ -55580,19 +55466,19 @@ const GridView = emotion_styled_base_browser_esm("div", true ? { } = _ref5; return showOverlay ? 1 : 0; }, ";" + ( true ? "" : 0)); -const GridLine = emotion_styled_base_browser_esm("div", true ? { +const GridLine = createStyled("div", true ? { target: "eeew7dm2" } : 0)( true ? { name: "1d42i6k", styles: "background:white;box-shadow:0 0 2px rgba( 0, 0, 0, 0.6 );position:absolute;opacity:0.4;transform:translateZ( 0 )" } : 0); -const GridLineX = /*#__PURE__*/emotion_styled_base_browser_esm(GridLine, true ? { +const GridLineX = /*#__PURE__*/createStyled(GridLine, true ? { target: "eeew7dm1" } : 0)( true ? { name: "1qp910y", styles: "height:1px;left:0;right:0" } : 0); -const GridLineY = /*#__PURE__*/emotion_styled_base_browser_esm(GridLine, true ? { +const GridLineY = /*#__PURE__*/createStyled(GridLine, true ? { target: "eeew7dm0" } : 0)( true ? { name: "1oz3zka", @@ -55678,7 +55564,7 @@ function FocalPointUnitControl(props) { /** * External dependencies */ -const PointerCircle = emotion_styled_base_browser_esm("div", true ? { +const PointerCircle = createStyled("div", true ? { target: "e19snlhg0" } : 0)("background-color:transparent;cursor:grab;height:48px;margin:-24px 0 0 -24px;position:absolute;user-select:none;width:48px;will-change:transform;z-index:10000;background:rgba( 255, 255, 255, 0.6 );border-radius:50%;backdrop-filter:blur( 4px );box-shadow:rgb( 0 0 0 / 20% ) 0px 0px 10px;", _ref => { let { @@ -56187,22 +56073,22 @@ function font_size_picker_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You -const styles_Container = emotion_styled_base_browser_esm("fieldset", true ? { +const styles_Container = createStyled("fieldset", true ? { target: "e8tqeku4" } : 0)( true ? { name: "1t1ytme", styles: "border:0;margin:0;padding:0" } : 0); -const HeaderLabel = /*#__PURE__*/emotion_styled_base_browser_esm(base_control.VisualLabel, true ? { +const HeaderLabel = /*#__PURE__*/createStyled(base_control.VisualLabel, true ? { target: "e8tqeku3" } : 0)("display:flex;gap:", space(1), ";justify-content:flex-start;margin-bottom:0;" + ( true ? "" : 0)); -const HeaderHint = emotion_styled_base_browser_esm("span", true ? { +const HeaderHint = createStyled("span", true ? { target: "e8tqeku2" } : 0)("color:", COLORS.gray[700], ";" + ( true ? "" : 0)); -const Controls = emotion_styled_base_browser_esm("div", true ? { +const Controls = createStyled("div", true ? { target: "e8tqeku1" } : 0)(props => !props.__nextHasNoMarginBottom && `margin-bottom: ${space(6)};`, ";" + ( true ? "" : 0)); -const ResetButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_button, true ? { +const ResetButton = /*#__PURE__*/createStyled(build_module_button, true ? { target: "e8tqeku0" } : 0)("&&&{height:", props => props.size === '__unstable-large' ? '40px' : '30px', ";}" + ( true ? "" : 0)); @@ -56329,10 +56215,10 @@ const toggle_group_control_styles_block = true ? { name: "7whenc", styles: "display:flex;width:100%" } : 0; -const BackdropView = emotion_styled_base_browser_esm("div", true ? { +const BackdropView = createStyled("div", true ? { target: "eakva831" } : 0)("background:", COLORS.gray[900], ";border-radius:", config_values.controlBorderRadius, ";left:0;position:absolute;top:2px;bottom:2px;transition:transform ", config_values.transitionDurationFast, " ease;", reduceMotion('transition'), " z-index:1;" + ( true ? "" : 0)); -const VisualLabelWrapper = emotion_styled_base_browser_esm("div", true ? { +const VisualLabelWrapper = createStyled("div", true ? { target: "eakva830" } : 0)( true ? { name: "zjik7", @@ -56978,7 +56864,7 @@ function toggle_group_control_option_base_styles_EMOTION_STRINGIFIED_CSS_ERROR_( * Internal dependencies */ -const LabelView = emotion_styled_base_browser_esm("div", true ? { +const LabelView = createStyled("div", true ? { target: "et6ln9s1" } : 0)( true ? { name: "sln1fl", @@ -57001,7 +56887,7 @@ const buttonView = _ref => { }; const pressed = /*#__PURE__*/emotion_react_browser_esm_css("color:", COLORS.white, ";&:active{background:transparent;}" + ( true ? "" : 0), true ? "" : 0); const deselectable = /*#__PURE__*/emotion_react_browser_esm_css("color:", COLORS.gray[900], ";&:focus{box-shadow:inset 0 0 0 1px ", COLORS.white, ",0 0 0 ", config_values.borderWidthFocus, " ", COLORS.ui.theme, ";outline:2px solid transparent;}" + ( true ? "" : 0), true ? "" : 0); -const ButtonContentView = emotion_styled_base_browser_esm("div", true ? { +const ButtonContentView = createStyled("div", true ? { target: "et6ln9s0" } : 0)("display:flex;font-size:", config_values.fontSize, ";line-height:1;" + ( true ? "" : 0)); @@ -57705,7 +57591,7 @@ const deprecatedPaddings = _ref => { return !__next36pxDefaultSize && /*#__PURE__*/emotion_react_browser_esm_css("padding-top:", space(hasTokens ? 1 : 0.5), ";padding-bottom:", space(hasTokens ? 1 : 0.5), ";" + ( true ? "" : 0), true ? "" : 0); }; -const TokensAndInputWrapperFlex = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? { +const TokensAndInputWrapperFlex = /*#__PURE__*/createStyled(flex_component, true ? { target: "ehq8nmi0" } : 0)("padding:5px ", space(1), ";", deprecatedPaddings, ";" + ( true ? "" : 0)); @@ -59250,53 +59136,53 @@ function navigation_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have t -const NavigationUI = emotion_styled_base_browser_esm("div", true ? { +const NavigationUI = createStyled("div", true ? { target: "ejwewyf11" } : 0)("width:100%;box-sizing:border-box;padding:0 ", space(4), ";overflow:hidden;" + ( true ? "" : 0)); -const MenuUI = emotion_styled_base_browser_esm("div", true ? { +const MenuUI = createStyled("div", true ? { target: "ejwewyf10" } : 0)("margin-top:", space(6), ";margin-bottom:", space(6), ";display:flex;flex-direction:column;ul{padding:0;margin:0;list-style:none;}.components-navigation__back-button{margin-bottom:", space(6), ";}.components-navigation__group+.components-navigation__group{margin-top:", space(6), ";}" + ( true ? "" : 0)); -const MenuBackButtonUI = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_button, true ? { +const MenuBackButtonUI = /*#__PURE__*/createStyled(build_module_button, true ? { target: "ejwewyf9" } : 0)( true ? { name: "26l0q2", styles: "&.is-tertiary{color:inherit;opacity:0.7;&:hover:not( :disabled ){opacity:1;box-shadow:none;color:inherit;}&:active:not( :disabled ){background:transparent;opacity:1;color:inherit;}}" } : 0); -const MenuTitleUI = emotion_styled_base_browser_esm("div", true ? { +const MenuTitleUI = createStyled("div", true ? { target: "ejwewyf8" } : 0)( true ? { name: "1aubja5", styles: "overflow:hidden;width:100%" } : 0); -const MenuTitleActionsUI = emotion_styled_base_browser_esm("span", true ? { +const MenuTitleActionsUI = createStyled("span", true ? { target: "ejwewyf7" } : 0)("height:", space(6), ";.components-button.is-small{color:inherit;opacity:0.7;margin-right:", space(1), ";padding:0;&:active:not( :disabled ){background:none;opacity:1;color:inherit;}&:hover:not( :disabled ){box-shadow:none;opacity:1;color:inherit;}}" + ( true ? "" : 0)); -const MenuTitleSearchUI = /*#__PURE__*/emotion_styled_base_browser_esm(search_control, true ? { +const MenuTitleSearchUI = /*#__PURE__*/createStyled(search_control, true ? { target: "ejwewyf6" } : 0)( true ? { name: "za3n3e", styles: "input[type='search'].components-search-control__input{margin:0;background:#303030;color:#fff;&:focus{background:#434343;color:#fff;}&::placeholder{color:rgba( 255, 255, 255, 0.6 );}}svg{fill:white;}.components-button.has-icon{padding:0;min-width:auto;}" } : 0); -const GroupTitleUI = /*#__PURE__*/emotion_styled_base_browser_esm(heading_component, true ? { +const GroupTitleUI = /*#__PURE__*/createStyled(heading_component, true ? { target: "ejwewyf5" } : 0)("min-height:", space(12), ";align-items:center;color:inherit;display:flex;justify-content:space-between;margin-bottom:", space(2), ";padding:", () => (0,external_wp_i18n_namespaceObject.isRTL)() ? `${space(1)} ${space(4)} ${space(1)} ${space(2)}` : `${space(1)} ${space(2)} ${space(1)} ${space(4)}`, ";" + ( true ? "" : 0)); -const ItemBaseUI = emotion_styled_base_browser_esm("li", true ? { +const ItemBaseUI = createStyled("li", true ? { target: "ejwewyf4" } : 0)("border-radius:2px;color:inherit;margin-bottom:0;>button,>a.components-button,>a{width:100%;color:inherit;opacity:0.7;padding:", space(2), " ", space(4), ";", rtl({ textAlign: 'left' }, { textAlign: 'right' }), " &:hover,&:focus:not( [aria-disabled='true'] ):active,&:active:not( [aria-disabled='true'] ):active{color:inherit;opacity:1;}}&.is-active{background-color:", COLORS.ui.theme, ";color:", COLORS.white, ";>button,>a{color:", COLORS.white, ";opacity:1;}}>svg path{color:", COLORS.gray[600], ";}" + ( true ? "" : 0)); -const ItemUI = emotion_styled_base_browser_esm("div", true ? { +const ItemUI = createStyled("div", true ? { target: "ejwewyf3" } : 0)("display:flex;align-items:center;height:auto;min-height:40px;margin:0;padding:", space(1.5), " ", space(4), ";font-weight:400;line-height:20px;width:100%;color:inherit;opacity:0.7;" + ( true ? "" : 0)); -const ItemIconUI = emotion_styled_base_browser_esm("span", true ? { +const ItemIconUI = createStyled("span", true ? { target: "ejwewyf2" } : 0)("display:flex;margin-right:", space(2), ";" + ( true ? "" : 0)); -const ItemBadgeUI = emotion_styled_base_browser_esm("span", true ? { +const ItemBadgeUI = createStyled("span", true ? { target: "ejwewyf1" } : 0)("margin-left:", () => (0,external_wp_i18n_namespaceObject.isRTL)() ? '0' : space(2), ";margin-right:", () => (0,external_wp_i18n_namespaceObject.isRTL)() ? space(2) : '0', ";display:inline-flex;padding:", space(1), " ", space(3), ";border-radius:2px;animation:fade-in 250ms ease-out;@keyframes fade-in{from{opacity:0;}to{opacity:1;}}", reduceMotion('animation'), ";" + ( true ? "" : 0)); -const ItemTitleUI = /*#__PURE__*/emotion_styled_base_browser_esm(text_component, true ? { +const ItemTitleUI = /*#__PURE__*/createStyled(text_component, true ? { target: "ejwewyf0" } : 0)(() => (0,external_wp_i18n_namespaceObject.isRTL)() ? 'margin-left: auto;' : 'margin-right: auto;', " font-size:14px;line-height:20px;color:inherit;" + ( true ? "" : 0)); @@ -63557,24 +63443,24 @@ function resize_tooltip_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You ha */ -const resize_tooltip_styles_Root = emotion_styled_base_browser_esm("div", true ? { +const resize_tooltip_styles_Root = createStyled("div", true ? { target: "ekdag503" } : 0)( true ? { name: "1cd7zoc", styles: "bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0" } : 0); -const TooltipWrapper = emotion_styled_base_browser_esm("div", true ? { +const TooltipWrapper = createStyled("div", true ? { target: "ekdag502" } : 0)( true ? { name: "ajymcs", styles: "align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear" } : 0); -const resize_tooltip_styles_Tooltip = emotion_styled_base_browser_esm("div", true ? { +const resize_tooltip_styles_Tooltip = createStyled("div", true ? { target: "ekdag501" } : 0)("background:", COLORS.gray[900], ";border-radius:2px;box-sizing:border-box;font-size:12px;color:", COLORS.ui.textDark, ";padding:4px 8px;position:relative;" + ( true ? "" : 0)); // TODO: Resolve need to use &&& to increase specificity // https://github.com/WordPress/gutenberg/issues/18483 -const LabelText = /*#__PURE__*/emotion_styled_base_browser_esm(text_component, true ? { +const LabelText = /*#__PURE__*/createStyled(text_component, true ? { target: "ekdag500" } : 0)("&&&{color:", COLORS.ui.textDark, ";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}" + ( true ? "" : 0)); @@ -64376,17 +64262,17 @@ const spinAnimation = emotion_react_browser_esm_keyframes` transform: rotate(360deg); } `; -const StyledSpinner = emotion_styled_base_browser_esm("svg", true ? { +const StyledSpinner = createStyled("svg", true ? { target: "ea4tfvq2" } : 0)("width:", config_values.spinnerSize, "px;height:", config_values.spinnerSize, "px;display:inline-block;margin:5px 11px 0;position:relative;color:", COLORS.ui.theme, ";overflow:visible;" + ( true ? "" : 0)); const commonPathProps = true ? { name: "9s4963", styles: "fill:transparent;stroke-width:1.5px" } : 0; -const SpinnerTrack = emotion_styled_base_browser_esm("circle", true ? { +const SpinnerTrack = createStyled("circle", true ? { target: "ea4tfvq1" } : 0)(commonPathProps, ";stroke:", COLORS.gray[300], ";" + ( true ? "" : 0)); -const SpinnerIndicator = emotion_styled_base_browser_esm("path", true ? { +const SpinnerIndicator = createStyled("path", true ? { target: "ea4tfvq0" } : 0)(commonPathProps, ";stroke:currentColor;stroke-linecap:round;transform-origin:50% 50%;animation:1.4s linear infinite both ", spinAnimation, ";" + ( true ? "" : 0)); @@ -64814,7 +64700,7 @@ const inputControl = /*#__PURE__*/emotion_react_browser_esm_css("font-family:", * Internal dependencies */ -const StyledTextarea = emotion_styled_base_browser_esm("textarea", true ? { +const StyledTextarea = createStyled("textarea", true ? { target: "e1w5nnrk0" } : 0)("width:100%;", inputControl, ";" + ( true ? "" : 0)); @@ -65794,7 +65680,7 @@ const styles_DropdownMenu = true ? { name: "16gsvie", styles: "min-width:200px" } : 0; -const ResetLabel = emotion_styled_base_browser_esm("span", true ? { +const ResetLabel = createStyled("span", true ? { target: "ews648u0" } : 0)("color:", COLORS.ui.themeDark10, ";font-size:11px;font-weight:500;line-height:1.4;", rtl({ marginLeft: space(3) @@ -67007,13 +66893,13 @@ function z_stack_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have trie * Internal dependencies */ -const ZStackView = emotion_styled_base_browser_esm("div", true ? { +const ZStackView = createStyled("div", true ? { target: "ebn2ljm1" } : 0)( true ? { name: "5ob2ly", styles: "display:flex;position:relative" } : 0); -const ZStackChildView = emotion_styled_base_browser_esm("div", true ? { +const ZStackChildView = createStyled("div", true ? { target: "ebn2ljm0" } : 0)(_ref => { let { diff --git a/wp-includes/js/dist/components.min.js b/wp-includes/js/dist/components.min.js index 49c87e133f..b871389209 100644 --- a/wp-includes/js/dist/components.min.js +++ b/wp-includes/js/dist/components.min.js @@ -29,11 +29,11 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var r=n(9196);var o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,a=r.useEffect,s=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return s((function(){o.value=n,o.getSnapshot=t,c(o)&&u({inst:o})}),[e,n,t]),a((function(){return c(o)&&u({inst:o}),e((function(){c(o)&&u({inst:o})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},635:function(e,t,n){"use strict";e.exports=n(7755)},9196:function(e){"use strict";e.exports=window.React}},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.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var r={};!function(){"use strict";n.r(r),n.d(r,{AnglePickerControl:function(){return ib},Animate:function(){return Tm},Autocomplete:function(){return vb},BaseControl:function(){return Nv},BlockQuotation:function(){return i.BlockQuotation},Button:function(){return od},ButtonGroup:function(){return RC},Card:function(){return ck},CardBody:function(){return vk},CardDivider:function(){return Ck},CardFooter:function(){return kk},CardHeader:function(){return Sk},CardMedia:function(){return Tk},CheckboxControl:function(){return Nk},Circle:function(){return i.Circle},ClipboardButton:function(){return Rk},ColorIndicator:function(){return Zb},ColorPalette:function(){return Q_},ColorPicker:function(){return F_},ComboboxControl:function(){return cT},CustomGradientPicker:function(){return bS},CustomSelectControl:function(){return EN},Dashicon:function(){return Kl},DatePicker:function(){return SI},DateTimePicker:function(){return ZI},Disabled:function(){return iM},Draggable:function(){return sM},DropZone:function(){return cM},DropZoneProvider:function(){return uM},Dropdown:function(){return ny},DropdownMenu:function(){return OS},DuotonePicker:function(){return bM},DuotoneSwatch:function(){return pM},ExternalLink:function(){return xM},Fill:function(){return mf},Flex:function(){return Zm},FlexBlock:function(){return jm},FlexItem:function(){return $m},FocalPointPicker:function(){return GM},FocusReturnProvider:function(){return Ez},FocusableIframe:function(){return YM},FontSizePicker:function(){return jP},FormFileUpload:function(){return $P},FormToggle:function(){return UP},FormTokenField:function(){return ZP},G:function(){return i.G},GradientPicker:function(){return _S},Guide:function(){return eO},GuidePage:function(){return tO},HorizontalRule:function(){return i.HorizontalRule},Icon:function(){return Xl},IconButton:function(){return nO},IsolatedEventContainer:function(){return sz},KeyboardShortcuts:function(){return aO},Line:function(){return i.Line},MenuGroup:function(){return sO},MenuItem:function(){return lO},MenuItemsChoice:function(){return uO},Modal:function(){return gT},NavigableMenu:function(){return IS},Notice:function(){return ED},NoticeList:function(){return kD},Panel:function(){return TD},PanelBody:function(){return PD},PanelHeader:function(){return SD},PanelRow:function(){return OD},Path:function(){return i.Path},Placeholder:function(){return AD},Polygon:function(){return i.Polygon},Popover:function(){return Mf},QueryControls:function(){return GD},RadioControl:function(){return XD},RangeControl:function(){return $y},Rect:function(){return i.Rect},ResizableBox:function(){return LA},ResponsiveWrapper:function(){return zA},SVG:function(){return i.SVG},SandBox:function(){return VA},ScrollLock:function(){return ld},SearchControl:function(){return bO},SelectControl:function(){return fy},Slot:function(){return hf},SlotFillProvider:function(){return gf},Snackbar:function(){return jA},SnackbarList:function(){return WA},Spinner:function(){return ZA},TabPanel:function(){return eL},TabbableContainer:function(){return dO},TextControl:function(){return nL},TextHighlight:function(){return cL},TextareaControl:function(){return lL},TimePicker:function(){return GI},Tip:function(){return dL},ToggleControl:function(){return fL},Toolbar:function(){return NL},ToolbarButton:function(){return xL},ToolbarDropdownMenu:function(){return RL},ToolbarGroup:function(){return CL},ToolbarItem:function(){return yL},Tooltip:function(){return Bf},TreeSelect:function(){return FD},VisuallyHidden:function(){return td},__experimentalAlignmentMatrixControl:function(){return Cm},__experimentalApplyValueToSides:function(){return lC},__experimentalBorderBoxControl:function(){return zE},__experimentalBorderControl:function(){return yE},__experimentalBoxControl:function(){return NC},__experimentalConfirmDialog:function(){return bT},__experimentalDimensionControl:function(){return QI},__experimentalDivider:function(){return Ek},__experimentalDropdownContentWrapper:function(){return Y_},__experimentalElevation:function(){return OC},__experimentalGrid:function(){return _E},__experimentalHStack:function(){return Gv},__experimentalHasSplitBorders:function(){return IE},__experimentalHeading:function(){return W_},__experimentalInputControl:function(){return Mv},__experimentalInputControlPrefixWrapper:function(){return oO},__experimentalInputControlSuffixWrapper:function(){return ry},__experimentalIsDefinedBorder:function(){return RE},__experimentalIsEmptyBorder:function(){return NE},__experimentalItem:function(){return rO},__experimentalItemGroup:function(){return Gk},__experimentalNavigation:function(){return OO},__experimentalNavigationBackButton:function(){return LO},__experimentalNavigationGroup:function(){return FO},__experimentalNavigationItem:function(){return qO},__experimentalNavigationMenu:function(){return QO},__experimentalNavigatorBackButton:function(){return yD},__experimentalNavigatorButton:function(){return vD},__experimentalNavigatorProvider:function(){return dD},__experimentalNavigatorScreen:function(){return hD},__experimentalNavigatorToParentButton:function(){return wD},__experimentalNumberControl:function(){return Jv},__experimentalPaletteEdit:function(){return ZS},__experimentalParseQuantityAndUnitFromRawValue:function(){return sE},__experimentalRadio:function(){return qD},__experimentalRadioGroup:function(){return KD},__experimentalScrollable:function(){return gk},__experimentalSpacer:function(){return Kv},__experimentalStyleProvider:function(){return af},__experimentalSurface:function(){return JA},__experimentalText:function(){return Ih},__experimentalToggleGroupControl:function(){return wP},__experimentalToggleGroupControlOption:function(){return zP},__experimentalToggleGroupControlOptionIcon:function(){return mL},__experimentalToolbarContext:function(){return bL},__experimentalToolsPanel:function(){return qL},__experimentalToolsPanelContext:function(){return VL},__experimentalToolsPanelItem:function(){return KL},__experimentalTreeGrid:function(){return tz},__experimentalTreeGridCell:function(){return iz},__experimentalTreeGridItem:function(){return oz},__experimentalTreeGridRow:function(){return nz},__experimentalTruncate:function(){return $_},__experimentalUnitControl:function(){return hE},__experimentalUseCustomUnits:function(){return cE},__experimentalUseNavigator:function(){return gD},__experimentalUseSlot:function(){return Vd},__experimentalUseSlotFills:function(){return lz},__experimentalVStack:function(){return j_},__experimentalView:function(){return ed},__experimentalZStack:function(){return mz},__unstableAnimatePresence:function(){return Dm},__unstableComposite:function(){return pm},__unstableCompositeGroup:function(){return gm},__unstableCompositeItem:function(){return Se},__unstableDisclosureContent:function(){return Rx},__unstableGetAnimateClassName:function(){return Sm},__unstableMotion:function(){return Ul},__unstableUseAutocompleteProps:function(){return gb},__unstableUseCompositeState:function(){return om},__unstableUseNavigateRegions:function(){return gz},createSlotFill:function(){return vf},navigateRegions:function(){return vz},privateApis:function(){return Nz},useBaseControlProps:function(){return bb},withConstrainedTabbing:function(){return bz},withFallbackStyles:function(){return yz},withFilters:function(){return xz},withFocusOutside:function(){return aT},withFocusReturn:function(){return _z},withNotices:function(){return Cz},withSpokenMessages:function(){return KO}});var e={};n.r(e),n.d(e,{Text:function(){return hh},block:function(){return gh},destructive:function(){return bh},highlighterText:function(){return wh},muted:function(){return yh},positive:function(){return vh},upperCase:function(){return xh}});var t={};n.r(t),n.d(t,{TooltipContent:function(){return zx},TooltipPopoverView:function(){return Bx},TooltipShortcut:function(){return Vx},noOutline:function(){return Fx}});var o={};n.r(o),n.d(o,{ButtonContentView:function(){return IP},LabelView:function(){return kP},buttonView:function(){return TP},labelBlock:function(){return SP}});var i=window.wp.primitives;function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}var b=n(9196),y=n.n(b);function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _(e){for(var t=1;t=0||(o[n]=e[n]);return o}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}var S=(0,b.createContext)({});var T,N=function(e,t,n){void 0===n&&(n=t.children);var r=(0,b.useContext)(S);if(r.useCreateElement)return r.useCreateElement(e,t,n);if("string"==typeof e&&function(e){return"function"==typeof e}(n)){t.children;return n(E(t,["children"]))}return(0,b.createElement)(e,t,n)};function R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t=0?n[a]=e[a]:r[a]=e[a]}return[n,r]}function D(e,t){if(void 0===t&&(t=[]),!P(e.state))return O(e,t);var n=O(e,[].concat(t,["state"])),r=n[0],o=n[1],i=r.state,a=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(r,["state"]);return[M(M({},i),a),o]}function A(e,t){if(e===t)return!0;if(!e)return!1;if(!t)return!1;if("object"!=typeof e)return!1;if("object"!=typeof t)return!1;var n=Object.keys(e),r=Object.keys(t),o=n.length;if(r.length!==o)return!1;for(var i=0,a=n;i0||t.offsetHeight>0||e.getClientRects().length>0}(e)}var re=F({name:"Role",keys:["unstable_system"],propsAreEqual:function(e,t){var n=e.unstable_system,r=h(e,["unstable_system"]),o=t.unstable_system,i=h(t,["unstable_system"]);return!(n!==o&&!A(n,o))&&A(r,i)}}),oe=(z({as:"div",useHook:re}),ee("Mac")&&!ee("Chrome")&&(ee("Safari")||ee("Firefox")));function ie(e){!X(e)&&ne(e)&&e.focus()}function ae(e,t,n,r){return e?t&&!n?-1:void 0:t?r:r||0}function se(e,t){return(0,b.useCallback)((function(n){var r;null===(r=e.current)||void 0===r||r.call(e,n),n.defaultPrevented||t&&(n.stopPropagation(),n.preventDefault())}),[e,t])}var le=F({name:"Tabbable",compose:re,keys:["disabled","focusable"],useOptions:function(e,t){return m({disabled:t.disabled},e)},useProps:function(e,t){var n=t.ref,r=t.tabIndex,o=t.onClickCapture,i=t.onMouseDownCapture,a=t.onMouseDown,s=t.onKeyPressCapture,l=t.style,c=h(t,["ref","tabIndex","onClickCapture","onMouseDownCapture","onMouseDown","onKeyPressCapture","style"]),u=(0,b.useRef)(null),d=G(o),f=G(i),p=G(a),g=G(s),v=!!e.disabled&&!e.focusable,y=(0,b.useState)(!0),w=y[0],x=y[1],_=(0,b.useState)(!0),E=_[0],C=_[1],k=e.disabled?m({pointerEvents:"none"},l):l;U((function(){var e=u.current;e&&(["BUTTON","INPUT","SELECT","TEXTAREA","A"].includes(e.tagName)||x(!1),function(e){return["BUTTON","INPUT","SELECT","TEXTAREA"].includes(e.tagName)}(e)||C(!1))}),[]);var S=se(d,e.disabled),T=se(f,e.disabled),N=se(g,e.disabled),R=(0,b.useCallback)((function(e){var t;null===(t=p.current)||void 0===t||t.call(p,e);var n=e.currentTarget;if(!e.defaultPrevented&&oe&&!Z(e)&&Q(n)){var r=requestAnimationFrame((function(){n.removeEventListener("mouseup",o,!0),ie(n)})),o=function(){cancelAnimationFrame(r),ie(n)};n.addEventListener("mouseup",o,{once:!0,capture:!0})}}),[]);return m({ref:H(u,n),style:k,tabIndex:ae(v,w,E,r),disabled:!(!v||!E)||void 0,"aria-disabled":!!e.disabled||void 0,onClickCapture:S,onMouseDownCapture:T,onMouseDown:R,onKeyPressCapture:N},c)}});z({as:"div",useHook:le});var ce=F({name:"Clickable",compose:le,keys:["unstable_clickOnEnter","unstable_clickOnSpace"],useOptions:function(e){var t=e.unstable_clickOnEnter,n=void 0===t||t,r=e.unstable_clickOnSpace;return m({unstable_clickOnEnter:n,unstable_clickOnSpace:void 0===r||r},h(e,["unstable_clickOnEnter","unstable_clickOnSpace"]))},useProps:function(e,t){var n=t.onKeyDown,r=t.onKeyUp,o=h(t,["onKeyDown","onKeyUp"]),i=(0,b.useState)(!1),a=i[0],s=i[1],l=G(n),c=G(r),u=(0,b.useCallback)((function(t){var n;if(null===(n=l.current)||void 0===n||n.call(l,t),!t.defaultPrevented&&!e.disabled&&!t.metaKey&&Y(t)){var r=e.unstable_clickOnEnter&&"Enter"===t.key,o=e.unstable_clickOnSpace&&" "===t.key;if(r||o){if(function(e){var t=e.currentTarget;return!!e.isTrusted&&(Q(t)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||"A"===t.tagName||"SELECT"===t.tagName)}(t))return;t.preventDefault(),r?t.currentTarget.click():o&&s(!0)}}}),[e.disabled,e.unstable_clickOnEnter,e.unstable_clickOnSpace]),d=(0,b.useCallback)((function(t){var n;if(null===(n=c.current)||void 0===n||n.call(c,t),!t.defaultPrevented&&!e.disabled&&!t.metaKey){var r=e.unstable_clickOnSpace&&" "===t.key;a&&r&&(s(!1),t.currentTarget.click())}}),[e.disabled,e.unstable_clickOnSpace,a]);return m({"data-active":a||void 0,onKeyDown:u,onKeyUp:d},o)}});z({as:"button",memo:!0,useHook:ce});function ue(e,t){return t?e.find((function(e){return!e.disabled&&e.id!==t})):e.find((function(e){return!e.disabled}))}function de(e,t){var n;return t||null===t?t:e.currentId||null===e.currentId?e.currentId:null===(n=ue(e.items||[]))||void 0===n?void 0:n.id}var fe=["baseId","unstable_idCountRef","setBaseId","unstable_virtual","rtl","orientation","items","groups","currentId","loop","wrap","shift","unstable_moves","unstable_hasActiveWidget","unstable_includesBaseElement","registerItem","unregisterItem","registerGroup","unregisterGroup","move","next","previous","up","down","first","last","sort","unstable_setVirtual","setRTL","setOrientation","setCurrentId","setLoop","setWrap","setShift","reset","unstable_setIncludesBaseElement","unstable_setHasActiveWidget"],pe=fe,me=pe;function he(e){e.userFocus=!0,e.focus(),e.userFocus=!1}function ge(e,t){e.userFocus=t}function ve(e){try{var t=e instanceof HTMLInputElement&&null!==e.selectionStart,n="TEXTAREA"===e.tagName,r="true"===e.contentEditable;return t||n||r||!1}catch(e){return!1}}function be(e){var t=q(e);if(!t)return!1;if(t===e)return!0;var n=t.getAttribute("aria-activedescendant");return!!n&&n===e.id}function ye(e){return void 0===e&&(e="id"),(e?e+"-":"")+Math.random().toString(32).substr(2,6)}var we=(0,b.createContext)(ye);var xe=F({keys:[].concat(["baseId","unstable_idCountRef","setBaseId"],["id"]),useOptions:function(e,t){var n=(0,b.useContext)(we),r=(0,b.useState)((function(){return e.unstable_idCountRef?(e.unstable_idCountRef.current+=1,"-"+e.unstable_idCountRef.current):e.baseId?"-"+n(""):""}))[0],o=(0,b.useMemo)((function(){return e.baseId||n()}),[e.baseId,n]),i=t.id||e.id||""+o+r;return m(m({},e),{},{id:i})},useProps:function(e,t){return m({id:e.id},t)}});z({as:"div",useHook:xe});function _e(e,t,n){if("function"==typeof Event)return new Event(t,n);var r=j(e).createEvent("Event");return r.initEvent(t,null==n?void 0:n.bubbles,null==n?void 0:n.cancelable),r}function Ee(e,t){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){var n,r=Object.getPrototypeOf(e),o=null===(n=Object.getOwnPropertyDescriptor(r,"value"))||void 0===n?void 0:n.set;o&&(o.call(e,t),function(e,t,n){e.dispatchEvent(_e(e,t,n))}(e,"input",{bubbles:!0}))}}function Ce(e){return e.querySelector("[data-composite-item-widget]")}var ke=F({name:"CompositeItem",compose:[ce,xe],keys:me,propsAreEqual:function(e,t){if(!t.id||e.id!==t.id)return ce.unstable_propsAreEqual(e,t);var n=e.currentId,r=e.unstable_moves,o=h(e,["currentId","unstable_moves"]),i=t.currentId,a=t.unstable_moves,s=h(t,["currentId","unstable_moves"]);if(i!==n){if(t.id===i||t.id===n)return!1}else if(r!==a)return!1;return ce.unstable_propsAreEqual(o,s)},useOptions:function(e){return m(m({},e),{},{id:e.id,currentId:de(e),unstable_clickOnSpace:!e.unstable_hasActiveWidget&&e.unstable_clickOnSpace})},useProps:function(e,t){var n,r=t.ref,o=t.tabIndex,i=void 0===o?0:o,a=t.onMouseDown,s=t.onFocus,l=t.onBlurCapture,c=t.onKeyDown,u=t.onClick,d=h(t,["ref","tabIndex","onMouseDown","onFocus","onBlurCapture","onKeyDown","onClick"]),f=(0,b.useRef)(null),p=e.id,g=e.disabled&&!e.focusable,y=e.currentId===p,w=G(y),x=(0,b.useRef)(!1),_=function(e){return(0,b.useMemo)((function(){var t;return null===(t=e.items)||void 0===t?void 0:t.find((function(t){return e.id&&t.id===e.id}))}),[e.items,e.id])}(e),E=G(a),C=G(s),k=G(l),S=G(c),T=G(u),N=!e.unstable_virtual&&!e.unstable_hasActiveWidget&&y||!(null!==(n=e.items)&&void 0!==n&&n.length);(0,b.useEffect)((function(){var t;if(p)return null===(t=e.registerItem)||void 0===t||t.call(e,{id:p,ref:f,disabled:!!g}),function(){var t;null===(t=e.unregisterItem)||void 0===t||t.call(e,p)}}),[p,g,e.registerItem,e.unregisterItem]),(0,b.useEffect)((function(){var t=f.current;t&&e.unstable_moves&&w.current&&he(t)}),[e.unstable_moves]);var R=(0,b.useCallback)((function(e){var t;null===(t=E.current)||void 0===t||t.call(E,e),ge(e.currentTarget,!0)}),[]),I=(0,b.useCallback)((function(t){var n,r,o=!!t.currentTarget.userFocus;if(ge(t.currentTarget,!1),null===(n=C.current)||void 0===n||n.call(C,t),!t.defaultPrevented&&!Z(t)&&p&&!function(e,t){if(Y(e))return!1;for(var n,r=v(t);!(n=r()).done;)if(n.value.ref.current===e.target)return!0;return!1}(t,e.items)&&(null===(r=e.setCurrentId)||void 0===r||r.call(e,p),o&&e.unstable_virtual&&e.baseId&&Y(t))){var i=j(t.target).getElementById(e.baseId);i&&(x.current=!0,function(e,t){var n=void 0===t?{}:t,r=n.preventScroll,o=n.isActive,i=void 0===o?be:o;i(e)||(e.focus({preventScroll:r}),i(e)||requestAnimationFrame((function(){e.focus({preventScroll:r})})))}(i))}}),[p,e.items,e.setCurrentId,e.unstable_virtual,e.baseId]),M=(0,b.useCallback)((function(t){var n;null===(n=k.current)||void 0===n||n.call(k,t),t.defaultPrevented||e.unstable_virtual&&x.current&&(x.current=!1,t.preventDefault(),t.stopPropagation())}),[e.unstable_virtual]),P=(0,b.useCallback)((function(t){var n;if(Y(t)){var r="horizontal"!==e.orientation,o="vertical"!==e.orientation,i=!(null==_||!_.groupId),a={ArrowUp:(i||r)&&e.up,ArrowRight:(i||o)&&e.next,ArrowDown:(i||r)&&e.down,ArrowLeft:(i||o)&&e.previous,Home:function(){var n,r;!i||t.ctrlKey?null===(n=e.first)||void 0===n||n.call(e):null===(r=e.previous)||void 0===r||r.call(e,!0)},End:function(){var n,r;!i||t.ctrlKey?null===(n=e.last)||void 0===n||n.call(e):null===(r=e.next)||void 0===r||r.call(e,!0)},PageUp:function(){var t,n;i?null===(t=e.up)||void 0===t||t.call(e,!0):null===(n=e.first)||void 0===n||n.call(e)},PageDown:function(){var t,n;i?null===(t=e.down)||void 0===t||t.call(e,!0):null===(n=e.last)||void 0===n||n.call(e)}}[t.key];if(a)return t.preventDefault(),void a();if(null===(n=S.current)||void 0===n||n.call(S,t),!t.defaultPrevented)if(1===t.key.length&&" "!==t.key){var s=Ce(t.currentTarget);s&&ve(s)&&(s.focus(),Ee(s,""))}else if("Delete"===t.key||"Backspace"===t.key){var l=Ce(t.currentTarget);l&&ve(l)&&(t.preventDefault(),Ee(l,""))}}}),[e.orientation,_,e.up,e.next,e.down,e.previous,e.first,e.last]),O=(0,b.useCallback)((function(e){var t;if(null===(t=T.current)||void 0===t||t.call(T,e),!e.defaultPrevented){var n=Ce(e.currentTarget);n&&!X(n)&&n.focus()}}),[]);return m({ref:H(f,r),id:p,tabIndex:N?i:-1,"aria-selected":!(!e.unstable_virtual||!y)||void 0,onMouseDown:R,onFocus:I,onBlurCapture:M,onKeyDown:P,onClick:O},d)}}),Se=z({as:"button",memo:!0,useHook:ke});function Te(e){return e.split("-")[1]}function Ne(e){return"y"===e?"height":"width"}function Re(e){return e.split("-")[0]}function Ie(e){return["top","bottom"].includes(Re(e))?"x":"y"}function Me(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,a=r.y+r.height/2-o.height/2,s=Ie(t),l=Ne(s),c=r[l]/2-o[l]/2,u="x"===s;let d;switch(Re(t)){case"top":d={x:i,y:r.y-o.height};break;case"bottom":d={x:i,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-o.width,y:a};break;default:d={x:r.x,y:r.y}}switch(Te(t)){case"start":d[s]-=c*(n&&u?-1:1);break;case"end":d[s]+=c*(n&&u?-1:1)}return d}const Pe=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Me(c,r,l),f=r,p={},m=0;for(let n=0;n({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e||{},{x:o,y:i,placement:a,rects:s,platform:l,elements:c}=t;if(null==n)return{};const u=Oe(r),d={x:o,y:i},f=Ie(a),p=Ne(f),m=await l.getDimensions(n),h="y"===f,g=h?"top":"left",v=h?"bottom":"right",b=h?"clientHeight":"clientWidth",y=s.reference[p]+s.reference[f]-d[f]-s.floating[p],w=d[f]-s.reference[f],x=await(null==l.getOffsetParent?void 0:l.getOffsetParent(n));let _=x?x[b]:0;_&&await(null==l.isElement?void 0:l.isElement(x))||(_=c.floating[b]||s.floating[p]);const E=y/2-w/2,C=u[g],k=_-m[p]-u[v],S=_/2-m[p]/2+E,T=Be(C,S,k),N=null!=Te(a)&&S!=T&&s.reference[p]/2-(Se.concat(t,t+"-start",t+"-end")),[]),{left:"right",right:"left",bottom:"top",top:"bottom"});function je(e){return e.replace(/left|right|bottom|top/g,(e=>He[e]))}function $e(e,t,n){void 0===n&&(n=!1);const r=Te(e),o=Ie(e),i=Ne(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=je(a)),{main:a,cross:je(a)}}const We={start:"end",end:"start"};function Ue(e){return e.replace(/start|end/g,(e=>We[e]))}const Ge=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...h}=e,g=Re(r),v=Re(a)===a,b=await(null==s.isRTL?void 0:s.isRTL(l.floating)),y=d||(v||!m?[je(a)]:function(e){const t=je(e);return[Ue(e),t,Ue(t)]}(a));d||"none"===p||y.push(...function(e,t,n,r){const o=Te(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}(Re(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(Ue)))),i}(a,m,p,b));const w=[a,...y],x=await Ae(t,h),_=[];let E=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&_.push(x[g]),u){const{main:e,cross:t}=$e(r,i,b);_.push(x[e],x[t])}if(E=[...E,{placement:r,overflows:_}],!_.every((e=>e<=0))){var C,k;const e=((null==(C=o.flip)?void 0:C.index)||0)+1,t=w[e];if(t)return{data:{index:e,overflows:E},reset:{placement:t}};let n=null==(k=E.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:k.placement;if(!n)switch(f){case"bestFit":{var S;const e=null==(S=E.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:S[0];e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const Ye=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=Re(n),s=Te(n),l="x"===Ie(n),c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d="function"==typeof t?t(e):t;let{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof m&&(p="end"===s?-1*m:m),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function qe(e){return"x"===e?"y":"x"}const Ke=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=e,c={x:n,y:r},u=await Ae(t,l),d=Ie(Re(o)),f=qe(d);let p=c[d],m=c[f];if(i){const e="y"===d?"bottom":"right";p=Be(p+u["y"===d?"top":"left"],p,p-u[e])}if(a){const e="y"===f?"bottom":"right";m=Be(m+u["y"===f?"top":"left"],m,m-u[e])}const h=s.fn({...t,[d]:p,[f]:m});return{...h,data:{x:h.x-n,y:h.y-r}}}}},Xe=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:a=(()=>{}),...s}=e,l=await Ae(t,s),c=Re(n),u=Te(n),d="x"===Ie(n),{width:f,height:p}=r.floating;let m,h;"top"===c||"bottom"===c?(m=c,h=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(h=c,m="end"===u?"top":"bottom");const g=p-l[m],v=f-l[h];let b=g,y=v;if(d?y=Le(f-l.right-l.left,v):b=Le(p-l.bottom-l.top,g),!t.middlewareData.shift&&!u){const e=ze(l.left,0),t=ze(l.right,0),n=ze(l.top,0),r=ze(l.bottom,0);d?y=f-2*(0!==e||0!==t?e+t:ze(l.left,l.right)):b=p-2*(0!==n||0!==r?n+r:ze(l.top,l.bottom))}await a({...t,availableWidth:y,availableHeight:b});const w=await o.getDimensions(i.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Ze(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Je(e){return Ze(e).getComputedStyle(e)}const Qe=Math.min,et=Math.max,tt=Math.round;function nt(e){const t=Je(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,i=e.offsetHeight,a=tt(n)!==o||tt(r)!==i;return a&&(n=o,r=i),{width:n,height:r,fallback:a}}function rt(e){return lt(e)?(e.nodeName||"").toLowerCase():""}let ot;function it(){if(ot)return ot;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(ot=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),ot):navigator.userAgent}function at(e){return e instanceof Ze(e).HTMLElement}function st(e){return e instanceof Ze(e).Element}function lt(e){return e instanceof Ze(e).Node}function ct(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Ze(e).ShadowRoot||e instanceof ShadowRoot)}function ut(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Je(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function dt(e){return["table","td","th"].includes(rt(e))}function ft(e){const t=/firefox/i.test(it()),n=Je(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function pt(){return/^((?!chrome|android).)*safari/i.test(it())}function mt(e){return["html","body","#document"].includes(rt(e))}function ht(e){return st(e)?e:e.contextElement}const gt={x:1,y:1};function vt(e){const t=ht(e);if(!at(t))return gt;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=nt(t);let a=(i?tt(n.width):n.width)/r,s=(i?tt(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}function bt(e,t,n,r){var o,i;void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect(),s=ht(e);let l=gt;t&&(r?st(r)&&(l=vt(r)):l=vt(e));const c=s?Ze(s):window,u=pt()&&n;let d=(a.left+(u&&(null==(o=c.visualViewport)?void 0:o.offsetLeft)||0))/l.x,f=(a.top+(u&&(null==(i=c.visualViewport)?void 0:i.offsetTop)||0))/l.y,p=a.width/l.x,m=a.height/l.y;if(s){const e=Ze(s),t=r&&st(r)?Ze(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=vt(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,d*=e.x,f*=e.y,p*=e.x,m*=e.y,d+=t.x,f+=t.y,n=Ze(n).frameElement}}return De({width:p,height:m,x:d,y:f})}function yt(e){return((lt(e)?e.ownerDocument:e.document)||window.document).documentElement}function wt(e){return st(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function xt(e){return bt(yt(e)).left+wt(e).scrollLeft}function _t(e){if("html"===rt(e))return e;const t=e.assignedSlot||e.parentNode||ct(e)&&e.host||yt(e);return ct(t)?t.host:t}function Et(e){const t=_t(e);return mt(t)?t.ownerDocument.body:at(t)&&ut(t)?t:Et(t)}function Ct(e,t){var n;void 0===t&&(t=[]);const r=Et(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=Ze(r);return o?t.concat(i,i.visualViewport||[],ut(r)?r:[]):t.concat(r,Ct(r))}function kt(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Ze(e),r=yt(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=pt();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=yt(e),n=wt(e),r=e.ownerDocument.body,o=et(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=et(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+xt(e);const s=-n.scrollTop;return"rtl"===Je(r).direction&&(a+=et(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(yt(e));else if(st(t))r=function(e,t){const n=bt(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=at(e)?vt(e):{x:1,y:1};return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n={...t};if(pt()){var o,i;const t=Ze(e);n.x-=(null==(o=t.visualViewport)?void 0:o.offsetLeft)||0,n.y-=(null==(i=t.visualViewport)?void 0:i.offsetTop)||0}r=n}return De(r)}function St(e,t){return at(e)&&"fixed"!==Je(e).position?t?t(e):e.offsetParent:null}function Tt(e,t){const n=Ze(e);if(!at(e))return n;let r=St(e,t);for(;r&&dt(r)&&"static"===Je(r).position;)r=St(r,t);return r&&("html"===rt(r)||"body"===rt(r)&&"static"===Je(r).position&&!ft(r))?n:r||function(e){let t=_t(e);for(;at(t)&&!mt(t);){if(ft(t))return t;t=_t(t)}return null}(e)||n}function Nt(e,t,n){const r=at(t),o=yt(t),i=bt(e,!0,"fixed"===n,t);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==rt(t)||ut(o))&&(a=wt(t)),at(t)){const e=bt(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=xt(o));return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}const Rt={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=Ct(e).filter((e=>st(e)&&"body"!==rt(e))),o=null;const i="fixed"===Je(e).position;let a=i?_t(e):e;for(;st(a)&&!mt(a);){const e=Je(a),t=ft(a);"fixed"===e.position?o=null:(i?t||o:t||"static"!==e.position||!o||!["absolute","fixed"].includes(o.position))?o=e:r=r.filter((e=>e!==a)),a=_t(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],s=a[0],l=a.reduce(((e,n)=>{const r=kt(t,n,o);return e.top=et(r.top,e.top),e.right=Qe(r.right,e.right),e.bottom=Qe(r.bottom,e.bottom),e.left=et(r.left,e.left),e}),kt(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=at(n),i=yt(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0},s={x:1,y:1};const l={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==rt(n)||ut(i))&&(a=wt(n)),at(n))){const e=bt(n);s=vt(n),l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}},isElement:st,getDimensions:function(e){return at(e)?nt(e):e.getBoundingClientRect()},getOffsetParent:Tt,getDocumentElement:yt,getScale:vt,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||Tt,i=this.getDimensions;return{reference:Nt(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===Je(e).direction};var It=window.ReactDOM,Mt="undefined"!=typeof document?b.useLayoutEffect:b.useEffect;function Pt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)if(!Pt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Pt(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Ot(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:o}=void 0===e?{}:e;const[i,a]=b.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[s,l]=b.useState(t);Pt(null==s?void 0:s.map((e=>{let{name:t,options:n}=e;return{name:t,options:n}})),null==t?void 0:t.map((e=>{let{name:t,options:n}=e;return{name:t,options:n}})))||l(t);const c=b.useRef(null),u=b.useRef(null),d=b.useRef(null),f=b.useRef(i),p=function(e){const t=b.useRef(e);return Mt((()=>{t.current=e})),t}(o),m=b.useCallback((()=>{c.current&&u.current&&((e,t,n)=>{const r=new Map,o={platform:Rt,...n},i={...o.platform,_c:r};return Pe(e,t,{...o,platform:i})})(c.current,u.current,{middleware:s,placement:n,strategy:r}).then((e=>{h.current&&!Pt(f.current,e)&&(f.current=e,It.flushSync((()=>{a(e)})))}))}),[s,n,r]);Mt((()=>{h.current&&m()}),[m]);const h=b.useRef(!1);Mt((()=>(h.current=!0,()=>{h.current=!1})),[]);const g=b.useCallback((()=>{if("function"==typeof d.current&&(d.current(),d.current=null),c.current&&u.current)if(p.current){const e=p.current(c.current,u.current,m);d.current=e}else m()}),[m,p]),v=b.useCallback((e=>{c.current=e,g()}),[g]),y=b.useCallback((e=>{u.current=e,g()}),[g]),w=b.useMemo((()=>({reference:c,floating:u})),[]);return b.useMemo((()=>({...i,update:m,refs:w,reference:v,floating:y})),[i,m,w,v,y])}const Dt=e=>{const{element:t,padding:n}=e;return{name:"arrow",options:e,fn(e){return r=t,Object.prototype.hasOwnProperty.call(r,"current")?null!=t.current?Fe({element:t.current,padding:n}).fn(e):{}:t?Fe({element:t,padding:n}).fn(e):{};var r}}},At="undefined"!=typeof document,Lt={current:null},zt={current:!1};function Bt(){if(zt.current=!0,At)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Lt.current=e.matches;e.addListener(t),t()}else Lt.current=!1}const Ft=(0,b.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Vt=(0,b.createContext)({});const Ht=(0,b.createContext)(null),jt=At?b.useLayoutEffect:b.useEffect,$t=(0,b.createContext)({strict:!1});function Wt(e,t,n,r){const o=(0,b.useContext)(Vt).visualElement,i=(0,b.useContext)($t),a=(0,b.useContext)(Ht),s=(0,b.useContext)(Ft).reducedMotion,l=(0,b.useRef)();r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:o,props:n,presenceId:a?a.id:void 0,blockInitialAnimation:!!a&&!1===a.initial,reducedMotionConfig:s}));const c=l.current;return jt((()=>{c&&c.render()})),jt((()=>{c&&c.animationState&&c.animationState.animateChanges()})),jt((()=>()=>c&&c.notify("Unmount")),[]),c}function Ut(e){return"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function Gt(e){return"string"==typeof e||Array.isArray(e)}function Yt(e){return"object"==typeof e&&"function"==typeof e.start}const qt=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function Kt(e){return Yt(e.animate)||qt.some((t=>Gt(e[t])))}function Xt(e){return Boolean(Kt(e)||e.variants)}function Zt(e){const{initial:t,animate:n}=function(e,t){if(Kt(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Gt(t)?t:void 0,animate:Gt(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,b.useContext)(Vt));return(0,b.useMemo)((()=>({initial:t,animate:n})),[Jt(t),Jt(n)])}function Jt(e){return Array.isArray(e)?e.join(" "):e}const Qt=e=>({isEnabled:t=>e.some((e=>!!t[e]))}),en={measureLayout:Qt(["layout","layoutId","drag"]),animation:Qt(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:Qt(["exit"]),drag:Qt(["drag","dragControls"]),focus:Qt(["whileFocus"]),hover:Qt(["whileHover","onHoverStart","onHoverEnd"]),tap:Qt(["whileTap","onTap","onTapStart","onTapCancel"]),pan:Qt(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:Qt(["whileInView","onViewportEnter","onViewportLeave"])};function tn(e){const t=(0,b.useRef)(null);return null===t.current&&(t.current=e()),t.current}const nn={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let rn=1;const on=(0,b.createContext)({});class an extends b.Component{getSnapshotBeforeUpdate(){const{visualElement:e,props:t}=this.props;return e&&e.setProps(t),null}componentDidUpdate(){}render(){return this.props.children}}const sn=(0,b.createContext)({}),ln=Symbol.for("motionComponentSymbol");function cn({preloadedFeatures:e,createVisualElement:t,projectionNodeConstructor:n,useRender:r,useVisualState:o,Component:i}){e&&function(e){for(const t in e)"projectionNodeConstructor"===t?en.projectionNodeConstructor=e[t]:en[t].Component=e[t]}(e);const a=(0,b.forwardRef)((function(a,s){const l={...(0,b.useContext)(Ft),...a,layoutId:un(a)},{isStatic:c}=l;let u=null;const d=Zt(a),f=c?void 0:tn((()=>{if(nn.hasEverUpdated)return rn++})),p=o(a,c);if(!c&&At){d.visualElement=Wt(i,p,l,t);const r=(0,b.useContext)($t).strict,o=(0,b.useContext)(sn);d.visualElement&&(u=d.visualElement.loadFeatures(l,r,e,f,n||en.projectionNodeConstructor,o))}return b.createElement(an,{visualElement:d.visualElement,props:l},u,b.createElement(Vt.Provider,{value:d},r(i,a,f,function(e,t,n){return(0,b.useCallback)((r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):Ut(n)&&(n.current=r))}),[t])}(p,d.visualElement,s),p,c,d.visualElement)))}));return a[ln]=i,a}function un({layoutId:e}){const t=(0,b.useContext)(on).id;return t&&void 0!==e?t+"-"+e:e}function dn(e){function t(t,n={}){return cn(e(t,n))}if("undefined"==typeof Proxy)return t;const n=new Map;return new Proxy(t,{get:(e,r)=>(n.has(r)||n.set(r,t(r)),n.get(r))})}const fn=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function pn(e){return"string"==typeof e&&!e.includes("-")&&!!(fn.indexOf(e)>-1||/[A-Z]/.test(e))}const mn={};const hn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],gn=new Set(hn);function vn(e,{layout:t,layoutId:n}){return gn.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!mn[e]||"opacity"===e)}const bn=e=>!!(null==e?void 0:e.getVelocity),yn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},wn=(e,t)=>hn.indexOf(e)-hn.indexOf(t);function xn(e){return e.startsWith("--")}const _n=(e,t)=>t&&"number"==typeof e?t.transform(e):e,En=(e,t,n)=>Math.min(Math.max(n,e),t),Cn={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},kn={...Cn,transform:e=>En(0,1,e)},Sn={...Cn,default:1},Tn=e=>Math.round(1e5*e)/1e5,Nn=/(-)?([\d]*\.?[\d])+/g,Rn=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,In=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Mn(e){return"string"==typeof e}const Pn=e=>({test:t=>Mn(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),On=Pn("deg"),Dn=Pn("%"),An=Pn("px"),Ln=Pn("vh"),zn=Pn("vw"),Bn={...Dn,parse:e=>Dn.parse(e)/100,transform:e=>Dn.transform(100*e)},Fn={...Cn,transform:Math.round},Vn={borderWidth:An,borderTopWidth:An,borderRightWidth:An,borderBottomWidth:An,borderLeftWidth:An,borderRadius:An,radius:An,borderTopLeftRadius:An,borderTopRightRadius:An,borderBottomRightRadius:An,borderBottomLeftRadius:An,width:An,maxWidth:An,height:An,maxHeight:An,size:An,top:An,right:An,bottom:An,left:An,padding:An,paddingTop:An,paddingRight:An,paddingBottom:An,paddingLeft:An,margin:An,marginTop:An,marginRight:An,marginBottom:An,marginLeft:An,rotate:On,rotateX:On,rotateY:On,rotateZ:On,scale:Sn,scaleX:Sn,scaleY:Sn,scaleZ:Sn,skew:On,skewX:On,skewY:On,distance:An,translateX:An,translateY:An,translateZ:An,x:An,y:An,z:An,perspective:An,transformPerspective:An,opacity:kn,originX:Bn,originY:Bn,originZ:An,zIndex:Fn,fillOpacity:kn,strokeOpacity:kn,numOctaves:Fn};function Hn(e,t,n,r){const{style:o,vars:i,transform:a,transformKeys:s,transformOrigin:l}=e;s.length=0;let c=!1,u=!1,d=!0;for(const e in t){const n=t[e];if(xn(e)){i[e]=n;continue}const r=Vn[e],f=_n(n,r);if(gn.has(e)){if(c=!0,a[e]=f,s.push(e),!d)continue;n!==(r.default||0)&&(d=!1)}else e.startsWith("origin")?(u=!0,l[e]=f):o[e]=f}if(t.transform||(c||r?o.transform=function({transform:e,transformKeys:t},{enableHardwareAcceleration:n=!0,allowTransformNone:r=!0},o,i){let a="";t.sort(wn);for(const n of t)a+=`${yn[n]||n}(${e[n]}) `;return n&&!e.z&&(a+="translateZ(0)"),a=a.trim(),i?a=i(e,o?"":a):r&&o&&(a="none"),a}(e,n,d,r):o.transform&&(o.transform="none")),u){const{originX:e="50%",originY:t="50%",originZ:n=0}=l;o.transformOrigin=`${e} ${t} ${n}`}}const jn=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function $n(e,t,n){for(const r in t)bn(t[r])||vn(r,n)||(e[r]=t[r])}function Wn(e,t,n){const r={};return $n(r,e.style||{},e),Object.assign(r,function({transformTemplate:e},t,n){return(0,b.useMemo)((()=>{const r={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return Hn(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)}),[t])}(e,t,n)),e.transformValues?e.transformValues(r):r}function Un(e,t,n){const r={},o=Wn(e,t,n);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),r.style=o,r}const Gn=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function Yn(e){return Gn.has(e)}let qn=e=>!Yn(e);try{(Kn=require("@emotion/is-prop-valid").default)&&(qn=e=>e.startsWith("on")?!Yn(e):Kn(e))}catch(e){}var Kn;function Xn(e,t,n){return"string"==typeof e?e:An.transform(t+n*e)}const Zn={offset:"stroke-dashoffset",array:"stroke-dasharray"},Jn={offset:"strokeDashoffset",array:"strokeDasharray"};function Qn(e,{attrX:t,attrY:n,originX:r,originY:o,pathLength:i,pathSpacing:a=1,pathOffset:s=0,...l},c,u,d){if(Hn(e,l,c,d),u)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(void 0!==r||void 0!==o||p.transform)&&(p.transformOrigin=function(e,t,n){return`${Xn(t,e.x,e.width)} ${Xn(n,e.y,e.height)}`}(m,void 0!==r?r:.5,void 0!==o?o:.5)),void 0!==t&&(f.x=t),void 0!==n&&(f.y=n),void 0!==i&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?Zn:Jn;e[i.offset]=An.transform(-r);const a=An.transform(t),s=An.transform(n);e[i.array]=`${a} ${s}`}(f,i,a,s,!1)}const er=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}}),tr=e=>"string"==typeof e&&"svg"===e.toLowerCase();function nr(e,t,n,r){const o=(0,b.useMemo)((()=>{const n={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return Qn(n,t,{enableHardwareAcceleration:!1},tr(r),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};$n(t,e.style,e),o.style={...t,...o.style}}return o}function rr(e=!1){return(t,n,r,o,{latestValues:i},a)=>{const s=(pn(t)?nr:Un)(n,i,a,t),l=function(e,t,n){const r={};for(const o in e)(qn(o)||!0===n&&Yn(o)||!t&&!Yn(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),c={...l,...s,ref:o};return r&&(c["data-projection-id"]=r),(0,b.createElement)(t,c)}}const or=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function ir(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const t in n)e.style.setProperty(t,n[t])}const ar=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function sr(e,t,n,r){ir(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(ar.has(n)?n:or(n),t.attrs[n])}function lr(e){const{style:t}=e,n={};for(const r in t)(bn(t[r])||vn(r,e))&&(n[r]=t[r]);return n}function cr(e){const t=lr(e);for(const n in e)if(bn(e[n])){t["x"===n||"y"===n?"attr"+n.toUpperCase():n]=e[n]}return t}function ur(e,t,n,r={},o={}){return"function"==typeof t&&(t=t(void 0!==n?n:e.custom,r,o)),"string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t&&(t=t(void 0!==n?n:e.custom,r,o)),t}const dr=e=>Array.isArray(e),fr=e=>dr(e)?e[e.length-1]||0:e;function pr(e){const t=bn(e)?e.get():e;return(e=>Boolean(e&&"object"==typeof e&&e.mix&&e.toValue))(t)?t.toValue():t}const mr=e=>(t,n)=>{const r=(0,b.useContext)(Vt),o=(0,b.useContext)(Ht),i=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,o,i){const a={latestValues:hr(r,o,i,e),renderState:t()};return n&&(a.mount=e=>n(r,e,a)),a}(e,t,r,o);return n?i():tn(i)};function hr(e,t,n,r){const o={},i=r(e);for(const e in i)o[e]=pr(i[e]);let{initial:a,animate:s}=e;const l=Kt(e),c=Xt(e);t&&c&&!l&&!1!==e.inherit&&(void 0===a&&(a=t.initial),void 0===s&&(s=t.animate));let u=!!n&&!1===n.initial;u=u||!1===a;const d=u?s:a;if(d&&"boolean"!=typeof d&&!Yt(d)){(Array.isArray(d)?d:[d]).forEach((t=>{const n=ur(e,t);if(!n)return;const{transitionEnd:r,transition:i,...a}=n;for(const e in a){let t=a[e];if(Array.isArray(t)){t=t[u?t.length-1:0]}null!==t&&(o[e]=t)}for(const e in r)o[e]=r[e]}))}return o}const gr={useVisualState:mr({scrapeMotionValuesFromProps:cr,createRenderState:er,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){n.dimensions={x:0,y:0,width:0,height:0}}Qn(n,r,{enableHardwareAcceleration:!1},tr(t.tagName),e.transformTemplate),sr(t,n)}})},vr={useVisualState:mr({scrapeMotionValuesFromProps:lr,createRenderState:jn})};var br;function yr(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function wr(e,t,n,r){(0,b.useEffect)((()=>{const o=e.current;if(n&&o)return yr(o,t,n,r)}),[e,t,n,r])}function xr(e){return"undefined"!=typeof PointerEvent&&e instanceof PointerEvent?!("mouse"!==e.pointerType):e instanceof MouseEvent}function _r(e){return!!e.touches}!function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"}(br||(br={}));const Er={pageX:0,pageY:0};function Cr(e,t="page"){const n=e.touches[0]||e.changedTouches[0]||Er;return{x:n[t+"X"],y:n[t+"Y"]}}function kr(e,t="page"){return{x:e[t+"X"],y:e[t+"Y"]}}function Sr(e,t="page"){return{point:_r(e)?Cr(e,t):kr(e,t)}}const Tr=(e,t=!1)=>{const n=t=>e(t,Sr(t));return t?(r=n,e=>{const t=e instanceof MouseEvent;(!t||t&&0===e.button)&&r(e)}):n;var r},Nr={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Rr={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Ir(e){return At&&null===window.onpointerdown?e:At&&null===window.ontouchstart?Rr[e]:At&&null===window.onmousedown?Nr[e]:e}function Mr(e,t,n,r){return yr(e,Ir(t),Tr(n,"pointerdown"===t),r)}function Pr(e,t,n,r){return wr(e,Ir(t),n&&Tr(n,"pointerdown"===t),r)}function Or(e){let t=null;return()=>{const n=()=>{t=null};return null===t&&(t=e,n)}}const Dr=Or("dragHorizontal"),Ar=Or("dragVertical");function Lr(e){let t=!1;if("y"===e)t=Ar();else if("x"===e)t=Dr();else{const e=Dr(),n=Ar();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function zr(){const e=Lr(!0);return!e||(e(),!1)}function Br(e,t,n){return(r,o)=>{xr(r)&&!zr()&&(e.animationState&&e.animationState.setActive(br.Hover,t),n&&n(r,o))}}const Fr=(e,t)=>!!t&&(e===t||Fr(e,t.parentElement));function Vr(e){return(0,b.useEffect)((()=>()=>e()),[])}const Hr=(e,t)=>n=>t(e(n)),jr=(...e)=>e.reduce(Hr);const $r=("undefined"==typeof process||process.env,"production"),Wr=new Set;function Ur(e,t,n){e||Wr.has(t)||(console.warn(t),n&&console.warn(n),Wr.add(t))}const Gr=new WeakMap,Yr=new WeakMap,qr=e=>{const t=Gr.get(e.target);t&&t(e)},Kr=e=>{e.forEach(qr)};function Xr(e,t,n){const r=function({root:e,...t}){const n=e||document;Yr.has(n)||Yr.set(n,{});const r=Yr.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Kr,{root:e,...t})),r[o]}(t);return Gr.set(e,n),r.observe(e),()=>{Gr.delete(e),r.unobserve(e)}}const Zr={some:0,all:1};function Jr(e,t,n,{root:r,margin:o,amount:i="some",once:a}){(0,b.useEffect)((()=>{if(!e||!n.current)return;const s={root:null==r?void 0:r.current,rootMargin:o,threshold:"number"==typeof i?i:Zr[i]};return Xr(n.current,s,(e=>{const{isIntersecting:r}=e;if(t.isInView===r)return;if(t.isInView=r,a&&!r&&t.hasEnteredView)return;r&&(t.hasEnteredView=!0),n.animationState&&n.animationState.setActive(br.InView,r);const o=n.getProps(),i=r?o.onViewportEnter:o.onViewportLeave;i&&i(e)}))}),[e,r,o,i])}function Qr(e,t,n,{fallback:r=!0}){(0,b.useEffect)((()=>{e&&r&&("production"!==$r&&Ur(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame((()=>{t.hasEnteredView=!0;const{onViewportEnter:e}=n.getProps();e&&e(null),n.animationState&&n.animationState.setActive(br.InView,!0)})))}),[e])}const eo=e=>t=>(e(t),null),to={inView:eo((function({visualElement:e,whileInView:t,onViewportEnter:n,onViewportLeave:r,viewport:o={}}){const i=(0,b.useRef)({hasEnteredView:!1,isInView:!1});let a=Boolean(t||n||r);o.once&&i.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?Qr:Jr)(a,i.current,e,o)})),tap:eo((function({onTap:e,onTapStart:t,onTapCancel:n,whileTap:r,visualElement:o}){const i=e||t||n||r,a=(0,b.useRef)(!1),s=(0,b.useRef)(null),l={passive:!(t||e||n||p)};function c(){s.current&&s.current(),s.current=null}function u(){return c(),a.current=!1,o.animationState&&o.animationState.setActive(br.Tap,!1),!zr()}function d(t,r){u()&&(Fr(o.current,t.target)?e&&e(t,r):n&&n(t,r))}function f(e,t){u()&&n&&n(e,t)}function p(e,n){c(),a.current||(a.current=!0,s.current=jr(Mr(window,"pointerup",d,l),Mr(window,"pointercancel",f,l)),o.animationState&&o.animationState.setActive(br.Tap,!0),t&&t(e,n))}Pr(o,"pointerdown",i?p:void 0,l),Vr(c)})),focus:eo((function({whileFocus:e,visualElement:t}){const{animationState:n}=t;wr(t,"focus",e?()=>{n&&n.setActive(br.Focus,!0)}:void 0),wr(t,"blur",e?()=>{n&&n.setActive(br.Focus,!1)}:void 0)})),hover:eo((function({onHoverStart:e,onHoverEnd:t,whileHover:n,visualElement:r}){Pr(r,"pointerenter",e||n?Br(r,!0,e):void 0,{passive:!e}),Pr(r,"pointerleave",t||n?Br(r,!1,t):void 0,{passive:!t})}))};function no(){const e=(0,b.useContext)(Ht);if(null===e)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,o=(0,b.useId)();(0,b.useEffect)((()=>r(o)),[]);return!t&&n?[!1,()=>n&&n(o)]:[!0]}function ro(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r/^\-?\d*\.?\d+$/.test(e),io=e=>/^0[^.\s]+$/.test(e),ao={delta:0,timestamp:0},so=1/60*1e3,lo="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),co="undefined"!=typeof window?e=>window.requestAnimationFrame(e):e=>setTimeout((()=>e(lo())),so);let uo=!0,fo=!1,po=!1;const mo=["read","update","preRender","render","postRender"],ho=mo.reduce(((e,t)=>(e[t]=function(e){let t=[],n=[],r=0,o=!1,i=!1;const a=new WeakSet,s={schedule:(e,i=!1,s=!1)=>{const l=s&&o,c=l?t:n;return i&&a.add(e),-1===c.indexOf(e)&&(c.push(e),l&&o&&(r=t.length)),e},cancel:e=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1),a.delete(e)},process:l=>{if(o)i=!0;else{if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let n=0;nfo=!0)),e)),{}),go=mo.reduce(((e,t)=>{const n=ho[t];return e[t]=(e,t=!1,r=!1)=>(fo||xo(),n.schedule(e,t,r)),e}),{}),vo=mo.reduce(((e,t)=>(e[t]=ho[t].cancel,e)),{}),bo=mo.reduce(((e,t)=>(e[t]=()=>ho[t].process(ao),e)),{}),yo=e=>ho[e].process(ao),wo=e=>{fo=!1,ao.delta=uo?so:Math.max(Math.min(e-ao.timestamp,40),1),ao.timestamp=e,po=!0,mo.forEach(yo),po=!1,fo&&(uo=!1,co(wo))},xo=()=>{fo=!0,uo=!0,po||co(wo)};function _o(e,t){-1===e.indexOf(t)&&e.push(t)}function Eo(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Co{constructor(){this.subscriptions=[]}add(e){return _o(this.subscriptions,e),()=>Eo(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o{this.prev=this.current,this.current=e;const{delta:n,timestamp:r}=ao;this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,go.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>go.postRender(this.velocityCheck),this.velocityCheck=({timestamp:e})=>{e!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=t.owner}onChange(e){return this.on("change",e)}on(e,t){return this.events[e]||(this.events[e]=new Co),this.events[e].add(t)}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e){this.passiveEffect=e}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=e,this.timeDelta=n}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ko(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.stopAnimation=e(t),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.stopAnimation&&(this.stopAnimation(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.clearListeners(),this.stop()}}function To(e,t){return new So(e,t)}const No=(e,t)=>n=>Boolean(Mn(n)&&In.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),Ro=(e,t,n)=>r=>{if(!Mn(r))return r;const[o,i,a,s]=r.match(Nn);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(a),alpha:void 0!==s?parseFloat(s):1}},Io={...Cn,transform:e=>Math.round((e=>En(0,255,e))(e))},Mo={test:No("rgb","red"),parse:Ro("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Io.transform(e)+", "+Io.transform(t)+", "+Io.transform(n)+", "+Tn(kn.transform(r))+")"};const Po={test:No("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:Mo.transform},Oo={test:No("hsl","hue"),parse:Ro("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Dn.transform(Tn(t))+", "+Dn.transform(Tn(n))+", "+Tn(kn.transform(r))+")"},Do={test:e=>Mo.test(e)||Po.test(e)||Oo.test(e),parse:e=>Mo.test(e)?Mo.parse(e):Oo.test(e)?Oo.parse(e):Po.parse(e),transform:e=>Mn(e)?e:e.hasOwnProperty("red")?Mo.transform(e):Oo.transform(e)},Ao="${c}",Lo="${n}";function zo(e){"number"==typeof e&&(e=`${e}`);const t=[];let n=0,r=0;const o=e.match(Rn);o&&(n=o.length,e=e.replace(Rn,Ao),t.push(...o.map(Do.parse)));const i=e.match(Nn);return i&&(r=i.length,e=e.replace(Nn,Lo),t.push(...i.map(Cn.parse))),{values:t,numColors:n,numNumbers:r,tokenised:e}}function Bo(e){return zo(e).values}function Fo(e){const{values:t,numColors:n,tokenised:r}=zo(e),o=t.length;return e=>{let t=r;for(let r=0;r"number"==typeof e?0:e;const Ho={test:function(e){var t,n;return isNaN(e)&&Mn(e)&&((null===(t=e.match(Nn))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(Rn))||void 0===n?void 0:n.length)||0)>0},parse:Bo,createTransformer:Fo,getAnimatableNone:function(e){const t=Bo(e);return Fo(e)(t.map(Vo))}},jo=new Set(["brightness","contrast","saturate","opacity"]);function $o(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Nn)||[];if(!r)return e;const o=n.replace(r,"");let i=jo.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const Wo=/([a-z-]*)\(.*?\)/g,Uo={...Ho,getAnimatableNone:e=>{const t=e.match(Wo);return t?t.map($o).join(" "):e}},Go={...Vn,color:Do,backgroundColor:Do,outlineColor:Do,fill:Do,stroke:Do,borderColor:Do,borderTopColor:Do,borderRightColor:Do,borderBottomColor:Do,borderLeftColor:Do,filter:Uo,WebkitFilter:Uo},Yo=e=>Go[e];function qo(e,t){var n;let r=Yo(e);return r!==Uo&&(r=Ho),null===(n=r.getAnimatableNone)||void 0===n?void 0:n.call(r,t)}const Ko=e=>t=>t.test(e),Xo=[Cn,An,Dn,On,zn,Ln,{test:e=>"auto"===e,parse:e=>e}],Zo=e=>Xo.find(Ko(e)),Jo=[...Xo,Do,Ho],Qo=e=>Jo.find(Ko(e));function ei(e,t,n){const r=e.getProps();return ur(r,t,void 0!==n?n:r.custom,function(e){const t={};return e.values.forEach(((e,n)=>t[n]=e.get())),t}(e),function(e){const t={};return e.values.forEach(((e,n)=>t[n]=e.getVelocity())),t}(e))}function ti(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,To(n))}function ni(e,t){const n=ei(e,t);let{transitionEnd:r={},transition:o={},...i}=n?e.makeTargetAnimatable(n,!1):{};i={...i,...r};for(const t in i){ti(e,t,fr(i[t]))}}function ri(e,t){if(!t)return;return(t[e]||t.default||t).from}function oi(e){return Boolean(bn(e)&&e.add)}function ii(e,t){const{MotionAppearAnimations:n}=window,r=((e,t)=>`${e}: ${t}`)(e,gn.has(t)?"transform":t),o=n&&n.get(r);return o?(go.render((()=>{try{o.cancel(),n.delete(r)}catch(e){}})),o.currentTime||0):0}const ai="data-"+or("framerAppearId");const si=e=>1e3*e,li=!1,ci=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ui=e=>t=>1-e(1-t),di=e=>e*e,fi=ui(di),pi=ci(di),mi=(e,t,n)=>-n*e+n*t+e;function hi(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}const gi=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},vi=[Po,Mo,Oo];function bi(e){const t=(e=>vi.find((t=>t.test(e))))(e);Boolean(t);let n=t.parse(e);return t===Oo&&(n=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,i=0,a=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;o=hi(s,r,e+1/3),i=hi(s,r,e),a=hi(s,r,e-1/3)}else o=i=a=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*a),alpha:r}}(n)),n}const yi=(e,t)=>{const n=bi(e),r=bi(t),o={...n};return e=>(o.red=gi(n.red,r.red,e),o.green=gi(n.green,r.green,e),o.blue=gi(n.blue,r.blue,e),o.alpha=mi(n.alpha,r.alpha,e),Mo.transform(o))};function wi(e,t){return"number"==typeof e?n=>mi(e,t,n):Do.test(e)?yi(e,t):Ei(e,t)}const xi=(e,t)=>{const n=[...e],r=n.length,o=e.map(((e,n)=>wi(e,t[n])));return e=>{for(let t=0;t{const n={...e,...t},r={};for(const o in n)void 0!==e[o]&&void 0!==t[o]&&(r[o]=wi(e[o],t[o]));return e=>{for(const t in r)n[t]=r[t](e);return n}},Ei=(e,t)=>{const n=Ho.createTransformer(t),r=zo(e),o=zo(t);return r.numColors===o.numColors&&r.numNumbers>=o.numNumbers?jr(xi(r.values,o.values),n):n=>`${n>0?t:e}`},Ci=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},ki=(e,t)=>n=>mi(e,t,n);function Si(e,t,n){const r=[],o=n||function(e){return"number"==typeof e?ki:"string"==typeof e?Do.test(e)?yi:Ei:Array.isArray(e)?xi:"object"==typeof e?_i:ki}(e[0]),i=e.length-1;for(let n=0;ne[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Si(t,r,o),s=a.length,l=t=>{let n=0;if(s>1)for(;nl(En(e[0],e[i-1],t)):l}const Ni=e=>e,Ri=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Ii(e,t,n,r){if(e===t&&n===r)return Ni;const o=t=>function(e,t,n,r,o){let i,a,s=0;do{a=t+(n-t)/2,i=Ri(a,r,o)-e,i>0?n=a:t=a}while(Math.abs(i)>1e-7&&++s<12);return a}(t,0,1,e,n);return e=>0===e||1===e?e:Ri(o(e),t,r)}const Mi=e=>1-Math.sin(Math.acos(e)),Pi=ui(Mi),Oi=ci(Pi),Di=Ii(.33,1.53,.69,.99),Ai=ui(Di),Li=ci(Ai),zi={linear:Ni,easeIn:di,easeInOut:pi,easeOut:fi,circIn:Mi,circInOut:Oi,circOut:Pi,backIn:Ai,backInOut:Li,backOut:Di,anticipate:e=>(e*=2)<1?.5*Ai(e):.5*(2-Math.pow(2,-10*(e-1)))},Bi=e=>{if(Array.isArray(e)){e.length;const[t,n,r,o]=e;return Ii(t,n,r,o)}return"string"==typeof e?zi[e]:e};function Fi({keyframes:e,ease:t=pi,times:n,duration:r=300}){e=[...e];const o=Fi[0],i=(e=>Array.isArray(e)&&"number"!=typeof e[0])(t)?t.map(Bi):Bi(t),a={done:!1,value:o},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===Fi.length?n:function(e){const t=e.length;return e.map(((e,n)=>0!==n?n/(t-1):0))}(e),r);function l(){return Ti(s,e,{ease:Array.isArray(i)?i:(t=e,n=i,t.map((()=>n||pi)).splice(0,t.length-1))});var t,n}let c=l();return{next:e=>(a.value=c(e),a.done=e>=r,a),flipTarget:()=>{e.reverse(),c=l()}}}const Vi=.001;function Hi({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i,a=1-t;a=En(.05,1,a),e=En(.01,10,e/1e3),a<1?(o=t=>{const r=t*a,o=r*e,i=r-n,s=ji(t,a),l=Math.exp(-o);return Vi-i/s*l},i=t=>{const r=t*a*e,i=r*n+n,s=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=ji(Math.pow(t,2),a);return(-o(t)+Vi>0?-1:1)*((i-s)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const s=function(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}(o,i,5/e);if(e*=1e3,isNaN(s))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(s,2)*r;return{stiffness:t,damping:2*a*Math.sqrt(r*t),duration:e}}}function ji(e,t){return e*Math.sqrt(1-t*t)}const $i=["duration","bounce"],Wi=["stiffness","damping","mass"];function Ui(e,t){return t.some((t=>void 0!==e[t]))}function Gi({keyframes:e,restSpeed:t=2,restDelta:n=.01,...r}){let o=e[0],i=e[e.length-1];const a={done:!1,value:o},{stiffness:s,damping:l,mass:c,velocity:u,duration:d,isResolvedFromDuration:f}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Ui(e,Wi)&&Ui(e,$i)){const n=Hi(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}(r);let p=Yi,m=u?-u/1e3:0;const h=l/(2*Math.sqrt(s*c));function g(){const e=i-o,t=Math.sqrt(s/c)/1e3;if(void 0===n&&(n=Math.min(Math.abs(i-o)/100,.4)),h<1){const n=ji(t,h);p=r=>{const o=Math.exp(-h*t*r);return i-o*((m+h*t*e)/n*Math.sin(n*r)+e*Math.cos(n*r))}}else if(1===h)p=n=>i-Math.exp(-t*n)*(e+(m+t*e)*n);else{const n=t*Math.sqrt(h*h-1);p=r=>{const o=Math.exp(-h*t*r),a=Math.min(n*r,300);return i-o*((m+h*t*e)*Math.sinh(a)+n*e*Math.cosh(a))/n}}}return g(),{next:e=>{const r=p(e);if(f)a.done=e>=d;else{let o=m;if(0!==e)if(h<1){const t=Math.max(0,e-5);o=ko(r-p(t),e-t)}else o=0;const s=Math.abs(o)<=t,l=Math.abs(i-r)<=n;a.done=s&&l}return a.value=a.done?i:r,a},flipTarget:()=>{m=-m,[o,i]=[i,o],g()}}}Gi.needsInterpolation=(e,t)=>"string"==typeof e||"string"==typeof t;const Yi=e=>0;const qi={decay:function({keyframes:e=[0],velocity:t=0,power:n=.8,timeConstant:r=350,restDelta:o=.5,modifyTarget:i}){const a=e[0],s={done:!1,value:a};let l=n*t;const c=a+l,u=void 0===i?c:i(c);return u!==c&&(l=u-a),{next:e=>{const t=-l*Math.exp(-e/r);return s.done=!(t>o||t<-o),s.value=s.done?u:u+t,s},flipTarget:()=>{}}},keyframes:Fi,tween:Fi,spring:Gi};function Ki(e,t,n=0){return e-t-n}const Xi=e=>{const t=({delta:t})=>e(t);return{start:()=>go.update(t,!0),stop:()=>vo.update(t)}};function Zi({duration:e,driver:t=Xi,elapsed:n=0,repeat:r=0,repeatType:o="loop",repeatDelay:i=0,keyframes:a,autoplay:s=!0,onPlay:l,onStop:c,onComplete:u,onRepeat:d,onUpdate:f,type:p="keyframes",...m}){var h,g;let v,b,y,w=0,x=e,_=!1,E=!0;const C=qi[a.length>2?"keyframes":p],k=a[0],S=a[a.length-1];(null===(g=(h=C).needsInterpolation)||void 0===g?void 0:g.call(h,k,S))&&(y=Ti([0,100],[k,S],{clamp:!1}),a=[0,100]);const T=C({...m,duration:e,keyframes:a});function N(){w++,"reverse"===o?(E=w%2==0,n=function(e,t=0,n=0,r=!0){return r?Ki(t+-e,t,n):t-(e-t)+n}(n,x,i,E)):(n=Ki(n,x,i),"mirror"===o&&T.flipTarget()),_=!1,d&&d()}function R(e){if(E||(e=-e),n+=e,!_){const e=T.next(Math.max(0,n));b=e.value,y&&(b=y(b)),_=E?e.done:n<=0}f&&f(b),_&&(0===w&&(x=void 0!==x?x:n),w=t+n:e<=-n}(n,x,i,E)&&N():(v.stop(),u&&u()))}return s&&(l&&l(),v=t(R),v.start()),{stop:()=>{c&&c(),v.stop()},sample:e=>T.next(Math.max(0,e))}}const Ji=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Qi={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ji([0,.65,.55,1]),circOut:Ji([.55,0,1,.45]),backIn:Ji([.31,.01,.66,-.59]),backOut:Ji([.33,1.53,.69,.99])};function ea(e){if(e)return Array.isArray(e)?Ji(e):Qi[e]}function ta(e,t,{onUpdate:n,onComplete:r,...o}){let{keyframes:i,duration:a=.3,elapsed:s=0,ease:l}=o;if("spring"===o.type||!(!(c=o.ease)||Array.isArray(c)||"string"==typeof c&&Qi[c])){const e=Zi(o);let t={done:!1,value:i[0]};const n=[];let r=0;for(;!t.done;)t=e.sample(r),n.push(t.value),r+=10;i=n,a=r-10,l="linear"}var c;const u=function(e,t,n,{delay:r=0,duration:o,repeat:i=0,repeatType:a="loop",ease:s,times:l}={}){return e.animate({[t]:n,offset:l},{delay:r,duration:o,easing:ea(s),fill:"both",iterations:i+1,direction:"reverse"===a?"alternate":"normal"})}(e.owner.current,t,i,{...o,delay:-s,duration:a,ease:l});return u.onfinish=()=>{e.set(i[i.length-1]),r&&r()},()=>{const{currentTime:t}=u;if(t){const n=Zi(o);e.setWithVelocity(n.sample(t-10).value,n.sample(t).value,10)}go.update((()=>u.cancel()))}}function na(e,t){const n=performance.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(vo.read(r),e(i-t))};return go.read(r,!0),()=>vo.read(r)}function ra({keyframes:e,elapsed:t,onUpdate:n,onComplete:r}){const o=()=>(n&&n(e[e.length-1]),r&&r(),()=>{});return t?na(o,-t):o()}const oa=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),ia=e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}),aa=()=>({type:"keyframes",ease:"linear",duration:.3}),sa={type:"keyframes",duration:.8},la={x:oa,y:oa,z:oa,rotate:oa,rotateX:oa,rotateY:oa,rotateZ:oa,scaleX:ia,scaleY:ia,scale:ia,opacity:aa,backgroundColor:aa,color:aa,default:ia},ca=(e,{keyframes:t})=>{if(t.length>2)return sa;return(la[e]||la.default)(t[1])},ua=(e,t)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Ho.test(t)||t.startsWith("url(")));function da(e){return 0===e||"string"==typeof e&&0===parseFloat(e)&&-1===e.indexOf(" ")}function fa(e){return"number"==typeof e?0:qo("",e)}function pa(e,t){return e[t]||e.default||e}const ma={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},ha={},ga={};for(const e in ma)ga[e]=()=>(void 0===ha[e]&&(ha[e]=ma[e]()),ha[e]);const va=new Set(["opacity"]),ba=(e,t,n,r={})=>o=>{const i=pa(r,e)||{},a=i.delay||r.delay||0;let{elapsed:s=0}=r;s-=si(a);const l=function(e,t,n,r){const o=ua(t,n);let i=void 0!==r.from?r.from:e.get();return"none"===i&&o&&"string"==typeof n?i=qo(t,n):da(i)&&"string"==typeof n?i=fa(n):!Array.isArray(n)&&da(n)&&"string"==typeof i&&(n=fa(i)),Array.isArray(n)?(null===n[0]&&(n[0]=i),n):[i,n]}(t,e,n,i),c=l[0],u=l[l.length-1],d=ua(e,c),f=ua(e,u);let p={keyframes:l,velocity:t.getVelocity(),...i,elapsed:s,onUpdate:e=>{t.set(e),i.onUpdate&&i.onUpdate(e)},onComplete:()=>{o(),i.onComplete&&i.onComplete()}};if(!d||!f||li||!1===i.type)return ra(p);if("inertia"===i.type){const e=function({keyframes:e,velocity:t=0,min:n,max:r,power:o=.8,timeConstant:i=750,bounceStiffness:a=500,bounceDamping:s=10,restDelta:l=1,modifyTarget:c,driver:u,onUpdate:d,onComplete:f,onStop:p}){const m=e[0];let h;function g(e){return void 0!==n&&er}function v(e){return void 0===n?r:void 0===r||Math.abs(n-e){var n;null==d||d(t),null===(n=e.onUpdate)||void 0===n||n.call(e,t)},onComplete:f,onStop:p})}function y(e){b({type:"spring",stiffness:a,damping:s,restDelta:l,...e})}if(g(m))y({velocity:t,keyframes:[m,v(m)]});else{let e=o*t+m;void 0!==c&&(e=c(e));const r=v(e),a=r===n?-1:1;let s,u;const d=e=>{s=u,u=e,t=ko(e-s,ao.delta),(1===a&&e>r||-1===a&&enull==h?void 0:h.stop()}}(p);return()=>e.stop()}(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:a,repeatDelay:s,from:l,...c}){return!!Object.keys(c).length})(i)||(p={...p,...ca(e,p)}),p.duration&&(p.duration=si(p.duration)),p.repeatDelay&&(p.repeatDelay=si(p.repeatDelay));const m=t.owner,h=m&&m.current;if(ga.waapi()&&va.has(e)&&!p.repeatDelay&&"mirror"!==p.repeatType&&0!==p.damping&&m&&h instanceof HTMLElement&&!m.getProps().onUpdate)return ta(t,e,p);{const e=Zi(p);return()=>e.stop()}};function ya(e,t,n={}){var r;const o=ei(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const a=o?()=>wa(e,o,n):()=>Promise.resolve(),s=(null===(r=e.variantChildren)||void 0===r?void 0:r.size)?(r=0)=>{const{delayChildren:o=0,staggerChildren:a,staggerDirection:s}=i;return function(e,t,n=0,r=0,o=1,i){const a=[],s=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>s-e*r;return Array.from(e.variantChildren).sort(xa).forEach(((e,r)=>{a.push(ya(e,t,{...i,delay:n+l(r)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(a)}(e,t,o+r,a,s,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[e,t]="beforeChildren"===l?[a,s]:[s,a];return e().then(t)}return Promise.all([a(),s(n.delay)])}function wa(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var i;let{transition:a=e.getDefaultTransition(),transitionEnd:s,...l}=e.makeTargetAnimatable(t);const c=e.getValue("willChange");r&&(a=r);const u=[],d=o&&(null===(i=e.animationState)||void 0===i?void 0:i.getState()[o]);for(const t in l){const r=e.getValue(t),o=l[t];if(!r||void 0===o||d&&_a(d,t))continue;let i={delay:n,elapsed:0,...a};if(e.shouldReduceMotion&&gn.has(t)&&(i={...i,type:!1,delay:0}),!r.hasAnimated){const n=e.getProps()[ai];n&&(i.elapsed=ii(n,t))}let s=r.start(ba(t,r,o,i));oi(c)&&(c.add(t),s=s.then((()=>c.remove(t)))),u.push(s)}return Promise.all(u).then((()=>{s&&ni(e,s)}))}function xa(e,t){return e.sortNodePosition(t)}function _a({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}const Ea=[br.Animate,br.InView,br.Focus,br.Hover,br.Tap,br.Drag,br.Exit],Ca=[...Ea].reverse(),ka=Ea.length;function Sa(e){return t=>Promise.all(t.map((({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map((t=>ya(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=ya(e,t,n);else{const o="function"==typeof t?ei(e,t,n.custom):t;r=wa(e,o,n)}return r.then((()=>e.notify("AnimationComplete",t)))}(e,t,n))))}function Ta(e){let t=Sa(e);const n={[br.Animate]:Ra(!0),[br.InView]:Ra(),[br.Hover]:Ra(),[br.Tap]:Ra(),[br.Drag]:Ra(),[br.Focus]:Ra(),[br.Exit]:Ra()};let r=!0;const o=(t,n)=>{const r=ei(e,n);if(r){const{transition:e,transitionEnd:n,...o}=r;t={...t,...o,...n}}return t};function i(i,a){const s=e.getProps(),l=e.getVariantContext(!0)||{},c=[],u=new Set;let d={},f=1/0;for(let t=0;tf&&g;const x=Array.isArray(h)?h:[h];let _=x.reduce(o,{});!1===v&&(_={});const{prevResolvedValues:E={}}=m,C={...E,..._},k=e=>{w=!0,u.delete(e),m.needsAnimating[e]=!0};for(const e in C){const t=_[e],n=E[e];d.hasOwnProperty(e)||(t!==n?dr(t)&&dr(n)?!ro(t,n)||y?k(e):m.protectedKeys[e]=!0:void 0!==t?k(e):u.add(e):void 0!==t&&u.has(e)?k(e):m.protectedKeys[e]=!0)}m.prevProp=h,m.prevResolvedValues=_,m.isActive&&(d={...d,..._}),r&&e.blockInitialAnimation&&(w=!1),w&&!b&&c.push(...x.map((e=>({animation:e,options:{type:p,...i}}))))}if(u.size){const t={};u.forEach((n=>{const r=e.getBaseTarget(n);void 0!==r&&(t[n]=r)})),c.push({animation:t})}let p=Boolean(c.length);return r&&!1===s.initial&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(c):Promise.resolve()}return{animateChanges:i,setActive:function(t,r,o){var a;if(n[t].isActive===r)return Promise.resolve();null===(a=e.variantChildren)||void 0===a||a.forEach((e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)})),n[t].isActive=r;const s=i(o,t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n}}function Na(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!ro(t,e)}function Ra(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const Ia={animation:eo((({visualElement:e,animate:t})=>{e.animationState||(e.animationState=Ta(e)),Yt(t)&&(0,b.useEffect)((()=>t.subscribe(e)),[t])})),exit:eo((e=>{const{custom:t,visualElement:n}=e,[r,o]=no(),i=(0,b.useContext)(Ht);(0,b.useEffect)((()=>{n.isPresent=r;const e=n.animationState&&n.animationState.setActive(br.Exit,!r,{custom:i&&i.custom||t});e&&!r&&e.then(o)}),[r])}))},Ma=(e,t)=>Math.abs(e-t);class Pa{constructor(e,t,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=Aa(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=Ma(e.x,t.x),r=Ma(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=ao;this.history.push({...r,timestamp:o});const{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=Oa(t,this.transformPagePoint),xr(e)&&0===e.buttons?this.handlePointerUp(e,t):go.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r}=this.handlers,o=Aa(Oa(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,o),r&&r(e,o)},_r(e)&&e.touches.length>1)return;this.handlers=t,this.transformPagePoint=n;const r=Oa(Sr(e),this.transformPagePoint),{point:o}=r,{timestamp:i}=ao;this.history=[{...o,timestamp:i}];const{onSessionStart:a}=t;a&&a(e,Aa(r,this.history)),this.removeListeners=jr(Mr(window,"pointermove",this.handlePointerMove),Mr(window,"pointerup",this.handlePointerUp),Mr(window,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),vo.update(this.updatePoint)}}function Oa(e,t){return t?{point:t(e.point)}:e}function Da(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Aa({point:e},t){return{point:e,delta:Da(e,za(t)),offset:Da(e,La(t)),velocity:Ba(t,.1)}}function La(e){return e[0]}function za(e){return e[e.length-1]}function Ba(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=za(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>si(t)));)n--;if(!r)return{x:0,y:0};const i=(o.timestamp-r.timestamp)/1e3;if(0===i)return{x:0,y:0};const a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Fa(e){return e.max-e.min}function Va(e,t=0,n=.01){return Math.abs(e-t)<=n}function Ha(e,t,n,r=.5){e.origin=r,e.originPoint=mi(t.min,t.max,e.origin),e.scale=Fa(n)/Fa(t),(Va(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=mi(n.min,n.max,e.origin)-e.originPoint,(Va(e.translate)||isNaN(e.translate))&&(e.translate=0)}function ja(e,t,n,r){Ha(e.x,t.x,n.x,null==r?void 0:r.originX),Ha(e.y,t.y,n.y,null==r?void 0:r.originY)}function $a(e,t,n){e.min=n.min+t.min,e.max=e.min+Fa(t)}function Wa(e,t,n){e.min=t.min-n.min,e.max=e.min+Fa(t)}function Ua(e,t,n){Wa(e.x,t.x,n.x),Wa(e.y,t.y,n.y)}function Ga(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Ya(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min1.0000000000001||e<.999999999999?e:1}function cs(e,t){e.min=e.min+t,e.max=e.max+t}function us(e,t,[n,r,o]){const i=void 0!==t[o]?t[o]:.5,a=mi(e.min,e.max,i);as(e,t[n],t[r],a,t.scale)}const ds=["x","scaleX","originX"],fs=["y","scaleY","originY"];function ps(e,t){us(e.x,t,ds),us(e.y,t,fs)}function ms(e,t){return Ja(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const hs=new WeakMap;class gs{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new Pa(e,{onSessionStart:e=>{this.stopAnimation(),t&&this.snapToCursor(Sr(e,"page").point)},onStart:(e,t)=>{var n;const{drag:r,dragPropagation:o,onDragStart:i}=this.getProps();(!r||o||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Lr(r),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Za((e=>{var t,n;let r=this.getAxisMotionValue(e).get()||0;if(Dn.test(r)){const o=null===(n=null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout)||void 0===n?void 0:n.layoutBox[e];if(o){r=Fa(o)*(parseFloat(r)/100)}}this.originPoint[e]=r})),null==i||i(e,t),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(br.Drag,!0))},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:a}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(a),void(null!==this.currentDirection&&(null==o||o(this.currentDirection)));this.updateAxis("x",t.point,a),this.updateAxis("y",t.point,a),this.visualElement.render(),null==i||i(e,t)},onSessionEnd:(e,t)=>this.stop(e,t)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(e,t){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:o}=this.getProps();null==o||o(e,t)}cancel(){var e,t;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(e=this.panSession)||void 0===e||e.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(t=this.visualElement.animationState)||void 0===t||t.setActive(br.Drag,!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!vs(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:n},r){return void 0!==t&&en&&(e=r?mi(n,e,r.max):Math.min(e,n)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){const{dragConstraints:e,dragElastic:t}=this.getProps(),{layout:n}=this.visualElement.projection||{},r=this.constraints;e&&Ut(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!n)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:Ga(e.x,n,o),y:Ga(e.y,t,r)}}(n.layoutBox,e),this.elastic=function(e=qa){return!1===e?e=0:!0===e&&(e=qa),{x:Ka(e,"left","right"),y:Ka(e,"top","bottom")}}(t),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Za((e=>{this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(n.layoutBox[e],this.constraints[e]))}))}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Ut(e))return!1;const n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=ms(e,n),{scroll:o}=t;return o&&(cs(r.x,o.offset.x),cs(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:Ya(e.x,t.x),y:Ya(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(i));this.hasMutatedConstraints=!!e,e&&(i=Ja(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),s=this.constraints||{},l=Za((a=>{if(!vs(a,t,this.currentDirection))return;let l=(null==s?void 0:s[a])||{};i&&(l={min:0,max:0});const c=r?200:1e6,u=r?40:1e7,d={type:"inertia",velocity:n?e[a]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(a,d)}));return Promise.all(l).then(a)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return n.start(ba(e,n,0,t))}stopAnimation(){Za((e=>this.getAxisMotionValue(e).stop()))}getAxisMotionValue(e){var t;const n="_drag"+e.toUpperCase(),r=this.visualElement.getProps()[n];return r||this.visualElement.getValue(e,(null===(t=this.visualElement.getProps().initial)||void 0===t?void 0:t[e])||0)}snapToCursor(e){Za((t=>{const{drag:n}=this.getProps();if(!vs(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[t];o.set(e[t]-mi(n,i,.5))}}))}scalePositionWithinConstraints(){var e;if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ut(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Za((e=>{const t=this.getAxisMotionValue(e);if(t){const n=t.get();o[e]=function(e,t){let n=.5;const r=Fa(e),o=Fa(t);return o>r?n=Ci(t.min,t.max-r,e.min):r>o&&(n=Ci(e.min,e.max-o,t.min)),En(0,1,n)}({min:n,max:n},this.constraints[e])}}));const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",null===(e=r.root)||void 0===e||e.updateScroll(),r.updateLayout(),this.resolveConstraints(),Za((e=>{if(!vs(e,t,null))return;const n=this.getAxisMotionValue(e),{min:r,max:i}=this.constraints[e];n.set(mi(r,i,o[e]))}))}addListeners(){var e;if(!this.visualElement.current)return;hs.set(this.visualElement,this);const t=Mr(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),n=()=>{const{dragConstraints:e}=this.getProps();Ut(e)&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,o=r.addEventListener("measure",n);r&&!r.layout&&(null===(e=r.root)||void 0===e||e.updateScroll(),r.updateLayout()),n();const i=yr(window,"resize",(()=>this.scalePositionWithinConstraints())),a=r.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Za((t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))})),this.visualElement.render())}));return()=>{i(),t(),o(),null==a||a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=qa,dragMomentum:a=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:a}}}function vs(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const bs={pan:eo((function({onPan:e,onPanStart:t,onPanEnd:n,onPanSessionStart:r,visualElement:o}){const i=e||t||n||r,a=(0,b.useRef)(null),{transformPagePoint:s}=(0,b.useContext)(Ft),l={onSessionStart:r,onStart:t,onMove:e,onEnd:(e,t)=>{a.current=null,n&&n(e,t)}};(0,b.useEffect)((()=>{null!==a.current&&a.current.updateHandlers(l)})),Pr(o,"pointerdown",i&&function(e){a.current=new Pa(e,l,{transformPagePoint:s})}),Vr((()=>a.current&&a.current.end()))})),drag:eo((function(e){const{dragControls:t,visualElement:n}=e,r=tn((()=>new gs(n)));(0,b.useEffect)((()=>t&&t.subscribe(r)),[r,t]),(0,b.useEffect)((()=>r.addListeners()),[r])}))};function ys(e){return"string"==typeof e&&e.startsWith("var(--")}const ws=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function xs(e,t,n=1){const[r,o]=function(e){const t=ws.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);return i?i.trim():ys(o)?xs(o,t,n+1):o}const _s=new Set(["width","height","top","left","right","bottom","x","y"]),Es=e=>_s.has(e),Cs=(e,t)=>{e.set(t,!1),e.set(t)},ks=e=>e===Cn||e===An;var Ss;!function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"}(Ss||(Ss={}));const Ts=(e,t)=>parseFloat(e.split(", ")[t]),Ns=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return Ts(o[1],t);{const t=r.match(/^matrix\((.+)\)$/);return t?Ts(t[1],e):0}},Rs=new Set(["x","y","z"]),Is=hn.filter((e=>!Rs.has(e)));const Ms={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Ns(4,13),y:Ns(5,14)},Ps=(e,t,n={},r={})=>{t={...t},r={...r};const o=Object.keys(t).filter(Es);let i=[],a=!1;const s=[];if(o.forEach((o=>{const l=e.getValue(o);if(!e.hasValue(o))return;let c=n[o],u=Zo(c);const d=t[o];let f;if(dr(d)){const e=d.length,t=null===d[0]?1:0;c=d[t],u=Zo(c);for(let n=t;n{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t.length&&e.render(),t}(e),a=!0),s.push(o),r[o]=void 0!==r[o]?r[o]:t[o],Cs(l,d))})),s.length){const n=s.indexOf("height")>=0?window.pageYOffset:null,o=((e,t,n)=>{const r=t.measureViewportBox(),o=t.current,i=getComputedStyle(o),{display:a}=i,s={};"none"===a&&t.setStaticValue("display",e.display||"block"),n.forEach((e=>{s[e]=Ms[e](r,i)})),t.render();const l=t.measureViewportBox();return n.forEach((n=>{const r=t.getValue(n);Cs(r,s[n]),e[n]=Ms[n](l,i)})),e})(t,e,s);return i.length&&i.forEach((([t,n])=>{e.getValue(t).set(n)})),e.render(),At&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:r}}return{target:t,transitionEnd:r}};function Os(e,t,n,r){return(e=>Object.keys(e).some(Es))(t)?Ps(e,t,n,r):{target:t,transitionEnd:r}}const Ds=(e,t,n,r)=>{const o=function(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach((e=>{const t=e.get();if(!ys(t))return;const n=xs(t,r);n&&e.set(n)}));for(const e in t){const o=t[e];if(!ys(o))continue;const i=xs(o,r);i&&(t[e]=i,n&&void 0===n[e]&&(n[e]=o))}return{target:t,transitionEnd:n}}(e,t,r);return Os(e,t=o.target,n,r=o.transitionEnd)};const As=Object.keys(en),Ls=As.length,zs=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];const Bs=["initial",...Ea],Fs=Bs.length;class Vs extends class{constructor({parent:e,props:t,reducedMotionConfig:n,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>go.render(this.render,!1,!0);const{latestValues:i,renderState:a}=r;this.latestValues=i,this.baseTarget={...i},this.initialValues=t.initial?{...i}:{},this.renderState=a,this.parent=e,this.props=t,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=o,this.isControllingVariants=Kt(t),this.isVariantNode=Xt(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:s,...l}=this.scrapeMotionValuesFromProps(t);for(const e in l){const t=l[e];void 0!==i[e]&&bn(t)&&(t.set(i[e],!1),oi(s)&&s.add(e))}}scrapeMotionValuesFromProps(e){return{}}mount(e){var t;this.current=e,this.projection&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(t=this.parent)||void 0===t?void 0:t.addVariantChild(this)),this.values.forEach(((e,t)=>this.bindToMotionValue(t,e))),zt.current||Bt(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Lt.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var e,t,n;null===(e=this.projection)||void 0===e||e.unmount(),vo.update(this.notifyUpdate),vo.render(this.render),this.valueSubscriptions.forEach((e=>e())),null===(t=this.removeFromVariantTree)||void 0===t||t.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const e in this.events)this.events[e].clear();this.current=null}bindToMotionValue(e,t){const n=gn.has(e),r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&go.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,(()=>{r(),o()}))}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}loadFeatures(e,t,n,r,o,i){const a=[];for(let t=0;tthis.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:i,layoutScroll:l})}return a}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e,t=!0){return this.makeTargetAnimatableFromInstance(e,this.props,t)}setProps(e){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=e;for(let t=0;tn.variantChildren.delete(e)}addValue(e,t){this.hasValue(e)&&this.removeValue(e),this.values.set(e,t),this.latestValues[e]=t.get(),this.bindToMotionValue(e,t)}removeValue(e){var t;this.values.delete(e),null===(t=this.valueSubscriptions.get(e))||void 0===t||t(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=To(t,{owner:this}),this.addValue(e,n)),n}readValue(e){return void 0===this.latestValues[e]&&this.current?this.readValueFromInstance(this.current,e,this.options):this.latestValues[e]}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props,r="string"==typeof n||"object"==typeof n?null===(t=ur(this.props,n))||void 0===t?void 0:t[e]:void 0;if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||bn(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new Co),this.events[e].add(t)}notify(e,...t){var n;null===(n=this.events[e])||void 0===n||n.notify(...t)}}{sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){var n;return null===(n=e.style)||void 0===n?void 0:n[t]}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:t,...n},{transformValues:r},o){let i=function(e,t,n){var r;const o={};for(const i in e){const e=ri(i,t);o[i]=void 0!==e?e:null===(r=n.getValue(i))||void 0===r?void 0:r.get()}return o}(n,e||{},this);if(r&&(t&&(t=r(t)),n&&(n=r(n)),i&&(i=r(i))),o){!function(e,t,n){var r,o;const i=Object.keys(t).filter((t=>!e.hasValue(t))),a=i.length;if(a)for(let s=0;spn(e)?new js(t,{enableHardwareAcceleration:!1}):new Hs(t,{enableHardwareAcceleration:!0});function Ws(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Us={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!An.test(e))return e;e=parseFloat(e)}return`${Ws(e,t.target.x)}% ${Ws(e,t.target.y)}%`}},Gs="_$css",Ys={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=e.includes("var("),i=[];o&&(e=e.replace(ws,(e=>(i.push(e),Gs))));const a=Ho.parse(e);if(a.length>5)return r;const s=Ho.createTransformer(e),l="number"!=typeof a[0]?1:0,c=n.x.scale*t.x,u=n.y.scale*t.y;a[0+l]/=c,a[1+l]/=u;const d=mi(c,u,.5);"number"==typeof a[2+l]&&(a[2+l]/=d),"number"==typeof a[3+l]&&(a[3+l]/=d);let f=s(a);if(o){let e=0;f=f.replace(Gs,(()=>{const t=i[e];return e++,t}))}return f}};class qs extends b.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var i;i=Ks,Object.assign(mn,i),o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),nn.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||e.layoutDependency!==t||void 0===t?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||go.postRender((()=>{var e;(null===(e=i.getStack())||void 0===e?void 0:e.members.length)||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),!e.currentAnimation&&e.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),(null==t?void 0:t.group)&&t.group.remove(r),(null==n?void 0:n.deregister)&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;null==e||e()}render(){return null}}const Ks={borderRadius:{...Us,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Us,borderTopRightRadius:Us,borderBottomLeftRadius:Us,borderBottomRightRadius:Us,boxShadow:Ys},Xs={measureLayout:function(e){const[t,n]=no(),r=(0,b.useContext)(on);return b.createElement(qs,{...e,layoutGroup:r,switchLayoutGroup:(0,b.useContext)(sn),isPresent:t,safeToRemove:n})}};const Zs=["TopLeft","TopRight","BottomLeft","BottomRight"],Js=Zs.length,Qs=e=>"string"==typeof e?parseFloat(e):e,el=e=>"number"==typeof e||An.test(e);function tl(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const nl=ol(0,.5,Pi),rl=ol(.5,.95,Ni);function ol(e,t,n){return r=>rt?1:n(Ci(e,t,r))}function il(e,t){e.min=t.min,e.max=t.max}function al(e,t){il(e.x,t.x),il(e.y,t.y)}function sl(e,t,n,r,o){return e=os(e-=t,1/n,r),void 0!==o&&(e=os(e,1/o,r)),e}function ll(e,t,[n,r,o],i,a){!function(e,t=0,n=1,r=.5,o,i=e,a=e){Dn.test(t)&&(t=parseFloat(t),t=mi(a.min,a.max,t/100)-a.min);if("number"!=typeof t)return;let s=mi(i.min,i.max,r);e===i&&(s-=t),e.min=sl(e.min,t,n,s,o),e.max=sl(e.max,t,n,s,o)}(e,t[n],t[r],t[o],t.scale,i,a)}const cl=["x","scaleX","originX"],ul=["y","scaleY","originY"];function dl(e,t,n,r){ll(e.x,t,cl,null==n?void 0:n.x,null==r?void 0:r.x),ll(e.y,t,ul,null==n?void 0:n.y,null==r?void 0:r.y)}function fl(e){return 0===e.translate&&1===e.scale}function pl(e){return fl(e.x)&&fl(e.y)}function ml(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function hl(e){return Fa(e.x)/Fa(e.y)}class gl{constructor(){this.members=[]}add(e){_o(this.members,e),e.scheduleRender()}remove(e){if(Eo(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex((t=>e===t));if(0===t)return!1;let n;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(e,t){var n;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,t&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(null===(n=e.root)||void 0===n?void 0:n.isUpdating)&&(e.isLayoutDirty=!0);const{crossfade:o}=e.options;!1===o&&r.hide()}}exitAnimationComplete(){this.members.forEach((e=>{var t,n,r,o,i;null===(n=(t=e.options).onExitComplete)||void 0===n||n.call(t),null===(i=null===(r=e.resumingFrom)||void 0===r?void 0:(o=r.options).onExitComplete)||void 0===i||i.call(o)}))}scheduleRender(){this.members.forEach((e=>{e.instance&&e.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function vl(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y;if((o||i)&&(r=`translate3d(${o}px, ${i}px, 0) `),1===t.x&&1===t.y||(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:e,rotateX:t,rotateY:o}=n;e&&(r+=`rotate(${e}deg) `),t&&(r+=`rotateX(${t}deg) `),o&&(r+=`rotateY(${o}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return 1===a&&1===s||(r+=`scale(${a}, ${s})`),r||"none"}const bl=(e,t)=>e.depth-t.depth;class yl{constructor(){this.children=[],this.isDirty=!1}add(e){_o(this.children,e),this.isDirty=!0}remove(e){Eo(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(bl),this.isDirty=!1,this.children.forEach(e)}}const wl=["","X","Y","Z"];let xl=0;function _l({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e,n={},r=(null==t?void 0:t())){this.id=xl++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(kl),this.nodes.forEach(Il),this.nodes.forEach(Ml)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=e,this.latestValues=n,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0,e&&this.root.registerPotentialNode(e,this);for(let e=0;ethis.root.updateBlockedByResize=!1;e(t,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=na(r,250),nn.hasAnimatedSinceResize&&(nn.hasAnimatedSinceResize=!1,this.nodes.forEach(Rl))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&a&&(o||i)&&this.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{var o,i,s,l,c;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const u=null!==(i=null!==(o=this.options.transition)&&void 0!==o?o:a.getDefaultTransition())&&void 0!==i?i:zl,{onLayoutAnimationStart:d,onLayoutAnimationComplete:f}=a.getProps(),p=!this.targetLayout||!ml(this.targetLayout,r)||n,m=!t&&n;if((null===(s=this.resumeFrom)||void 0===s?void 0:s.instance)||m||t&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,m);const t={...pa(u,"layout"),onPlay:d,onComplete:f};a.shouldReduceMotion&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||0!==this.animationProgress||Rl(this),this.isLead()&&(null===(c=(l=this.options).onExitComplete)||void 0===c||c.call(l));this.targetLayout=r}))}unmount(){var e,t;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(e=this.getStack())||void 0===e||e.remove(this),null===(t=this.parent)||void 0===t||t.children.delete(this),this.instance=void 0,vo.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var e;return this.isAnimationBlocked||(null===(e=this.parent)||void 0===e?void 0:e.isTreeAnimationBlocked())||!1}startUpdate(){var e;this.isUpdateBlocked()||(this.isUpdating=!0,null===(e=this.nodes)||void 0===e||e.forEach(Pl),this.animationId++)}willUpdate(e=!0){var t,n,r;if(this.root.isUpdateBlocked())return void(null===(n=(t=this.options).onExitComplete)||void 0===n||n.call(t));if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){var e;if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e{var n;const r=t/1e3;Dl(s.x,e.x,r),Dl(s.y,e.y,r),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(Ua(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,n,r){Al(e.x,t.x,n.x,r),Al(e.y,t.y,n.y,r)}(this.relativeTarget,this.relativeTargetOrigin,l,r)),c&&(this.animationValues=a,function(e,t,n,r,o,i){o?(e.opacity=mi(0,void 0!==n.opacity?n.opacity:1,nl(r)),e.opacityExit=mi(void 0!==t.opacity?t.opacity:1,0,rl(r))):i&&(e.opacity=mi(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o{nn.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n={}){const r=bn(e)?e:To(e);return r.start(ba("",r,t,n)),{stop:()=>r.stop(),isAnimating:()=>r.isAnimating()}}(0,1e3,{...e,onUpdate:t=>{var n;this.mixTargetDelta(t),null===(n=e.onUpdate)||void 0===n||n.call(e,t)},onComplete:()=>{var t;null===(t=e.onComplete)||void 0===t||t.call(e),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0}))}completeAnimation(){var e;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(e=this.getStack())||void 0===e||e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var e;this.currentAnimation&&(null===(e=this.mixTargetDelta)||void 0===e||e.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&Vl(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=Fa(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=Fa(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}al(t,n),ps(t,o),ja(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){var n,r,o;this.sharedNodes.has(e)||this.sharedNodes.set(e,new gl);this.sharedNodes.get(e).add(t),t.promote({transition:null===(n=t.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(o=null===(r=t.options.initialPromotionConfig)||void 0===r?void 0:r.shouldPreserveFollowOpacity)||void 0===o?void 0:o.call(r,t)})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(t=!0),!t)return;const r={};for(let t=0;t{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()})),this.root.nodes.forEach(Tl),this.root.sharedNodes.clear()}}}function El(e){e.updateLayout()}function Cl(e){var t,n,r;const o=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&o&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:n}=e.layout,{animationType:r}=e.options,i=o.source!==e.layout.source;"size"===r?Za((e=>{const n=i?o.measuredBox[e]:o.layoutBox[e],r=Fa(n);n.min=t[e].min,n.max=n.min+r})):Vl(r,o.layoutBox,t)&&Za((e=>{const n=i?o.measuredBox[e]:o.layoutBox[e],r=Fa(t[e]);n.max=n.min+r}));const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};ja(a,t,o.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};i?ja(s,e.applyTransform(n,!0),o.measuredBox):ja(s,t,o.layoutBox);const l=!pl(a);let c=!1;if(!e.resumeFrom){const n=e.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:e,layout:r}=n;if(e&&r){const n={x:{min:0,max:0},y:{min:0,max:0}};Ua(n,o.layoutBox,e.layoutBox);const i={x:{min:0,max:0},y:{min:0,max:0}};Ua(i,t,r.layoutBox),ml(n,i)||(c=!0)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:o,delta:s,layoutDelta:a,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else e.isLead()&&(null===(r=(n=e.options).onExitComplete)||void 0===r||r.call(n));e.options.transition=void 0}function kl(e){e.isProjectionDirty||(e.isProjectionDirty=Boolean(e.parent&&e.parent.isProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=Boolean(e.parent&&e.parent.isTransformDirty))}function Sl(e){e.clearSnapshot()}function Tl(e){e.clearMeasurements()}function Nl(e){const{visualElement:t}=e.options;(null==t?void 0:t.getProps().onBeforeLayoutMeasure)&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Rl(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function Il(e){e.resolveTargetDelta()}function Ml(e){e.calcProjection()}function Pl(e){e.resetRotation()}function Ol(e){e.removeLeadSnapshot()}function Dl(e,t,n){e.translate=mi(t.translate,0,n),e.scale=mi(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Al(e,t,n,r){e.min=mi(t.min,n.min,r),e.max=mi(t.max,n.max,r)}function Ll(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const zl={duration:.45,ease:[.4,0,.1,1]};function Bl(e,t){let n=e.root;for(let t=e.path.length-1;t>=0;t--)if(Boolean(e.path[t].instance)){n=e.path[t];break}const r=(n&&n!==e.root?n.instance:document).querySelector(`[data-projection-id="${t}"]`);r&&e.mount(r,!0)}function Fl(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function Vl(e,t,n){return"position"===e||"preserve-aspect"===e&&!Va(hl(t),hl(n),.2)}const Hl=_l({attachResizeListener:(e,t)=>yr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),jl={current:void 0},$l=_l({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!jl.current){const e=new Hl(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),jl.current=e}return jl.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),Wl={...Ia,...to,...bs,...Xs},Ul=dn(((e,t)=>function(e,{forwardMotionProps:t=!1},n,r,o){return{...pn(e)?gr:vr,preloadedFeatures:n,useRender:rr(t),createVisualElement:r,projectionNodeConstructor:o,Component:e}}(e,t,Wl,$s,$l)));var Gl=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),Yl=window.wp.deprecated,ql=n.n(Yl);var Kl=function(e){let{icon:t,className:n,size:r=20,style:o={},...i}=e;const l=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" "),c={...20!=r?{fontSize:`${r}px`,width:`${r}px`,height:`${r}px`}:{},...o};return(0,s.createElement)("span",a({className:l,style:c},i))};var Xl=function(e){let{icon:t=null,size:n=("string"==typeof t?20:24),...r}=e;if("string"==typeof t)return(0,s.createElement)(Kl,a({icon:t,size:n},r));if((0,s.isValidElement)(t)&&Kl===t.type)return(0,s.cloneElement)(t,{...r});if("function"==typeof t)return t.prototype instanceof s.Component?(0,s.createElement)(t,{size:n,...r}):t({size:n,...r});if(t&&("svg"===t.type||t.type===i.SVG)){const e={...t.props,width:n,height:n,...r};return(0,s.createElement)(i.SVG,e)}return(0,s.isValidElement)(t)?(0,s.cloneElement)(t,{size:n,...r}):t},Zl=(window.wp.warning,n(5619)),Jl=n.n(Zl),Ql=window.lodash;var ec=function(e,t){const n=(0,s.useRef)(!1);(0,s.useEffect)((()=>{if(n.current)return e();n.current=!0}),t)};const tc=(0,s.createContext)({}),nc=()=>(0,s.useContext)(tc);const rc=(0,s.memo)((e=>{let{children:t,value:n}=e;const r=function(e){let{value:t}=e;const n=nc(),r=(0,s.useRef)(t);return ec((()=>{Jl()(r.current,t)&&r.current!==t&&"undefined"!=typeof process&&process.env}),[t]),(0,s.useMemo)((()=>(0,Ql.merge)(JSON.parse(JSON.stringify(n)),t)),[n,t])}({value:n});return(0,s.createElement)(tc.Provider,{value:r},t)})),oc="__contextSystemKey__";var ic=n(9756),ac=n.n(ic);const sc=ac()((function(e){return`components-${(0,Ql.kebabCase)(e)}`}));var lc=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?hc(kc,--Ec):0,xc--,10===Cc&&(xc=1,wc--),Cc}function Rc(){return Cc=Ec<_c?hc(kc,Ec++):0,xc++,10===Cc&&(xc=1,wc++),Cc}function Ic(){return hc(kc,Ec)}function Mc(){return Ec}function Pc(e,t){return gc(kc,e,t)}function Oc(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Dc(e){return wc=xc=1,_c=vc(kc=e),Ec=0,[]}function Ac(e){return kc="",e}function Lc(e){return fc(Pc(Ec-1,Fc(91===e?e+2:40===e?e+1:e)))}function zc(e){for(;(Cc=Ic())&&Cc<33;)Rc();return Oc(e)>2||Oc(Cc)>3?"":" "}function Bc(e,t){for(;--t&&Rc()&&!(Cc<48||Cc>102||Cc>57&&Cc<65||Cc>70&&Cc<97););return Pc(e,Mc()+(t<6&&32==Ic()&&32==Rc()))}function Fc(e){for(;Rc();)switch(Cc){case e:return Ec;case 34:case 39:34!==e&&39!==e&&Fc(Cc);break;case 40:41===e&&Fc(e);break;case 92:Rc()}return Ec}function Vc(e,t){for(;Rc()&&e+Cc!==57&&(e+Cc!==84||47!==Ic()););return"/*"+Pc(t,Ec-1)+"*"+uc(47===e?e:Rc())}function Hc(e){for(;!Oc(Ic());)Rc();return Pc(e,Ec)}var jc="-ms-",$c="-moz-",Wc="-webkit-",Uc="comm",Gc="rule",Yc="decl",qc="@keyframes";function Kc(e,t){for(var n="",r=bc(e),o=0;o0&&vc(E)-d&&yc(p>32?tu(E+";",r,n,d-1):tu(pc(E," ","")+";",r,n,d-2),l);break;case 59:E+=";";default:if(yc(_=Qc(E,t,n,c,u,o,s,y,w=[],x=[],d),i),123===b)if(0===u)Jc(E,t,_,_,w,i,d,s,x);else switch(99===f&&110===hc(E,3)?100:f){case 100:case 109:case 115:Jc(e,_,_,r&&yc(Qc(e,_,_,0,0,o,s,y,o,w=[],d),x),o,x,d,s,r?w:x);break;default:Jc(E,_,_,_,[""],x,0,s,x)}}c=u=p=0,h=v=1,y=E="",d=a;break;case 58:d=1+vc(E),p=m;default:if(h<1)if(123==b)--h;else if(125==b&&0==h++&&125==Nc())continue;switch(E+=uc(b),b*h){case 38:v=u>0?1:(E+="\f",-1);break;case 44:s[c++]=(vc(E)-1)*v,v=1;break;case 64:45===Ic()&&(E+=Lc(Rc())),f=Ic(),u=d=vc(y=E+=Hc(Mc())),b++;break;case 45:45===m&&2==vc(E)&&(h=0)}}return i}function Qc(e,t,n,r,o,i,a,s,l,c,u){for(var d=o-1,f=0===o?i:[""],p=bc(f),m=0,h=0,g=0;m0?f[v]+" "+b:pc(b,/&\f/g,f[v])))&&(l[g++]=y);return Sc(e,t,n,0===o?Gc:s,l,c,u)}function eu(e,t,n){return Sc(e,t,n,Uc,uc(Cc),gc(e,2,-2),0)}function tu(e,t,n,r){return Sc(e,t,n,Yc,gc(e,0,r),gc(e,r+1,-1),r)}var nu=function(e,t,n){for(var r=0,o=0;r=o,o=Ic(),38===r&&12===o&&(t[n]=1),!Oc(o);)Rc();return Pc(e,Ec)},ru=function(e,t){return Ac(function(e,t){var n=-1,r=44;do{switch(Oc(r)){case 0:38===r&&12===Ic()&&(t[n]=1),e[n]+=nu(Ec-1,t,n);break;case 2:e[n]+=Lc(r);break;case 4:if(44===r){e[++n]=58===Ic()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=uc(r)}}while(r=Rc());return e}(Dc(e),t))},ou=new WeakMap,iu=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ou.get(n))&&!r){ou.set(e,!0);for(var o=[],i=ru(t,o),a=n.props,s=0,l=0;s6)switch(hc(e,t+1)){case 109:if(45!==hc(e,t+4))break;case 102:return pc(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1-moz-"+(108==hc(e,t+3)?"$3":"$2-$3"))+e;case 115:return~mc(e,"stretch")?su(pc(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==hc(e,t+1))break;case 6444:switch(hc(e,vc(e)-3-(~mc(e,"!important")&&10))){case 107:return pc(e,":",":-webkit-")+e;case 101:return pc(e,/(.+:)([^;!]+)(;|!.+)?/,"$1-webkit-"+(45===hc(e,14)?"inline-":"")+"box$3$1"+"-webkit-$2$3$1"+"-ms-$2box$3")+e}break;case 5936:switch(hc(e,t+11)){case 114:return Wc+e+jc+pc(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Wc+e+jc+pc(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Wc+e+jc+pc(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Wc+e+jc+e+e}return e}var lu=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Yc:e.return=su(e.value,e.length);break;case qc:return Kc([Tc(e,{value:pc(e.value,"@","@-webkit-")})],r);case Gc:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Kc([Tc(e,{props:[pc(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Kc([Tc(e,{props:[pc(t,/:(plac\w+)/,":-webkit-input-$1")]}),Tc(e,{props:[pc(t,/:(plac\w+)/,":-moz-$1")]}),Tc(e,{props:[pc(t,/:(plac\w+)/,"-ms-input-$1")]})],r)}return""}))}}],cu=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r=e.stylisPlugins||lu;var o,i,a={},s=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},du={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var fu=function(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}},pu=/[A-Z]|^ms/g,mu=/_EMO_([^_]+?)_([^]*?)_EMO_/g,hu=function(e){return 45===e.charCodeAt(1)},gu=function(e){return null!=e&&"boolean"!=typeof e},vu=fu((function(e){return hu(e)?e:e.replace(pu,"-$&").toLowerCase()})),bu=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(mu,(function(e,t,n){return wu={name:t,styles:n,next:wu},t}))}return 1===du[e]||hu(e)||"number"!=typeof t||0===t?t:t+"px"};function yu(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return wu={name:n.name,styles:n.styles,next:wu},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)wu={name:r.name,styles:r.styles,next:wu},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;onull!=e&&["name","styles"].every((t=>void 0!==e[t])),Fu=()=>{const e=(0,b.useContext)(ku),t=(0,s.useCallback)((function(){if(null===e)throw new Error("The `useCx` hook should be only used within a valid Emotion Cache Context");for(var t=arguments.length,n=new Array(t),r=0;rBu(t)?(Mu(e,t,!1),`${e.key}-${t.name}`):t)))}),[e]);return t};function Vu(e,t){const n=nc();void 0===t&&"undefined"!=typeof process&&process.env;const r=(null==n?void 0:n[t])||{},o={"data-wp-c16t":!0,...(i=t,{"data-wp-component":i})};var i;const{_overrides:a,...s}=r,l=Object.entries(s).length?Object.assign({},s,e):e,c=Fu()(sc(t),e.className),u="function"==typeof l.renderChildren?l.renderChildren(l):l.children;for(const e in l)o[e]=l[e];for(const e in a)o[e]=a[e];return void 0!==u&&(o.children=u),o.className=c,o}function Hu(e,t){return ju(e,t,{forwardsRef:!0})}function ju(e,t,n){const r=null!=n&&n.forwardsRef?(0,s.forwardRef)(e):e;void 0===t&&"undefined"!=typeof process&&process.env;let o=r.__contextSystemKey__||[t];return Array.isArray(t)&&(o=[...o,...t]),"string"==typeof t&&(o=[...o,t]),Object.assign(r,{[oc]:[...new Set(o)],displayName:t,selector:`.${sc(t)}`})}function $u(e){if(!e)return[];let t=[];return e.__contextSystemKey__&&(t=e.__contextSystemKey__),e.type&&e.type.__contextSystemKey__&&(t=e.type.__contextSystemKey__),t}function Wu(e,t){return!!e&&("string"==typeof t?$u(e).includes(t):!!Array.isArray(t)&&t.some((t=>$u(e).includes(t))))}const Uu={border:0,clip:"rect(1px, 1px, 1px, 1px)",WebkitClipPath:"inset( 50% )",clipPath:"inset( 50% )",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",wordWrap:"normal"};var Gu=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Yu=fu((function(e){return Gu.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),qu=function(e){return"theme"!==e},Ku=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Yu:qu},Xu=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},Zu=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;Iu(t,n,r);Cu((function(){return Mu(t,n,r)}));return null},Ju=function e(t,n){var r,o,i=t.__emotion_real===t,s=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,o=n.target);var l=Xu(t,n,i),c=l||Ku(s),u=!c("as");return function(){var d=arguments,f=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&f.push("label:"+r+";"),null==d[0]||void 0===d[0].raw)f.push.apply(f,d);else{0,f.push(d[0][0]);for(var p=d.length,m=1;m{e&&(e.stopPropagation(),e.preventDefault())}}const z=!O&&(v&&w||y||!!w&&!(null!=x&&x.length)&&!1!==v),B=k?I:void 0,F=R["aria-describedby"]||B,V={className:P,"aria-label":R["aria-label"]||w,"aria-describedby":F,ref:t},H=(0,s.createElement)(s.Fragment,null,m&&"left"===h&&(0,s.createElement)(Xl,{icon:m,size:g}),_&&(0,s.createElement)(s.Fragment,null,_),m&&"right"===h&&(0,s.createElement)(Xl,{icon:m,size:g}),x),j="a"===D?(0,s.createElement)("a",a({},L,R,V),H):(0,s.createElement)("button",a({},A,R,V),H);return z?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Bf,{text:null!=x&&x.length&&k?k:w,shortcut:y,position:b},j),k&&(0,s.createElement)(td,null,(0,s.createElement)("span",{id:B},k))):(0,s.createElement)(s.Fragment,null,j,k&&(0,s.createElement)(td,null,(0,s.createElement)("span",{id:B},k)))}));var od=rd;let id=0;function ad(e){const t=document.scrollingElement||document.body;e&&(id=t.scrollTop);const n=e?"add":"remove";t.classList[n]("lockscroll"),document.documentElement.classList[n]("lockscroll"),e||(t.scrollTop=id)}let sd=0;var ld=function(){return(0,s.useEffect)((()=>(0===sd&&ad(!0),++sd,()=>{1===sd&&ad(!1),--sd})),[]),null};const cd=Symbol(),ud=Symbol(),dd=Symbol();let fd=(e,t)=>new Proxy(e,t);const pd=Object.getPrototypeOf,md=new WeakMap,hd=e=>e&&(md.has(e)?md.get(e):pd(e)===Object.prototype||pd(e)===Array.prototype),gd=e=>"object"==typeof e&&null!==e,vd=new WeakMap,bd=e=>e[dd]||e,yd=(e,t,n)=>{if(!hd(e))return e;const r=bd(e),o=(e=>Object.isFrozen(e)||Object.values(Object.getOwnPropertyDescriptors(e)).some((e=>!e.writable)))(r);let i=n&&n.get(r);return i&&i[1].f===o||(i=((e,t)=>{const n={f:t};let r=!1;const o=(t,o)=>{if(!r){let r=n.a.get(e);r||(r=new Set,n.a.set(e,r)),o&&r.has(cd)||r.add(t)}},i={get:(t,r)=>r===dd?e:(o(r),yd(t[r],n.a,n.c)),has:(t,i)=>i===ud?(r=!0,n.a.delete(e),!0):(o(i),i in t),getOwnPropertyDescriptor:(e,t)=>(o(t,!0),Object.getOwnPropertyDescriptor(e,t)),ownKeys:e=>(o(cd),Reflect.ownKeys(e))};return t&&(i.set=i.deleteProperty=()=>!1),[i,n]})(r,o),i[1].p=fd(o?(e=>{let t=vd.get(e);if(!t){if(Array.isArray(e))t=Array.from(e);else{const n=Object.getOwnPropertyDescriptors(e);Object.values(n).forEach((e=>{e.configurable=!0})),t=Object.create(pd(e),n)}vd.set(e,t)}return t})(r):r,i[0]),n&&n.set(r,i)),i[1].a=t,i[1].c=n,i[1].p},wd=(e,t)=>{const n=Reflect.ownKeys(e),r=Reflect.ownKeys(t);return n.length!==r.length||n.some(((e,t)=>e!==r[t]))},xd=(e,t,n,r)=>{if(Object.is(e,t))return!1;if(!gd(e)||!gd(t))return!0;const o=n.get(bd(e));if(!o)return!0;if(r){const n=r.get(e);if(n&&n.n===t)return n.g;r.set(e,{n:t,g:!1})}let i=null;for(const a of o){const o=a===cd?wd(e,t):xd(e[a],t[a],n,r);if(!0!==o&&!1!==o||(i=o),i)break}return null===i&&(i=!0),r&&r.set(e,{n:t,g:i}),i},_d=(e,t=!0)=>{md.set(e,t)};var Ed=n(635);const Cd=e=>"object"==typeof e&&null!==e,kd=new WeakSet,Sd=Symbol("VERSION"),Td=Symbol("LISTENERS"),Nd=Symbol("SNAPSHOT"),Rd=(e=Object.is,t=((e,t)=>new Proxy(e,t)),n=(e=>Cd(e)&&!kd.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)),r=Symbol("PROMISE_RESULT"),o=Symbol("PROMISE_ERROR"),i=new WeakMap,a=((e,t,n)=>{const a=i.get(n);if((null==a?void 0:a[0])===e)return a[1];const s=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return _d(s,!0),i.set(n,[e,s]),Reflect.ownKeys(t).forEach((e=>{const i=Reflect.get(t,e,n);if(kd.has(i))_d(i,!1),s[e]=i;else if(i instanceof Promise)if(r in i)s[e]=i[r];else{const t=i[o]||i;Object.defineProperty(s,e,{get(){if(r in i)return i[r];throw t}})}else(null==i?void 0:i[Td])?s[e]=i[Nd]:s[e]=i})),Object.freeze(s)}),s=new WeakMap,l=[1],c=(i=>{if(!Cd(i))throw new Error("object required");const c=s.get(i);if(c)return c;let u=l[0];const d=new Set,f=(e,t=++l[0])=>{u!==t&&(u=t,d.forEach((n=>n(e,t))))},p=new Map,m=e=>{let t=p.get(e);return t||(t=(t,n)=>{const r=[...t];r[1]=[e,...r[1]],f(r,n)},p.set(e,t)),t},h=e=>{const t=p.get(e);return p.delete(e),t},g=Array.isArray(i)?[]:Object.create(Object.getPrototypeOf(i)),v={get(e,t,n){return t===Sd?u:t===Td?d:t===Nd?a(u,e,n):Reflect.get(e,t,n)},deleteProperty(e,t){const n=Reflect.get(e,t),r=null==n?void 0:n[Td];r&&r.delete(h(t));const o=Reflect.deleteProperty(e,t);return o&&f(["delete",[t],n]),o},set(t,i,a,s){var l;const c=Reflect.has(t,i),u=Reflect.get(t,i,s);if(c&&e(u,a))return!0;const d=null==u?void 0:u[Td];let p;return d&&d.delete(h(i)),Cd(a)&&(a=(e=>hd(e)&&e[dd]||null)(a)||a),(null==(l=Object.getOwnPropertyDescriptor(t,i))?void 0:l.set)?p=a:a instanceof Promise?p=a.then((e=>(p[r]=e,f(["resolve",[i],e]),e))).catch((e=>{p[o]=e,f(["reject",[i],e])})):(null==a?void 0:a[Td])?(p=a,p[Td].add(m(i))):n(a)?(p=Md(a),p[Td].add(m(i))):p=a,Reflect.set(t,i,p,s),f(["set",[i],a,u]),!0}},b=t(g,v);return s.set(i,b),Reflect.ownKeys(i).forEach((e=>{const t=Object.getOwnPropertyDescriptor(i,e);t.get||t.set?Object.defineProperty(g,e,t):b[e]=i[e]})),b}))=>[c,kd,Sd,Td,Nd,e,t,n,r,o,i,a,s,l],[Id]=Rd();function Md(e={}){return Id(e)}function Pd(e,t,n){let r;(null==e?void 0:e[Td])||console.warn("Please use proxy object");const o=[],i=e=>{o.push(e),n?t(o.splice(0)):r||(r=Promise.resolve().then((()=>{r=void 0,t(o.splice(0))})))};return e[Td].add(i),()=>{e[Td].delete(i)}}function Od(e){return(null==e?void 0:e[Nd])||console.warn("Please use proxy object"),e[Nd]}function Dd(e){return kd.add(e),e}const{useSyncExternalStore:Ad}=Ed,Ld=(e,t)=>{const n=(0,b.useRef)();(0,b.useEffect)((()=>{n.current=((e,t)=>{const n=[],r=new WeakSet,o=(e,i)=>{if(r.has(e))return;gd(e)&&r.add(e);const a=gd(e)&&t.get(bd(e));a?a.forEach((t=>{o(e[t],i?[...i,t]:[t])})):i&&n.push(i)};return o(e),n})(e,t)})),(0,b.useDebugValue)(n.current)};function zd(e,t){const n=null==t?void 0:t.sync,r=(0,b.useRef)(),o=(0,b.useRef)();let i=!0;const a=Ad((0,b.useCallback)((t=>{const r=Pd(e,t,n);return t(),r}),[e,n]),(()=>{const t=Od(e);try{if(!i&&r.current&&o.current&&!xd(r.current,t,o.current,new WeakMap))return r.current}catch(e){}return t}),(()=>Od(e)));i=!1;const s=new WeakMap;(0,b.useEffect)((()=>{r.current=a,o.current=s})),Ld(a,s);const l=(0,b.useMemo)((()=>new WeakMap),[]);return yd(a,s,l)}Symbol();function Bd(e){const t=Md({data:Array.from(e||[]),has(e){return this.data.some((t=>t[0]===e))},set(e,t){const n=this.data.find((t=>t[0]===e));return n?n[1]=t:this.data.push([e,t]),this},get(e){var t;return null==(t=this.data.find((t=>t[0]===e)))?void 0:t[1]},delete(e){const t=this.data.findIndex((t=>t[0]===e));return-1!==t&&(this.data.splice(t,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},toJSON(){return{}},forEach(e){this.data.forEach((t=>{e(t[1],t[0],this)}))},keys(){return this.data.map((e=>e[0])).values()},values(){return this.data.map((e=>e[1])).values()},entries(){return new Map(this.data).entries()},get[Symbol.toStringTag](){return"Map"},[Symbol.iterator](){return this.entries()}});return Object.defineProperties(t,{data:{enumerable:!1},size:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(t),t}var Fd=(0,s.createContext)({slots:Bd(),fills:Bd(),registerSlot:()=>{"undefined"!=typeof process&&process.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});function Vd(e){const{updateSlot:t,unregisterSlot:n,registerFill:r,unregisterFill:o,...i}=(0,s.useContext)(Fd);return{...zd(i.slots,{sync:!0}).get(e),updateSlot:(0,s.useCallback)((n=>{t(e,n)}),[e,t]),unregisterSlot:(0,s.useCallback)((t=>{n(e,t)}),[e,n]),registerFill:(0,s.useCallback)((t=>{r(e,t)}),[e,r]),unregisterFill:(0,s.useCallback)((t=>{o(e,t)}),[e,o])}}var Hd=(0,s.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});var jd=e=>{const{getSlot:t,subscribe:n}=(0,s.useContext)(Hd);return(0,s.useSyncExternalStore)(n,(()=>t(e)),(()=>t(e)))};function $d(e){let{name:t,children:n,registerFill:r,unregisterFill:o}=e;const i=jd(t),a=(0,s.useRef)({name:t,children:n});return(0,s.useLayoutEffect)((()=>{const e=a.current;return r(t,e),()=>o(t,e)}),[]),(0,s.useLayoutEffect)((()=>{a.current.children=n,i&&i.forceUpdate()}),[n]),(0,s.useLayoutEffect)((()=>{t!==a.current.name&&(o(a.current.name,a.current),a.current.name=t,r(t,a.current))}),[t]),i&&i.node?("function"==typeof n&&(n=n(i.props.fillProps)),(0,s.createPortal)(n,i.node)):null}var Wd=e=>(0,s.createElement)(Hd.Consumer,null,(t=>{let{registerFill:n,unregisterFill:r}=t;return(0,s.createElement)($d,a({},e,{registerFill:n,unregisterFill:r}))}));function Ud(e){return"function"==typeof e}class Gd extends s.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;this.isUnmounted=!1,e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:n,registerSlot:r}=this.props;e.name!==t&&(n(e.name),r(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){var e;const{children:t,name:n,fillProps:r={},getFills:o}=this.props,i=(null!==(e=o(n,this))&&void 0!==e?e:[]).map((e=>{const t=Ud(e.children)?e.children(r):e.children;return s.Children.map(t,((e,t)=>{if(!e||"string"==typeof e)return e;const n=e.key||t;return(0,s.cloneElement)(e,{key:n})}))})).filter((e=>!(0,s.isEmptyElement)(e)));return(0,s.createElement)(s.Fragment,null,Ud(t)?t(i):i)}}var Yd,qd=e=>(0,s.createElement)(Hd.Consumer,null,(t=>{let{registerSlot:n,unregisterSlot:r,getFills:o}=t;return(0,s.createElement)(Gd,a({},e,{registerSlot:n,unregisterSlot:r,getFills:o}))})),Kd=new Uint8Array(16);function Xd(){if(!Yd&&!(Yd="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Yd(Kd)}var Zd=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var Jd=function(e){return"string"==typeof e&&Zd.test(e)},Qd=[],ef=0;ef<256;++ef)Qd.push((ef+256).toString(16).substr(1));var tf=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Qd[e[t+0]]+Qd[e[t+1]]+Qd[e[t+2]]+Qd[e[t+3]]+"-"+Qd[e[t+4]]+Qd[e[t+5]]+"-"+Qd[e[t+6]]+Qd[e[t+7]]+"-"+Qd[e[t+8]]+Qd[e[t+9]]+"-"+Qd[e[t+10]]+Qd[e[t+11]]+Qd[e[t+12]]+Qd[e[t+13]]+Qd[e[t+14]]+Qd[e[t+15]]).toLowerCase();if(!Jd(n))throw TypeError("Stringified UUID is invalid");return n};var nf=function(e,t,n){var r=(e=e||{}).random||(e.rng||Xd)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return tf(r)};const rf=new Set,of=ac()((e=>{let t=nf().replace(/[0-9]/g,"");for(;rf.has(t);)t=nf().replace(/[0-9]/g,"");return rf.add(t),cu({container:e,key:t})}));var af=function(e){const{children:t,document:n}=e;if(!n)return null;const r=of(n.head);return(0,s.createElement)(Su,{value:r},t)};function sf(){const[,e]=(0,s.useState)({}),t=(0,s.useRef)(!0);return(0,s.useEffect)((()=>(t.current=!0,()=>{t.current=!1})),[]),()=>{t.current&&e({})}}function lf(e){let{name:t,children:n}=e;const{registerFill:r,unregisterFill:o,...i}=Vd(t),a=(0,s.useRef)({rerender:sf()});if((0,s.useEffect)((()=>(r(a),()=>{o(a)})),[r,o]),!i.ref||!i.ref.current)return null;"function"==typeof n&&(n=n(i.fillProps));const l=(0,s.createElement)(af,{document:i.ref.current.ownerDocument},n);return(0,s.createPortal)(l,i.ref.current)}var cf=(0,s.forwardRef)((function(e,t){let{name:n,fillProps:r={},as:o="div",...i}=e;const{registerSlot:l,unregisterSlot:c,...u}=(0,s.useContext)(Fd),f=(0,s.useRef)();return(0,s.useLayoutEffect)((()=>(l(n,f,r),()=>{c(n,f)})),[l,c,n]),(0,s.useLayoutEffect)((()=>{u.updateSlot(n,r)})),(0,s.createElement)(o,a({ref:(0,d.useMergeRefs)([t,f])},i))})),uf=window.wp.isShallowEqual,df=n.n(uf);function ff(e){let{children:t}=e;const n=function(){const e=(0,s.useRef)(Bd()),t=(0,s.useRef)(Bd()),n=(0,s.useCallback)(((t,n,r)=>{const o=e.current.get(t)||{};e.current.set(t,Dd({...o,ref:n||o.ref,fillProps:r||o.fillProps||{}}))}),[]),r=(0,s.useCallback)(((t,n)=>{var r;(null===(r=e.current.get(t))||void 0===r?void 0:r.ref)===n&&e.current.delete(t)}),[]),o=(0,s.useCallback)(((n,r)=>{const o=e.current.get(n);if(o&&!df()(o.fillProps,r)){o.fillProps=r;const e=t.current.get(n);e&&e.map((e=>e.current.rerender()))}}),[]),i=(0,s.useCallback)(((e,n)=>{t.current.set(e,Dd([...t.current.get(e)||[],n]))}),[]),a=(0,s.useCallback)(((e,n)=>{t.current.get(e)&&t.current.set(e,Dd(t.current.get(e).filter((e=>e!==n))))}),[]);return(0,s.useMemo)((()=>({slots:e.current,fills:t.current,registerSlot:n,updateSlot:o,unregisterSlot:r,registerFill:i,unregisterFill:a})),[n,o,r,i,a])}();return(0,s.createElement)(Fd.Provider,{value:n},t)}class pf extends s.Component{constructor(){super(...arguments),this.registerSlot=this.registerSlot.bind(this),this.registerFill=this.registerFill.bind(this),this.unregisterSlot=this.unregisterSlot.bind(this),this.unregisterFill=this.unregisterFill.bind(this),this.getSlot=this.getSlot.bind(this),this.getFills=this.getFills.bind(this),this.hasFills=this.hasFills.bind(this),this.subscribe=this.subscribe.bind(this),this.slots={},this.fills={},this.listeners=[],this.contextValue={registerSlot:this.registerSlot,unregisterSlot:this.unregisterSlot,registerFill:this.registerFill,unregisterFill:this.unregisterFill,getSlot:this.getSlot,getFills:this.getFills,hasFills:this.hasFills,subscribe:this.subscribe}}registerSlot(e,t){const n=this.slots[e];this.slots[e]=t,this.triggerListeners(),this.forceUpdateSlot(e),n&&n.forceUpdate()}registerFill(e,t){this.fills[e]=[...this.fills[e]||[],t],this.forceUpdateSlot(e)}unregisterSlot(e,t){this.slots[e]===t&&(delete this.slots[e],this.triggerListeners())}unregisterFill(e,t){var n,r;this.fills[e]=null!==(n=null===(r=this.fills[e])||void 0===r?void 0:r.filter((e=>e!==t)))&&void 0!==n?n:[],this.forceUpdateSlot(e)}getSlot(e){return this.slots[e]}getFills(e,t){return this.slots[e]!==t?[]:this.fills[e]}hasFills(e){return this.fills[e]&&!!this.fills[e].length}forceUpdateSlot(e){const t=this.getSlot(e);t&&t.forceUpdate()}triggerListeners(){this.listeners.forEach((e=>e()))}subscribe(e){return this.listeners.push(e),()=>{this.listeners=this.listeners.filter((t=>t!==e))}}render(){return(0,s.createElement)(Hd.Provider,{value:this.contextValue},this.props.children)}}function mf(e){return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Wd,e),(0,s.createElement)(lf,e))}const hf=(0,s.forwardRef)(((e,t)=>{let{bubblesVirtually:n,...r}=e;return n?(0,s.createElement)(cf,a({},r,{ref:t})):(0,s.createElement)(qd,r)}));function gf(e){let{children:t,...n}=e;return(0,s.createElement)(pf,n,(0,s.createElement)(ff,null,t))}function vf(e){const t=t=>(0,s.createElement)(mf,a({name:e},t));t.displayName=e+"Fill";const n=t=>(0,s.createElement)(hf,a({name:e},t));return n.displayName=e+"Slot",n.__unstableName=e,{Fill:t,Slot:n}}const bf={bottom:"bottom",top:"top","middle left":"left","middle right":"right","bottom left":"bottom-end","bottom center":"bottom","bottom right":"bottom-start","top left":"top-end","top center":"top","top right":"top-start","middle left left":"left","middle left right":"left","middle left bottom":"left-end","middle left top":"left-start","middle right left":"right","middle right right":"right","middle right bottom":"right-end","middle right top":"right-start","bottom left left":"bottom-end","bottom left right":"bottom-end","bottom left bottom":"bottom-end","bottom left top":"bottom-end","bottom center left":"bottom","bottom center right":"bottom","bottom center bottom":"bottom","bottom center top":"bottom","bottom right left":"bottom-start","bottom right right":"bottom-start","bottom right bottom":"bottom-start","bottom right top":"bottom-start","top left left":"top-end","top left right":"top-end","top left bottom":"top-end","top left top":"top-end","top center left":"top","top center right":"top","top center bottom":"top","top center top":"top","top right left":"top-start","top right right":"top-start","top right bottom":"top-start","top right top":"top-start",middle:"bottom","middle center":"bottom","middle center bottom":"bottom","middle center left":"bottom","middle center right":"bottom","middle center top":"bottom"},yf=e=>{var t;return null!==(t=bf[e])&&void 0!==t?t:"bottom"},wf={top:{originX:.5,originY:1},"top-start":{originX:0,originY:1},"top-end":{originX:1,originY:1},right:{originX:0,originY:.5},"right-start":{originX:0,originY:0},"right-end":{originX:0,originY:1},bottom:{originX:.5,originY:0},"bottom-start":{originX:0,originY:0},"bottom-end":{originX:1,originY:0},left:{originX:1,originY:.5},"left-start":{originX:1,originY:0},"left-end":{originX:1,originY:1}},xf=e=>{var t;const n=null==e||null===(t=e.defaultView)||void 0===t?void 0:t.frameElement;if(!n)return;const r=n.getBoundingClientRect();return{x:r.left,y:r.top}};function _f(e){return e.split("-")[0]}function Ef(e){return["top","bottom"].includes(_f(e))?"x":"y"}function Cf(e){return"x"===e?"y":"x"}const kf=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{options:e,fn(t){var n;const{x:r,y:o,placement:i,rects:a,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=e,d={x:r,y:o},f=Ef(i),p=Cf(f);let m=d[f],h=d[p];const g="function"==typeof l?l(t):l,v="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g},b={x:0,y:0,...null===(n=s.frameOffset)||void 0===n?void 0:n.amount};if(c){const e="y"===f?"height":"width",t=a.reference[f]-a.floating[e]+v.mainAxis+b[f],n=a.reference[f]+a.reference[e]-v.mainAxis+b[f];mn&&(m=n)}if(u){var y,w,x,_;const e="y"===f?"width":"height",t=["top","left"].includes(_f(i)),n=a.reference[p]-a.floating[e]+(t&&null!==(y=null===(w=s.offset)||void 0===w?void 0:w[p])&&void 0!==y?y:0)+(t?0:v.crossAxis)+b[p],r=a.reference[p]+a.reference[e]+(t?0:null!==(x=null===(_=s.offset)||void 0===_?void 0:_[p])&&void 0!==x?x:0)-(t?v.crossAxis:0)+b[p];hr&&(h=r)}return{[f]:m,[p]:h}}}},Sf="Popover",Tf=()=>(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:"components-popover__triangle",role:"presentation"},(0,s.createElement)(i.Path,{className:"components-popover__triangle-bg",d:"M 0 0 L 50 50 L 100 0"}),(0,s.createElement)(i.Path,{className:"components-popover__triangle-border",d:"M 0 0 L 50 50 L 100 0",vectorEffect:"non-scaling-stroke"})),Nf=(0,s.forwardRef)(((e,t)=>{let{style:n,placement:r,shouldAnimate:o=!1,...i}=e;const[l,c]=(0,s.useState)(!1),u=function(){!zt.current&&Bt();const[e]=(0,b.useState)(Lt.current);return e}(),{style:d,...f}=(0,s.useMemo)((()=>(e=>{const t=e.startsWith("top")||e.startsWith("bottom")?"translateY":"translateX",n=e.startsWith("top")||e.startsWith("left")?1:-1;return{style:wf[e],initial:{opacity:0,scale:0,[t]:2*n+"em"},animate:{opacity:1,scale:1,[t]:0},transition:{duration:.1,ease:[0,0,.2,1]}}})(r)),[r]),p=(0,s.useCallback)((()=>c(!0)),[]),m=o&&!u?{style:{...d,...n},...f,onAnimationComplete:p,animate:!l&&f.animate}:{animate:!1,style:n};return(0,s.createElement)(Ul.div,a({},m,i,{ref:t}))})),Rf=(0,s.createContext)(void 0),If=(0,s.forwardRef)(((e,t)=>{var n,r,o,i;const{animate:l=!0,headerTitle:u,onClose:f,children:p,className:m,noArrow:h=!0,position:g,placement:v="bottom-start",offset:b=0,focusOnMount:y="firstElement",anchor:w,expandOnMobile:x,onFocusOutside:_,__unstableSlotName:E=Sf,flip:C=!0,resize:k=!0,shift:S=!1,variant:T,__unstableForcePosition:N,anchorRef:R,anchorRect:I,getAnchorRect:M,isAlternate:P,...O}=e;let D=C,A=k;void 0!==N&&(ql()("`__unstableForcePosition` prop in wp.components.Popover",{since:"6.1",version:"6.3",alternative:"`flip={ false }` and `resize={ false }`"}),D=!N,A=!N),void 0!==R&&ql()("`anchorRef` prop in wp.components.Popover",{since:"6.1",alternative:"`anchor` prop"}),void 0!==I&&ql()("`anchorRect` prop in wp.components.Popover",{since:"6.1",alternative:"`anchor` prop"}),void 0!==M&&ql()("`getAnchorRect` prop in wp.components.Popover",{since:"6.1",alternative:"`anchor` prop"});const L=P?"toolbar":T;void 0!==P&&ql()("`isAlternate` prop in wp.components.Popover",{since:"6.2",alternative:"`variant` prop with the `'toolbar'` value"});const z=(0,s.useRef)(null),[B,F]=(0,s.useState)(null),[V,H]=(0,s.useState)(),j=(0,s.useCallback)((e=>{F(e)}),[]),$=(0,d.useViewportMatch)("medium","<"),W=x&&$,U=!W&&!h,G=g?yf(g):v,Y=(0,s.useRef)(xf(V)),q=[{name:"frameOffset",fn(e){let{x:t,y:n}=e;return Y.current?{x:t+Y.current.x,y:n+Y.current.y,data:{amount:Y.current}}:{x:t,y:n}}},Ye(b),D?Ge():void 0,A?Xe({apply(e){var t;const{firstElementChild:n}=null!==(t=oe.floating.current)&&void 0!==t?t:{};n instanceof HTMLElement&&Object.assign(n.style,{maxHeight:`${e.availableHeight}px`,overflow:"auto"})}}):void 0,S?Ke({crossAxis:!0,limiter:kf(),padding:1}):void 0,Dt({element:z})].filter((e=>void 0!==e)),K=(0,s.useContext)(Rf)||E,X=Vd(K);let Z;(f||_)&&(Z=(e,t)=>{"focus-outside"===e&&_?_(t):f&&f()});const[J,Q]=(0,d.__experimentalUseDialog)({focusOnMount:y,__unstableOnClose:Z,onClose:Z}),{x:ee,y:te,reference:ne,floating:re,refs:oe,strategy:ie,update:ae,placement:se,middlewareData:{arrow:le}}=Ot({placement:G,middleware:q,whileElementsMounted:(e,t,n)=>function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=o&&!s,c=l||i?[...st(e)?Ct(e):e.contextElement?Ct(e.contextElement):[],...Ct(t)]:[];c.forEach((e=>{l&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));let u,d=null;if(a){let r=!0;d=new ResizeObserver((()=>{r||n(),r=!1})),st(e)&&!s&&d.observe(e),st(e)||!e.contextElement||s||d.observe(e.contextElement),d.observe(t)}let f=s?bt(e):null;return s&&function t(){const r=bt(e);!f||r.x===f.x&&r.y===f.y&&r.width===f.width&&r.height===f.height||n(),f=r,u=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{l&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==(e=d)||e.disconnect(),d=null,s&&cancelAnimationFrame(u)}}(e,t,n,{animationFrame:!0})}),ce=(0,s.useCallback)((e=>{z.current=e,ae()}),[ae]),ue=null==R?void 0:R.top,de=null==R?void 0:R.bottom,fe=null==R?void 0:R.startContainer,pe=null==R?void 0:R.current;(0,s.useLayoutEffect)((()=>{const e=(e=>{var t;let n,{anchor:r,anchorRef:o,anchorRect:i,getAnchorRect:a,fallbackReferenceElement:s,fallbackDocument:l}=e;if(r)n=r.ownerDocument;else if(null!=o&&o.top)n=null==o?void 0:o.top.ownerDocument;else if(null!=o&&o.startContainer)n=o.startContainer.ownerDocument;else if(null!=o&&o.current)n=o.current.ownerDocument;else if(o)n=o.ownerDocument;else if(i&&null!=i&&i.ownerDocument)n=i.ownerDocument;else if(a){var c;n=null===(c=a(s))||void 0===c?void 0:c.ownerDocument}return null!==(t=n)&&void 0!==t?t:l})({anchor:w,anchorRef:R,anchorRect:I,getAnchorRect:M,fallbackReferenceElement:B,fallbackDocument:document}),t=(e=>{var t;let{anchor:n,anchorRef:r,anchorRect:o,getAnchorRect:i,fallbackReferenceElement:a}=e,s=null;return n?s=n:null!=r&&r.top?s={getBoundingClientRect(){const e=r.top.getBoundingClientRect(),t=r.bottom.getBoundingClientRect();return new window.DOMRect(e.x,e.y,e.width,t.bottom-e.top)}}:null!=r&&r.current?s=r.current:r?s=r:o?s={getBoundingClientRect(){return o}}:i?s={getBoundingClientRect(){var e,t,n,r;const o=i(a);return new window.DOMRect(null!==(e=o.x)&&void 0!==e?e:o.left,null!==(t=o.y)&&void 0!==t?t:o.top,null!==(n=o.width)&&void 0!==n?n:o.right-o.left,null!==(r=o.height)&&void 0!==r?r:o.bottom-o.top)}}:a&&(s=a.parentElement),null!==(t=s)&&void 0!==t?t:null})({anchor:w,anchorRef:R,anchorRect:I,getAnchorRect:M,fallbackReferenceElement:B});ne(t),H(e)}),[w,R,ue,de,fe,pe,I,M,B,ne]),(0,s.useLayoutEffect)((()=>{var e,t;if(V===document||V===(null===(e=oe.floating.current)||void 0===e?void 0:e.ownerDocument)||null==V||null===(t=V.defaultView)||void 0===t||!t.frameElement)return void(Y.current=void 0);const{defaultView:n}=V,r=()=>{Y.current=xf(V),ae()};return n.addEventListener("resize",r),r(),()=>{n.removeEventListener("resize",r)}}),[V,ae,oe.floating]);const me=(0,d.useMergeRefs)([re,J,t]);let he=(0,s.createElement)(Nf,a({shouldAnimate:l&&!W,placement:se,className:c()("components-popover",m,{"is-expanded":W,"is-positioned":null!==ee&&null!==te,[`is-${"toolbar"===L?"alternate":L}`]:L})},O,{ref:me},Q,{tabIndex:-1,style:W?void 0:{position:ie,top:0,left:0,x:Math.round(null!=ee?ee:0)||void 0,y:Math.round(null!=te?te:0)||void 0}}),W&&(0,s.createElement)(ld,null),W&&(0,s.createElement)("div",{className:"components-popover__header"},(0,s.createElement)("span",{className:"components-popover__header-title"},u),(0,s.createElement)(od,{className:"components-popover__close",icon:Gl,onClick:f})),(0,s.createElement)("div",{className:"components-popover__content"},p),U&&(0,s.createElement)("div",{ref:ce,className:["components-popover__arrow",`is-${se.split("-")[0]}`].join(" "),style:{left:void 0!==(null==le?void 0:le.x)&&Number.isFinite(le.x)?`${le.x+(null!==(n=null===(r=Y.current)||void 0===r?void 0:r.x)&&void 0!==n?n:0)}px`:"",top:void 0!==(null==le?void 0:le.y)&&Number.isFinite(le.y)?`${le.y+(null!==(o=null===(i=Y.current)||void 0===i?void 0:i.y)&&void 0!==o?o:0)}px`:""}},(0,s.createElement)(Tf,null)));return X.ref&&(he=(0,s.createElement)(mf,{name:K},he)),R||I||w?he:(0,s.createElement)("span",{ref:j},he)}));If.Slot=(0,s.forwardRef)((function(e,t){let{name:n=Sf}=e;return(0,s.createElement)(hf,{bubblesVirtually:!0,name:n,className:"popover-slot",ref:t})})),If.__unstableSlotNameProvider=Rf.Provider;var Mf=If;var Pf=function(e){const{shortcut:t,className:n}=e;if(!t)return null;let r,o;return"string"==typeof t&&(r=t),null!==t&&"object"==typeof t&&(r=t.display,o=t.ariaLabel),(0,s.createElement)("span",{className:n,"aria-label":o},r)};const Of=700,Df=(0,s.createElement)("div",{className:"event-catcher"}),Af=e=>{let{eventHandlers:t,child:n,childrenWithPopover:r,mergedRefs:o}=e;return(0,s.cloneElement)((0,s.createElement)("span",{className:"disabled-element-wrapper"},(0,s.cloneElement)(Df,t),(0,s.cloneElement)(n,{children:r,ref:o})),{...t})},Lf=e=>{let{child:t,eventHandlers:n,childrenWithPopover:r,mergedRefs:o}=e;return(0,s.cloneElement)(t,{...n,children:r,ref:o})},zf=(e,t,n)=>{if(1!==s.Children.count(e))return;const r=s.Children.only(e);r.props.disabled||"function"==typeof r.props[t]&&r.props[t](n)};var Bf=function(e){var t;const{children:n,position:r="bottom middle",text:o,shortcut:i,delay:l=Of,...u}=e,[f,p]=(0,s.useState)(!1),[m,h]=(0,s.useState)(!1),g=(0,d.useDebounce)(h,l),[v,b]=(0,s.useState)(null),y=null===(t=s.Children.toArray(n)[0])||void 0===t?void 0:t.ref,w=(0,d.useMergeRefs)([b,y]),x=e=>{"OPTION"!==e.target.tagName&&(zf(n,"onMouseDown",e),document.addEventListener("mouseup",C),p(!0))},_=e=>{"OPTION"!==e.target.tagName&&(zf(n,"onMouseUp",e),document.removeEventListener("mouseup",C),p(!1))},E=e=>"mouseUp"===e?_:"mouseDown"===e?x:void 0,C=E("mouseUp"),k=(e,t)=>r=>{if(zf(n,e,r),r.currentTarget.disabled)return;if("focus"===r.type&&f)return;g.cancel();const o=["focus","mouseenter"].includes(r.type);o!==m&&(t?g(o):h(o))},S=()=>{g.cancel(),document.removeEventListener("mouseup",C)};if((0,s.useEffect)((()=>S),[]),1!==s.Children.count(n))return n;const T={onMouseEnter:k("onMouseEnter",!0),onMouseLeave:k("onMouseLeave"),onClick:k("onClick"),onFocus:k("onFocus"),onBlur:k("onBlur"),onMouseDown:E("mouseDown")},N=s.Children.only(n),{children:R,disabled:I}=N.props,M=I?Af:Lf,P=(e=>{let{anchor:t,grandchildren:n,isOver:r,offset:o,position:i,shortcut:l,text:u,className:d,...f}=e;return(0,s.concatChildren)(n,r&&(0,s.createElement)(Mf,a({focusOnMount:!1,position:i,className:c()("components-tooltip",d),"aria-hidden":"true",animate:!1,offset:o,anchor:t,shift:!0},f),u,(0,s.createElement)(Pf,{className:"components-tooltip__shortcut",shortcut:l})))})({grandchildren:R,...{anchor:v,isOver:m,offset:4,position:r,shortcut:i,text:o},...u});return M({child:N,eventHandlers:T,childrenWithPopover:P,mergedRefs:w})};const Ff=[["top left","top center","top right"],["center left","center center","center right"],["bottom left","bottom center","bottom right"]],Vf={"top left":(0,u.__)("Top Left"),"top center":(0,u.__)("Top Center"),"top right":(0,u.__)("Top Right"),"center left":(0,u.__)("Center Left"),"center center":(0,u.__)("Center"),center:(0,u.__)("Center"),"center right":(0,u.__)("Center Right"),"bottom left":(0,u.__)("Bottom Left"),"bottom center":(0,u.__)("Bottom Center"),"bottom right":(0,u.__)("Bottom Right")},Hf=Ff.flat();function jf(e){return("center"===e?"center center":e).replace("-"," ")}function $f(e,t){return`${e}-${jf(t).replace(" ","-")}`}n(1281);function Wf(){for(var e=arguments.length,t=new Array(e),n=0;n0:"number"==typeof e},Yf=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},qf=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Kf=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Xf=function(e){return{r:qf(e.r,0,255),g:qf(e.g,0,255),b:qf(e.b,0,255),a:qf(e.a)}},Zf=function(e){return{r:Yf(e.r),g:Yf(e.g),b:Yf(e.b),a:Yf(e.a,3)}},Jf=/^#([0-9a-f]{3,8})$/i,Qf=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},ep=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),a=i-Math.min(t,n,r),s=a?i===t?(n-r)/a:i===n?2+(r-t)/a:4+(t-n)/a:0;return{h:60*(s<0?s+6:s),s:i?a/i*100:0,v:i/255*100,a:o}},tp=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),a=r*(1-n),s=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:255*[r,s,a,a,l,r][c],g:255*[l,r,r,s,a,a][c],b:255*[a,a,l,r,r,s][c],a:o}},np=function(e){return{h:Kf(e.h),s:qf(e.s,0,100),l:qf(e.l,0,100),a:qf(e.a)}},rp=function(e){return{h:Yf(e.h),s:Yf(e.s),l:Yf(e.l),a:Yf(e.a,3)}},op=function(e){return tp((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},ip=function(e){return{h:(t=ep(e)).h,s:(o=(200-(n=t.s))*(r=t.v)/100)>0&&o<200?n*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,n,r,o},ap=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,sp=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,lp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,cp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,up={string:[[function(e){var t=Jf.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?Yf(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?Yf(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=lp.exec(e)||cp.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Xf({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=ap.exec(e)||sp.exec(e);if(!t)return null;var n,r,o=np({h:(n=t[1],r=t[2],void 0===r&&(r="deg"),Number(n)*(Uf[r]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return op(o)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=void 0===o?1:o;return Gf(t)&&Gf(n)&&Gf(r)?Xf({r:Number(t),g:Number(n),b:Number(r),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,o=e.a,i=void 0===o?1:o;if(!Gf(t)||!Gf(n)||!Gf(r))return null;var a=np({h:Number(t),s:Number(n),l:Number(r),a:Number(i)});return op(a)},"hsl"],[function(e){var t=e.h,n=e.s,r=e.v,o=e.a,i=void 0===o?1:o;if(!Gf(t)||!Gf(n)||!Gf(r))return null;var a=function(e){return{h:Kf(e.h),s:qf(e.s,0,100),v:qf(e.v,0,100),a:qf(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(i)});return tp(a)},"hsv"]]},dp=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=Zf(this.rgba)).r,n=e.g,r=e.b,i=(o=e.a)<1?Qf(Yf(255*o)):"","#"+Qf(t)+Qf(n)+Qf(r)+i;var e,t,n,r,o,i},e.prototype.toRgb=function(){return Zf(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Zf(this.rgba)).r,n=e.g,r=e.b,(o=e.a)<1?"rgba("+t+", "+n+", "+r+", "+o+")":"rgb("+t+", "+n+", "+r+")";var e,t,n,r,o},e.prototype.toHsl=function(){return rp(ip(this.rgba))},e.prototype.toHslString=function(){return t=(e=rp(ip(this.rgba))).h,n=e.s,r=e.l,(o=e.a)<1?"hsla("+t+", "+n+"%, "+r+"%, "+o+")":"hsl("+t+", "+n+"%, "+r+"%)";var e,t,n,r,o},e.prototype.toHsv=function(){return e=ep(this.rgba),{h:Yf(e.h),s:Yf(e.s),v:Yf(e.v),a:Yf(e.a,3)};var e},e.prototype.invert=function(){return vp({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),vp(pp(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),vp(pp(this.rgba,-e))},e.prototype.grayscale=function(){return vp(pp(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),vp(hp(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),vp(hp(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?vp({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Yf(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=ip(this.rgba);return"number"==typeof e?vp({h:e,s:t.s,l:t.l,a:t.a}):Yf(t.h)},e.prototype.isEqual=function(e){return this.toHex()===vp(e).toHex()},e}(),vp=function(e){return e instanceof gp?e:new gp(e)},bp=[],yp=function(e){e.forEach((function(e){bp.indexOf(e)<0&&(e(gp,up),bp.push(e))}))};function wp(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var o in n)r[n[o]]=o;var i={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,a,s=r[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var l=this.toRgb(),c=1/0,u="black";if(!i.length)for(var d in n)i[d]=new e(n[d]).toRgb();for(var f in n){var p=(o=l,a=i[f],Math.pow(o.r-a.r,2)+Math.pow(o.g-a.g,2)+Math.pow(o.b-a.b,2));p0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return vp(e).alpha(t).toRgbString()}yp([wp]);const _p="#fff",Ep={900:"#1e1e1e",800:"#2f2f2f",700:"#757575",600:"#949494",400:"#ccc",300:"#ddd",200:"#e0e0e0",100:"#f0f0f0"},Cp="var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #006ba1))",kp={theme:"var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba))",themeDark10:Cp,background:_p,backgroundDisabled:Ep[100],border:Ep[600],borderHover:Ep[700],borderFocus:Cp,borderDisabled:Ep[400],textDisabled:Ep[600],textDark:_p,darkGrayPlaceholder:xp(Ep[900],.62),lightGrayPlaceholder:xp(_p,.65)},Sp=Object.freeze({gray:Ep,white:_p,alert:{yellow:"#f0b849",red:"#d94f4f",green:"#4ab866"},ui:kp});function Tp(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transition";switch(t){case"transition":e="transition-duration: 0ms;";break;case"animation":e="animation-duration: 1ms;";break;default:e="\n\t\t\t\tanimation-duration: 1ms;\n\t\t\t\ttransition-duration: 0ms;\n\t\t\t"}return`\n\t\t@media ( prefers-reduced-motion: reduce ) {\n\t\t\t${e};\n\t\t}\n\t`}var Np={name:"93uojk",styles:"border-radius:2px;box-sizing:border-box;direction:ltr;display:grid;grid-template-columns:repeat( 3, 1fr );outline:none"};const Rp=()=>Np,Ip=Ju("div",{target:"ecapk1j3"})(Rp,";border:1px solid transparent;cursor:pointer;grid-template-columns:auto;",(e=>{let{size:t=92}=e;return Wf("grid-template-rows:repeat( 3, calc( ",t,"px / 3 ) );width:",t,"px;","")}),";"),Mp=Ju("div",{target:"ecapk1j2"})({name:"1x5gbbj",styles:"box-sizing:border-box;display:grid;grid-template-columns:repeat( 3, 1fr )"}),Pp=e=>Wf("background:currentColor;box-sizing:border-box;display:grid;margin:auto;transition:all 120ms linear;",Tp("transition")," ",(e=>{let{isActive:t}=e;return Wf("box-shadow:",t?`0 0 0 2px ${Sp.gray[900]}`:null,";color:",t?Sp.gray[900]:Sp.gray[400],";*:hover>&{color:",t?Sp.gray[900]:Sp.ui.theme,";}","")})(e),";",""),Op=Ju("span",{target:"ecapk1j1"})("height:6px;width:6px;",Pp,";"),Dp=Ju("span",{target:"ecapk1j0"})({name:"rjf3ub",styles:"appearance:none;border:none;box-sizing:border-box;margin:0;display:flex;position:relative;outline:none;align-items:center;justify-content:center;padding:0"});function Ap(e){let{isActive:t=!1,value:n,...r}=e;const o=Vf[n];return(0,s.createElement)(Bf,{text:o},(0,s.createElement)(Se,a({as:Dp,role:"gridcell"},r),(0,s.createElement)(td,null,n),(0,s.createElement)(Op,{isActive:t,role:"presentation"})))}function Lp(e){return(0,b.useState)(e)[0]}function zp(e){for(var t,n=[[]],r=function(){var e=t.value,r=n.find((function(t){return!t[0]||t[0].groupId===e.groupId}));r?r.push(e):n.push([e])},o=v(e);!(t=o()).done;)r();return n}function Bp(e){for(var t,n=[],r=v(e);!(t=r()).done;){var o=t.value;n.push.apply(n,o)}return n}function Fp(e){return e.slice().reverse()}function Vp(e,t){if(t)return null==e?void 0:e.find((function(e){return e.id===t&&!e.disabled}))}function Hp(e,t){return function(e){return"function"==typeof e}(e)?e(t):e}function jp(e){void 0===e&&(e={});var t=Lp(e).baseId,n=(0,b.useContext)(we),r=(0,b.useRef)(0),o=(0,b.useState)((function(){return t||n()}));return{baseId:o[0],setBaseId:o[1],unstable_idCountRef:r}}function $p(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Wp(e,t){return e.findIndex((function(e){return!(!e.ref.current||!t.ref.current)&&$p(t.ref.current,e.ref.current)}))}function Up(e){for(var t,n=0,r=v(e);!(t=r()).done;){var o=t.value.length;o>n&&(n=o)}return n}function Gp(e){for(var t=zp(e),n=Up(t),r=[],o=0;oi&&(n=!0),-1):(rWf({gridTemplateRows:"repeat( 3, calc( 21px / 3))",padding:1.5,maxHeight:24,maxWidth:24},"","")),";",(e=>{let{disablePointerEvents:t}=e;return Wf({pointerEvents:t?"none":void 0},"","")}),";"),bm=Ju("span",{target:"erowt50"})("height:2px;width:2px;",Pp,";",(e=>{let{isActive:t}=e;return Wf("box-shadow:",t?"0 0 0 1px currentColor":null,";color:currentColor;*:hover>&{color:currentColor;}","")}),";"),ym=Dp,wm=24;var xm=function(e){let{className:t,disablePointerEvents:n=!0,size:r=wm,style:o={},value:i="center",...l}=e;const u=function(){const e=jf(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"center"),t=Hf.indexOf(e);return t>-1?t:void 0}(i),d=(r/wm).toFixed(2),f=c()("component-alignment-matrix-control-icon",t),p={...o,transform:`scale(${d})`};return(0,s.createElement)(vm,a({},l,{className:f,disablePointerEvents:n,role:"presentation",style:p}),Hf.map(((e,t)=>{const n=u===t;return(0,s.createElement)(ym,{key:e},(0,s.createElement)(bm,{isActive:n}))})))};const _m=()=>{};function Em(e){let{className:t,id:n,label:r=(0,u.__)("Alignment Matrix Control"),defaultValue:o="center center",value:i,onChange:l=_m,width:f=92,...p}=e;const[m]=(0,s.useState)(null!=i?i:o),h=function(e){const t=(0,d.useInstanceId)(Em,"alignment-matrix-control");return e||t}(n),g=$f(h,m),v=om({baseId:h,currentId:g,rtl:(0,u.isRTL)()}),{setCurrentId:b}=v;(0,s.useEffect)((()=>{void 0!==i&&b($f(h,i))}),[i,b,h]);const y=c()("component-alignment-matrix-control",t);return(0,s.createElement)(pm,a({},p,v,{"aria-label":r,as:Ip,className:y,role:"grid",size:f}),Ff.map(((e,t)=>(0,s.createElement)(gm,a({},v,{as:Mp,role:"row",key:t}),e.map((e=>{const t=$f(h,e),n=v.currentId===t;return(0,s.createElement)(Ap,a({},v,{id:t,isActive:n,key:e,value:e,onFocus:()=>{l(e)},tabIndex:n?0:-1}))}))))))}Em.Icon=xm;var Cm=Em;function km(e){return"appear"===e?"top":"left"}function Sm(e){if("loading"===e.type)return c()("components-animate__loading");const{type:t,origin:n=km(t)}=e;if("appear"===t){const[e,t="center"]=n.split(" ");return c()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?c()("components-animate__slide-in","is-from-"+n):void 0}function Tm(e){let{type:t,options:n={},children:r}=e;return r({className:Sm({type:t,...n})})}function Nm(){const e=(0,b.useRef)(!1);return jt((()=>(e.current=!0,()=>{e.current=!1})),[]),e}class Rm extends b.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Im({children:e,isPresent:t}){const n=(0,b.useId)(),r=(0,b.useRef)(null),o=(0,b.useRef)({width:0,height:0,top:0,left:0});return(0,b.useInsertionEffect)((()=>{const{width:e,height:i,top:a,left:s}=o.current;if(t||!r.current||!e||!i)return;r.current.dataset.motionPopId=n;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${n}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${i}px !important;\n top: ${a}px !important;\n left: ${s}px !important;\n }\n `),()=>{document.head.removeChild(l)}}),[t]),b.createElement(Rm,{isPresent:t,childRef:r,sizeRef:o},b.cloneElement(e,{ref:r}))}const Mm=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:a})=>{const s=tn(Pm),l=(0,b.useId)(),c=(0,b.useMemo)((()=>({id:l,initial:t,isPresent:n,custom:o,onExitComplete:e=>{s.set(e,!0);for(const e of s.values())if(!e)return;r&&r()},register:e=>(s.set(e,!1),()=>s.delete(e))})),i?void 0:[n]);return(0,b.useMemo)((()=>{s.forEach(((e,t)=>s.set(t,!1)))}),[n]),b.useEffect((()=>{!n&&!s.size&&r&&r()}),[n]),"popLayout"===a&&(e=b.createElement(Im,{isPresent:n},e)),b.createElement(Ht.Provider,{value:c},e)};function Pm(){return new Map}const Om=e=>e.key||"";const Dm=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:o,presenceAffectsLayout:i=!0,mode:a="sync"})=>{o&&(a="wait",Ur(!1,"Replace exitBeforeEnter with mode='wait'"));let[s]=function(){const e=Nm(),[t,n]=(0,b.useState)(0),r=(0,b.useCallback)((()=>{e.current&&n(t+1)}),[t]);return[(0,b.useCallback)((()=>go.postRender(r)),[r]),t]}();const l=(0,b.useContext)(on).forceRender;l&&(s=l);const c=Nm(),u=function(e){const t=[];return b.Children.forEach(e,(e=>{(0,b.isValidElement)(e)&&t.push(e)})),t}(e);let d=u;const f=new Set,p=(0,b.useRef)(d),m=(0,b.useRef)(new Map).current,h=(0,b.useRef)(!0);if(jt((()=>{h.current=!1,function(e,t){e.forEach((e=>{const n=Om(e);t.set(n,e)}))}(u,m),p.current=d})),Vr((()=>{h.current=!0,m.clear(),f.clear()})),h.current)return b.createElement(b.Fragment,null,d.map((e=>b.createElement(Mm,{key:Om(e),isPresent:!0,initial:!!n&&void 0,presenceAffectsLayout:i,mode:a},e))));d=[...d];const g=p.current.map(Om),v=u.map(Om),y=g.length;for(let e=0;e{if(-1!==v.indexOf(e))return;const n=m.get(e);if(!n)return;const o=g.indexOf(e);d.splice(o,0,b.createElement(Mm,{key:Om(n),isPresent:!1,onExitComplete:()=>{m.delete(e),f.delete(e);const t=p.current.findIndex((t=>t.key===e));if(p.current.splice(t,1),!f.size){if(p.current=u,!1===c.current)return;s(),r&&r()}},custom:t,presenceAffectsLayout:i,mode:a},n))})),d=d.map((e=>{const t=e.key;return f.has(t)?e:b.createElement(Mm,{key:Om(e),isPresent:!0,presenceAffectsLayout:i,mode:a},e)})),"production"!==$r&&"wait"===a&&d.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.'),b.createElement(b.Fragment,null,f.size?d:d.map((e=>(0,b.cloneElement)(e))))},Am=(0,s.createContext)({flexItemDisplay:void 0});const Lm={name:"zjik7",styles:"display:flex"},zm={name:"qgaee5",styles:"display:block;max-height:100%;max-width:100%;min-height:0;min-width:0"},Bm={name:"82a6rk",styles:"flex:1"},Fm={name:"13nosa1",styles:">*{min-height:0;}"},Vm={name:"1pwxzk4",styles:">*{min-width:0;}"};function Hm(e){const{className:t,display:n,isBlock:r=!1,...o}=Vu(e,"FlexItem"),i={},a=(0,s.useContext)(Am).flexItemDisplay;i.Base=Wf({display:n||a},"","");return{...o,className:Fu()(zm,i.Base,r&&Bm,t)}}var jm=Hu((function(e,t){const n=function(e){return Hm({isBlock:!0,...Vu(e,"FlexBlock")})}(e);return(0,s.createElement)(ed,a({},n,{ref:t}))}),"FlexBlock");var $m=Hu((function(e,t){const n=Hm(e);return(0,s.createElement)(ed,a({},n,{ref:t}))}),"FlexItem");var Wm=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));var Um=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M7 11.5h10V13H7z"}));const Gm=["40em","52em","64em"],Ym=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{defaultIndex:t=0}=e;if("number"!=typeof t)throw new TypeError(`Default breakpoint index should be a number. Got: ${t}, ${typeof t}`);if(t<0||t>Gm.length-1)throw new RangeError(`Default breakpoint index out of range. Theme has ${Gm.length} breakpoints, got index ${t}`);const[n,r]=(0,s.useState)(t);return(0,s.useEffect)((()=>{const e=()=>{const e=Gm.filter((e=>"undefined"!=typeof window&&window.matchMedia(`screen and (min-width: ${e})`).matches)).length;n!==e&&r(e)};return e(),"undefined"!=typeof window&&window.addEventListener("resize",e),()=>{"undefined"!=typeof window&&window.removeEventListener("resize",e)}}),[n]),n};function qm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=Ym(t);if(!Array.isArray(e)&&"function"!=typeof e)return e;const r=e||[];return r[n>=r.length?r.length-1:n]}function Km(e){var t,n;if(void 0===e)return;if(!e)return"0";const r="number"==typeof e?e:Number(e);return"undefined"!=typeof window&&null!==(t=window.CSS)&&void 0!==t&&null!==(n=t.supports)&&void 0!==n&&n.call(t,"margin",e.toString())||Number.isNaN(r)?e.toString():`calc(4px * ${e})`}function Xm(e){const{align:t="center",className:n,direction:r="row",expanded:o=!0,gap:i=2,justify:a="space-between",wrap:l=!1,...c}=Vu(function(e){const{isReversed:t,...n}=e;return void 0!==t?(ql()("Flex isReversed",{alternative:'Flex direction="row-reverse" or "column-reverse"',since:"5.9"}),{...n,direction:t?"row-reverse":"row"}):n}(e),"Flex"),u=qm(Array.isArray(r)?r:[r]),d="string"==typeof u&&!!u.includes("column"),f=Fu();return{...c,className:(0,s.useMemo)((()=>{const e=Wf({alignItems:d?"normal":t,flexDirection:u,flexWrap:l?"wrap":void 0,gap:Km(i),justifyContent:a,height:d&&o?"100%":void 0,width:!d&&o?"100%":void 0},"","");return f(Lm,e,d?Fm:Vm,n)}),[t,n,f,u,o,i,d,a,l]),isColumn:d}}var Zm=Hu((function(e,t){const{children:n,isColumn:r,...o}=Xm(e);return(0,s.createElement)(Am.Provider,{value:{flexItemDisplay:r?"block":void 0}},(0,s.createElement)(ed,a({},o,{ref:t}),n))}),"Flex");const Jm={name:"hdknak",styles:"display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"};function Qm(e){return null!=e}function eh(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;return null!==(e=t.find(Qm))&&void 0!==e?e:n}const th=e=>"string"==typeof e?(e=>parseFloat(e))(e):e,nh="…",rh={auto:"auto",head:"head",middle:"middle",tail:"tail",none:"none"},oh={ellipsis:nh,ellipsizeMode:rh.auto,limit:0,numberOfLines:0};function ih(e,t,n,r){if("string"!=typeof e)return"";const o=e.length,i=~~t,a=~~n,s=Qm(r)?r:nh;return 0===i&&0===a||i>=o||a>=o||i+a>=o?e:0===a?e.slice(0,i)+s:e.slice(0,i)+s+e.slice(o-a)}function ah(e){const{className:t,children:n,ellipsis:r=nh,ellipsizeMode:o=rh.auto,limit:i=0,numberOfLines:a=0,...l}=Vu(e,"Truncate"),c=Fu(),u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;const n={...oh,...t},{ellipsis:r,ellipsizeMode:o,limit:i}=n;if(o===rh.none)return e;let a,s;switch(o){case rh.head:a=0,s=i;break;case rh.middle:a=Math.floor(i/2),s=Math.floor(i/2);break;default:a=i,s=0}return o!==rh.auto?ih(e,a,s,r):e}("string"==typeof n?n:"",{ellipsis:r,ellipsizeMode:o,limit:i,numberOfLines:a}),d=o===rh.auto;return{...l,className:(0,s.useMemo)((()=>c(d&&!a&&Jm,d&&!!a&&Wf("-webkit-box-orient:vertical;-webkit-line-clamp:",a,";display:-webkit-box;overflow:hidden;",""),t)),[t,c,a,d]),children:u}}let sh;yp([wp]);const lh=ac()((function(e){var t,n;if("string"!=typeof e)return"";if("string"==typeof(n=e)&&vp(n).isValid())return e;if(!e.includes("var("))return"";if("undefined"==typeof document)return"";const r=function(){if("undefined"!=typeof document){if(!sh){const e=document.createElement("div");e.setAttribute("data-g2-color-computation-node",""),document.body.appendChild(e),sh=e}return sh}}();if(!r)return"";r.style.background=e;const o=null===(t=window)||void 0===t?void 0:t.getComputedStyle(r).background;return r.style.background="",o||""}));function ch(e){const t=function(e){const t=lh(e);return vp(t).isLight()?"#000000":"#ffffff"}(e);return"#000000"===t?"dark":"light"}const uh="36px",dh="12px",fh={controlSurfaceColor:Sp.white,controlTextActiveColor:Sp.ui.theme,controlPaddingX:dh,controlPaddingXLarge:"calc(12px * 1.3334)",controlPaddingXSmall:"calc(12px / 1.3334)",controlBackgroundColor:Sp.white,controlBorderRadius:"2px",controlBoxShadow:"transparent",controlBoxShadowFocus:`0 0 0 0.5px ${Sp.ui.theme}`,controlDestructiveBorderColor:Sp.alert.red,controlHeight:uh,controlHeightXSmall:"calc( 36px * 0.6 )",controlHeightSmall:"calc( 36px * 0.8 )",controlHeightLarge:"calc( 36px * 1.2 )",controlHeightXLarge:"calc( 36px * 1.4 )"},ph={toggleGroupControlBackgroundColor:fh.controlBackgroundColor,toggleGroupControlBorderColor:Sp.ui.border,toggleGroupControlBackdropBackgroundColor:fh.controlSurfaceColor,toggleGroupControlBackdropBorderColor:Sp.ui.border,toggleGroupControlButtonColorActive:fh.controlBackgroundColor};var mh=Object.assign({},fh,ph,{colorDivider:"rgba(0, 0, 0, 0.1)",colorScrollbarThumb:"rgba(0, 0, 0, 0.2)",colorScrollbarThumbHover:"rgba(0, 0, 0, 0.5)",colorScrollbarTrack:"rgba(0, 0, 0, 0.04)",elevationIntensity:1,radiusBlockUi:"2px",borderWidth:"1px",borderWidthFocus:"1.5px",borderWidthTab:"4px",spinnerSize:16,fontSize:"13px",fontSizeH1:"calc(2.44 * 13px)",fontSizeH2:"calc(1.95 * 13px)",fontSizeH3:"calc(1.56 * 13px)",fontSizeH4:"calc(1.25 * 13px)",fontSizeH5:"13px",fontSizeH6:"calc(0.8 * 13px)",fontSizeInputMobile:"16px",fontSizeMobile:"15px",fontSizeSmall:"calc(0.92 * 13px)",fontSizeXSmall:"calc(0.75 * 13px)",fontLineHeightBase:"1.2",fontWeight:"normal",fontWeightHeading:"600",gridBase:"4px",cardBorderRadius:"2px",cardPaddingXSmall:`${Km(2)}`,cardPaddingSmall:`${Km(4)}`,cardPaddingMedium:`${Km(4)} ${Km(6)}`,cardPaddingLarge:`${Km(6)} ${Km(8)}`,surfaceBackgroundColor:Sp.white,surfaceBackgroundSubtleColor:"#F3F3F3",surfaceBackgroundTintColor:"#F5F5F5",surfaceBorderColor:"rgba(0, 0, 0, 0.1)",surfaceBorderBoldColor:"rgba(0, 0, 0, 0.15)",surfaceBorderSubtleColor:"rgba(0, 0, 0, 0.05)",surfaceBackgroundTertiaryColor:Sp.white,surfaceColor:Sp.white,transitionDuration:"200ms",transitionDurationFast:"160ms",transitionDurationFaster:"120ms",transitionDurationFastest:"100ms",transitionTimingFunction:"cubic-bezier(0.08, 0.52, 0.52, 1)",transitionTimingFunctionControl:"cubic-bezier(0.12, 0.8, 0.32, 1)"});const hh=Wf("color:",Sp.gray[900],";line-height:",mh.fontLineHeightBase,";margin:0;",""),gh={name:"4zleql",styles:"display:block"},vh=Wf("color:",Sp.alert.green,";",""),bh=Wf("color:",Sp.alert.red,";",""),yh=Wf("color:",Sp.gray[700],";",""),wh=Wf("mark{background:",Sp.alert.yellow,";border-radius:2px;box-shadow:0 0 0 1px rgba( 0, 0, 0, 0.05 ) inset,0 -1px 0 rgba( 0, 0, 0, 0.1 ) inset;}",""),xh={name:"50zrmy",styles:"text-transform:uppercase"};var _h=n(3138);const Eh=ac()((e=>{const t={};for(const n in e)t[n.toLowerCase()]=e[n];return t}));const Ch={body:13,caption:10,footnote:11,largeTitle:28,subheadline:12,title:20},kh=[1,2,3,4,5,6].flatMap((e=>[e,e.toString()]));function Sh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:13;if(e in Ch)return Sh(Ch[e]);if("number"!=typeof e){const t=parseFloat(e);if(Number.isNaN(t))return e;e=t}const t=`(${e} / 13)`;return`calc(${t} * ${mh.fontSize})`}function Th(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(!kh.includes(e))return Sh(e);const t=`fontSizeH${e}`;return mh[t]}var Nh={name:"50zrmy",styles:"text-transform:uppercase"};function Rh(t){const{adjustLineHeightForInnerControls:n,align:r,children:o,className:i,color:a,ellipsizeMode:l,isDestructive:c=!1,display:u,highlightEscape:d=!1,highlightCaseSensitive:f=!1,highlightWords:p,highlightSanitize:m,isBlock:h=!1,letterSpacing:g,lineHeight:v,optimizeReadabilityFor:b,size:y,truncate:w=!1,upperCase:x=!1,variant:_,weight:E=mh.fontWeight,...C}=Vu(t,"Text");let k=o;const S=Array.isArray(p),T="caption"===y;if(S){if("string"!=typeof o)throw new TypeError("`children` of `Text` must only be `string` types when `highlightWords` is defined");k=function(e){let{activeClassName:t="",activeIndex:n=-1,activeStyle:r,autoEscape:o,caseSensitive:i=!1,children:a,findChunks:l,highlightClassName:c="",highlightStyle:u={},highlightTag:d="mark",sanitize:f,searchWords:p=[],unhighlightClassName:m="",unhighlightStyle:h}=e;if(!a)return null;if("string"!=typeof a)return a;const g=a,v=(0,_h.findAll)({autoEscape:o,caseSensitive:i,findChunks:l,sanitize:f,searchWords:p,textToHighlight:g}),b=d;let y,w=-1,x="";const _=v.map(((e,o)=>{const a=g.substr(e.start,e.end-e.start);if(e.highlight){let e;w++,"object"==typeof c?i?e=c[a]:(c=Eh(c),e=c[a.toLowerCase()]):e=c;const l=w===+n;x=`${e} ${l?t:""}`,y=!0===l&&null!==r?Object.assign({},u,r):u;const d={children:a,className:x,key:o,style:y};return"string"!=typeof b&&(d.highlightIndex=w),(0,s.createElement)(b,d)}return(0,s.createElement)("span",{children:a,className:m,key:o,style:h})}));return _}({autoEscape:d,children:o,caseSensitive:f,searchWords:p,sanitize:m})}const N=Fu();let R;!0===w&&(R="auto"),!1===w&&(R="none");const I=ah({...C,className:(0,s.useMemo)((()=>{const t={},o=function(e,t){if(t)return t;if(!e)return;let n=`calc(${mh.controlHeight} + ${Km(2)})`;switch(e){case"large":n=`calc(${mh.controlHeightLarge} + ${Km(2)})`;break;case"small":n=`calc(${mh.controlHeightSmall} + ${Km(2)})`;break;case"xSmall":n=`calc(${mh.controlHeightXSmall} + ${Km(2)})`}return n}(n,v);if(t.Base=Wf({color:a,display:u,fontSize:Sh(y),fontWeight:E,lineHeight:o,letterSpacing:g,textAlign:r},"",""),t.upperCase=Nh,t.optimalTextColor=null,b){const e="dark"===ch(b);t.optimalTextColor=Wf(e?{color:Sp.gray[900]}:{color:Sp.white},"","")}return N(hh,t.Base,t.optimalTextColor,c&&bh,!!S&&wh,h&&gh,T&&yh,_&&e[_],x&&t.upperCase,i)}),[n,r,i,a,N,u,h,T,c,S,g,v,b,y,x,_,E]),children:o,ellipsizeMode:l||R});return!w&&Array.isArray(o)&&(k=s.Children.map(o,(e=>{if("object"!=typeof e||null===e||!("props"in e))return e;return Wu(e,["Link"])?(0,s.cloneElement)(e,{size:e.props.size||"inherit"}):e}))),{...I,children:w?I.children:k}}var Ih=Hu((function(e,t){const n=Rh(e);return(0,s.createElement)(ed,a({as:"span"},n,{ref:t}))}),"Text");const Mh={name:"9amh4a",styles:"font-size:11px;font-weight:500;line-height:1.4;text-transform:uppercase"},Ph=new RegExp(/-left/g),Oh=new RegExp(/-right/g),Dh=new RegExp(/Left/g),Ah=new RegExp(/Right/g);function Lh(e){return"left"===e?"right":"right"===e?"left":Ph.test(e)?e.replace(Ph,"-right"):Oh.test(e)?e.replace(Oh,"-left"):Dh.test(e)?e.replace(Dh,"Right"):Ah.test(e)?e.replace(Ah,"Left"):e}const zh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.fromEntries(Object.entries(e).map((e=>{let[t,n]=e;return[Lh(t),n]})))};function Bh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return()=>t?(0,u.isRTL)()?Wf(t,""):Wf(e,""):(0,u.isRTL)()?Wf(zh(e),""):Wf(e,"")}Bh.watch=()=>(0,u.isRTL)();var Fh={name:"1739oy8",styles:"z-index:1"};const Vh=e=>{let{isFocused:t}=e;return t?Fh:""},Hh=Ju(Zm,{target:"em5sgkm7"})("box-sizing:border-box;position:relative;border-radius:2px;padding-top:0;",Vh,";");var jh={name:"1d3w5wq",styles:"width:100%"};const $h=Ju("div",{target:"em5sgkm6"})("align-items:center;box-sizing:border-box;border-radius:inherit;display:flex;flex:1;position:relative;",(e=>{let{disabled:t}=e;return Wf({backgroundColor:t?Sp.ui.backgroundDisabled:Sp.ui.background},"","")})," ",(e=>{let{__unstableInputWidth:t,labelPosition:n}=e;return t?"side"===n?"":Wf("edge"===n?{flex:`0 0 ${t}`}:{width:t},"",""):jh}),";"),Wh=e=>{let{inputSize:t,__next36pxDefaultSize:n}=e;const r={default:{height:36,lineHeight:1,minHeight:36,paddingLeft:Km(4),paddingRight:Km(4)},small:{height:24,lineHeight:1,minHeight:24,paddingLeft:Km(2),paddingRight:Km(2)},"__unstable-large":{height:40,lineHeight:1,minHeight:40,paddingLeft:Km(4),paddingRight:Km(4)}};return n||(r.default={height:30,lineHeight:1,minHeight:30,paddingLeft:Km(2),paddingRight:Km(2)}),r[t]||r.default},Uh=Ju("input",{target:"em5sgkm5"})("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:",Sp.gray[900],";display:block;font-family:inherit;margin:0;outline:none;width:100%;",(e=>{let t,n,{isDragging:r,dragCursor:o}=e;return r&&(t=Wf("cursor:",o,";user-select:none;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}","")),r&&o&&(n=Wf("&:active{cursor:",o,";}","")),Wf(t," ",n,";","")})," ",(e=>{let{disabled:t}=e;return t?Wf({color:Sp.ui.textDisabled},"",""):""})," ",(e=>{let{inputSize:t}=e;const n={default:"13px",small:"11px","__unstable-large":"13px"},r=n[t]||n.default;return r?Wf("font-size:","16px",";@media ( min-width: 600px ){font-size:",r,";}",""):""})," ",(e=>Wf(Wh(e),"",""))," ",(e=>{let{paddingInlineStart:t,paddingInlineEnd:n}=e;return Wf({paddingInlineStart:t,paddingInlineEnd:n},"","")})," &::-webkit-input-placeholder{line-height:normal;}}"),Gh=Ju(Ih,{target:"em5sgkm4"})("&&&{",Mh,";box-sizing:border-box;display:block;padding-top:0;padding-bottom:0;max-width:100%;z-index:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}"),Yh=e=>(0,s.createElement)(Gh,a({},e,{as:"label"})),qh=Ju($m,{target:"em5sgkm3"})({name:"1b6uupn",styles:"max-width:calc( 100% - 10px )"}),Kh=Ju("div",{target:"em5sgkm2"})("&&&{box-sizing:border-box;border-radius:inherit;bottom:0;left:0;margin:0;padding:0;pointer-events:none;position:absolute;right:0;top:0;",(e=>{let t,{disabled:n,isFocused:r}=e,o=r?Sp.ui.borderFocus:Sp.ui.border;return r&&(t=`0 0 0 1px ${Sp.ui.borderFocus} inset`),n&&(o=Sp.ui.borderDisabled),Wf({boxShadow:t,borderColor:o,borderStyle:"solid",borderWidth:1},"","")})," ",Bh({paddingLeft:2}),";}"),Xh=Ju("span",{target:"em5sgkm1"})({name:"pvvbxf",styles:"box-sizing:border-box;display:block"}),Zh=Ju("span",{target:"em5sgkm0"})({name:"jgf79h",styles:"align-items:center;align-self:stretch;box-sizing:border-box;display:flex"});const Jh=(0,s.memo)((function(e){let{disabled:t=!1,isFocused:n=!1}=e;return(0,s.createElement)(Kh,{"aria-hidden":"true",className:"components-input-control__backdrop",disabled:t,isFocused:n})}));var Qh=Jh;function eg(e){let{children:t,hideLabelFromVision:n,htmlFor:r,...o}=e;return t?n?(0,s.createElement)(td,{as:"label",htmlFor:r},t):(0,s.createElement)(qh,null,(0,s.createElement)(Yh,a({htmlFor:r},o),t)):null}function tg(e,t){let{__next36pxDefaultSize:n,__unstableInputWidth:r,children:o,className:i,disabled:l=!1,hideLabelFromVision:c=!1,labelPosition:u,id:f,isFocused:p=!1,label:m,prefix:h,size:g="default",suffix:v,...b}=e;const y=function(e){const t=(0,d.useInstanceId)(tg);return e||`input-base-control-${t}`}(f),w=c||!m,{paddingLeft:x,paddingRight:_}=Wh({inputSize:g,__next36pxDefaultSize:n}),E=(0,s.useMemo)((()=>({InputControlPrefixWrapper:{paddingLeft:x},InputControlSuffixWrapper:{paddingRight:_}})),[x,_]);return(0,s.createElement)(Hh,a({},b,function(e){const t={};switch(e){case"top":t.direction="column",t.expanded=!1,t.gap=0;break;case"bottom":t.direction="column-reverse",t.expanded=!1,t.gap=0;break;case"edge":t.justify="space-between"}return t}(u),{className:i,gap:2,isFocused:p,labelPosition:u,ref:t}),(0,s.createElement)(eg,{className:"components-input-control__label",hideLabelFromVision:c,labelPosition:u,htmlFor:y},m),(0,s.createElement)($h,{__unstableInputWidth:r,className:"components-input-control__container",disabled:l,hideLabel:w,labelPosition:u},(0,s.createElement)(rc,{value:E},h&&(0,s.createElement)(Xh,{className:"components-input-control__prefix"},h),o,v&&(0,s.createElement)(Zh,{className:"components-input-control__suffix"},v)),(0,s.createElement)(Qh,{disabled:l,isFocused:p})))}var ng=(0,s.forwardRef)(tg);const rg={toVector(e,t){return void 0===e&&(e=t),Array.isArray(e)?e:[e,e]},add(e,t){return[e[0]+t[0],e[1]+t[1]]},sub(e,t){return[e[0]-t[0],e[1]-t[1]]},addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function og(e,t,n){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*n):e*t*n/(t+n*e)}function ig(e,t,n,r=.15){return 0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):en?+og(e-n,n-t,r)+n:e}function ag(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function sg(e,t,n){return(t=ag(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cg(e){for(var t=1;t{var n,r;return t.target===e.currentTarget||(null===(n=e.currentTarget)||void 0===n||null===(r=n.contains)||void 0===r?void 0:r.call(n,t.target))}))}(e).map((e=>e.identifier))}function wg(e){const t=bg(e);return gg(e)?t.identifier:t.pointerId}function xg(e){const t=bg(e);return[t.clientX,t.clientY]}function _g(e,...t){return"function"==typeof e?e(...t):e}function Eg(){}function Cg(...e){return 0===e.length?Eg:1===e.length?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function kg(e,t){return Object.assign({},t,e||{})}class Sg{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:n,args:r}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?_g(n.from,t):t.offset,t.offset=t.lastOffset),t.startTime=t.timeStamp=e.timeStamp}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:n,shared:r}=this;t.args=this.args;let o=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,function(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i})}return t}(e)),r.down=r.pressed=r.buttons%2==1||r.touches>0,o=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const e=t._delta.map(Math.abs);rg.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);const[i,a]=t._movement,[s,l]=n.threshold,{_step:c,values:u}=t;if(n.hasCustomTransform?(!1===c[0]&&(c[0]=Math.abs(i)>=s&&u[0]),!1===c[1]&&(c[1]=Math.abs(a)>=l&&u[1])):(!1===c[0]&&(c[0]=Math.abs(i)>=s&&Math.sign(i)*s),!1===c[1]&&(c[1]=Math.abs(a)>=l&&Math.sign(a)*l)),t.intentional=!1!==c[0]||!1!==c[1],!t.intentional)return;const d=[0,0];if(n.hasCustomTransform){const[e,t]=u;d[0]=!1!==c[0]?e-c[0]:0,d[1]=!1!==c[1]?t-c[1]:0}else d[0]=!1!==c[0]?i-c[0]:0,d[1]=!1!==c[1]?a-c[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);const f=t.offset,p=t._active&&!t._blocked||t.active;p&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in n&&(t._bounds=_g(n.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));const[m,h]=t.offset,[[g,v],[b,y]]=t._bounds;t.overflow=[mv?1:0,hy?1:0],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);const w=t._active&&n.rubberband||[0,0];if(t.offset=function(e,[t,n],[r,o]){const[[i,a],[s,l]]=e;return[ig(t,i,a,r),ig(n,s,l,o)]}(t._bounds,t.offset,w),t.delta=rg.sub(t.offset,f),this.computeMovement(),p&&(!t.last||o>32)){t.delta=rg.sub(t.offset,f);const e=t.delta.map(Math.abs);rg.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&o>0&&(t.velocity=[e[0]/o,e[1]/o])}}emit(){const e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;const r=this.handler(cg(cg(cg({},t),e),{},{[this.aliasKey]:e.values}));void 0!==r&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class Tg extends Sg{constructor(...e){super(...e),sg(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=rg.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=rg.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,n=this.config;if(!t.axis&&e){const r="object"==typeof n.axisThreshold?n.axisThreshold[vg(e)]:n.axisThreshold;t.axis=function([e,t],n){const r=Math.abs(e),o=Math.abs(t);return r>o&&r>n?"x":o>r&&o>n?"y":void 0}(t._movement,r)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}const Ng=e=>e,Rg={enabled(e=!0){return e},eventOptions(e,t,n){return cg(cg({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return rg.toVector(e)}},from(e){return"function"==typeof e?e:null!=e?rg.toVector(e):void 0},transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||Ng},threshold(e){return rg.toVector(e,0)}};const Ig=cg(cg({},Rg),{},{axis(e,t,{axis:n}){if(this.lockDirection="lock"===n,!this.lockDirection)return n},axisThreshold(e=0){return e},bounds(e={}){if("function"==typeof e)return t=>Ig.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:o=1/0}=e;return[[t,n],[r,o]]}}),Mg={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};const Pg="undefined"!=typeof window&&window.document&&window.document.createElement;function Og(){return Pg&&"ontouchstart"in window||Pg&&window.navigator.maxTouchPoints>1}const Dg={isBrowser:Pg,gesture:function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),touch:Og(),touchscreen:Og(),pointer:Pg&&"onpointerdown"in window,pointerLock:Pg&&"exitPointerLock"in window.document},Ag={mouse:0,touch:0,pen:8},Lg=cg(cg({},Ig),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:o=!1}={}}){return this.pointerLock=r&&Dg.pointerLock,Dg.touch&&n?"touch":this.pointerLock?"mouse":Dg.pointer&&!o?"pointer":Dg.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay="number"==typeof n?n:n||void 0===n&&e?250:void 0,Dg.touchscreen&&!1!==n)return e||(void 0!==n?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:o=!0}={}}){return this.pointerButtons=r,this.keys=o,!this.pointerLock&&"pointer"===this.device&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:o}){const i=rg.toVector(e,n?r:o?1:0);return this.filterTaps=n,this.tapsThreshold=r,i},swipe({velocity:e=.5,distance:t=50,duration:n=250}={}){return{velocity:this.transform(rg.toVector(e)),distance:this.transform(rg.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold(e){return e?cg(cg({},Ag),e):Ag},keyboardDisplacement(e=10){return e}});cg(cg({},Rg),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!Dg.touch&&Dg.gesture)return"gesture";if(Dg.touch&&r)return"touch";if(Dg.touchscreen){if(Dg.pointer)return"pointer";if(Dg.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const o=e=>{const t=kg(_g(n,e),{min:-1/0,max:1/0});return[t.min,t.max]},i=e=>{const t=kg(_g(r,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof n&&"function"!=typeof r?[o(),i()]:e=>[o(e),i(e)]},threshold(e,t,n){this.lockDirection="lock"===n.axis;return rg.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return void 0===e?"ctrlKey":e},pinchOnWheel(e=!0){return e}});cg(cg({},Ig),{},{mouseOnly:(e=!0)=>e});const zg=cg(cg({},Ig),{},{mouseOnly:(e=!0)=>e}),Bg=new Map,Fg=new Map;function Vg(e){Bg.set(e.key,e.engine),Fg.set(e.key,e.resolver)}const Hg={key:"drag",engine:class extends Tg{constructor(...e){super(...e),sg(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),r={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=Ig.bounds(r)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout((()=>{this.compute(),this.emit()}),0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,n=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;const r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),r&&r.size>1&&n._pointerActive||(this.start(e),this.setupPointer(e),n._pointerId=wg(e),n._pointerActive=!0,this.computeValues(xg(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==vg(e)?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,n=this.config;if(!t._pointerActive)return;if(t.type===e.type&&e.timeStamp===t.timeStamp)return;const r=wg(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;const o=xg(e);return document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=rg.sub(o,t._values),this.computeValues(o)),rg.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional?(this.timeoutStore.remove("dragDelay"),t.active=!1,void this.startPointerDrag(e)):n.preventScrollAxis&&!t._preventScroll?t.axis?t.axis===n.preventScrollAxis||"xy"===n.preventScrollAxis?(t._active=!1,void this.clean()):(this.timeoutStore.remove("startPointerDrag"),void this.startPointerDrag(e)):void 0:void this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch(e){0}const t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;const r=wg(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[o,i]=t._distance;if(t.tap=o<=n.tapsThreshold&&i<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{const[e,r]=t.direction,[o,i]=t.velocity,[a,s]=t.movement,[l,c]=n.swipe.velocity,[u,d]=n.swipe.distance,f=n.swipe.duration;t.elapsedTimel&&Math.abs(a)>u&&(t.swipe[0]=e),Math.abs(i)>c&&Math.abs(s)>d&&(t.swipe[1]=r))}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,function(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",(()=>{this.state._step=[0,0],this.startPointerDrag(e)}),this.config.delay)}keyDown(e){const t=Mg[e.key];if(t){const n=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,r),n._keyboardActive=!0,rg.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in Mg&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:Lg},jg={key:"hover",engine:class extends Tg{constructor(...e){super(...e),sg(this,"ingKey","hovering")}enter(e){this.config.mouseOnly&&"mouse"!==e.pointerType||(this.start(e),this.computeValues(xg(e)),this.compute(e),this.emit())}leave(e){if(this.config.mouseOnly&&"mouse"!==e.pointerType)return;const t=this.state;if(!t._active)return;t._active=!1;const n=xg(e);t._movement=t._delta=rg.sub(n,t._values),this.computeValues(n),this.compute(e),t.delta=t.movement,this.emit()}bind(e){e("pointer","enter",this.enter.bind(this)),e("pointer","leave",this.leave.bind(this))}},resolver:zg};function $g(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const Wg={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=(Dg.isBrowser?window:void 0)){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},Ug=["target","eventOptions","window","enabled","transform"];function Gg(e={},t){const n={};for(const[r,o]of Object.entries(t))switch(typeof o){case"function":n[r]=o.call(n,e[r],r,e);break;case"object":n[r]=Gg(e[r],o);break;case"boolean":o&&(n[r]=e[r])}return n}class Yg{constructor(e,t){sg(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,r,o){const i=this._listeners,a=function(e,t=""){const n=ug[e];return e+(n&&n[t]||t)}(t,n),s=cg(cg({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),o);e.addEventListener(a,r,s);const l=()=>{e.removeEventListener(a,r,s),i.delete(l)};return i.add(l),l}clean(){this._listeners.forEach((e=>e())),this._listeners.clear()}}class qg{constructor(){sg(this,"_timeouts",new Map)}add(e,t,n=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...r))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach((e=>{window.clearTimeout(e)})),this._timeouts.clear()}}class Kg{constructor(e){sg(this,"gestures",new Set),sg(this,"_targetEventStore",new Yg(this)),sg(this,"gestureEventStores",{}),sg(this,"gestureTimeoutStores",{}),sg(this,"handlers",{}),sg(this,"config",{}),sg(this,"pointerIds",new Set),sg(this,"touchIds",new Set),sg(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&Xg(e,"drag");t.wheel&&Xg(e,"wheel");t.scroll&&Xg(e,"scroll");t.move&&Xg(e,"move");t.pinch&&Xg(e,"pinch");t.hover&&Xg(e,"hover")}(this,e)}setEventIds(e){return gg(e)?(this.touchIds=new Set(yg(e)),this.touchIds):"pointerId"in e?("pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds):void 0}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,n={}){const r=e,{target:o,eventOptions:i,window:a,enabled:s,transform:l}=r,c=$g(r,Ug);if(n.shared=Gg({target:o,eventOptions:i,window:a,enabled:s,transform:l},Wg),t){const e=Fg.get(t);n[t]=Gg(cg({shared:n.shared},c),e)}else for(const e in c){const t=Fg.get(e);t&&(n[e]=Gg(cg({shared:n.shared},c[e]),t))}return n}(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,n={};let r;if(!t.target||(r=t.target(),r)){if(t.enabled){for(const t of this.gestures){const o=this.config[t],i=Zg(n,o.eventOptions,!!r);if(o.enabled){new(Bg.get(t))(this,e,t).bind(i)}}const o=Zg(n,t.eventOptions,!!r);for(const t in this.nativeHandlers)o(t,"",(n=>this.nativeHandlers[t](cg(cg({},this.state.shared),{},{event:n,args:e}))),void 0,!0)}for(const e in n)n[e]=Cg(...n[e]);if(!r)return n;for(const e in n){const{device:t,capture:o,passive:i}=hg(e);this._targetEventStore.add(r,t,"",n[e],{capture:o,passive:i})}}}}function Xg(e,t){e.gestures.add(t),e.gestureEventStores[t]=new Yg(e,t),e.gestureTimeoutStores[t]=new qg}const Zg=(e,t,n)=>(r,o,i,a={},s=!1)=>{var l,c;const u=null!==(l=a.capture)&&void 0!==l?l:t.capture,d=null!==(c=a.passive)&&void 0!==c?c:t.passive;let f=s?r:pg(r,o,u);n&&d&&(f+="Passive"),e[f]=e[f]||[],e[f].push(i)};function Jg(e,t={},n,r){const o=y().useMemo((()=>new Kg(e)),[]);if(o.applyHandlers(e,r),o.applyConfig(t,n),y().useEffect(o.effect.bind(o)),y().useEffect((()=>o.clean.bind(o)),[]),void 0===t.target)return o.bind.bind(o)}const Qg=e=>e,ev={error:null,initialValue:"",isDirty:!1,isDragEnabled:!1,isDragging:!1,isPressEnterToChange:!1,value:""},tv="CHANGE",nv="COMMIT",rv="CONTROL",ov="DRAG_END",iv="DRAG_START",av="DRAG",sv="INVALIDATE",lv="PRESS_DOWN",cv="PRESS_ENTER",uv="PRESS_UP",dv="RESET";function fv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ev;const{value:t}=e;return{...ev,...e,initialValue:t}}function pv(e){return(t,n)=>{const r={...t};switch(n.type){case rv:return r.value=n.payload.value,r.isDirty=!1,r._event=void 0,r;case uv:case lv:r.isDirty=!1;break;case iv:r.isDragging=!0;break;case ov:r.isDragging=!1;break;case tv:r.error=null,r.value=n.payload.value,t.isPressEnterToChange&&(r.isDirty=!0);break;case nv:r.value=n.payload.value,r.isDirty=!1;break;case dv:r.error=null,r.isDirty=!1,r.value=n.payload.value||t.initialValue;break;case sv:r.error=n.payload.error}return r._event=n.payload.event,e(r,n)}}const mv=()=>{};const hv=(0,s.forwardRef)((function(e,t){let{disabled:n=!1,dragDirection:r="n",dragThreshold:o=10,id:i,isDragEnabled:l=!1,isFocused:c,isPressEnterToChange:u=!1,onBlur:d=mv,onChange:f=mv,onDrag:p=mv,onDragEnd:m=mv,onDragStart:h=mv,onFocus:g=mv,onKeyDown:v=mv,onValidate:b=mv,size:y="default",setIsFocused:w,stateReducer:x=(e=>e),value:_,type:E,...C}=e;const{state:k,change:S,commit:T,drag:N,dragEnd:R,dragStart:I,invalidate:M,pressDown:P,pressEnter:O,pressUp:D,reset:A}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qg,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ev,n=arguments.length>2?arguments[2]:void 0;const[r,o]=(0,s.useReducer)(pv(e),fv(t)),i=e=>(t,n)=>{o({type:e,payload:{value:t,event:n}})},a=e=>t=>{o({type:e,payload:{event:t}})},l=e=>t=>{o({type:e,payload:t})},c=i(tv),u=(e,t)=>o({type:sv,payload:{error:e,event:t}}),d=i(dv),f=i(nv),p=l(iv),m=l(av),h=l(ov),g=a(uv),v=a(lv),b=a(cv),y=(0,s.useRef)(r),w=(0,s.useRef)({value:t.value,onChangeHandler:n});return(0,s.useLayoutEffect)((()=>{y.current=r,w.current={value:t.value,onChangeHandler:n}})),(0,s.useLayoutEffect)((()=>{var e;void 0===y.current._event||r.value===w.current.value||r.isDirty||w.current.onChangeHandler(null!==(e=r.value)&&void 0!==e?e:"",{event:y.current._event})}),[r.value,r.isDirty]),(0,s.useLayoutEffect)((()=>{var e;t.value===y.current.value||y.current.isDirty||o({type:rv,payload:{value:null!==(e=t.value)&&void 0!==e?e:""}})}),[t.value]),{change:c,commit:f,dispatch:o,drag:m,dragEnd:h,dragStart:p,invalidate:u,pressDown:v,pressEnter:b,pressUp:g,reset:d,state:r}}(x,{isDragEnabled:l,value:_,isPressEnterToChange:u},f),{value:L,isDragging:z,isDirty:B}=k,F=(0,s.useRef)(!1),V=function(e,t){const n=function(e){let t="ns-resize";switch(e){case"n":case"s":t="ns-resize";break;case"e":case"w":t="ew-resize"}return t}(t);return(0,s.useEffect)((()=>{document.documentElement.style.cursor=e?n:null}),[e,n]),n}(z,r),H=e=>{const t=e.currentTarget.value;try{b(t),T(t,e)}catch(t){M(t,e)}},j=($=e=>{const{distance:t,dragging:n,event:r,target:o}=e;if(e.event={...e.event,target:o},t){if(r.stopPropagation(),!n)return m(e),void R(e);p(e),N(e),z||(h(e),I(e))}},W={axis:"e"===r||"w"===r?"x":"y",threshold:o,enabled:l,pointer:{capture:!1}},Vg(Hg),Jg({drag:$},W||{},"drag"));var $,W;const U=l?j():{};let G;return"number"===E&&(G=e=>{var t;null===(t=C.onMouseDown)||void 0===t||t.call(C,e),e.currentTarget!==e.currentTarget.ownerDocument.activeElement&&e.currentTarget.focus()}),(0,s.createElement)(Uh,a({},C,U,{className:"components-input-control__input",disabled:n,dragCursor:V,isDragging:z,id:i,onBlur:e=>{d(e),null==w||w(!1),!B&&e.target.validity.valid||(F.current=!0,H(e))},onChange:e=>{const t=e.target.value;S(t,e)},onFocus:e=>{g(e),null==w||w(!0)},onKeyDown:e=>{const{key:t}=e;switch(v(e),t){case"ArrowUp":D(e);break;case"ArrowDown":P(e);break;case"Enter":O(e),u&&(e.preventDefault(),H(e));break;case"Escape":u&&B&&(e.preventDefault(),A(_,e))}},onMouseDown:G,ref:t,inputSize:y,value:null!=L?L:"",type:E}))}));var gv=hv,vv={"default.fontFamily":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif","default.fontSize":"13px","helpText.fontSize":"12px",mobileTextMinFontSize:"16px"};function bv(e){return(0,Ql.get)(vv,e,"")}const yv={name:"kv6lnz",styles:"box-sizing:border-box;*,*::before,*::after{box-sizing:inherit;}"};const wv=Ju("div",{target:"ej5x27r4"})("font-family:",bv("default.fontFamily"),";font-size:",bv("default.fontSize"),";",yv,";"),xv=Ju("div",{target:"ej5x27r3"})((e=>{let{__nextHasNoMarginBottom:t=!1}=e;return!t&&Wf("margin-bottom:",Km(2),";","")})," .components-panel__row &{margin-bottom:inherit;}"),_v=Wf(Mh,";display:inline-block;margin-bottom:",Km(2),";padding:0;",""),Ev=Ju("label",{target:"ej5x27r2"})(_v,";");var Cv={name:"11yad0w",styles:"margin-bottom:revert"};const kv=Ju("p",{target:"ej5x27r1"})("margin-top:",Km(2),";margin-bottom:0;font-size:",bv("helpText.fontSize"),";font-style:normal;color:",Sp.gray[700],";",(e=>{let{__nextHasNoMarginBottom:t=!1}=e;return!t&&Cv}),";"),Sv=Ju("span",{target:"ej5x27r0"})(_v,";"),Tv=e=>{let{__nextHasNoMarginBottom:t=!1,id:n,label:r,hideLabelFromVision:o=!1,help:i,className:a,children:l}=e;return(0,s.createElement)(wv,{className:c()("components-base-control",a)},(0,s.createElement)(xv,{className:"components-base-control__field",__nextHasNoMarginBottom:t},r&&n&&(o?(0,s.createElement)(td,{as:"label",htmlFor:n},r):(0,s.createElement)(Ev,{className:"components-base-control__label",htmlFor:n},r)),r&&!n&&(o?(0,s.createElement)(td,{as:"label"},r):(0,s.createElement)(Tv.VisualLabel,null,r)),l),!!i&&(0,s.createElement)(kv,{id:n?n+"__help":void 0,className:"components-base-control__help",__nextHasNoMarginBottom:t},i))};Tv.VisualLabel=e=>{let{className:t,children:n,...r}=e;return(0,s.createElement)(Sv,a({},r,{className:c()("components-base-control__label",t)}),n)};var Nv=Tv;const Rv=()=>{};const Iv=(0,s.forwardRef)((function(e,t){let{__next36pxDefaultSize:n,__unstableStateReducer:r=(e=>e),__unstableInputWidth:o,className:i,disabled:l=!1,help:u,hideLabelFromVision:f=!1,id:p,isPressEnterToChange:m=!1,label:h,labelPosition:g="top",onChange:v=Rv,onValidate:b=Rv,onKeyDown:y=Rv,prefix:w,size:x="default",style:_,suffix:E,value:C,...k}=e;const[S,T]=(0,s.useState)(!1),N=function(e){const t=(0,d.useInstanceId)(Iv);return e||`inspector-input-control-${t}`}(p),R=c()("components-input-control",i),I=function(e){const t=(0,s.useRef)(e.value),[n,r]=(0,s.useState)({}),o=void 0!==n.value?n.value:e.value;return(0,s.useLayoutEffect)((()=>{const{current:o}=t;t.current=e.value,void 0===n.value||n.isStale?n.isStale&&e.value!==o&&r({}):r({...n,isStale:!0})}),[e.value,n]),{value:o,onBlur:t=>{var n;r({}),null===(n=e.onBlur)||void 0===n||n.call(e,t)},onChange:(t,n)=>{r((e=>Object.assign(e,{value:t,isStale:!1}))),e.onChange(t,n)}}}({value:C,onBlur:k.onBlur,onChange:v}),M=u?{["string"==typeof u?"aria-describedby":"aria-details"]:`${N}__help`}:{};return(0,s.createElement)(Nv,{className:R,help:u,id:N,__nextHasNoMarginBottom:!0},(0,s.createElement)(ng,{__next36pxDefaultSize:n,__unstableInputWidth:o,disabled:l,gap:3,hideLabelFromVision:f,id:N,isFocused:S,justify:"left",label:h,labelPosition:g,prefix:w,size:x,style:_,suffix:E},(0,s.createElement)(gv,a({},k,M,{__next36pxDefaultSize:n,className:"components-input-control__input",disabled:l,id:N,isFocused:S,isPressEnterToChange:m,onKeyDown:y,onValidate:b,paddingInlineStart:w?Km(2):void 0,paddingInlineEnd:E?Km(2):void 0,ref:t,setIsFocused:T,size:x,stateReducer:r},I))))}));var Mv=Iv;var Pv={name:"euqsgg",styles:"input[type='number']::-webkit-outer-spin-button,input[type='number']::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}input[type='number']{-moz-appearance:textfield;}"};const Ov=e=>{let{hideHTMLArrows:t}=e;return t?Pv:""},Dv=Ju(Mv,{target:"ep09it41"})(Ov,";"),Av=e=>{let{size:t}=e;return"small"!==t?"":Wf("width:",Km(5),";min-width:",Km(5),";height:",Km(5),";","")},Lv=Ju(od,{target:"ep09it40"})("&&&&&{color:",Sp.ui.theme,";",Av,";}");function zv(e){const t=Number(e);return isNaN(t)?0:t}function Bv(){for(var e=arguments.length,t=new Array(e),n=0;ne+zv(t)),0)}function Fv(e){const t=(e+"").split(".");return void 0!==t[1]?t[1].length:0}function Vv(e,t,n){const r=zv(e);return Math.max(t,Math.min(r,n))}function Hv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const o=zv(e),i=zv(r),a=Fv(r),s=Math.round(o/i)*i,l=Vv(s,t,n);return a?zv(l.toFixed(a)):l}const jv={bottom:{align:"flex-end",justify:"center"},bottomLeft:{align:"flex-start",justify:"flex-end"},bottomRight:{align:"flex-end",justify:"flex-end"},center:{align:"center",justify:"center"},edge:{align:"center",justify:"space-between"},left:{align:"center",justify:"flex-start"},right:{align:"center",justify:"flex-end"},stretch:{align:"stretch"},top:{align:"flex-start",justify:"center"},topLeft:{align:"flex-start",justify:"flex-start"},topRight:{align:"flex-start",justify:"flex-end"}},$v={bottom:{justify:"flex-end",align:"center"},bottomLeft:{justify:"flex-start",align:"flex-end"},bottomRight:{justify:"flex-end",align:"flex-end"},center:{justify:"center",align:"center"},edge:{justify:"space-between",align:"center"},left:{justify:"center",align:"flex-start"},right:{justify:"center",align:"flex-end"},stretch:{justify:"stretch"},top:{justify:"flex-start",align:"center"},topLeft:{justify:"flex-start",align:"flex-start"},topRight:{justify:"flex-start",align:"flex-end"}};function Wv(e){return"string"==typeof e?[e]:s.Children.toArray(e).filter((e=>(0,s.isValidElement)(e)))}function Uv(e){const{alignment:t="edge",children:n,direction:r,spacing:o=2,...i}=Vu(e,"HStack"),l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"row";if(!Qm(e))return{};const n="column"===t?$v:jv;return e in n?n[e]:{align:e}}(t,r),c=Wv(n).map(((e,t)=>{if(Wu(e,["Spacer"])){const n=e,r=n.key||`hstack-${t}`;return(0,s.createElement)($m,a({isBlock:!0,key:r},n.props))}return e}));return Xm({children:c,direction:r,justify:"center",...l,...i,gap:o})}var Gv=Hu((function(e,t){const n=Uv(e);return(0,s.createElement)(ed,a({},n,{ref:t}))}),"HStack");const Yv=e=>null!=e;const qv=Hu((function(e,t){const n=function(e){const{className:t,margin:n,marginBottom:r=2,marginLeft:o,marginRight:i,marginTop:a,marginX:s,marginY:l,padding:c,paddingBottom:u,paddingLeft:d,paddingRight:f,paddingTop:p,paddingX:m,paddingY:h,...g}=Vu(e,"Spacer");return{...g,className:Fu()(Yv(n)&&Wf("margin:",Km(n),";",""),Yv(l)&&Wf("margin-bottom:",Km(l),";margin-top:",Km(l),";",""),Yv(s)&&Wf("margin-left:",Km(s),";margin-right:",Km(s),";",""),Yv(a)&&Wf("margin-top:",Km(a),";",""),Yv(r)&&Wf("margin-bottom:",Km(r),";",""),Yv(o)&&Bh({marginLeft:Km(o)})(),Yv(i)&&Bh({marginRight:Km(i)})(),Yv(c)&&Wf("padding:",Km(c),";",""),Yv(h)&&Wf("padding-bottom:",Km(h),";padding-top:",Km(h),";",""),Yv(m)&&Wf("padding-left:",Km(m),";padding-right:",Km(m),";",""),Yv(p)&&Wf("padding-top:",Km(p),";",""),Yv(u)&&Wf("padding-bottom:",Km(u),";",""),Yv(d)&&Bh({paddingLeft:Km(d)})(),Yv(f)&&Bh({paddingRight:Km(f)})(),t)}}(e);return(0,s.createElement)(ed,a({},n,{ref:t}))}),"Spacer");var Kv=qv;const Xv=()=>{};const Zv=(0,s.forwardRef)((function(e,t){let{__unstableStateReducer:n,className:r,dragDirection:o="n",hideHTMLArrows:i=!1,spinControls:l="native",isDragEnabled:f=!0,isShiftStepEnabled:p=!0,label:m,max:h=1/0,min:g=-1/0,required:v=!1,shiftStep:b=10,step:y=1,type:w="number",value:x,size:_="default",suffix:E,onChange:C=Xv,...k}=e;i&&(ql()("wp.components.NumberControl hideHTMLArrows prop ",{alternative:'spinControls="none"',since:"6.2",version:"6.3"}),l="none");const S=(0,s.useRef)(),T=(0,d.useMergeRefs)([S,t]),N="any"===y,R=N?1:th(y),I=Hv(0,g,h,R),M=(e,t)=>N?Math.min(h,Math.max(g,th(e))):Hv(e,g,h,null!=t?t:R),P="number"===w?"off":void 0,O=c()("components-number-control",r),D=(e,t,n)=>{null==n||n.preventDefault();const r=(null==n?void 0:n.shiftKey)&&p,o=r?th(b)*R:R;let i=function(e){const t=""===e;return!Qm(e)||t}(e)?I:e;return"up"===t?i=Bv(i,o):"down"===t&&(i=function(){for(var e=arguments.length,t=new Array(e),n=0;n{const r=zv(t);return 0===n?r:e-r}),0)}(i,o)),M(i,r?o:void 0)},A=e=>t=>C(String(D(x,e,t)),{event:{...t,target:S.current}});return(0,s.createElement)(Dv,a({autoComplete:P,inputMode:"numeric"},k,{className:O,dragDirection:o,hideHTMLArrows:"native"!==l,isDragEnabled:f,label:m,max:h,min:g,ref:T,required:v,step:y,type:w,value:x,__unstableStateReducer:(e,t)=>{var r;const i=((e,t)=>{const n={...e},{type:r,payload:i}=t,a=i.event,s=n.value;if(r!==uv&&r!==lv||(n.value=D(s,r===uv?"up":"down",a)),r===av&&f){const[e,t]=i.delta,r=i.shiftKey&&p,a=r?th(b)*R:R;let l,c;switch(o){case"n":c=t,l=-1;break;case"e":c=e,l=(0,u.isRTL)()?-1:1;break;case"s":c=t,l=1;break;case"w":c=e,l=(0,u.isRTL)()?1:-1}if(0!==c){c=Math.ceil(Math.abs(c))*Math.sign(c);const e=c*a*l;n.value=M(Bv(s,e),r?a:void 0)}}if(r===cv||r===nv){const e=!1===v&&""===s;n.value=e?s:M(s)}return n})(e,t);return null!==(r=null==n?void 0:n(i,t))&&void 0!==r?r:i},size:_,suffix:"custom"===l?(0,s.createElement)(s.Fragment,null,E,(0,s.createElement)(Kv,{marginBottom:0,marginRight:2},(0,s.createElement)(Gv,{spacing:1},(0,s.createElement)(Lv,{icon:Wm,isSmall:!0,"aria-hidden":"true","aria-label":(0,u.__)("Increment"),tabIndex:-1,onClick:A("up"),size:_}),(0,s.createElement)(Lv,{icon:Um,isSmall:!0,"aria-hidden":"true","aria-label":(0,u.__)("Decrement"),tabIndex:-1,onClick:A("down"),size:_})))):E,onChange:C}))}));var Jv=Zv;const Qv=e=>{let{__nextHasNoMarginBottom:t}=e;return t?"":Wf("margin-bottom:",Km(2),";","")},eb=Ju(Zm,{target:"e65ony43"})(Qv,";"),tb=Ju("div",{target:"e65ony42"})("border-radius:50%;border:",mh.borderWidth," solid ",Sp.ui.border,";box-sizing:border-box;cursor:grab;height:",32,"px;overflow:hidden;width:",32,"px;"),nb=Ju("div",{target:"e65ony41"})({name:"1r307gh",styles:"box-sizing:border-box;position:relative;width:100%;height:100%;:focus-visible{outline:none;}"}),rb=Ju("div",{target:"e65ony40"})("background:",Sp.ui.theme,";border-radius:50%;border:",3,"px solid ",Sp.ui.theme,";bottom:0;box-sizing:border-box;display:block;height:0px;left:0;margin:auto;position:absolute;right:0;top:-",16,"px;width:0px;");var ob=function(e){let{value:t,onChange:n,...r}=e;const o=(0,s.useRef)(),i=(0,s.useRef)(),l=(0,s.useRef)(),c=e=>{const{x:t,y:r}=i.current;e.preventDefault(),e.target.focus(),n(function(e,t,n,r){const o=r-t,i=n-e,a=Math.atan2(o,i),s=Math.round(a*(180/Math.PI))+90;if(s<0)return 360+s;return s}(t,r,e.clientX,e.clientY))},{startDrag:u,isDragging:f}=(0,d.__experimentalUseDragging)({onDragStart:e=>{(()=>{const e=o.current.getBoundingClientRect();i.current={x:e.x+e.width/2,y:e.y+e.height/2}})(),c(e)},onDragMove:c,onDragEnd:c});return(0,s.useEffect)((()=>{f?(void 0===l.current&&(l.current=document.body.style.cursor),document.body.style.cursor="grabbing"):(document.body.style.cursor=l.current||null,l.current=void 0)}),[f]),(0,s.createElement)(tb,a({ref:o,onMouseDown:u,className:"components-angle-picker-control__angle-circle",style:f?{cursor:"grabbing"}:void 0},r),(0,s.createElement)(nb,{style:t?{transform:`rotate(${t}deg)`}:void 0,className:"components-angle-picker-control__angle-circle-indicator-wrapper",tabIndex:-1},(0,s.createElement)(rb,{className:"components-angle-picker-control__angle-circle-indicator"})))};function ib(e){let{__nextHasNoMarginBottom:t=!1,className:n,label:r=(0,u.__)("Angle"),onChange:o,value:i}=e;t||ql()("Bottom margin styles for wp.components.AnglePickerControl",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const a=c()("components-angle-picker-control",n);return(0,s.createElement)(eb,{__nextHasNoMarginBottom:t,className:a,gap:4},(0,s.createElement)(jm,null,(0,s.createElement)(Jv,{label:r,className:"components-angle-picker-control__input-field",max:360,min:0,onChange:e=>{const t=""!==e?parseInt(e,10):0;o(t)},size:"__unstable-large",step:"1",value:i,spinControls:"none",suffix:(0,s.createElement)(Kv,{as:Ih,marginBottom:0,marginRight:Km(3),style:{color:Sp.ui.theme}},"°")})),(0,s.createElement)($m,{style:{marginBottom:Km(1),marginTop:"auto"}},(0,s.createElement)(ob,{"aria-hidden":"true",value:i,onChange:o})))}var ab=n(4793),sb=n.n(ab),lb=window.wp.richText,cb=window.wp.a11y;const ub=new RegExp(`[${["-","~","­","֊","־","᐀","᠆","‐","‑","‒","–","—","―","⁓","⁻","₋","−","⸗","⸺","⸻","〜","〰","゠","︱","︲","﹘","﹣","-"].join("")}]`,"g"),db=e=>sb()(e).toLocaleLowerCase().replace(ub,"-");function fb(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}function pb(e){return t=>{const[n,r]=(0,s.useState)([]);return(0,s.useLayoutEffect)((()=>{const{options:n,isDebounced:o}=e,i=(0,d.debounce)((()=>{const o=Promise.resolve("function"==typeof n?n(t):n).then((n=>{if(o.canceled)return;const i=n.map(((t,n)=>({key:`${e.name}-${n}`,value:t,label:e.getOptionLabel(t),keywords:e.getOptionKeywords?e.getOptionKeywords(t):[],isDisabled:!!e.isOptionDisabled&&e.isOptionDisabled(t)}))),a=new RegExp("(?:\\b|\\s|^)"+fb(t),"i");r(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;const r=[];for(let o=0;oe.test(sb()(t))))&&(r.push(i),r.length===n))break}return r}(a,i))}));return o}),o?250:0),a=i();return()=>{i.cancel(),a&&(a.canceled=!0)}}),[t]),[n]}}function mb(e){const t=e.useItems?e.useItems:pb(e);return function(e){let{filterValue:n,instanceId:r,listBoxId:o,className:i,selectedIndex:a,onChangeOptions:l,onSelect:u,onReset:d,reset:f,value:p,contentRef:m}=e;const[h]=t(n),g=(0,lb.useAnchor)({editableContentElement:m.current,value:p}),v=(0,s.useRef)();return function(e,t){(0,s.useEffect)((()=>{const n=n=>{e.current&&!e.current.contains(n.target)&&t(n)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}}),[t])}(v,f),(0,s.useLayoutEffect)((()=>{l(h)}),[h]),!h.length>0?null:(0,s.createElement)(Mf,{focusOnMount:!1,onClose:d,placement:"top-start",className:"components-autocomplete__popover",anchor:g,ref:v},(0,s.createElement)("div",{id:o,role:"listbox",className:"components-autocomplete__results"},h.map(((e,t)=>(0,s.createElement)(od,{key:e.key,id:`components-autocomplete-item-${r}-${e.key}`,role:"option","aria-selected":t===a,disabled:e.isDisabled,className:c()("components-autocomplete__result",i,{"is-selected":t===a}),onClick:()=>u(e)},e.label)))))}}function hb(e){let{record:t,onChange:n,onReplace:r,completers:o,contentRef:i}=e;const a=(0,d.useDebounce)(cb.speak,500),l=(0,d.useInstanceId)(hb),[c,f]=(0,s.useState)(0),[p,m]=(0,s.useState)([]),[h,g]=(0,s.useState)(""),[v,b]=(0,s.useState)(null),[y,w]=(0,s.useState)(null),x=(0,s.useRef)(!1);function _(e){const{getOptionCompletion:o}=v||{};if(!e.isDisabled){if(o){const i=o(e.value,h),{action:a,value:l}=void 0===i.action||void 0===i.value?{action:"insert-at-caret",value:i}:i;if("replace"===a)return void r([l]);"insert-at-caret"===a&&function(e){const r=t.start,o=r-v.triggerPrefix.length-h.length,i=(0,lb.create)({html:(0,s.renderToString)(e)});n((0,lb.insert)(t,i,o,r))}(l)}E()}}function E(){f(0),m([]),g(""),b(null),w(null)}const C=(0,s.useMemo)((()=>{if((0,lb.isCollapsed)(t))return(0,lb.getTextContent)((0,lb.slice)(t,0))}),[t]);(0,s.useEffect)((()=>{if(!C)return void E();const e=sb()(C),n=(0,lb.getTextContent)((0,lb.slice)(t,void 0,(0,lb.getTextContent)(t).length)),r=null==o?void 0:o.find((t=>{let{triggerPrefix:r,allowContext:o}=t;const i=e.lastIndexOf(r);if(-1===i)return!1;const a=e.slice(i+r.length);if(a.length>50)return!1;const s=0===p.length,l=1===a.split(/\s/).length,c=x.current&&a.split(/\s/).length<=3;return!(s&&!c&&!l)&&(!(o&&!o(e.slice(0,i),n))&&(!/^\s/.test(a)&&!/\s\s+$/.test(a)&&/[\u0000-\uFFFF]*$/.test(a)))}));if(!r)return void E();const i=fb(r.triggerPrefix),a=e.slice(e.lastIndexOf(r.triggerPrefix)).match(new RegExp(`${i}([\0-￿]*)$`)),s=a&&a[1];b(r),w((()=>r!==v?mb(r):y)),g(s)}),[C]);const{key:k=""}=p[c]||{},{className:S}=v||{},T=!!v&&p.length>0,N=T?`components-autocomplete-listbox-${l}`:null;return{listBoxId:N,activeId:T?`components-autocomplete-item-${l}-${k}`:null,onKeyDown:function(e){if(x.current="Backspace"===e.key,v&&0!==p.length&&!e.defaultPrevented&&!e.isComposing&&229!==e.keyCode){switch(e.key){case"ArrowUp":f((0===c?p.length:c)-1);break;case"ArrowDown":f((c+1)%p.length);break;case"Escape":b(null),w(null),e.preventDefault();break;case"Enter":_(p[c]);break;case"ArrowLeft":case"ArrowRight":return void E();default:return}e.preventDefault()}},popover:void 0!==t.start&&y&&(0,s.createElement)(y,{className:S,filterValue:h,instanceId:l,listBoxId:N,selectedIndex:c,onChangeOptions:function(e){f(e.length===p.length?c:0),m(e),function(e){a&&(e.length?a((0,u.sprintf)((0,u._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):a((0,u.__)("No results."),"assertive"))}(e)},onSelect:_,value:t,contentRef:i,reset:E})}}function gb(e){const[t,n]=(0,s.useState)(!1),r=(0,s.useRef)(),o=(0,s.useRef)(),i=(0,s.useRef)(),{popover:a,listBoxId:l,activeId:c,onKeyDown:u}=hb({...e,contentRef:r});i.current=u,(0,s.useEffect)((()=>{t&&(o.current?o.current.start===e.record.start&&o.current.end===e.record.end||(n(!1),o.current=null):o.current=e.record)}),[e.record]);const f=(0,d.useMergeRefs)([r,(0,d.useRefEffect)((e=>{function t(e){i.current(e)}function r(){n(!0),o.current=null}return e.addEventListener("keydown",t),e.addEventListener("input",r),()=>{e.removeEventListener("keydown",t),e.removeEventListener("input",r)}}),[])]);return t?{ref:f,children:a,"aria-autocomplete":l?"list":void 0,"aria-owns":l,"aria-activedescendant":c}:{ref:f}}function vb(e){let{children:t,isSelected:n,...r}=e;const{popover:o,...i}=hb(r);return(0,s.createElement)(s.Fragment,null,t(i),n&&o)}function bb(e){const{help:t,id:n,...r}=e,o=(0,d.useInstanceId)(Nv,"wp-components-base-control",n);return{baseControlProps:{id:o,help:t,...r},controlProps:{id:o,...t?{["string"==typeof t?"aria-describedby":"aria-details"]:`${o}__help`}:{}}}}var yb=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"}));var wb=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));const xb=Wf("",""),_b={name:"bjn8wh",styles:"position:relative"},Eb=e=>{const{color:t=Sp.gray[200],style:n="solid",width:r=mh.borderWidth}=e||{};return`${t} ${!!r&&"0"!==r||!!t?n||"solid":n} ${r!==mh.borderWidth?`clamp(1px, ${r}, 10px)`:r}`},Cb={name:"1nwbfnf",styles:"grid-column:span 2;margin:0 auto"};function kb(e){const{className:t,size:n="default",...r}=Vu(e,"BorderBoxControlLinkedButton"),o=Fu();return{...r,className:(0,s.useMemo)((()=>o((e=>Wf("position:absolute;top:","__unstable-large"===e?"8px":"3px",";",Bh({right:0})()," line-height:0;",""))(n),t)),[t,o,n])}}var Sb=Hu(((e,t)=>{const{className:n,isLinked:r,...o}=kb(e),i=r?(0,u.__)("Unlink sides"):(0,u.__)("Link sides");return(0,s.createElement)(Bf,{text:i},(0,s.createElement)(ed,{className:n},(0,s.createElement)(od,a({},o,{isSmall:!0,icon:r?yb:wb,iconSize:24,"aria-label":i,ref:t}))))}),"BorderBoxControlLinkedButton");function Tb(e){const{className:t,value:n,size:r="default",...o}=Vu(e,"BorderBoxControlVisualizer"),i=Fu(),a=(0,s.useMemo)((()=>i(((e,t)=>Wf("position:absolute;top:","__unstable-large"===t?"20px":"15px",";right:","__unstable-large"===t?"39px":"29px",";bottom:","__unstable-large"===t?"20px":"15px",";left:","__unstable-large"===t?"39px":"29px",";border-top:",Eb(null==e?void 0:e.top),";border-bottom:",Eb(null==e?void 0:e.bottom),";",Bh({borderLeft:Eb(null==e?void 0:e.left)})()," ",Bh({borderRight:Eb(null==e?void 0:e.right)})(),";",""))(n,r),t)),[i,t,n,r]);return{...o,className:a,value:n}}var Nb=Hu(((e,t)=>{const{value:n,...r}=Tb(e);return(0,s.createElement)(ed,a({},r,{ref:t}))}),"BorderBoxControlVisualizer");var Rb=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));var Ib=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M5 11.25h14v1.5H5z"}));var Mb=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{fillRule:"evenodd",d:"M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"}));var Pb=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{fillRule:"evenodd",d:"M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",clipRule:"evenodd"}));const Ob=Ju(Jv,{target:"e1bagdl32"})("&&&{input{display:block;width:100%;}",Kh,"{transition:box-shadow 0.1s linear;}}"),Db=e=>{let{selectSize:t}=e;const n={default:Wf("box-sizing:border-box;padding:2px 1px;width:20px;color:",Sp.gray[800],";font-size:8px;line-height:1;letter-spacing:-0.5px;text-transform:uppercase;text-align-last:center;",""),large:Wf("box-sizing:border-box;min-width:24px;max-width:48px;height:24px;margin-inline-end:",Km(2),";padding:",Km(1),";color:",Sp.ui.theme,";font-size:13px;line-height:1;text-align-last:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;","")};return"__unstable-large"===t?n.large:n.default},Ab=Ju("div",{target:"e1bagdl31"})("&&&{pointer-events:none;",Db,";color:",Sp.gray[900],";}"),Lb=Ju("select",{target:"e1bagdl30"})("&&&{appearance:none;background:transparent;border-radius:2px;border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;",Db,";",(e=>{let{selectSize:t="default"}=e;const n={default:Wf("height:100%;border:1px solid transparent;transition:box-shadow 0.1s linear,border 0.1s linear;",Bh({borderTopLeftRadius:0,borderBottomLeftRadius:0})()," &:not(:disabled):hover{background-color:",Sp.gray[100],";}&:focus{border:1px solid ",Sp.ui.borderFocus,";box-shadow:inset 0 0 0 ",mh.borderWidth+" "+Sp.ui.borderFocus,";outline-offset:0;outline:2px solid transparent;z-index:1;}",""),large:Wf("display:flex;justify-content:center;align-items:center;&:hover{color:",Sp.ui.borderFocus,";box-shadow:inset 0 0 0 ",mh.borderWidth+" "+Sp.ui.borderFocus,";outline:",mh.borderWidth," solid transparent;}&:focus{box-shadow:0 0 0 ",mh.borderWidthFocus+" "+Sp.ui.borderFocus,";outline:",mh.borderWidthFocus," solid transparent;}","")};return"__unstable-large"===t?n.large:n.default}),";&:not( :disabled ){cursor:pointer;}}");const zb={name:"f3vz0n",styles:"font-weight:500"},Bb=Wf("box-shadow:inset 0 0 0 ",mh.borderWidth," ",Sp.ui.borderFocus,";",""),Fb=Wf("border:0;padding:0;margin:0;",yv,";",""),Vb=Wf(Ob,"{flex:0 0 auto;}",""),Hb=(e,t)=>{const{style:n}=e||{};return Wf("border-radius:9999px;border:2px solid transparent;",n?(e=>{const{color:t,style:n}=e||{},r=n&&"none"!==n?Sp.gray[300]:void 0;return Wf("border-style:","none"===n?"solid":n,";border-color:",t||r,";","")})(e):void 0," width:","__unstable-large"===t?"24px":"22px",";height:","__unstable-large"===t?"24px":"22px",";padding:","__unstable-large"===t?"2px":"1px",";&>span{height:",Km(4),";width:",Km(4),";background:linear-gradient(\n\t\t\t\t-45deg,\n\t\t\t\ttransparent 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 52%,\n\t\t\t\ttransparent 52%\n\t\t\t);}","")},jb=Wf("width:",228,"px;>div:first-of-type>",Ev,"{margin-bottom:0;",zb,";}&& ",Ev,"+button:not( .has-text ){min-width:24px;padding:0;}",""),$b=Wf("",""),Wb=Wf("",""),Ub=Wf("justify-content:center;width:100%;&&{border-top:",mh.borderWidth," solid ",Sp.gray[200],";border-top-left-radius:0;border-top-right-radius:0;height:46px;}",""),Gb=Wf(Ev,"{",zb,";}",""),Yb={name:"1486260",styles:"&&&&&{min-width:30px;width:30px;height:30px;padding:3px;}"};const qb=[{label:(0,u.__)("Solid"),icon:Ib,value:"solid"},{label:(0,u.__)("Dashed"),icon:Mb,value:"dashed"},{label:(0,u.__)("Dotted"),icon:Pb,value:"dotted"}],Kb=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,s.createElement)(td,{as:"label"},t):(0,s.createElement)(Ev,null,t):null};var Xb=Hu(((e,t)=>{const{buttonClassName:n,hideLabelFromVision:r,label:o,onChange:i,value:l,...c}=function(e){const{className:t,...n}=Vu(e,"BorderControlStylePicker"),r=Fu();return{...n,className:(0,s.useMemo)((()=>r(Gb,t)),[t,r]),buttonClassName:(0,s.useMemo)((()=>r(Yb)),[r])}}(e);return(0,s.createElement)(ed,a({},c,{ref:t}),(0,s.createElement)(Kb,{label:o,hideLabelFromVision:r}),(0,s.createElement)(Zm,{justify:"flex-start",gap:1},qb.map((e=>(0,s.createElement)(od,{key:e.value,className:n,icon:e.icon,isSmall:!0,isPressed:e.value===l,onClick:()=>i(e.value===l?void 0:e.value),"aria-label":e.label,label:e.label,showTooltip:!0})))))}),"BorderControlStylePicker");var Zb=(0,s.forwardRef)((function(e,t){const{className:n,colorValue:r,...o}=e;return(0,s.createElement)("span",a({className:c()("component-color-indicator",n),style:{background:r},ref:t},o))})),Jb=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Qb=function(e){return.2126*Jb(e.r)+.7152*Jb(e.g)+.0722*Jb(e.b)};function ey(e){e.prototype.luminance=function(){return e=Qb(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,r,o,i,a,s,l,c=t instanceof e?t:new e(t);return i=this.rgba,a=c.toRgb(),n=(s=Qb(i))>(l=Qb(a))?(s+.05)/(l+.05):(l+.05)/(s+.05),void 0===(r=2)&&(r=0),void 0===o&&(o=Math.pow(10,r)),Math.floor(o*n)/o+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(a=void 0===(i=(n=t).size)?"normal":i,"AAA"===(o=void 0===(r=n.level)?"AA":r)&&"normal"===a?7:"AA"===o&&"large"===a?3:4.5);var n,r,o,i,a}}const ty=(0,s.forwardRef)((function(e,t){let{renderContent:n,renderToggle:r,className:o,contentClassName:i,expandOnMobile:l,headerTitle:u,focusOnMount:f,popoverProps:p,onClose:m,onToggle:h,style:g,position:v}=e;void 0!==v&&ql()("`position` prop in wp.components.Dropdown",{since:"6.2",alternative:"`popoverProps.placement` prop",hint:"Note that the `position` prop will override any values passed through the `popoverProps.placement` prop."});const[b,y]=(0,s.useState)(null),w=(0,s.useRef)(),[x,_]=function(e,t){const[n,r]=(0,s.useState)(e);return[n,e=>{r(e),t&&t(e)}]}(!1,h);function E(){m&&m(),_(!1)}(0,s.useEffect)((()=>()=>{h&&x&&h(!1)}),[h,x]);const C={isOpen:x,onToggle:function(){_(!x)},onClose:E},k=!!(null!=p&&p.anchor||null!=p&&p.anchorRef||null!=p&&p.getAnchorRect||null!=p&&p.anchorRect);return(0,s.createElement)("div",{className:c()("components-dropdown",o),ref:(0,d.useMergeRefs)([w,t,y]),tabIndex:-1,style:g},r(C),x&&(0,s.createElement)(Mf,a({position:v,onClose:E,onFocusOutside:function(){var e;if(!w.current)return;const{ownerDocument:t}=w.current,n=null==t||null===(e=t.activeElement)||void 0===e?void 0:e.closest('[role="dialog"]');w.current.contains(t.activeElement)||n&&!n.contains(w.current)||E()},expandOnMobile:l,headerTitle:u,focusOnMount:f,offset:13,anchor:k?void 0:b},p,{className:c()("components-dropdown__content",null==p?void 0:p.className,i)}),n(C)))}));var ny=ty;var ry=Hu((function(e,t){const n=Vu(e,"InputControlSuffixWrapper");return(0,s.createElement)(Kv,a({marginBottom:0},n,{ref:t}))}),"InputControlSuffixWrapper");const oy=Ju("select",{target:"e1mv6sxx2"})("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:",Sp.gray[900],";display:block;font-family:inherit;margin:0;width:100%;max-width:none;cursor:pointer;white-space:nowrap;text-overflow:ellipsis;",(e=>{let{disabled:t}=e;return t?Wf({color:Sp.ui.textDisabled},"",""):""}),";",(e=>{let{selectSize:t="default"}=e;const n={default:"13px",small:"11px","__unstable-large":"13px"}[t];return n?Wf("font-size:","16px",";@media ( min-width: 600px ){font-size:",n,";}",""):""}),";",(e=>{let{__next36pxDefaultSize:t,multiple:n,selectSize:r="default"}=e;if(n)return;const o={default:{height:36,minHeight:36,paddingTop:0,paddingBottom:0},small:{height:24,minHeight:24,paddingTop:0,paddingBottom:0},"__unstable-large":{height:40,minHeight:40,paddingTop:0,paddingBottom:0}};t||(o.default={height:30,minHeight:30,paddingTop:0,paddingBottom:0});return Wf(o[r]||o.default,"","")}),";",(e=>{let{__next36pxDefaultSize:t,multiple:n,selectSize:r="default"}=e;const o={default:16,small:8,"__unstable-large":16};t||(o.default=8);const i=o[r]||o.default;return Bh({paddingLeft:i,paddingRight:i+18,...n?{paddingTop:i,paddingBottom:i}:{}})}),";",(e=>{let{multiple:t}=e;return{overflow:t?"auto":"hidden"}}),";}"),iy=Ju("div",{target:"e1mv6sxx1"})("margin-inline-end:",Km(-1),";line-height:0;"),ay=Ju(ry,{target:"e1mv6sxx0"})("position:absolute;pointer-events:none;",Bh({right:0}),";");var sy=function(e){let{icon:t,size:n=24,...r}=e;return(0,s.cloneElement)(t,{width:n,height:n,...r})};var ly=(0,s.createElement)(i.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(i.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));var cy=()=>(0,s.createElement)(ay,null,(0,s.createElement)(iy,null,(0,s.createElement)(sy,{icon:ly,size:18})));const uy=()=>{};const dy=(0,s.forwardRef)((function(e,t){let{className:n,disabled:r=!1,help:o,hideLabelFromVision:i,id:l,label:u,multiple:f=!1,onBlur:p=uy,onChange:m=uy,onFocus:h=uy,options:g=[],size:v="default",value:b,labelPosition:y="top",children:w,prefix:x,suffix:_,__next36pxDefaultSize:E=!1,__nextHasNoMarginBottom:C=!1,...k}=e;const[S,T]=(0,s.useState)(!1),N=function(e){const t=(0,d.useInstanceId)(dy);return e||`inspector-select-control-${t}`}(l),R=o?`${N}__help`:void 0;if(!(null!=g&&g.length||w))return null;const I=c()("components-select-control",n);return(0,s.createElement)(Nv,{help:o,id:N,__nextHasNoMarginBottom:C},(0,s.createElement)(ng,{className:I,disabled:r,hideLabelFromVision:i,id:N,isFocused:S,label:u,size:v,suffix:_||!f&&(0,s.createElement)(cy,null),prefix:x,labelPosition:y,__next36pxDefaultSize:E},(0,s.createElement)(oy,a({},k,{__next36pxDefaultSize:E,"aria-describedby":R,className:"components-select-control__input",disabled:r,id:N,multiple:f,onBlur:e=>{p(e),T(!1)},onChange:e=>{if(f){const t=Array.from(e.target.options).filter((e=>{let{selected:t}=e;return t})),n=t.map((e=>{let{value:t}=e;return t}));m(n)}else m(e.target.value,{event:e})},onFocus:e=>{h(e),T(!0)},ref:t,selectSize:v,value:b}),w||g.map(((e,t)=>{const n=e.id||`${e.label}-${e.value}-${t}`;return(0,s.createElement)("option",{key:n,value:e.value,disabled:e.disabled},e.label)})))))}));var fy=dy;const py={initial:void 0,fallback:""};var my=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:py;const{initial:n,fallback:r}={...py,...t},[o,i]=(0,s.useState)(e),a=Qm(e);(0,s.useEffect)((()=>{a&&o&&i(void 0)}),[a,o]);const l=eh([e,o,n],r),c=(0,s.useCallback)((e=>{a||i(e)}),[a]);return[l,c]};function hy(e,t,n){return"number"!=typeof e?null:parseFloat(`${Vv(e,t,n)}`)}const gy=()=>Wf({height:30,minHeight:30},"",""),vy=12,by=Ju("div",{target:"e1epgpqk14"})({name:"1se47kl",styles:"-webkit-tap-highlight-color:transparent;align-items:flex-start;display:flex;justify-content:flex-start;padding:0;position:relative;touch-action:none;width:100%"}),yy=Ju("div",{target:"e1epgpqk13"})("display:block;flex:1;position:relative;width:100%;",(e=>{let{color:t=Sp.ui.borderFocus}=e;return Wf({color:t},"","")}),";",gy,";",(e=>{let{marks:t,__nextHasNoMarginBottom:n}=e;return n?"":Wf({marginBottom:t?16:void 0},"","")}),";"),wy=Ju("span",{target:"e1epgpqk12"})("display:flex;margin-top:",4,"px;",Bh({marginRight:6}),";"),xy=Ju("span",{target:"e1epgpqk11"})("display:flex;margin-top:",4,"px;",Bh({marginLeft:6}),";"),_y=Ju("span",{target:"e1epgpqk10"})("background-color:",Sp.gray[300],";left:0;pointer-events:none;right:0;display:block;height:",4,"px;position:absolute;margin-top:",13,"px;top:0;border-radius:",4,"px;",(e=>{let{disabled:t,railColor:n}=e,r=n||"";return t&&(r=Sp.ui.backgroundDisabled),Wf({background:r},"","")}),";"),Ey=Ju("span",{target:"e1epgpqk9"})("background-color:currentColor;border-radius:",4,"px;height:",4,"px;pointer-events:none;display:block;position:absolute;margin-top:",13,"px;top:0;",(e=>{let{disabled:t,trackColor:n}=e,r=n||"currentColor";return t&&(r=Sp.gray[400]),Wf({background:r},"","")}),";"),Cy=Ju("span",{target:"e1epgpqk8"})({name:"l7tjj5",styles:"display:block;pointer-events:none;position:relative;width:100%;user-select:none"}),ky=Ju("span",{target:"e1epgpqk7"})("height:",vy,"px;left:0;position:absolute;top:-4px;width:1px;",(e=>{let{disabled:t,isFilled:n}=e,r=n?"currentColor":Sp.gray[300];return t&&(r=Sp.gray[400]),Wf({backgroundColor:r},"","")}),";"),Sy=Ju("span",{target:"e1epgpqk6"})("color:",Sp.gray[300],";left:0;font-size:11px;position:absolute;top:12px;transform:translateX( -50% );white-space:nowrap;",(e=>{let{isFilled:t}=e;return Wf({color:t?Sp.gray[700]:Sp.gray[300]},"","")}),";"),Ty=e=>{let{disabled:t}=e;return Wf("background-color:",t?Sp.gray[400]:Sp.ui.theme,";","")},Ny=Ju("span",{target:"e1epgpqk5"})("align-items:center;display:flex;height:",vy,"px;justify-content:center;margin-top:",9,"px;outline:0;pointer-events:none;position:absolute;top:0;user-select:none;width:",vy,"px;border-radius:50%;",Ty,";",Bh({marginLeft:-10}),";",Bh({transform:"translateX( 4.5px )"},{transform:"translateX( -4.5px )"}),";"),Ry=Ju("span",{target:"e1epgpqk4"})("align-items:center;border-radius:50%;height:100%;outline:0;position:absolute;user-select:none;width:100%;",Ty,";",(e=>{let{isFocused:t}=e;return t?Wf("&::before{content:' ';position:absolute;background-color:",Sp.ui.theme,";opacity:0.4;border-radius:50%;height:",20,"px;width:",20,"px;top:-4px;left:-4px;}",""):""}),";"),Iy=Ju("input",{target:"e1epgpqk3"})("box-sizing:border-box;cursor:pointer;display:block;height:100%;left:0;margin:0 -",6,"px;opacity:0;outline:none;position:absolute;right:0;top:0;width:calc( 100% + ",vy,"px );");var My={name:"1cypxip",styles:"top:-80%"},Py={name:"1lr98c4",styles:"bottom:-80%"};const Oy=Ju("span",{target:"e1epgpqk2"})("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;color:white;display:inline-block;font-size:12px;min-width:32px;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;transition:opacity 120ms ease;user-select:none;line-height:1.4;",(e=>{let{show:t}=e;return Wf({opacity:t?1:0},"","")}),";",(e=>{let{position:t}=e;return"bottom"===t?Py:My}),";",Tp("transition"),";",Bh({transform:"translateX(-50%)"},{transform:"translateX(50%)"}),";"),Dy=Ju(Jv,{target:"e1epgpqk1"})("display:inline-block;font-size:13px;margin-top:0;width:",Km(16),"!important;input[type='number']&{",gy,";}",Bh({marginLeft:`${Km(4)} !important`}),";"),Ay=Ju("span",{target:"e1epgpqk0"})("display:block;margin-top:0;button,button.is-small{margin-left:0;",gy,";}",Bh({marginLeft:8}),";");var Ly=(0,s.forwardRef)((function(e,t){const{describedBy:n,label:r,value:o,...i}=e;return(0,s.createElement)(Iy,a({},i,{"aria-describedby":n,"aria-label":r,"aria-hidden":!1,ref:t,tabIndex:0,type:"range",value:o}))}));function zy(e){const{className:t,isFilled:n=!1,label:r,style:o={},...i}=e,l=c()("components-range-control__mark",n&&"is-filled",t),u=c()("components-range-control__mark-label",n&&"is-filled");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ky,a({},i,{"aria-hidden":"true",className:l,isFilled:n,style:o})),r&&(0,s.createElement)(Sy,{"aria-hidden":"true",className:u,isFilled:n,style:o},r))}function By(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:l=0,...c}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_y,a({disabled:t},c)),n&&(0,s.createElement)(Fy,{disabled:t,marks:n,min:r,max:o,step:i,value:l}))}function Fy(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:l=0}=e,c=function(e){let{marks:t,min:n=0,max:r=100,step:o=1,value:i=0}=e;if(!t)return[];const a=r-n;if(!Array.isArray(t)){t=[];const e=1+Math.round(a/o);for(;e>t.push({value:o*t.length+n}););}const s=[];return t.forEach(((e,t)=>{if(e.valuer)return;const o=`mark-${t}`,l=e.value<=i,c=(e.value-n)/a*100+"%",d={[(0,u.isRTL)()?"right":"left"]:c};s.push({...e,isFilled:l,key:o,style:d})})),s}({marks:n,min:r,max:o,step:"any"===i?1:i,value:l});return(0,s.createElement)(Cy,{"aria-hidden":"true",className:"components-range-control__marks"},c.map((e=>(0,s.createElement)(zy,a({},e,{key:e.key,"aria-hidden":"true",disabled:t})))))}function Vy(e){const{className:t,inputRef:n,tooltipPosition:r,show:o=!1,style:i={},value:l=0,renderTooltipContent:u=(e=>e),zIndex:d=100,...f}=e,p=function(e){let{inputRef:t,tooltipPosition:n}=e;const[r,o]=(0,s.useState)(),i=(0,s.useCallback)((()=>{t&&t.current&&o(n)}),[n,t]);return(0,s.useEffect)((()=>{i()}),[i]),(0,s.useEffect)((()=>(window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}))),r}({inputRef:n,tooltipPosition:r}),m=c()("components-simple-tooltip",t),h={...i,zIndex:d};return(0,s.createElement)(Oy,a({},f,{"aria-hidden":o,className:m,position:p,show:o,role:"tooltip",style:h}),u(l))}const Hy=()=>{};const jy=(0,s.forwardRef)((function e(t,n){var r;const{__nextHasNoMarginBottom:o=!1,afterIcon:i,allowReset:l=!1,beforeIcon:f,className:p,color:m=Sp.ui.theme,currentInput:h,disabled:g=!1,help:v,hideLabelFromVision:b=!1,initialPosition:y,isShiftStepEnabled:w=!0,label:x,marks:_=!1,max:E=100,min:C=0,onBlur:k=Hy,onChange:S=Hy,onFocus:T=Hy,onMouseLeave:N=Hy,onMouseMove:R=Hy,railColor:I,renderTooltipContent:M=(e=>e),resetFallbackValue:P,shiftStep:O=10,showTooltip:D,step:A=1,trackColor:L,value:z,withInputField:B=!0,...F}=t,[V,H]=function(e){const{min:t,max:n,value:r,initial:o}=e,[i,a]=my(hy(r,t,n),{initial:hy(null!=o?o:null,t,n),fallback:null});return[i,(0,s.useCallback)((e=>{a(null===e?null:hy(e,t,n))}),[t,n,a])]}({min:C,max:E,value:null!=z?z:null,initial:y}),j=(0,s.useRef)(!1);let $=D,W=B;"any"===A&&($=!1,W=!1);const[U,G]=(0,s.useState)($),[Y,q]=(0,s.useState)(!1),K=(0,s.useRef)(),X=null===(r=K.current)||void 0===r?void 0:r.matches(":focus"),Z=!g&&Y,J=null===V,Q=J?"":void 0!==V?V:h,ee=J?(E-C)/2+C:V,te=`${Vv(J?50:(V-C)/(E-C)*100,0,100)}%`,ne=c()("components-range-control",p),re=c()("components-range-control__wrapper",!!_&&"is-marked"),oe=(0,d.useInstanceId)(e,"inspector-range-control"),ie=v?`${oe}__help`:void 0,ae=!1!==$&&Number.isFinite(V),se=()=>{let e=parseFloat(`${P}`),t=e;isNaN(e)&&(e=null,t=void 0),H(e),S(t)},le={[(0,u.isRTL)()?"right":"left"]:te};return(0,s.createElement)(Nv,{__nextHasNoMarginBottom:o,className:ne,label:x,hideLabelFromVision:b,id:`${oe}`,help:v},(0,s.createElement)(by,{className:"components-range-control__root"},f&&(0,s.createElement)(wy,null,(0,s.createElement)(Xl,{icon:f})),(0,s.createElement)(yy,{__nextHasNoMarginBottom:o,className:re,color:m,marks:!!_},(0,s.createElement)(Ly,a({},F,{className:"components-range-control__slider",describedBy:ie,disabled:g,id:`${oe}`,label:x,max:E,min:C,onBlur:e=>{k(e),q(!1),G(!1)},onChange:e=>{const t=parseFloat(e.target.value);H(t),S(t)},onFocus:e=>{T(e),q(!0),G(!0)},onMouseMove:R,onMouseLeave:N,ref:(0,d.useMergeRefs)([K,n]),step:A,value:null!=Q?Q:void 0})),(0,s.createElement)(By,{"aria-hidden":!0,disabled:g,marks:_,max:E,min:C,railColor:I,step:A,value:ee}),(0,s.createElement)(Ey,{"aria-hidden":!0,className:"components-range-control__track",disabled:g,style:{width:te},trackColor:L}),(0,s.createElement)(Ny,{className:"components-range-control__thumb-wrapper",style:le,disabled:g},(0,s.createElement)(Ry,{"aria-hidden":!0,isFocused:Z,disabled:g})),ae&&(0,s.createElement)(Vy,{className:"components-range-control__tooltip",inputRef:K,tooltipPosition:"bottom",renderTooltipContent:M,show:X||U,style:le,value:V})),i&&(0,s.createElement)(xy,null,(0,s.createElement)(Xl,{icon:i})),W&&(0,s.createElement)(Dy,{"aria-label":x,className:"components-range-control__number",disabled:g,inputMode:"decimal",isShiftStepEnabled:w,max:E,min:C,onBlur:()=>{j.current&&(se(),j.current=!1)},onChange:e=>{let t=parseFloat(e);H(t),isNaN(t)?l&&(j.current=!0):((tE)&&(t=hy(t,C,E)),S(t),j.current=!1)},shiftStep:O,step:A,value:Q}),l&&(0,s.createElement)(Ay,null,(0,s.createElement)(od,{className:"components-range-control__reset",disabled:g||void 0===V,variant:"secondary",isSmall:!0,onClick:se},(0,u.__)("Reset")))))}));var $y=jy;const Wy=Ju(Jv,{target:"ez9hsf47"})($h,"{width:",Km(24),";}"),Uy=Ju(fy,{target:"ez9hsf46"})("margin-left:",Km(-2),";width:5em;",Kh,"{display:none;}"),Gy=Ju($y,{target:"ez9hsf45"})("flex:1;margin-right:",Km(2),";"),Yy=`\n.react-colorful__interactive {\n\twidth: calc( 100% - ${Km(2)} );\n\tmargin-left: ${Km(1)};\n}`,qy=Ju("div",{target:"ez9hsf44"})("padding-top:",Km(2),";padding-right:0;padding-left:0;padding-bottom:0;"),Ky=Ju(Gv,{target:"ez9hsf43"})("padding-left:",Km(4),";padding-right:",Km(4),";"),Xy=Ju(Zm,{target:"ez9hsf42"})("padding-top:",Km(4),";padding-left:",Km(4),";padding-right:",Km(3),";padding-bottom:",Km(5),";"),Zy=Ju("div",{target:"ez9hsf41"})(yv,";width:216px;.react-colorful{display:flex;flex-direction:column;align-items:center;width:216px;height:auto;overflow:hidden;}.react-colorful__saturation{width:100%;border-radius:0;height:216px;margin-bottom:",Km(4),";border-bottom:none;}.react-colorful__hue,.react-colorful__alpha{width:184px;height:16px;border-radius:16px;margin-bottom:",Km(2),";}.react-colorful__pointer{height:16px;width:16px;border:none;box-shadow:0 0 2px 0 rgba( 0, 0, 0, 0.25 );outline:2px solid transparent;}.react-colorful__pointer-fill{box-shadow:inset 0 0 0 ",mh.borderWidthFocus," #fff;}",Yy,";"),Jy=Ju(od,{target:"ez9hsf40"})("&&&&&{min-width:",Km(6),";padding:0;>svg{margin-right:0;}}");var Qy=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"}));function ew(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function tw(e){return e instanceof ew(e).Element||e instanceof Element}function nw(e){return e instanceof ew(e).HTMLElement||e instanceof HTMLElement}function rw(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ew(e).ShadowRoot||e instanceof ShadowRoot)}var ow=Math.max,iw=Math.min,aw=Math.round;function sw(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function lw(){return!/^((?!chrome|android).)*safari/i.test(sw())}function cw(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&nw(e)&&(o=e.offsetWidth>0&&aw(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&aw(r.height)/e.offsetHeight||1);var a=(tw(e)?ew(e):window).visualViewport,s=!lw()&&n,l=(r.left+(s&&a?a.offsetLeft:0))/o,c=(r.top+(s&&a?a.offsetTop:0))/i,u=r.width/o,d=r.height/i;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l,x:l,y:c}}function uw(e){var t=ew(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function dw(e){return e?(e.nodeName||"").toLowerCase():null}function fw(e){return((tw(e)?e.ownerDocument:e.document)||window.document).documentElement}function pw(e){return cw(fw(e)).left+uw(e).scrollLeft}function mw(e){return ew(e).getComputedStyle(e)}function hw(e){var t=mw(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function gw(e,t,n){void 0===n&&(n=!1);var r=nw(t),o=nw(t)&&function(e){var t=e.getBoundingClientRect(),n=aw(t.width)/e.offsetWidth||1,r=aw(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),i=fw(t),a=cw(e,o,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&(("body"!==dw(t)||hw(i))&&(s=function(e){return e!==ew(e)&&nw(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:uw(e);var t}(t)),nw(t)?((l=cw(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=pw(i))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function vw(e){var t=cw(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function bw(e){return"html"===dw(e)?e:e.assignedSlot||e.parentNode||(rw(e)?e.host:null)||fw(e)}function yw(e){return["html","body","#document"].indexOf(dw(e))>=0?e.ownerDocument.body:nw(e)&&hw(e)?e:yw(bw(e))}function ww(e,t){var n;void 0===t&&(t=[]);var r=yw(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=ew(r),a=o?[i].concat(i.visualViewport||[],hw(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(ww(bw(a)))}function xw(e){return["table","td","th"].indexOf(dw(e))>=0}function _w(e){return nw(e)&&"fixed"!==mw(e).position?e.offsetParent:null}function Ew(e){for(var t=ew(e),n=_w(e);n&&xw(n)&&"static"===mw(n).position;)n=_w(n);return n&&("html"===dw(n)||"body"===dw(n)&&"static"===mw(n).position)?t:n||function(e){var t=/firefox/i.test(sw());if(/Trident/i.test(sw())&&nw(e)&&"fixed"===mw(e).position)return null;var n=bw(e);for(rw(n)&&(n=n.host);nw(n)&&["html","body"].indexOf(dw(n))<0;){var r=mw(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var Cw="top",kw="bottom",Sw="right",Tw="left",Nw="auto",Rw=[Cw,kw,Sw,Tw],Iw="start",Mw="end",Pw="viewport",Ow="popper",Dw=Rw.reduce((function(e,t){return e.concat([t+"-"+Iw,t+"-"+Mw])}),[]),Aw=[].concat(Rw,[Nw]).reduce((function(e,t){return e.concat([t,t+"-"+Iw,t+"-"+Mw])}),[]),Lw=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function zw(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}var Bw={placement:"bottom",modifiers:[],strategy:"absolute"};function Fw(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function Gw(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?$w(o):null,a=o?Ww(o):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case Cw:t={x:s,y:n.y-r.height};break;case kw:t={x:s,y:n.y+n.height};break;case Sw:t={x:n.x+n.width,y:l};break;case Tw:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=i?Uw(i):null;if(null!=c){var u="y"===c?"height":"width";switch(a){case Iw:t[c]=t[c]-(n[u]/2-r[u]/2);break;case Mw:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}var Yw={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Gw({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},qw={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Kw(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=a.x,p=void 0===f?0:f,m=a.y,h=void 0===m?0:m,g="function"==typeof u?u({x:p,y:h}):{x:p,y:h};p=g.x,h=g.y;var v=a.hasOwnProperty("x"),b=a.hasOwnProperty("y"),y=Tw,w=Cw,x=window;if(c){var _=Ew(n),E="clientHeight",C="clientWidth";if(_===ew(n)&&"static"!==mw(_=fw(n)).position&&"absolute"===s&&(E="scrollHeight",C="scrollWidth"),o===Cw||(o===Tw||o===Sw)&&i===Mw)w=kw,h-=(d&&_===x&&x.visualViewport?x.visualViewport.height:_[E])-r.height,h*=l?1:-1;if(o===Tw||(o===Cw||o===kw)&&i===Mw)y=Sw,p-=(d&&_===x&&x.visualViewport?x.visualViewport.width:_[C])-r.width,p*=l?1:-1}var k,S=Object.assign({position:s},c&&qw),T=!0===u?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:aw(t*r)/r||0,y:aw(n*r)/r||0}}({x:p,y:h}):{x:p,y:h};return p=T.x,h=T.y,l?Object.assign({},S,((k={})[w]=b?"0":"",k[y]=v?"0":"",k.transform=(x.devicePixelRatio||1)<=1?"translate("+p+"px, "+h+"px)":"translate3d("+p+"px, "+h+"px, 0)",k)):Object.assign({},S,((t={})[w]=b?h+"px":"",t[y]=v?p+"px":"",t.transform="",t))}var Xw={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,l=void 0===s||s,c={placement:$w(t.placement),variation:Ww(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Kw(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Kw(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var Zw={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];nw(o)&&dw(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});nw(r)&&dw(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var Jw={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=Aw.reduce((function(e,n){return e[n]=function(e,t,n){var r=$w(e),o=[Tw,Cw].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[Tw,Sw].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}},Qw={left:"right",right:"left",bottom:"top",top:"bottom"};function ex(e){return e.replace(/left|right|bottom|top/g,(function(e){return Qw[e]}))}var tx={start:"end",end:"start"};function nx(e){return e.replace(/start|end/g,(function(e){return tx[e]}))}function rx(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&rw(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ox(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ix(e,t,n){return t===Pw?ox(function(e,t){var n=ew(e),r=fw(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var c=lw();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s+pw(e),y:l}}(e,n)):tw(t)?function(e,t){var n=cw(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):ox(function(e){var t,n=fw(e),r=uw(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=ow(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=ow(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+pw(e),l=-r.scrollTop;return"rtl"===mw(o||n).direction&&(s+=ow(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(fw(e)))}function ax(e,t,n,r){var o="clippingParents"===t?function(e){var t=ww(bw(e)),n=["absolute","fixed"].indexOf(mw(e).position)>=0&&nw(e)?Ew(e):e;return tw(n)?t.filter((function(e){return tw(e)&&rx(e,n)&&"body"!==dw(e)})):[]}(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce((function(t,n){var o=ix(e,n,r);return t.top=ow(o.top,t.top),t.right=iw(o.right,t.right),t.bottom=iw(o.bottom,t.bottom),t.left=ow(o.left,t.left),t}),ix(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function sx(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function lx(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function cx(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.strategy,a=void 0===i?e.strategy:i,s=n.boundary,l=void 0===s?"clippingParents":s,c=n.rootBoundary,u=void 0===c?Pw:c,d=n.elementContext,f=void 0===d?Ow:d,p=n.altBoundary,m=void 0!==p&&p,h=n.padding,g=void 0===h?0:h,v=sx("number"!=typeof g?g:lx(g,Rw)),b=f===Ow?"reference":Ow,y=e.rects.popper,w=e.elements[m?b:f],x=ax(tw(w)?w:w.contextElement||fw(e.elements.popper),l,u,a),_=cw(e.elements.reference),E=Gw({reference:_,element:y,strategy:"absolute",placement:o}),C=ox(Object.assign({},y,E)),k=f===Ow?C:_,S={top:x.top-k.top+v.top,bottom:k.bottom-x.bottom+v.bottom,left:x.left-k.left+v.left,right:k.right-x.right+v.right},T=e.modifiersData.offset;if(f===Ow&&T){var N=T[o];Object.keys(S).forEach((function(e){var t=[Sw,kw].indexOf(e)>=0?1:-1,n=[Cw,kw].indexOf(e)>=0?"y":"x";S[e]+=N[n]*t}))}return S}var ux={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,m=void 0===p||p,h=n.allowedAutoPlacements,g=t.options.placement,v=$w(g),b=l||(v===g||!m?[ex(g)]:function(e){if($w(e)===Nw)return[];var t=ex(e);return[nx(e),t,nx(t)]}(g)),y=[g].concat(b).reduce((function(e,n){return e.concat($w(n)===Nw?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?Aw:l,u=Ww(r),d=u?s?Dw:Dw.filter((function(e){return Ww(e)===u})):Rw,f=d.filter((function(e){return c.indexOf(e)>=0}));0===f.length&&(f=d);var p=f.reduce((function(t,n){return t[n]=cx(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[$w(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:m,allowedAutoPlacements:h}):n)}),[]),w=t.rects.reference,x=t.rects.popper,_=new Map,E=!0,C=y[0],k=0;k=0,I=R?"width":"height",M=cx(t,{placement:S,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),P=R?N?Sw:Tw:N?kw:Cw;w[I]>x[I]&&(P=ex(P));var O=ex(P),D=[];if(i&&D.push(M[T]<=0),s&&D.push(M[P]<=0,M[O]<=0),D.every((function(e){return e}))){C=S,E=!1;break}_.set(S,D)}if(E)for(var A=function(e){var t=y.find((function(t){var n=_.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return C=t,"break"},L=m?3:1;L>0;L--){if("break"===A(L))break}t.placement!==C&&(t.modifiersData[r]._skip=!0,t.placement=C,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function dx(e,t,n){return ow(e,iw(t,n))}var fx={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=void 0===f||f,m=n.tetherOffset,h=void 0===m?0:m,g=cx(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=$w(t.placement),b=Ww(t.placement),y=!b,w=Uw(v),x="x"===w?"y":"x",_=t.modifiersData.popperOffsets,E=t.rects.reference,C=t.rects.popper,k="function"==typeof h?h(Object.assign({},t.rects,{placement:t.placement})):h,S="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,N={x:0,y:0};if(_){if(i){var R,I="y"===w?Cw:Tw,M="y"===w?kw:Sw,P="y"===w?"height":"width",O=_[w],D=O+g[I],A=O-g[M],L=p?-C[P]/2:0,z=b===Iw?E[P]:C[P],B=b===Iw?-C[P]:-E[P],F=t.elements.arrow,V=p&&F?vw(F):{width:0,height:0},H=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},j=H[I],$=H[M],W=dx(0,E[P],V[P]),U=y?E[P]/2-L-W-j-S.mainAxis:z-W-j-S.mainAxis,G=y?-E[P]/2+L+W+$+S.mainAxis:B+W+$+S.mainAxis,Y=t.elements.arrow&&Ew(t.elements.arrow),q=Y?"y"===w?Y.clientTop||0:Y.clientLeft||0:0,K=null!=(R=null==T?void 0:T[w])?R:0,X=O+G-K,Z=dx(p?iw(D,O+U-K-q):D,O,p?ow(A,X):A);_[w]=Z,N[w]=Z-O}if(s){var J,Q="x"===w?Cw:Tw,ee="x"===w?kw:Sw,te=_[x],ne="y"===x?"height":"width",re=te+g[Q],oe=te-g[ee],ie=-1!==[Cw,Tw].indexOf(v),ae=null!=(J=null==T?void 0:T[x])?J:0,se=ie?re:te-E[ne]-C[ne]-ae+S.altAxis,le=ie?te+E[ne]+C[ne]-ae-S.altAxis:oe,ce=p&&ie?function(e,t,n){var r=dx(e,t,n);return r>n?n:r}(se,te,le):dx(p?se:re,te,p?le:oe);_[x]=ce,N[x]=ce-te}t.modifiersData[r]=N}},requiresIfExists:["offset"]};var px={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=$w(n.placement),l=Uw(s),c=[Tw,Sw].indexOf(s)>=0?"height":"width";if(i&&a){var u=function(e,t){return sx("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:lx(e,Rw))}(o.padding,n),d=vw(i),f="y"===l?Cw:Tw,p="y"===l?kw:Sw,m=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],h=a[l]-n.rects.reference[l],g=Ew(i),v=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=m/2-h/2,y=u[f],w=v-d[c]-u[p],x=v/2-d[c]/2+b,_=dx(y,x,w),E=l;n.modifiersData[r]=((t={})[E]=_,t.centerOffset=_-x,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&rx(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function mx(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function hx(e){return[Cw,Sw,kw,Tw].some((function(t){return e[t]>=0}))}var gx={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=cx(t,{elementContext:"reference"}),s=cx(t,{altBoundary:!0}),l=mx(a,r),c=mx(s,o,i),u=hx(l),d=hx(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}},vx=Vw({defaultModifiers:[jw,Yw,Xw,Zw,Jw,ux,fx,px,gx]});function bx(e){void 0===e&&(e={});var t,n,r=Lp(e),o=r.visible,i=void 0!==o&&o,a=r.animated,s=void 0!==a&&a,l=jp(h(r,["visible","animated"])),c=(0,b.useState)(i),u=c[0],d=c[1],f=(0,b.useState)(s),p=f[0],g=f[1],v=(0,b.useState)(!1),y=v[0],w=v[1],x=(t=u,n=(0,b.useRef)(null),U((function(){n.current=t}),[t]),n),_=null!=x.current&&x.current!==u;p&&!y&&_&&w(!0),(0,b.useEffect)((function(){if("number"==typeof p&&y){var e=setTimeout((function(){return w(!1)}),p);return function(){clearTimeout(e)}}return function(){}}),[p,y]);var E=(0,b.useCallback)((function(){return d(!0)}),[]),C=(0,b.useCallback)((function(){return d(!1)}),[]),k=(0,b.useCallback)((function(){return d((function(e){return!e}))}),[]),S=(0,b.useCallback)((function(){return w(!1)}),[]);return m(m({},l),{},{visible:u,animated:p,animating:y,show:E,hide:C,toggle:k,setVisible:d,setAnimated:g,stopAnimation:S})}var yx=ee("Mac")&&!ee("Chrome")&&ee("Safari");function wx(e){return function(t){return e&&!A(t,e)?e:t}}function xx(e){void 0===e&&(e={});var t=Lp(e),n=t.gutter,r=void 0===n?12:n,o=t.placement,i=void 0===o?"bottom":o,a=t.unstable_flip,s=void 0===a||a,l=t.unstable_offset,c=t.unstable_preventOverflow,u=void 0===c||c,d=t.unstable_fixed,f=void 0!==d&&d,p=t.modal,g=void 0!==p&&p,v=h(t,["gutter","placement","unstable_flip","unstable_offset","unstable_preventOverflow","unstable_fixed","modal"]),y=(0,b.useRef)(null),w=(0,b.useRef)(null),x=(0,b.useRef)(null),_=(0,b.useRef)(null),E=(0,b.useState)(i),C=E[0],k=E[1],S=(0,b.useState)(i),T=S[0],N=S[1],R=(0,b.useState)(l||[0,r])[0],I=(0,b.useState)({position:"fixed",left:"100%",top:"100%"}),M=I[0],P=I[1],O=(0,b.useState)({}),D=O[0],A=O[1],L=function(e){void 0===e&&(e={});var t=Lp(e),n=t.modal,r=void 0===n||n,o=bx(h(t,["modal"])),i=(0,b.useState)(r),a=i[0],s=i[1],l=(0,b.useRef)(null);return m(m({},o),{},{modal:a,setModal:s,unstable_disclosureRef:l})}(m({modal:g},v)),z=(0,b.useCallback)((function(){return!!y.current&&(y.current.forceUpdate(),!0)}),[]),B=(0,b.useCallback)((function(e){e.placement&&N(e.placement),e.styles&&(P(wx(e.styles.popper)),_.current&&A(wx(e.styles.arrow)))}),[]);return U((function(){return w.current&&x.current&&(y.current=vx(w.current,x.current,{placement:C,strategy:f?"fixed":"absolute",onFirstUpdate:yx?B:void 0,modifiers:[{name:"eventListeners",enabled:L.visible},{name:"applyStyles",enabled:!1},{name:"flip",enabled:s,options:{padding:8}},{name:"offset",options:{offset:R}},{name:"preventOverflow",enabled:u,options:{tetherOffset:function(){var e;return(null===(e=_.current)||void 0===e?void 0:e.clientWidth)||0}}},{name:"arrow",enabled:!!_.current,options:{element:_.current}},{name:"updateState",phase:"write",requires:["computeStyles"],enabled:L.visible&&!0,fn:function(e){var t=e.state;return B(t)}}]})),function(){y.current&&(y.current.destroy(),y.current=null)}}),[C,f,L.visible,s,R,u]),(0,b.useEffect)((function(){if(L.visible){var e=window.requestAnimationFrame((function(){var e;null===(e=y.current)||void 0===e||e.forceUpdate()}));return function(){window.cancelAnimationFrame(e)}}}),[L.visible]),m(m({},L),{},{unstable_referenceRef:w,unstable_popoverRef:x,unstable_arrowRef:_,unstable_popoverStyles:M,unstable_arrowStyles:D,unstable_update:z,unstable_originalPlacement:C,placement:T,place:k})}var _x={currentTooltipId:null,listeners:new Set,subscribe:function(e){var t=this;return this.listeners.add(e),function(){t.listeners.delete(e)}},show:function(e){this.currentTooltipId=e,this.listeners.forEach((function(t){return t(e)}))},hide:function(e){this.currentTooltipId===e&&(this.currentTooltipId=null,this.listeners.forEach((function(e){return e(null)})))}};var Ex=["baseId","unstable_idCountRef","visible","animated","animating","setBaseId","show","hide","toggle","setVisible","setAnimated","stopAnimation","unstable_disclosureRef","unstable_referenceRef","unstable_popoverRef","unstable_arrowRef","unstable_popoverStyles","unstable_arrowStyles","unstable_originalPlacement","unstable_update","placement","place","unstable_timeout","unstable_setTimeout"],Cx=[].concat(Ex,["unstable_portal"]),kx=F({name:"TooltipReference",compose:re,keys:Ex,useProps:function(e,t){var n=t.ref,r=t.onFocus,o=t.onBlur,i=t.onMouseEnter,a=t.onMouseLeave,s=h(t,["ref","onFocus","onBlur","onMouseEnter","onMouseLeave"]),l=G(r),c=G(o),u=G(i),d=G(a),f=(0,b.useCallback)((function(t){var n,r;null===(n=l.current)||void 0===n||n.call(l,t),t.defaultPrevented||null===(r=e.show)||void 0===r||r.call(e)}),[e.show]),p=(0,b.useCallback)((function(t){var n,r;null===(n=c.current)||void 0===n||n.call(c,t),t.defaultPrevented||null===(r=e.hide)||void 0===r||r.call(e)}),[e.hide]),g=(0,b.useCallback)((function(t){var n,r;null===(n=u.current)||void 0===n||n.call(u,t),t.defaultPrevented||null===(r=e.show)||void 0===r||r.call(e)}),[e.show]),v=(0,b.useCallback)((function(t){var n,r;null===(n=d.current)||void 0===n||n.call(d,t),t.defaultPrevented||null===(r=e.hide)||void 0===r||r.call(e)}),[e.hide]);return m({ref:H(e.unstable_referenceRef,n),tabIndex:0,onFocus:f,onBlur:p,onMouseEnter:g,onMouseLeave:v,"aria-describedby":e.baseId},s)}}),Sx=z({as:"div",useHook:kx});const Tx=(0,s.createContext)({});var Nx=F({name:"DisclosureContent",compose:re,keys:["baseId","unstable_idCountRef","visible","animated","animating","setBaseId","show","hide","toggle","setVisible","setAnimated","stopAnimation"],useProps:function(e,t){var n=t.onTransitionEnd,r=t.onAnimationEnd,o=t.style,i=h(t,["onTransitionEnd","onAnimationEnd","style"]),a=e.animated&&e.animating,s=(0,b.useState)(null),l=s[0],c=s[1],u=!e.visible&&!a,d=u?m({display:"none"},o):o,f=G(n),p=G(r),g=(0,b.useRef)(0);(0,b.useEffect)((function(){if(e.animated)return g.current=window.requestAnimationFrame((function(){g.current=window.requestAnimationFrame((function(){e.visible?c("enter"):c(a?"leave":null)}))})),function(){return window.cancelAnimationFrame(g.current)}}),[e.animated,e.visible,a]);var v=(0,b.useCallback)((function(t){var n;Y(t)&&(a&&!0===e.animated&&(null===(n=e.stopAnimation)||void 0===n||n.call(e)))}),[e.animated,a,e.stopAnimation]),y=(0,b.useCallback)((function(e){var t;null===(t=f.current)||void 0===t||t.call(f,e),v(e)}),[v]),w=(0,b.useCallback)((function(e){var t;null===(t=p.current)||void 0===t||t.call(p,e),v(e)}),[v]);return m({id:e.baseId,"data-enter":"enter"===l?"":void 0,"data-leave":"leave"===l?"":void 0,onTransitionEnd:y,onAnimationEnd:w,hidden:u,style:d},i)}}),Rx=z({as:"div",useHook:Nx});function Ix(){return W?document.body:null}var Mx=(0,b.createContext)(Ix());function Px(e){var t=e.children,n=(0,b.useContext)(Mx)||Ix(),r=(0,b.useState)((function(){if(W){var e=document.createElement("div");return e.className=Px.__className,e}return null}))[0];return U((function(){if(r&&n)return n.appendChild(r),function(){n.removeChild(r)}}),[r,n]),r?(0,It.createPortal)((0,b.createElement)(Mx.Provider,{value:r},t),r):null}function Ox(e){e.defaultPrevented||"Escape"===e.key&&_x.show(null)}Px.__className="__reakit-portal",Px.__selector="."+Px.__className;var Dx=F({name:"Tooltip",compose:Nx,keys:Cx,useOptions:function(e){var t=e.unstable_portal;return m({unstable_portal:void 0===t||t},h(e,["unstable_portal"]))},useProps:function(e,t){var n=t.ref,r=t.style,o=t.wrapElement,i=h(t,["ref","style","wrapElement"]);(0,b.useEffect)((function(){var t;j(null===(t=e.unstable_popoverRef)||void 0===t?void 0:t.current).addEventListener("keydown",Ox)}),[]);var a=(0,b.useCallback)((function(t){return e.unstable_portal&&(t=(0,b.createElement)(Px,null,t)),o?o(t):t}),[e.unstable_portal,o]);return m({ref:H(e.unstable_popoverRef,n),role:"tooltip",style:m(m({},e.unstable_popoverStyles),{},{pointerEvents:"none"},r),wrapElement:a},i)}}),Ax=z({as:"div",memo:!0,useHook:Dx});var Lx=Hu((function(e,t){const{as:n="span",shortcut:r,className:o,...i}=Vu(e,"Shortcut");if(!r)return null;let l,c;return"string"==typeof r?l=r:(l=r.display,c=r.ariaLabel),(0,s.createElement)(ed,a({as:n,className:o,"aria-label":c,ref:t},i),l)}),"Shortcut");const zx=Wf("z-index:",1000002,";box-sizing:border-box;opacity:0;outline:none;transform-origin:top center;transition:opacity ",mh.transitionDurationFastest," ease;font-size:",mh.fontSize,";&[data-enter]{opacity:1;}",""),Bx=Ju("div",{target:"e7tfjmw1"})("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;box-shadow:0 0 0 1px rgba( 255, 255, 255, 0.04 );color:",Sp.white,";padding:4px 8px;"),Fx={name:"12mkfdx",styles:"outline:none"},Vx=Ju(Lx,{target:"e7tfjmw0"})("display:inline-block;margin-left:",Km(1),";"),{TooltipPopoverView:Hx}=t;var jx=Hu((function(e,t){const{children:n,className:r,...o}=Vu(e,"TooltipContent"),{tooltip:i}=(0,s.useContext)(Tx),l=Fu()(zx,r);return(0,s.createElement)(Ax,a({as:ed},o,i,{className:l,ref:t}),(0,s.createElement)(Hx,null,n))}),"TooltipContent");const $x=Hu((function(e,t){const{animated:n=!0,animationDuration:r=160,baseId:o,children:i,content:l,focusable:c=!0,gutter:u=4,id:d,modal:f=!0,placement:p,visible:g=!1,shortcut:v,...y}=Vu(e,"Tooltip"),w=function(e){void 0===e&&(e={});var t=Lp(e),n=t.placement,r=void 0===n?"top":n,o=t.unstable_timeout,i=void 0===o?0:o,a=h(t,["placement","unstable_timeout"]),s=(0,b.useState)(i),l=s[0],c=s[1],u=(0,b.useRef)(null),d=(0,b.useRef)(null),f=xx(m(m({},a),{},{placement:r})),p=(f.modal,f.setModal,h(f,["modal","setModal"])),g=(0,b.useCallback)((function(){null!==u.current&&window.clearTimeout(u.current),null!==d.current&&window.clearTimeout(d.current)}),[]),v=(0,b.useCallback)((function(){g(),p.hide(),d.current=window.setTimeout((function(){_x.hide(p.baseId)}),l)}),[g,p.hide,l,p.baseId]),y=(0,b.useCallback)((function(){g(),!l||_x.currentTooltipId?(_x.show(p.baseId),p.show()):(_x.show(null),u.current=window.setTimeout((function(){_x.show(p.baseId),p.show()}),l))}),[g,l,p.show,p.baseId]);return(0,b.useEffect)((function(){return _x.subscribe((function(e){e!==p.baseId&&(g(),p.visible&&p.hide())}))}),[p.baseId,g,p.visible,p.hide]),(0,b.useEffect)((function(){return function(){g(),_x.hide(p.baseId)}}),[g,p.baseId]),m(m({},p),{},{hide:v,show:y,unstable_timeout:l,unstable_setTimeout:c})}({animated:n?r:void 0,baseId:o||d,gutter:u,placement:p,visible:g,...y}),x=(0,s.useMemo)((()=>({tooltip:w})),[w]);return(0,s.createElement)(Tx.Provider,{value:x},l&&(0,s.createElement)(jx,{unstable_portal:f,ref:t},l,v&&(0,s.createElement)(Vx,{shortcut:v})),i&&(0,s.createElement)(Sx,a({},w,i.props,{ref:null==i?void 0:i.ref}),(e=>(c||(e.tabIndex=void 0),(0,s.cloneElement)(i,e)))))}),"Tooltip");var Wx=$x;const Ux=e=>{const{color:t,colorType:n}=e,[r,o]=(0,s.useState)(null),i=(0,s.useRef)(),a=(0,d.useCopyToClipboard)((()=>{switch(n){case"hsl":return t.toHslString();case"rgb":return t.toRgbString();default:return t.toHex()}}),(()=>{i.current&&clearTimeout(i.current),o(t.toHex()),i.current=setTimeout((()=>{o(null),i.current=void 0}),3e3)}));return(0,s.useEffect)((()=>()=>{i.current&&clearTimeout(i.current)}),[]),(0,s.createElement)(Wx,{content:(0,s.createElement)(Ih,{color:"white"},r===t.toHex()?(0,u.__)("Copied!"):(0,u.__)("Copy")),placement:"bottom"},(0,s.createElement)(Jy,{isSmall:!0,ref:a,icon:Qy,showTooltip:!1}))},Gx=e=>{let{min:t,max:n,label:r,abbreviation:o,onChange:i,value:a}=e;return(0,s.createElement)(Gv,{spacing:4},(0,s.createElement)(Wy,{min:t,max:n,label:r,hideLabelFromVision:!0,value:a,onChange:e=>{i(e?"string"!=typeof e?e:parseInt(e,10):0)},prefix:(0,s.createElement)(Kv,{as:Ih,paddingLeft:Km(4),color:Sp.ui.theme,lineHeight:1},o),spinControls:"none",size:"__unstable-large"}),(0,s.createElement)(Gy,{__nextHasNoMarginBottom:!0,label:r,hideLabelFromVision:!0,min:t,max:n,value:a,onChange:i,withInputField:!1}))},Yx=e=>{let{color:t,onChange:n,enableAlpha:r}=e;const{r:o,g:i,b:a,a:l}=t.toRgb();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Gx,{min:0,max:255,label:"Red",abbreviation:"R",value:o,onChange:e=>n(vp({r:e,g:i,b:a,a:l}))}),(0,s.createElement)(Gx,{min:0,max:255,label:"Green",abbreviation:"G",value:i,onChange:e=>n(vp({r:o,g:e,b:a,a:l}))}),(0,s.createElement)(Gx,{min:0,max:255,label:"Blue",abbreviation:"B",value:a,onChange:e=>n(vp({r:o,g:i,b:e,a:l}))}),r&&(0,s.createElement)(Gx,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*l),onChange:e=>n(vp({r:o,g:i,b:a,a:e/100}))}))},qx=e=>{let{color:t,onChange:n,enableAlpha:r}=e;const{h:o,s:i,l:a,a:l}=t.toHsl();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Gx,{min:0,max:359,label:"Hue",abbreviation:"H",value:o,onChange:e=>{n(vp({h:e,s:i,l:a,a:l}))}}),(0,s.createElement)(Gx,{min:0,max:100,label:"Saturation",abbreviation:"S",value:i,onChange:e=>{n(vp({h:o,s:e,l:a,a:l}))}}),(0,s.createElement)(Gx,{min:0,max:100,label:"Lightness",abbreviation:"L",value:a,onChange:e=>{n(vp({h:o,s:i,l:e,a:l}))}}),r&&(0,s.createElement)(Gx,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*l),onChange:e=>{n(vp({h:o,s:i,l:a,a:e/100}))}}))},Kx=e=>{let{color:t,onChange:n,enableAlpha:r}=e;return(0,s.createElement)(Iv,{prefix:(0,s.createElement)(Kv,{as:Ih,marginLeft:Km(4),color:Sp.ui.theme,lineHeight:1},"#"),value:t.toHex().slice(1).toUpperCase(),onChange:e=>{if(!e)return;const t=e.startsWith("#")?e:"#"+e;n(vp(t))},maxLength:r?9:7,label:(0,u.__)("Hex color"),hideLabelFromVision:!0,size:"__unstable-large",__unstableStateReducer:(e,t)=>{var n,r,o,i;const a=null===(n=t.payload)||void 0===n||null===(r=n.event)||void 0===r?void 0:r.nativeEvent;if("insertFromPaste"!==(null==a?void 0:a.inputType))return{...e};const s=null!==(o=e.value)&&void 0!==o&&o.startsWith("#")?e.value.slice(1).toUpperCase():null===(i=e.value)||void 0===i?void 0:i.toUpperCase();return{...e,value:s}},__unstableInputWidth:"9em"})},Xx=e=>{let{colorType:t,color:n,onChange:r,enableAlpha:o}=e;const i={color:n,onChange:r,enableAlpha:o};switch(t){case"hsl":return(0,s.createElement)(qx,i);case"rgb":return(0,s.createElement)(Yx,i);default:return(0,s.createElement)(Kx,i)}};function Zx(){return(Zx=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function Qx(e){var t=(0,b.useRef)(e),n=(0,b.useRef)((function(e){t.current&&t.current(e)}));return t.current=e,n.current}var e_=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e0:e.buttons>0)&&o.current?i(r_(o.current,e,s.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=l.current,i=n_(o.current),a=n?i.addEventListener:i.removeEventListener;a(r?"touchmove":"mousemove",e),a(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=o.current;if(r&&(o_(t),!function(e,t){return t&&!t_(e)}(t,l.current)&&r)){if(t_(t)){l.current=!0;var a=t.changedTouches||[];a.length&&(s.current=a[0].identifier)}r.focus(),i(r_(r,t,s.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),a({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]}),[a,i]),u=c[0],d=c[1],f=c[2];return(0,b.useEffect)((function(){return f}),[f]),b.createElement("div",Zx({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:o,onKeyDown:d,tabIndex:0,role:"slider"}))})),a_=function(e){return e.filter(Boolean).join(" ")},s_=function(e){var t=e.color,n=e.left,r=e.top,o=void 0===r?.5:r,i=a_(["react-colorful__pointer",e.className]);return b.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},b.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},l_=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},c_=(Math.PI,function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:l_(e.h),s:l_(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:l_(o/2),a:l_(r,2)}}),u_=function(e){var t=c_(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},d_=function(e){var t=c_(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},f_=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),a=r*(1-n),s=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:l_(255*[r,s,a,a,l,r][c]),g:l_(255*[l,r,r,s,a,a][c]),b:l_(255*[a,a,l,r,r,s][c]),a:l_(o,2)}},p_=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?h_({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},m_=p_,h_=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),a=i-Math.min(t,n,r),s=a?i===t?(n-r)/a:i===n?2+(r-t)/a:4+(t-n)/a:0;return{h:l_(60*(s<0?s+6:s)),s:l_(i?a/i*100:0),v:l_(i/255*100),a:o}},g_=b.memo((function(e){var t=e.hue,n=e.onChange,r=a_(["react-colorful__hue",e.className]);return b.createElement("div",{className:r},b.createElement(i_,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:e_(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":l_(t),"aria-valuemax":"360","aria-valuemin":"0"},b.createElement(s_,{className:"react-colorful__hue-pointer",left:t/360,color:u_({h:t,s:100,v:100,a:1})})))})),v_=b.memo((function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:u_({h:t.h,s:100,v:100,a:1})};return b.createElement("div",{className:"react-colorful__saturation",style:r},b.createElement(i_,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:e_(t.s+100*e.left,0,100),v:e_(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+l_(t.s)+"%, Brightness "+l_(t.v)+"%"},b.createElement(s_,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:u_(t)})))})),b_=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},y_=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")};function w_(e,t,n){var r=Qx(n),o=(0,b.useState)((function(){return e.toHsva(t)})),i=o[0],a=o[1],s=(0,b.useRef)({color:t,hsva:i});(0,b.useEffect)((function(){if(!e.equal(t,s.current.color)){var n=e.toHsva(t);s.current={hsva:n,color:t},a(n)}}),[t,e]),(0,b.useEffect)((function(){var t;b_(i,s.current.hsva)||e.equal(t=e.fromHsva(i),s.current.color)||(s.current={hsva:i,color:t},r(t))}),[i,e,r]);var l=(0,b.useCallback)((function(e){a((function(t){return Object.assign({},t,e)}))}),[]);return[i,l]}var x_,__="undefined"!=typeof window?b.useLayoutEffect:b.useEffect,E_=new Map,C_=function(e){__((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!E_.has(t)){var r=t.createElement("style");r.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',E_.set(t,r);var o=x_||n.nc;o&&r.setAttribute("nonce",o),t.head.appendChild(r)}}),[])},k_=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,a=Jx(e,["className","colorModel","color","onChange"]),s=(0,b.useRef)(null);C_(s);var l=w_(n,o,i),c=l[0],u=l[1],d=a_(["react-colorful",t]);return b.createElement("div",Zx({},a,{ref:s,className:d}),b.createElement(v_,{hsva:c,onChange:u}),b.createElement(g_,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},S_=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+d_(Object.assign({},n,{a:0}))+", "+d_(Object.assign({},n,{a:1}))+")"},i=a_(["react-colorful__alpha",t]),a=l_(100*n.a);return b.createElement("div",{className:i},b.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),b.createElement(i_,{onMove:function(e){r({a:e.left})},onKey:function(e){r({a:e_(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},b.createElement(s_,{className:"react-colorful__alpha-pointer",left:n.a,color:d_(n)})))},T_=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,a=Jx(e,["className","colorModel","color","onChange"]),s=(0,b.useRef)(null);C_(s);var l=w_(n,o,i),c=l[0],u=l[1],d=a_(["react-colorful",t]);return b.createElement("div",Zx({},a,{ref:s,className:d}),b.createElement(v_,{hsva:c,onChange:u}),b.createElement(g_,{hue:c.h,onChange:u}),b.createElement(S_,{hsva:c,onChange:u,className:"react-colorful__last-control"}))},N_={defaultColor:"rgba(0, 0, 0, 1)",toHsva:p_,fromHsva:function(e){var t=f_(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:y_},R_=function(e){return b.createElement(T_,Zx({},e,{colorModel:N_}))},I_={defaultColor:"rgb(0, 0, 0)",toHsva:m_,fromHsva:function(e){var t=f_(e);return"rgb("+t.r+", "+t.g+", "+t.b+")"},equal:y_},M_=function(e){return b.createElement(k_,Zx({},e,{colorModel:I_}))};const P_=e=>{let{color:t,enableAlpha:n,onChange:r}=e;const o=n?R_:M_,i=(0,s.useMemo)((()=>t.toRgbString()),[t]);return(0,s.createElement)(o,{color:i,onChange:e=>{r(vp(e))}})};function O_(e){let{defaultValue:t,onChange:n,value:r}=e;const o=void 0!==r,i=o?r:t,[a,l]=(0,s.useState)(i);let c;return c=o&&"function"==typeof n?n:o||"function"!=typeof n?l:e=>{n(e),l(e)},[o?r:a,c]}yp([wp]);const D_=[{label:"RGB",value:"rgb"},{label:"HSL",value:"hsl"},{label:"Hex",value:"hex"}],A_=Hu(((e,t)=>{const{enableAlpha:n=!1,color:r,onChange:o,defaultValue:i="#fff",copyFormat:l,...c}=Vu(e,"ColorPicker"),[f,p]=O_({onChange:o,value:r,defaultValue:i}),m=(0,s.useMemo)((()=>vp(f||"")),[f]),h=(0,d.useDebounce)(p),g=(0,s.useCallback)((e=>{h(e.toHex())}),[h]),[v,b]=(0,s.useState)(l||"hex");return(0,s.createElement)(Zy,a({ref:t},c),(0,s.createElement)(P_,{onChange:g,color:m,enableAlpha:n}),(0,s.createElement)(qy,null,(0,s.createElement)(Ky,{justify:"space-between"},(0,s.createElement)(Uy,{__nextHasNoMarginBottom:!0,options:D_,value:v,onChange:e=>b(e),label:(0,u.__)("Color format"),hideLabelFromVision:!0}),(0,s.createElement)(Ux,{color:m,colorType:l||v})),(0,s.createElement)(Xy,{direction:"column",gap:2},(0,s.createElement)(Xx,{colorType:v,color:m,onChange:g,enableAlpha:n}))))}),"ColorPicker");var L_=A_;function z_(e){if(void 0!==e)return"string"==typeof e?e:e.hex?e.hex:void 0}const B_=ac()((e=>{const t=vp(e),n=t.toHex(),r=t.toRgb(),o=t.toHsv(),i=t.toHsl();return{hex:n,rgb:r,hsv:o,hsl:i,source:"hex",oldHue:i.h}}));const F_=e=>(0,s.createElement)(L_,function(e){const{onChangeComplete:t}=e,n=(0,s.useCallback)((e=>{t(B_(e))}),[t]);return function(e){var t;return void 0!==e.onChangeComplete||void 0!==e.disableAlpha||"string"==typeof(null===(t=e.color)||void 0===t?void 0:t.hex)}(e)?{color:z_(e.color),enableAlpha:!e.disableAlpha,onChange:n}:{...e,color:e.color,enableAlpha:e.enableAlpha,onChange:e.onChange}}(e));var V_=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));function H_(e){const{actions:t,className:n,options:r,children:o}=e;return(0,s.createElement)("div",{className:c()("components-circular-option-picker",n)},(0,s.createElement)("div",{className:"components-circular-option-picker__swatches"},r),o,t&&(0,s.createElement)("div",{className:"components-circular-option-picker__custom-clear-wrapper"},t))}H_.Option=function(e){const{className:t,isSelected:n,selectedIconProps:r,tooltipText:o,...i}=e,l=(0,s.createElement)(od,a({isPressed:n,className:"components-circular-option-picker__option"},i));return(0,s.createElement)("div",{className:c()(t,"components-circular-option-picker__option-wrapper")},o?(0,s.createElement)(Bf,{text:o},l):l,n&&(0,s.createElement)(sy,a({icon:V_},r||{})))},H_.ButtonAction=function(e){const{className:t,children:n,...r}=e;return(0,s.createElement)(od,a({className:c()("components-circular-option-picker__clear",t),variant:"tertiary"},r),n)},H_.DropdownLinkAction=function(e){const{buttonProps:t,className:n,dropdownProps:r,linkText:o}=e;return(0,s.createElement)(ny,a({className:c()("components-circular-option-picker__dropdown-link-action",n),renderToggle:e=>{let{isOpen:n,onToggle:r}=e;return(0,s.createElement)(od,a({"aria-expanded":n,"aria-haspopup":"true",onClick:r,variant:"link"},t),o)}},r))};var j_=Hu((function(e,t){const n=function(e){const{expanded:t=!1,...n}=Vu(e,"VStack");return Uv({direction:"column",expanded:t,...n})}(e);return(0,s.createElement)(ed,a({},n,{ref:t}))}),"VStack");var $_=Hu((function(e,t){const n=ah(e);return(0,s.createElement)(ed,a({as:"span"},n,{ref:t}))}),"Truncate");var W_=Hu((function(e,t){const n=function(e){const{as:t,level:n=2,...r}=Vu(e,"Heading"),o=t||`h${n}`,i={};return"string"==typeof o&&"h"!==o[0]&&(i.role="heading",i["aria-level"]="string"==typeof n?parseInt(n):n),{...Rh({color:Sp.gray[900],size:Th(n),isBlock:!0,weight:mh.fontWeightHeading,...r}),...i,as:o}}(e);return(0,s.createElement)(ed,a({},n,{ref:t}))}),"Heading");const U_=Ju(W_,{target:"ev9wop70"})({name:"13lxv2o",styles:"text-transform:uppercase;line-height:24px;font-weight:500;&&&{font-size:11px;margin-bottom:0;}"}),G_=Ju("div",{target:"eovvns30"})("margin-left:",Km(-2),";margin-right:",Km(-2),";&:first-of-type{margin-top:",Km(-2),";}&:last-of-type{margin-bottom:",Km(-2),";}",(e=>{let{paddingSize:t="small"}=e;if("none"===t)return;const n={small:Km(2),medium:Km(4)};return Wf("padding:",n[t]||n.small,";","")}),";");var Y_=Hu((function(e,t){const{paddingSize:n="small",...r}=Vu(e,"DropdownContentWrapper");return(0,s.createElement)(G_,a({},r,{paddingSize:n,ref:t}))}),"DropdownContentWrapper");yp([wp,ey]);const q_=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.colors)&&!("color"in t);var t}));function K_(e){let{className:t,clearColor:n,colors:r,onChange:o,value:i,actions:a}=e;const l=(0,s.useMemo)((()=>r.map(((e,t)=>{let{color:r,name:a}=e;const l=vp(r),c=i===r;return(0,s.createElement)(H_.Option,{key:`${r}-${t}`,isSelected:c,selectedIconProps:c?{fill:l.contrast()>l.contrast("#000")?"#fff":"#000"}:{},tooltipText:a||(0,u.sprintf)((0,u.__)("Color code: %s"),r),style:{backgroundColor:r,color:r},onClick:c?n:()=>o(r,t),"aria-label":a?(0,u.sprintf)((0,u.__)("Color: %s"),a):(0,u.sprintf)((0,u.__)("Color code: %s"),r)})}))),[r,i,o,n]);return(0,s.createElement)(H_,{className:t,options:l,actions:a})}function X_(e){let{className:t,clearColor:n,colors:r,onChange:o,value:i,actions:a}=e;return 0===r.length?null:(0,s.createElement)(j_,{spacing:3,className:t},r.map(((e,t)=>{let{name:l,colors:c}=e;return(0,s.createElement)(j_,{spacing:2,key:t},(0,s.createElement)(U_,null,l),(0,s.createElement)(K_,{clearColor:n,colors:c,onChange:e=>o(e,t),value:i,actions:r.length===t+1?a:null}))})))}function Z_(e){let{isRenderedInSidebar:t,popoverProps:n,...r}=e;const o=(0,s.useMemo)((()=>({shift:!0,...t?{placement:"left-start",offset:34}:{placement:"bottom",offset:8},...n})),[t,n]);return(0,s.createElement)(ny,a({contentClassName:"components-color-palette__custom-color-dropdown-content",popoverProps:o},r))}yp([wp,ey]);const J_=(0,s.forwardRef)((function(e,t){const{clearable:n=!0,colors:r=[],disableCustomColors:o=!1,enableAlpha:i=!1,onChange:l,value:c,__experimentalIsRenderedInSidebar:d=!1,...f}=e,[p,m]=(0,s.useState)(c),h=(0,s.useCallback)((()=>l(void 0)),[l]),g=(0,s.useCallback)((e=>{m(((e,t)=>{if(!/^var\(/.test(null!=e?e:"")||null===t)return e;const{ownerDocument:n}=t,{defaultView:r}=n,o=null==r?void 0:r.getComputedStyle(t).backgroundColor;return o?vp(o).toHex():e})(c,e))}),[c]),v=q_(r),b=(0,s.useMemo)((()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return"";const r=/^var\(/.test(e),o=r?e:vp(e).toHex(),i=n?t:[{colors:t}];for(const{colors:e}of i)for(const{name:t,color:n}of e)if(o===(r?n:vp(n).toHex()))return t;return(0,u.__)("Custom")}(c,r,v)),[c,r,v]),y=vp(null!=p?p:""),w=null!=c&&c.startsWith("#")?c.substring(1):null!=c?c:"",x=w?(0,u.sprintf)((0,u.__)('Custom color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),b,w):(0,u.__)("Custom color picker."),_={clearable:n,clearColor:h,onChange:l,value:c,actions:!!n&&(0,s.createElement)(H_.ButtonAction,{onClick:h},(0,u.__)("Clear"))};return(0,s.createElement)(j_,a({spacing:3,ref:t},f),!o&&(0,s.createElement)(Z_,{isRenderedInSidebar:d,renderContent:()=>(0,s.createElement)(Y_,{paddingSize:"none"},(0,s.createElement)(F_,{color:p,onChange:e=>l(e),enableAlpha:i})),renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(Zm,{as:"button",ref:g,justify:"space-between",align:"flex-start",className:"components-color-palette__custom-color","aria-expanded":t,"aria-haspopup":"true",onClick:n,"aria-label":x,style:(r=c,void 0===r||0===vp(r).alpha()?{color:"#000"}:{background:c,color:y.contrast()>y.contrast("#000")?"#fff":"#000"})},(0,s.createElement)($m,{isBlock:!0,as:$_,className:"components-color-palette__custom-color-name"},b),(0,s.createElement)($m,{as:"span",className:"components-color-palette__custom-color-value"},w));var r}}),v?(0,s.createElement)(X_,a({},_,{colors:r})):(0,s.createElement)(K_,a({},_,{colors:r})))}));var Q_=J_;const eE="web"===s.Platform.OS,tE={px:{value:"px",label:eE?"px":(0,u.__)("Pixels (px)"),a11yLabel:(0,u.__)("Pixels (px)"),step:1},"%":{value:"%",label:eE?"%":(0,u.__)("Percentage (%)"),a11yLabel:(0,u.__)("Percent (%)"),step:.1},em:{value:"em",label:eE?"em":(0,u.__)("Relative to parent font size (em)"),a11yLabel:(0,u._x)("ems","Relative to parent font size (em)"),step:.01},rem:{value:"rem",label:eE?"rem":(0,u.__)("Relative to root font size (rem)"),a11yLabel:(0,u._x)("rems","Relative to root font size (rem)"),step:.01},vw:{value:"vw",label:eE?"vw":(0,u.__)("Viewport width (vw)"),a11yLabel:(0,u.__)("Viewport width (vw)"),step:.1},vh:{value:"vh",label:eE?"vh":(0,u.__)("Viewport height (vh)"),a11yLabel:(0,u.__)("Viewport height (vh)"),step:.1},vmin:{value:"vmin",label:eE?"vmin":(0,u.__)("Viewport smallest dimension (vmin)"),a11yLabel:(0,u.__)("Viewport smallest dimension (vmin)"),step:.1},vmax:{value:"vmax",label:eE?"vmax":(0,u.__)("Viewport largest dimension (vmax)"),a11yLabel:(0,u.__)("Viewport largest dimension (vmax)"),step:.1},ch:{value:"ch",label:eE?"ch":(0,u.__)("Width of the zero (0) character (ch)"),a11yLabel:(0,u.__)("Width of the zero (0) character (ch)"),step:.01},ex:{value:"ex",label:eE?"ex":(0,u.__)("x-height of the font (ex)"),a11yLabel:(0,u.__)("x-height of the font (ex)"),step:.01},cm:{value:"cm",label:eE?"cm":(0,u.__)("Centimeters (cm)"),a11yLabel:(0,u.__)("Centimeters (cm)"),step:.001},mm:{value:"mm",label:eE?"mm":(0,u.__)("Millimeters (mm)"),a11yLabel:(0,u.__)("Millimeters (mm)"),step:.1},in:{value:"in",label:eE?"in":(0,u.__)("Inches (in)"),a11yLabel:(0,u.__)("Inches (in)"),step:.001},pc:{value:"pc",label:eE?"pc":(0,u.__)("Picas (pc)"),a11yLabel:(0,u.__)("Picas (pc)"),step:1},pt:{value:"pt",label:eE?"pt":(0,u.__)("Points (pt)"),a11yLabel:(0,u.__)("Points (pt)"),step:1}},nE=Object.values(tE),rE=[tE.px,tE["%"],tE.em,tE.rem,tE.vw,tE.vh],oE=tE.px;function iE(e,t,n){return sE(t?`${null!=e?e:""}${t}`:e,n)}function aE(e){return Array.isArray(e)&&!!e.length}function sE(e){var t,n;let r,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nE;if(void 0!==e||null===e){r=`${e}`.trim();const t=parseFloat(r);o=isFinite(t)?t:void 0}const a=null===(t=r)||void 0===t?void 0:t.match(/[\d.\-\+]*\s*(.*)/),s=null==a||null===(n=a[1])||void 0===n?void 0:n.toLowerCase();let l;if(aE(i)){const e=i.find((e=>e.value===s));l=null==e?void 0:e.value}else l=oE.value;return[o,l]}function lE(e,t,n,r){const[o,i]=sE(e,t),a=null!=o?o:n;let s=i||r;return!s&&aE(t)&&(s=t[0].value),[a,s]}const cE=e=>{let{units:t=nE,availableUnits:n=[],defaultValues:r}=e;const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return Array.isArray(t)?t.filter((t=>e.includes(t.value))):[]}(n,t);return r&&o.forEach(((e,t)=>{if(r[e.value]){const[n]=sE(r[e.value]);o[t].default=n}})),o};function uE(e){const{border:t,className:n,colors:r=[],enableAlpha:o=!1,enableStyle:i=!0,onChange:a,previousStyleSelection:l,size:c="default",__experimentalIsRenderedInSidebar:u=!1,...d}=Vu(e,"BorderControlDropdown"),[f]=sE(null==t?void 0:t.width),p=0===f,m=Fu(),h=(0,s.useMemo)((()=>m((e=>Wf("background:#fff;&&>button{height:","__unstable-large"===e?"40px":"30px",";width:","__unstable-large"===e?"40px":"30px",";padding:0;display:flex;align-items:center;justify-content:center;",Bh({borderRadius:"2px 0 0 2px"},{borderRadius:"0 2px 2px 0"})()," border:",mh.borderWidth," solid ",Sp.ui.border,";&:focus,&:hover:not( :disabled ){",Bb," border-color:",Sp.ui.borderFocus,";z-index:1;position:relative;}}",""))(c),n)),[n,m,c]),g=(0,s.useMemo)((()=>m(Wb)),[m]),v=(0,s.useMemo)((()=>m(Hb(t,c))),[t,m,c]),b=(0,s.useMemo)((()=>m(jb)),[m]),y=(0,s.useMemo)((()=>m($b)),[m]),w=(0,s.useMemo)((()=>m(Ub)),[m]);return{...d,border:t,className:h,colors:r,enableAlpha:o,enableStyle:i,indicatorClassName:g,indicatorWrapperClassName:v,onColorChange:e=>{const n="none"===(null==t?void 0:t.style)?l:null==t?void 0:t.style,r=p&&e?"1px":null==t?void 0:t.width;a({color:e,style:n,width:r})},onStyleChange:e=>{const n=p&&e?"1px":null==t?void 0:t.width;a({...t,style:e,width:n})},onReset:()=>{a({...t,color:void 0,style:void 0})},popoverContentClassName:y,popoverControlsClassName:b,resetButtonClassName:w,__experimentalIsRenderedInSidebar:u}}const dE=Hu(((e,t)=>{const{__experimentalIsRenderedInSidebar:n,border:r,colors:o,disableCustomColors:i,enableAlpha:l,enableStyle:c,indicatorClassName:d,indicatorWrapperClassName:f,onReset:p,onColorChange:m,onStyleChange:h,popoverContentClassName:g,popoverControlsClassName:v,resetButtonClassName:b,showDropdownHeader:y,__unstablePopoverProps:w,...x}=uE(e),{color:_,style:E}=r||{},C=((e,t)=>{if(e&&t){if(q_(t)){let n;return t.some((t=>t.colors.some((t=>t.color===e&&(n=t,!0))))),n}return t.find((t=>t.color===e))}})(_,o),k=((e,t,n,r)=>r?t?n?(0,u.sprintf)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s". The currently selected style is "%3$s".',t.name,t.color,n):(0,u.sprintf)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s".',t.name,t.color):e?n?(0,u.sprintf)('Border color and style picker. The currently selected color has a value of "%1$s". The currently selected style is "%2$s".',e,n):(0,u.sprintf)('Border color and style picker. The currently selected color has a value of "%1$s".',e):(0,u.__)("Border color and style picker."):t?(0,u.sprintf)('Border color picker. The currently selected color is called "%1$s" and has a value of "%2$s".',t.name,t.color):e?(0,u.sprintf)('Border color picker. The currently selected color has a value of "%1$s".',e):(0,u.__)("Border color picker."))(_,C,E,c),S=_||E&&"none"!==E,T=n?"bottom left":void 0;return(0,s.createElement)(ny,a({renderToggle:e=>{let{onToggle:t}=e;return(0,s.createElement)(od,{onClick:t,variant:"tertiary","aria-label":k,tooltipPosition:T,label:(0,u.__)("Border color and style picker"),showTooltip:!0},(0,s.createElement)("span",{className:f},(0,s.createElement)(Zb,{className:d,colorValue:_})))},renderContent:e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Y_,{paddingSize:"medium"},(0,s.createElement)(j_,{className:v,spacing:6},y?(0,s.createElement)(Gv,null,(0,s.createElement)(Ev,null,(0,u.__)("Border color")),(0,s.createElement)(od,{isSmall:!0,label:(0,u.__)("Close border color"),icon:Rb,onClick:t})):void 0,(0,s.createElement)(Q_,{className:g,value:_,onChange:m,colors:o,disableCustomColors:i,__experimentalIsRenderedInSidebar:n,clearable:!1,enableAlpha:l}),c&&(0,s.createElement)(Xb,{label:(0,u.__)("Style"),value:E,onChange:h}))),S&&(0,s.createElement)(Y_,{paddingSize:"none"},(0,s.createElement)(od,{className:b,variant:"tertiary",onClick:()=>{p(),t()}},(0,u.__)("Reset to default"))))},popoverProps:{...w}},x,{ref:t}))}),"BorderControlDropdown");var fE=dE;function pE(e){let{className:t,isUnitSelectTabbable:n=!0,onChange:r,size:o="default",unit:i="px",units:l=rE,...u}=e;if(!aE(l)||1===(null==l?void 0:l.length))return(0,s.createElement)(Ab,{className:"components-unit-control__unit-label",selectSize:o},i);const d=c()("components-unit-control__select",t);return(0,s.createElement)(Lb,a({className:d,onChange:e=>{const{value:t}=e.target,n=l.find((e=>e.value===t));null==r||r(t,{event:e,data:n})},selectSize:o,tabIndex:n?void 0:-1,value:i},u),l.map((e=>(0,s.createElement)("option",{value:e.value,key:e.value},e.label))))}const mE=(0,s.forwardRef)((function(e,t){const{__unstableStateReducer:n,autoComplete:r="off",children:o,className:i,disabled:l=!1,disableUnits:d=!1,isPressEnterToChange:f=!1,isResetValueOnUnitChange:p=!1,isUnitSelectTabbable:m=!0,label:h,onChange:g,onUnitChange:v,size:b="default",unit:y,units:w=rE,value:x,onBlur:_,onFocus:E,...C}=e;"unit"in e&&ql()("UnitControl unit prop",{since:"5.6",hint:"The unit should be provided within the `value` prop.",version:"6.2"});const k=null!=x?x:void 0,S=(0,s.useMemo)((()=>function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:nE;const r=Array.isArray(n)?[...n]:[],[,o]=iE(e,t,nE);return o&&!r.some((e=>e.value===o))&&tE[o]&&r.unshift(tE[o]),r}(k,y,w)),[k,y,w]),[T,N]=iE(k,y,S),[R,I]=my(1===S.length?S[0].value:y,{initial:N,fallback:""});(0,s.useEffect)((()=>{void 0!==N&&I(N)}),[N,I]);const M=(0,s.useRef)(void 0),P=c()("components-unit-control","components-unit-control-wrapper",i),O=e=>{if(!isNaN(Number(e.currentTarget.value)))return void(M.current=void 0);const[t,n]=lE(e.currentTarget.value,S,T,R);if(M.current=t,f&&n!==R){const t={event:e,data:Array.isArray(S)?S.find((e=>e.value===n)):void 0};null==v||v(n,t),I(n)}},D=(e,t)=>{const n={...e};var r;t.type===nv&&(void 0!==M.current&&(n.value=(null!==(r=M.current)&&void 0!==r?r:"").toString(),M.current=void 0));return n};let A=D;n&&(A=(e,t)=>{const r=D(e,t);return n(r,t)});const L=d?null:(0,s.createElement)(pE,{"aria-label":(0,u.__)("Select unit"),disabled:l,isUnitSelectTabbable:m,onChange:(e,t)=>{const{data:n}=t;let r=`${null!=T?T:""}${e}`;p&&void 0!==(null==n?void 0:n.default)&&(r=`${n.default}${e}`),null==g||g(r,t),null==v||v(e,t),I(e)},size:b,unit:R,units:S,onBlur:_,onFocus:E});let z=C.step;if(!z&&S){var B;const e=S.find((e=>e.value===R));z=null!==(B=null==e?void 0:e.step)&&void 0!==B?B:1}return(0,s.createElement)(Ob,a({type:f?"text":"number"},C,{autoComplete:r,className:P,disabled:l,spinControls:"none",isPressEnterToChange:f,label:h,onBlur:e=>{O(e),null==_||_(e)},onKeyDown:e=>{const{key:t}=e;"Enter"===t&&O(e)},onChange:(e,t)=>{if(""===e||null==e)return void(null==g||g("",t));const n=lE(e,S,T,R).join("");null==g||g(n,t)},ref:t,size:b,suffix:L,value:null!=T?T:"",step:z,__unstableStateReducer:A,onFocus:E}))}));var hE=mE;function gE(e){const{className:t,colors:n=[],isCompact:r,onChange:o,enableAlpha:i=!0,enableStyle:a=!0,shouldSanitizeBorder:l=!0,size:c="default",value:u,width:d,__experimentalIsRenderedInSidebar:f=!1,...p}=Vu(e,"BorderControl"),[m,h]=sE(null==u?void 0:u.width),g=h||"px",v=0===m,[b,y]=(0,s.useState)(),[w,x]=(0,s.useState)(),_=(0,s.useCallback)((e=>{if(l)return o((e=>{const t=void 0===(null==e?void 0:e.width)||""===e.width,n=void 0===(null==e?void 0:e.color);if(!t||!n)return e})(e));o(e)}),[o,l]),E=(0,s.useCallback)((e=>{const t=""===e?void 0:e,[n]=sE(e),r=0===n,o={...u,width:t};r&&!v&&(y(null==u?void 0:u.color),x(null==u?void 0:u.style),o.color=void 0,o.style="none"),!r&&v&&(void 0===o.color&&(o.color=b),"none"===o.style&&(o.style=w)),_(o)}),[u,v,b,w,_]),C=(0,s.useCallback)((e=>{E(`${e}${g}`)}),[E,g]),k=Fu(),S=(0,s.useMemo)((()=>k(Fb,t)),[t,k]);let T=d;r&&(T="__unstable-large"===c?"116px":"90px");const N=(0,s.useMemo)((()=>{const e=!!T&&Vb,t=(e=>Wf("height:","__unstable-large"===e?"40px":"30px",";",""))(c);return k(Wf(Ob,"{flex:1 1 40%;}&& ",Lb,"{min-height:0;}",""),e,t)}),[T,k,c]),R=(0,s.useMemo)((()=>k(Wf("flex:1 1 60%;",Bh({marginRight:Km(3)})(),";",""))),[k]);return{...p,className:S,colors:n,enableAlpha:i,enableStyle:a,innerWrapperClassName:N,inputWidth:T,onBorderChange:_,onSliderChange:C,onWidthChange:E,previousStyleSelection:w,sliderClassName:R,value:u,widthUnit:g,widthValue:m,size:c,__experimentalIsRenderedInSidebar:f}}const vE=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,s.createElement)(td,{as:"legend"},t):(0,s.createElement)(Ev,{as:"legend"},t):null},bE=Hu(((e,t)=>{const{colors:n,disableCustomColors:r,disableUnits:o,enableAlpha:i,enableStyle:l,hideLabelFromVision:c,innerWrapperClassName:d,inputWidth:f,label:p,onBorderChange:m,onSliderChange:h,onWidthChange:g,placeholder:v,__unstablePopoverProps:b,previousStyleSelection:y,showDropdownHeader:w,size:x,sliderClassName:_,value:E,widthUnit:C,widthValue:k,withSlider:S,__experimentalIsRenderedInSidebar:T,...N}=gE(e);return(0,s.createElement)(ed,a({as:"fieldset"},N,{ref:t}),(0,s.createElement)(vE,{label:p,hideLabelFromVision:c}),(0,s.createElement)(Gv,{spacing:4,className:d},(0,s.createElement)(hE,{prefix:(0,s.createElement)(fE,{border:E,colors:n,__unstablePopoverProps:b,disableCustomColors:r,enableAlpha:i,enableStyle:l,onChange:m,previousStyleSelection:y,showDropdownHeader:w,__experimentalIsRenderedInSidebar:T,size:x}),label:(0,u.__)("Border width"),hideLabelFromVision:!0,min:0,onChange:g,value:(null==E?void 0:E.width)||"",placeholder:v,disableUnits:o,__unstableInputWidth:f,size:x}),S&&(0,s.createElement)($y,{__nextHasNoMarginBottom:!0,label:(0,u.__)("Border width"),hideLabelFromVision:!0,className:_,initialPosition:0,max:100,min:0,onChange:h,step:["px","%"].includes(C)?1:.1,value:k||void 0,withInputField:!1})))}),"BorderControl");var yE=bE;const wE={bottom:{alignItems:"flex-end",justifyContent:"center"},bottomLeft:{alignItems:"flex-start",justifyContent:"flex-end"},bottomRight:{alignItems:"flex-end",justifyContent:"flex-end"},center:{alignItems:"center",justifyContent:"center"},spaced:{alignItems:"center",justifyContent:"space-between"},left:{alignItems:"center",justifyContent:"flex-start"},right:{alignItems:"center",justifyContent:"flex-end"},stretch:{alignItems:"stretch"},top:{alignItems:"flex-start",justifyContent:"center"},topLeft:{alignItems:"flex-start",justifyContent:"flex-start"},topRight:{alignItems:"flex-start",justifyContent:"flex-end"}};function xE(e){const{align:t,alignment:n,className:r,columnGap:o,columns:i=2,gap:a=3,isInline:l=!1,justify:c,rowGap:u,rows:d,templateColumns:f,templateRows:p,...m}=Vu(e,"Grid"),h=qm(Array.isArray(i)?i:[i]),g=qm(Array.isArray(d)?d:[d]),v=f||!!i&&`repeat( ${h}, 1fr )`,b=p||!!d&&`repeat( ${g}, 1fr )`,y=Fu();return{...m,className:(0,s.useMemo)((()=>{const e=function(e){return e?wE[e]:{}}(n),i=Wf({alignItems:t,display:l?"inline-grid":"grid",gap:`calc( ${mh.gridBase} * ${a} )`,gridTemplateColumns:v||void 0,gridTemplateRows:b||void 0,gridRowGap:u,gridColumnGap:o,justifyContent:c,verticalAlign:l?"middle":void 0,...e},"","");return y(i,r)}),[t,n,r,o,y,a,v,b,l,c,u])}}var _E=Hu((function(e,t){const n=xE(e);return(0,s.createElement)(ed,a({},n,{ref:t}))}),"Grid");function EE(e){const{className:t,colors:n=[],enableAlpha:r=!1,enableStyle:o=!0,size:i="default",__experimentalIsRenderedInSidebar:a=!1,...l}=Vu(e,"BorderBoxControlSplitControls"),c=Fu(),u=(0,s.useMemo)((()=>c((e=>Wf("position:relative;flex:1;width:","__unstable-large"===e?void 0:"80%",";",""))(i),t)),[c,t,i]);return{...l,centeredClassName:(0,s.useMemo)((()=>c(Cb,t)),[c,t]),className:u,colors:n,enableAlpha:r,enableStyle:o,rightAlignedClassName:(0,s.useMemo)((()=>c(Wf(Bh({marginLeft:"auto"})(),";",""),t)),[c,t]),size:i,__experimentalIsRenderedInSidebar:a}}var CE=Hu(((e,t)=>{const{centeredClassName:n,colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:l,onChange:c,popoverPlacement:f,popoverOffset:p,rightAlignedClassName:m,size:h="default",value:g,__experimentalIsRenderedInSidebar:v,...b}=EE(e),[y,w]=(0,s.useState)(null),x=(0,s.useMemo)((()=>f?{placement:f,offset:p,anchor:y,shift:!0}:void 0),[f,p,y]),_={colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:l,isCompact:!0,__experimentalIsRenderedInSidebar:v,size:h},E=(0,d.useMergeRefs)([w,t]);return(0,s.createElement)(_E,a({},b,{ref:E,gap:4}),(0,s.createElement)(Nb,{value:g,size:h}),(0,s.createElement)(yE,a({className:n,hideLabelFromVision:!0,label:(0,u.__)("Top border"),onChange:e=>c(e,"top"),__unstablePopoverProps:x,value:null==g?void 0:g.top},_)),(0,s.createElement)(yE,a({hideLabelFromVision:!0,label:(0,u.__)("Left border"),onChange:e=>c(e,"left"),__unstablePopoverProps:x,value:null==g?void 0:g.left},_)),(0,s.createElement)(yE,a({className:m,hideLabelFromVision:!0,label:(0,u.__)("Right border"),onChange:e=>c(e,"right"),__unstablePopoverProps:x,value:null==g?void 0:g.right},_)),(0,s.createElement)(yE,a({className:n,hideLabelFromVision:!0,label:(0,u.__)("Bottom border"),onChange:e=>c(e,"bottom"),__unstablePopoverProps:x,value:null==g?void 0:g.bottom},_)))}),"BorderBoxControlSplitControls");const kE=/^([\d.\-+]*)\s*(fr|cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|vw|vh|vmin|vmax|%|cap|ic|rlh|vi|vb|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?$/;const SE=["top","right","bottom","left"],TE=["color","style","width"],NE=e=>!e||!TE.some((t=>void 0!==e[t])),RE=e=>{if(!e)return!1;if(IE(e)){return!SE.every((t=>NE(e[t])))}return!NE(e)},IE=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).some((e=>-1!==SE.indexOf(e)))},ME=e=>{if(!IE(e))return!1;const t=SE.map((t=>PE(null==e?void 0:e[t])));return!t.every((e=>e===t[0]))},PE=(e,t)=>{if(NE(e))return t;const{color:n,style:r,width:o}=t||{},{color:i=n,style:a=r,width:s=o}=e;return[s,!!s&&"0"!==s||!!i?a||"solid":a,i].filter(Boolean).join(" ")},OE=e=>function(e){if(0===e.length)return;const t={};let n,r=0;return e.forEach((e=>{t[e]=void 0===t[e]?1:t[e]+1,t[e]>r&&(n=e,r=t[e])})),n}(e.map((e=>void 0===e?void 0:function(e){const t=e.trim().match(kE);if(!t)return[void 0,void 0];const[,n,r]=t;let o=parseFloat(n);return o=Number.isNaN(o)?void 0:o,[o,r]}(`${e}`)[1])).filter((e=>void 0!==e)));function DE(e){const{className:t,colors:n=[],onChange:r,enableAlpha:o=!1,enableStyle:i=!0,size:a="default",value:l,__experimentalIsRenderedInSidebar:c=!1,...u}=Vu(e,"BorderBoxControl"),d=ME(l),f=IE(l),p=f?(e=>{if(!e)return;const t=[],n=[],r=[];SE.forEach((o=>{var i,a,s;t.push(null===(i=e[o])||void 0===i?void 0:i.color),n.push(null===(a=e[o])||void 0===a?void 0:a.style),r.push(null===(s=e[o])||void 0===s?void 0:s.width)}));const o=t.every((e=>e===t[0])),i=n.every((e=>e===n[0])),a=r.every((e=>e===r[0]));return{color:o?t[0]:void 0,style:i?n[0]:void 0,width:a?r[0]:OE(r)}})(l):l,m=f?l:(e=>{if(e&&!NE(e))return{top:e,right:e,bottom:e,left:e}})(l),h=!isNaN(parseFloat(`${null==p?void 0:p.width}`)),[g,v]=(0,s.useState)(!d),b=Fu(),y=(0,s.useMemo)((()=>b(xb,t)),[b,t]),w=(0,s.useMemo)((()=>b(Wf("flex:1;",Bh({marginRight:"24px"})(),";",""))),[b]),x=(0,s.useMemo)((()=>b(_b)),[b]);return{...u,className:y,colors:n,disableUnits:d&&!h,enableAlpha:o,enableStyle:i,hasMixedBorders:d,isLinked:g,linkedControlClassName:w,onLinkedChange:e=>{if(!e)return r(void 0);if(!d||(t=e)&&TE.every((e=>void 0!==t[e])))return r(NE(e)?void 0:e);var t;const n=((e,t)=>{const n={};return e.color!==t.color&&(n.color=t.color),e.style!==t.style&&(n.style=t.style),e.width!==t.width&&(n.width=t.width),n})(p,e),o={top:{...null==l?void 0:l.top,...n},right:{...null==l?void 0:l.right,...n},bottom:{...null==l?void 0:l.bottom,...n},left:{...null==l?void 0:l.left,...n}};if(ME(o))return r(o);const i=NE(o.top)?void 0:o.top;r(i)},onSplitChange:(e,t)=>{const n={...m,[t]:e};ME(n)?r(n):r(e)},toggleLinked:()=>v(!g),linkedValue:p,size:a,splitValue:m,wrapperClassName:x,__experimentalIsRenderedInSidebar:c}}const AE=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,s.createElement)(td,{as:"label"},t):(0,s.createElement)(Ev,null,t):null},LE=Hu(((e,t)=>{const{className:n,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:l,enableStyle:c,hasMixedBorders:f,hideLabelFromVision:p,isLinked:m,label:h,linkedControlClassName:g,linkedValue:v,onLinkedChange:b,onSplitChange:y,popoverPlacement:w,popoverOffset:x,size:_,splitValue:E,toggleLinked:C,wrapperClassName:k,__experimentalIsRenderedInSidebar:S,...T}=DE(e),[N,R]=(0,s.useState)(null),I=(0,s.useMemo)((()=>w?{placement:w,offset:x,anchor:N,shift:!0}:void 0),[w,x,N]),M=(0,d.useMergeRefs)([R,t]);return(0,s.createElement)(ed,a({className:n},T,{ref:M}),(0,s.createElement)(AE,{label:h,hideLabelFromVision:p}),(0,s.createElement)(ed,{className:k},m?(0,s.createElement)(yE,{className:g,colors:r,disableUnits:i,disableCustomColors:o,enableAlpha:l,enableStyle:c,onChange:b,placeholder:f?(0,u.__)("Mixed"):void 0,__unstablePopoverProps:I,shouldSanitizeBorder:!1,value:v,withSlider:!0,width:"__unstable-large"===_?"116px":"110px",__experimentalIsRenderedInSidebar:S,size:_}):(0,s.createElement)(CE,{colors:r,disableCustomColors:o,enableAlpha:l,enableStyle:c,onChange:y,popoverPlacement:w,popoverOffset:x,value:E,__experimentalIsRenderedInSidebar:S,size:_}),(0,s.createElement)(Sb,{onClick:C,isLinked:m,size:_})))}),"BorderBoxControl");var zE=LE;const BE=Ju("div",{target:"e7pk0lh6"})({name:"14bvcyk",styles:"box-sizing:border-box;max-width:235px;padding-bottom:12px;width:100%"}),FE=Ju(Zm,{target:"e7pk0lh5"})({name:"5bhc30",styles:"margin-bottom:8px"}),VE=Ju(Zm,{target:"e7pk0lh4"})({name:"aujtid",styles:"min-height:30px;gap:0"}),HE=Ju("div",{target:"e7pk0lh3"})({name:"112jwab",styles:"box-sizing:border-box;max-width:80px"}),jE=Ju(Zm,{target:"e7pk0lh2"})({name:"xy18ro",styles:"justify-content:center;padding-top:8px"}),$E=Ju(Zm,{target:"e7pk0lh1"})({name:"3tw5wk",styles:"position:relative;height:100%;width:100%;justify-content:flex-start"});var WE={name:"1ch9yvl",styles:"border-radius:0"},UE={name:"tg3mx0",styles:"border-radius:2px"};const GE=e=>{let{isFirst:t,isLast:n,isOnly:r}=e;return t?Bh({borderTopRightRadius:0,borderBottomRightRadius:0})():n?Bh({borderTopLeftRadius:0,borderBottomLeftRadius:0})():r?UE:WE},YE=e=>{let{isFirst:t,isOnly:n}=e;return Bh({marginLeft:t||n?0:-1})()},qE=Ju(hE,{target:"e7pk0lh0"})("max-width:60px;",GE,";",YE,";"),KE=()=>{};function XE(e){let{isFirst:t,isLast:n,isOnly:r,onHoverOn:o=KE,onHoverOff:i=KE,label:l,value:c,...u}=e;const d=(f=e=>{let{event:t,...n}=e;n.hovering?o(t,n):i(t,n)},Vg(jg),Jg({hover:f},p||{},"hover"));var f,p;return(0,s.createElement)(HE,d(),(0,s.createElement)(ZE,{text:l},(0,s.createElement)(qE,a({"aria-label":l,className:"component-box-control__unit-control",isFirst:t,isLast:n,isOnly:r,isPressEnterToChange:!0,isResetValueOnUnitChange:!1,value:c},u))))}function ZE(e){let{children:t,text:n}=e;return n?(0,s.createElement)(Bf,{text:n,position:"top"},(0,s.createElement)("div",null,t)):t}const JE={all:(0,u.__)("All"),top:(0,u.__)("Top"),bottom:(0,u.__)("Bottom"),left:(0,u.__)("Left"),right:(0,u.__)("Right"),mixed:(0,u.__)("Mixed"),vertical:(0,u.__)("Vertical"),horizontal:(0,u.__)("Horizontal")},QE={top:void 0,right:void 0,bottom:void 0,left:void 0},eC=["top","right","bottom","left"];function tC(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function nC(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eC;const r=sC(n),o=r.map((t=>sE(e[t]))),i=o.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),a=o.map((e=>e[1])),s=i.every((e=>e===i[0]))?i[0]:"";let l;var c;"number"==typeof s?l=tC(a):l=null!==(c=rC(t))&&void 0!==c?c:tC(a);return[s,l].join("")}function rC(e){if(!e||"object"!=typeof e)return;return tC(Object.values(e).filter(Boolean))}function oC(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eC;const r=nC(e,t,n),o=isNaN(parseFloat(r));return o}function iC(e){return void 0!==e&&Object.values(e).filter((e=>!!e&&/\d/.test(e))).length>0}function aC(e,t){let n="all";return e||(n=t?"vertical":"top"),n}function sC(e){const t=[];if(null==e||!e.length)return eC;if(e.includes("vertical"))t.push("top","bottom");else if(e.includes("horizontal"))t.push("left","right");else{const n=eC.filter((t=>e.includes(t)));t.push(...n)}return t}function lC(e,t,n){const r={...e};return null!=n&&n.length?n.forEach((e=>{"vertical"===e?(r.top=t,r.bottom=t):"horizontal"===e?(r.left=t,r.right=t):r[e]=t})):eC.forEach((e=>r[e]=t)),r}const cC=()=>{};function uC(e){let{onChange:t=cC,onFocus:n=cC,onHoverOn:r=cC,onHoverOff:o=cC,values:i,sides:l,selectedUnits:c,setSelectedUnits:u,...d}=e;const f=nC(i,c,l),p=iC(i)&&oC(i,c,l),m=p?JE.mixed:null;return(0,s.createElement)(XE,a({},d,{disableUnits:p,isOnly:!0,value:f,onChange:e=>{const n=!isNaN(parseFloat(e)),r=lC(i,n?e:void 0,l);t(r)},onUnitChange:e=>{const t=lC(c,e,l);u(t)},onFocus:e=>{n(e,{side:"all"})},onHoverOn:()=>{r({top:!0,bottom:!0,left:!0,right:!0})},onHoverOff:()=>{o({top:!1,bottom:!1,left:!1,right:!1})},placeholder:m}))}const dC=()=>{};function fC(e){let{onChange:t=dC,onFocus:n=dC,onHoverOn:r=dC,onHoverOff:o=dC,values:i,selectedUnits:l,setSelectedUnits:c,sides:u,...d}=e;const f=e=>t=>{n(t,{side:e})},p=e=>()=>{r({[e]:!0})},m=e=>()=>{o({[e]:!1})},h=e=>(n,r)=>{let{event:o}=r;const{altKey:a}=o,s={...i},l=!isNaN(parseFloat(n))?n:void 0;if(s[e]=l,a)switch(e){case"top":s.bottom=l;break;case"bottom":s.top=l;break;case"left":s.right=l;break;case"right":s.left=l}(e=>{t(e)})(s)},g=e=>t=>{const n={...l};n[e]=t,c(n)},v=null!=u&&u.length?eC.filter((e=>u.includes(e))):eC,b=v[0],y=v[v.length-1],w=b===y&&b;return(0,s.createElement)(jE,{className:"component-box-control__input-controls-wrapper"},(0,s.createElement)($E,{gap:0,align:"top",className:"component-box-control__input-controls"},v.map((e=>{const[t,n]=sE(i[e]),r=i[e]?n:l[e];return(0,s.createElement)(XE,a({},d,{isFirst:b===e,isLast:y===e,isOnly:w===e,value:[t,r].join(""),onChange:h(e),onUnitChange:g(e),onFocus:f(e),onHoverOn:p(e),onHoverOff:m(e),label:JE[e],key:`box-control-${e}`}))}))))}const pC=["vertical","horizontal"];function mC(e){let{onChange:t,onFocus:n,onHoverOn:r,onHoverOff:o,values:i,selectedUnits:l,setSelectedUnits:c,sides:u,...d}=e;const f=e=>t=>{n&&n(t,{side:e})},p=e=>()=>{r&&("vertical"===e&&r({top:!0,bottom:!0}),"horizontal"===e&&r({left:!0,right:!0}))},m=e=>()=>{o&&("vertical"===e&&o({top:!1,bottom:!1}),"horizontal"===e&&o({left:!1,right:!1}))},h=e=>n=>{if(!t)return;const r={...i},o=!isNaN(parseFloat(n))?n:void 0;"vertical"===e&&(r.top=o,r.bottom=o),"horizontal"===e&&(r.left=o,r.right=o),t(r)},g=e=>t=>{const n={...l};"vertical"===e&&(n.top=t,n.bottom=t),"horizontal"===e&&(n.left=t,n.right=t),c(n)},v=null!=u&&u.length?pC.filter((e=>u.includes(e))):pC,b=v[0],y=v[v.length-1],w=b===y&&b;return(0,s.createElement)($E,{gap:0,align:"top",className:"component-box-control__vertical-horizontal-input-controls"},v.map((e=>{const[t,n]=sE("vertical"===e?i.top:i.left),r="vertical"===e?l.top:l.left;return(0,s.createElement)(XE,a({},d,{isFirst:b===e,isLast:y===e,isOnly:w===e,value:[t,null!=r?r:n].join(""),onChange:h(e),onUnitChange:g(e),onFocus:f(e),onHoverOn:p(e),onHoverOff:m(e),label:JE[e],key:e}))})))}const hC=Ju("span",{target:"eaw9yqk8"})({name:"1w884gc",styles:"box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px"}),gC=Ju("span",{target:"eaw9yqk7"})({name:"i6vjox",styles:"box-sizing:border-box;display:block;position:relative;width:100%;height:100%"}),vC=Ju("span",{target:"eaw9yqk6"})("box-sizing:border-box;display:block;pointer-events:none;position:absolute;",(e=>{let{isFocused:t}=e;return Wf({backgroundColor:"currentColor",opacity:t?1:.3},"","")}),";"),bC=Ju(vC,{target:"eaw9yqk5"})({name:"1k2w39q",styles:"bottom:3px;top:3px;width:2px"}),yC=Ju(vC,{target:"eaw9yqk4"})({name:"1q9b07k",styles:"height:2px;left:3px;right:3px"}),wC=Ju(yC,{target:"eaw9yqk3"})({name:"abcix4",styles:"top:0"}),xC=Ju(bC,{target:"eaw9yqk2"})({name:"1wf8jf",styles:"right:0"}),_C=Ju(yC,{target:"eaw9yqk1"})({name:"8tapst",styles:"bottom:0"}),EC=Ju(bC,{target:"eaw9yqk0"})({name:"1ode3cm",styles:"left:0"});function CC(e){let{size:t=24,side:n="all",sides:r,...o}=e;const i=e=>!(e=>(null==r?void 0:r.length)&&!r.includes(e))(e)&&("all"===n||n===e),l=i("top")||i("vertical"),c=i("right")||i("horizontal"),u=i("bottom")||i("vertical"),d=i("left")||i("horizontal"),f=t/24;return(0,s.createElement)(hC,a({style:{transform:`scale(${f})`}},o),(0,s.createElement)(gC,null,(0,s.createElement)(wC,{isFocused:l}),(0,s.createElement)(xC,{isFocused:c}),(0,s.createElement)(_C,{isFocused:u}),(0,s.createElement)(EC,{isFocused:d})))}function kC(e){let{isLinked:t,...n}=e;const r=t?(0,u.__)("Unlink sides"):(0,u.__)("Link sides");return(0,s.createElement)(Bf,{text:r},(0,s.createElement)(od,a({},n,{className:"component-box-control__linked-button",isSmall:!0,icon:t?yb:wb,iconSize:24,"aria-label":r})))}const SC={min:0},TC=()=>{};function NC(e){let{id:t,inputProps:n=SC,onChange:r=TC,label:o=(0,u.__)("Box Control"),values:i,units:l,sides:c,splitOnAxis:f=!1,allowReset:p=!0,resetValues:m=QE,onMouseOver:h,onMouseOut:g}=e;const[v,b]=my(i,{fallback:QE}),y=v||QE,w=iC(i),x=1===(null==c?void 0:c.length),[_,E]=(0,s.useState)(w),[C,k]=(0,s.useState)(!w||!oC(y)||x),[S,T]=(0,s.useState)(aC(C,f)),[N,R]=(0,s.useState)({top:sE(null==i?void 0:i.top)[1],right:sE(null==i?void 0:i.right)[1],bottom:sE(null==i?void 0:i.bottom)[1],left:sE(null==i?void 0:i.left)[1]}),I=function(e){const t=(0,d.useInstanceId)(NC,"inspector-box-control");return e||t}(t),M=`${I}-heading`,P={...n,onChange:e=>{r(e),b(e),E(!0)},onFocus:(e,t)=>{let{side:n}=t;T(n)},isLinked:C,units:l,selectedUnits:N,setSelectedUnits:R,sides:c,values:y,onMouseOver:h,onMouseOut:g};return(0,s.createElement)(BE,{id:I,role:"group","aria-labelledby":M},(0,s.createElement)(FE,{className:"component-box-control__header"},(0,s.createElement)($m,null,(0,s.createElement)(Tv.VisualLabel,{id:M},o)),p&&(0,s.createElement)($m,null,(0,s.createElement)(od,{className:"component-box-control__reset-button",isSecondary:!0,isSmall:!0,onClick:()=>{r(m),b(m),R(m),E(!1)},disabled:!_},(0,u.__)("Reset")))),(0,s.createElement)(VE,{className:"component-box-control__header-control-wrapper"},(0,s.createElement)($m,null,(0,s.createElement)(CC,{side:S,sides:c})),C&&(0,s.createElement)(jm,null,(0,s.createElement)(uC,a({"aria-label":o},P))),!C&&f&&(0,s.createElement)(jm,null,(0,s.createElement)(mC,P)),!x&&(0,s.createElement)($m,null,(0,s.createElement)(kC,{onClick:()=>{k(!C),T(aC(!C,f))},isLinked:C}))),!C&&!f&&(0,s.createElement)(fC,P))}var RC=(0,s.forwardRef)((function(e,t){const{className:n,...r}=e,o=c()("components-button-group",n);return(0,s.createElement)("div",a({ref:t,role:"group",className:o},r))}));const IC={name:"12ip69d",styles:"background:transparent;display:block;margin:0!important;pointer-events:none;position:absolute;will-change:box-shadow"};function MC(e){return`0 ${e}px ${2*e}px 0\n\t${`rgba(0, 0, 0, ${e/20})`}`}const PC=Hu((function(e,t){const n=function(e){const{active:t,borderRadius:n="inherit",className:r,focus:o,hover:i,isInteractive:a=!1,offset:l=0,value:c=0,...u}=Vu(e,"Elevation"),d=Fu();return{...u,className:(0,s.useMemo)((()=>{let e=Qm(i)?i:2*c,s=Qm(t)?t:c/2;a||(e=Qm(i)?i:void 0,s=Qm(t)?t:void 0);const u=`box-shadow ${mh.transitionDuration} ${mh.transitionTimingFunction}`,f={};return f.Base=Wf({borderRadius:n,bottom:l,boxShadow:MC(c),opacity:mh.elevationIntensity,left:l,right:l,top:l,transition:u},Tp("transition"),"",""),Qm(e)&&(f.hover=Wf("*:hover>&{box-shadow:",MC(e),";}","")),Qm(s)&&(f.active=Wf("*:active>&{box-shadow:",MC(s),";}","")),Qm(o)&&(f.focus=Wf("*:focus>&{box-shadow:",MC(o),";}","")),d(IC,f.Base,f.hover,f.focus,f.active,r)}),[t,n,r,d,o,i,a,l,c]),"aria-hidden":!0}}(e);return(0,s.createElement)(ed,a({},n,{ref:t}))}),"Elevation");var OC=PC;const DC=`calc(${mh.cardBorderRadius} - 1px)`,AC=Wf("box-shadow:0 0 0 1px ",mh.surfaceBorderColor,";outline:none;",""),LC={name:"1showjb",styles:"border-bottom:1px solid;box-sizing:border-box;&:last-child{border-bottom:none;}"},zC={name:"14n5oej",styles:"border-top:1px solid;box-sizing:border-box;&:first-of-type{border-top:none;}"},BC={name:"13udsys",styles:"height:100%"},FC={name:"6ywzd",styles:"box-sizing:border-box;height:auto;max-height:100%"},VC={name:"dq805e",styles:"box-sizing:border-box;overflow:hidden;&>img,&>iframe{display:block;height:auto;max-width:100%;width:100%;}"},HC={name:"c990dr",styles:"box-sizing:border-box;display:block;width:100%"},jC=Wf("&:first-of-type{border-top-left-radius:",DC,";border-top-right-radius:",DC,";}&:last-of-type{border-bottom-left-radius:",DC,";border-bottom-right-radius:",DC,";}",""),$C=Wf("border-color:",mh.colorDivider,";",""),WC={name:"1t90u8d",styles:"box-shadow:none"},UC={name:"1e1ncky",styles:"border:none"},GC=Wf("border-radius:",DC,";",""),YC=Wf("padding:",mh.cardPaddingXSmall,";",""),qC={large:Wf("padding:",mh.cardPaddingLarge,";",""),medium:Wf("padding:",mh.cardPaddingMedium,";",""),small:Wf("padding:",mh.cardPaddingSmall,";",""),xSmall:YC,extraSmall:YC},KC=Wf("background-color:",Sp.ui.backgroundDisabled,";",""),XC=Wf("background-color:",mh.surfaceColor,";color:",Sp.gray[900],";position:relative;","");mh.surfaceBackgroundColor;function ZC(e){let{borderBottom:t,borderLeft:n,borderRight:r,borderTop:o}=e;const i=`1px solid ${mh.surfaceBorderColor}`;return Wf({borderBottom:t?i:void 0,borderLeft:n?i:void 0,borderRight:r?i:void 0,borderTop:o?i:void 0},"","")}const JC=Wf("",""),QC=Wf("background:",mh.surfaceBackgroundTintColor,";",""),ek=Wf("background:",mh.surfaceBackgroundTertiaryColor,";",""),tk=e=>[e,e].join(" "),nk=e=>["90deg",[mh.surfaceBackgroundColor,e].join(" "),"transparent 1%"].join(","),rk=e=>[[mh.surfaceBackgroundColor,e].join(" "),"transparent 1%"].join(","),ok=(e,t)=>Wf("background:",(e=>[`linear-gradient( ${nk(e)} ) center`,`linear-gradient( ${rk(e)} ) center`,mh.surfaceBorderBoldColor].join(","))(t),";background-size:",tk(e),";",""),ik=[`linear-gradient( ${[`${mh.surfaceBorderSubtleColor} 1px`,"transparent 1px"].join(",")} )`,`linear-gradient( ${["90deg",`${mh.surfaceBorderSubtleColor} 1px`,"transparent 1px"].join(",")} )`].join(","),ak=(e,t,n)=>{switch(e){case"dotted":return ok(t,n);case"grid":return(e=>Wf("background:",mh.surfaceBackgroundColor,";background-image:",ik,";background-size:",tk(e),";",""))(t);case"primary":return JC;case"secondary":return QC;case"tertiary":return ek}};function sk(e){const{backgroundSize:t=12,borderBottom:n=!1,borderLeft:r=!1,borderRight:o=!1,borderTop:i=!1,className:a,variant:l="primary",...c}=Vu(e,"Surface"),u=Fu();return{...c,className:(0,s.useMemo)((()=>{const e={borders:ZC({borderBottom:n,borderLeft:r,borderRight:o,borderTop:i})};return u(XC,e.borders,ak(l,`${t}px`,t-1+"px"),a)}),[t,n,r,o,i,a,u,l])}}function lk(e){const{className:t,elevation:n=0,isBorderless:r=!1,isRounded:o=!0,size:i="medium",...a}=Vu(function(e){let{elevation:t,isElevated:n,...r}=e;const o={...r};let i=t;var a;return n&&(ql()("Card isElevated prop",{since:"5.9",alternative:"elevation"}),null!==(a=i)&&void 0!==a||(i=2)),void 0!==i&&(o.elevation=i),o}(e),"Card"),l=Fu();return{...sk({...a,className:(0,s.useMemo)((()=>l(AC,r&&WC,o&&GC,t)),[t,l,r,o])}),elevation:n,isBorderless:r,isRounded:o,size:i}}var ck=Hu((function(e,t){const{children:n,elevation:r,isBorderless:o,isRounded:i,size:l,...c}=lk(e),u=i?mh.cardBorderRadius:0,d=Fu(),f=(0,s.useMemo)((()=>d(Wf({borderRadius:u},"",""))),[d,u]),p=(0,s.useMemo)((()=>{const e={size:l,isBorderless:o};return{CardBody:e,CardHeader:e,CardFooter:e}}),[o,l]);return(0,s.createElement)(rc,{value:p},(0,s.createElement)(ed,a({},c,{ref:t}),(0,s.createElement)(ed,{className:d(BC)},n),(0,s.createElement)(OC,{className:f,isInteractive:!1,value:r?1:0}),(0,s.createElement)(OC,{className:f,isInteractive:!1,value:r})))}),"Card");const uk=Wf("@media only screen and ( min-device-width: 40em ){&::-webkit-scrollbar{height:12px;width:12px;}&::-webkit-scrollbar-track{background-color:transparent;}&::-webkit-scrollbar-track{background:",mh.colorScrollbarTrack,";border-radius:8px;}&::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:",mh.colorScrollbarThumb,";border:2px solid rgba( 0, 0, 0, 0 );border-radius:7px;}&:hover::-webkit-scrollbar-thumb{background-color:",mh.colorScrollbarThumbHover,";}}",""),dk={name:"13udsys",styles:"height:100%"},fk={name:"7zq9w",styles:"scroll-behavior:smooth"},pk={name:"q33xhg",styles:"overflow-x:auto;overflow-y:hidden"},mk={name:"103x71s",styles:"overflow-x:hidden;overflow-y:auto"},hk={name:"umwchj",styles:"overflow-y:auto"};var gk=Hu((function(e,t){const n=function(e){const{className:t,scrollDirection:n="y",smoothScroll:r=!1,...o}=Vu(e,"Scrollable"),i=Fu();return{...o,className:(0,s.useMemo)((()=>i(dk,uk,r&&fk,"x"===n&&pk,"y"===n&&mk,"auto"===n&&hk,t)),[t,i,n,r])}}(e);return(0,s.createElement)(ed,a({},n,{ref:t}))}),"Scrollable");var vk=Hu((function(e,t){const{isScrollable:n,...r}=function(e){const{className:t,isScrollable:n=!1,isShady:r=!1,size:o="medium",...i}=Vu(e,"CardBody"),a=Fu();return{...i,className:(0,s.useMemo)((()=>a(FC,jC,qC[o],r&&KC,"components-card__body",t)),[t,a,r,o]),isScrollable:n}}(e);return n?(0,s.createElement)(gk,a({},r,{ref:t})):(0,s.createElement)(ed,a({},r,{ref:t}))}),"CardBody"),bk=F({name:"Separator",compose:re,keys:["orientation"],useOptions:function(e){var t=e.orientation;return m({orientation:void 0===t?"horizontal":t},h(e,["orientation"]))},useProps:function(e,t){return m({role:"separator","aria-orientation":e.orientation},t)}}),yk=z({as:"hr",memo:!0,useHook:bk});const wk={vertical:{start:"marginLeft",end:"marginRight"},horizontal:{start:"marginTop",end:"marginBottom"}};var xk={name:"1u4hpl4",styles:"display:inline"};const _k=Ju("hr",{target:"e19on6iw0"})("border:0;margin:0;",(e=>{let{"aria-orientation":t="horizontal"}=e;return"vertical"===t?xk:void 0})," ",(e=>{let{"aria-orientation":t="horizontal"}=e;return Wf({["vertical"===t?"borderRight":"borderBottom"]:"1px solid currentColor"},"","")})," ",(e=>{let{"aria-orientation":t="horizontal"}=e;return Wf({height:"vertical"===t?"auto":0,width:"vertical"===t?0:"auto"},"","")})," ",(e=>{let{"aria-orientation":t="horizontal",margin:n,marginStart:r,marginEnd:o}=e;return Wf(Bh({[wk[t].start]:Km(null!=r?r:n),[wk[t].end]:Km(null!=o?o:n)})(),"","")}),";");var Ek=Hu((function(e,t){const n=Vu(e,"Divider");return(0,s.createElement)(yk,a({as:_k},n,{ref:t}))}),"Divider");var Ck=Hu((function(e,t){const n=function(e){const{className:t,...n}=Vu(e,"CardDivider"),r=Fu();return{...n,className:(0,s.useMemo)((()=>r(HC,$C,"components-card__divider",t)),[t,r])}}(e);return(0,s.createElement)(Ek,a({},n,{ref:t}))}),"CardDivider");var kk=Hu((function(e,t){const n=function(e){const{className:t,justify:n,isBorderless:r=!1,isShady:o=!1,size:i="medium",...a}=Vu(e,"CardFooter"),l=Fu();return{...a,className:(0,s.useMemo)((()=>l(zC,jC,$C,qC[i],r&&UC,o&&KC,"components-card__footer",t)),[t,l,r,o,i]),justify:n}}(e);return(0,s.createElement)(Zm,a({},n,{ref:t}))}),"CardFooter");var Sk=Hu((function(e,t){const n=function(e){const{className:t,isBorderless:n=!1,isShady:r=!1,size:o="medium",...i}=Vu(e,"CardHeader"),a=Fu();return{...i,className:(0,s.useMemo)((()=>a(LC,jC,$C,qC[o],n&&UC,r&&KC,"components-card__header",t)),[t,a,n,r,o])}}(e);return(0,s.createElement)(Zm,a({},n,{ref:t}))}),"CardHeader");var Tk=Hu((function(e,t){const n=function(e){const{className:t,...n}=Vu(e,"CardMedia"),r=Fu();return{...n,className:(0,s.useMemo)((()=>r(VC,jC,"components-card__media",t)),[t,r])}}(e);return(0,s.createElement)(ed,a({},n,{ref:t}))}),"CardMedia");var Nk=function e(t){const{__nextHasNoMarginBottom:n,label:r,className:o,heading:i,checked:l,indeterminate:u,help:f,onChange:p,...m}=t;i&&ql()("`heading` prop in `CheckboxControl`",{alternative:"a separate element to implement a heading",since:"5.8"});const[h,g]=(0,s.useState)(!1),[v,b]=(0,s.useState)(!1),y=(0,d.useRefEffect)((e=>{e&&(e.indeterminate=!!u,g(e.matches(":checked")),b(e.matches(":indeterminate")))}),[l,u]),w=`inspector-checkbox-control-${(0,d.useInstanceId)(e)}`;return(0,s.createElement)(Nv,{__nextHasNoMarginBottom:n,label:i,id:w,help:f,className:c()("components-checkbox-control",o)},(0,s.createElement)("span",{className:"components-checkbox-control__input-container"},(0,s.createElement)("input",a({ref:y,id:w,className:"components-checkbox-control__input",type:"checkbox",value:"1",onChange:e=>p(e.target.checked),checked:l,"aria-describedby":f?w+"__help":void 0},m)),v?(0,s.createElement)(sy,{icon:Um,className:"components-checkbox-control__indeterminate",role:"presentation"}):null,h?(0,s.createElement)(sy,{icon:V_,className:"components-checkbox-control__checked",role:"presentation"}):null),(0,s.createElement)("label",{className:"components-checkbox-control__label",htmlFor:w},r))};function Rk(e){let{className:t,children:n,onCopy:r,onFinishCopy:o,text:i,...l}=e;ql()("wp.components.ClipboardButton",{since:"5.8",alternative:"wp.compose.useCopyToClipboard"});const u=(0,s.useRef)(),f=(0,d.useCopyToClipboard)(i,(()=>{r(),clearTimeout(u.current),o&&(u.current=setTimeout((()=>o()),4e3))}));(0,s.useEffect)((()=>{clearTimeout(u.current)}),[]);const p=c()("components-clipboard-button",t);return(0,s.createElement)(od,a({},l,{className:p,ref:f,onCopy:e=>{e.target.focus()}}),n)}var Ik=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));const Mk=Wf("appearance:none;border:1px solid transparent;cursor:pointer;background:none;text-align:start;&:hover{color:",Sp.ui.theme,";}&:focus{background-color:transparent;color:",Sp.ui.theme,";border-color:",Sp.ui.theme,";outline:3px solid transparent;}",""),Pk={name:"1bcj5ek",styles:"width:100%;display:block"},Ok={name:"150ruhm",styles:"box-sizing:border-box;width:100%;display:block;margin:0;color:inherit"},Dk=Wf("border:1px solid ",mh.surfaceBorderColor,";",""),Ak=Wf(">*:not( marquee )>*{border-bottom:1px solid ",mh.surfaceBorderColor,";}>*:last-of-type>*:not( :focus ){border-bottom-color:transparent;}",""),Lk=mh.controlBorderRadius,zk=Wf("border-radius:",Lk,";",""),Bk=Wf("border-radius:",Lk,";>*:first-of-type>*{border-top-left-radius:",Lk,";border-top-right-radius:",Lk,";}>*:last-of-type>*{border-bottom-left-radius:",Lk,";border-bottom-right-radius:",Lk,";}",""),Fk=`calc(${mh.fontSize} * ${mh.fontLineHeightBase})`,Vk=`calc((${mh.controlHeight} - ${Fk} - 2px) / 2)`,Hk=`calc((${mh.controlHeightSmall} - ${Fk} - 2px) / 2)`,jk=`calc((${mh.controlHeightLarge} - ${Fk} - 2px) / 2)`,$k={small:Wf("padding:",Hk," ",mh.controlPaddingXSmall,";",""),medium:Wf("padding:",Vk," ",mh.controlPaddingX,";",""),large:Wf("padding:",jk," ",mh.controlPaddingXLarge,";","")};const Wk=(0,s.createContext)({size:"medium"}),Uk=()=>(0,s.useContext)(Wk);var Gk=Hu((function(e,t){const{isBordered:n,isSeparated:r,size:o,...i}=function(e){const{className:t,isBordered:n=!1,isRounded:r=!0,isSeparated:o=!1,role:i="list",...a}=Vu(e,"ItemGroup");return{isBordered:n,className:Fu()(n&&Dk,o&&Ak,r&&Bk,t),role:i,isSeparated:o,...a}}(e),{size:l}=Uk(),c={spacedAround:!n&&!r,size:o||l};return(0,s.createElement)(Wk.Provider,{value:c},(0,s.createElement)(ed,a({},i,{ref:t})))}),"ItemGroup");function Yk(e){return Math.max(0,Math.min(100,e))}function qk(e,t,n){const r=e.slice();return r[t]=n,r}function Kk(e,t,n){if(function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const o=e[t].position,i=Math.min(o,n),a=Math.max(o,n);return e.some(((e,o)=>{let{position:s}=e;return o!==t&&(Math.abs(s-n)({placement:"bottom",offset:8})),[]),i=c()("components-custom-gradient-picker__control-point-dropdown",n);return(0,s.createElement)(Z_,a({isRenderedInSidebar:t,popoverProps:o,className:i},r))}function eS(e){let{disableRemove:t,disableAlpha:n,gradientPickerDomRef:r,ignoreMarkerPosition:o,value:i,onChange:a,onStartControlPointChange:l,onStopControlPointChange:c,__experimentalIsRenderedInSidebar:d}=e;const f=(0,s.useRef)(),p=e=>{const t=Zk(e.clientX,r.current),{initialPosition:n,index:o,significantMoveHappened:s}=f.current;!s&&Math.abs(n-t)>=5&&(f.current.significantMoveHappened=!0),a(Kk(i,o,t))},m=()=>{window&&window.removeEventListener&&f.current&&f.current.listenersActivated&&(window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",m),c(),f.current.listenersActivated=!1)},h=(0,s.useRef)();return h.current=m,(0,s.useEffect)((()=>()=>{h.current()}),[]),i.map(((e,r)=>{const h=null==e?void 0:e.position;return o!==h&&(0,s.createElement)(Qk,{isRenderedInSidebar:d,key:r,onClose:c,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(Jk,{key:r,onClick:()=>{f.current&&f.current.significantMoveHappened||(n?c():l(),o())},onMouseDown:()=>{window&&window.addEventListener&&(f.current={initialPosition:h,index:r,significantMoveHappened:!1,listenersActivated:!0},l(),window.addEventListener("mousemove",p),window.addEventListener("mouseup",m))},onKeyDown:t=>{"ArrowLeft"===t.code?(t.stopPropagation(),a(Kk(i,r,Yk(e.position-10)))):"ArrowRight"===t.code&&(t.stopPropagation(),a(Kk(i,r,Yk(e.position+10))))},isOpen:n,position:e.position,color:e.color})},renderContent:o=>{let{onClose:l}=o;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(F_,{enableAlpha:!n,color:e.color,onChange:e=>{a(Xk(i,r,vp(e).toRgbString()))}}),!t&&i.length>2&&(0,s.createElement)(Gv,{className:"components-custom-gradient-picker__remove-control-point-wrapper",alignment:"center"},(0,s.createElement)(od,{onClick:()=>{a(function(e,t){return e.filter(((e,n)=>n!==t))}(i,r)),l()},variant:"link"},(0,u.__)("Remove Control Point"))))},style:{left:`${e.position}%`,transform:"translateX( -50% )"}})}))}eS.InsertPoint=function(e){let{value:t,onChange:n,onOpenInserter:r,onCloseInserter:o,insertPosition:i,disableAlpha:a,__experimentalIsRenderedInSidebar:l}=e;const[c,u]=(0,s.useState)(!1);return(0,s.createElement)(Qk,{isRenderedInSidebar:l,className:"components-custom-gradient-picker__inserter",onClose:()=>{o()},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(od,{"aria-expanded":t,"aria-haspopup":"true",onClick:()=>{t?o():(u(!1),r()),n()},className:"components-custom-gradient-picker__insert-point-dropdown",icon:Wm})},renderContent:()=>(0,s.createElement)(F_,{enableAlpha:!a,onChange:e=>{c?n(function(e,t,n){const r=e.findIndex((e=>e.position===t));return Xk(e,r,n)}(t,i,vp(e).toRgbString())):(n(function(e,t,n){const r=e.findIndex((e=>e.position>t)),o={color:n,position:t},i=e.slice();return i.splice(r-1,0,o),i}(t,i,vp(e).toRgbString())),u(!0))}}),style:null!==i?{left:`${i}%`,transform:"translateX( -50% )"}:void 0})};var tS=eS;function nS(e,t){switch(t.type){case"MOVE_INSERTER":if("IDLE"===e.id||"MOVING_INSERTER"===e.id)return{id:"MOVING_INSERTER",insertPosition:t.insertPosition};break;case"STOP_INSERTER_MOVE":if("MOVING_INSERTER"===e.id)return{id:"IDLE"};break;case"OPEN_INSERTER":if("MOVING_INSERTER"===e.id)return{id:"INSERTING_CONTROL_POINT",insertPosition:e.insertPosition};break;case"CLOSE_INSERTER":if("INSERTING_CONTROL_POINT"===e.id)return{id:"IDLE"};break;case"START_CONTROL_CHANGE":if("IDLE"===e.id)return{id:"MOVING_CONTROL_POINT"};break;case"STOP_CONTROL_CHANGE":if("MOVING_CONTROL_POINT"===e.id)return{id:"IDLE"}}return e}const rS={id:"IDLE"};function oS(e){let{background:t,hasGradient:n,value:r,onChange:o,disableInserter:i=!1,disableAlpha:a=!1,__experimentalIsRenderedInSidebar:l}=e;const u=(0,s.useRef)(),[d,f]=(0,s.useReducer)(nS,rS),p=e=>{const t=Zk(e.clientX,u.current);r.some((e=>{let{position:n}=e;return Math.abs(t-n)<10}))?"MOVING_INSERTER"===d.id&&f({type:"STOP_INSERTER_MOVE"}):f({type:"MOVE_INSERTER",insertPosition:t})},m="MOVING_INSERTER"===d.id,h="INSERTING_CONTROL_POINT"===d.id;return(0,s.createElement)("div",{className:c()("components-custom-gradient-picker__gradient-bar",{"has-gradient":n}),onMouseEnter:p,onMouseMove:p,style:{background:t},onMouseLeave:()=>{f({type:"STOP_INSERTER_MOVE"})}},(0,s.createElement)("div",{ref:u,className:"components-custom-gradient-picker__markers-container"},!i&&(m||h)&&(0,s.createElement)(tS.InsertPoint,{__experimentalIsRenderedInSidebar:l,disableAlpha:a,insertPosition:d.insertPosition,value:r,onChange:o,onOpenInserter:()=>{f({type:"OPEN_INSERTER"})},onCloseInserter:()=>{f({type:"CLOSE_INSERTER"})}}),(0,s.createElement)(tS,{__experimentalIsRenderedInSidebar:l,disableAlpha:a,disableRemove:i,gradientPickerDomRef:u,ignoreMarkerPosition:h?d.insertPosition:void 0,value:r,onChange:o,onStartControlPointChange:()=>{f({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{f({type:"STOP_CONTROL_CHANGE"})}})))}var iS=n(7115);const aS="linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)",sS={type:"angular",value:90},lS=[{value:"linear-gradient",label:(0,u.__)("Linear")},{value:"radial-gradient",label:(0,u.__)("Radial")}],cS={top:0,"top right":45,"right top":45,right:90,"right bottom":135,"bottom right":135,bottom:180,"bottom left":225,"left bottom":225,left:270,"top left":315,"left top":315};function uS(e){let{type:t,value:n,length:r}=e;return`${function(e){let{type:t,value:n}=e;return"literal"===t?n:"hex"===t?`#${n}`:`${t}(${n.join(",")})`}({type:t,value:n})} ${function(e){if(!e)return"";const{value:t,type:n}=e;return`${t}${n}`}(r)}`}function dS(e){let{type:t,orientation:n,colorStops:r}=e;const o=function(e){if(e&&"angular"===e.type)return`${e.value}deg`}(n);return`${t}(${[o,...r.sort(((e,t)=>{var n,r,o,i;return(null!==(n=null==e||null===(r=e.length)||void 0===r?void 0:r.value)&&void 0!==n?n:0)-(null!==(o=null==t||null===(i=t.length)||void 0===i?void 0:i.value)&&void 0!==o?o:0)})).map(uS)].filter(Boolean).join(",")})`}function fS(e){return void 0===e.length||"%"!==e.length.type}function pS(e){switch(e.type){case"hex":return`#${e.value}`;case"literal":return e.value;case"rgb":case"rgba":return`${e.type}(${e.value.join(",")})`;default:return"transparent"}}yp([wp]);const mS=Ju(jm,{target:"e99xvul1"})({name:"1gvx10y",styles:"flex-grow:5"}),hS=Ju(jm,{target:"e99xvul0"})({name:"1gvx10y",styles:"flex-grow:5"}),gS=e=>{var t,n;let{gradientAST:r,hasGradient:o,onChange:i}=e;const a=null!==(t=null==r||null===(n=r.orientation)||void 0===n?void 0:n.value)&&void 0!==t?t:180;return(0,s.createElement)(ib,{__nextHasNoMarginBottom:!0,onChange:e=>{i(dS({...r,orientation:{type:"angular",value:e}}))},labelPosition:"top",value:o?a:""})},vS=e=>{let{gradientAST:t,hasGradient:n,onChange:r}=e;const{type:o}=t;return(0,s.createElement)(fy,{__nextHasNoMarginBottom:!0,className:"components-custom-gradient-picker__type-picker",label:(0,u.__)("Type"),labelPosition:"top",onChange:e=>{"linear-gradient"===e&&r(dS({...t,...t.orientation?{}:{orientation:sS},type:"linear-gradient"})),"radial-gradient"===e&&(()=>{const{orientation:e,...n}=t;r(dS({...n,type:"radial-gradient"}))})()},options:lS,size:"__unstable-large",value:n&&o})};function bS(e){let{__nextHasNoMargin:t=!1,value:n,onChange:r,__experimentalIsRenderedInSidebar:o}=e;const i=function(e){var t;let n;try{n=iS.parse(e)[0],n.value=e}catch(e){n=iS.parse(aS)[0],n.value=aS}if("directional"===(null===(t=n.orientation)||void 0===t?void 0:t.type)&&(n.orientation.type="angular",n.orientation.value=cS[n.orientation.value].toString()),n.colorStops.some(fS)){const{colorStops:e}=n,t=100/(e.length-1);e.forEach(((e,n)=>{e.length={value:t*n,type:"%"}})),n.value=dS(n)}return n}(n),a=function(e){return dS({type:"linear-gradient",orientation:sS,colorStops:e.colorStops})}(i),l=i.value!==aS,u=i.colorStops.map((e=>({color:pS(e),position:parseInt(e.length.value)})));return t||ql()("Outer margin styles for wp.components.CustomGradientPicker",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMargin` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,s.createElement)(j_,{spacing:4,className:c()("components-custom-gradient-picker",{"is-next-has-no-margin":t})},(0,s.createElement)(oS,{__experimentalIsRenderedInSidebar:o,background:a,hasGradient:l,value:u,onChange:e=>{r(dS(function(e,t){return{...e,colorStops:t.map((e=>{let{position:t,color:n}=e;const{r:r,g:o,b:i,a:a}=vp(n).toRgb();return{length:{type:"%",value:null==t?void 0:t.toString()},type:a<1?"rgba":"rgb",value:a<1?[r,o,i,a]:[r,o,i]}}))}}(i,e)))}}),(0,s.createElement)(Zm,{gap:3,className:"components-custom-gradient-picker__ui-line"},(0,s.createElement)(mS,null,(0,s.createElement)(vS,{gradientAST:i,hasGradient:l,onChange:r})),(0,s.createElement)(hS,null,"linear-gradient"===i.type&&(0,s.createElement)(gS,{gradientAST:i,hasGradient:l,onChange:r}))))}const yS=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.gradients)&&!("gradient"in t);var t}));function wS(e){let{className:t,clearGradient:n,gradients:r,onChange:o,value:i,actions:a}=e;const l=(0,s.useMemo)((()=>r.map(((e,t)=>{let{gradient:r,name:a}=e;return(0,s.createElement)(H_.Option,{key:r,value:r,isSelected:i===r,tooltipText:a||(0,u.sprintf)((0,u.__)("Gradient code: %s"),r),style:{color:"rgba( 0,0,0,0 )",background:r},onClick:i===r?n:()=>o(r,t),"aria-label":a?(0,u.sprintf)((0,u.__)("Gradient: %s"),a):(0,u.sprintf)((0,u.__)("Gradient code: %s"),r)})}))),[r,i,o,n]);return(0,s.createElement)(H_,{className:t,options:l,actions:a})}function xS(e){let{className:t,clearGradient:n,gradients:r,onChange:o,value:i,actions:l}=e;return(0,s.createElement)(j_,{spacing:3,className:t},r.map(((e,t)=>{let{name:c,gradients:u}=e;return(0,s.createElement)(j_,{spacing:2,key:t},(0,s.createElement)(U_,null,c),(0,s.createElement)(wS,a({clearGradient:n,gradients:u,onChange:e=>o(e,t),value:i},r.length===t+1?{actions:l}:{})))})))}function _S(e){let{__nextHasNoMargin:t=!1,className:n,gradients:r,onChange:o,value:i,clearable:l=!0,disableCustomGradients:c=!1,__experimentalIsRenderedInSidebar:d}=e;const f=(0,s.useCallback)((()=>o(void 0)),[o]),p=yS(r)?xS:wS;t||ql()("Outer margin styles for wp.components.GradientPicker",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMargin` prop to true to start opting into the new styles, which will become the default in a future version"});const m=t?{}:{marginTop:null!=r&&r.length?void 0:3,marginBottom:l?0:6};return(0,s.createElement)(Kv,a({marginBottom:0},m),(0,s.createElement)(j_,{spacing:null!=r&&r.length?4:0},!c&&(0,s.createElement)(bS,{__nextHasNoMargin:!0,__experimentalIsRenderedInSidebar:d,value:i,onChange:o}),((null==r?void 0:r.length)||l)&&(0,s.createElement)(p,{className:n,clearable:l,clearGradient:f,gradients:r,onChange:o,value:i,actions:l&&!c&&(0,s.createElement)(H_.ButtonAction,{onClick:f},(0,u.__)("Clear"))})))}var ES=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z"})),CS=window.wp.dom;const kS=()=>{},SS=["menuitem","menuitemradio","menuitemcheckbox"];class TS extends s.Component{constructor(){super(...arguments),this.onKeyDown=this.onKeyDown.bind(this),this.bindContainer=this.bindContainer.bind(this),this.getFocusableContext=this.getFocusableContext.bind(this),this.getFocusableIndex=this.getFocusableIndex.bind(this)}componentDidMount(){this.container.addEventListener("keydown",this.onKeyDown),this.container.addEventListener("focus",this.onFocus)}componentWillUnmount(){this.container.removeEventListener("keydown",this.onKeyDown),this.container.removeEventListener("focus",this.onFocus)}bindContainer(e){const{forwardedRef:t}=this.props;this.container=e,"function"==typeof t?t(e):t&&"current"in t&&(t.current=e)}getFocusableContext(e){const{onlyBrowserTabstops:t}=this.props,n=(t?CS.focus.tabbable:CS.focus.focusable).find(this.container),r=this.getFocusableIndex(n,e);return r>-1&&e?{index:r,target:e,focusables:n}:null}getFocusableIndex(e,t){const n=e.indexOf(t);if(-1!==n)return n}onKeyDown(e){this.props.onKeyDown&&this.props.onKeyDown(e);const{getFocusableContext:t}=this,{cycle:n=!0,eventToOffset:r,onNavigate:o=kS,stopNavigationEvents:i}=this.props,a=r(e);if(void 0!==a&&i){e.stopImmediatePropagation();const t=e.target.getAttribute("role"),n=SS.includes(t),r="Tab"===e.code;(n||r)&&e.preventDefault()}if(!a)return;const s=t(e.target.ownerDocument.activeElement);if(!s)return;const{index:l,focusables:c}=s,u=n?function(e,t,n){const r=e+n;return r<0?t+r:r>=t?r-t:r}(l,c.length,a):l+a;u>=0&&u(0,s.createElement)(TS,a({},e,{forwardedRef:t}));NS.displayName="NavigableContainer";var RS=(0,s.forwardRef)(NS);var IS=(0,s.forwardRef)((function(e,t){let{role:n="menu",orientation:r="vertical",...o}=e;return(0,s.createElement)(RS,a({ref:t,stopNavigationEvents:!0,onlyBrowserTabstops:!1,role:n,"aria-orientation":"presentation"===n?null:r,eventToOffset:e=>{const{code:t}=e;let n=["ArrowDown"],o=["ArrowUp"];return"horizontal"===r&&(n=["ArrowRight"],o=["ArrowLeft"]),"both"===r&&(n=["ArrowRight","ArrowDown"],o=["ArrowLeft","ArrowUp"]),n.includes(t)?1:o.includes(t)?-1:["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(t)?0:void 0}},o))}));function MS(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={...e,...t};return t.className&&e.className&&(n.className=c()(t.className,e.className)),n}function PS(e){return"function"==typeof e}var OS=function(e){const{children:t,className:n,controls:r,icon:o=ES,label:i,popoverProps:l,toggleProps:u,menuProps:d,disableOpenOnArrowDown:f=!1,text:p,noIcons:m}=e;if(!(null!=r&&r.length||PS(t)))return null;let h;null!=r&&r.length&&(h=r,Array.isArray(h[0])||(h=[h]));const g=MS({className:"components-dropdown-menu__popover"},l);return(0,s.createElement)(ny,{className:c()("components-dropdown-menu",n),popoverProps:g,renderToggle:e=>{var t;let{isOpen:n,onToggle:r}=e;const{as:l=od,...d}=null!=u?u:{},m=MS({className:c()("components-dropdown-menu__toggle",{"is-opened":n})},d);return(0,s.createElement)(l,a({},m,{icon:o,onClick:e=>{r(e),m.onClick&&m.onClick(e)},onKeyDown:e=>{(e=>{f||n||"ArrowDown"!==e.code||(e.preventDefault(),r())})(e),m.onKeyDown&&m.onKeyDown(e)},"aria-haspopup":"true","aria-expanded":n,label:i,text:p,showTooltip:null===(t=null==u?void 0:u.showTooltip)||void 0===t||t}),m.children)},renderContent:e=>{var n;const r=MS({"aria-label":i,className:c()("components-dropdown-menu__menu",{"no-icons":m})},d);return(0,s.createElement)(IS,a({},r,{role:"menu"}),PS(t)?t(e):null,null===(n=h)||void 0===n?void 0:n.flatMap(((t,n)=>t.map(((t,r)=>(0,s.createElement)(od,{key:[n,r].join(),onClick:n=>{n.stopPropagation(),e.onClose(),t.onClick&&t.onClick()},className:c()("components-dropdown-menu__menu-item",{"has-separator":n>0&&0===r,"is-active":t.isActive,"is-icon-only":!t.title}),icon:t.icon,label:t.label,"aria-checked":"menuitemcheckbox"===t.role||"menuitemradio"===t.role?t.isActive:void 0,role:"menuitemcheckbox"===t.role||"menuitemradio"===t.role?t.role:"menuitem",disabled:t.isDisabled},t.title))))))}})};const DS=Ju(H_.Option,{target:"e5bw3229"})("width:",Km(6),";height:",Km(6),";pointer-events:none;"),AS=Ju(Mv,{target:"e5bw3228"})($h,"{background:",Sp.gray[100],";border-radius:",mh.controlBorderRadius,";",Uh,Uh,Uh,Uh,"{height:",Km(8),";}",Kh,Kh,Kh,"{border-color:transparent;box-shadow:none;}}"),LS=Ju(ed,{target:"e5bw3227"})("padding:3px 0 3px ",Km(3),";height:calc( 40px - ",mh.borderWidth," );border:1px solid ",mh.surfaceBorderColor,";border-bottom-color:transparent;&:first-of-type{border-top-left-radius:",mh.controlBorderRadius,";border-top-right-radius:",mh.controlBorderRadius,";}&:last-of-type{border-bottom-left-radius:",mh.controlBorderRadius,";border-bottom-right-radius:",mh.controlBorderRadius,";border-bottom-color:",mh.surfaceBorderColor,";}&.is-selected+&{border-top-color:transparent;}&.is-selected{border-color:",Sp.ui.theme,";}"),zS=Ju("div",{target:"e5bw3226"})("line-height:",Km(8),";margin-left:",Km(2),";margin-right:",Km(2),";white-space:nowrap;overflow:hidden;",LS,":hover &{color:",Sp.ui.theme,";}"),BS=Ju(W_,{target:"e5bw3225"})("text-transform:uppercase;line-height:",Km(6),";font-weight:500;&&&{font-size:11px;margin-bottom:0;}"),FS=Ju(ed,{target:"e5bw3224"})("height:",Km(6),";display:flex;"),VS=Ju(Gv,{target:"e5bw3223"})("margin-bottom:",Km(2),";"),HS=Ju(ed,{target:"e5bw3222"})({name:"u6wnko",styles:"&&&{.components-button.has-icon{min-width:0;padding:0;}}"}),jS=Ju(od,{target:"e5bw3221"})("&&{color:",Sp.ui.theme,";}"),$S=Ju(od,{target:"e5bw3220"})("&&{margin-top:",Km(1),";}"),WS="#000";function US(e){let{value:t,onChange:n,label:r}=e;return(0,s.createElement)(AS,{label:r,hideLabelFromVision:!0,value:t,onChange:n})}function GS(e){let{isGradient:t,element:n,onChange:r,onClose:o=(()=>{})}=e;return(0,s.createElement)(Mf,{placement:"left-start",offset:20,className:"components-palette-edit__popover",onClose:o},!t&&(0,s.createElement)(F_,{color:n.color,enableAlpha:!0,onChange:e=>r({...n,color:e})}),t&&(0,s.createElement)("div",{className:"components-palette-edit__popover-gradient-picker"},(0,s.createElement)(bS,{__nextHasNoMargin:!0,__experimentalIsRenderedInSidebar:!0,value:n.gradient,onChange:e=>r({...n,gradient:e})})))}function YS(e){let{canOnlyChangeValues:t,element:n,onChange:r,isEditing:o,onStartEditing:i,onRemove:l,onStopEditing:c,slugPrefix:f,isGradient:p}=e;const m=(0,d.__experimentalUseFocusOutside)(c),h=p?n.gradient:n.color;return(0,s.createElement)(LS,a({className:o?"is-selected":void 0,as:"div",onClick:i},o?{...m}:{style:{cursor:"pointer"}}),(0,s.createElement)(Gv,{justify:"flex-start"},(0,s.createElement)($m,null,(0,s.createElement)(DS,{style:{background:h,color:"transparent"}})),(0,s.createElement)($m,null,o&&!t?(0,s.createElement)(US,{label:p?(0,u.__)("Gradient name"):(0,u.__)("Color name"),value:n.name,onChange:e=>r({...n,name:e,slug:f+(0,Ql.kebabCase)(e)})}):(0,s.createElement)(zS,null,n.name)),o&&!t&&(0,s.createElement)($m,null,(0,s.createElement)($S,{isSmall:!0,icon:Ib,label:(0,u.__)("Remove color"),onClick:l}))),o&&(0,s.createElement)(GS,{isGradient:p,onChange:r,element:n}))}function qS(e,t){let{slug:n,color:r,gradient:o}=t;return new RegExp(`^${e}color-([\\d]+)$`).test(n)&&(!!r&&r===WS||!!o&&o===aS)}function KS(e){let{elements:t,onChange:n,editingElement:r,setEditingElement:o,canOnlyChangeValues:i,slugPrefix:a,isGradient:l}=e;const c=(0,s.useRef)();(0,s.useEffect)((()=>{c.current=t}),[t]),(0,s.useEffect)((()=>()=>{if(c.current.some(((e,t)=>qS(a,e)))){const e=c.current.filter((e=>!qS(a,e)));n(e.length?e:void 0)}}),[]);const u=(0,d.useDebounce)(n,100);return(0,s.createElement)(j_,{spacing:3},(0,s.createElement)(Gk,{isRounded:!0},t.map(((e,c)=>(0,s.createElement)(YS,{isGradient:l,canOnlyChangeValues:i,key:c,element:e,onStartEditing:()=>{r!==c&&o(c)},onChange:e=>{u(t.map(((t,n)=>n===c?e:t)))},onRemove:()=>{o(null);const e=t.filter(((e,t)=>t!==c));n(e.length?e:void 0)},isEditing:c===r,onStopEditing:()=>{c===r&&o(null)},slugPrefix:a})))))}const XS=[];function ZS(e){let{gradients:t,colors:n=XS,onChange:r,paletteLabel:o,emptyMessage:i,canOnlyChangeValues:a,canReset:l,slugPrefix:c=""}=e;const f=!!t,p=f?t:n,[m,h]=(0,s.useState)(!1),[g,v]=(0,s.useState)(null),b=m&&g&&p[g]&&!p[g].slug,y=p.length>0,w=(0,d.useDebounce)(r,100),x=(0,s.useCallback)(((e,t)=>{const n=p[t];n&&n[f?"gradient":"color"]===e?v(t):h(!0)}),[f,p]);return(0,s.createElement)(HS,null,(0,s.createElement)(VS,null,(0,s.createElement)(BS,null,o),(0,s.createElement)(FS,null,y&&m&&(0,s.createElement)(jS,{isSmall:!0,onClick:()=>{h(!1),v(null)}},(0,u.__)("Done")),!a&&(0,s.createElement)(od,{isSmall:!0,isPressed:b,icon:Wm,label:f?(0,u.__)("Add gradient"):(0,u.__)("Add color"),onClick:()=>{const e=function(e,t){const n=new RegExp(`^${t}color-([\\d]+)$`),r=e.reduce(((e,t)=>{if("string"==typeof(null==t?void 0:t.slug)){const r=null==t?void 0:t.slug.match(n);if(r){const t=parseInt(r[1],10);if(t>=e)return t+1}}return e}),1);return(0,u.sprintf)((0,u.__)("Color %s"),r)}(p,c);r([...p,{...f?{gradient:aS}:{color:WS},name:e,slug:c+(0,Ql.kebabCase)(e)}]),h(!0),v(p.length)}}),y&&(!m||!a||l)&&(0,s.createElement)(OS,{icon:Ik,label:f?(0,u.__)("Gradient options"):(0,u.__)("Color options"),toggleProps:{isSmall:!0}},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(IS,{role:"menu"},!m&&(0,s.createElement)(od,{variant:"tertiary",onClick:()=>{h(!0),t()},className:"components-palette-edit__menu-button"},(0,u.__)("Show details")),!a&&(0,s.createElement)(od,{variant:"tertiary",onClick:()=>{v(null),h(!1),r(),t()},className:"components-palette-edit__menu-button"},f?(0,u.__)("Remove all gradients"):(0,u.__)("Remove all colors")),l&&(0,s.createElement)(od,{variant:"tertiary",onClick:()=>{v(null),r(),t()}},f?(0,u.__)("Reset gradient"):(0,u.__)("Reset colors"))))})))),y&&(0,s.createElement)(s.Fragment,null,m&&(0,s.createElement)(KS,{canOnlyChangeValues:a,elements:p,onChange:r,editingElement:g,setEditingElement:v,slugPrefix:c,isGradient:f}),!m&&null!==g&&(0,s.createElement)(GS,{isGradient:f,onClose:()=>v(null),onChange:e=>{w(p.map(((t,n)=>n===g?e:t)))},element:p[g]}),!m&&(f?(0,s.createElement)(_S,{__nextHasNoMargin:!0,gradients:t,onChange:x,clearable:!1,disableCustomGradients:!0}):(0,s.createElement)(Q_,{colors:n,onChange:x,clearable:!1,disableCustomColors:!0}))),!y&&i)}const JS=e=>{let{__next36pxDefaultSize:t}=e;return!t&&Wf("height:28px;padding-left:",Km(1),";padding-right:",Km(1),";","")},QS=Ju(Zm,{target:"evuatpg0"})("height:34px;padding-left:",Km(2),";padding-right:",Km(2),";",JS,";");const eT=(0,s.forwardRef)((function(e,t){const{value:n,isExpanded:r,instanceId:o,selectedSuggestionIndex:i,className:l,onChange:u,onFocus:d,onBlur:f,...p}=e,[m,h]=(0,s.useState)(!1),g=n?n.length+1:0;return(0,s.createElement)("input",a({ref:t,id:`components-form-token-input-${o}`,type:"text"},p,{value:n||"",onChange:e=>{u&&u({value:e.target.value})},onFocus:e=>{h(!0),null==d||d(e)},onBlur:e=>{h(!1),null==f||f(e)},size:g,className:c()(l,"components-form-token-field__input"),autoComplete:"off",role:"combobox","aria-expanded":r,"aria-autocomplete":"list","aria-owns":r?`components-form-token-suggestions-${o}`:void 0,"aria-activedescendant":m&&-1!==i&&r?`components-form-token-suggestions-${o}-${i}`:void 0,"aria-describedby":`components-form-token-suggestions-howto-${o}`}))}));var tT=eT,nT=n(5425),rT=n.n(nT);const oT=e=>{e.preventDefault()};var iT=function(e){let{selectedIndex:t,scrollIntoView:n,match:r,onHover:o,onSelect:i,suggestions:a=[],displayTransform:l,instanceId:u,__experimentalRenderItem:f}=e;const[p,m]=(0,s.useState)(!1),h=(0,d.useRefEffect)((e=>{let r;return t>-1&&n&&e.children[t]&&(m(!0),rT()(e.children[t],e,{onlyScrollIfNeeded:!0}),r=requestAnimationFrame((()=>{m(!1)}))),()=>{void 0!==r&&cancelAnimationFrame(r)}}),[t,n]),g=e=>()=>{p||null==o||o(e)},v=e=>()=>{null==i||i(e)};return(0,s.createElement)("ul",{ref:h,className:"components-form-token-field__suggestions-list",id:`components-form-token-suggestions-${u}`,role:"listbox"},a.map(((e,n)=>{const o=(e=>{const t=l(r).toLocaleLowerCase();if(0===t.length)return null;const n=l(e),o=n.toLocaleLowerCase().indexOf(t);return{suggestionBeforeMatch:n.substring(0,o),suggestionMatch:n.substring(o,o+t.length),suggestionAfterMatch:n.substring(o+t.length)}})(e),i=c()("components-form-token-field__suggestion",{"is-selected":n===t});let a;return a="function"==typeof f?f({item:e}):o?(0,s.createElement)("span",{"aria-label":l(e)},o.suggestionBeforeMatch,(0,s.createElement)("strong",{className:"components-form-token-field__suggestion-match"},o.suggestionMatch),o.suggestionAfterMatch):l(e),(0,s.createElement)("li",{id:`components-form-token-suggestions-${u}-${n}`,role:"option",className:i,key:"object"==typeof e&&"value"in e?null==e?void 0:e.value:l(e),onMouseDown:oT,onClick:v(e),onMouseEnter:g(e),"aria-selected":n===t},a)})))},aT=(0,d.createHigherOrderComponent)((e=>t=>{const[n,r]=(0,s.useState)(),o=(0,s.useCallback)((e=>r((()=>null!=e&&e.handleFocusOutside?e.handleFocusOutside.bind(e):void 0))),[]);return(0,s.createElement)("div",(0,d.__experimentalUseFocusOutside)(n),(0,s.createElement)(e,a({ref:o},t)))}),"withFocusOutside");const sT=()=>{},lT=aT(class extends s.Component{handleFocusOutside(e){this.props.onFocusOutside(e)}render(){return this.props.children}});var cT=function e(t){var n;let{__nextHasNoMarginBottom:r=!1,__next36pxDefaultSize:o,value:i,label:a,options:l,onChange:f,onFilterValueChange:p=sT,hideLabelFromVision:m,help:h,allowReset:g=!0,className:v,messages:b={selected:(0,u.__)("Item selected.")},__experimentalRenderItem:y}=t;const[w,x]=O_({value:i,onChange:f}),_=l.find((e=>e.value===w)),E=null!==(n=null==_?void 0:_.label)&&void 0!==n?n:"",C=(0,d.useInstanceId)(e,"combobox-control"),[k,S]=(0,s.useState)(_||null),[T,N]=(0,s.useState)(!1),[R,I]=(0,s.useState)(!1),[M,P]=(0,s.useState)(""),O=(0,s.useRef)(),D=(0,s.useMemo)((()=>{const e=[],t=[],n=db(M);return l.forEach((r=>{const o=db(r.label).indexOf(n);0===o?e.push(r):o>0&&t.push(r)})),e.concat(t)}),[M,l]),A=e=>{x(e.value),(0,cb.speak)(b.selected,"assertive"),S(e),P(""),N(!1)},L=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const t=D.indexOf(k);let n=t+e;n<0?n=D.length-1:n>=D.length&&(n=0),S(D[n]),N(!0)};return(0,s.useEffect)((()=>{const e=D.length>0,t=D.indexOf(k)>0;e&&!t&&S(D[0])}),[D,k]),(0,s.useEffect)((()=>{const e=D.length>0;if(T){const t=e?(0,u.sprintf)((0,u._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",D.length),D.length):(0,u.__)("No results.");(0,cb.speak)(t,"polite")}}),[D,T]),(0,s.createElement)(lT,{onFocusOutside:()=>{N(!1)}},(0,s.createElement)(Nv,{__nextHasNoMarginBottom:r,className:c()(v,"components-combobox-control"),tabIndex:"-1",label:a,id:`components-form-token-input-${C}`,hideLabelFromVision:m,help:h},(0,s.createElement)("div",{className:"components-combobox-control__suggestions-container",tabIndex:"-1",onKeyDown:e=>{let t=!1;if(!e.defaultPrevented&&!e.nativeEvent.isComposing&&229!==e.keyCode){switch(e.code){case"Enter":k&&(A(k),t=!0);break;case"ArrowUp":L(-1),t=!0;break;case"ArrowDown":L(1),t=!0;break;case"Escape":N(!1),S(null),t=!0}t&&e.preventDefault()}}},(0,s.createElement)(QS,{__next36pxDefaultSize:o},(0,s.createElement)(jm,null,(0,s.createElement)(tT,{className:"components-combobox-control__input",instanceId:C,ref:O,value:T?M:E,onFocus:()=>{I(!0),N(!0),p(""),P("")},onBlur:()=>{I(!1)},isExpanded:T,selectedSuggestionIndex:D.indexOf(k),onChange:e=>{const t=e.value;P(t),p(t),R&&N(!0)}})),g&&(0,s.createElement)($m,null,(0,s.createElement)(od,{className:"components-combobox-control__reset",icon:Rb,disabled:!w,onClick:()=>{x(null),O.current.focus()},label:(0,u.__)("Reset")}))),T&&(0,s.createElement)(iT,{instanceId:C,match:{label:M},displayTransform:e=>e.label,suggestions:D,selectedIndex:D.indexOf(k),onHover:S,onSelect:A,scrollIntoView:!0,__experimentalRenderItem:y}))))};const uT=new Set(["alert","status","log","marquee","timer"]);let dT=[],fT=!1;function pT(e){if(fT)return;Array.from(document.body.children).forEach((t=>{t!==e&&function(e){const t=e.getAttribute("role");return!("SCRIPT"===e.tagName||e.hasAttribute("aria-hidden")||e.hasAttribute("aria-live")||t&&uT.has(t))}(t)&&(t.setAttribute("aria-hidden","true"),dT.push(t))})),fT=!0}let mT=0;const hT=(0,s.forwardRef)((function(e,t){const{bodyOpenClassName:n="modal-open",role:r="dialog",title:o=null,focusOnMount:i=!0,shouldCloseOnEsc:l=!0,shouldCloseOnClickOutside:f=!0,isDismissible:p=!0,aria:m={labelledby:void 0,describedby:void 0},onRequestClose:h,icon:g,closeButtonLabel:v,children:b,style:y,overlayClassName:w,className:x,contentLabel:_,onKeyDown:E,isFullScreen:C=!1,__experimentalHideHeader:k=!1}=e,S=(0,s.useRef)(),T=(0,d.useInstanceId)(hT),N=o?`components-modal-header-${T}`:m.labelledby,R=(0,d.useFocusOnMount)(i),I=(0,d.useConstrainedTabbing)(),M=(0,d.useFocusReturn)(),P=(0,d.__experimentalUseFocusOutside)(h),[O,D]=(0,s.useState)(!1);(0,s.useEffect)((()=>(mT++,1===mT&&(pT(S.current),document.body.classList.add(n)),()=>{mT--,0===mT&&(document.body.classList.remove(n),fT&&(dT.forEach((e=>{e.removeAttribute("aria-hidden")})),dT=[],fT=!1))})),[n]);const A=(0,s.useCallback)((e=>{var t,n;const r=null!==(t=null==e||null===(n=e.currentTarget)||void 0===n?void 0:n.scrollTop)&&void 0!==t?t:-1;!O&&r>0?D(!0):O&&r<=0&&D(!1)}),[O]);return(0,s.createPortal)((0,s.createElement)("div",{ref:(0,d.useMergeRefs)([S,t]),className:c()("components-modal__screen-overlay",w),onKeyDown:function(e){e.nativeEvent.isComposing||229===e.keyCode||l&&"Escape"===e.code&&!e.defaultPrevented&&(e.preventDefault(),h&&h(e))}},(0,s.createElement)(af,{document:document},(0,s.createElement)("div",a({className:c()("components-modal__frame",x,{"is-full-screen":C}),style:y,ref:(0,d.useMergeRefs)([I,M,R]),role:r,"aria-label":_,"aria-labelledby":_?void 0:N,"aria-describedby":m.describedby,tabIndex:-1},f?P:{},{onKeyDown:E}),(0,s.createElement)("div",{className:c()("components-modal__content",{"hide-header":k,"has-scrolled-content":O}),role:"document",onScroll:A},!k&&(0,s.createElement)("div",{className:"components-modal__header"},(0,s.createElement)("div",{className:"components-modal__header-heading-container"},g&&(0,s.createElement)("span",{className:"components-modal__icon-container","aria-hidden":!0},g),o&&(0,s.createElement)("h1",{id:N,className:"components-modal__header-heading"},o)),p&&(0,s.createElement)(od,{onClick:h,icon:Gl,label:v||(0,u.__)("Close")})),b)))),document.body)}));var gT=hT;const vT={name:"7g5ii0",styles:"&&{z-index:1000001;}"};var bT=Hu((function(e,t){const{isOpen:n,onConfirm:r,onCancel:o,children:i,confirmButtonText:l,cancelButtonText:c,...d}=Vu(e,"ConfirmDialog"),f=Fu()(vT),[p,m]=(0,s.useState)(),[h,g]=(0,s.useState)();(0,s.useEffect)((()=>{const e=void 0!==n;m(!e||n),g(!e)}),[n]);const v=(0,s.useCallback)((e=>t=>{null==e||e(t),h&&m(!1)}),[h,m]),b=(0,s.useCallback)((e=>{"Enter"===e.key&&v(r)(e)}),[v,r]),y=null!=c?c:(0,u.__)("Cancel"),w=null!=l?l:(0,u.__)("OK");return(0,s.createElement)(s.Fragment,null,p&&(0,s.createElement)(gT,a({onRequestClose:v(o),onKeyDown:b,closeButtonLabel:y,isDismissible:!0,ref:t,overlayClassName:f,__experimentalHideHeader:!0},d),(0,s.createElement)(j_,{spacing:8},(0,s.createElement)(Ih,null,i),(0,s.createElement)(Zm,{direction:"row",justify:"flex-end"},(0,s.createElement)(od,{variant:"tertiary",onClick:v(o)},y),(0,s.createElement)(od,{variant:"primary",onClick:v(r)},w)))))}),"ConfirmDialog"),yT=n(2652),wT=n.n(yT);n(2797);function xT(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function _T(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function ET(e,t){if(e.clientHeightt||i>e&&a=t&&s>=n?i-e-r:a>t&&sn?a-t+o:0}var kT=function(){return kT=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0&&C>=0&&E<=h&&_<=m&&x>=O&&E<=A&&C>=L&&_<=D)return T;var z=getComputedStyle(R),B=parseInt(z.borderLeftWidth,10),F=parseInt(z.borderTopWidth,10),V=parseInt(z.borderRightWidth,10),H=parseInt(z.borderBottomWidth,10),j=0,$=0,W="offsetWidth"in R?R.offsetWidth-R.clientWidth-B-V:0,U="offsetHeight"in R?R.offsetHeight-R.clientHeight-F-H:0,G="offsetWidth"in R?0===R.offsetWidth?0:P/R.offsetWidth:0,Y="offsetHeight"in R?0===R.offsetHeight?0:M/R.offsetHeight:0;if(d===R)j="start"===o?k:"end"===o?k-h:"nearest"===o?CT(v,v+h,h,F,H,v+k,v+k+y,y):k-h/2,$="start"===i?S:"center"===i?S-m/2:"end"===i?S-m:CT(g,g+m,m,B,V,g+S,g+S+w,w),j=Math.max(0,j+v),$=Math.max(0,$+g);else{j="start"===o?k-O-F:"end"===o?k-A+H+U:"nearest"===o?CT(O,A,M,F,H+U,k,k+y,y):k-(O+M/2)+U/2,$="start"===i?S-L-B:"center"===i?S-(L+P/2)+W/2:"end"===i?S-D+V+W:CT(L,D,P,B,V+W,S,S+w,w);var q=R.scrollLeft,K=R.scrollTop;k+=K-(j=Math.max(0,Math.min(K+j/Y,R.scrollHeight-M/Y+U))),S+=q-($=Math.max(0,Math.min(q+$/G,R.scrollWidth-P/G+W)))}T.push({el:R,top:j,left:$})}return T}(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach((e=>{let{el:t,top:n,left:r}=e;t.scrollTop=n,t.scrollLeft=r}))}function RT(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function IT(e,t){let n;function r(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,i=new Array(o),a=0;a{n=null,e(...i)}),t)}return o.cancel=r,o}function MT(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;o(t&&t(e,...r),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault)))}}function PT(){for(var e=arguments.length,t=new Array(e),n=0;n{t.forEach((t=>{"function"==typeof t?t(e):t&&(t.current=e)}))}}function OT(){return String(ST++)}function DT(e){let{isOpen:t,resultCount:n,previousResultCount:r}=e;return t?n?n!==r?`${n} result${1===n?" is":"s are"} available, use up and down arrow keys to navigate. Press Enter key to select.`:"":"No results are available.":""}function AT(e,t){return Object.keys(e).reduce(((n,r)=>(n[r]=LT(t,r)?t[r]:e[r],n)),{})}function LT(e,t){return void 0!==e[t]}function zT(e){const{key:t,keyCode:n}=e;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?`Arrow${t}`:t}function BT(e,t,n,r,o){if(void 0===o&&(o=!0),0===n)return-1;const i=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:i+1);let a=t+e;a<0?a=o?i:0:a>i&&(a=o?0:i);const s=FT(e,a,n,r,o);return-1===s?t>=n?-1:t:s}function FT(e,t,n,r,o){const i=r(t);if(!i||!i.hasAttribute("disabled"))return t;if(e>0){for(let e=t+1;e=0;e--)if(!r(e).hasAttribute("disabled"))return e;return o?e>0?FT(1,0,n,r,!1):FT(-1,n-1,n,r,!1):-1}function VT(e,t,n,r){return void 0===r&&(r=!0),t.some((t=>t&&(RT(t,e,n)||r&&RT(t,n.document.activeElement,n))))}const HT=IT((e=>{$T(e).textContent=""}),500);function jT(e,t){const n=$T(t);e&&(n.textContent=e,HT(t))}function $T(e){void 0===e&&(e=document);let t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}const WT={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function UT(e,t,n){const{props:r,type:o}=e,i={};Object.keys(t).forEach((r=>{!function(e,t,n,r){const{props:o,type:i}=t,a=`on${ZT(e)}Change`;o[a]&&void 0!==r[e]&&r[e]!==n[e]&&o[a]({type:i,...r})}(r,e,t,n),n[r]!==t[r]&&(i[r]=n[r])})),r.onStateChange&&Object.keys(i).length&&r.onStateChange({type:o,...i})}const GT=IT(((e,t)=>{jT(e(),t)}),200),YT="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?b.useLayoutEffect:b.useEffect;function qT(e){let{id:t=`downshift-${OT()}`,labelId:n,menuId:r,getItemId:o,toggleButtonId:i,inputId:a}=e;const s=(0,b.useRef)({labelId:n||`${t}-label`,menuId:r||`${t}-menu`,getItemId:o||(e=>`${t}-item-${e}`),toggleButtonId:i||`${t}-toggle-button`,inputId:a||`${t}-input`});return s.current}function KT(e,t,n){return void 0!==e?e:0===n.length?-1:n.indexOf(t)}function XT(e){return/^\S{1}$/.test(e)}function ZT(e){return`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}function JT(e){const t=(0,b.useRef)(e);return t.current=e,t}function QT(e,t,n){const r=(0,b.useRef)(),o=(0,b.useRef)(),i=(0,b.useCallback)(((t,n)=>{o.current=n,t=AT(t,n.props);const r=e(t,n);return n.props.stateReducer(t,{...n,changes:r})}),[e]),[a,s]=(0,b.useReducer)(i,t),l=JT(n),c=(0,b.useCallback)((e=>s({props:l.current,...e})),[l]),u=o.current;return(0,b.useEffect)((()=>{u&&r.current&&r.current!==a&&UT(u,AT(r.current,u.props),a),r.current=a}),[a,n,u]),[a,c]}function eN(e,t,n){const[r,o]=QT(e,t,n);return[AT(r,n),o]}const tN={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){const{selectedItem:t,itemToString:n}=e;return t?`${n(t)} has been selected.`:""},scrollIntoView:NT,circularNavigation:!1,environment:"undefined"==typeof window?{}:window};function nN(e,t,n){void 0===n&&(n=WT);const r=e[`default${ZT(t)}`];return void 0!==r?r:n[t]}function rN(e,t,n){void 0===n&&(n=WT);const r=e[t];if(void 0!==r)return r;const o=e[`initial${ZT(t)}`];return void 0!==o?o:nN(e,t,n)}function oN(e){const t=rN(e,"selectedItem"),n=rN(e,"isOpen"),r=rN(e,"highlightedIndex"),o=rN(e,"inputValue");return{highlightedIndex:r<0&&t&&n?e.items.indexOf(t):r,isOpen:n,selectedItem:t,inputValue:o}}function iN(e,t,n,r){const{items:o,initialHighlightedIndex:i,defaultHighlightedIndex:a}=e,{selectedItem:s,highlightedIndex:l}=t;return 0===o.length?-1:void 0!==i&&l===i?i:void 0!==a?a:s?0===n?o.indexOf(s):BT(n,o.indexOf(s),o.length,r,!1):0===n?-1:n<0?o.length-1:0}function aN(e,t,n,r){const o=(0,b.useRef)({isMouseDown:!1,isTouchMove:!1});return(0,b.useEffect)((()=>{const i=()=>{o.current.isMouseDown=!0},a=i=>{o.current.isMouseDown=!1,e&&!VT(i.target,t.map((e=>e.current)),n)&&r()},s=()=>{o.current.isTouchMove=!1},l=()=>{o.current.isTouchMove=!0},c=i=>{!e||o.current.isTouchMove||VT(i.target,t.map((e=>e.current)),n,!1)||r()};return n.addEventListener("mousedown",i),n.addEventListener("mouseup",a),n.addEventListener("touchstart",s),n.addEventListener("touchmove",l),n.addEventListener("touchend",c),function(){n.removeEventListener("mousedown",i),n.removeEventListener("mouseup",a),n.removeEventListener("touchstart",s),n.removeEventListener("touchmove",l),n.removeEventListener("touchend",c)}}),[e,n]),o}let sN=()=>TT;function lN(e,t,n){let{isInitialMount:r,highlightedIndex:o,items:i,environment:a,...s}=n;(0,b.useEffect)((()=>{r||GT((()=>e({highlightedIndex:o,highlightedItem:i[o],resultCount:i.length,...s})),a.document)}),t)}function cN(e){let{highlightedIndex:t,isOpen:n,itemRefs:r,getItemNodeFromIndex:o,menuElement:i,scrollIntoView:a}=e;const s=(0,b.useRef)(!0);return YT((()=>{t<0||!n||!Object.keys(r.current).length||(!1===s.current?s.current=!0:a(o(t),i))}),[t]),s}let uN=TT;function dN(e,t,n){const{type:r,props:o}=t;let i;switch(r){case n.ItemMouseMove:i={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:i={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:iN(o,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:iN(o,e,0)};break;case n.FunctionCloseMenu:i={isOpen:!1};break;case n.FunctionSetHighlightedIndex:i={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:i={inputValue:t.inputValue};break;case n.FunctionReset:i={highlightedIndex:nN(o,"highlightedIndex"),isOpen:nN(o,"isOpen"),selectedItem:nN(o,"selectedItem"),inputValue:nN(o,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return{...e,...i}}function fN(e){for(var t=e.keysSoFar,n=e.highlightedIndex,r=e.items,o=e.itemToString,i=e.getItemNodeFromIndex,a=t.toLowerCase(),s=0;s=0&&{selectedItem:r.items[a]}}}break;case 13:i={highlightedIndex:iN(r,e,1,t.getItemNodeFromIndex),isOpen:!0};break;case 14:i={highlightedIndex:iN(r,e,-1,t.getItemNodeFromIndex),isOpen:!0};break;case 5:case 6:i={isOpen:nN(r,"isOpen"),highlightedIndex:nN(r,"highlightedIndex"),...e.highlightedIndex>=0&&{selectedItem:r.items[e.highlightedIndex]}};break;case 3:i={highlightedIndex:FT(1,0,r.items.length,t.getItemNodeFromIndex,!1)};break;case 4:i={highlightedIndex:FT(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1)};break;case 2:case 8:i={isOpen:!1,highlightedIndex:-1};break;case 7:{const n=t.key,o=`${e.inputValue}${n}`,a=fN({keysSoFar:o,highlightedIndex:e.highlightedIndex,items:r.items,itemToString:r.itemToString,getItemNodeFromIndex:t.getItemNodeFromIndex});i={inputValue:o,...a>=0&&{highlightedIndex:a}}}break;case 0:i={highlightedIndex:BT(o?5:1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,r.circularNavigation)};break;case 1:i={highlightedIndex:BT(o?-5:-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,r.circularNavigation)};break;case 20:i={selectedItem:t.selectedItem};break;default:return dN(e,t,hN)}return{...e,...i}}function vN(e){void 0===e&&(e={}),mN(e,vN);const t={...pN,...e},{items:n,scrollIntoView:r,environment:o,initialIsOpen:i,defaultIsOpen:a,itemToString:s,getA11ySelectionMessage:l,getA11yStatusMessage:c}=t,u=oN(t),[d,f]=eN(gN,u,t),{isOpen:p,highlightedIndex:m,selectedItem:h,inputValue:g}=d,v=(0,b.useRef)(null),y=(0,b.useRef)(null),w=(0,b.useRef)({}),x=(0,b.useRef)(!0),_=(0,b.useRef)(null),E=qT(t),C=(0,b.useRef)(),k=(0,b.useRef)(!0),S=JT({state:d,props:t}),T=(0,b.useCallback)((e=>w.current[E.getItemId(e)]),[E]);lN(c,[p,m,g,n],{isInitialMount:k.current,previousResultCount:C.current,items:n,environment:o,itemToString:s,...d}),lN(l,[h],{isInitialMount:k.current,previousResultCount:C.current,items:n,environment:o,itemToString:s,...d});const N=cN({menuElement:y.current,highlightedIndex:m,isOpen:p,itemRefs:w,scrollIntoView:r,getItemNodeFromIndex:T});(0,b.useEffect)((()=>(_.current=IT((e=>{e({type:21,inputValue:""})}),500),()=>{_.current.cancel()})),[]),(0,b.useEffect)((()=>{g&&_.current(f)}),[f,g]),uN({isInitialMount:k.current,props:t,state:d}),(0,b.useEffect)((()=>{k.current?(i||a||p)&&y.current&&y.current.focus():p?y.current&&y.current.focus():o.document.activeElement===y.current&&v.current&&(x.current=!1,v.current.focus())}),[p]),(0,b.useEffect)((()=>{k.current||(C.current=n.length)}));const R=aN(p,[y,v],o,(()=>{f({type:8})})),I=sN();(0,b.useEffect)((()=>{k.current=!1}),[]),(0,b.useEffect)((()=>{p||(w.current={})}),[p]);const M=(0,b.useMemo)((()=>({ArrowDown(e){e.preventDefault(),f({type:13,getItemNodeFromIndex:T,shiftKey:e.shiftKey})},ArrowUp(e){e.preventDefault(),f({type:14,getItemNodeFromIndex:T,shiftKey:e.shiftKey})}})),[f,T]),P=(0,b.useMemo)((()=>({ArrowDown(e){e.preventDefault(),f({type:0,getItemNodeFromIndex:T,shiftKey:e.shiftKey})},ArrowUp(e){e.preventDefault(),f({type:1,getItemNodeFromIndex:T,shiftKey:e.shiftKey})},Home(e){e.preventDefault(),f({type:3,getItemNodeFromIndex:T})},End(e){e.preventDefault(),f({type:4,getItemNodeFromIndex:T})},Escape(){f({type:2})},Enter(e){e.preventDefault(),f({type:5})}," "(e){e.preventDefault(),f({type:6})}})),[f,T]),O=(0,b.useCallback)((()=>{f({type:16})}),[f]),D=(0,b.useCallback)((()=>{f({type:18})}),[f]),A=(0,b.useCallback)((()=>{f({type:17})}),[f]),L=(0,b.useCallback)((e=>{f({type:19,highlightedIndex:e})}),[f]),z=(0,b.useCallback)((e=>{f({type:20,selectedItem:e})}),[f]),B=(0,b.useCallback)((()=>{f({type:22})}),[f]),F=(0,b.useCallback)((e=>{f({type:21,inputValue:e})}),[f]),V=(0,b.useCallback)((e=>({id:E.labelId,htmlFor:E.toggleButtonId,...e})),[E]),H=(0,b.useCallback)((function(e,t){let{onMouseLeave:n,refKey:r="ref",onKeyDown:o,onBlur:i,ref:a,...s}=void 0===e?{}:e,{suppressRefError:l=!1}=void 0===t?{}:t;const c=S.current.state;return I("getMenuProps",l,r,y),{[r]:PT(a,(e=>{y.current=e})),id:E.menuId,role:"listbox","aria-labelledby":E.labelId,tabIndex:-1,...c.isOpen&&c.highlightedIndex>-1&&{"aria-activedescendant":E.getItemId(c.highlightedIndex)},onMouseLeave:MT(n,(()=>{f({type:9})})),onKeyDown:MT(o,(e=>{const t=zT(e);t&&P[t]?P[t](e):XT(t)&&f({type:7,key:t,getItemNodeFromIndex:T})})),onBlur:MT(i,(()=>{if(!1===x.current)return void(x.current=!0);!R.current.isMouseDown&&f({type:8})})),...s}}),[f,S,P,R,I,E,T]),j=(0,b.useCallback)((function(e,t){let{onClick:n,onKeyDown:r,refKey:o="ref",ref:i,...a}=void 0===e?{}:e,{suppressRefError:s=!1}=void 0===t?{}:t;const l=()=>{f({type:12})},c=e=>{const t=zT(e);t&&M[t]?M[t](e):XT(t)&&f({type:15,key:t,getItemNodeFromIndex:T})},u={[o]:PT(i,(e=>{v.current=e})),id:E.toggleButtonId,"aria-haspopup":"listbox","aria-expanded":S.current.state.isOpen,"aria-labelledby":`${E.labelId} ${E.toggleButtonId}`,...a};return a.disabled||(u.onClick=MT(n,l),u.onKeyDown=MT(r,c)),I("getToggleButtonProps",s,o,v),u}),[f,S,M,I,E,T]),$=(0,b.useCallback)((function(e){let{item:t,index:n,onMouseMove:r,onClick:o,refKey:i="ref",ref:a,disabled:s,...l}=void 0===e?{}:e;const{state:c,props:u}=S.current,d=()=>{f({type:11,index:n})},p=KT(n,t,u.items);if(p<0)throw new Error("Pass either item or item index in getItemProps!");const m={disabled:s,role:"option","aria-selected":`${p===c.highlightedIndex}`,id:E.getItemId(p),[i]:PT(a,(e=>{e&&(w.current[E.getItemId(p)]=e)})),...l};return s||(m.onClick=MT(o,d)),m.onMouseMove=MT(r,(()=>{n!==c.highlightedIndex&&(N.current=!1,f({type:10,index:n,disabled:s}))})),m}),[f,S,N,E]);return{getToggleButtonProps:j,getLabelProps:V,getMenuProps:H,getItemProps:$,toggleMenu:O,openMenu:A,closeMenu:D,setHighlightedIndex:L,selectItem:z,reset:B,setInputValue:F,highlightedIndex:m,isOpen:p,selectedItem:h,inputValue:g}}vN.stateChangeTypes=hN;wT().array.isRequired,wT().func,wT().func,wT().func,wT().bool,wT().number,wT().number,wT().number,wT().bool,wT().bool,wT().bool,wT().any,wT().any,wT().any,wT().string,wT().string,wT().string,wT().string,wT().string,wT().string,wT().func,wT().string,wT().string,wT().func,wT().func,wT().func,wT().func,wT().func,wT().func,wT().shape({addEventListener:wT().func,removeEventListener:wT().func,document:wT().shape({getElementById:wT().func,activeElement:wT().any,body:wT().any})});wT().array,wT().array,wT().array,wT().func,wT().func,wT().func,wT().number,wT().number,wT().number,wT().func,wT().func,wT().string,wT().string,wT().shape({addEventListener:wT().func,removeEventListener:wT().func,document:wT().shape({getElementById:wT().func,activeElement:wT().any,body:wT().any})});const bN=e=>e.__nextUnconstrainedWidth?"":Wf($h,"{min-width:130px;}",""),yN=Ju(ng,{target:"eswuck60"})(bN,";"),wN=e=>null==e?void 0:e.name,xN=(e,t)=>{let{selectedItem:n}=e,{type:r,changes:o,props:{items:i}}=t;switch(r){case vN.stateChangeTypes.ToggleButtonKeyDownArrowDown:return{selectedItem:i[n?Math.min(i.indexOf(n)+1,i.length-1):0]};case vN.stateChangeTypes.ToggleButtonKeyDownArrowUp:return{selectedItem:i[n?Math.max(i.indexOf(n)-1,0):i.length-1]};default:return o}};function _N(e){var t;const{__next36pxDefaultSize:n=!1,__nextUnconstrainedWidth:r=!1,className:o,hideLabelFromVision:i,label:l,describedBy:d,options:f,onChange:p,size:m="default",value:h,onMouseOver:g,onMouseOut:v,onFocus:b,onBlur:y,__experimentalShowSelectedHint:w=!1}=e,{getLabelProps:x,getToggleButtonProps:_,getMenuProps:E,getItemProps:C,isOpen:k,highlightedIndex:S,selectedItem:T}=vN({initialSelectedItem:f[0],items:f,itemToString:wN,onSelectedItemChange:p,...null!=h?{selectedItem:h}:void 0,stateReducer:xN}),[N,R]=(0,s.useState)(!1);r||ql()("Constrained width styles for wp.components.CustomSelectControl",{since:"6.1",version:"6.4",hint:"Set the `__nextUnconstrainedWidth` prop to true to start opting into the new styles, which will become the default in a future version"});const I=E({className:"components-custom-select-control__menu","aria-hidden":!k}),M=(0,s.useCallback)((e=>{var t;e.stopPropagation(),null==I||null===(t=I.onKeyDown)||void 0===t||t.call(I,e)}),[I]);return null!==(t=I["aria-activedescendant"])&&void 0!==t&&t.startsWith("downshift-null")&&delete I["aria-activedescendant"],(0,s.createElement)("div",{className:c()("components-custom-select-control",o)},i?(0,s.createElement)(td,a({as:"label"},x()),l):(0,s.createElement)(Ev,x({className:"components-custom-select-control__label"}),l),(0,s.createElement)(yN,{__next36pxDefaultSize:n,__nextUnconstrainedWidth:r,isFocused:k||N,__unstableInputWidth:r?void 0:"auto",labelPosition:r?void 0:"top",size:m,suffix:(0,s.createElement)(cy,null)},(0,s.createElement)(oy,a({onMouseOver:g,onMouseOut:v,as:"button",onFocus:function(e){R(!0),null==b||b(e)},onBlur:function(e){R(!1),null==y||y(e)},selectSize:m,__next36pxDefaultSize:n},_({"aria-label":l,"aria-labelledby":void 0,className:"components-custom-select-control__button",describedBy:d||(T?(0,u.sprintf)((0,u.__)("Currently selected: %s"),T.name):(0,u.__)("No selection"))})),wN(T),w&&T.__experimentalHint&&(0,s.createElement)("span",{className:"components-custom-select-control__hint"},T.__experimentalHint))),(0,s.createElement)("ul",a({},I,{onKeyDown:M}),k&&f.map(((e,t)=>(0,s.createElement)("li",C({item:e,index:t,key:e.key,className:c()(e.className,"components-custom-select-control__item",{"is-highlighted":t===S,"has-hint":!!e.__experimentalHint,"is-next-36px-default-size":n}),style:e.style}),e.name,e.__experimentalHint&&(0,s.createElement)("span",{className:"components-custom-select-control__item-hint"},e.__experimentalHint),e===T&&(0,s.createElement)(sy,{icon:V_,className:"components-custom-select-control__item-icon"}))))))}function EN(e){return(0,s.createElement)(_N,a({},e,{__experimentalShowSelectedHint:!1}))}function CN(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function kN(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function SN(e){kN(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function TN(e,t){kN(2,arguments);var n=SN(e),r=CN(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function NN(e,t){kN(2,arguments);var n=SN(e),r=CN(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),i=new Date(n.getTime());i.setMonth(n.getMonth()+r+1,0);var a=i.getDate();return o>=a?i:(n.setFullYear(i.getFullYear(),i.getMonth(),o),n)}var RN,IN,MN={};function PN(){return MN}function ON(e,t){var n,r,o,i,a,s,l,c;kN(1,arguments);var u=PN(),d=CN(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=SN(e),p=f.getDay(),m=(p=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=SN(e),p=f.getDay(),m=6+(pr.getTime()}(e,t))&&(HN(e,n)||function(e,t){kN(2,arguments);var n=SN(e),r=SN(t);return n.getTime()-1}),[_]),k=(0,b.useCallback)((function(e,t){E(t?Array.isArray(e)?e:[e]:function(t){return t.concat(Array.isArray(e)?e:[e])})}),[]),S=(0,b.useCallback)((function(e){return E((function(t){return Array.isArray(e)?t.filter((function(t){return!e.map((function(e){return e.getTime()})).includes(t.getTime())})):t.filter((function(t){return!HN(t,e)}))}))}),[]),T=(0,b.useCallback)((function(e,t){return C(e)?S(e):k(e,t)}),[S,C,k]),N=(0,b.useCallback)((function(e,t,n){E(n?zN({start:e,end:t}):function(n){return n.concat(zN({start:e,end:t}))})}),[]),R=(0,b.useCallback)((function(e,t){E((function(n){return n.filter((function(n){return!zN({start:e,end:t}).map((function(e){return e.getTime()})).includes(n.getTime())}))}))}),[]),I=(0,b.useMemo)((function(){return function(e){kN(1,arguments);var t=e||{},n=SN(t.start),r=SN(t.end).getTime(),o=[];if(!(n.getTime()<=r))throw new RangeError("Invalid interval");var i=n;for(i.setHours(0,0,0,0),i.setDate(1);i.getTime()<=r;)o.push(SN(i)),i.setMonth(i.getMonth()+1);return o}({start:BN(d),end:LN(NN(d,c-1))}).map((function(e){return function(e,t){kN(1,arguments);var n=e||{},r=SN(n.start),o=SN(n.end),i=o.getTime();if(!(r.getTime()<=i))throw new RangeError("Invalid interval");var a=ON(r,t),s=ON(o,t);a.setHours(15),s.setHours(15),i=s.getTime();for(var l=[],c=a;c.getTime()<=i;)c.setHours(0),l.push(SN(c)),(c=DN(c,1)).setHours(15);return l}({start:BN(e),end:LN(e)},{weekStartsOn:r}).map((function(e){return zN({start:ON(e,{weekStartsOn:r}),end:FN(e,{weekStartsOn:r})})}))}))}),[d,r,c]);return{clearTime:UN,inRange:WN,viewing:d,setViewing:f,viewToday:p,viewMonth:m,viewPreviousMonth:h,viewNextMonth:g,viewYear:v,viewPreviousYear:y,viewNextYear:w,selected:_,setSelected:E,clearSelected:function(){return E([])},isSelected:C,select:k,deselect:S,toggle:T,selectRange:N,deselectRange:R,calendar:I}};function YN(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function qN(e){return qN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qN(e)}function KN(e){YN(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===qN(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function XN(e){YN(1,arguments);var t=KN(e);return t.setHours(0,0,0,0),t}function ZN(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function JN(e,t){YN(2,arguments);var n=KN(e),r=ZN(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),i=new Date(n.getTime());i.setMonth(n.getMonth()+r+1,0);var a=i.getDate();return o>=a?i:(n.setFullYear(i.getFullYear(),i.getMonth(),o),n)}function QN(e,t){YN(2,arguments);var n=ZN(t);return JN(e,-n)}function eR(e){return eR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eR(e)}function tR(e){return YN(1,arguments),e instanceof Date||"object"===eR(e)&&"[object Date]"===Object.prototype.toString.call(e)}function nR(e){if(YN(1,arguments),!tR(e)&&"number"!=typeof e)return!1;var t=KN(e);return!isNaN(Number(t))}function rR(e,t){YN(2,arguments);var n=KN(e).getTime(),r=ZN(t);return new Date(n+r)}function oR(e,t){YN(2,arguments);var n=ZN(t);return rR(e,-n)}var iR=864e5;function aR(e){YN(1,arguments);var t=1,n=KN(e),r=n.getUTCDay(),o=(r=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function lR(e){YN(1,arguments);var t=sR(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=aR(n);return r}var cR=6048e5;var uR={};function dR(){return uR}function fR(e,t){var n,r,o,i,a,s,l,c;YN(1,arguments);var u=dR(),d=ZN(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=KN(e),p=f.getUTCDay(),m=(p=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(d+1,0,p),m.setUTCHours(0,0,0,0);var h=fR(m,t),g=new Date(0);g.setUTCFullYear(d,0,p),g.setUTCHours(0,0,0,0);var v=fR(g,t);return u.getTime()>=h.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}function mR(e,t){var n,r,o,i,a,s,l,c;YN(1,arguments);var u=dR(),d=ZN(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==o?o:u.firstWeekContainsDate)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),f=pR(e,t),p=new Date(0);p.setUTCFullYear(f,0,d),p.setUTCHours(0,0,0,0);var m=fR(p,t);return m}var hR=6048e5;function gR(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length0?n:1-n;return gR("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):gR(n+1,2)},d:function(e,t){return gR(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(e,t){return gR(e.getUTCHours()%12||12,t.length)},H:function(e,t){return gR(e.getUTCHours(),t.length)},m:function(e,t){return gR(e.getUTCMinutes(),t.length)},s:function(e,t){return gR(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds();return gR(Math.floor(r*Math.pow(10,n-3)),t.length)}},bR=vR,yR="midnight",wR="noon",xR="morning",_R="afternoon",ER="evening",CR="night",kR={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return bR.y(e,t)},Y:function(e,t,n,r){var o=pR(e,r),i=o>0?o:1-o;return"YY"===t?gR(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):gR(i,t.length)},R:function(e,t){return gR(sR(e),t.length)},u:function(e,t){return gR(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return gR(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return gR(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return bR.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return gR(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=function(e,t){YN(1,arguments);var n=KN(e),r=fR(n,t).getTime()-mR(n,t).getTime();return Math.round(r/hR)+1}(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):gR(o,t.length)},I:function(e,t,n){var r=function(e){YN(1,arguments);var t=KN(e),n=aR(t).getTime()-lR(t).getTime();return Math.round(n/cR)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):gR(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):bR.d(e,t)},D:function(e,t,n){var r=function(e){YN(1,arguments);var t=KN(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),o=n-r;return Math.floor(o/iR)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):gR(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return gR(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return gR(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return gR(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?wR:0===o?yR:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?ER:o>=12?_R:o>=4?xR:CR,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return bR.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):bR.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):gR(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):gR(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):bR.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):bR.s(e,t)},S:function(e,t){return bR.S(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return TR(o);case"XXXX":case"XX":return NR(o);default:return NR(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return TR(o);case"xxxx":case"xx":return NR(o);default:return NR(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+SR(o,":");default:return"GMT"+NR(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+SR(o,":");default:return"GMT"+NR(o,":")}},t:function(e,t,n,r){var o=r._originalDate||e;return gR(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,n,r){return gR((r._originalDate||e).getTime(),t.length)}};function SR(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(0===i)return n+String(o);var a=t||"";return n+String(o)+a+gR(i,2)}function TR(e,t){return e%60==0?(e>0?"-":"+")+gR(Math.abs(e)/60,2):NR(e,t)}function NR(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+gR(Math.floor(o/60),2)+n+gR(o%60,2)}var RR=kR,IR=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},MR=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},PR={p:MR,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return IR(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",IR(o,t)).replace("{{time}}",MR(i,t))}},OR=PR;function DR(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var AR=["D","DD"],LR=["YY","YYYY"];function zR(e){return-1!==AR.indexOf(e)}function BR(e){return-1!==LR.indexOf(e)}function FR(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var VR={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},HR=function(e,t,n){var r,o=VR[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function jR(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var $R={date:jR({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:jR({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:jR({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},WR={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},UR=function(e,t,n,r){return WR[e]};function GR(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,i=null!=n&&n.width?String(n.width):o;r=e.formattingValues[i]||e.formattingValues[o]}else{var a=e.defaultWidth,s=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[s]||e.values[a]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var YR={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:GR({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:GR({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:GR({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:GR({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:GR({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},qR=YR;function KR(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a,s=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?ZR(l,(function(e){return e.test(s)})):XR(l,(function(e){return e.test(s)}));a=e.valueCallback?e.valueCallback(c):c,a=n.valueCallback?n.valueCallback(a):a;var u=t.slice(s.length);return{value:a,rest:u}}}function XR(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function ZR(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(JR.matchPattern);if(!n)return null;var r=n[0],o=e.match(JR.parsePattern);if(!o)return null;var i=JR.valueCallback?JR.valueCallback(o[0]):o[0];i=t.valueCallback?t.valueCallback(i):i;var a=e.slice(r.length);return{value:i,rest:a}}),era:KR({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:KR({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:KR({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:KR({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:KR({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},eI={code:"en-US",formatDistance:HR,formatLong:$R,formatRelative:UR,localize:qR,match:QR,options:{weekStartsOn:0,firstWeekContainsDate:1}},tI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,nI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rI=/^'([^]*?)'?$/,oI=/''/g,iI=/[a-zA-Z]/;function aI(e,t,n){var r,o,i,a,s,l,c,u,d,f,p,m,h,g,v,b,y,w;YN(2,arguments);var x=String(t),_=dR(),E=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:_.locale)&&void 0!==r?r:eI,C=ZN(null!==(i=null!==(a=null!==(s=null!==(l=null==n?void 0:n.firstWeekContainsDate)&&void 0!==l?l:null==n||null===(c=n.locale)||void 0===c||null===(u=c.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==s?s:_.firstWeekContainsDate)&&void 0!==a?a:null===(d=_.locale)||void 0===d||null===(f=d.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==i?i:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=ZN(null!==(p=null!==(m=null!==(h=null!==(g=null==n?void 0:n.weekStartsOn)&&void 0!==g?g:null==n||null===(v=n.locale)||void 0===v||null===(b=v.options)||void 0===b?void 0:b.weekStartsOn)&&void 0!==h?h:_.weekStartsOn)&&void 0!==m?m:null===(y=_.locale)||void 0===y||null===(w=y.options)||void 0===w?void 0:w.weekStartsOn)&&void 0!==p?p:0);if(!(k>=0&&k<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!E.localize)throw new RangeError("locale must contain localize property");if(!E.formatLong)throw new RangeError("locale must contain formatLong property");var S=KN(e);if(!nR(S))throw new RangeError("Invalid time value");var T=DR(S),N=oR(S,T),R={firstWeekContainsDate:C,weekStartsOn:k,locale:E,_originalDate:S},I=x.match(nI).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,OR[t])(e,E.formatLong):e})).join("").match(tI).map((function(r){if("''"===r)return"'";var o=r[0];if("'"===o)return sI(r);var i=RR[o];if(i)return null!=n&&n.useAdditionalWeekYearTokens||!BR(r)||FR(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!zR(r)||FR(r,t,String(e)),i(N,r,E.localize,R);if(o.match(iI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("");return I}function sI(e){var t=e.match(rI);return t?t[1].replace(oI,"'"):e}function lI(e,t){YN(2,arguments);var n=KN(e),r=KN(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function cI(e,t){YN(2,arguments);var n=KN(e),r=KN(t);return n.getTime()===r.getTime()}function uI(e,t){YN(2,arguments);var n=XN(e),r=XN(t);return n.getTime()===r.getTime()}function dI(e,t){YN(2,arguments);var n=KN(e),r=ZN(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function fI(e,t){YN(2,arguments);var n=ZN(t),r=7*n;return dI(e,r)}var pI=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"}));var mI=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})),hI=window.wp.date;const gI=Ju("div",{target:"e105ri6r5"})({name:"1khn195",styles:"box-sizing:border-box"}),vI=Ju(Gv,{target:"e105ri6r4"})("margin-bottom:",Km(4),";"),bI=Ju(W_,{target:"e105ri6r3"})("font-size:",mh.fontSize,";font-weight:",mh.fontWeight,";strong{font-weight:",mh.fontWeightHeading,";}"),yI=Ju("div",{target:"e105ri6r2"})("column-gap:",Km(2),";display:grid;grid-template-columns:0.5fr repeat( 5, 1fr ) 0.5fr;justify-items:center;row-gap:",Km(2),";"),wI=Ju("div",{target:"e105ri6r1"})("color:",Sp.gray[700],";font-size:",mh.fontSize,";line-height:",mh.fontLineHeightBase,";&:nth-of-type( 1 ){justify-self:start;}&:nth-of-type( 7 ){justify-self:end;}"),xI=Ju(od,{shouldForwardProp:e=>!["column","isSelected","isToday","hasEvents"].includes(e),target:"e105ri6r0"})("grid-column:",(e=>e.column),";position:relative;justify-content:center;",(e=>1===e.column&&"\n\t\tjustify-self: start;\n\t\t")," ",(e=>7===e.column&&"\n\t\tjustify-self: end;\n\t\t")," ",(e=>e.disabled&&"\n\t\tpointer-events: none;\n\t\t")," &&&{border-radius:100%;height:",Km(7),";width:",Km(7),";",(e=>e.isSelected&&`\n\t\t\tbackground: ${Sp.ui.theme};\n\t\t\tcolor: ${Sp.white};\n\t\t\t`)," ",(e=>!e.isSelected&&e.isToday&&`\n\t\t\tbackground: ${Sp.gray[200]};\n\t\t\t`),";}",(e=>e.hasEvents&&`\n\t\t::before {\n\t\t\tbackground: ${e.isSelected?Sp.white:Sp.ui.theme};\n\t\t\tborder-radius: 2px;\n\t\t\tbottom: 0;\n\t\t\tcontent: " ";\n\t\t\theight: 4px;\n\t\t\tleft: 50%;\n\t\t\tmargin-left: -2px;\n\t\t\tposition: absolute;\n\t\t\twidth: 4px;\n\t\t}\n\t\t`),";");function _I(e){return"string"==typeof e?new Date(e):KN(e)}const EI="yyyy-MM-dd'T'HH:mm:ss";function CI(e){let{day:t,column:n,isSelected:r,isFocusable:o,isFocusAllowed:i,isToday:a,isInvalid:l,numEvents:c,onClick:u,onKeyDown:d}=e;const f=(0,s.useRef)();return(0,s.useEffect)((()=>{f.current&&o&&i&&f.current.focus()}),[o]),(0,s.createElement)(xI,{ref:f,className:"components-datetime__date__day",disabled:l,tabIndex:o?0:-1,"aria-label":kI(t,r,c),column:n,isSelected:r,isToday:a,hasEvents:c>0,onClick:u,onKeyDown:d},(0,hI.dateI18n)("j",t,-t.getTimezoneOffset()))}function kI(e,t,n){const{formats:r}=(0,hI.getSettings)(),o=(0,hI.dateI18n)(r.date,e,-e.getTimezoneOffset());return t&&n>0?(0,u.sprintf)((0,u._n)("%1$s. Selected. There is %2$d event","%1$s. Selected. There are %2$d events",n),o,n):t?(0,u.sprintf)((0,u.__)("%1$s. Selected"),o):n>0?(0,u.sprintf)((0,u._n)("%1$s. There is %2$d event","%1$s. There are %2$d events",n),o,n):o}var SI=function(e){let{currentDate:t,onChange:n,events:r=[],isInvalidDate:o,onMonthPreviewed:i,startOfWeek:a=0}=e;const l=t?_I(t):new Date,{calendar:c,viewing:d,setSelected:f,setViewing:p,isSelected:m,viewPreviousMonth:h,viewNextMonth:g}=GN({selected:[XN(l)],viewing:XN(l),weekStartsOn:a}),[v,b]=(0,s.useState)(XN(l)),[y,w]=(0,s.useState)(!1),[x,_]=(0,s.useState)(t);return t!==x&&(_(t),f([XN(l)]),p(XN(l)),b(XN(l))),(0,s.createElement)(gI,{className:"components-datetime__date",role:"application","aria-label":(0,u.__)("Calendar")},(0,s.createElement)(vI,null,(0,s.createElement)(od,{icon:(0,u.isRTL)()?pI:mI,variant:"tertiary","aria-label":(0,u.__)("View previous month"),onClick:()=>{h(),b(QN(v,1)),null==i||i(aI(QN(d,1),EI))}}),(0,s.createElement)(bI,{level:3},(0,s.createElement)("strong",null,(0,hI.dateI18n)("F",d,-d.getTimezoneOffset()))," ",(0,hI.dateI18n)("Y",d,-d.getTimezoneOffset())),(0,s.createElement)(od,{icon:(0,u.isRTL)()?mI:pI,variant:"tertiary","aria-label":(0,u.__)("View next month"),onClick:()=>{g(),b(JN(v,1)),null==i||i(aI(JN(d,1),EI))}})),(0,s.createElement)(yI,{onFocus:()=>w(!0),onBlur:()=>w(!1)},c[0][0].map((e=>(0,s.createElement)(wI,{key:e.toString()},(0,hI.dateI18n)("D",e,-e.getTimezoneOffset())))),c[0].map((e=>e.map(((e,t)=>lI(e,d)?(0,s.createElement)(CI,{key:e.toString(),day:e,column:t+1,isSelected:m(e),isFocusable:cI(e,v),isFocusAllowed:y,isToday:uI(e,new Date),isInvalid:!!o&&o(e),numEvents:r.filter((t=>uI(t.date,e))).length,onClick:()=>{f([e]),b(e),null==n||n(aI(new Date(e.getFullYear(),e.getMonth(),e.getDate(),l.getHours(),l.getMinutes(),l.getSeconds(),l.getMilliseconds()),EI))},onKeyDown:t=>{let n;"ArrowLeft"===t.key&&(n=dI(e,(0,u.isRTL)()?1:-1)),"ArrowRight"===t.key&&(n=dI(e,(0,u.isRTL)()?-1:1)),"ArrowUp"===t.key&&(n=function(e,t){YN(2,arguments);var n=ZN(t);return fI(e,-n)}(e,1)),"ArrowDown"===t.key&&(n=fI(e,1)),"PageUp"===t.key&&(n=QN(e,1)),"PageDown"===t.key&&(n=JN(e,1)),"Home"===t.key&&(n=function(e,t){var n,r,o,i,a,s,l,c;YN(1,arguments);var u=dR(),d=ZN(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=KN(e),p=f.getDay(),m=(p=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=KN(e),p=f.getDay(),m=6+(p{const{timezone:e}=(0,hI.getSettings)(),t=(new Date).getTimezoneOffset()/60*-1;if(Number(e.offset)===t)return null;const n=Number(e.offset)>=0?"+":"",r=""!==e.abbr&&isNaN(Number(e.abbr))?e.abbr:`UTC${n}${e.offset}`,o="UTC"===e.string?(0,u.__)("Coordinated Universal Time"):`(${r}) ${e.string.replace("_"," ")}`;return(0,s.createElement)(Bf,{position:"top center",text:o},(0,s.createElement)(jI,{className:"components-datetime__timezone"},r))};function WI(e,t){return t?(e%12+12)%24:e%12}function UI(e){return(t,n)=>{const r={...t};return n.type!==nv&&n.type!==uv&&n.type!==lv||void 0!==r.value&&(r.value=r.value.toString().padStart(e,"0")),r}}var GI=function(e){let{is12Hour:t,currentTime:n,onChange:r}=e;const[o,i]=(0,s.useState)((()=>n?TI(_I(n)):new Date));(0,s.useEffect)((()=>{i(n?TI(_I(n)):new Date)}),[n]);const{day:a,month:l,year:c,minutes:d,hours:f,am:p}=(0,s.useMemo)((()=>({day:aI(o,"dd"),month:aI(o,"MM"),year:aI(o,"yyyy"),minutes:aI(o,"mm"),hours:aI(o,t?"hh":"HH"),am:aI(o,"a")})),[o,t]),m=e=>(n,a)=>{let{event:s}=a;if(!(s.target instanceof HTMLInputElement))return;if(!s.target.validity.valid)return;let l=Number(n);"hours"===e&&t&&(l=WI(l,"PM"===p));const c=function(e,t){if(YN(2,arguments),"object"!==II(t)||null===t)throw new RangeError("values parameter must be an object");var n=KN(e);return isNaN(n.getTime())?new Date(NaN):(null!=t.year&&n.setFullYear(t.year),null!=t.month&&(n=RI(n,t.month)),null!=t.date&&n.setDate(ZN(t.date)),null!=t.hours&&n.setHours(ZN(t.hours)),null!=t.minutes&&n.setMinutes(ZN(t.minutes)),null!=t.seconds&&n.setSeconds(ZN(t.seconds)),null!=t.milliseconds&&n.setMilliseconds(ZN(t.milliseconds)),n)}(o,{[e]:l});i(c),null==r||r(aI(c,EI))};function h(e){return()=>{if(p===e)return;const t=parseInt(f,10),n=function(e,t){YN(2,arguments);var n=KN(e),r=ZN(t);return n.setHours(r),n}(o,WI(t,"PM"===e));i(n),null==r||r(aI(n,EI))}}const g=(0,s.createElement)(VI,{className:"components-datetime__time-field components-datetime__time-field-day",label:(0,u.__)("Day"),hideLabelFromVision:!0,__next36pxDefaultSize:!0,value:a,step:1,min:1,max:31,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:m("date")}),v=(0,s.createElement)(BI,null,(0,s.createElement)(FI,{className:"components-datetime__time-field components-datetime__time-field-month",label:(0,u.__)("Month"),hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,value:l,options:[{value:"01",label:(0,u.__)("January")},{value:"02",label:(0,u.__)("February")},{value:"03",label:(0,u.__)("March")},{value:"04",label:(0,u.__)("April")},{value:"05",label:(0,u.__)("May")},{value:"06",label:(0,u.__)("June")},{value:"07",label:(0,u.__)("July")},{value:"08",label:(0,u.__)("August")},{value:"09",label:(0,u.__)("September")},{value:"10",label:(0,u.__)("October")},{value:"11",label:(0,u.__)("November")},{value:"12",label:(0,u.__)("December")}],onChange:e=>{const t=RI(o,Number(e)-1);i(t),null==r||r(aI(t,EI))}}));return(0,s.createElement)(MI,{className:"components-datetime__time"},(0,s.createElement)(PI,null,(0,s.createElement)(Nv.VisualLabel,{as:"legend",className:"components-datetime__time-legend"},(0,u.__)("Time")),(0,s.createElement)(Gv,{className:"components-datetime__time-wrapper"},(0,s.createElement)(OI,{className:"components-datetime__time-field components-datetime__time-field-time"},(0,s.createElement)(AI,{className:"components-datetime__time-field-hours-input",label:(0,u.__)("Hours"),hideLabelFromVision:!0,__next36pxDefaultSize:!0,value:f,step:1,min:t?1:0,max:t?12:23,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:m("hours"),__unstableStateReducer:UI(2)}),(0,s.createElement)(LI,{className:"components-datetime__time-separator","aria-hidden":"true"},":"),(0,s.createElement)(zI,{className:"components-datetime__time-field-minutes-input",label:(0,u.__)("Minutes"),hideLabelFromVision:!0,__next36pxDefaultSize:!0,value:d,step:1,min:0,max:59,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:m("minutes"),__unstableStateReducer:UI(2)})),t&&(0,s.createElement)(RC,{className:"components-datetime__time-field components-datetime__time-field-am-pm"},(0,s.createElement)(od,{className:"components-datetime__time-am-button",variant:"AM"===p?"primary":"secondary",onClick:h("AM")},(0,u.__)("AM")),(0,s.createElement)(od,{className:"components-datetime__time-pm-button",variant:"PM"===p?"primary":"secondary",onClick:h("PM")},(0,u.__)("PM"))),(0,s.createElement)(Kv,null),(0,s.createElement)($I,null))),(0,s.createElement)(PI,null,(0,s.createElement)(Nv.VisualLabel,{as:"legend",className:"components-datetime__time-legend"},(0,u.__)("Date")),(0,s.createElement)(Gv,{className:"components-datetime__time-wrapper"},t?(0,s.createElement)(s.Fragment,null,v,g):(0,s.createElement)(s.Fragment,null,g,v),(0,s.createElement)(HI,{className:"components-datetime__time-field components-datetime__time-field-year",label:(0,u.__)("Year"),hideLabelFromVision:!0,__next36pxDefaultSize:!0,value:c,step:1,min:1,max:9999,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:m("year"),__unstableStateReducer:UI(4)}))))};const YI=Ju(j_,{target:"e1p5onf01"})({name:"1khn195",styles:"box-sizing:border-box"}),qI=Ju("div",{target:"e1p5onf00"})({name:"l0rwn2",styles:"min-width:260px"}),KI=()=>{};const XI=(0,s.forwardRef)((function(e,t){let{currentDate:n,is12Hour:r,isInvalidDate:o,onMonthPreviewed:i=KI,onChange:a,events:l,startOfWeek:c,__nextRemoveHelpButton:d=!1,__nextRemoveResetButton:f=!1}=e;d||ql()("Help button in wp.components.DateTimePicker",{since:"13.4",version:"15.8",hint:"Set the `__nextRemoveHelpButton` prop to `true` to remove this warning and opt in to the new behaviour, which will become the default in a future version."}),f||ql()("Reset button in wp.components.DateTimePicker",{since:"13.4",version:"15.8",hint:"Set the `__nextRemoveResetButton` prop to `true` to remove this warning and opt in to the new behaviour, which will become the default in a future version."});const[p,m]=(0,s.useState)(!1);return(0,s.createElement)(YI,{ref:t,className:"components-datetime",spacing:4},!p&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(GI,{currentTime:n,onChange:a,is12Hour:r}),(0,s.createElement)(SI,{currentDate:n,onChange:a,isInvalidDate:o,events:l,onMonthPreviewed:i,startOfWeek:c})),p&&(0,s.createElement)(qI,{className:"components-datetime__calendar-help"},(0,s.createElement)(W_,{level:4},(0,u.__)("Click to Select")),(0,s.createElement)("ul",null,(0,s.createElement)("li",null,(0,u.__)("Click the right or left arrows to select other months in the past or the future.")),(0,s.createElement)("li",null,(0,u.__)("Click the desired day to select it."))),(0,s.createElement)(W_,{level:4},(0,u.__)("Navigating with a keyboard")),(0,s.createElement)("ul",null,(0,s.createElement)("li",null,(0,s.createElement)("abbr",{"aria-label":(0,u._x)("Enter","keyboard button")},"↵")," ",(0,s.createElement)("span",null,(0,u.__)("Select the date in focus."))),(0,s.createElement)("li",null,(0,s.createElement)("abbr",{"aria-label":(0,u.__)("Left and Right Arrows")},"←/→")," ",(0,u.__)("Move backward (left) or forward (right) by one day.")),(0,s.createElement)("li",null,(0,s.createElement)("abbr",{"aria-label":(0,u.__)("Up and Down Arrows")},"↑/↓")," ",(0,u.__)("Move backward (up) or forward (down) by one week.")),(0,s.createElement)("li",null,(0,s.createElement)("abbr",{"aria-label":(0,u.__)("Page Up and Page Down")},(0,u.__)("PgUp/PgDn"))," ",(0,u.__)("Move backward (PgUp) or forward (PgDn) by one month.")),(0,s.createElement)("li",null,(0,s.createElement)("abbr",{"aria-label":(0,u.__)("Home and End")},(0,u.__)("Home/End"))," ",(0,u.__)("Go to the first (Home) or last (End) day of a week.")))),(!f||!d)&&(0,s.createElement)(Gv,{className:"components-datetime__buttons"},!f&&!p&&n&&(0,s.createElement)(od,{className:"components-datetime__date-reset-button",variant:"link",onClick:()=>null==a?void 0:a(null)},(0,u.__)("Reset")),(0,s.createElement)(Kv,null),!d&&(0,s.createElement)(od,{className:"components-datetime__date-help-toggle",variant:"link",onClick:function(){m(!p)}},p?(0,u.__)("Close"):(0,u.__)("Calendar Help"))))}));var ZI=XI;var JI=[{name:(0,u._x)("None","Size of a UI element"),slug:"none"},{name:(0,u._x)("Small","Size of a UI element"),slug:"small"},{name:(0,u._x)("Medium","Size of a UI element"),slug:"medium"},{name:(0,u._x)("Large","Size of a UI element"),slug:"large"},{name:(0,u._x)("Extra Large","Size of a UI element"),slug:"xlarge"}];var QI=function(e){const{label:t,value:n,sizes:r=JI,icon:o,onChange:i,className:a=""}=e,l=(0,s.createElement)(s.Fragment,null,o&&(0,s.createElement)(Xl,{icon:o}),t);return(0,s.createElement)(fy,{className:c()(a,"block-editor-dimension-control"),label:l,hideLabelFromVision:!1,value:n,onChange:e=>{const t=((e,t)=>e.find((e=>t===e.slug)))(r,e);t&&n!==t.slug?"function"==typeof i&&i(t.slug):i(void 0)},options:(e=>{const t=e.map((e=>{let{name:t,slug:n}=e;return{label:t,value:n}}));return[{label:(0,u.__)("Default"),value:""}].concat(t)})(r)})};const eM={name:"u2jump",styles:"position:relative;pointer-events:none;&::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;}*{pointer-events:none;}"},tM=(0,s.createContext)(!1),{Consumer:nM,Provider:rM}=tM;function oM(e){let{className:t,children:n,isDisabled:r=!0,...o}=e;const i=Fu();return(0,s.createElement)(rM,{value:r},(0,s.createElement)("div",a({inert:r?"true":void 0,className:r?i(eM,t,"components-disabled"):void 0},o),n))}oM.Context=tM,oM.Consumer=nM;var iM=oM;const aM="is-dragging-components-draggable";var sM=function(e){let{children:t,onDragStart:n,onDragOver:r,onDragEnd:o,cloneClassname:i,elementId:a,transferData:l,__experimentalTransferDataType:c="text",__experimentalDragComponent:u}=e;const f=(0,s.useRef)(null),p=(0,s.useRef)((()=>{}));return(0,s.useEffect)((()=>()=>{p.current()}),[]),(0,s.createElement)(s.Fragment,null,t({onDraggableStart:function(e){const{ownerDocument:t}=e.target;e.dataTransfer.setData(c,JSON.stringify(l));const o=t.createElement("div");o.style.top="0",o.style.left="0";const s=t.createElement("div");"function"==typeof e.dataTransfer.setDragImage&&(s.classList.add("components-draggable__invisible-drag-image"),t.body.appendChild(s),e.dataTransfer.setDragImage(s,0,0)),o.classList.add("components-draggable__clone"),i&&o.classList.add(i);let u=0,m=0;if(f.current){u=e.clientX,m=e.clientY,o.style.transform=`translate( ${u}px, ${m}px )`;const n=t.createElement("div");n.innerHTML=f.current.innerHTML,o.appendChild(n),t.body.appendChild(o)}else{const e=t.getElementById(a),n=e.getBoundingClientRect(),r=e.parentNode,i=n.top,s=n.left;o.style.width=`${n.width+0}px`;const l=e.cloneNode(!0);l.id=`clone-${a}`,u=s-0,m=i-0,o.style.transform=`translate( ${u}px, ${m}px )`,Array.from(l.querySelectorAll("iframe")).forEach((e=>{var t;return null===(t=e.parentNode)||void 0===t?void 0:t.removeChild(e)})),o.appendChild(l),null==r||r.appendChild(o)}let h=e.clientX,g=e.clientY;const v=(0,d.throttle)((function(e){if(h===e.clientX&&g===e.clientY)return;const t=u+e.clientX-h,n=m+e.clientY-g;o.style.transform=`translate( ${t}px, ${n}px )`,h=e.clientX,g=e.clientY,u=t,m=n,r&&r(e)}),16);let b;t.addEventListener("dragover",v),t.body.classList.add(aM),e.persist(),n&&(b=setTimeout((()=>n(e)))),p.current=()=>{o&&o.parentNode&&o.parentNode.removeChild(o),s&&s.parentNode&&s.parentNode.removeChild(s),t.body.classList.remove(aM),t.removeEventListener("dragover",v),clearTimeout(b)}},onDraggableEnd:function(e){e.preventDefault(),p.current(),o&&o(e)}}),u&&(0,s.createElement)("div",{className:"components-draggable-drag-component-root",style:{display:"none"},ref:f},u))};var lM=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"}));var cM=function(e){let{className:t,label:n,onFilesDrop:r,onHTMLDrop:o,onDrop:i,...l}=e;const[f,p]=(0,s.useState)(),[m,h]=(0,s.useState)(),[g,v]=(0,s.useState)(),b=(0,d.__experimentalUseDropZone)({onDrop(e){var t;const n=e.dataTransfer?(0,CS.getFilesFromDataTransfer)(e.dataTransfer):[],a=null===(t=e.dataTransfer)||void 0===t?void 0:t.getData("text/html");a&&o?o(a):n.length&&r?r(n):i&&i(e)},onDragStart(e){var t,n;p(!0);let r="default";null!==(t=e.dataTransfer)&&void 0!==t&&t.types.includes("text/html")?r="html":(null!==(n=e.dataTransfer)&&void 0!==n&&n.types.includes("Files")||(e.dataTransfer?(0,CS.getFilesFromDataTransfer)(e.dataTransfer):[]).length>0)&&(r="file"),v(r)},onDragEnd(){p(!1),v(void 0)},onDragEnter(){h(!0)},onDragLeave(){h(!1)}}),y=(0,d.useReducedMotion)();let w;const x={hidden:{scaleY:0,opacity:0},show:{scaleY:1,opacity:1,transition:{type:"tween",duration:.2,delay:.1,delayChildren:.2}},exit:{scaleY:1,opacity:0,transition:{duration:.3,delayChildren:0}}},_={hidden:{opacity:0,scale:.75},show:{opacity:1,scale:1},exit:{opacity:0,scale:.9}};m&&(w=(0,s.createElement)(Ul.div,{variants:x,initial:y?"show":"hidden",animate:"show",exit:y?"show":"exit",className:"components-drop-zone__content",style:{pointerEvents:"none"}},(0,s.createElement)(Ul.div,{variants:_},(0,s.createElement)(sy,{icon:lM,className:"components-drop-zone__content-icon"}),(0,s.createElement)("span",{className:"components-drop-zone__content-text"},n||(0,u.__)("Drop files to upload")))));const E=c()("components-drop-zone",t,{"is-active":(f||m)&&("file"===g&&r||"html"===g&&o||"default"===g&&i),"is-dragging-over-document":f,"is-dragging-over-element":m,[`is-dragging-${g}`]:!!g});return(0,s.createElement)("div",a({},l,{ref:b,className:E}),y?w:(0,s.createElement)(Dm,null,w))};function uM(e){let{children:t}=e;return ql()("wp.components.DropZoneProvider",{since:"5.8",hint:"wp.component.DropZone no longer needs a provider. wp.components.DropZoneProvider is safe to remove from your code."}),t}var dM=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M5 17.7c.4.5.8.9 1.2 1.2l1.1-1.4c-.4-.3-.7-.6-1-1L5 17.7zM5 6.3l1.4 1.1c.3-.4.6-.7 1-1L6.3 5c-.5.4-.9.8-1.3 1.3zm.1 7.8l-1.7.5c.2.6.4 1.1.7 1.6l1.5-.8c-.2-.4-.4-.8-.5-1.3zM4.8 12v-.7L3 11.1v1.8l1.7-.2c.1-.2.1-.5.1-.7zm3 7.9c.5.3 1.1.5 1.6.7l.5-1.7c-.5-.1-.9-.3-1.3-.5l-.8 1.5zM19 6.3c-.4-.5-.8-.9-1.2-1.2l-1.1 1.4c.4.3.7.6 1 1L19 6.3zm-.1 3.6l1.7-.5c-.2-.6-.4-1.1-.7-1.6l-1.5.8c.2.4.4.8.5 1.3zM5.6 8.6l-1.5-.8c-.3.5-.5 1-.7 1.6l1.7.5c.1-.5.3-.9.5-1.3zm2.2-4.5l.8 1.5c.4-.2.8-.4 1.3-.5l-.5-1.7c-.6.2-1.1.4-1.6.7zm8.8 13.5l1.1 1.4c.5-.4.9-.8 1.2-1.2l-1.4-1.1c-.2.3-.5.6-.9.9zm1.8-2.2l1.5.8c.3-.5.5-1.1.7-1.6l-1.7-.5c-.1.5-.3.9-.5 1.3zm2.6-4.3l-1.7.2v1.4l1.7.2V12v-.9zM11.1 3l.2 1.7h1.4l.2-1.7h-1.8zm3 2.1c.5.1.9.3 1.3.5l.8-1.5c-.5-.3-1.1-.5-1.6-.7l-.5 1.7zM12 19.2h-.7l-.2 1.8h1.8l-.2-1.7c-.2-.1-.5-.1-.7-.1zm2.1-.3l.5 1.7c.6-.2 1.1-.4 1.6-.7l-.8-1.5c-.4.2-.8.4-1.3.5z"}));function fM(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"90deg";const n=100/e.length,r=e.map(((e,t)=>`${e} ${t*n}%, ${e} ${(t+1)*n}%`)).join(", ");return`linear-gradient( ${t}, ${r} )`}yp([wp]);var pM=function(e){let{values:t}=e;return t?(0,s.createElement)(Zb,{colorValue:fM(t,"135deg")}):(0,s.createElement)(Xl,{icon:dM})};function mM(e){let{label:t,value:n,colors:r,disableCustomColors:o,enableAlpha:i,onChange:a}=e;const[l,c]=(0,s.useState)(!1);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(od,{className:"components-color-list-picker__swatch-button",onClick:()=>c((e=>!e))},(0,s.createElement)(Gv,{justify:"flex-start",spacing:2},n?(0,s.createElement)(Zb,{colorValue:n,className:"components-color-list-picker__swatch-color"}):(0,s.createElement)(Xl,{icon:dM}),(0,s.createElement)("span",null,t))),l&&(0,s.createElement)(Q_,{className:"components-color-list-picker__color-picker",colors:r,value:n,clearable:!1,onChange:a,disableCustomColors:o,enableAlpha:i}))}var hM=function(e){let{colors:t,labels:n,value:r=[],disableCustomColors:o,enableAlpha:i,onChange:a}=e;return(0,s.createElement)("div",{className:"components-color-list-picker"},n.map(((e,n)=>(0,s.createElement)(mM,{key:n,label:e,value:r[n],colors:t,disableCustomColors:o,enableAlpha:i,onChange:e=>{const t=r.slice();t[n]=e,a(t)}}))))};const gM=["#333","#CCC"];function vM(e){let{value:t,onChange:n}=e;const r=!!t,o=r?t:gM,i=fM(o),a=(l=o).map(((e,t)=>({position:100*t/(l.length-1),color:e})));var l;return(0,s.createElement)(oS,{disableInserter:!0,background:i,hasGradient:r,value:a,onChange:e=>{const t=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((e=>{let{color:t}=e;return t}))}(e);n(t)}})}var bM=function(e){let{clearable:t=!0,unsetable:n=!0,colorPalette:r,duotonePalette:o,disableCustomColors:i,disableCustomDuotone:a,value:l,onChange:c}=e;const[d,f]=(0,s.useMemo)((()=>{return!(e=r)||e.length<2?["#000","#fff"]:e.map((e=>{let{color:t}=e;return{color:t,brightness:vp(t).brightness()}})).reduce(((e,t)=>{let[n,r]=e;return[t.brightness<=n.brightness?t:n,t.brightness>=r.brightness?t:r]}),[{brightness:1},{brightness:0}]).map((e=>{let{color:t}=e;return t}));var e}),[r]),p="unset"===l,m=(0,s.createElement)(H_.Option,{key:"unset",value:"unset",isSelected:p,tooltipText:(0,u.__)("Unset"),className:"components-duotone-picker__color-indicator",onClick:()=>{c(p?void 0:"unset")}}),h=o.map((e=>{let{colors:t,slug:n,name:r}=e;const o={background:fM(t,"135deg"),color:"transparent"},i=null!=r?r:(0,u.sprintf)((0,u.__)("Duotone code: %s"),n),a=r?(0,u.sprintf)((0,u.__)("Duotone: %s"),r):i,d=Jl()(t,l);return(0,s.createElement)(H_.Option,{key:n,value:t,isSelected:d,"aria-label":a,tooltipText:i,style:o,onClick:()=>{c(d?void 0:t)}})}));return(0,s.createElement)(H_,{options:n?[m,...h]:h,actions:!!t&&(0,s.createElement)(H_.ButtonAction,{onClick:()=>c(void 0)},(0,u.__)("Clear"))},(0,s.createElement)(Kv,{paddingTop:4},(0,s.createElement)(j_,{spacing:3},!i&&!a&&(0,s.createElement)(vM,{value:p?void 0:l,onChange:c}),!a&&(0,s.createElement)(hM,{labels:[(0,u.__)("Shadows"),(0,u.__)("Highlights")],colors:r,value:p?void 0:l,disableCustomColors:i,enableAlpha:!0,onChange:e=>{e[0]||(e[0]=d),e[1]||(e[1]=f);const t=e.length>=2?e:void 0;c(t)}}))))};var yM=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"}));const wM=Ju(sy,{target:"esh4a730"})({name:"rvs7bx",styles:"width:1em;height:1em;margin:0;vertical-align:middle;fill:currentColor"});var xM=(0,s.forwardRef)((function(e,t){const{href:n,children:r,className:o,rel:i="",...l}=e,d=[...new Set([...i.split(" "),"external","noreferrer","noopener"].filter(Boolean))].join(" "),f=c()("components-external-link",o),p=!(null==n||!n.startsWith("#"));return(0,s.createElement)("a",a({},l,{className:f,href:n,onClick:t=>{p&&t.preventDefault(),e.onClick&&e.onClick(t)},target:"_blank",rel:d,ref:t}),r,(0,s.createElement)(td,{as:"span"},(0,u.__)("(opens in a new tab)")),(0,s.createElement)(wM,{icon:yM,className:"components-external-link__icon"}))}));const _M={width:200,height:170},EM=["avi","mpg","mpeg","mov","mp4","m4v","ogg","ogv","webm","wmv"];function CM(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=e.split(".");return t[t.length-1]}function kM(e){return Math.round(100*e)}const SM=Ju("div",{target:"eeew7dm8"})({name:"w0nf6b",styles:"background-color:transparent;text-align:center;width:100%"}),TM=Ju("div",{target:"eeew7dm7"})({name:"megach",styles:"align-items:center;box-shadow:0 0 0 1px rgba( 0, 0, 0, 0.2 );cursor:pointer;display:inline-flex;justify-content:center;margin:auto;position:relative;height:100%;img,video{box-sizing:border-box;display:block;height:auto;margin:0;max-height:100%;max-width:100%;pointer-events:none;user-select:none;width:auto;}"}),NM=Ju("div",{target:"eeew7dm6"})("background:",Sp.gray[100],";box-sizing:border-box;height:",_M.height,"px;max-width:280px;min-width:",_M.width,"px;width:100%;"),RM=Ju(hE,{target:"eeew7dm5"})({name:"1pzk433",styles:"width:100px"});var IM={name:"1mn7kwb",styles:"padding-bottom:1em"};const MM=e=>{let{__nextHasNoMarginBottom:t}=e;return t?void 0:IM};var PM={name:"1mn7kwb",styles:"padding-bottom:1em"};const OM=e=>{let{hasHelpText:t=!1}=e;return t?PM:void 0},DM=Ju(Zm,{target:"eeew7dm4"})("max-width:320px;padding-top:1em;",OM," ",MM,";"),AM=Ju("div",{target:"eeew7dm3"})("left:50%;overflow:hidden;pointer-events:none;position:absolute;top:50%;transform:translate3d( -50%, -50%, 0 );transition:opacity 120ms linear;z-index:1;opacity:",(e=>{let{showOverlay:t}=e;return t?1:0}),";"),LM=Ju("div",{target:"eeew7dm2"})({name:"1d42i6k",styles:"background:white;box-shadow:0 0 2px rgba( 0, 0, 0, 0.6 );position:absolute;opacity:0.4;transform:translateZ( 0 )"}),zM=Ju(LM,{target:"eeew7dm1"})({name:"1qp910y",styles:"height:1px;left:0;right:0"}),BM=Ju(LM,{target:"eeew7dm0"})({name:"1oz3zka",styles:"width:1px;top:0;bottom:0"}),FM=()=>{};function VM(e){let{__nextHasNoMarginBottom:t,hasHelpText:n,onChange:r=FM,point:o={x:.5,y:.5}}=e;const i=kM(o.x),a=kM(o.y),l=(e,t)=>{if(void 0===e)return;const n=parseInt(e,10);isNaN(n)||r({...o,[t]:n/100})};return(0,s.createElement)(DM,{className:"focal-point-picker__controls",__nextHasNoMarginBottom:t,hasHelpText:n},(0,s.createElement)(HM,{label:(0,u.__)("Left"),value:[i,"%"].join(""),onChange:e=>l(e,"x"),dragDirection:"e"}),(0,s.createElement)(HM,{label:(0,u.__)("Top"),value:[a,"%"].join(""),onChange:e=>l(e,"y"),dragDirection:"s"}))}function HM(e){return(0,s.createElement)(RM,a({className:"focal-point-picker__controls-position-unit-control",labelPosition:"top",max:100,min:0,units:[{value:"%",label:"%"}]},e))}const jM=Ju("div",{target:"e19snlhg0"})("background-color:transparent;cursor:grab;height:48px;margin:-24px 0 0 -24px;position:absolute;user-select:none;width:48px;will-change:transform;z-index:10000;background:rgba( 255, 255, 255, 0.6 );border-radius:50%;backdrop-filter:blur( 4px );box-shadow:rgb( 0 0 0 / 20% ) 0px 0px 10px;",(e=>{let{isDragging:t}=e;return t&&"cursor: grabbing;"}),";");function $M(e){let{left:t="50%",top:n="50%",...r}=e;const o=c()("components-focal-point-picker__icon_container"),i={left:t,top:n};return(0,s.createElement)(jM,a({},r,{className:o,style:i}))}function WM(e){let{bounds:t,...n}=e;return(0,s.createElement)(AM,a({},n,{className:"components-focal-point-picker__grid",style:{width:t.width,height:t.height}}),(0,s.createElement)(zM,{style:{top:"33%"}}),(0,s.createElement)(zM,{style:{top:"66%"}}),(0,s.createElement)(BM,{style:{left:"33%"}}),(0,s.createElement)(BM,{style:{left:"66%"}}))}function UM(e){let{alt:t,autoPlay:n,src:r,onLoad:o,mediaRef:i,muted:l=!0,...c}=e;if(!r)return(0,s.createElement)(NM,a({className:"components-focal-point-picker__media components-focal-point-picker__media--placeholder",ref:i},c));const u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!!e&&(e.startsWith("data:video/")||EM.includes(CM(e)))}(r);return u?(0,s.createElement)("video",a({},c,{autoPlay:n,className:"components-focal-point-picker__media components-focal-point-picker__media--video",loop:!0,muted:l,onLoadedData:o,ref:i,src:r})):(0,s.createElement)("img",a({},c,{alt:t,className:"components-focal-point-picker__media components-focal-point-picker__media--image",onLoad:o,ref:i,src:r}))}var GM=function e(t){let{__nextHasNoMarginBottom:n,autoPlay:r=!0,className:o,help:i,label:l,onChange:f,onDrag:p,onDragEnd:m,onDragStart:h,resolvePoint:g,url:v,value:b={x:.5,y:.5},...y}=t;const[w,x]=(0,s.useState)(b),[_,E]=(0,s.useState)(!1),{startDrag:C,endDrag:k,isDragging:S}=(0,d.__experimentalUseDragging)({onDragStart:e=>{var t;null===(t=R.current)||void 0===t||t.focus();const n=O(e);n&&(null==h||h(n,e),x(n))},onDragMove:e=>{e.preventDefault();const t=O(e);t&&(null==p||p(t,e),x(t))},onDragEnd:()=>{null==m||m(),null==f||f(w)}}),{x:T,y:N}=S?w:b,R=(0,s.useRef)(null),[I,M]=(0,s.useState)(_M),P=(0,s.useRef)((()=>{if(!R.current)return;const{clientWidth:e,clientHeight:t}=R.current;M(e>0&&t>0?{width:e,height:t}:{..._M})}));(0,s.useEffect)((()=>{const e=P.current;if(!R.current)return;const{defaultView:t}=R.current.ownerDocument;return null==t||t.addEventListener("resize",e),()=>null==t?void 0:t.removeEventListener("resize",e)}),[]),(0,d.useIsomorphicLayoutEffect)((()=>{P.current()}),[]);const O=e=>{let{clientX:t,clientY:n,shiftKey:r}=e;if(!R.current)return;const{top:o,left:i}=R.current.getBoundingClientRect();let a=(t-i)/I.width,s=(n-o)/I.height;return r&&(a=.1*Math.round(a/.1),s=.1*Math.round(s/.1)),D({x:a,y:s})},D=e=>{var t;const n=null!==(t=null==g?void 0:g(e))&&void 0!==t?t:e;n.x=Math.max(0,Math.min(n.x,1)),n.y=Math.max(0,Math.min(n.y,1));const r=e=>Math.round(100*e)/100;return{x:r(n.x),y:r(n.y)}},A={left:T*I.width,top:N*I.height},L=c()("components-focal-point-picker-control",o),z=`inspector-focal-point-picker-control-${(0,d.useInstanceId)(e)}`;return ec((()=>{E(!0);const e=window.setTimeout((()=>{E(!1)}),600);return()=>window.clearTimeout(e)}),[T,N]),(0,s.createElement)(Nv,a({},y,{__nextHasNoMarginBottom:n,label:l,id:z,help:i,className:L}),(0,s.createElement)(SM,{className:"components-focal-point-picker-wrapper"},(0,s.createElement)(TM,{className:"components-focal-point-picker",onKeyDown:e=>{const{code:t,shiftKey:n}=e;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t))return;e.preventDefault();const r={x:T,y:N},o=n?.1:.01,i="ArrowUp"===t||"ArrowLeft"===t?-1*o:o,a="ArrowUp"===t||"ArrowDown"===t?"y":"x";r[a]=r[a]+i,null==f||f(D(r))},onMouseDown:C,onBlur:()=>{S&&k()},ref:R,role:"button",tabIndex:-1},(0,s.createElement)(WM,{bounds:I,showOverlay:_}),(0,s.createElement)(UM,{alt:(0,u.__)("Media preview"),autoPlay:r,onLoad:P.current,src:v}),(0,s.createElement)($M,a({},A,{isDragging:S})))),(0,s.createElement)(VM,{__nextHasNoMarginBottom:n,hasHelpText:!!i,point:{x:T,y:N},onChange:e=>{null==f||f(D(e))}}))};function YM(e){let{iframeRef:t,...n}=e;const r=(0,d.useMergeRefs)([t,(0,d.useFocusableIframe)()]);return ql()("wp.components.FocusableIframe",{since:"5.9",alternative:"wp.compose.useFocusableIframe"}),(0,s.createElement)("iframe",a({ref:r},n))}var qM=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"}));function KM(e){const[t,...n]=e;if(!t)return null;const[,r]=sE(t.size);return n.every((e=>{const[,t]=sE(e.size);return t===r}))?r:null}const XM=Ju("fieldset",{target:"e8tqeku4"})({name:"1t1ytme",styles:"border:0;margin:0;padding:0"}),ZM=Ju(Nv.VisualLabel,{target:"e8tqeku3"})("display:flex;gap:",Km(1),";justify-content:flex-start;margin-bottom:0;"),JM=Ju("span",{target:"e8tqeku2"})("color:",Sp.gray[700],";"),QM=Ju("div",{target:"e8tqeku1"})((e=>!e.__nextHasNoMarginBottom&&`margin-bottom: ${Km(6)};`),";"),eP=Ju(od,{target:"e8tqeku0"})("&&&{height:",(e=>"__unstable-large"===e.size?"40px":"30px"),";}"),tP={key:"default",name:(0,u.__)("Default"),value:void 0},nP={key:"custom",name:(0,u.__)("Custom")};var rP=e=>{var t;const{fontSizes:n,value:r,disableCustomFontSizes:o,size:i,onChange:a,onSelectCustom:l}=e,c=!!KM(n),d=[tP,...n.map((e=>{let t;if(c){const[n]=sE(e.size);void 0!==n&&(t=String(n))}else(function(e){return/^[\d\.]+(px|em|rem|vw|vh|%)?$/i.test(String(e))})(e.size)&&(t=String(e.size));return{key:e.slug,name:e.name||e.slug,value:e.size,__experimentalHint:t}})),...o?[]:[nP]],f=r?null!==(t=d.find((e=>e.value===r)))&&void 0!==t?t:nP:tP;return(0,s.createElement)(_N,{__nextUnconstrainedWidth:!0,className:"components-font-size-picker__select",label:(0,u.__)("Font size"),hideLabelFromVision:!0,describedBy:(0,u.sprintf)((0,u.__)("Currently selected font size: %s"),f.name),options:d,value:f,__experimentalShowSelectedHint:!0,onChange:e=>{let{selectedItem:t}=e;t===nP?l():a(t.value)},size:i})};const oP=e=>{const t=Wf("border-color:",Sp.ui.border,";","");return Wf(e&&t," &:hover{border-color:",Sp.ui.borderHover,";}&:focus-within{border-color:",Sp.ui.borderFocus,";box-shadow:",mh.controlBoxShadowFocus,";outline:none;z-index:1;}","")},iP=e=>Wf("min-height:",{default:"36px","__unstable-large":"40px"}[e],";",""),aP={name:"7whenc",styles:"display:flex;width:100%"},sP=Ju("div",{target:"eakva831"})("background:",Sp.gray[900],";border-radius:",mh.controlBorderRadius,";left:0;position:absolute;top:2px;bottom:2px;transition:transform ",mh.transitionDurationFast," ease;",Tp("transition")," z-index:1;"),lP=Ju("div",{target:"eakva830"})({name:"zjik7",styles:"display:flex"});function cP(e){void 0===e&&(e={});var t=Lp(e),n=t.state,r=t.loop,o=void 0===r||r,i=h(t,["state","loop"]),a=(0,b.useState)(n),s=a[0],l=a[1],c=om(m(m({},i),{},{loop:o}));return m(m({},c),{},{state:s,setState:l})}var uP=["baseId","unstable_idCountRef","unstable_virtual","rtl","orientation","items","groups","currentId","loop","wrap","shift","unstable_moves","unstable_hasActiveWidget","unstable_includesBaseElement","state","setBaseId","registerItem","unregisterItem","registerGroup","unregisterGroup","move","next","previous","up","down","first","last","sort","unstable_setVirtual","setRTL","setOrientation","setCurrentId","setLoop","setWrap","setShift","reset","unstable_setIncludesBaseElement","unstable_setHasActiveWidget","setState"],dP=[].concat(uP,["value","checked","unstable_checkOnFocus"]),fP=z({as:"div",useHook:F({name:"RadioGroup",compose:fm,keys:uP,useProps:function(e,t){return m({role:"radiogroup"},t)}}),useCreateElement:function(e,t,n){return N(e,t,n)}});var pP=(0,s.memo)((function(e){let{containerRef:t,containerWidth:n,isAdaptiveWidth:r,state:o}=e;const[i,a]=(0,s.useState)(0),[l,c]=(0,s.useState)(0),[u,d]=(0,s.useState)(!1),[f,p]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{const e=null==t?void 0:t.current;if(!e)return;const n=e.querySelector(`[data-value="${o}"]`);if(p(!!n),!n)return;const r=window.setTimeout((()=>{const{width:t,x:r}=n.getBoundingClientRect(),{x:o}=e.getBoundingClientRect();a(r-o-1),c(t)}),100);let i;return u||(i=window.requestAnimationFrame((()=>{d(!0)}))),()=>{window.clearTimeout(r),window.cancelAnimationFrame(i)}}),[u,t,n,o,r]),f?(0,s.createElement)(sP,{role:"presentation",style:{transform:`translateX(${i}px)`,transition:u?void 0:"none",width:l}}):null}));const mP=(0,s.createContext)({});var hP=mP;const gP=(0,s.forwardRef)((function(e,t){let{children:n,isAdaptiveWidth:r,label:o,onChange:i,size:l,value:c,...u}=e;const f=(0,s.useRef)(),[p,m]=(0,d.useResizeObserver)(),h=cP({baseId:(0,d.useInstanceId)(gP,"toggle-group-control-as-radio-group").toString(),state:c}),g=(0,d.usePrevious)(c);return ec((()=>{g!==h.state&&i(h.state)}),[h.state]),ec((()=>{c!==h.state&&h.setState(c)}),[c]),(0,s.createElement)(hP.Provider,{value:{...h,isBlock:!r,size:l}},(0,s.createElement)(fP,a({},h,{"aria-label":o,as:ed},u,{ref:(0,d.useMergeRefs)([f,t])}),p,(0,s.createElement)(pP,{state:h.state,containerRef:f,containerWidth:m.width,isAdaptiveWidth:r}),n))}));const vP=(0,s.forwardRef)((function(e,t){let{children:n,isAdaptiveWidth:r,label:o,onChange:i,size:l,value:c,...u}=e;const f=(0,s.useRef)(),[p,m]=(0,d.useResizeObserver)(),h=(0,d.useInstanceId)(vP,"toggle-group-control-as-button-group").toString(),[g,v]=(0,s.useState)(c),b={baseId:h,state:g,setState:v},y=(0,d.usePrevious)(c);return ec((()=>{y!==b.state&&i(b.state)}),[b.state]),ec((()=>{c!==b.state&&b.setState(c)}),[c]),(0,s.createElement)(hP.Provider,{value:{...b,isBlock:!r,isDeselectable:!0,size:l}},(0,s.createElement)(ed,a({"aria-label":o},u,{ref:(0,d.useMergeRefs)([f,t]),role:"group"}),p,(0,s.createElement)(pP,{state:b.state,containerRef:f,containerWidth:m.width,isAdaptiveWidth:r}),n))})),bP=()=>{};const yP=Hu((function(e,t){const{__nextHasNoMarginBottom:n=!1,className:r,isAdaptiveWidth:o=!1,isBlock:i=!1,isDeselectable:l=!1,label:c,hideLabelFromVision:u=!1,help:d,onChange:f=bP,size:p="default",value:m,children:h,...g}=Vu(e,"ToggleGroupControl"),v=Fu(),b=(0,s.useMemo)((()=>v((e=>{let{isBlock:t,isDeselectable:n,size:r}=e;return Wf("background:",Sp.ui.background,";border:1px solid transparent;border-radius:",mh.controlBorderRadius,";display:inline-flex;min-width:0;padding:2px;position:relative;transition:transform ",mh.transitionDurationFastest," linear;",Tp("transition")," ",iP(r)," ",!n&&oP(t),";","")})({isBlock:i,isDeselectable:l,size:p}),i&&aP,r)),[r,v,i,l,p]),y=l?vP:gP;return(0,s.createElement)(Nv,{help:d,__nextHasNoMarginBottom:n},!u&&(0,s.createElement)(lP,null,(0,s.createElement)(Nv.VisualLabel,null,c)),(0,s.createElement)(y,a({},g,{children:h,className:b,isAdaptiveWidth:o,label:c,onChange:f,ref:t,size:p,value:m})))}),"ToggleGroupControl");var wP=yP;function xP(e){return void 0!==e.checked?e.checked:void 0!==e.value&&e.state===e.value}function _P(e,t){var n=_e(e,"change");Object.defineProperties(n,{type:{value:"change"},target:{value:e},currentTarget:{value:e}}),null==t||t(n)}var EP=F({name:"Radio",compose:ke,keys:dP,useOptions:function(e,t){var n,r=t.value,o=t.checked,i=e.unstable_clickOnEnter,a=void 0!==i&&i,s=e.unstable_checkOnFocus,l=void 0===s||s,c=h(e,["unstable_clickOnEnter","unstable_checkOnFocus"]);return m(m({checked:o,unstable_clickOnEnter:a,unstable_checkOnFocus:l},c),{},{value:null!=(n=c.value)?n:r})},useProps:function(e,t){var n=t.ref,r=t.onChange,o=t.onClick,i=h(t,["ref","onChange","onClick"]),a=(0,b.useRef)(null),s=(0,b.useState)(!0),l=s[0],c=s[1],u=xP(e),d=G(e.currentId===e.id),f=G(r),p=G(o);!function(e){var t=(0,b.useState)((function(){return xP(e)}))[0],n=(0,b.useState)(e.currentId)[0],r=e.id,o=e.setCurrentId;(0,b.useEffect)((function(){t&&r&&n!==r&&(null==o||o(r))}),[t,r,o,n])}(e),(0,b.useEffect)((function(){var e=a.current;e&&("INPUT"===e.tagName&&"radio"===e.type||c(!1))}),[]);var g=(0,b.useCallback)((function(t){var n,r;null===(n=f.current)||void 0===n||n.call(f,t),t.defaultPrevented||e.disabled||null===(r=e.setState)||void 0===r||r.call(e,e.value)}),[e.disabled,e.setState,e.value]),v=(0,b.useCallback)((function(e){var t;null===(t=p.current)||void 0===t||t.call(p,e),e.defaultPrevented||l||_P(e.currentTarget,g)}),[g,l]);return(0,b.useEffect)((function(){var t=a.current;t&&e.unstable_moves&&d.current&&e.unstable_checkOnFocus&&_P(t,g)}),[e.unstable_moves,e.unstable_checkOnFocus,g]),m({ref:H(a,n),role:l?void 0:"radio",type:l?"radio":void 0,value:l?e.value:void 0,name:l?e.baseId:void 0,"aria-checked":u,checked:u,onChange:g,onClick:v},i)}}),CP=z({as:"input",memo:!0,useHook:EP});const kP=Ju("div",{target:"et6ln9s1"})({name:"sln1fl",styles:"display:inline-flex;max-width:100%;min-width:0;position:relative"}),SP={name:"82a6rk",styles:"flex:1"},TP=e=>{let{isDeselectable:t,isIcon:n,isPressed:r,size:o}=e;return Wf("align-items:center;appearance:none;background:transparent;border:none;border-radius:",mh.controlBorderRadius,";color:",Sp.gray[700],";fill:currentColor;cursor:pointer;display:flex;font-family:inherit;height:100%;justify-content:center;line-height:100%;outline:none;padding:0 12px;position:relative;text-align:center;transition:background ",mh.transitionDurationFast," linear,color ",mh.transitionDurationFast," linear,font-weight 60ms linear;",Tp("transition")," user-select:none;width:100%;z-index:2;&::-moz-focus-inner{border:0;}&:active{background:",mh.toggleGroupControlBackgroundColor,";}",t&&RP," ",n&&MP({size:o})," ",r&&NP,";","")},NP=Wf("color:",Sp.white,";&:active{background:transparent;}",""),RP=Wf("color:",Sp.gray[900],";&:focus{box-shadow:inset 0 0 0 1px ",Sp.white,",0 0 0 ",mh.borderWidthFocus," ",Sp.ui.theme,";outline:2px solid transparent;}",""),IP=Ju("div",{target:"et6ln9s0"})("display:flex;font-size:",mh.fontSize,";line-height:1;"),MP=e=>{let{size:t="default"}=e;return Wf("color:",Sp.gray[900],";width:",{default:"30px","__unstable-large":"34px"}[t],";padding-left:0;padding-right:0;","")},{ButtonContentView:PP,LabelView:OP}=o,DP=e=>{let{showTooltip:t,text:n,children:r}=e;return t&&n?(0,s.createElement)(Bf,{text:n,position:"top center"},r):(0,s.createElement)(s.Fragment,null,r)};const AP=Hu((function e(t,n){const r=(0,s.useContext)(mP),o=Vu({...t,id:(0,d.useInstanceId)(e,r.baseId||"toggle-group-control-option-base")},"ToggleGroupControlOptionBase"),{isBlock:i=!1,isDeselectable:l=!1,size:c="default",...u}=r,{className:f,isIcon:p=!1,value:m,children:h,showTooltip:g=!1,...v}=o,b=u.state===m,y=Fu(),w=y(i&&SP),x=y(TP({isDeselectable:l,isIcon:p,isPressed:b,size:c}),f),_={...v,className:x,"data-value":m,ref:n};return(0,s.createElement)(OP,{className:w},(0,s.createElement)(DP,{showTooltip:g,text:v["aria-label"]},l?(0,s.createElement)("button",a({},_,{"aria-pressed":b,type:"button",onClick:()=>{l&&b?u.setState(void 0):u.setState(m)}}),(0,s.createElement)(PP,null,h)):(0,s.createElement)(CP,a({},_,u,{as:"button",value:m}),(0,s.createElement)(PP,null,h))))}),"ToggleGroupControlOptionBase");var LP=AP;var zP=(0,s.forwardRef)((function(e,t){const{label:n,...r}=e,o=r["aria-label"]||n;return(0,s.createElement)(LP,a({},r,{"aria-label":o,ref:t}),n)}));const BP=[(0,u.__)("S"),(0,u.__)("M"),(0,u.__)("L"),(0,u.__)("XL"),(0,u.__)("XXL")],FP=[(0,u.__)("Small"),(0,u.__)("Medium"),(0,u.__)("Large"),(0,u.__)("Extra Large"),(0,u.__)("Extra Extra Large")];var VP=e=>{const{fontSizes:t,value:n,__nextHasNoMarginBottom:r,size:o,onChange:i}=e;return(0,s.createElement)(wP,{__nextHasNoMarginBottom:r,label:(0,u.__)("Font size"),hideLabelFromVision:!0,value:n,onChange:i,isBlock:!0,size:o},t.map(((e,t)=>(0,s.createElement)(zP,{key:e.slug,value:e.size,label:BP[t],"aria-label":e.name||FP[t],showTooltip:!0}))))};const HP=(0,s.forwardRef)(((e,t)=>{var n;const{__nextHasNoMarginBottom:r=!1,fallbackFontSize:o,fontSizes:i=[],disableCustomFontSizes:a=!1,onChange:l,size:c="default",value:d,withSlider:f=!1,withReset:p=!0}=e;r||ql()("Bottom margin styles for wp.components.FontSizePicker",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const m=cE({availableUnits:["px","em","rem"]}),h=i.length>5,g=i.find((e=>e.size===d)),v=!!d&&!g,[b,y]=(0,s.useState)(!a&&v),w=(0,s.useMemo)((()=>{if(b)return(0,u.__)("Custom");if(!h)return g?g.name||FP[i.indexOf(g)]:"";const e=KM(i);return e?`(${e})`:""}),[b,h,g,i]);if(0===i.length&&a)return null;const x="string"==typeof d||"string"==typeof(null===(n=i[0])||void 0===n?void 0:n.size),[_,E]=sE(d,m),C=!!E&&["em","rem"].includes(E);return(0,s.createElement)(XM,{ref:t,className:"components-font-size-picker"},(0,s.createElement)(td,{as:"legend"},(0,u.__)("Font size")),(0,s.createElement)(Kv,null,(0,s.createElement)(Gv,{className:"components-font-size-picker__header"},(0,s.createElement)(ZM,{"aria-label":`${(0,u.__)("Size")} ${w||""}`},(0,u.__)("Size"),w&&(0,s.createElement)(JM,{className:"components-font-size-picker__header__hint"},w)),!a&&(0,s.createElement)(od,{label:b?(0,u.__)("Use size preset"):(0,u.__)("Set custom size"),icon:qM,onClick:()=>{y(!b)},isPressed:b,isSmall:!0}))),(0,s.createElement)(QM,{className:"components-font-size-picker__controls",__nextHasNoMarginBottom:r},!!i.length&&h&&!b&&(0,s.createElement)(rP,{fontSizes:i,value:d,disableCustomFontSizes:a,size:c,onChange:e=>{void 0===e?null==l||l(void 0):null==l||l(x?e:Number(e),i.find((t=>t.size===e)))},onSelectCustom:()=>y(!0)}),!h&&!b&&(0,s.createElement)(VP,{fontSizes:i,value:d,__nextHasNoMarginBottom:r,size:c,onChange:e=>{void 0===e?null==l||l(void 0):null==l||l(x?e:Number(e),i.find((t=>t.size===e)))}}),!a&&b&&(0,s.createElement)(Zm,{className:"components-font-size-picker__custom-size-control"},(0,s.createElement)($m,{isBlock:!0},(0,s.createElement)(hE,{label:(0,u.__)("Custom"),labelPosition:"top",hideLabelFromVision:!0,value:d,onChange:e=>{void 0===e?null==l||l(void 0):null==l||l(x?e:parseInt(e,10))},size:c,units:x?m:[],min:0})),f&&(0,s.createElement)($m,{isBlock:!0},(0,s.createElement)(Kv,{marginX:2,marginBottom:0},(0,s.createElement)($y,{__nextHasNoMarginBottom:r,className:"components-font-size-picker__custom-input",label:(0,u.__)("Custom Size"),hideLabelFromVision:!0,value:_,initialPosition:o,withInputField:!1,onChange:e=>{void 0===e?null==l||l(void 0):x?null==l||l(e+(null!=E?E:"px")):null==l||l(e)},min:0,max:C?10:100,step:C?.1:1}))),p&&(0,s.createElement)($m,null,(0,s.createElement)(eP,{disabled:void 0===d,onClick:()=>{null==l||l(void 0)},isSmall:!0,variant:"secondary",size:c},(0,u.__)("Reset"))))))}));var jP=HP;var $P=function(e){let{accept:t,children:n,multiple:r=!1,onChange:o,onClick:i,render:l,...c}=e;const u=(0,s.useRef)(null),d=()=>{var e;null===(e=u.current)||void 0===e||e.click()},f=l?l({openFileDialog:d}):(0,s.createElement)(od,a({onClick:d},c),n);return(0,s.createElement)("div",{className:"components-form-file-upload"},f,(0,s.createElement)("input",{type:"file",ref:u,multiple:r,style:{display:"none"},accept:t,onChange:o,onClick:i,"data-testid":"form-file-upload-input"}))};const WP=()=>{};var UP=function(e){const{className:t,checked:n,id:r,disabled:o,onChange:i=WP,...l}=e,u=c()("components-form-toggle",t,{"is-checked":n,"is-disabled":o});return(0,s.createElement)("span",{className:u},(0,s.createElement)("input",a({className:"components-form-toggle__input",id:r,type:"checkbox",checked:n,onChange:i,disabled:o},l)),(0,s.createElement)("span",{className:"components-form-toggle__track"}),(0,s.createElement)("span",{className:"components-form-toggle__thumb"}))};const GP=()=>{};function YP(e){let{value:t,status:n,title:r,displayTransform:o,isBorderless:i=!1,disabled:a=!1,onClickRemove:l=GP,onMouseEnter:f,onMouseLeave:p,messages:m,termPosition:h,termsCount:g}=e;const v=(0,d.useInstanceId)(YP),b=c()("components-form-token-field__token",{"is-error":"error"===n,"is-success":"success"===n,"is-validating":"validating"===n,"is-borderless":i,"is-disabled":a}),y=o(t),w=(0,u.sprintf)((0,u.__)("%1$s (%2$s of %3$s)"),y,h,g);return(0,s.createElement)("span",{className:b,onMouseEnter:f,onMouseLeave:p,title:r},(0,s.createElement)("span",{className:"components-form-token-field__token-text",id:`components-form-token-field__token-text-${v}`},(0,s.createElement)(td,{as:"span"},w),(0,s.createElement)("span",{"aria-hidden":"true"},y)),(0,s.createElement)(od,{className:"components-form-token-field__remove-token",icon:Rb,onClick:a?void 0:()=>l({value:t}),label:m.remove,"aria-describedby":`components-form-token-field__token-text-${v}`}))}const qP=e=>{let{__next36pxDefaultSize:t,hasTokens:n}=e;return!t&&Wf("padding-top:",Km(n?1:.5),";padding-bottom:",Km(n?1:.5),";","")},KP=Ju(Zm,{target:"ehq8nmi0"})("padding:5px ",Km(1),";",qP,";"),XP=e=>e;var ZP=function e(t){const{autoCapitalize:n,autoComplete:r,maxLength:o,placeholder:i,label:l=(0,u.__)("Add item"),className:f,suggestions:p=[],maxSuggestions:m=100,value:h=[],displayTransform:g=XP,saveTransform:v=(e=>e.trim()),onChange:b=(()=>{}),onInputChange:y=(()=>{}),onFocus:w,isBorderless:x=!1,disabled:_=!1,tokenizeOnSpace:E=!1,messages:C={added:(0,u.__)("Item added."),removed:(0,u.__)("Item removed."),remove:(0,u.__)("Remove item"),__experimentalInvalid:(0,u.__)("Invalid item")},__experimentalRenderItem:k,__experimentalExpandOnFocus:S=!1,__experimentalValidateInput:T=(()=>!0),__experimentalShowHowTo:N=!0,__next36pxDefaultSize:R=!1,__experimentalAutoSelectFirstMatch:I=!1}=t,M=(0,d.useInstanceId)(e),[P,O]=(0,s.useState)(""),[D,A]=(0,s.useState)(0),[L,z]=(0,s.useState)(!1),[B,F]=(0,s.useState)(!1),[V,H]=(0,s.useState)(-1),[j,$]=(0,s.useState)(!1),W=(0,d.usePrevious)(p),U=(0,d.usePrevious)(h),G=(0,s.useRef)(null),Y=(0,s.useRef)(null),q=(0,d.useDebounce)(cb.speak,500);function K(){var e;null===(e=G.current)||void 0===e||e.focus()}function X(){var e;return G.current===(null===(e=G.current)||void 0===e?void 0:e.ownerDocument.activeElement)}function Z(){fe()?z(!1):(O(""),A(0),z(!1),F(!1),H(-1),$(!1))}function J(e){e.target===Y.current&&L&&e.preventDefault()}function Q(e){se(e.value),K()}function ee(e){const t=e.value,n=E?/[ ,\t]+/:/[,\t]+/,r=t.split(n),o=r[r.length-1]||"";r.length>1&&ie(r.slice(0,-1)),O(o),y(o)}function te(e){let t=!1;return X()&&de()&&(e(),t=!0),t}function ne(){const e=ue()-1;e>-1&&se(h[e])}function re(){const e=ue();e!function(e){return h.some((t=>le(e)===le(t)))}(e))))];if(t.length>0){const e=[...h];e.splice(ue(),0,...t),b(e)}}function ae(e){T(e)?(ie([e]),(0,cb.speak)(C.added,"assertive"),O(""),H(-1),$(!1),F(!S),L&&K()):(0,cb.speak)(C.__experimentalInvalid,"assertive")}function se(e){const t=h.filter((t=>le(t)!==le(e)));b(t),(0,cb.speak)(C.removed,"assertive")}function le(e){return"object"==typeof e?e.value:e}function ce(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:m,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:v,i=o(e);const a=[],s=[],l=n.map((e=>"string"==typeof e?e:e.value));return 0===i.length?t=t.filter((e=>!l.includes(e))):(i=i.toLocaleLowerCase(),t.forEach((e=>{const t=e.toLocaleLowerCase().indexOf(i);-1===l.indexOf(e)&&(0===t?a.push(e):t>0&&s.push(e))})),t=a.concat(s)),t.slice(0,r)}function ue(){return h.length-D}function de(){return 0===P.length}function fe(){return v(P).length>0}function pe(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=P.trim().length>1,n=ce(P),r=n.length>0,o=X()&&S;if(F(o||t&&r),e&&(I&&t&&r?(H(0),$(!0)):(H(-1),$(!1))),t){const e=r?(0,u.sprintf)((0,u._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",n.length),n.length):(0,u.__)("No results.");q(e,"assertive")}}function me(e,t,n){const r=le(e),o="string"!=typeof e?e.status:void 0,i=t+1,a=n.length;return(0,s.createElement)($m,{key:"token-"+r},(0,s.createElement)(YP,{value:r,status:o,title:"string"!=typeof e?e.title:void 0,displayTransform:g,onClickRemove:Q,isBorderless:"string"!=typeof e&&e.isBorderless||x,onMouseEnter:"string"!=typeof e?e.onMouseEnter:void 0,onMouseLeave:"string"!=typeof e?e.onMouseLeave:void 0,disabled:"error"!==o&&_,messages:C,termsCount:a,termPosition:i}))}(0,s.useEffect)((()=>{L&&!X()&&K()}),[L]),(0,s.useEffect)((()=>{const e=!df()(p,W||[]);(e||h!==U)&&pe(e)}),[p,W,h,U]),(0,s.useEffect)((()=>{pe()}),[P]),(0,s.useEffect)((()=>{pe()}),[I]),_&&L&&(z(!1),O(""));const he=c()(f,"components-form-token-field__input-container",{"is-active":L,"is-disabled":_});let ge={className:"components-form-token-field",tabIndex:-1};const ve=ce();return _||(ge=Object.assign({},ge,{onKeyDown:function(e){let t=!1;if(!e.defaultPrevented&&!e.nativeEvent.isComposing&&229!==e.keyCode){switch(e.key){case"Backspace":t=te(ne);break;case"Enter":t=oe();break;case"ArrowLeft":t=function(){let e=!1;return de()&&(A((e=>Math.min(e+1,h.length))),e=!0),e}();break;case"ArrowUp":H((e=>(0===e?ce(P,p,h,m,v).length:e)-1)),$(!0),t=!0;break;case"ArrowRight":t=function(){let e=!1;return de()&&(A((e=>Math.max(e-1,0))),e=!0),e}();break;case"ArrowDown":H((e=>(e+1)%ce(P,p,h,m,v).length)),$(!0),t=!0;break;case"Delete":t=te(re);break;case"Space":E&&(t=oe());break;case"Escape":t=function(e){return e.target instanceof HTMLInputElement&&(O(e.target.value),F(!1),H(-1),$(!1)),!0}(e)}t&&e.preventDefault()}},onKeyPress:function(e){let t=!1;","===e.key&&(fe()&&ae(P),t=!0);t&&e.preventDefault()},onFocus:function(e){X()||e.target===Y.current?(z(!0),F(S||B)):z(!1),"function"==typeof w&&w(e)}})),(0,s.createElement)("div",ge,(0,s.createElement)(Ev,{htmlFor:`components-form-token-input-${M}`,className:"components-form-token-field__label"},l),(0,s.createElement)("div",{ref:Y,className:he,tabIndex:-1,onMouseDown:J,onTouchStart:J},(0,s.createElement)(KP,{justify:"flex-start",align:"center",gap:1,wrap:!0,__next36pxDefaultSize:R,hasTokens:!!h.length},function(){const e=h.map(me);return e.splice(ue(),0,function(){const e={instanceId:M,autoCapitalize:n,autoComplete:r,placeholder:0===h.length?i:"",key:"input",disabled:_,value:P,onBlur:Z,isExpanded:B,selectedSuggestionIndex:V};return(0,s.createElement)(tT,a({},e,{onChange:o&&h.length>=o?void 0:ee,ref:G}))}()),e}()),B&&(0,s.createElement)(iT,{instanceId:M,match:v(P),displayTransform:g,suggestions:ve,selectedIndex:V,scrollIntoView:j,onHover:function(e){const t=ce().indexOf(e);t>=0&&(H(t),$(!1))},onSelect:function(e){ae(e)},__experimentalRenderItem:k})),N&&(0,s.createElement)("p",{id:`components-form-token-suggestions-howto-${M}`,className:"components-form-token-field__help"},E?(0,u.__)("Separate with commas, spaces, or the Enter key."):(0,u.__)("Separate with commas or the Enter key.")))};const JP=e=>{let{isSelected:t}=e;return(0,s.createElement)(i.SVG,{width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(i.Circle,{cx:"4",cy:"4",r:"4",fill:t?"#419ECD":"#E1E3E6"}))};function QP(e){let{currentPage:t,numberOfPages:n,setCurrentPage:r}=e;return(0,s.createElement)("ul",{className:"components-guide__page-control","aria-label":(0,u.__)("Guide controls")},Array.from({length:n}).map(((e,o)=>(0,s.createElement)("li",{key:o,"aria-current":o===t?"step":void 0},(0,s.createElement)(od,{key:o,icon:(0,s.createElement)(JP,{isSelected:o===t}),"aria-label":(0,u.sprintf)((0,u.__)("Page %1$d of %2$d"),o+1,n),onClick:()=>r(o)})))))}function eO(e){let{children:t,className:n,contentLabel:r,finishButtonText:o,onFinish:i,pages:a=[]}=e;const l=(0,s.useRef)(),[d,f]=(0,s.useState)(0);(0,s.useEffect)((()=>{s.Children.count(t)&&ql()("Passing children to ",{since:"5.5",alternative:"the `pages` prop"})}),[t]),(0,s.useEffect)((()=>{var e,t;l.current&&(null===(e=CS.focus.tabbable.find(l.current))||void 0===e||null===(t=e[0])||void 0===t||t.focus())}),[d]),s.Children.count(t)&&(a=s.Children.map(t,(e=>({content:e}))));const p=d>0,m=d{p&&f(d-1)},g=()=>{m&&f(d+1)};return 0===a.length?null:(0,s.createElement)(gT,{className:c()("components-guide",n),contentLabel:r,onRequestClose:i,onKeyDown:e=>{"ArrowLeft"===e.code?(h(),e.preventDefault()):"ArrowRight"===e.code&&(g(),e.preventDefault())},ref:l},(0,s.createElement)("div",{className:"components-guide__container"},(0,s.createElement)("div",{className:"components-guide__page"},a[d].image,a.length>1&&(0,s.createElement)(QP,{currentPage:d,numberOfPages:a.length,setCurrentPage:f}),a[d].content),(0,s.createElement)("div",{className:"components-guide__footer"},p&&(0,s.createElement)(od,{className:"components-guide__back-button",onClick:h},(0,u.__)("Previous")),m&&(0,s.createElement)(od,{className:"components-guide__forward-button",onClick:g},(0,u.__)("Next")),!m&&(0,s.createElement)(od,{className:"components-guide__finish-button",onClick:i},o||(0,u.__)("Finish")))))}function tO(e){return(0,s.useEffect)((()=>{ql()("",{since:"5.5",alternative:"the `pages` prop in "})}),[]),(0,s.createElement)("div",e)}var nO=(0,s.forwardRef)((function(e,t){let{label:n,labelPosition:r,size:o,tooltip:i,...l}=e;return ql()("wp.components.IconButton",{since:"5.4",alternative:"wp.components.Button",version:"6.2"}),(0,s.createElement)(od,a({},l,{ref:t,tooltipPosition:r,iconSize:o,showTooltip:void 0!==i?!!i:void 0,label:i||n}))}));var rO=Hu((function(e,t){const{role:n,wrapperClassName:r,...o}=function(e){const{as:t,className:n,onClick:r,role:o="listitem",size:i,...a}=Vu(e,"Item"),{spacedAround:l,size:c}=Uk(),u=i||c,d=t||(void 0!==r?"button":"div"),f=Fu(),p=(0,s.useMemo)((()=>f("button"===d&&Mk,$k[u]||$k.medium,Ok,l&&zk,n)),[d,n,f,u,l]),m=f(Pk);return{as:d,className:p,onClick:r,wrapperClassName:m,role:o,...a}}(e);return(0,s.createElement)("div",{role:n,className:r},(0,s.createElement)(ed,a({},o,{ref:t})))}),"Item");var oO=Hu((function(e,t){const n=Vu(e,"InputControlPrefixWrapper");return(0,s.createElement)(Kv,a({marginBottom:0},n,{ref:t}))}),"InputControlPrefixWrapper");function iO(e){let{target:t,callback:n,shortcut:r,bindGlobal:o,eventName:i}=e;return(0,d.useKeyboardShortcut)(r,n,{bindGlobal:o,target:t,eventName:i}),null}var aO=function(e){let{children:t,shortcuts:n,bindGlobal:r,eventName:o}=e;const i=(0,s.useRef)(null),a=Object.entries(null!=n?n:{}).map((e=>{let[t,n]=e;return(0,s.createElement)(iO,{key:t,shortcut:t,callback:n,bindGlobal:r,eventName:o,target:i})}));return s.Children.count(t)?(0,s.createElement)("div",{ref:i},a,t):(0,s.createElement)(s.Fragment,null,a)};var sO=function e(t){const{children:n,className:r="",label:o,hideSeparator:i}=t,a=(0,d.useInstanceId)(e);if(!s.Children.count(n))return null;const l=`components-menu-group-label-${a}`,u=c()(r,"components-menu-group",{"has-hidden-separator":i});return(0,s.createElement)("div",{className:u},o&&(0,s.createElement)("div",{className:"components-menu-group__label",id:l,"aria-hidden":"true"},o),(0,s.createElement)("div",{role:"group","aria-labelledby":o?l:void 0},n))};var lO=(0,s.forwardRef)((function(e,t){let{children:n,info:r,className:o,icon:i,iconPosition:l="right",shortcut:u,isSelected:d,role:f="menuitem",suffix:p,...m}=e;return o=c()("components-menu-item__button",o),r&&(n=(0,s.createElement)("span",{className:"components-menu-item__info-wrapper"},(0,s.createElement)("span",{className:"components-menu-item__item"},n),(0,s.createElement)("span",{className:"components-menu-item__info"},r))),i&&"string"!=typeof i&&(i=(0,s.cloneElement)(i,{className:c()("components-menu-items__item-icon",{"has-icon-right":"right"===l})})),(0,s.createElement)(od,a({ref:t,"aria-checked":"menuitemcheckbox"===f||"menuitemradio"===f?d:void 0,role:f,icon:"left"===l?i:void 0,className:o},m),(0,s.createElement)("span",{className:"components-menu-item__item"},n),!p&&(0,s.createElement)(Pf,{className:"components-menu-item__shortcut",shortcut:u}),!p&&i&&"right"===l&&(0,s.createElement)(Xl,{icon:i}),p)}));const cO=()=>{};function uO(e){let{choices:t=[],onHover:n=cO,onSelect:r,value:o}=e;return t.map((e=>{const t=o===e.value;return(0,s.createElement)(lO,{key:e.value,role:"menuitemradio",icon:t&&V_,info:e.info,isSelected:t,shortcut:e.shortcut,className:"components-menu-items-choice",onClick:()=>{t||r(e.value)},onMouseEnter:()=>n(e.value),onMouseLeave:()=>n(null),"aria-label":e["aria-label"]},e.label)}))}var dO=(0,s.forwardRef)((function(e,t){let{eventToOffset:n,...r}=e;return(0,s.createElement)(RS,a({ref:t,stopNavigationEvents:!0,onlyBrowserTabstops:!0,eventToOffset:e=>{const{code:t,shiftKey:r}=e;return"Tab"===t?r?-1:1:n?n(e):void 0}},r))}));const fO="root",pO=()=>{},mO=(0,s.createContext)({activeItem:void 0,activeMenu:fO,setActiveMenu:pO,isMenuEmpty:pO,navigationTree:{items:{},getItem:pO,addItem:pO,removeItem:pO,menus:{},getMenu:pO,addMenu:pO,removeMenu:pO,childMenu:{},traverseMenu:pO,isMenuEmpty:pO}}),hO=()=>(0,s.useContext)(mO);var gO=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));const vO=(0,s.forwardRef)((function(e,t){let{__nextHasNoMarginBottom:n,className:r,onChange:o,onKeyDown:i,value:l,label:f,placeholder:p=(0,u.__)("Search"),hideLabelFromVision:m=!0,help:h,onClose:g,...v}=e;const b=(0,s.useRef)(),y=`components-search-control-${(0,d.useInstanceId)(vO)}`;return(0,s.createElement)(Nv,{__nextHasNoMarginBottom:n,label:f,id:y,hideLabelFromVision:m,help:h,className:c()(r,"components-search-control")},(0,s.createElement)("div",{className:"components-search-control__input-wrapper"},(0,s.createElement)("input",a({},v,{ref:(0,d.useMergeRefs)([b,t]),className:"components-search-control__input",id:y,type:"search",placeholder:p,onChange:e=>o(e.target.value),onKeyDown:i,autoComplete:"off",value:l||""})),(0,s.createElement)("div",{className:"components-search-control__icon"},g?(0,s.createElement)(od,{icon:Rb,label:(0,u.__)("Close search"),onClick:g}):l?(0,s.createElement)(od,{icon:Rb,label:(0,u.__)("Reset search"),onClick:()=>{var e;o(""),null===(e=b.current)||void 0===e||e.focus()}}):(0,s.createElement)(sy,{icon:gO}))))}));var bO=vO;const yO=Ju("div",{target:"ejwewyf11"})("width:100%;box-sizing:border-box;padding:0 ",Km(4),";overflow:hidden;"),wO=Ju("div",{target:"ejwewyf10"})("margin-top:",Km(6),";margin-bottom:",Km(6),";display:flex;flex-direction:column;ul{padding:0;margin:0;list-style:none;}.components-navigation__back-button{margin-bottom:",Km(6),";}.components-navigation__group+.components-navigation__group{margin-top:",Km(6),";}"),xO=Ju(od,{target:"ejwewyf9"})({name:"26l0q2",styles:"&.is-tertiary{color:inherit;opacity:0.7;&:hover:not( :disabled ){opacity:1;box-shadow:none;color:inherit;}&:active:not( :disabled ){background:transparent;opacity:1;color:inherit;}}"}),_O=Ju("div",{target:"ejwewyf8"})({name:"1aubja5",styles:"overflow:hidden;width:100%"}),EO=Ju("span",{target:"ejwewyf7"})("height:",Km(6),";.components-button.is-small{color:inherit;opacity:0.7;margin-right:",Km(1),";padding:0;&:active:not( :disabled ){background:none;opacity:1;color:inherit;}&:hover:not( :disabled ){box-shadow:none;opacity:1;color:inherit;}}"),CO=Ju(bO,{target:"ejwewyf6"})({name:"za3n3e",styles:"input[type='search'].components-search-control__input{margin:0;background:#303030;color:#fff;&:focus{background:#434343;color:#fff;}&::placeholder{color:rgba( 255, 255, 255, 0.6 );}}svg{fill:white;}.components-button.has-icon{padding:0;min-width:auto;}"}),kO=Ju(W_,{target:"ejwewyf5"})("min-height:",Km(12),";align-items:center;color:inherit;display:flex;justify-content:space-between;margin-bottom:",Km(2),";padding:",(()=>(0,u.isRTL)()?`${Km(1)} ${Km(4)} ${Km(1)} ${Km(2)}`:`${Km(1)} ${Km(2)} ${Km(1)} ${Km(4)}`),";"),SO=Ju("li",{target:"ejwewyf4"})("border-radius:2px;color:inherit;margin-bottom:0;>button,>a.components-button,>a{width:100%;color:inherit;opacity:0.7;padding:",Km(2)," ",Km(4),";",Bh({textAlign:"left"},{textAlign:"right"})," &:hover,&:focus:not( [aria-disabled='true'] ):active,&:active:not( [aria-disabled='true'] ):active{color:inherit;opacity:1;}}&.is-active{background-color:",Sp.ui.theme,";color:",Sp.white,";>button,>a{color:",Sp.white,";opacity:1;}}>svg path{color:",Sp.gray[600],";}"),TO=Ju("div",{target:"ejwewyf3"})("display:flex;align-items:center;height:auto;min-height:40px;margin:0;padding:",Km(1.5)," ",Km(4),";font-weight:400;line-height:20px;width:100%;color:inherit;opacity:0.7;"),NO=Ju("span",{target:"ejwewyf2"})("display:flex;margin-right:",Km(2),";"),RO=Ju("span",{target:"ejwewyf1"})("margin-left:",(()=>(0,u.isRTL)()?"0":Km(2)),";margin-right:",(()=>(0,u.isRTL)()?Km(2):"0"),";display:inline-flex;padding:",Km(1)," ",Km(3),";border-radius:2px;animation:fade-in 250ms ease-out;@keyframes fade-in{from{opacity:0;}to{opacity:1;}}",Tp("animation"),";"),IO=Ju(Ih,{target:"ejwewyf0"})((()=>(0,u.isRTL)()?"margin-left: auto;":"margin-right: auto;")," font-size:14px;line-height:20px;color:inherit;"),MO=()=>{const[e,t]=(0,s.useState)({});return{nodes:e,getNode:t=>e[t],addNode:(e,n)=>{const{children:r,...o}=n;return t((t=>({...t,[e]:o})))},removeNode:e=>t((t=>{const{[e]:n,...r}=t;return r}))}},PO=()=>{};function OO(e){let{activeItem:t,activeMenu:n=fO,children:r,className:o,onActivateMenu:i=PO}=e;const[a,l]=(0,s.useState)(n),[d,f]=(0,s.useState)(),p=(()=>{const{nodes:e,getNode:t,addNode:n,removeNode:r}=MO(),{nodes:o,getNode:i,addNode:a,removeNode:l}=MO(),[c,u]=(0,s.useState)({}),d=e=>c[e]||[],f=(e,t)=>{const n=[];let r,o=[e];for(;o.length>0&&(r=i(o.shift()),!r||n.includes(r.menu)||(n.push(r.menu),o=[...o,...d(r.menu)],!1!==t(r))););};return{items:e,getItem:t,addItem:n,removeItem:r,menus:o,getMenu:i,addMenu:(e,t)=>{u((n=>{const r={...n};return r[t.parentMenu]||(r[t.parentMenu]=[]),r[t.parentMenu].push(e),r})),a(e,t)},removeMenu:l,childMenu:c,traverseMenu:f,isMenuEmpty:e=>{let t=!0;return f(e,(e=>{if(!e.isEmpty)return t=!1,!1})),t}}})(),m=(0,u.isRTL)()?"right":"left",h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m;p.getMenu(e)&&(f(t),l(e),i(e))},g=(0,s.useRef)(!1);(0,s.useEffect)((()=>{g.current||(g.current=!0)}),[]),(0,s.useEffect)((()=>{n!==a&&h(n)}),[n]);const v={activeItem:t,activeMenu:a,setActiveMenu:h,navigationTree:p},b=c()("components-navigation",o),y=Sm({type:"slide-in",origin:d});return(0,s.createElement)(yO,{className:b},(0,s.createElement)("div",{key:a,className:c()({[y]:g.current&&d})},(0,s.createElement)(mO.Provider,{value:v},r)))}var DO=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));var AO=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var LO=(0,s.forwardRef)((function(e,t){var n;let{backButtonLabel:r,className:o,href:i,onClick:a,parentMenu:l}=e;const{setActiveMenu:d,navigationTree:f}=hO(),p=c()("components-navigation__back-button",o),m=null===(n=f.getMenu(l))||void 0===n?void 0:n.title,h=(0,u.isRTL)()?DO:AO;return(0,s.createElement)(xO,{className:p,href:i,variant:"tertiary",ref:t,onClick:e=>{"function"==typeof a&&a(e);const t=(0,u.isRTL)()?"left":"right";l&&!e.defaultPrevented&&d(l,t)}},(0,s.createElement)(sy,{icon:h}),r||m||(0,u.__)("Back"))}));const zO=(0,s.createContext)({group:void 0});let BO=0;function FO(e){let{children:t,className:n,title:r}=e;const[o]=(0,s.useState)("group-"+ ++BO),{navigationTree:{items:i}}=hO(),a={group:o};if(!Object.values(i).some((e=>e.group===o&&e._isVisible)))return(0,s.createElement)(zO.Provider,{value:a},t);const l=`components-navigation__group-title-${o}`,u=c()("components-navigation__group",n);return(0,s.createElement)(zO.Provider,{value:a},(0,s.createElement)("li",{className:u},r&&(0,s.createElement)(kO,{className:"components-navigation__group-title",id:l,level:3},r),(0,s.createElement)("ul",{"aria-labelledby":l,role:"group"},t)))}function VO(e){const{badge:t,title:n}=e;return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(IO,{className:"components-navigation__item-title",variant:"body.small",as:"span"},n),t&&(0,s.createElement)(RO,{className:"components-navigation__item-badge"},t))}const HO=(0,s.createContext)({menu:void 0,search:""}),jO=()=>(0,s.useContext)(HO),$O=e=>sb()(e).replace(/^\//,"").toLowerCase(),WO=(e,t)=>{const{activeMenu:n,navigationTree:{addItem:r,removeItem:o}}=hO(),{group:i}=(0,s.useContext)(zO),{menu:a,search:l}=jO();(0,s.useEffect)((()=>{const s=n===a,c=!l||((e,t)=>-1!==$O(e).indexOf($O(t)))(t.title,l);return r(e,{...t,group:i,menu:a,_isVisible:s&&c}),()=>{o(e)}}),[n,l])};let UO=0;function GO(e){var t;const{children:n,className:r,title:o,href:i,...l}=e,[u]=(0,s.useState)("item-"+ ++UO);WO(u,e);const{navigationTree:d}=hO();if(null===(t=d.getItem(u))||void 0===t||!t._isVisible)return null;const f=c()("components-navigation__item",r);return(0,s.createElement)(SO,a({className:f},l),n)}const YO=()=>{};function qO(e){const{badge:t,children:n,className:r,href:o,item:i,navigateToMenu:l,onClick:d=YO,title:f,icon:p,hideIfTargetMenuEmpty:m,isText:h,...g}=e,{activeItem:v,setActiveMenu:b,navigationTree:{isMenuEmpty:y}}=hO();if(m&&l&&y(l))return null;const w=i&&v===i,x=c()(r,{"is-active":w}),_=(0,u.isRTL)()?AO:DO,E=n?e:{...e,onClick:void 0},C=h?g:{as:od,href:o,onClick:e=>{l&&b(l),d(e)},"aria-current":w?"page":void 0,...g};return(0,s.createElement)(GO,a({},E,{className:x}),n||(0,s.createElement)(TO,C,p&&(0,s.createElement)(NO,null,(0,s.createElement)(sy,{icon:p})),(0,s.createElement)(VO,{title:f,badge:t}),l&&(0,s.createElement)(sy,{icon:_})))}var KO=(0,d.createHigherOrderComponent)((e=>t=>(0,s.createElement)(e,a({},t,{speak:cb.speak,debouncedSpeak:(0,d.useDebounce)(cb.speak,500)}))),"withSpokenMessages");var XO=KO((function(e){let{debouncedSpeak:t,onCloseSearch:n,onSearch:r,search:o,title:i}=e;const{navigationTree:{items:a}}=hO(),{menu:l}=jO(),c=(0,s.useRef)();(0,s.useEffect)((()=>{const e=setTimeout((()=>{c.current.focus()}),100);return()=>{clearTimeout(e)}}),[]),(0,s.useEffect)((()=>{if(!o)return;const e=Object.values(a).filter((e=>e._isVisible)).length,n=(0,u.sprintf)((0,u._n)("%d result found.","%d results found.",e),e);t(n)}),[a,o]);const d=()=>{r(""),n()},f=`components-navigation__menu-title-search-${l}`,p=(0,u.sprintf)((0,u.__)("Search %s"),null==i?void 0:i.toLowerCase()).trim();return(0,s.createElement)("div",{className:"components-navigation__menu-title-search"},(0,s.createElement)(CO,{autoComplete:"off",className:"components-navigation__menu-search-input",id:f,onChange:e=>r(e),onKeyDown:function(e){"Escape"!==e.code||e.defaultPrevented||(e.preventDefault(),d())},placeholder:p,onClose:d,ref:c,type:"search",value:o}))}));function ZO(e){let{hasSearch:t,onSearch:n,search:r,title:o,titleAction:i}=e;const[a,l]=(0,s.useState)(!1),{menu:c}=jO(),d=(0,s.useRef)();if(!o)return null;const f=`components-navigation__menu-title-${c}`,p=(0,u.sprintf)((0,u.__)("Search in %s"),o);return(0,s.createElement)(_O,{className:"components-navigation__menu-title"},!a&&(0,s.createElement)(kO,{as:"h2",className:"components-navigation__menu-title-heading",level:3},(0,s.createElement)("span",{id:f},o),(t||i)&&(0,s.createElement)(EO,null,i,t&&(0,s.createElement)(od,{isSmall:!0,variant:"tertiary",label:p,onClick:()=>l(!0),ref:d},(0,s.createElement)(sy,{icon:gO})))),a&&(0,s.createElement)("div",{className:Sm({type:"slide-in",origin:"left"})},(0,s.createElement)(XO,{onCloseSearch:()=>{l(!1),setTimeout((()=>{d.current.focus()}),100)},onSearch:n,search:r,title:o})))}function JO(e){let{search:t}=e;const{navigationTree:{items:n}}=hO(),r=Object.values(n).filter((e=>e._isVisible)).length;return!t||r?null:(0,s.createElement)(SO,null,(0,s.createElement)(TO,null,(0,u.__)("No results found.")," "))}function QO(e){const{backButtonLabel:t,children:n,className:r,hasSearch:o,menu:i=fO,onBackButtonClick:a,onSearch:l,parentMenu:u,search:d,isSearchDebouncing:f,title:p,titleAction:m}=e,[h,g]=(0,s.useState)("");(e=>{const{navigationTree:{addMenu:t,removeMenu:n}}=hO(),r=e.menu||fO;(0,s.useEffect)((()=>(t(r,{...e,menu:r}),()=>{n(r)})),[])})(e);const{activeMenu:v}=hO(),b={menu:i,search:h};if(v!==i)return(0,s.createElement)(HO.Provider,{value:b},n);const y=!!l,w=y?d:h,x=y?l:g,_=`components-navigation__menu-title-${i}`,E=c()("components-navigation__menu",r);return(0,s.createElement)(HO.Provider,{value:b},(0,s.createElement)(wO,{className:E},(u||a)&&(0,s.createElement)(LO,{backButtonLabel:t,parentMenu:u,onClick:a}),p&&(0,s.createElement)(ZO,{hasSearch:o,onSearch:x,search:w,title:p,titleAction:m}),(0,s.createElement)(IS,null,(0,s.createElement)("ul",{"aria-labelledby":_},n,w&&!f&&(0,s.createElement)(JO,{search:w})))))}const eD=(0,s.createContext)({location:{},goTo:()=>{},goBack:()=>{},goToParent:()=>{},addScreen:()=>{},removeScreen:()=>{},params:{}});function tD(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||95===l))break;a+=e[s++]}if(!a)throw new TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:a}),n=s}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),r=t.prefixes,o=void 0===r?"./":r,i="[^".concat(rD(t.delimiter||"/#?"),"]+?"),a=[],s=0,l=0,c="",u=function(e){if(l-1:void 0===E;o||(g+="(?:".concat(h,"(?=").concat(m,"))?")),C||(g+="(?=".concat(h,"|").concat(m,")"))}return new RegExp(g,oD(n))}(tD(e,n),t,n)}function aD(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,o=n.exec(e.source);o;)t.push({name:o[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),o=n.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,n){var r=e.map((function(e){return aD(e,t,n).source}));return new RegExp("(?:".concat(r.join("|"),")"),oD(n))}(e,t,n):iD(e,t,n)}function sD(e,t){return nD(t,{decode:decodeURIComponent})(e)}function lD(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"add":return[...e,t.screen];case"remove":return e.filter((e=>e.id!==t.screen.id))}return e}var cD={name:"15bx5k",styles:"overflow-x:hidden"};const uD=Hu((function(e,t){const{initialPath:n,children:r,className:o,...i}=Vu(e,"NavigatorProvider"),[l,c]=(0,s.useState)([{path:n}]),u=(0,s.useRef)([]),[d,f]=(0,s.useReducer)(lD,[]),p=(0,s.useRef)([]);(0,s.useEffect)((()=>{p.current=d}),[d]),(0,s.useEffect)((()=>{u.current=l}),[l]);const m=(0,s.useRef)(),h=(0,s.useMemo)((()=>{let e;if(0===l.length||void 0===(e=l[l.length-1].path))return void(m.current=void 0);const t=(e=>{const t=function(e,t){for(const n of t){const t=sD(e,n.path);if(t)return{params:t.params,id:n.id}}}(e,d);return m.current&&t&&df()(t.params,m.current.params)&&t.id===m.current.id?m.current:t})(e);return m.current=t,t}),[d,l]),g=(0,s.useCallback)((e=>f({type:"add",screen:e})),[]),v=(0,s.useCallback)((e=>f({type:"remove",screen:e})),[]),b=(0,s.useCallback)((()=>{c((e=>e.length<=1?e:[...e.slice(0,-2),{...e[e.length-2],isBack:!0,hasRestoredFocus:!1}]))}),[]),y=(0,s.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{focusTargetSelector:n,isBack:r=!1,...o}=t,i=r&&u.current.length>1&&u.current[u.current.length-2].path===e;i?b():c((t=>{const i={...o,path:e,isBack:r,hasRestoredFocus:!1};return t.length<1?[i]:[...t.slice(t.length>49?1:0,-1),{...t[t.length-1],focusTargetSelector:n},i]}))}),[b]),w=(0,s.useCallback)((()=>{const e=u.current[u.current.length-1].path;if(void 0===e)return;const t=function(e,t){if(!e.startsWith("/"))return;const n=e.split("/");let r;for(;n.length>1&&void 0===r;){n.pop();const e=""===n.join("/")?"/":n.join("/");t.find((t=>!1!==sD(e,t.path)))&&(r=e)}return r}(e,p.current);void 0!==t&&y(t,{isBack:!0})}),[y]),x=(0,s.useMemo)((()=>({location:{...l[l.length-1],isInitial:1===l.length},params:h?h.params:{},match:h?h.id:void 0,goTo:y,goBack:b,goToParent:w,addScreen:g,removeScreen:v})),[l,h,y,b,w,g,v]),_=Fu(),E=(0,s.useMemo)((()=>_(cD,o)),[o,_]);return(0,s.createElement)(ed,a({ref:t,className:E},i),(0,s.createElement)(eD.Provider,{value:x},r))}),"NavigatorProvider");var dD=uD,fD=window.wp.escapeHtml;var pD={name:"14x3t6z",styles:"overflow-x:auto;max-height:100%"};const mD=Hu((function(e,t){const n=(0,s.useId)(),{children:r,className:o,path:i,...l}=Vu(e,"NavigatorScreen"),c=(0,d.useReducedMotion)(),{location:f,match:p,addScreen:m,removeScreen:h}=(0,s.useContext)(eD),g=p===n,v=(0,s.useRef)(null);(0,s.useEffect)((()=>{const e={id:n,path:(0,fD.escapeAttribute)(i)};return m(e),()=>h(e)}),[n,i,m,h]);const b=Fu(),y=(0,s.useMemo)((()=>b(pD,o)),[o,b]),w=(0,s.useRef)(f);(0,s.useEffect)((()=>{w.current=f}),[f]);const x=f.isInitial&&!f.isBack;(0,s.useEffect)((()=>{if(x||!g||!v.current||w.current.hasRestoredFocus)return;const e=v.current.ownerDocument.activeElement;if(v.current.contains(e))return;let t=null;if(f.isBack&&null!=f&&f.focusTargetSelector&&(t=v.current.querySelector(f.focusTargetSelector)),!t){const e=CS.focus.tabbable.find(v.current)[0];t=null!=e?e:v.current}w.current.hasRestoredFocus=!0,t.focus()}),[x,g,f.isBack,f.focusTargetSelector]);const _=(0,d.useMergeRefs)([t,v]);if(!g)return null;if(c)return(0,s.createElement)(ed,a({ref:_,className:y},l),r);const E={opacity:1,transition:{delay:0,duration:.14,ease:"easeInOut"},x:0},C={opacity:0,x:(0,u.isRTL)()&&f.isBack||!(0,u.isRTL)()&&!f.isBack?50:-50},k={animate:E,exit:{delay:0,opacity:0,x:!(0,u.isRTL)()&&f.isBack||(0,u.isRTL)()&&!f.isBack?50:-50,transition:{duration:.14,ease:"easeInOut"}},initial:C};return(0,s.createElement)(Ul.div,a({ref:_,className:y},l,k),r)}),"NavigatorScreen");var hD=mD;var gD=function(){const{location:e,params:t,goTo:n,goBack:r,goToParent:o}=(0,s.useContext)(eD);return{location:e,goTo:n,goBack:r,goToParent:o,params:t}};var vD=Hu((function(e,t){const n=function(e){const{path:t,onClick:n,as:r=od,attributeName:o="id",...i}=Vu(e,"NavigatorButton"),a=(0,fD.escapeAttribute)(t),{goTo:l}=gD();return{as:r,onClick:(0,s.useCallback)((e=>{var t,r;e.preventDefault(),l(a,{focusTargetSelector:(t=o,r=a,`[${t}="${r}"]`)}),null==n||n(e)}),[l,n,o,a]),...i,[o]:a}}(e);return(0,s.createElement)(ed,a({ref:t},n))}),"NavigatorButton");function bD(e){const{onClick:t,as:n=od,goToParent:r=!1,...o}=Vu(e,"NavigatorBackButton"),{goBack:i,goToParent:a}=gD();return{as:n,onClick:(0,s.useCallback)((e=>{e.preventDefault(),r?a():i(),null==t||t(e)}),[r,a,i,t]),...o}}var yD=Hu((function(e,t){const n=bD(e);return(0,s.createElement)(ed,a({ref:t},n))}),"NavigatorBackButton");var wD=Hu((function(e,t){const n=bD({...e,goToParent:!0});return(0,s.createElement)(ed,a({ref:t},n))}),"NavigatorToParentButton");const xD=()=>{};function _D(e){switch(e){case"success":case"warning":case"info":return"polite";default:return"assertive"}}var ED=function(e){let{className:t,status:n="info",children:r,spokenMessage:o=r,onRemove:i=xD,isDismissible:a=!0,actions:l=[],politeness:d=_D(n),__unstableHTML:f,onDismiss:p=xD}=e;!function(e,t){const n="string"==typeof e?e:(0,s.renderToString)(e);(0,s.useEffect)((()=>{n&&(0,cb.speak)(n,t)}),[n,t])}(o,d);const m=c()(t,"components-notice","is-"+n,{"is-dismissible":a});return f&&"string"==typeof r&&(r=(0,s.createElement)(s.RawHTML,null,r)),(0,s.createElement)("div",{className:m},(0,s.createElement)("div",{className:"components-notice__content"},r,(0,s.createElement)("div",{className:"components-notice__actions"},l.map(((e,t)=>{let{className:n,label:r,isPrimary:o,variant:i,noDefaultClasses:a=!1,onClick:l,url:u}=e,d=i;return"primary"===i||a||(d=u?"link":"secondary"),void 0===d&&o&&(d="primary"),(0,s.createElement)(od,{key:t,href:u,variant:d,onClick:u?void 0:l,className:c()("components-notice__action",n)},r)})))),a&&(0,s.createElement)(od,{className:"components-notice__dismiss",icon:Gl,label:(0,u.__)("Dismiss this notice"),onClick:e=>{var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),p(),i()},showTooltip:!1}))};const CD=()=>{};var kD=function(e){let{notices:t,onRemove:n=CD,className:r,children:o}=e;const i=e=>()=>n(e);return r=c()("components-notice-list",r),(0,s.createElement)("div",{className:r},o,[...t].reverse().map((e=>{const{content:t,...n}=e;return(0,s.createElement)(ED,a({},n,{key:e.id,onRemove:i(e.id)}),e.content)})))};var SD=function(e){let{label:t,children:n}=e;return(0,s.createElement)("div",{className:"components-panel__header"},t&&(0,s.createElement)("h2",null,t),n)};var TD=(0,s.forwardRef)((function(e,t){let{header:n,className:r,children:o}=e;const i=c()(r,"components-panel");return(0,s.createElement)("div",{className:i,ref:t},n&&(0,s.createElement)(SD,{label:n}),o)}));var ND=(0,s.createElement)(i.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(i.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));const RD=()=>{};const ID=(0,s.forwardRef)(((e,t)=>{let{isOpened:n,icon:r,title:o,...i}=e;return o?(0,s.createElement)("h2",{className:"components-panel__body-title"},(0,s.createElement)(od,a({className:"components-panel__body-toggle","aria-expanded":n,ref:t},i),(0,s.createElement)("span",{"aria-hidden":"true"},(0,s.createElement)(Xl,{className:"components-panel__arrow",icon:n?ND:ly})),o,r&&(0,s.createElement)(Xl,{icon:r,className:"components-panel__icon",size:20}))):null})),MD=(0,s.forwardRef)((function(e,t){let{buttonProps:n={},children:r,className:o,icon:i,initialOpen:l,onToggle:u=RD,opened:f,title:p,scrollAfterOpen:m=!0}=e;const[h,g]=my(f,{initial:void 0===l||l}),v=(0,s.useRef)(),b=(0,d.useReducedMotion)()?"auto":"smooth",y=(0,s.useRef)();y.current=m,ec((()=>{var e;h&&y.current&&null!==(e=v.current)&&void 0!==e&&e.scrollIntoView&&v.current.scrollIntoView({inline:"nearest",block:"nearest",behavior:b})}),[h,b]);const w=c()("components-panel__body",o,{"is-opened":h});return(0,s.createElement)("div",{className:w,ref:(0,d.useMergeRefs)([v,t])},(0,s.createElement)(ID,a({icon:i,isOpened:h,onClick:e=>{e.preventDefault();const t=!h;g(t),u(t)},title:p},n)),"function"==typeof r?r({opened:h}):h&&r)}));MD.displayName="PanelBody";var PD=MD;var OD=(0,s.forwardRef)(((e,t)=>{let{className:n,children:r}=e;return(0,s.createElement)("div",{className:c()("components-panel__row",n),ref:t},r)}));const DD=(0,s.createElement)(i.SVG,{className:"components-placeholder__illustration",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",preserveAspectRatio:"none"},(0,s.createElement)(i.Path,{vectorEffect:"non-scaling-stroke",d:"M60 60 0 0"}));var AD=function(e){const{icon:t,children:n,label:r,instructions:o,className:i,notices:l,preview:u,isColumnLayout:f,withIllustration:p,...m}=e,[h,{width:g}]=(0,d.useResizeObserver)();let v;"number"==typeof g&&(v={"is-large":g>=480,"is-medium":g>=160&&g<480,"is-small":g<160});const b=c()("components-placeholder",i,v,p?"has-illustration":null),y=c()("components-placeholder__fieldset",{"is-column-layout":f});return(0,s.createElement)("div",a({},m,{className:b}),p?DD:null,h,l,u&&(0,s.createElement)("div",{className:"components-placeholder__preview"},u),(0,s.createElement)("div",{className:"components-placeholder__label"},(0,s.createElement)(Xl,{icon:t}),r),(0,s.createElement)("fieldset",{className:y},!!o&&(0,s.createElement)("legend",{className:"components-placeholder__instructions"},o),n))};function LD(e){const t=e.map((e=>({children:[],parent:null,...e,id:String(e.id)}))),n=(0,Ql.groupBy)(t,"parent");if(n.null&&n.null.length)return t;const r=e=>e.map((e=>{const t=n[e.id];return{...e,children:t&&t.length?r(t):[]}}));return r(n[0]||[])}var zD=window.wp.htmlEntities;function BD(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.flatMap((e=>[{value:e.id,label:" ".repeat(3*t)+(0,zD.decodeEntities)(e.name)},...BD(e.children||[],t+1)]))}var FD=function(e){let{label:t,noOptionLabel:n,onChange:r,selectedId:o,tree:i=[],...l}=e;const c=(0,s.useMemo)((()=>[n&&{value:"",label:n},...BD(i)].filter((e=>!!e))),[n,i]);return(0,s.createElement)(dy,a({label:t,options:c,onChange:r,value:o},l))};function VD(e){let{label:t,noOptionLabel:n,authorList:r,selectedAuthorId:o,onChange:i}=e;if(!r)return null;const a=LD(r);return(0,s.createElement)(FD,{label:t,noOptionLabel:n,onChange:i,tree:a,selectedId:void 0!==o?String(o):void 0})}function HD(e){let{label:t,noOptionLabel:n,categoriesList:r,selectedCategoryId:o,onChange:i,...l}=e;const c=(0,s.useMemo)((()=>LD(r)),[r]);return(0,s.createElement)(FD,a({label:t,noOptionLabel:n,onChange:i,tree:c,selectedId:void 0!==o?String(o):void 0},l))}const jD=1,$D=100;function WD(e){return"categoriesList"in e}function UD(e){return"categorySuggestions"in e}var GD=function(e){let{authorList:t,selectedAuthorId:n,numberOfItems:r,order:o,orderBy:i,maxItems:a=$D,minItems:l=jD,onAuthorChange:c,onNumberOfItemsChange:d,onOrderChange:f,onOrderByChange:p,...m}=e;return(0,s.createElement)(s.Fragment,null,[f&&p&&(0,s.createElement)(fy,{__nextHasNoMarginBottom:!0,key:"query-controls-order-select",label:(0,u.__)("Order by"),value:`${i}/${o}`,options:[{label:(0,u.__)("Newest to oldest"),value:"date/desc"},{label:(0,u.__)("Oldest to newest"),value:"date/asc"},{label:(0,u.__)("A → Z"),value:"title/asc"},{label:(0,u.__)("Z → A"),value:"title/desc"}],onChange:e=>{if("string"!=typeof e)return;const[t,n]=e.split("/");n!==o&&f(n),t!==i&&p(t)}}),WD(m)&&m.categoriesList&&m.onCategoryChange&&(0,s.createElement)(HD,{key:"query-controls-category-select",categoriesList:m.categoriesList,label:(0,u.__)("Category"),noOptionLabel:(0,u.__)("All"),selectedCategoryId:m.selectedCategoryId,onChange:m.onCategoryChange}),UD(m)&&m.categorySuggestions&&m.onCategoryChange&&(0,s.createElement)(ZP,{key:"query-controls-categories-select",label:(0,u.__)("Categories"),value:m.selectedCategories&&m.selectedCategories.map((e=>({id:e.id,value:e.name||e.value}))),suggestions:Object.keys(m.categorySuggestions),onChange:m.onCategoryChange,maxSuggestions:20}),c&&(0,s.createElement)(VD,{key:"query-controls-author-select",authorList:t,label:(0,u.__)("Author"),noOptionLabel:(0,u.__)("All"),selectedAuthorId:n,onChange:c}),d&&(0,s.createElement)($y,{__nextHasNoMarginBottom:!0,key:"query-controls-range-control",label:(0,u.__)("Number of items"),value:r,onChange:d,min:l,max:a,required:!0})])};var YD=(0,s.createContext)({state:null,setState:()=>{}});var qD=(0,s.forwardRef)((function(e,t){let{children:n,value:r,...o}=e;const i=(0,s.useContext)(YD),l=i.state===r;return(0,s.createElement)(CP,a({ref:t,as:od,variant:l?"primary":"secondary",value:r},i,o),n||r)}));var KD=(0,s.forwardRef)((function(e,t){let{label:n,checked:r,defaultChecked:o,disabled:i,onChange:l,...c}=e;const u=cP({state:o,baseId:c.id}),d={...u,disabled:i,state:null!=r?r:u.state,setState:null!=l?l:u.setState};return(0,s.createElement)(YD.Provider,{value:d},(0,s.createElement)(fP,a({ref:t,as:RC,"aria-label":n},u,c)))}));var XD=function e(t){const{label:n,className:r,selected:o,help:i,onChange:l,hideLabelFromVision:u,options:f=[],...p}=t,m=`inspector-radio-control-${(0,d.useInstanceId)(e)}`,h=e=>l(e.target.value);return null!=f&&f.length?(0,s.createElement)(Nv,{__nextHasNoMarginBottom:!0,label:n,id:m,hideLabelFromVision:u,help:i,className:c()(r,"components-radio-control")},(0,s.createElement)(j_,{spacing:1},f.map(((e,t)=>(0,s.createElement)("div",{key:`${m}-${t}`,className:"components-radio-control__option"},(0,s.createElement)("input",a({id:`${m}-${t}`,className:"components-radio-control__input",type:"radio",name:m,value:e.value,onChange:h,checked:e.value===o,"aria-describedby":i?`${m}__help`:void 0},p)),(0,s.createElement)("label",{htmlFor:`${m}-${t}`},e.label)))))):null},ZD=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),JD=function(){return JD=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{},bA={bottom:"bottom",corner:"corner"};function yA(e){let{axis:t,fadeTimeout:n=180,onResize:r=vA,position:o=bA.bottom,showPx:i=!1}=e;const[a,l]=(0,d.useResizeObserver)(),c=!!t,[u,f]=(0,s.useState)(!1),[p,m]=(0,s.useState)(!1),{width:h,height:g}=l,v=(0,s.useRef)(g),b=(0,s.useRef)(h),y=(0,s.useRef)(),w=(0,s.useCallback)((()=>{y.current&&window.clearTimeout(y.current),y.current=window.setTimeout((()=>{c||(f(!1),m(!1))}),n)}),[n,c]);(0,s.useEffect)((()=>{if(!(null!==h||null!==g))return;const e=h!==b.current,t=g!==v.current;if(e||t){if(h&&!b.current&&g&&!v.current)return b.current=h,void(v.current=g);e&&(f(!0),b.current=h),t&&(m(!0),v.current=g),r({width:h,height:g}),w()}}),[h,g,r,w]);const x=function(e){let{axis:t,height:n,moveX:r=!1,moveY:o=!1,position:i=bA.bottom,showPx:a=!1,width:s}=e;if(!r&&!o)return;if(i===bA.corner)return`${s} x ${n}`;const l=a?" px":"";if(t){if("x"===t&&r)return`${s}${l}`;if("y"===t&&o)return`${n}${l}`}if(r&&o)return`${s} x ${n}`;if(r)return`${s}${l}`;if(o)return`${n}${l}`;return}({axis:t,height:g,moveX:u,moveY:p,position:o,showPx:i,width:h});return{label:x,resizeListener:a}}const wA=Ju("div",{target:"ekdag503"})({name:"1cd7zoc",styles:"bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0"}),xA=Ju("div",{target:"ekdag502"})({name:"ajymcs",styles:"align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear"}),_A=Ju("div",{target:"ekdag501"})("background:",Sp.gray[900],";border-radius:2px;box-sizing:border-box;font-size:12px;color:",Sp.ui.textDark,";padding:4px 8px;position:relative;"),EA=Ju(Ih,{target:"ekdag500"})("&&&{color:",Sp.ui.textDark,";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}");const CA=(0,s.forwardRef)((function(e,t){let{label:n,position:r=bA.corner,zIndex:o=1e3,...i}=e;const l=!!n,c=r===bA.bottom,d=r===bA.corner;if(!l)return null;let f={opacity:l?1:void 0,zIndex:o},p={};return c&&(f={...f,position:"absolute",bottom:-10,left:"50%",transform:"translate(-50%, 0)"},p={transform:"translate(0, 100%)"}),d&&(f={...f,position:"absolute",top:4,right:(0,u.isRTL)()?void 0:4,left:(0,u.isRTL)()?4:void 0}),(0,s.createElement)(xA,a({"aria-hidden":"true",className:"components-resizable-tooltip__tooltip-wrapper",ref:t,style:f},i),(0,s.createElement)(_A,{className:"components-resizable-tooltip__tooltip",style:p},(0,s.createElement)(EA,{as:"span"},n)))}));var kA=CA;const SA=()=>{};const TA=(0,s.forwardRef)((function(e,t){let{axis:n,className:r,fadeTimeout:o=180,isVisible:i=!0,labelRef:l,onResize:u=SA,position:d=bA.bottom,showPx:f=!0,zIndex:p=1e3,...m}=e;const{label:h,resizeListener:g}=yA({axis:n,fadeTimeout:o,onResize:u,showPx:f,position:d});if(!i)return null;const v=c()("components-resize-tooltip",r);return(0,s.createElement)(wA,a({"aria-hidden":"true",className:v,ref:t},m),g,(0,s.createElement)(kA,{"aria-hidden":m["aria-hidden"],label:h,position:d,ref:l,zIndex:p}))}));var NA=TA;const RA="components-resizable-box__handle",IA="components-resizable-box__side-handle",MA="components-resizable-box__corner-handle",PA={top:c()(RA,IA,"components-resizable-box__handle-top"),right:c()(RA,IA,"components-resizable-box__handle-right"),bottom:c()(RA,IA,"components-resizable-box__handle-bottom"),left:c()(RA,IA,"components-resizable-box__handle-left"),topLeft:c()(RA,MA,"components-resizable-box__handle-top","components-resizable-box__handle-left"),topRight:c()(RA,MA,"components-resizable-box__handle-top","components-resizable-box__handle-right"),bottomRight:c()(RA,MA,"components-resizable-box__handle-bottom","components-resizable-box__handle-right"),bottomLeft:c()(RA,MA,"components-resizable-box__handle-bottom","components-resizable-box__handle-left")},OA={width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0},DA={top:OA,right:OA,bottom:OA,left:OA,topLeft:OA,topRight:OA,bottomRight:OA,bottomLeft:OA};const AA=(0,s.forwardRef)((function(e,t){let{className:n,children:r,showHandle:o=!0,__experimentalShowTooltip:i=!1,__experimentalTooltipProps:l={},...u}=e;return(0,s.createElement)(gA,a({className:c()("components-resizable-box__container",o&&"has-show-handle",n),handleClasses:PA,handleStyles:DA,ref:t},u),r,i&&(0,s.createElement)(NA,l))}));var LA=AA;var zA=function(e){let{naturalWidth:t,naturalHeight:n,children:r,isInline:o=!1}=e;const[i,{width:a}]=(0,d.useResizeObserver)();if(1!==s.Children.count(r))return null;const l={paddingBottom:t<(null!=a?a:0)?n:n/t*100+"%"},u=o?"span":"div";return(0,s.createElement)(u,{className:"components-responsive-wrapper"},i,(0,s.createElement)(u,{style:l}),(0,s.cloneElement)(r,{className:c()("components-responsive-wrapper__content",r.props.className)}))};const BA=function(){const{MutationObserver:e}=window;if(!e||!document.body||!window.parent)return;function t(){const e=document.body.getBoundingClientRect();window.parent.postMessage({action:"resize",width:e.width,height:e.height},"*")}function n(e){e.style&&["width","height","minHeight","maxHeight"].forEach((function(t){/^\\d+(vmin|vmax|vh|vw)$/.test(e.style[t])&&(e.style[t]="")}))}new e(t).observe(document.body,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),window.addEventListener("load",t,!0),Array.prototype.forEach.call(document.querySelectorAll("[style]"),n),Array.prototype.forEach.call(document.styleSheets,(function(e){Array.prototype.forEach.call(e.cssRules||e.rules,n)})),document.body.style.position="absolute",document.body.style.width="100%",document.body.setAttribute("data-resizable-iframe-connected",""),t(),window.addEventListener("resize",t,!0)},FA="\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div {\n\t\twidth: 100%;\n\t}\n\thtml.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio > div,\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t}\n\tbody > div > * {\n\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\tmargin-bottom: 0 !important;\n\t}\n";var VA=function(e){let{html:t="",title:n="",type:r,styles:o=[],scripts:i=[],onFocus:a}=e;const l=(0,s.useRef)(),[c,u]=(0,s.useState)(0),[f,p]=(0,s.useState)(0);function m(){try{var e,t;return!(null===(e=l.current)||void 0===e||null===(t=e.contentDocument)||void 0===t||!t.body)}catch(e){return!1}}function h(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!m())return;const{contentDocument:a,ownerDocument:c}=l.current;if(!e&&null!==(null==a?void 0:a.body.getAttribute("data-resizable-iframe-connected")))return;const u=(0,s.createElement)("html",{lang:c.documentElement.lang,className:r},(0,s.createElement)("head",null,(0,s.createElement)("title",null,n),(0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:FA}}),o.map(((e,t)=>(0,s.createElement)("style",{key:t,dangerouslySetInnerHTML:{__html:e}})))),(0,s.createElement)("body",{"data-resizable-iframe-connected":"data-resizable-iframe-connected",className:r},(0,s.createElement)("div",{dangerouslySetInnerHTML:{__html:t}}),(0,s.createElement)("script",{type:"text/javascript",dangerouslySetInnerHTML:{__html:`(${BA.toString()})();`}}),i.map((e=>(0,s.createElement)("script",{key:e,src:e})))));a.open(),a.write(""+(0,s.renderToString)(u)),a.close()}return(0,s.useEffect)((()=>{var e;function t(){h(!1)}function n(e){const t=l.current;if(!t||t.contentWindow!==e.source)return;let n=e.data||{};if("string"==typeof n)try{n=JSON.parse(n)}catch(e){}"resize"===n.action&&(u(n.width),p(n.height))}h();const r=l.current,o=null==r||null===(e=r.ownerDocument)||void 0===e?void 0:e.defaultView;return null==r||r.addEventListener("load",t,!1),null==o||o.addEventListener("message",n),()=>{null==r||r.removeEventListener("load",t,!1),null==o||o.addEventListener("message",n)}}),[]),(0,s.useEffect)((()=>{h()}),[n,o,i]),(0,s.useEffect)((()=>{h(!0)}),[t,r]),(0,s.createElement)("iframe",{ref:(0,d.useMergeRefs)([l,(0,d.useFocusableIframe)()]),title:n,className:"components-sandbox",sandbox:"allow-scripts allow-same-origin allow-presentation",onFocus:a,width:Math.ceil(c),height:Math.ceil(f)})};const HA=(0,s.forwardRef)((function(e,t){let{className:n,children:r,spokenMessage:o=r,politeness:i="polite",actions:a=[],onRemove:l,icon:d=null,explicitDismiss:f=!1,onDismiss:p,listRef:m}=e;function h(e){var t;e&&e.preventDefault&&e.preventDefault(),null==m||null===(t=m.current)||void 0===t||t.focus(),null==p||p(),null==l||l()}!function(e,t){const n="string"==typeof e?e:(0,s.renderToString)(e);(0,s.useEffect)((()=>{n&&(0,cb.speak)(n,t)}),[n,t])}(o,i),(0,s.useEffect)((()=>{const e=setTimeout((()=>{f||(null==p||p(),null==l||l())}),1e4);return()=>clearTimeout(e)}),[p,l,f]);const g=c()(n,"components-snackbar",{"components-snackbar-explicit-dismiss":!!f});a&&a.length>1&&("undefined"!=typeof process&&process.env,a=[a[0]]);const v=c()("components-snackbar__content",{"components-snackbar__content-with-icon":!!d});return(0,s.createElement)("div",{ref:t,className:g,onClick:f?void 0:h,tabIndex:0,role:f?"":"button",onKeyPress:f?void 0:h,"aria-label":f?"":(0,u.__)("Dismiss this notice")},(0,s.createElement)("div",{className:v},d&&(0,s.createElement)("div",{className:"components-snackbar__icon"},d),r,a.map(((e,t)=>{let{label:n,onClick:r,url:o}=e;return(0,s.createElement)(od,{key:t,href:o,variant:"tertiary",onClick:e=>function(e,t){e.stopPropagation(),null==l||l(),t&&t(e)}(e,r),className:"components-snackbar__action"},n)})),f&&(0,s.createElement)("span",{role:"button","aria-label":"Dismiss this notice",tabIndex:0,className:"components-snackbar__dismiss-button",onClick:h,onKeyPress:h},"✕")))}));var jA=HA;const $A={init:{height:0,opacity:0},open:{height:"auto",opacity:1,transition:{height:{stiffness:1e3,velocity:-100}}},exit:{opacity:0,transition:{duration:.5}}};var WA=function(e){let{notices:t,className:n,children:r,onRemove:o}=e;const i=(0,s.useRef)(null),l=(0,d.useReducedMotion)();n=c()("components-snackbar-list",n);const u=e=>()=>null==o?void 0:o(e.id);return(0,s.createElement)("div",{className:n,tabIndex:-1,ref:i},r,(0,s.createElement)(Dm,null,t.map((e=>{const{content:t,...n}=e;return(0,s.createElement)(Ul.div,{layout:!l,initial:"init",animate:"open",exit:"exit",key:e.id,variants:l?void 0:$A},(0,s.createElement)("div",{className:"components-snackbar-list__notice-container"},(0,s.createElement)(jA,a({},n,{onRemove:u(e),listRef:i}),e.content)))}))))};const UA=(function(){var e=Wf.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}})` + */var r=n(9196);var o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,a=r.useEffect,s=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return s((function(){o.value=n,o.getSnapshot=t,c(o)&&u({inst:o})}),[e,n,t]),a((function(){return c(o)&&u({inst:o}),e((function(){c(o)&&u({inst:o})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},635:function(e,t,n){"use strict";e.exports=n(7755)},9196:function(e){"use strict";e.exports=window.React}},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.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var r={};!function(){"use strict";n.r(r),n.d(r,{AnglePickerControl:function(){return ob},Animate:function(){return Sm},Autocomplete:function(){return gb},BaseControl:function(){return Tv},BlockQuotation:function(){return i.BlockQuotation},Button:function(){return rd},ButtonGroup:function(){return NC},Card:function(){return lk},CardBody:function(){return gk},CardDivider:function(){return Ek},CardFooter:function(){return Ck},CardHeader:function(){return kk},CardMedia:function(){return Sk},CheckboxControl:function(){return Tk},Circle:function(){return i.Circle},ClipboardButton:function(){return Nk},ColorIndicator:function(){return Xb},ColorPalette:function(){return J_},ColorPicker:function(){return B_},ComboboxControl:function(){return lT},CustomGradientPicker:function(){return vS},CustomSelectControl:function(){return _N},Dashicon:function(){return Xl},DatePicker:function(){return CI},DateTimePicker:function(){return qI},Disabled:function(){return nM},Draggable:function(){return oM},DropZone:function(){return aM},DropZoneProvider:function(){return sM},Dropdown:function(){return ty},DropdownMenu:function(){return PS},DuotonePicker:function(){return hM},DuotoneSwatch:function(){return uM},ExternalLink:function(){return bM},Fill:function(){return pf},Flex:function(){return Xm},FlexBlock:function(){return Hm},FlexItem:function(){return jm},FocalPointPicker:function(){return $M},FocusReturnProvider:function(){return wz},FocusableIframe:function(){return WM},FontSizePicker:function(){return FP},FormFileUpload:function(){return VP},FormToggle:function(){return jP},FormTokenField:function(){return qP},G:function(){return i.G},GradientPicker:function(){return xS},Guide:function(){return ZP},GuidePage:function(){return JP},HorizontalRule:function(){return i.HorizontalRule},Icon:function(){return Zl},IconButton:function(){return QP},IsolatedEventContainer:function(){return oz},KeyboardShortcuts:function(){return rO},Line:function(){return i.Line},MenuGroup:function(){return oO},MenuItem:function(){return iO},MenuItemsChoice:function(){return sO},Modal:function(){return hT},NavigableMenu:function(){return RS},Notice:function(){return wD},NoticeList:function(){return _D},Panel:function(){return CD},PanelBody:function(){return RD},PanelHeader:function(){return ED},PanelRow:function(){return ID},Path:function(){return i.Path},Placeholder:function(){return PD},Polygon:function(){return i.Polygon},Popover:function(){return If},QueryControls:function(){return $D},RadioControl:function(){return YD},RangeControl:function(){return jy},Rect:function(){return i.Rect},ResizableBox:function(){return OA},ResponsiveWrapper:function(){return DA},SVG:function(){return i.SVG},SandBox:function(){return zA},ScrollLock:function(){return sd},SearchControl:function(){return hO},SelectControl:function(){return dy},Slot:function(){return mf},SlotFillProvider:function(){return hf},Snackbar:function(){return FA},SnackbarList:function(){return HA},Spinner:function(){return qA},TabPanel:function(){return ZA},TabbableContainer:function(){return lO},TextControl:function(){return QA},TextHighlight:function(){return aL},TextareaControl:function(){return iL},TimePicker:function(){return $I},Tip:function(){return lL},ToggleControl:function(){return cL},Toolbar:function(){return kL},ToolbarButton:function(){return bL},ToolbarDropdownMenu:function(){return SL},ToolbarGroup:function(){return xL},ToolbarItem:function(){return gL},Tooltip:function(){return zf},TreeSelect:function(){return LD},VisuallyHidden:function(){return ed},__experimentalAlignmentMatrixControl:function(){return Em},__experimentalApplyValueToSides:function(){return sC},__experimentalBorderBoxControl:function(){return LE},__experimentalBorderControl:function(){return bE},__experimentalBoxControl:function(){return TC},__experimentalConfirmDialog:function(){return vT},__experimentalDimensionControl:function(){return XI},__experimentalDivider:function(){return _k},__experimentalDropdownContentWrapper:function(){return G_},__experimentalElevation:function(){return PC},__experimentalGrid:function(){return xE},__experimentalHStack:function(){return Uv},__experimentalHasSplitBorders:function(){return RE},__experimentalHeading:function(){return $_},__experimentalInputControl:function(){return Iv},__experimentalInputControlPrefixWrapper:function(){return tO},__experimentalInputControlSuffixWrapper:function(){return ny},__experimentalIsDefinedBorder:function(){return NE},__experimentalIsEmptyBorder:function(){return TE},__experimentalItem:function(){return eO},__experimentalItemGroup:function(){return Uk},__experimentalNavigation:function(){return IO},__experimentalNavigationBackButton:function(){return OO},__experimentalNavigationGroup:function(){return LO},__experimentalNavigationItem:function(){return UO},__experimentalNavigationMenu:function(){return XO},__experimentalNavigatorBackButton:function(){return gD},__experimentalNavigatorButton:function(){return mD},__experimentalNavigatorProvider:function(){return lD},__experimentalNavigatorScreen:function(){return fD},__experimentalNavigatorToParentButton:function(){return vD},__experimentalNumberControl:function(){return Zv},__experimentalPaletteEdit:function(){return XS},__experimentalParseQuantityAndUnitFromRawValue:function(){return aE},__experimentalRadio:function(){return UD},__experimentalRadioGroup:function(){return GD},__experimentalScrollable:function(){return hk},__experimentalSpacer:function(){return qv},__experimentalStyleProvider:function(){return of},__experimentalSurface:function(){return KA},__experimentalText:function(){return Rh},__experimentalToggleGroupControl:function(){return vP},__experimentalToggleGroupControlOption:function(){return DP},__experimentalToggleGroupControlOptionIcon:function(){return dL},__experimentalToolbarContext:function(){return hL},__experimentalToolsPanel:function(){return UL},__experimentalToolsPanelContext:function(){return zL},__experimentalToolsPanelItem:function(){return GL},__experimentalTreeGrid:function(){return JL},__experimentalTreeGridCell:function(){return nz},__experimentalTreeGridItem:function(){return tz},__experimentalTreeGridRow:function(){return QL},__experimentalTruncate:function(){return j_},__experimentalUnitControl:function(){return mE},__experimentalUseCustomUnits:function(){return lE},__experimentalUseNavigator:function(){return pD},__experimentalUseSlot:function(){return Fd},__experimentalUseSlotFills:function(){return iz},__experimentalVStack:function(){return H_},__experimentalView:function(){return Qu},__experimentalZStack:function(){return dz},__unstableAnimatePresence:function(){return Om},__unstableComposite:function(){return fm},__unstableCompositeGroup:function(){return hm},__unstableCompositeItem:function(){return Se},__unstableDisclosureContent:function(){return Nx},__unstableGetAnimateClassName:function(){return km},__unstableMotion:function(){return Gl},__unstableUseAutocompleteProps:function(){return hb},__unstableUseCompositeState:function(){return rm},__unstableUseNavigateRegions:function(){return pz},createSlotFill:function(){return gf},navigateRegions:function(){return mz},privateApis:function(){return kz},useBaseControlProps:function(){return vb},withConstrainedTabbing:function(){return hz},withFallbackStyles:function(){return gz},withFilters:function(){return bz},withFocusOutside:function(){return iT},withFocusReturn:function(){return yz},withNotices:function(){return xz},withSpokenMessages:function(){return GO}});var e={};n.r(e),n.d(e,{Text:function(){return mh},block:function(){return hh},destructive:function(){return vh},highlighterText:function(){return yh},muted:function(){return bh},positive:function(){return gh},upperCase:function(){return wh}});var t={};n.r(t),n.d(t,{TooltipContent:function(){return Lx},TooltipPopoverView:function(){return zx},TooltipShortcut:function(){return Fx},noOutline:function(){return Bx}});var o={};n.r(o),n.d(o,{ButtonContentView:function(){return TP},LabelView:function(){return _P},buttonView:function(){return CP},labelBlock:function(){return EP}});var i=window.wp.primitives;function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}var b=n(9196),y=n.n(b);function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _(e){for(var t=1;t=0||(o[n]=e[n]);return o}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}var S=(0,b.createContext)({});var T,N=function(e,t,n){void 0===n&&(n=t.children);var r=(0,b.useContext)(S);if(r.useCreateElement)return r.useCreateElement(e,t,n);if("string"==typeof e&&function(e){return"function"==typeof e}(n)){t.children;return n(E(t,["children"]))}return(0,b.createElement)(e,t,n)};function R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t=0?n[a]=e[a]:r[a]=e[a]}return[n,r]}function D(e,t){if(void 0===t&&(t=[]),!P(e.state))return O(e,t);var n=O(e,[].concat(t,["state"])),r=n[0],o=n[1],i=r.state,a=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(r,["state"]);return[M(M({},i),a),o]}function A(e,t){if(e===t)return!0;if(!e)return!1;if(!t)return!1;if("object"!=typeof e)return!1;if("object"!=typeof t)return!1;var n=Object.keys(e),r=Object.keys(t),o=n.length;if(r.length!==o)return!1;for(var i=0,a=n;i0||t.offsetHeight>0||e.getClientRects().length>0}(e)}var re=F({name:"Role",keys:["unstable_system"],propsAreEqual:function(e,t){var n=e.unstable_system,r=h(e,["unstable_system"]),o=t.unstable_system,i=h(t,["unstable_system"]);return!(n!==o&&!A(n,o))&&A(r,i)}}),oe=(z({as:"div",useHook:re}),ee("Mac")&&!ee("Chrome")&&(ee("Safari")||ee("Firefox")));function ie(e){!X(e)&&ne(e)&&e.focus()}function ae(e,t,n,r){return e?t&&!n?-1:void 0:t?r:r||0}function se(e,t){return(0,b.useCallback)((function(n){var r;null===(r=e.current)||void 0===r||r.call(e,n),n.defaultPrevented||t&&(n.stopPropagation(),n.preventDefault())}),[e,t])}var le=F({name:"Tabbable",compose:re,keys:["disabled","focusable"],useOptions:function(e,t){return m({disabled:t.disabled},e)},useProps:function(e,t){var n=t.ref,r=t.tabIndex,o=t.onClickCapture,i=t.onMouseDownCapture,a=t.onMouseDown,s=t.onKeyPressCapture,l=t.style,c=h(t,["ref","tabIndex","onClickCapture","onMouseDownCapture","onMouseDown","onKeyPressCapture","style"]),u=(0,b.useRef)(null),d=G(o),f=G(i),p=G(a),g=G(s),v=!!e.disabled&&!e.focusable,y=(0,b.useState)(!0),w=y[0],x=y[1],_=(0,b.useState)(!0),E=_[0],C=_[1],k=e.disabled?m({pointerEvents:"none"},l):l;U((function(){var e=u.current;e&&(["BUTTON","INPUT","SELECT","TEXTAREA","A"].includes(e.tagName)||x(!1),function(e){return["BUTTON","INPUT","SELECT","TEXTAREA"].includes(e.tagName)}(e)||C(!1))}),[]);var S=se(d,e.disabled),T=se(f,e.disabled),N=se(g,e.disabled),R=(0,b.useCallback)((function(e){var t;null===(t=p.current)||void 0===t||t.call(p,e);var n=e.currentTarget;if(!e.defaultPrevented&&oe&&!Z(e)&&Q(n)){var r=requestAnimationFrame((function(){n.removeEventListener("mouseup",o,!0),ie(n)})),o=function(){cancelAnimationFrame(r),ie(n)};n.addEventListener("mouseup",o,{once:!0,capture:!0})}}),[]);return m({ref:H(u,n),style:k,tabIndex:ae(v,w,E,r),disabled:!(!v||!E)||void 0,"aria-disabled":!!e.disabled||void 0,onClickCapture:S,onMouseDownCapture:T,onMouseDown:R,onKeyPressCapture:N},c)}});z({as:"div",useHook:le});var ce=F({name:"Clickable",compose:le,keys:["unstable_clickOnEnter","unstable_clickOnSpace"],useOptions:function(e){var t=e.unstable_clickOnEnter,n=void 0===t||t,r=e.unstable_clickOnSpace;return m({unstable_clickOnEnter:n,unstable_clickOnSpace:void 0===r||r},h(e,["unstable_clickOnEnter","unstable_clickOnSpace"]))},useProps:function(e,t){var n=t.onKeyDown,r=t.onKeyUp,o=h(t,["onKeyDown","onKeyUp"]),i=(0,b.useState)(!1),a=i[0],s=i[1],l=G(n),c=G(r),u=(0,b.useCallback)((function(t){var n;if(null===(n=l.current)||void 0===n||n.call(l,t),!t.defaultPrevented&&!e.disabled&&!t.metaKey&&Y(t)){var r=e.unstable_clickOnEnter&&"Enter"===t.key,o=e.unstable_clickOnSpace&&" "===t.key;if(r||o){if(function(e){var t=e.currentTarget;return!!e.isTrusted&&(Q(t)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||"A"===t.tagName||"SELECT"===t.tagName)}(t))return;t.preventDefault(),r?t.currentTarget.click():o&&s(!0)}}}),[e.disabled,e.unstable_clickOnEnter,e.unstable_clickOnSpace]),d=(0,b.useCallback)((function(t){var n;if(null===(n=c.current)||void 0===n||n.call(c,t),!t.defaultPrevented&&!e.disabled&&!t.metaKey){var r=e.unstable_clickOnSpace&&" "===t.key;a&&r&&(s(!1),t.currentTarget.click())}}),[e.disabled,e.unstable_clickOnSpace,a]);return m({"data-active":a||void 0,onKeyDown:u,onKeyUp:d},o)}});z({as:"button",memo:!0,useHook:ce});function ue(e,t){return t?e.find((function(e){return!e.disabled&&e.id!==t})):e.find((function(e){return!e.disabled}))}function de(e,t){var n;return t||null===t?t:e.currentId||null===e.currentId?e.currentId:null===(n=ue(e.items||[]))||void 0===n?void 0:n.id}var fe=["baseId","unstable_idCountRef","setBaseId","unstable_virtual","rtl","orientation","items","groups","currentId","loop","wrap","shift","unstable_moves","unstable_hasActiveWidget","unstable_includesBaseElement","registerItem","unregisterItem","registerGroup","unregisterGroup","move","next","previous","up","down","first","last","sort","unstable_setVirtual","setRTL","setOrientation","setCurrentId","setLoop","setWrap","setShift","reset","unstable_setIncludesBaseElement","unstable_setHasActiveWidget"],pe=fe,me=pe;function he(e){e.userFocus=!0,e.focus(),e.userFocus=!1}function ge(e,t){e.userFocus=t}function ve(e){try{var t=e instanceof HTMLInputElement&&null!==e.selectionStart,n="TEXTAREA"===e.tagName,r="true"===e.contentEditable;return t||n||r||!1}catch(e){return!1}}function be(e){var t=q(e);if(!t)return!1;if(t===e)return!0;var n=t.getAttribute("aria-activedescendant");return!!n&&n===e.id}function ye(e){return void 0===e&&(e="id"),(e?e+"-":"")+Math.random().toString(32).substr(2,6)}var we=(0,b.createContext)(ye);var xe=F({keys:[].concat(["baseId","unstable_idCountRef","setBaseId"],["id"]),useOptions:function(e,t){var n=(0,b.useContext)(we),r=(0,b.useState)((function(){return e.unstable_idCountRef?(e.unstable_idCountRef.current+=1,"-"+e.unstable_idCountRef.current):e.baseId?"-"+n(""):""}))[0],o=(0,b.useMemo)((function(){return e.baseId||n()}),[e.baseId,n]),i=t.id||e.id||""+o+r;return m(m({},e),{},{id:i})},useProps:function(e,t){return m({id:e.id},t)}});z({as:"div",useHook:xe});function _e(e,t,n){if("function"==typeof Event)return new Event(t,n);var r=j(e).createEvent("Event");return r.initEvent(t,null==n?void 0:n.bubbles,null==n?void 0:n.cancelable),r}function Ee(e,t){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){var n,r=Object.getPrototypeOf(e),o=null===(n=Object.getOwnPropertyDescriptor(r,"value"))||void 0===n?void 0:n.set;o&&(o.call(e,t),function(e,t,n){e.dispatchEvent(_e(e,t,n))}(e,"input",{bubbles:!0}))}}function Ce(e){return e.querySelector("[data-composite-item-widget]")}var ke=F({name:"CompositeItem",compose:[ce,xe],keys:me,propsAreEqual:function(e,t){if(!t.id||e.id!==t.id)return ce.unstable_propsAreEqual(e,t);var n=e.currentId,r=e.unstable_moves,o=h(e,["currentId","unstable_moves"]),i=t.currentId,a=t.unstable_moves,s=h(t,["currentId","unstable_moves"]);if(i!==n){if(t.id===i||t.id===n)return!1}else if(r!==a)return!1;return ce.unstable_propsAreEqual(o,s)},useOptions:function(e){return m(m({},e),{},{id:e.id,currentId:de(e),unstable_clickOnSpace:!e.unstable_hasActiveWidget&&e.unstable_clickOnSpace})},useProps:function(e,t){var n,r=t.ref,o=t.tabIndex,i=void 0===o?0:o,a=t.onMouseDown,s=t.onFocus,l=t.onBlurCapture,c=t.onKeyDown,u=t.onClick,d=h(t,["ref","tabIndex","onMouseDown","onFocus","onBlurCapture","onKeyDown","onClick"]),f=(0,b.useRef)(null),p=e.id,g=e.disabled&&!e.focusable,y=e.currentId===p,w=G(y),x=(0,b.useRef)(!1),_=function(e){return(0,b.useMemo)((function(){var t;return null===(t=e.items)||void 0===t?void 0:t.find((function(t){return e.id&&t.id===e.id}))}),[e.items,e.id])}(e),E=G(a),C=G(s),k=G(l),S=G(c),T=G(u),N=!e.unstable_virtual&&!e.unstable_hasActiveWidget&&y||!(null!==(n=e.items)&&void 0!==n&&n.length);(0,b.useEffect)((function(){var t;if(p)return null===(t=e.registerItem)||void 0===t||t.call(e,{id:p,ref:f,disabled:!!g}),function(){var t;null===(t=e.unregisterItem)||void 0===t||t.call(e,p)}}),[p,g,e.registerItem,e.unregisterItem]),(0,b.useEffect)((function(){var t=f.current;t&&e.unstable_moves&&w.current&&he(t)}),[e.unstable_moves]);var R=(0,b.useCallback)((function(e){var t;null===(t=E.current)||void 0===t||t.call(E,e),ge(e.currentTarget,!0)}),[]),I=(0,b.useCallback)((function(t){var n,r,o=!!t.currentTarget.userFocus;if(ge(t.currentTarget,!1),null===(n=C.current)||void 0===n||n.call(C,t),!t.defaultPrevented&&!Z(t)&&p&&!function(e,t){if(Y(e))return!1;for(var n,r=v(t);!(n=r()).done;)if(n.value.ref.current===e.target)return!0;return!1}(t,e.items)&&(null===(r=e.setCurrentId)||void 0===r||r.call(e,p),o&&e.unstable_virtual&&e.baseId&&Y(t))){var i=j(t.target).getElementById(e.baseId);i&&(x.current=!0,function(e,t){var n=void 0===t?{}:t,r=n.preventScroll,o=n.isActive,i=void 0===o?be:o;i(e)||(e.focus({preventScroll:r}),i(e)||requestAnimationFrame((function(){e.focus({preventScroll:r})})))}(i))}}),[p,e.items,e.setCurrentId,e.unstable_virtual,e.baseId]),M=(0,b.useCallback)((function(t){var n;null===(n=k.current)||void 0===n||n.call(k,t),t.defaultPrevented||e.unstable_virtual&&x.current&&(x.current=!1,t.preventDefault(),t.stopPropagation())}),[e.unstable_virtual]),P=(0,b.useCallback)((function(t){var n;if(Y(t)){var r="horizontal"!==e.orientation,o="vertical"!==e.orientation,i=!(null==_||!_.groupId),a={ArrowUp:(i||r)&&e.up,ArrowRight:(i||o)&&e.next,ArrowDown:(i||r)&&e.down,ArrowLeft:(i||o)&&e.previous,Home:function(){var n,r;!i||t.ctrlKey?null===(n=e.first)||void 0===n||n.call(e):null===(r=e.previous)||void 0===r||r.call(e,!0)},End:function(){var n,r;!i||t.ctrlKey?null===(n=e.last)||void 0===n||n.call(e):null===(r=e.next)||void 0===r||r.call(e,!0)},PageUp:function(){var t,n;i?null===(t=e.up)||void 0===t||t.call(e,!0):null===(n=e.first)||void 0===n||n.call(e)},PageDown:function(){var t,n;i?null===(t=e.down)||void 0===t||t.call(e,!0):null===(n=e.last)||void 0===n||n.call(e)}}[t.key];if(a)return t.preventDefault(),void a();if(null===(n=S.current)||void 0===n||n.call(S,t),!t.defaultPrevented)if(1===t.key.length&&" "!==t.key){var s=Ce(t.currentTarget);s&&ve(s)&&(s.focus(),Ee(s,""))}else if("Delete"===t.key||"Backspace"===t.key){var l=Ce(t.currentTarget);l&&ve(l)&&(t.preventDefault(),Ee(l,""))}}}),[e.orientation,_,e.up,e.next,e.down,e.previous,e.first,e.last]),O=(0,b.useCallback)((function(e){var t;if(null===(t=T.current)||void 0===t||t.call(T,e),!e.defaultPrevented){var n=Ce(e.currentTarget);n&&!X(n)&&n.focus()}}),[]);return m({ref:H(f,r),id:p,tabIndex:N?i:-1,"aria-selected":!(!e.unstable_virtual||!y)||void 0,onMouseDown:R,onFocus:I,onBlurCapture:M,onKeyDown:P,onClick:O},d)}}),Se=z({as:"button",memo:!0,useHook:ke});function Te(e){return e.split("-")[1]}function Ne(e){return"y"===e?"height":"width"}function Re(e){return e.split("-")[0]}function Ie(e){return["top","bottom"].includes(Re(e))?"x":"y"}function Me(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,a=r.y+r.height/2-o.height/2,s=Ie(t),l=Ne(s),c=r[l]/2-o[l]/2,u="x"===s;let d;switch(Re(t)){case"top":d={x:i,y:r.y-o.height};break;case"bottom":d={x:i,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-o.width,y:a};break;default:d={x:r.x,y:r.y}}switch(Te(t)){case"start":d[s]-=c*(n&&u?-1:1);break;case"end":d[s]+=c*(n&&u?-1:1)}return d}const Pe=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Me(c,r,l),f=r,p={},m=0;for(let n=0;n({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e||{},{x:o,y:i,placement:a,rects:s,platform:l,elements:c}=t;if(null==n)return{};const u=Oe(r),d={x:o,y:i},f=Ie(a),p=Ne(f),m=await l.getDimensions(n),h="y"===f,g=h?"top":"left",v=h?"bottom":"right",b=h?"clientHeight":"clientWidth",y=s.reference[p]+s.reference[f]-d[f]-s.floating[p],w=d[f]-s.reference[f],x=await(null==l.getOffsetParent?void 0:l.getOffsetParent(n));let _=x?x[b]:0;_&&await(null==l.isElement?void 0:l.isElement(x))||(_=c.floating[b]||s.floating[p]);const E=y/2-w/2,C=u[g],k=_-m[p]-u[v],S=_/2-m[p]/2+E,T=Be(C,S,k),N=null!=Te(a)&&S!=T&&s.reference[p]/2-(Se.concat(t,t+"-start",t+"-end")),[]),{left:"right",right:"left",bottom:"top",top:"bottom"});function je(e){return e.replace(/left|right|bottom|top/g,(e=>He[e]))}function $e(e,t,n){void 0===n&&(n=!1);const r=Te(e),o=Ie(e),i=Ne(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=je(a)),{main:a,cross:je(a)}}const We={start:"end",end:"start"};function Ue(e){return e.replace(/start|end/g,(e=>We[e]))}const Ge=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...h}=e,g=Re(r),v=Re(a)===a,b=await(null==s.isRTL?void 0:s.isRTL(l.floating)),y=d||(v||!m?[je(a)]:function(e){const t=je(e);return[Ue(e),t,Ue(t)]}(a));d||"none"===p||y.push(...function(e,t,n,r){const o=Te(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}(Re(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(Ue)))),i}(a,m,p,b));const w=[a,...y],x=await Ae(t,h),_=[];let E=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&_.push(x[g]),u){const{main:e,cross:t}=$e(r,i,b);_.push(x[e],x[t])}if(E=[...E,{placement:r,overflows:_}],!_.every((e=>e<=0))){var C,k;const e=((null==(C=o.flip)?void 0:C.index)||0)+1,t=w[e];if(t)return{data:{index:e,overflows:E},reset:{placement:t}};let n=null==(k=E.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:k.placement;if(!n)switch(f){case"bestFit":{var S;const e=null==(S=E.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:S[0];e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const Ye=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=Re(n),s=Te(n),l="x"===Ie(n),c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d="function"==typeof t?t(e):t;let{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof m&&(p="end"===s?-1*m:m),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function qe(e){return"x"===e?"y":"x"}const Ke=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=e,c={x:n,y:r},u=await Ae(t,l),d=Ie(Re(o)),f=qe(d);let p=c[d],m=c[f];if(i){const e="y"===d?"bottom":"right";p=Be(p+u["y"===d?"top":"left"],p,p-u[e])}if(a){const e="y"===f?"bottom":"right";m=Be(m+u["y"===f?"top":"left"],m,m-u[e])}const h=s.fn({...t,[d]:p,[f]:m});return{...h,data:{x:h.x-n,y:h.y-r}}}}},Xe=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:a=(()=>{}),...s}=e,l=await Ae(t,s),c=Re(n),u=Te(n),d="x"===Ie(n),{width:f,height:p}=r.floating;let m,h;"top"===c||"bottom"===c?(m=c,h=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(h=c,m="end"===u?"top":"bottom");const g=p-l[m],v=f-l[h],b=!t.middlewareData.shift;let y=g,w=v;if(d){const e=f-l.left-l.right;w=u||b?Le(v,e):e}else{const e=p-l.top-l.bottom;y=u||b?Le(g,e):e}if(b&&!u){const e=ze(l.left,0),t=ze(l.right,0),n=ze(l.top,0),r=ze(l.bottom,0);d?w=f-2*(0!==e||0!==t?e+t:ze(l.left,l.right)):y=p-2*(0!==n||0!==r?n+r:ze(l.top,l.bottom))}await a({...t,availableWidth:w,availableHeight:y});const x=await o.getDimensions(i.floating);return f!==x.width||p!==x.height?{reset:{rects:!0}}:{}}}};function Ze(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Je(e){return Ze(e).getComputedStyle(e)}function Qe(e){return e instanceof Ze(e).Node}function et(e){return Qe(e)?(e.nodeName||"").toLowerCase():""}let tt;function nt(){if(tt)return tt;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(tt=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),tt):navigator.userAgent}function rt(e){return e instanceof Ze(e).HTMLElement}function ot(e){return e instanceof Ze(e).Element}function it(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Ze(e).ShadowRoot||e instanceof ShadowRoot)}function at(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Je(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function st(e){return["table","td","th"].includes(et(e))}function lt(e){const t=/firefox/i.test(nt()),n=Je(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function ct(){return/^((?!chrome|android).)*safari/i.test(nt())}function ut(e){return["html","body","#document"].includes(et(e))}const dt=Math.min,ft=Math.max,pt=Math.round;function mt(e){const t=Je(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=rt(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=pt(n)!==i||pt(r)!==a;return s&&(n=i,r=a),{width:n,height:r,fallback:s}}function ht(e){return ot(e)?e:e.contextElement}const gt={x:1,y:1};function vt(e){const t=ht(e);if(!rt(t))return gt;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=mt(t);let a=(i?pt(n.width):n.width)/r,s=(i?pt(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}function bt(e,t,n,r){var o,i;void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect(),s=ht(e);let l=gt;t&&(r?ot(r)&&(l=vt(r)):l=vt(e));const c=s?Ze(s):window,u=ct()&&n;let d=(a.left+(u&&(null==(o=c.visualViewport)?void 0:o.offsetLeft)||0))/l.x,f=(a.top+(u&&(null==(i=c.visualViewport)?void 0:i.offsetTop)||0))/l.y,p=a.width/l.x,m=a.height/l.y;if(s){const e=Ze(s),t=r&&ot(r)?Ze(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=vt(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,d*=e.x,f*=e.y,p*=e.x,m*=e.y,d+=t.x,f+=t.y,n=Ze(n).frameElement}}return De({width:p,height:m,x:d,y:f})}function yt(e){return((Qe(e)?e.ownerDocument:e.document)||window.document).documentElement}function wt(e){return ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function xt(e){return bt(yt(e)).left+wt(e).scrollLeft}function _t(e){if("html"===et(e))return e;const t=e.assignedSlot||e.parentNode||it(e)&&e.host||yt(e);return it(t)?t.host:t}function Et(e){const t=_t(e);return ut(t)?t.ownerDocument.body:rt(t)&&at(t)?t:Et(t)}function Ct(e,t){var n;void 0===t&&(t=[]);const r=Et(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=Ze(r);return o?t.concat(i,i.visualViewport||[],at(r)?r:[]):t.concat(r,Ct(r))}function kt(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Ze(e),r=yt(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=ct();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=yt(e),n=wt(e),r=e.ownerDocument.body,o=ft(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ft(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+xt(e);const s=-n.scrollTop;return"rtl"===Je(r).direction&&(a+=ft(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(yt(e));else if(ot(t))r=function(e,t){const n=bt(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=rt(e)?vt(e):{x:1,y:1};return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n={...t};if(ct()){var o,i;const t=Ze(e);n.x-=(null==(o=t.visualViewport)?void 0:o.offsetLeft)||0,n.y-=(null==(i=t.visualViewport)?void 0:i.offsetTop)||0}r=n}return De(r)}function St(e,t){const n=_t(e);return!(n===t||!ot(n)||ut(n))&&("fixed"===Je(n).position||St(n,t))}function Tt(e,t){return rt(e)&&"fixed"!==Je(e).position?t?t(e):e.offsetParent:null}function Nt(e,t){const n=Ze(e);if(!rt(e))return n;let r=Tt(e,t);for(;r&&st(r)&&"static"===Je(r).position;)r=Tt(r,t);return r&&("html"===et(r)||"body"===et(r)&&"static"===Je(r).position&&!lt(r))?n:r||function(e){let t=_t(e);for(;rt(t)&&!ut(t);){if(lt(t))return t;t=_t(t)}return null}(e)||n}function Rt(e,t,n){const r=rt(t),o=yt(t),i=bt(e,!0,"fixed"===n,t);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==et(t)||at(o))&&(a=wt(t)),rt(t)){const e=bt(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=xt(o));return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}const It={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=Ct(e).filter((e=>ot(e)&&"body"!==et(e))),o=null;const i="fixed"===Je(e).position;let a=i?_t(e):e;for(;ot(a)&&!ut(a);){const t=Je(a),n=lt(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||at(a)&&!n&&St(e,a))?r=r.filter((e=>e!==a)):o=t,a=_t(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],s=a[0],l=a.reduce(((e,n)=>{const r=kt(t,n,o);return e.top=ft(r.top,e.top),e.right=dt(r.right,e.right),e.bottom=dt(r.bottom,e.bottom),e.left=ft(r.left,e.left),e}),kt(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=rt(n),i=yt(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0},s={x:1,y:1};const l={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==et(n)||at(i))&&(a=wt(n)),rt(n))){const e=bt(n);s=vt(n),l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}},isElement:ot,getDimensions:function(e){return mt(e)},getOffsetParent:Nt,getDocumentElement:yt,getScale:vt,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||Nt,i=this.getDimensions;return{reference:Rt(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===Je(e).direction};var Mt=window.ReactDOM,Pt="undefined"!=typeof document?b.useLayoutEffect:b.useEffect;function Ot(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)if(!Ot(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Ot(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Dt(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:o}=void 0===e?{}:e;const[i,a]=b.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[s,l]=b.useState(t);Ot(null==s?void 0:s.map((e=>{let{name:t,options:n}=e;return{name:t,options:n}})),null==t?void 0:t.map((e=>{let{name:t,options:n}=e;return{name:t,options:n}})))||l(t);const c=b.useRef(null),u=b.useRef(null),d=b.useRef(null),f=b.useRef(i),p=function(e){const t=b.useRef(e);return Pt((()=>{t.current=e})),t}(o),m=b.useCallback((()=>{c.current&&u.current&&((e,t,n)=>{const r=new Map,o={platform:It,...n},i={...o.platform,_c:r};return Pe(e,t,{...o,platform:i})})(c.current,u.current,{middleware:s,placement:n,strategy:r}).then((e=>{h.current&&!Ot(f.current,e)&&(f.current=e,Mt.flushSync((()=>{a(e)})))}))}),[s,n,r]);Pt((()=>{h.current&&m()}),[m]);const h=b.useRef(!1);Pt((()=>(h.current=!0,()=>{h.current=!1})),[]);const g=b.useCallback((()=>{if("function"==typeof d.current&&(d.current(),d.current=null),c.current&&u.current)if(p.current){const e=p.current(c.current,u.current,m);d.current=e}else m()}),[m,p]),v=b.useCallback((e=>{c.current=e,g()}),[g]),y=b.useCallback((e=>{u.current=e,g()}),[g]),w=b.useMemo((()=>({reference:c,floating:u})),[]);return b.useMemo((()=>({...i,update:m,refs:w,reference:v,floating:y})),[i,m,w,v,y])}const At=e=>{const{element:t,padding:n}=e;return{name:"arrow",options:e,fn(e){return r=t,Object.prototype.hasOwnProperty.call(r,"current")?null!=t.current?Fe({element:t.current,padding:n}).fn(e):{}:t?Fe({element:t,padding:n}).fn(e):{};var r}}},Lt="undefined"!=typeof document,zt={current:null},Bt={current:!1};function Ft(){if(Bt.current=!0,Lt)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>zt.current=e.matches;e.addListener(t),t()}else zt.current=!1}const Vt=(0,b.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Ht=(0,b.createContext)({});const jt=(0,b.createContext)(null),$t=Lt?b.useLayoutEffect:b.useEffect,Wt=(0,b.createContext)({strict:!1});function Ut(e,t,n,r){const o=(0,b.useContext)(Ht).visualElement,i=(0,b.useContext)(Wt),a=(0,b.useContext)(jt),s=(0,b.useContext)(Vt).reducedMotion,l=(0,b.useRef)();r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:o,props:n,presenceId:a?a.id:void 0,blockInitialAnimation:!!a&&!1===a.initial,reducedMotionConfig:s}));const c=l.current;return $t((()=>{c&&c.render()})),$t((()=>{c&&c.animationState&&c.animationState.animateChanges()})),$t((()=>()=>c&&c.notify("Unmount")),[]),c}function Gt(e){return"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function Yt(e){return"string"==typeof e||Array.isArray(e)}function qt(e){return"object"==typeof e&&"function"==typeof e.start}const Kt=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function Xt(e){return qt(e.animate)||Kt.some((t=>Yt(e[t])))}function Zt(e){return Boolean(Xt(e)||e.variants)}function Jt(e){const{initial:t,animate:n}=function(e,t){if(Xt(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Yt(t)?t:void 0,animate:Yt(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,b.useContext)(Ht));return(0,b.useMemo)((()=>({initial:t,animate:n})),[Qt(t),Qt(n)])}function Qt(e){return Array.isArray(e)?e.join(" "):e}const en=e=>({isEnabled:t=>e.some((e=>!!t[e]))}),tn={measureLayout:en(["layout","layoutId","drag"]),animation:en(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:en(["exit"]),drag:en(["drag","dragControls"]),focus:en(["whileFocus"]),hover:en(["whileHover","onHoverStart","onHoverEnd"]),tap:en(["whileTap","onTap","onTapStart","onTapCancel"]),pan:en(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:en(["whileInView","onViewportEnter","onViewportLeave"])};function nn(e){const t=(0,b.useRef)(null);return null===t.current&&(t.current=e()),t.current}const rn={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let on=1;const an=(0,b.createContext)({});class sn extends b.Component{getSnapshotBeforeUpdate(){const{visualElement:e,props:t}=this.props;return e&&e.setProps(t),null}componentDidUpdate(){}render(){return this.props.children}}const ln=(0,b.createContext)({}),cn=Symbol.for("motionComponentSymbol");function un({preloadedFeatures:e,createVisualElement:t,projectionNodeConstructor:n,useRender:r,useVisualState:o,Component:i}){e&&function(e){for(const t in e)"projectionNodeConstructor"===t?tn.projectionNodeConstructor=e[t]:tn[t].Component=e[t]}(e);const a=(0,b.forwardRef)((function(a,s){const l={...(0,b.useContext)(Vt),...a,layoutId:dn(a)},{isStatic:c}=l;let u=null;const d=Jt(a),f=c?void 0:nn((()=>{if(rn.hasEverUpdated)return on++})),p=o(a,c);if(!c&&Lt){d.visualElement=Ut(i,p,l,t);const r=(0,b.useContext)(Wt).strict,o=(0,b.useContext)(ln);d.visualElement&&(u=d.visualElement.loadFeatures(l,r,e,f,n||tn.projectionNodeConstructor,o))}return b.createElement(sn,{visualElement:d.visualElement,props:l},u,b.createElement(Ht.Provider,{value:d},r(i,a,f,function(e,t,n){return(0,b.useCallback)((r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):Gt(n)&&(n.current=r))}),[t])}(p,d.visualElement,s),p,c,d.visualElement)))}));return a[cn]=i,a}function dn({layoutId:e}){const t=(0,b.useContext)(an).id;return t&&void 0!==e?t+"-"+e:e}function fn(e){function t(t,n={}){return un(e(t,n))}if("undefined"==typeof Proxy)return t;const n=new Map;return new Proxy(t,{get:(e,r)=>(n.has(r)||n.set(r,t(r)),n.get(r))})}const pn=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function mn(e){return"string"==typeof e&&!e.includes("-")&&!!(pn.indexOf(e)>-1||/[A-Z]/.test(e))}const hn={};const gn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],vn=new Set(gn);function bn(e,{layout:t,layoutId:n}){return vn.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!hn[e]||"opacity"===e)}const yn=e=>!!(null==e?void 0:e.getVelocity),wn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},xn=(e,t)=>gn.indexOf(e)-gn.indexOf(t);function _n(e){return e.startsWith("--")}const En=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Cn=(e,t,n)=>Math.min(Math.max(n,e),t),kn={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Sn={...kn,transform:e=>Cn(0,1,e)},Tn={...kn,default:1},Nn=e=>Math.round(1e5*e)/1e5,Rn=/(-)?([\d]*\.?[\d])+/g,In=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Mn=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Pn(e){return"string"==typeof e}const On=e=>({test:t=>Pn(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Dn=On("deg"),An=On("%"),Ln=On("px"),zn=On("vh"),Bn=On("vw"),Fn={...An,parse:e=>An.parse(e)/100,transform:e=>An.transform(100*e)},Vn={...kn,transform:Math.round},Hn={borderWidth:Ln,borderTopWidth:Ln,borderRightWidth:Ln,borderBottomWidth:Ln,borderLeftWidth:Ln,borderRadius:Ln,radius:Ln,borderTopLeftRadius:Ln,borderTopRightRadius:Ln,borderBottomRightRadius:Ln,borderBottomLeftRadius:Ln,width:Ln,maxWidth:Ln,height:Ln,maxHeight:Ln,size:Ln,top:Ln,right:Ln,bottom:Ln,left:Ln,padding:Ln,paddingTop:Ln,paddingRight:Ln,paddingBottom:Ln,paddingLeft:Ln,margin:Ln,marginTop:Ln,marginRight:Ln,marginBottom:Ln,marginLeft:Ln,rotate:Dn,rotateX:Dn,rotateY:Dn,rotateZ:Dn,scale:Tn,scaleX:Tn,scaleY:Tn,scaleZ:Tn,skew:Dn,skewX:Dn,skewY:Dn,distance:Ln,translateX:Ln,translateY:Ln,translateZ:Ln,x:Ln,y:Ln,z:Ln,perspective:Ln,transformPerspective:Ln,opacity:Sn,originX:Fn,originY:Fn,originZ:Ln,zIndex:Vn,fillOpacity:Sn,strokeOpacity:Sn,numOctaves:Vn};function jn(e,t,n,r){const{style:o,vars:i,transform:a,transformKeys:s,transformOrigin:l}=e;s.length=0;let c=!1,u=!1,d=!0;for(const e in t){const n=t[e];if(_n(e)){i[e]=n;continue}const r=Hn[e],f=En(n,r);if(vn.has(e)){if(c=!0,a[e]=f,s.push(e),!d)continue;n!==(r.default||0)&&(d=!1)}else e.startsWith("origin")?(u=!0,l[e]=f):o[e]=f}if(t.transform||(c||r?o.transform=function({transform:e,transformKeys:t},{enableHardwareAcceleration:n=!0,allowTransformNone:r=!0},o,i){let a="";t.sort(xn);for(const n of t)a+=`${wn[n]||n}(${e[n]}) `;return n&&!e.z&&(a+="translateZ(0)"),a=a.trim(),i?a=i(e,o?"":a):r&&o&&(a="none"),a}(e,n,d,r):o.transform&&(o.transform="none")),u){const{originX:e="50%",originY:t="50%",originZ:n=0}=l;o.transformOrigin=`${e} ${t} ${n}`}}const $n=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function Wn(e,t,n){for(const r in t)yn(t[r])||bn(r,n)||(e[r]=t[r])}function Un(e,t,n){const r={};return Wn(r,e.style||{},e),Object.assign(r,function({transformTemplate:e},t,n){return(0,b.useMemo)((()=>{const r={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return jn(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)}),[t])}(e,t,n)),e.transformValues?e.transformValues(r):r}function Gn(e,t,n){const r={},o=Un(e,t,n);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),r.style=o,r}const Yn=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function qn(e){return Yn.has(e)}let Kn=e=>!qn(e);try{(Xn=require("@emotion/is-prop-valid").default)&&(Kn=e=>e.startsWith("on")?!qn(e):Xn(e))}catch(e){}var Xn;function Zn(e,t,n){return"string"==typeof e?e:Ln.transform(t+n*e)}const Jn={offset:"stroke-dashoffset",array:"stroke-dasharray"},Qn={offset:"strokeDashoffset",array:"strokeDasharray"};function er(e,{attrX:t,attrY:n,originX:r,originY:o,pathLength:i,pathSpacing:a=1,pathOffset:s=0,...l},c,u,d){if(jn(e,l,c,d),u)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(void 0!==r||void 0!==o||p.transform)&&(p.transformOrigin=function(e,t,n){return`${Zn(t,e.x,e.width)} ${Zn(n,e.y,e.height)}`}(m,void 0!==r?r:.5,void 0!==o?o:.5)),void 0!==t&&(f.x=t),void 0!==n&&(f.y=n),void 0!==i&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?Jn:Qn;e[i.offset]=Ln.transform(-r);const a=Ln.transform(t),s=Ln.transform(n);e[i.array]=`${a} ${s}`}(f,i,a,s,!1)}const tr=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}}),nr=e=>"string"==typeof e&&"svg"===e.toLowerCase();function rr(e,t,n,r){const o=(0,b.useMemo)((()=>{const n={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return er(n,t,{enableHardwareAcceleration:!1},nr(r),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};Wn(t,e.style,e),o.style={...t,...o.style}}return o}function or(e=!1){return(t,n,r,o,{latestValues:i},a)=>{const s=(mn(t)?rr:Gn)(n,i,a,t),l=function(e,t,n){const r={};for(const o in e)(Kn(o)||!0===n&&qn(o)||!t&&!qn(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),c={...l,...s,ref:o};return r&&(c["data-projection-id"]=r),(0,b.createElement)(t,c)}}const ir=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function ar(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const t in n)e.style.setProperty(t,n[t])}const sr=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function lr(e,t,n,r){ar(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(sr.has(n)?n:ir(n),t.attrs[n])}function cr(e){const{style:t}=e,n={};for(const r in t)(yn(t[r])||bn(r,e))&&(n[r]=t[r]);return n}function ur(e){const t=cr(e);for(const n in e)if(yn(e[n])){t["x"===n||"y"===n?"attr"+n.toUpperCase():n]=e[n]}return t}function dr(e,t,n,r={},o={}){return"function"==typeof t&&(t=t(void 0!==n?n:e.custom,r,o)),"string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t&&(t=t(void 0!==n?n:e.custom,r,o)),t}const fr=e=>Array.isArray(e),pr=e=>fr(e)?e[e.length-1]||0:e;function mr(e){const t=yn(e)?e.get():e;return(e=>Boolean(e&&"object"==typeof e&&e.mix&&e.toValue))(t)?t.toValue():t}const hr=e=>(t,n)=>{const r=(0,b.useContext)(Ht),o=(0,b.useContext)(jt),i=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,o,i){const a={latestValues:gr(r,o,i,e),renderState:t()};return n&&(a.mount=e=>n(r,e,a)),a}(e,t,r,o);return n?i():nn(i)};function gr(e,t,n,r){const o={},i=r(e);for(const e in i)o[e]=mr(i[e]);let{initial:a,animate:s}=e;const l=Xt(e),c=Zt(e);t&&c&&!l&&!1!==e.inherit&&(void 0===a&&(a=t.initial),void 0===s&&(s=t.animate));let u=!!n&&!1===n.initial;u=u||!1===a;const d=u?s:a;if(d&&"boolean"!=typeof d&&!qt(d)){(Array.isArray(d)?d:[d]).forEach((t=>{const n=dr(e,t);if(!n)return;const{transitionEnd:r,transition:i,...a}=n;for(const e in a){let t=a[e];if(Array.isArray(t)){t=t[u?t.length-1:0]}null!==t&&(o[e]=t)}for(const e in r)o[e]=r[e]}))}return o}const vr={useVisualState:hr({scrapeMotionValuesFromProps:ur,createRenderState:tr,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){n.dimensions={x:0,y:0,width:0,height:0}}er(n,r,{enableHardwareAcceleration:!1},nr(t.tagName),e.transformTemplate),lr(t,n)}})},br={useVisualState:hr({scrapeMotionValuesFromProps:cr,createRenderState:$n})};var yr;function wr(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function xr(e,t,n,r){(0,b.useEffect)((()=>{const o=e.current;if(n&&o)return wr(o,t,n,r)}),[e,t,n,r])}function _r(e){return"undefined"!=typeof PointerEvent&&e instanceof PointerEvent?!("mouse"!==e.pointerType):e instanceof MouseEvent}function Er(e){return!!e.touches}!function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"}(yr||(yr={}));const Cr={pageX:0,pageY:0};function kr(e,t="page"){const n=e.touches[0]||e.changedTouches[0]||Cr;return{x:n[t+"X"],y:n[t+"Y"]}}function Sr(e,t="page"){return{x:e[t+"X"],y:e[t+"Y"]}}function Tr(e,t="page"){return{point:Er(e)?kr(e,t):Sr(e,t)}}const Nr=(e,t=!1)=>{const n=t=>e(t,Tr(t));return t?(r=n,e=>{const t=e instanceof MouseEvent;(!t||t&&0===e.button)&&r(e)}):n;var r},Rr={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Ir={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Mr(e){return Lt&&null===window.onpointerdown?e:Lt&&null===window.ontouchstart?Ir[e]:Lt&&null===window.onmousedown?Rr[e]:e}function Pr(e,t,n,r){return wr(e,Mr(t),Nr(n,"pointerdown"===t),r)}function Or(e,t,n,r){return xr(e,Mr(t),n&&Nr(n,"pointerdown"===t),r)}function Dr(e){let t=null;return()=>{const n=()=>{t=null};return null===t&&(t=e,n)}}const Ar=Dr("dragHorizontal"),Lr=Dr("dragVertical");function zr(e){let t=!1;if("y"===e)t=Lr();else if("x"===e)t=Ar();else{const e=Ar(),n=Lr();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function Br(){const e=zr(!0);return!e||(e(),!1)}function Fr(e,t,n){return(r,o)=>{_r(r)&&!Br()&&(e.animationState&&e.animationState.setActive(yr.Hover,t),n&&n(r,o))}}const Vr=(e,t)=>!!t&&(e===t||Vr(e,t.parentElement));function Hr(e){return(0,b.useEffect)((()=>()=>e()),[])}const jr=(e,t)=>n=>t(e(n)),$r=(...e)=>e.reduce(jr);const Wr=("undefined"==typeof process||process.env,"production"),Ur=new Set;function Gr(e,t,n){e||Ur.has(t)||(console.warn(t),n&&console.warn(n),Ur.add(t))}const Yr=new WeakMap,qr=new WeakMap,Kr=e=>{const t=Yr.get(e.target);t&&t(e)},Xr=e=>{e.forEach(Kr)};function Zr(e,t,n){const r=function({root:e,...t}){const n=e||document;qr.has(n)||qr.set(n,{});const r=qr.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Xr,{root:e,...t})),r[o]}(t);return Yr.set(e,n),r.observe(e),()=>{Yr.delete(e),r.unobserve(e)}}const Jr={some:0,all:1};function Qr(e,t,n,{root:r,margin:o,amount:i="some",once:a}){(0,b.useEffect)((()=>{if(!e||!n.current)return;const s={root:null==r?void 0:r.current,rootMargin:o,threshold:"number"==typeof i?i:Jr[i]};return Zr(n.current,s,(e=>{const{isIntersecting:r}=e;if(t.isInView===r)return;if(t.isInView=r,a&&!r&&t.hasEnteredView)return;r&&(t.hasEnteredView=!0),n.animationState&&n.animationState.setActive(yr.InView,r);const o=n.getProps(),i=r?o.onViewportEnter:o.onViewportLeave;i&&i(e)}))}),[e,r,o,i])}function eo(e,t,n,{fallback:r=!0}){(0,b.useEffect)((()=>{e&&r&&("production"!==Wr&&Gr(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame((()=>{t.hasEnteredView=!0;const{onViewportEnter:e}=n.getProps();e&&e(null),n.animationState&&n.animationState.setActive(yr.InView,!0)})))}),[e])}const to=e=>t=>(e(t),null),no={inView:to((function({visualElement:e,whileInView:t,onViewportEnter:n,onViewportLeave:r,viewport:o={}}){const i=(0,b.useRef)({hasEnteredView:!1,isInView:!1});let a=Boolean(t||n||r);o.once&&i.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?eo:Qr)(a,i.current,e,o)})),tap:to((function({onTap:e,onTapStart:t,onTapCancel:n,whileTap:r,visualElement:o}){const i=e||t||n||r,a=(0,b.useRef)(!1),s=(0,b.useRef)(null),l={passive:!(t||e||n||p)};function c(){s.current&&s.current(),s.current=null}function u(){return c(),a.current=!1,o.animationState&&o.animationState.setActive(yr.Tap,!1),!Br()}function d(t,r){u()&&(Vr(o.current,t.target)?e&&e(t,r):n&&n(t,r))}function f(e,t){u()&&n&&n(e,t)}function p(e,n){c(),a.current||(a.current=!0,s.current=$r(Pr(window,"pointerup",d,l),Pr(window,"pointercancel",f,l)),o.animationState&&o.animationState.setActive(yr.Tap,!0),t&&t(e,n))}Or(o,"pointerdown",i?p:void 0,l),Hr(c)})),focus:to((function({whileFocus:e,visualElement:t}){const{animationState:n}=t;xr(t,"focus",e?()=>{n&&n.setActive(yr.Focus,!0)}:void 0),xr(t,"blur",e?()=>{n&&n.setActive(yr.Focus,!1)}:void 0)})),hover:to((function({onHoverStart:e,onHoverEnd:t,whileHover:n,visualElement:r}){Or(r,"pointerenter",e||n?Fr(r,!0,e):void 0,{passive:!e}),Or(r,"pointerleave",t||n?Fr(r,!1,t):void 0,{passive:!t})}))};function ro(){const e=(0,b.useContext)(jt);if(null===e)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,o=(0,b.useId)();(0,b.useEffect)((()=>r(o)),[]);return!t&&n?[!1,()=>n&&n(o)]:[!0]}function oo(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r/^\-?\d*\.?\d+$/.test(e),ao=e=>/^0[^.\s]+$/.test(e),so={delta:0,timestamp:0},lo=1/60*1e3,co="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),uo="undefined"!=typeof window?e=>window.requestAnimationFrame(e):e=>setTimeout((()=>e(co())),lo);let fo=!0,po=!1,mo=!1;const ho=["read","update","preRender","render","postRender"],go=ho.reduce(((e,t)=>(e[t]=function(e){let t=[],n=[],r=0,o=!1,i=!1;const a=new WeakSet,s={schedule:(e,i=!1,s=!1)=>{const l=s&&o,c=l?t:n;return i&&a.add(e),-1===c.indexOf(e)&&(c.push(e),l&&o&&(r=t.length)),e},cancel:e=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1),a.delete(e)},process:l=>{if(o)i=!0;else{if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let n=0;npo=!0)),e)),{}),vo=ho.reduce(((e,t)=>{const n=go[t];return e[t]=(e,t=!1,r=!1)=>(po||_o(),n.schedule(e,t,r)),e}),{}),bo=ho.reduce(((e,t)=>(e[t]=go[t].cancel,e)),{}),yo=ho.reduce(((e,t)=>(e[t]=()=>go[t].process(so),e)),{}),wo=e=>go[e].process(so),xo=e=>{po=!1,so.delta=fo?lo:Math.max(Math.min(e-so.timestamp,40),1),so.timestamp=e,mo=!0,ho.forEach(wo),mo=!1,po&&(fo=!1,uo(xo))},_o=()=>{po=!0,fo=!0,mo||uo(xo)};function Eo(e,t){-1===e.indexOf(t)&&e.push(t)}function Co(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class ko{constructor(){this.subscriptions=[]}add(e){return Eo(this.subscriptions,e),()=>Co(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o{this.prev=this.current,this.current=e;const{delta:n,timestamp:r}=so;this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,vo.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>vo.postRender(this.velocityCheck),this.velocityCheck=({timestamp:e})=>{e!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=t.owner}onChange(e){return this.on("change",e)}on(e,t){return this.events[e]||(this.events[e]=new ko),this.events[e].add(t)}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e){this.passiveEffect=e}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=e,this.timeDelta=n}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?So(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.stopAnimation=e(t),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.stopAnimation&&(this.stopAnimation(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.clearListeners(),this.stop()}}function No(e,t){return new To(e,t)}const Ro=(e,t)=>n=>Boolean(Pn(n)&&Mn.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),Io=(e,t,n)=>r=>{if(!Pn(r))return r;const[o,i,a,s]=r.match(Rn);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(a),alpha:void 0!==s?parseFloat(s):1}},Mo={...kn,transform:e=>Math.round((e=>Cn(0,255,e))(e))},Po={test:Ro("rgb","red"),parse:Io("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Mo.transform(e)+", "+Mo.transform(t)+", "+Mo.transform(n)+", "+Nn(Sn.transform(r))+")"};const Oo={test:Ro("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:Po.transform},Do={test:Ro("hsl","hue"),parse:Io("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+An.transform(Nn(t))+", "+An.transform(Nn(n))+", "+Nn(Sn.transform(r))+")"},Ao={test:e=>Po.test(e)||Oo.test(e)||Do.test(e),parse:e=>Po.test(e)?Po.parse(e):Do.test(e)?Do.parse(e):Oo.parse(e),transform:e=>Pn(e)?e:e.hasOwnProperty("red")?Po.transform(e):Do.transform(e)},Lo="${c}",zo="${n}";function Bo(e){"number"==typeof e&&(e=`${e}`);const t=[];let n=0,r=0;const o=e.match(In);o&&(n=o.length,e=e.replace(In,Lo),t.push(...o.map(Ao.parse)));const i=e.match(Rn);return i&&(r=i.length,e=e.replace(Rn,zo),t.push(...i.map(kn.parse))),{values:t,numColors:n,numNumbers:r,tokenised:e}}function Fo(e){return Bo(e).values}function Vo(e){const{values:t,numColors:n,tokenised:r}=Bo(e),o=t.length;return e=>{let t=r;for(let r=0;r"number"==typeof e?0:e;const jo={test:function(e){var t,n;return isNaN(e)&&Pn(e)&&((null===(t=e.match(Rn))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(In))||void 0===n?void 0:n.length)||0)>0},parse:Fo,createTransformer:Vo,getAnimatableNone:function(e){const t=Fo(e);return Vo(e)(t.map(Ho))}},$o=new Set(["brightness","contrast","saturate","opacity"]);function Wo(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Rn)||[];if(!r)return e;const o=n.replace(r,"");let i=$o.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const Uo=/([a-z-]*)\(.*?\)/g,Go={...jo,getAnimatableNone:e=>{const t=e.match(Uo);return t?t.map(Wo).join(" "):e}},Yo={...Hn,color:Ao,backgroundColor:Ao,outlineColor:Ao,fill:Ao,stroke:Ao,borderColor:Ao,borderTopColor:Ao,borderRightColor:Ao,borderBottomColor:Ao,borderLeftColor:Ao,filter:Go,WebkitFilter:Go},qo=e=>Yo[e];function Ko(e,t){var n;let r=qo(e);return r!==Go&&(r=jo),null===(n=r.getAnimatableNone)||void 0===n?void 0:n.call(r,t)}const Xo=e=>t=>t.test(e),Zo=[kn,Ln,An,Dn,Bn,zn,{test:e=>"auto"===e,parse:e=>e}],Jo=e=>Zo.find(Xo(e)),Qo=[...Zo,Ao,jo],ei=e=>Qo.find(Xo(e));function ti(e,t,n){const r=e.getProps();return dr(r,t,void 0!==n?n:r.custom,function(e){const t={};return e.values.forEach(((e,n)=>t[n]=e.get())),t}(e),function(e){const t={};return e.values.forEach(((e,n)=>t[n]=e.getVelocity())),t}(e))}function ni(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,No(n))}function ri(e,t){const n=ti(e,t);let{transitionEnd:r={},transition:o={},...i}=n?e.makeTargetAnimatable(n,!1):{};i={...i,...r};for(const t in i){ni(e,t,pr(i[t]))}}function oi(e,t){if(!t)return;return(t[e]||t.default||t).from}function ii(e){return Boolean(yn(e)&&e.add)}function ai(e,t){const{MotionAppearAnimations:n}=window,r=((e,t)=>`${e}: ${t}`)(e,vn.has(t)?"transform":t),o=n&&n.get(r);return o?(vo.render((()=>{try{o.cancel(),n.delete(r)}catch(e){}})),o.currentTime||0):0}const si="data-"+ir("framerAppearId");const li=e=>1e3*e,ci=!1,ui=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,di=e=>t=>1-e(1-t),fi=e=>e*e,pi=di(fi),mi=ui(fi),hi=(e,t,n)=>-n*e+n*t+e;function gi(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}const vi=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},bi=[Oo,Po,Do];function yi(e){const t=(e=>bi.find((t=>t.test(e))))(e);Boolean(t);let n=t.parse(e);return t===Do&&(n=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,i=0,a=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;o=gi(s,r,e+1/3),i=gi(s,r,e),a=gi(s,r,e-1/3)}else o=i=a=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*a),alpha:r}}(n)),n}const wi=(e,t)=>{const n=yi(e),r=yi(t),o={...n};return e=>(o.red=vi(n.red,r.red,e),o.green=vi(n.green,r.green,e),o.blue=vi(n.blue,r.blue,e),o.alpha=hi(n.alpha,r.alpha,e),Po.transform(o))};function xi(e,t){return"number"==typeof e?n=>hi(e,t,n):Ao.test(e)?wi(e,t):Ci(e,t)}const _i=(e,t)=>{const n=[...e],r=n.length,o=e.map(((e,n)=>xi(e,t[n])));return e=>{for(let t=0;t{const n={...e,...t},r={};for(const o in n)void 0!==e[o]&&void 0!==t[o]&&(r[o]=xi(e[o],t[o]));return e=>{for(const t in r)n[t]=r[t](e);return n}},Ci=(e,t)=>{const n=jo.createTransformer(t),r=Bo(e),o=Bo(t);return r.numColors===o.numColors&&r.numNumbers>=o.numNumbers?$r(_i(r.values,o.values),n):n=>`${n>0?t:e}`},ki=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},Si=(e,t)=>n=>hi(e,t,n);function Ti(e,t,n){const r=[],o=n||function(e){return"number"==typeof e?Si:"string"==typeof e?Ao.test(e)?wi:Ci:Array.isArray(e)?_i:"object"==typeof e?Ei:Si}(e[0]),i=e.length-1;for(let n=0;ne[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Ti(t,r,o),s=a.length,l=t=>{let n=0;if(s>1)for(;nl(Cn(e[0],e[i-1],t)):l}const Ri=e=>e,Ii=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Mi(e,t,n,r){if(e===t&&n===r)return Ri;const o=t=>function(e,t,n,r,o){let i,a,s=0;do{a=t+(n-t)/2,i=Ii(a,r,o)-e,i>0?n=a:t=a}while(Math.abs(i)>1e-7&&++s<12);return a}(t,0,1,e,n);return e=>0===e||1===e?e:Ii(o(e),t,r)}const Pi=e=>1-Math.sin(Math.acos(e)),Oi=di(Pi),Di=ui(Oi),Ai=Mi(.33,1.53,.69,.99),Li=di(Ai),zi=ui(Li),Bi={linear:Ri,easeIn:fi,easeInOut:mi,easeOut:pi,circIn:Pi,circInOut:Di,circOut:Oi,backIn:Li,backInOut:zi,backOut:Ai,anticipate:e=>(e*=2)<1?.5*Li(e):.5*(2-Math.pow(2,-10*(e-1)))},Fi=e=>{if(Array.isArray(e)){e.length;const[t,n,r,o]=e;return Mi(t,n,r,o)}return"string"==typeof e?Bi[e]:e};function Vi({keyframes:e,ease:t=mi,times:n,duration:r=300}){e=[...e];const o=Vi[0],i=(e=>Array.isArray(e)&&"number"!=typeof e[0])(t)?t.map(Fi):Fi(t),a={done:!1,value:o},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===Vi.length?n:function(e){const t=e.length;return e.map(((e,n)=>0!==n?n/(t-1):0))}(e),r);function l(){return Ni(s,e,{ease:Array.isArray(i)?i:(t=e,n=i,t.map((()=>n||mi)).splice(0,t.length-1))});var t,n}let c=l();return{next:e=>(a.value=c(e),a.done=e>=r,a),flipTarget:()=>{e.reverse(),c=l()}}}const Hi=.001;function ji({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i,a=1-t;a=Cn(.05,1,a),e=Cn(.01,10,e/1e3),a<1?(o=t=>{const r=t*a,o=r*e,i=r-n,s=$i(t,a),l=Math.exp(-o);return Hi-i/s*l},i=t=>{const r=t*a*e,i=r*n+n,s=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=$i(Math.pow(t,2),a);return(-o(t)+Hi>0?-1:1)*((i-s)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const s=function(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}(o,i,5/e);if(e*=1e3,isNaN(s))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(s,2)*r;return{stiffness:t,damping:2*a*Math.sqrt(r*t),duration:e}}}function $i(e,t){return e*Math.sqrt(1-t*t)}const Wi=["duration","bounce"],Ui=["stiffness","damping","mass"];function Gi(e,t){return t.some((t=>void 0!==e[t]))}function Yi({keyframes:e,restSpeed:t=2,restDelta:n=.01,...r}){let o=e[0],i=e[e.length-1];const a={done:!1,value:o},{stiffness:s,damping:l,mass:c,velocity:u,duration:d,isResolvedFromDuration:f}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Gi(e,Ui)&&Gi(e,Wi)){const n=ji(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}(r);let p=qi,m=u?-u/1e3:0;const h=l/(2*Math.sqrt(s*c));function g(){const e=i-o,t=Math.sqrt(s/c)/1e3;if(void 0===n&&(n=Math.min(Math.abs(i-o)/100,.4)),h<1){const n=$i(t,h);p=r=>{const o=Math.exp(-h*t*r);return i-o*((m+h*t*e)/n*Math.sin(n*r)+e*Math.cos(n*r))}}else if(1===h)p=n=>i-Math.exp(-t*n)*(e+(m+t*e)*n);else{const n=t*Math.sqrt(h*h-1);p=r=>{const o=Math.exp(-h*t*r),a=Math.min(n*r,300);return i-o*((m+h*t*e)*Math.sinh(a)+n*e*Math.cosh(a))/n}}}return g(),{next:e=>{const r=p(e);if(f)a.done=e>=d;else{let o=m;if(0!==e)if(h<1){const t=Math.max(0,e-5);o=So(r-p(t),e-t)}else o=0;const s=Math.abs(o)<=t,l=Math.abs(i-r)<=n;a.done=s&&l}return a.value=a.done?i:r,a},flipTarget:()=>{m=-m,[o,i]=[i,o],g()}}}Yi.needsInterpolation=(e,t)=>"string"==typeof e||"string"==typeof t;const qi=e=>0;const Ki={decay:function({keyframes:e=[0],velocity:t=0,power:n=.8,timeConstant:r=350,restDelta:o=.5,modifyTarget:i}){const a=e[0],s={done:!1,value:a};let l=n*t;const c=a+l,u=void 0===i?c:i(c);return u!==c&&(l=u-a),{next:e=>{const t=-l*Math.exp(-e/r);return s.done=!(t>o||t<-o),s.value=s.done?u:u+t,s},flipTarget:()=>{}}},keyframes:Vi,tween:Vi,spring:Yi};function Xi(e,t,n=0){return e-t-n}const Zi=e=>{const t=({delta:t})=>e(t);return{start:()=>vo.update(t,!0),stop:()=>bo.update(t)}};function Ji({duration:e,driver:t=Zi,elapsed:n=0,repeat:r=0,repeatType:o="loop",repeatDelay:i=0,keyframes:a,autoplay:s=!0,onPlay:l,onStop:c,onComplete:u,onRepeat:d,onUpdate:f,type:p="keyframes",...m}){var h,g;let v,b,y,w=0,x=e,_=!1,E=!0;const C=Ki[a.length>2?"keyframes":p],k=a[0],S=a[a.length-1];(null===(g=(h=C).needsInterpolation)||void 0===g?void 0:g.call(h,k,S))&&(y=Ni([0,100],[k,S],{clamp:!1}),a=[0,100]);const T=C({...m,duration:e,keyframes:a});function N(){w++,"reverse"===o?(E=w%2==0,n=function(e,t=0,n=0,r=!0){return r?Xi(t+-e,t,n):t-(e-t)+n}(n,x,i,E)):(n=Xi(n,x,i),"mirror"===o&&T.flipTarget()),_=!1,d&&d()}function R(e){if(E||(e=-e),n+=e,!_){const e=T.next(Math.max(0,n));b=e.value,y&&(b=y(b)),_=E?e.done:n<=0}f&&f(b),_&&(0===w&&(x=void 0!==x?x:n),w=t+n:e<=-n}(n,x,i,E)&&N():(v.stop(),u&&u()))}return s&&(l&&l(),v=t(R),v.start()),{stop:()=>{c&&c(),v.stop()},sample:e=>T.next(Math.max(0,e))}}const Qi=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,ea={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qi([0,.65,.55,1]),circOut:Qi([.55,0,1,.45]),backIn:Qi([.31,.01,.66,-.59]),backOut:Qi([.33,1.53,.69,.99])};function ta(e){if(e)return Array.isArray(e)?Qi(e):ea[e]}function na(e,t,{onUpdate:n,onComplete:r,...o}){let{keyframes:i,duration:a=.3,elapsed:s=0,ease:l}=o;if("spring"===o.type||!(!(c=o.ease)||Array.isArray(c)||"string"==typeof c&&ea[c])){const e=Ji(o);let t={done:!1,value:i[0]};const n=[];let r=0;for(;!t.done;)t=e.sample(r),n.push(t.value),r+=10;i=n,a=r-10,l="linear"}var c;const u=function(e,t,n,{delay:r=0,duration:o,repeat:i=0,repeatType:a="loop",ease:s,times:l}={}){return e.animate({[t]:n,offset:l},{delay:r,duration:o,easing:ta(s),fill:"both",iterations:i+1,direction:"reverse"===a?"alternate":"normal"})}(e.owner.current,t,i,{...o,delay:-s,duration:a,ease:l});return u.onfinish=()=>{e.set(i[i.length-1]),r&&r()},()=>{const{currentTime:t}=u;if(t){const n=Ji(o);e.setWithVelocity(n.sample(t-10).value,n.sample(t).value,10)}vo.update((()=>u.cancel()))}}function ra(e,t){const n=performance.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(bo.read(r),e(i-t))};return vo.read(r,!0),()=>bo.read(r)}function oa({keyframes:e,elapsed:t,onUpdate:n,onComplete:r}){const o=()=>(n&&n(e[e.length-1]),r&&r(),()=>{});return t?ra(o,-t):o()}const ia=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),aa=e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}),sa=()=>({type:"keyframes",ease:"linear",duration:.3}),la={type:"keyframes",duration:.8},ca={x:ia,y:ia,z:ia,rotate:ia,rotateX:ia,rotateY:ia,rotateZ:ia,scaleX:aa,scaleY:aa,scale:aa,opacity:sa,backgroundColor:sa,color:sa,default:aa},ua=(e,{keyframes:t})=>{if(t.length>2)return la;return(ca[e]||ca.default)(t[1])},da=(e,t)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!jo.test(t)||t.startsWith("url(")));function fa(e){return 0===e||"string"==typeof e&&0===parseFloat(e)&&-1===e.indexOf(" ")}function pa(e){return"number"==typeof e?0:Ko("",e)}function ma(e,t){return e[t]||e.default||e}const ha={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},ga={},va={};for(const e in ha)va[e]=()=>(void 0===ga[e]&&(ga[e]=ha[e]()),ga[e]);const ba=new Set(["opacity"]),ya=(e,t,n,r={})=>o=>{const i=ma(r,e)||{},a=i.delay||r.delay||0;let{elapsed:s=0}=r;s-=li(a);const l=function(e,t,n,r){const o=da(t,n);let i=void 0!==r.from?r.from:e.get();return"none"===i&&o&&"string"==typeof n?i=Ko(t,n):fa(i)&&"string"==typeof n?i=pa(n):!Array.isArray(n)&&fa(n)&&"string"==typeof i&&(n=pa(i)),Array.isArray(n)?(null===n[0]&&(n[0]=i),n):[i,n]}(t,e,n,i),c=l[0],u=l[l.length-1],d=da(e,c),f=da(e,u);let p={keyframes:l,velocity:t.getVelocity(),...i,elapsed:s,onUpdate:e=>{t.set(e),i.onUpdate&&i.onUpdate(e)},onComplete:()=>{o(),i.onComplete&&i.onComplete()}};if(!d||!f||ci||!1===i.type)return oa(p);if("inertia"===i.type){const e=function({keyframes:e,velocity:t=0,min:n,max:r,power:o=.8,timeConstant:i=750,bounceStiffness:a=500,bounceDamping:s=10,restDelta:l=1,modifyTarget:c,driver:u,onUpdate:d,onComplete:f,onStop:p}){const m=e[0];let h;function g(e){return void 0!==n&&er}function v(e){return void 0===n?r:void 0===r||Math.abs(n-e){var n;null==d||d(t),null===(n=e.onUpdate)||void 0===n||n.call(e,t)},onComplete:f,onStop:p})}function y(e){b({type:"spring",stiffness:a,damping:s,restDelta:l,...e})}if(g(m))y({velocity:t,keyframes:[m,v(m)]});else{let e=o*t+m;void 0!==c&&(e=c(e));const r=v(e),a=r===n?-1:1;let s,u;const d=e=>{s=u,u=e,t=So(e-s,so.delta),(1===a&&e>r||-1===a&&enull==h?void 0:h.stop()}}(p);return()=>e.stop()}(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:a,repeatDelay:s,from:l,...c}){return!!Object.keys(c).length})(i)||(p={...p,...ua(e,p)}),p.duration&&(p.duration=li(p.duration)),p.repeatDelay&&(p.repeatDelay=li(p.repeatDelay));const m=t.owner,h=m&&m.current;if(va.waapi()&&ba.has(e)&&!p.repeatDelay&&"mirror"!==p.repeatType&&0!==p.damping&&m&&h instanceof HTMLElement&&!m.getProps().onUpdate)return na(t,e,p);{const e=Ji(p);return()=>e.stop()}};function wa(e,t,n={}){var r;const o=ti(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const a=o?()=>xa(e,o,n):()=>Promise.resolve(),s=(null===(r=e.variantChildren)||void 0===r?void 0:r.size)?(r=0)=>{const{delayChildren:o=0,staggerChildren:a,staggerDirection:s}=i;return function(e,t,n=0,r=0,o=1,i){const a=[],s=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>s-e*r;return Array.from(e.variantChildren).sort(_a).forEach(((e,r)=>{a.push(wa(e,t,{...i,delay:n+l(r)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(a)}(e,t,o+r,a,s,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[e,t]="beforeChildren"===l?[a,s]:[s,a];return e().then(t)}return Promise.all([a(),s(n.delay)])}function xa(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var i;let{transition:a=e.getDefaultTransition(),transitionEnd:s,...l}=e.makeTargetAnimatable(t);const c=e.getValue("willChange");r&&(a=r);const u=[],d=o&&(null===(i=e.animationState)||void 0===i?void 0:i.getState()[o]);for(const t in l){const r=e.getValue(t),o=l[t];if(!r||void 0===o||d&&Ea(d,t))continue;let i={delay:n,elapsed:0,...a};if(e.shouldReduceMotion&&vn.has(t)&&(i={...i,type:!1,delay:0}),!r.hasAnimated){const n=e.getProps()[si];n&&(i.elapsed=ai(n,t))}let s=r.start(ya(t,r,o,i));ii(c)&&(c.add(t),s=s.then((()=>c.remove(t)))),u.push(s)}return Promise.all(u).then((()=>{s&&ri(e,s)}))}function _a(e,t){return e.sortNodePosition(t)}function Ea({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}const Ca=[yr.Animate,yr.InView,yr.Focus,yr.Hover,yr.Tap,yr.Drag,yr.Exit],ka=[...Ca].reverse(),Sa=Ca.length;function Ta(e){return t=>Promise.all(t.map((({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map((t=>wa(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=wa(e,t,n);else{const o="function"==typeof t?ti(e,t,n.custom):t;r=xa(e,o,n)}return r.then((()=>e.notify("AnimationComplete",t)))}(e,t,n))))}function Na(e){let t=Ta(e);const n={[yr.Animate]:Ia(!0),[yr.InView]:Ia(),[yr.Hover]:Ia(),[yr.Tap]:Ia(),[yr.Drag]:Ia(),[yr.Focus]:Ia(),[yr.Exit]:Ia()};let r=!0;const o=(t,n)=>{const r=ti(e,n);if(r){const{transition:e,transitionEnd:n,...o}=r;t={...t,...o,...n}}return t};function i(i,a){const s=e.getProps(),l=e.getVariantContext(!0)||{},c=[],u=new Set;let d={},f=1/0;for(let t=0;tf&&g;const x=Array.isArray(h)?h:[h];let _=x.reduce(o,{});!1===v&&(_={});const{prevResolvedValues:E={}}=m,C={...E,..._},k=e=>{w=!0,u.delete(e),m.needsAnimating[e]=!0};for(const e in C){const t=_[e],n=E[e];d.hasOwnProperty(e)||(t!==n?fr(t)&&fr(n)?!oo(t,n)||y?k(e):m.protectedKeys[e]=!0:void 0!==t?k(e):u.add(e):void 0!==t&&u.has(e)?k(e):m.protectedKeys[e]=!0)}m.prevProp=h,m.prevResolvedValues=_,m.isActive&&(d={...d,..._}),r&&e.blockInitialAnimation&&(w=!1),w&&!b&&c.push(...x.map((e=>({animation:e,options:{type:p,...i}}))))}if(u.size){const t={};u.forEach((n=>{const r=e.getBaseTarget(n);void 0!==r&&(t[n]=r)})),c.push({animation:t})}let p=Boolean(c.length);return r&&!1===s.initial&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(c):Promise.resolve()}return{animateChanges:i,setActive:function(t,r,o){var a;if(n[t].isActive===r)return Promise.resolve();null===(a=e.variantChildren)||void 0===a||a.forEach((e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)})),n[t].isActive=r;const s=i(o,t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n}}function Ra(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!oo(t,e)}function Ia(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const Ma={animation:to((({visualElement:e,animate:t})=>{e.animationState||(e.animationState=Na(e)),qt(t)&&(0,b.useEffect)((()=>t.subscribe(e)),[t])})),exit:to((e=>{const{custom:t,visualElement:n}=e,[r,o]=ro(),i=(0,b.useContext)(jt);(0,b.useEffect)((()=>{n.isPresent=r;const e=n.animationState&&n.animationState.setActive(yr.Exit,!r,{custom:i&&i.custom||t});e&&!r&&e.then(o)}),[r])}))},Pa=(e,t)=>Math.abs(e-t);class Oa{constructor(e,t,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=La(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=Pa(e.x,t.x),r=Pa(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=so;this.history.push({...r,timestamp:o});const{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=Da(t,this.transformPagePoint),_r(e)&&0===e.buttons?this.handlePointerUp(e,t):vo.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r}=this.handlers,o=La(Da(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,o),r&&r(e,o)},Er(e)&&e.touches.length>1)return;this.handlers=t,this.transformPagePoint=n;const r=Da(Tr(e),this.transformPagePoint),{point:o}=r,{timestamp:i}=so;this.history=[{...o,timestamp:i}];const{onSessionStart:a}=t;a&&a(e,La(r,this.history)),this.removeListeners=$r(Pr(window,"pointermove",this.handlePointerMove),Pr(window,"pointerup",this.handlePointerUp),Pr(window,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),bo.update(this.updatePoint)}}function Da(e,t){return t?{point:t(e.point)}:e}function Aa(e,t){return{x:e.x-t.x,y:e.y-t.y}}function La({point:e},t){return{point:e,delta:Aa(e,Ba(t)),offset:Aa(e,za(t)),velocity:Fa(t,.1)}}function za(e){return e[0]}function Ba(e){return e[e.length-1]}function Fa(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Ba(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>li(t)));)n--;if(!r)return{x:0,y:0};const i=(o.timestamp-r.timestamp)/1e3;if(0===i)return{x:0,y:0};const a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Va(e){return e.max-e.min}function Ha(e,t=0,n=.01){return Math.abs(e-t)<=n}function ja(e,t,n,r=.5){e.origin=r,e.originPoint=hi(t.min,t.max,e.origin),e.scale=Va(n)/Va(t),(Ha(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=hi(n.min,n.max,e.origin)-e.originPoint,(Ha(e.translate)||isNaN(e.translate))&&(e.translate=0)}function $a(e,t,n,r){ja(e.x,t.x,n.x,null==r?void 0:r.originX),ja(e.y,t.y,n.y,null==r?void 0:r.originY)}function Wa(e,t,n){e.min=n.min+t.min,e.max=e.min+Va(t)}function Ua(e,t,n){e.min=t.min-n.min,e.max=e.min+Va(t)}function Ga(e,t,n){Ua(e.x,t.x,n.x),Ua(e.y,t.y,n.y)}function Ya(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function qa(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min1.0000000000001||e<.999999999999?e:1}function us(e,t){e.min=e.min+t,e.max=e.max+t}function ds(e,t,[n,r,o]){const i=void 0!==t[o]?t[o]:.5,a=hi(e.min,e.max,i);ss(e,t[n],t[r],a,t.scale)}const fs=["x","scaleX","originX"],ps=["y","scaleY","originY"];function ms(e,t){ds(e.x,t,fs),ds(e.y,t,ps)}function hs(e,t){return Qa(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const gs=new WeakMap;class vs{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new Oa(e,{onSessionStart:e=>{this.stopAnimation(),t&&this.snapToCursor(Tr(e,"page").point)},onStart:(e,t)=>{var n;const{drag:r,dragPropagation:o,onDragStart:i}=this.getProps();(!r||o||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=zr(r),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ja((e=>{var t,n;let r=this.getAxisMotionValue(e).get()||0;if(An.test(r)){const o=null===(n=null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout)||void 0===n?void 0:n.layoutBox[e];if(o){r=Va(o)*(parseFloat(r)/100)}}this.originPoint[e]=r})),null==i||i(e,t),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(yr.Drag,!0))},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:a}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(a),void(null!==this.currentDirection&&(null==o||o(this.currentDirection)));this.updateAxis("x",t.point,a),this.updateAxis("y",t.point,a),this.visualElement.render(),null==i||i(e,t)},onSessionEnd:(e,t)=>this.stop(e,t)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(e,t){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:o}=this.getProps();null==o||o(e,t)}cancel(){var e,t;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(e=this.panSession)||void 0===e||e.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(t=this.visualElement.animationState)||void 0===t||t.setActive(yr.Drag,!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!bs(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:n},r){return void 0!==t&&en&&(e=r?hi(n,e,r.max):Math.min(e,n)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){const{dragConstraints:e,dragElastic:t}=this.getProps(),{layout:n}=this.visualElement.projection||{},r=this.constraints;e&&Gt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!n)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:Ya(e.x,n,o),y:Ya(e.y,t,r)}}(n.layoutBox,e),this.elastic=function(e=Ka){return!1===e?e=0:!0===e&&(e=Ka),{x:Xa(e,"left","right"),y:Xa(e,"top","bottom")}}(t),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Ja((e=>{this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(n.layoutBox[e],this.constraints[e]))}))}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Gt(e))return!1;const n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=hs(e,n),{scroll:o}=t;return o&&(us(r.x,o.offset.x),us(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:qa(e.x,t.x),y:qa(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(i));this.hasMutatedConstraints=!!e,e&&(i=Qa(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),s=this.constraints||{},l=Ja((a=>{if(!bs(a,t,this.currentDirection))return;let l=(null==s?void 0:s[a])||{};i&&(l={min:0,max:0});const c=r?200:1e6,u=r?40:1e7,d={type:"inertia",velocity:n?e[a]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(a,d)}));return Promise.all(l).then(a)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return n.start(ya(e,n,0,t))}stopAnimation(){Ja((e=>this.getAxisMotionValue(e).stop()))}getAxisMotionValue(e){var t;const n="_drag"+e.toUpperCase(),r=this.visualElement.getProps()[n];return r||this.visualElement.getValue(e,(null===(t=this.visualElement.getProps().initial)||void 0===t?void 0:t[e])||0)}snapToCursor(e){Ja((t=>{const{drag:n}=this.getProps();if(!bs(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[t];o.set(e[t]-hi(n,i,.5))}}))}scalePositionWithinConstraints(){var e;if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Gt(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Ja((e=>{const t=this.getAxisMotionValue(e);if(t){const n=t.get();o[e]=function(e,t){let n=.5;const r=Va(e),o=Va(t);return o>r?n=ki(t.min,t.max-r,e.min):r>o&&(n=ki(e.min,e.max-o,t.min)),Cn(0,1,n)}({min:n,max:n},this.constraints[e])}}));const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",null===(e=r.root)||void 0===e||e.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ja((e=>{if(!bs(e,t,null))return;const n=this.getAxisMotionValue(e),{min:r,max:i}=this.constraints[e];n.set(hi(r,i,o[e]))}))}addListeners(){var e;if(!this.visualElement.current)return;gs.set(this.visualElement,this);const t=Pr(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),n=()=>{const{dragConstraints:e}=this.getProps();Gt(e)&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,o=r.addEventListener("measure",n);r&&!r.layout&&(null===(e=r.root)||void 0===e||e.updateScroll(),r.updateLayout()),n();const i=wr(window,"resize",(()=>this.scalePositionWithinConstraints())),a=r.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Ja((t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))})),this.visualElement.render())}));return()=>{i(),t(),o(),null==a||a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=Ka,dragMomentum:a=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:a}}}function bs(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const ys={pan:to((function({onPan:e,onPanStart:t,onPanEnd:n,onPanSessionStart:r,visualElement:o}){const i=e||t||n||r,a=(0,b.useRef)(null),{transformPagePoint:s}=(0,b.useContext)(Vt),l={onSessionStart:r,onStart:t,onMove:e,onEnd:(e,t)=>{a.current=null,n&&n(e,t)}};(0,b.useEffect)((()=>{null!==a.current&&a.current.updateHandlers(l)})),Or(o,"pointerdown",i&&function(e){a.current=new Oa(e,l,{transformPagePoint:s})}),Hr((()=>a.current&&a.current.end()))})),drag:to((function(e){const{dragControls:t,visualElement:n}=e,r=nn((()=>new vs(n)));(0,b.useEffect)((()=>t&&t.subscribe(r)),[r,t]),(0,b.useEffect)((()=>r.addListeners()),[r])}))};function ws(e){return"string"==typeof e&&e.startsWith("var(--")}const xs=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function _s(e,t,n=1){const[r,o]=function(e){const t=xs.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);return i?i.trim():ws(o)?_s(o,t,n+1):o}const Es=new Set(["width","height","top","left","right","bottom","x","y"]),Cs=e=>Es.has(e),ks=(e,t)=>{e.set(t,!1),e.set(t)},Ss=e=>e===kn||e===Ln;var Ts;!function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"}(Ts||(Ts={}));const Ns=(e,t)=>parseFloat(e.split(", ")[t]),Rs=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return Ns(o[1],t);{const t=r.match(/^matrix\((.+)\)$/);return t?Ns(t[1],e):0}},Is=new Set(["x","y","z"]),Ms=gn.filter((e=>!Is.has(e)));const Ps={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Rs(4,13),y:Rs(5,14)},Os=(e,t,n={},r={})=>{t={...t},r={...r};const o=Object.keys(t).filter(Cs);let i=[],a=!1;const s=[];if(o.forEach((o=>{const l=e.getValue(o);if(!e.hasValue(o))return;let c=n[o],u=Jo(c);const d=t[o];let f;if(fr(d)){const e=d.length,t=null===d[0]?1:0;c=d[t],u=Jo(c);for(let n=t;n{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t.length&&e.render(),t}(e),a=!0),s.push(o),r[o]=void 0!==r[o]?r[o]:t[o],ks(l,d))})),s.length){const n=s.indexOf("height")>=0?window.pageYOffset:null,o=((e,t,n)=>{const r=t.measureViewportBox(),o=t.current,i=getComputedStyle(o),{display:a}=i,s={};"none"===a&&t.setStaticValue("display",e.display||"block"),n.forEach((e=>{s[e]=Ps[e](r,i)})),t.render();const l=t.measureViewportBox();return n.forEach((n=>{const r=t.getValue(n);ks(r,s[n]),e[n]=Ps[n](l,i)})),e})(t,e,s);return i.length&&i.forEach((([t,n])=>{e.getValue(t).set(n)})),e.render(),Lt&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:r}}return{target:t,transitionEnd:r}};function Ds(e,t,n,r){return(e=>Object.keys(e).some(Cs))(t)?Os(e,t,n,r):{target:t,transitionEnd:r}}const As=(e,t,n,r)=>{const o=function(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach((e=>{const t=e.get();if(!ws(t))return;const n=_s(t,r);n&&e.set(n)}));for(const e in t){const o=t[e];if(!ws(o))continue;const i=_s(o,r);i&&(t[e]=i,n&&void 0===n[e]&&(n[e]=o))}return{target:t,transitionEnd:n}}(e,t,r);return Ds(e,t=o.target,n,r=o.transitionEnd)};const Ls=Object.keys(tn),zs=Ls.length,Bs=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];const Fs=["initial",...Ca],Vs=Fs.length;class Hs extends class{constructor({parent:e,props:t,reducedMotionConfig:n,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>vo.render(this.render,!1,!0);const{latestValues:i,renderState:a}=r;this.latestValues=i,this.baseTarget={...i},this.initialValues=t.initial?{...i}:{},this.renderState=a,this.parent=e,this.props=t,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=o,this.isControllingVariants=Xt(t),this.isVariantNode=Zt(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:s,...l}=this.scrapeMotionValuesFromProps(t);for(const e in l){const t=l[e];void 0!==i[e]&&yn(t)&&(t.set(i[e],!1),ii(s)&&s.add(e))}}scrapeMotionValuesFromProps(e){return{}}mount(e){var t;this.current=e,this.projection&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(t=this.parent)||void 0===t?void 0:t.addVariantChild(this)),this.values.forEach(((e,t)=>this.bindToMotionValue(t,e))),Bt.current||Ft(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||zt.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var e,t,n;null===(e=this.projection)||void 0===e||e.unmount(),bo.update(this.notifyUpdate),bo.render(this.render),this.valueSubscriptions.forEach((e=>e())),null===(t=this.removeFromVariantTree)||void 0===t||t.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const e in this.events)this.events[e].clear();this.current=null}bindToMotionValue(e,t){const n=vn.has(e),r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&vo.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,(()=>{r(),o()}))}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}loadFeatures(e,t,n,r,o,i){const a=[];for(let t=0;tthis.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:i,layoutScroll:l})}return a}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e,t=!0){return this.makeTargetAnimatableFromInstance(e,this.props,t)}setProps(e){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=e;for(let t=0;tn.variantChildren.delete(e)}addValue(e,t){this.hasValue(e)&&this.removeValue(e),this.values.set(e,t),this.latestValues[e]=t.get(),this.bindToMotionValue(e,t)}removeValue(e){var t;this.values.delete(e),null===(t=this.valueSubscriptions.get(e))||void 0===t||t(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=No(t,{owner:this}),this.addValue(e,n)),n}readValue(e){return void 0===this.latestValues[e]&&this.current?this.readValueFromInstance(this.current,e,this.options):this.latestValues[e]}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props,r="string"==typeof n||"object"==typeof n?null===(t=dr(this.props,n))||void 0===t?void 0:t[e]:void 0;if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||yn(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new ko),this.events[e].add(t)}notify(e,...t){var n;null===(n=this.events[e])||void 0===n||n.notify(...t)}}{sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){var n;return null===(n=e.style)||void 0===n?void 0:n[t]}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:t,...n},{transformValues:r},o){let i=function(e,t,n){var r;const o={};for(const i in e){const e=oi(i,t);o[i]=void 0!==e?e:null===(r=n.getValue(i))||void 0===r?void 0:r.get()}return o}(n,e||{},this);if(r&&(t&&(t=r(t)),n&&(n=r(n)),i&&(i=r(i))),o){!function(e,t,n){var r,o;const i=Object.keys(t).filter((t=>!e.hasValue(t))),a=i.length;if(a)for(let s=0;smn(e)?new $s(t,{enableHardwareAcceleration:!1}):new js(t,{enableHardwareAcceleration:!0});function Us(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Gs={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!Ln.test(e))return e;e=parseFloat(e)}return`${Us(e,t.target.x)}% ${Us(e,t.target.y)}%`}},Ys="_$css",qs={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=e.includes("var("),i=[];o&&(e=e.replace(xs,(e=>(i.push(e),Ys))));const a=jo.parse(e);if(a.length>5)return r;const s=jo.createTransformer(e),l="number"!=typeof a[0]?1:0,c=n.x.scale*t.x,u=n.y.scale*t.y;a[0+l]/=c,a[1+l]/=u;const d=hi(c,u,.5);"number"==typeof a[2+l]&&(a[2+l]/=d),"number"==typeof a[3+l]&&(a[3+l]/=d);let f=s(a);if(o){let e=0;f=f.replace(Ys,(()=>{const t=i[e];return e++,t}))}return f}};class Ks extends b.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var i;i=Xs,Object.assign(hn,i),o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),rn.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||e.layoutDependency!==t||void 0===t?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||vo.postRender((()=>{var e;(null===(e=i.getStack())||void 0===e?void 0:e.members.length)||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),!e.currentAnimation&&e.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),(null==t?void 0:t.group)&&t.group.remove(r),(null==n?void 0:n.deregister)&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;null==e||e()}render(){return null}}const Xs={borderRadius:{...Gs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Gs,borderTopRightRadius:Gs,borderBottomLeftRadius:Gs,borderBottomRightRadius:Gs,boxShadow:qs},Zs={measureLayout:function(e){const[t,n]=ro(),r=(0,b.useContext)(an);return b.createElement(Ks,{...e,layoutGroup:r,switchLayoutGroup:(0,b.useContext)(ln),isPresent:t,safeToRemove:n})}};const Js=["TopLeft","TopRight","BottomLeft","BottomRight"],Qs=Js.length,el=e=>"string"==typeof e?parseFloat(e):e,tl=e=>"number"==typeof e||Ln.test(e);function nl(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const rl=il(0,.5,Oi),ol=il(.5,.95,Ri);function il(e,t,n){return r=>rt?1:n(ki(e,t,r))}function al(e,t){e.min=t.min,e.max=t.max}function sl(e,t){al(e.x,t.x),al(e.y,t.y)}function ll(e,t,n,r,o){return e=is(e-=t,1/n,r),void 0!==o&&(e=is(e,1/o,r)),e}function cl(e,t,[n,r,o],i,a){!function(e,t=0,n=1,r=.5,o,i=e,a=e){An.test(t)&&(t=parseFloat(t),t=hi(a.min,a.max,t/100)-a.min);if("number"!=typeof t)return;let s=hi(i.min,i.max,r);e===i&&(s-=t),e.min=ll(e.min,t,n,s,o),e.max=ll(e.max,t,n,s,o)}(e,t[n],t[r],t[o],t.scale,i,a)}const ul=["x","scaleX","originX"],dl=["y","scaleY","originY"];function fl(e,t,n,r){cl(e.x,t,ul,null==n?void 0:n.x,null==r?void 0:r.x),cl(e.y,t,dl,null==n?void 0:n.y,null==r?void 0:r.y)}function pl(e){return 0===e.translate&&1===e.scale}function ml(e){return pl(e.x)&&pl(e.y)}function hl(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function gl(e){return Va(e.x)/Va(e.y)}class vl{constructor(){this.members=[]}add(e){Eo(this.members,e),e.scheduleRender()}remove(e){if(Co(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex((t=>e===t));if(0===t)return!1;let n;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(e,t){var n;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,t&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(null===(n=e.root)||void 0===n?void 0:n.isUpdating)&&(e.isLayoutDirty=!0);const{crossfade:o}=e.options;!1===o&&r.hide()}}exitAnimationComplete(){this.members.forEach((e=>{var t,n,r,o,i;null===(n=(t=e.options).onExitComplete)||void 0===n||n.call(t),null===(i=null===(r=e.resumingFrom)||void 0===r?void 0:(o=r.options).onExitComplete)||void 0===i||i.call(o)}))}scheduleRender(){this.members.forEach((e=>{e.instance&&e.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function bl(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y;if((o||i)&&(r=`translate3d(${o}px, ${i}px, 0) `),1===t.x&&1===t.y||(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:e,rotateX:t,rotateY:o}=n;e&&(r+=`rotate(${e}deg) `),t&&(r+=`rotateX(${t}deg) `),o&&(r+=`rotateY(${o}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return 1===a&&1===s||(r+=`scale(${a}, ${s})`),r||"none"}const yl=(e,t)=>e.depth-t.depth;class wl{constructor(){this.children=[],this.isDirty=!1}add(e){Eo(this.children,e),this.isDirty=!0}remove(e){Co(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(yl),this.isDirty=!1,this.children.forEach(e)}}const xl=["","X","Y","Z"];let _l=0;function El({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e,n={},r=(null==t?void 0:t())){this.id=_l++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Sl),this.nodes.forEach(Ml),this.nodes.forEach(Pl)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=e,this.latestValues=n,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0,e&&this.root.registerPotentialNode(e,this);for(let e=0;ethis.root.updateBlockedByResize=!1;e(t,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=ra(r,250),rn.hasAnimatedSinceResize&&(rn.hasAnimatedSinceResize=!1,this.nodes.forEach(Il))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&a&&(o||i)&&this.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{var o,i,s,l,c;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const u=null!==(i=null!==(o=this.options.transition)&&void 0!==o?o:a.getDefaultTransition())&&void 0!==i?i:Bl,{onLayoutAnimationStart:d,onLayoutAnimationComplete:f}=a.getProps(),p=!this.targetLayout||!hl(this.targetLayout,r)||n,m=!t&&n;if((null===(s=this.resumeFrom)||void 0===s?void 0:s.instance)||m||t&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,m);const t={...ma(u,"layout"),onPlay:d,onComplete:f};a.shouldReduceMotion&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||0!==this.animationProgress||Il(this),this.isLead()&&(null===(c=(l=this.options).onExitComplete)||void 0===c||c.call(l));this.targetLayout=r}))}unmount(){var e,t;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(e=this.getStack())||void 0===e||e.remove(this),null===(t=this.parent)||void 0===t||t.children.delete(this),this.instance=void 0,bo.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var e;return this.isAnimationBlocked||(null===(e=this.parent)||void 0===e?void 0:e.isTreeAnimationBlocked())||!1}startUpdate(){var e;this.isUpdateBlocked()||(this.isUpdating=!0,null===(e=this.nodes)||void 0===e||e.forEach(Ol),this.animationId++)}willUpdate(e=!0){var t,n,r;if(this.root.isUpdateBlocked())return void(null===(n=(t=this.options).onExitComplete)||void 0===n||n.call(t));if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){var e;if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e{var n;const r=t/1e3;Al(s.x,e.x,r),Al(s.y,e.y,r),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(Ga(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,n,r){Ll(e.x,t.x,n.x,r),Ll(e.y,t.y,n.y,r)}(this.relativeTarget,this.relativeTargetOrigin,l,r)),c&&(this.animationValues=a,function(e,t,n,r,o,i){o?(e.opacity=hi(0,void 0!==n.opacity?n.opacity:1,rl(r)),e.opacityExit=hi(void 0!==t.opacity?t.opacity:1,0,ol(r))):i&&(e.opacity=hi(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o{rn.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n={}){const r=yn(e)?e:No(e);return r.start(ya("",r,t,n)),{stop:()=>r.stop(),isAnimating:()=>r.isAnimating()}}(0,1e3,{...e,onUpdate:t=>{var n;this.mixTargetDelta(t),null===(n=e.onUpdate)||void 0===n||n.call(e,t)},onComplete:()=>{var t;null===(t=e.onComplete)||void 0===t||t.call(e),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0}))}completeAnimation(){var e;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(e=this.getStack())||void 0===e||e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var e;this.currentAnimation&&(null===(e=this.mixTargetDelta)||void 0===e||e.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&Hl(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=Va(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=Va(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}sl(t,n),ms(t,o),$a(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){var n,r,o;this.sharedNodes.has(e)||this.sharedNodes.set(e,new vl);this.sharedNodes.get(e).add(t),t.promote({transition:null===(n=t.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(o=null===(r=t.options.initialPromotionConfig)||void 0===r?void 0:r.shouldPreserveFollowOpacity)||void 0===o?void 0:o.call(r,t)})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(t=!0),!t)return;const r={};for(let t=0;t{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()})),this.root.nodes.forEach(Nl),this.root.sharedNodes.clear()}}}function Cl(e){e.updateLayout()}function kl(e){var t,n,r;const o=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&o&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:n}=e.layout,{animationType:r}=e.options,i=o.source!==e.layout.source;"size"===r?Ja((e=>{const n=i?o.measuredBox[e]:o.layoutBox[e],r=Va(n);n.min=t[e].min,n.max=n.min+r})):Hl(r,o.layoutBox,t)&&Ja((e=>{const n=i?o.measuredBox[e]:o.layoutBox[e],r=Va(t[e]);n.max=n.min+r}));const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};$a(a,t,o.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};i?$a(s,e.applyTransform(n,!0),o.measuredBox):$a(s,t,o.layoutBox);const l=!ml(a);let c=!1;if(!e.resumeFrom){const n=e.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:e,layout:r}=n;if(e&&r){const n={x:{min:0,max:0},y:{min:0,max:0}};Ga(n,o.layoutBox,e.layoutBox);const i={x:{min:0,max:0},y:{min:0,max:0}};Ga(i,t,r.layoutBox),hl(n,i)||(c=!0)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:o,delta:s,layoutDelta:a,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else e.isLead()&&(null===(r=(n=e.options).onExitComplete)||void 0===r||r.call(n));e.options.transition=void 0}function Sl(e){e.isProjectionDirty||(e.isProjectionDirty=Boolean(e.parent&&e.parent.isProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=Boolean(e.parent&&e.parent.isTransformDirty))}function Tl(e){e.clearSnapshot()}function Nl(e){e.clearMeasurements()}function Rl(e){const{visualElement:t}=e.options;(null==t?void 0:t.getProps().onBeforeLayoutMeasure)&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Il(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function Ml(e){e.resolveTargetDelta()}function Pl(e){e.calcProjection()}function Ol(e){e.resetRotation()}function Dl(e){e.removeLeadSnapshot()}function Al(e,t,n){e.translate=hi(t.translate,0,n),e.scale=hi(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Ll(e,t,n,r){e.min=hi(t.min,n.min,r),e.max=hi(t.max,n.max,r)}function zl(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const Bl={duration:.45,ease:[.4,0,.1,1]};function Fl(e,t){let n=e.root;for(let t=e.path.length-1;t>=0;t--)if(Boolean(e.path[t].instance)){n=e.path[t];break}const r=(n&&n!==e.root?n.instance:document).querySelector(`[data-projection-id="${t}"]`);r&&e.mount(r,!0)}function Vl(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function Hl(e,t,n){return"position"===e||"preserve-aspect"===e&&!Ha(gl(t),gl(n),.2)}const jl=El({attachResizeListener:(e,t)=>wr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),$l={current:void 0},Wl=El({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!$l.current){const e=new jl(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),$l.current=e}return $l.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),Ul={...Ma,...no,...ys,...Zs},Gl=fn(((e,t)=>function(e,{forwardMotionProps:t=!1},n,r,o){return{...mn(e)?vr:br,preloadedFeatures:n,useRender:or(t),createVisualElement:r,projectionNodeConstructor:o,Component:e}}(e,t,Ul,Ws,Wl)));var Yl=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),ql=window.wp.deprecated,Kl=n.n(ql);var Xl=function(e){let{icon:t,className:n,size:r=20,style:o={},...i}=e;const l=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" "),c={...20!=r?{fontSize:`${r}px`,width:`${r}px`,height:`${r}px`}:{},...o};return(0,s.createElement)("span",a({className:l,style:c},i))};var Zl=function(e){let{icon:t=null,size:n=("string"==typeof t?20:24),...r}=e;if("string"==typeof t)return(0,s.createElement)(Xl,a({icon:t,size:n},r));if((0,s.isValidElement)(t)&&Xl===t.type)return(0,s.cloneElement)(t,{...r});if("function"==typeof t)return t.prototype instanceof s.Component?(0,s.createElement)(t,{size:n,...r}):t({size:n,...r});if(t&&("svg"===t.type||t.type===i.SVG)){const e={...t.props,width:n,height:n,...r};return(0,s.createElement)(i.SVG,e)}return(0,s.isValidElement)(t)?(0,s.cloneElement)(t,{size:n,...r}):t},Jl=(window.wp.warning,n(5619)),Ql=n.n(Jl),ec=window.lodash;var tc=function(e,t){const n=(0,s.useRef)(!1);(0,s.useEffect)((()=>{if(n.current)return e();n.current=!0}),t)};const nc=(0,s.createContext)({}),rc=()=>(0,s.useContext)(nc);const oc=(0,s.memo)((e=>{let{children:t,value:n}=e;const r=function(e){let{value:t}=e;const n=rc(),r=(0,s.useRef)(t);return tc((()=>{Ql()(r.current,t)&&r.current!==t&&"undefined"!=typeof process&&process.env}),[t]),(0,s.useMemo)((()=>(0,ec.merge)(JSON.parse(JSON.stringify(n)),t)),[n,t])}({value:n});return(0,s.createElement)(nc.Provider,{value:r},t)})),ic="__contextSystemKey__";var ac=n(9756),sc=n.n(ac);const lc=sc()((function(e){return`components-${(0,ec.kebabCase)(e)}`}));var cc=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?gc(Sc,--Cc):0,_c--,10===kc&&(_c=1,xc--),kc}function Ic(){return kc=Cc2||Dc(kc)>3?"":" "}function Fc(e,t){for(;--t&&Ic()&&!(kc<48||kc>102||kc>57&&kc<65||kc>70&&kc<97););return Oc(e,Pc()+(t<6&&32==Mc()&&32==Ic()))}function Vc(e){for(;Ic();)switch(kc){case e:return Cc;case 34:case 39:34!==e&&39!==e&&Vc(kc);break;case 40:41===e&&Vc(e);break;case 92:Ic()}return Cc}function Hc(e,t){for(;Ic()&&e+kc!==57&&(e+kc!==84||47!==Mc()););return"/*"+Oc(t,Cc-1)+"*"+dc(47===e?e:Ic())}function jc(e){for(;!Dc(Mc());)Ic();return Oc(e,Cc)}var $c="-ms-",Wc="-moz-",Uc="-webkit-",Gc="comm",Yc="rule",qc="decl",Kc="@keyframes";function Xc(e,t){for(var n="",r=yc(e),o=0;o0&&bc(E)-d&&wc(p>32?nu(E+";",r,n,d-1):nu(mc(E," ","")+";",r,n,d-2),l);break;case 59:E+=";";default:if(wc(_=eu(E,t,n,c,u,o,s,y,w=[],x=[],d),i),123===b)if(0===u)Qc(E,t,_,_,w,i,d,s,x);else switch(99===f&&110===gc(E,3)?100:f){case 100:case 108:case 109:case 115:Qc(e,_,_,r&&wc(eu(e,_,_,0,0,o,s,y,o,w=[],d),x),o,x,d,s,r?w:x);break;default:Qc(E,_,_,_,[""],x,0,s,x)}}c=u=p=0,h=v=1,y=E="",d=a;break;case 58:d=1+bc(E),p=m;default:if(h<1)if(123==b)--h;else if(125==b&&0==h++&&125==Rc())continue;switch(E+=dc(b),b*h){case 38:v=u>0?1:(E+="\f",-1);break;case 44:s[c++]=(bc(E)-1)*v,v=1;break;case 64:45===Mc()&&(E+=zc(Ic())),f=Mc(),u=d=bc(y=E+=jc(Pc())),b++;break;case 45:45===m&&2==bc(E)&&(h=0)}}return i}function eu(e,t,n,r,o,i,a,s,l,c,u){for(var d=o-1,f=0===o?i:[""],p=yc(f),m=0,h=0,g=0;m0?f[v]+" "+b:mc(b,/&\f/g,f[v])))&&(l[g++]=y);return Tc(e,t,n,0===o?Yc:s,l,c,u)}function tu(e,t,n){return Tc(e,t,n,Gc,dc(kc),vc(e,2,-2),0)}function nu(e,t,n,r){return Tc(e,t,n,qc,vc(e,0,r),vc(e,r+1,-1),r)}var ru=function(e,t,n){for(var r=0,o=0;r=o,o=Mc(),38===r&&12===o&&(t[n]=1),!Dc(o);)Ic();return Oc(e,Cc)},ou=function(e,t){return Lc(function(e,t){var n=-1,r=44;do{switch(Dc(r)){case 0:38===r&&12===Mc()&&(t[n]=1),e[n]+=ru(Cc-1,t,n);break;case 2:e[n]+=zc(r);break;case 4:if(44===r){e[++n]=58===Mc()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=dc(r)}}while(r=Ic());return e}(Ac(e),t))},iu=new WeakMap,au=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||iu.get(n))&&!r){iu.set(e,!0);for(var o=[],i=ou(t,o),a=n.props,s=0,l=0;s6)switch(gc(e,t+1)){case 109:if(45!==gc(e,t+4))break;case 102:return mc(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1-moz-"+(108==gc(e,t+3)?"$3":"$2-$3"))+e;case 115:return~hc(e,"stretch")?lu(mc(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==gc(e,t+1))break;case 6444:switch(gc(e,bc(e)-3-(~hc(e,"!important")&&10))){case 107:return mc(e,":",":-webkit-")+e;case 101:return mc(e,/(.+:)([^;!]+)(;|!.+)?/,"$1-webkit-"+(45===gc(e,14)?"inline-":"")+"box$3$1"+"-webkit-$2$3$1"+"-ms-$2box$3")+e}break;case 5936:switch(gc(e,t+11)){case 114:return Uc+e+$c+mc(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Uc+e+$c+mc(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Uc+e+$c+mc(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Uc+e+$c+e+e}return e}var cu=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case qc:e.return=lu(e.value,e.length);break;case Kc:return Xc([Nc(e,{value:mc(e.value,"@","@-webkit-")})],r);case Yc:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Xc([Nc(e,{props:[mc(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Xc([Nc(e,{props:[mc(t,/:(plac\w+)/,":-webkit-input-$1")]}),Nc(e,{props:[mc(t,/:(plac\w+)/,":-moz-$1")]}),Nc(e,{props:[mc(t,/:(plac\w+)/,"-ms-input-$1")]})],r)}return""}))}}],uu=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r=e.stylisPlugins||cu;var o,i,a={},s=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+l;return{name:c,styles:o,next:wu}},Eu=!!b.useInsertionEffect&&b.useInsertionEffect,Cu=Eu||function(e){return e()},ku=(Eu||b.useLayoutEffect,b.createContext("undefined"!=typeof HTMLElement?uu({key:"css"}):null));var Su=ku.Provider,Tu=function(e){return(0,b.forwardRef)((function(t,n){var r=(0,b.useContext)(ku);return e(t,r,n)}))};var Nu=b.createContext({});function Ru(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "})),r}var Iu=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},Mu=function(e,t,n){Iu(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}};function Pu(e,t){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0)}function Ou(e,t,n){var r=[],o=Ru(e,r,n);return r.length<2?n:o+t(r)}var Du=function e(t){for(var n="",r=0;rnull!=e&&["name","styles"].every((t=>void 0!==e[t])),Bu=()=>{const e=(0,b.useContext)(ku),t=(0,s.useCallback)((function(){if(null===e)throw new Error("The `useCx` hook should be only used within a valid Emotion Cache Context");for(var t=arguments.length,n=new Array(t),r=0;rzu(t)?(Mu(e,t,!1),`${e.key}-${t.name}`):t)))}),[e]);return t};function Fu(e,t){const n=rc();void 0===t&&"undefined"!=typeof process&&process.env;const r=(null==n?void 0:n[t])||{},o={"data-wp-c16t":!0,...(i=t,{"data-wp-component":i})};var i;const{_overrides:a,...s}=r,l=Object.entries(s).length?Object.assign({},s,e):e,c=Bu()(lc(t),e.className),u="function"==typeof l.renderChildren?l.renderChildren(l):l.children;for(const e in l)o[e]=l[e];for(const e in a)o[e]=a[e];return void 0!==u&&(o.children=u),o.className=c,o}function Vu(e,t){return Hu(e,t,{forwardsRef:!0})}function Hu(e,t,n){const r=null!=n&&n.forwardsRef?(0,s.forwardRef)(e):e;void 0===t&&"undefined"!=typeof process&&process.env;let o=r.__contextSystemKey__||[t];return Array.isArray(t)&&(o=[...o,...t]),"string"==typeof t&&(o=[...o,t]),Object.assign(r,{[ic]:[...new Set(o)],displayName:t,selector:`.${lc(t)}`})}function ju(e){if(!e)return[];let t=[];return e.__contextSystemKey__&&(t=e.__contextSystemKey__),e.type&&e.type.__contextSystemKey__&&(t=e.type.__contextSystemKey__),t}function $u(e,t){return!!e&&("string"==typeof t?ju(e).includes(t):!!Array.isArray(t)&&t.some((t=>ju(e).includes(t))))}const Wu={border:0,clip:"rect(1px, 1px, 1px, 1px)",WebkitClipPath:"inset( 50% )",clipPath:"inset( 50% )",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",wordWrap:"normal"};var Uu=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Gu=fu((function(e){return Uu.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),Yu=function(e){return"theme"!==e},qu=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Gu:Yu},Ku=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},Xu=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Iu(t,n,r),Cu((function(){return Mu(t,n,r)})),null},Zu=function e(t,n){var r,o,i=t.__emotion_real===t,s=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,o=n.target);var l=Ku(t,n,i),c=l||qu(s),u=!c("as");return function(){var d=arguments,f=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&f.push("label:"+r+";"),null==d[0]||void 0===d[0].raw)f.push.apply(f,d);else{0,f.push(d[0][0]);for(var p=d.length,m=1;m{e&&(e.stopPropagation(),e.preventDefault())}}const z=!O&&(v&&w||y||!!w&&!(null!=x&&x.length)&&!1!==v),B=k?I:void 0,F=R["aria-describedby"]||B,V={className:P,"aria-label":R["aria-label"]||w,"aria-describedby":F,ref:t},H=(0,s.createElement)(s.Fragment,null,m&&"left"===h&&(0,s.createElement)(Zl,{icon:m,size:g}),_&&(0,s.createElement)(s.Fragment,null,_),m&&"right"===h&&(0,s.createElement)(Zl,{icon:m,size:g}),x),j="a"===D?(0,s.createElement)("a",a({},L,R,V),H):(0,s.createElement)("button",a({},A,R,V),H);return z?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(zf,{text:null!=x&&x.length&&k?k:w,shortcut:y,position:b},j),k&&(0,s.createElement)(ed,null,(0,s.createElement)("span",{id:B},k))):(0,s.createElement)(s.Fragment,null,j,k&&(0,s.createElement)(ed,null,(0,s.createElement)("span",{id:B},k)))}));var rd=nd;let od=0;function id(e){const t=document.scrollingElement||document.body;e&&(od=t.scrollTop);const n=e?"add":"remove";t.classList[n]("lockscroll"),document.documentElement.classList[n]("lockscroll"),e||(t.scrollTop=od)}let ad=0;var sd=function(){return(0,s.useEffect)((()=>(0===ad&&id(!0),++ad,()=>{1===ad&&id(!1),--ad})),[]),null};const ld=Symbol(),cd=Symbol(),ud=Symbol();let dd=(e,t)=>new Proxy(e,t);const fd=Object.getPrototypeOf,pd=new WeakMap,md=e=>e&&(pd.has(e)?pd.get(e):fd(e)===Object.prototype||fd(e)===Array.prototype),hd=e=>"object"==typeof e&&null!==e,gd=new WeakMap,vd=e=>e[ud]||e,bd=(e,t,n)=>{if(!md(e))return e;const r=vd(e),o=(e=>Object.isFrozen(e)||Object.values(Object.getOwnPropertyDescriptors(e)).some((e=>!e.writable)))(r);let i=n&&n.get(r);return i&&i[1].f===o||(i=((e,t)=>{const n={f:t};let r=!1;const o=(t,o)=>{if(!r){let r=n.a.get(e);r||(r=new Set,n.a.set(e,r)),o&&r.has(ld)||r.add(t)}},i={get:(t,r)=>r===ud?e:(o(r),bd(t[r],n.a,n.c)),has:(t,i)=>i===cd?(r=!0,n.a.delete(e),!0):(o(i),i in t),getOwnPropertyDescriptor:(e,t)=>(o(t,!0),Object.getOwnPropertyDescriptor(e,t)),ownKeys:e=>(o(ld),Reflect.ownKeys(e))};return t&&(i.set=i.deleteProperty=()=>!1),[i,n]})(r,o),i[1].p=dd(o?(e=>{let t=gd.get(e);if(!t){if(Array.isArray(e))t=Array.from(e);else{const n=Object.getOwnPropertyDescriptors(e);Object.values(n).forEach((e=>{e.configurable=!0})),t=Object.create(fd(e),n)}gd.set(e,t)}return t})(r):r,i[0]),n&&n.set(r,i)),i[1].a=t,i[1].c=n,i[1].p},yd=(e,t)=>{const n=Reflect.ownKeys(e),r=Reflect.ownKeys(t);return n.length!==r.length||n.some(((e,t)=>e!==r[t]))},wd=(e,t,n,r)=>{if(Object.is(e,t))return!1;if(!hd(e)||!hd(t))return!0;const o=n.get(vd(e));if(!o)return!0;if(r){const n=r.get(e);if(n&&n.n===t)return n.g;r.set(e,{n:t,g:!1})}let i=null;for(const a of o){const o=a===ld?yd(e,t):wd(e[a],t[a],n,r);if(!0!==o&&!1!==o||(i=o),i)break}return null===i&&(i=!0),r&&r.set(e,{n:t,g:i}),i},xd=(e,t=!0)=>{pd.set(e,t)};var _d=n(635);const Ed=e=>"object"==typeof e&&null!==e,Cd=new WeakSet,kd=Symbol("VERSION"),Sd=Symbol("LISTENERS"),Td=Symbol("SNAPSHOT"),Nd=(e=Object.is,t=((e,t)=>new Proxy(e,t)),n=(e=>Ed(e)&&!Cd.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)),r=Symbol("PROMISE_RESULT"),o=Symbol("PROMISE_ERROR"),i=new WeakMap,a=((e,t,n)=>{const a=i.get(n);if((null==a?void 0:a[0])===e)return a[1];const s=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return xd(s,!0),i.set(n,[e,s]),Reflect.ownKeys(t).forEach((e=>{const i=Reflect.get(t,e,n);if(Cd.has(i))xd(i,!1),s[e]=i;else if(i instanceof Promise)if(r in i)s[e]=i[r];else{const t=i[o]||i;Object.defineProperty(s,e,{get(){if(r in i)return i[r];throw t}})}else(null==i?void 0:i[Sd])?s[e]=i[Td]:s[e]=i})),Object.freeze(s)}),s=new WeakMap,l=[1],c=(i=>{if(!Ed(i))throw new Error("object required");const c=s.get(i);if(c)return c;let u=l[0];const d=new Set,f=(e,t=++l[0])=>{u!==t&&(u=t,d.forEach((n=>n(e,t))))},p=new Map,m=e=>{let t=p.get(e);return t||(t=(t,n)=>{const r=[...t];r[1]=[e,...r[1]],f(r,n)},p.set(e,t)),t},h=e=>{const t=p.get(e);return p.delete(e),t},g=Array.isArray(i)?[]:Object.create(Object.getPrototypeOf(i)),v={get(e,t,n){return t===kd?u:t===Sd?d:t===Td?a(u,e,n):Reflect.get(e,t,n)},deleteProperty(e,t){const n=Reflect.get(e,t),r=null==n?void 0:n[Sd];r&&r.delete(h(t));const o=Reflect.deleteProperty(e,t);return o&&f(["delete",[t],n]),o},set(t,i,a,s){var l;const c=Reflect.has(t,i),u=Reflect.get(t,i,s);if(c&&e(u,a))return!0;const d=null==u?void 0:u[Sd];let p;return d&&d.delete(h(i)),Ed(a)&&(a=(e=>md(e)&&e[ud]||null)(a)||a),(null==(l=Object.getOwnPropertyDescriptor(t,i))?void 0:l.set)?p=a:a instanceof Promise?p=a.then((e=>(p[r]=e,f(["resolve",[i],e]),e))).catch((e=>{p[o]=e,f(["reject",[i],e])})):(null==a?void 0:a[Sd])?(p=a,p[Sd].add(m(i))):n(a)?(p=Id(a),p[Sd].add(m(i))):p=a,Reflect.set(t,i,p,s),f(["set",[i],a,u]),!0}},b=t(g,v);return s.set(i,b),Reflect.ownKeys(i).forEach((e=>{const t=Object.getOwnPropertyDescriptor(i,e);t.get||t.set?Object.defineProperty(g,e,t):b[e]=i[e]})),b}))=>[c,Cd,kd,Sd,Td,e,t,n,r,o,i,a,s,l],[Rd]=Nd();function Id(e={}){return Rd(e)}function Md(e,t,n){let r;(null==e?void 0:e[Sd])||console.warn("Please use proxy object");const o=[],i=e=>{o.push(e),n?t(o.splice(0)):r||(r=Promise.resolve().then((()=>{r=void 0,t(o.splice(0))})))};return e[Sd].add(i),()=>{e[Sd].delete(i)}}function Pd(e){return(null==e?void 0:e[Td])||console.warn("Please use proxy object"),e[Td]}function Od(e){return Cd.add(e),e}const{useSyncExternalStore:Dd}=_d,Ad=(e,t)=>{const n=(0,b.useRef)();(0,b.useEffect)((()=>{n.current=((e,t)=>{const n=[],r=new WeakSet,o=(e,i)=>{if(r.has(e))return;hd(e)&&r.add(e);const a=hd(e)&&t.get(vd(e));a?a.forEach((t=>{o(e[t],i?[...i,t]:[t])})):i&&n.push(i)};return o(e),n})(e,t)})),(0,b.useDebugValue)(n.current)};function Ld(e,t){const n=null==t?void 0:t.sync,r=(0,b.useRef)(),o=(0,b.useRef)();let i=!0;const a=Dd((0,b.useCallback)((t=>{const r=Md(e,t,n);return t(),r}),[e,n]),(()=>{const t=Pd(e);try{if(!i&&r.current&&o.current&&!wd(r.current,t,o.current,new WeakMap))return r.current}catch(e){}return t}),(()=>Pd(e)));i=!1;const s=new WeakMap;(0,b.useEffect)((()=>{r.current=a,o.current=s})),Ad(a,s);const l=(0,b.useMemo)((()=>new WeakMap),[]);return bd(a,s,l)}Symbol();function zd(e){const t=Id({data:Array.from(e||[]),has(e){return this.data.some((t=>t[0]===e))},set(e,t){const n=this.data.find((t=>t[0]===e));return n?n[1]=t:this.data.push([e,t]),this},get(e){var t;return null==(t=this.data.find((t=>t[0]===e)))?void 0:t[1]},delete(e){const t=this.data.findIndex((t=>t[0]===e));return-1!==t&&(this.data.splice(t,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},toJSON(){return{}},forEach(e){this.data.forEach((t=>{e(t[1],t[0],this)}))},keys(){return this.data.map((e=>e[0])).values()},values(){return this.data.map((e=>e[1])).values()},entries(){return new Map(this.data).entries()},get[Symbol.toStringTag](){return"Map"},[Symbol.iterator](){return this.entries()}});return Object.defineProperties(t,{data:{enumerable:!1},size:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(t),t}var Bd=(0,s.createContext)({slots:zd(),fills:zd(),registerSlot:()=>{"undefined"!=typeof process&&process.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});function Fd(e){const{updateSlot:t,unregisterSlot:n,registerFill:r,unregisterFill:o,...i}=(0,s.useContext)(Bd);return{...Ld(i.slots,{sync:!0}).get(e),updateSlot:(0,s.useCallback)((n=>{t(e,n)}),[e,t]),unregisterSlot:(0,s.useCallback)((t=>{n(e,t)}),[e,n]),registerFill:(0,s.useCallback)((t=>{r(e,t)}),[e,r]),unregisterFill:(0,s.useCallback)((t=>{o(e,t)}),[e,o])}}var Vd=(0,s.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});var Hd=e=>{const{getSlot:t,subscribe:n}=(0,s.useContext)(Vd);return(0,s.useSyncExternalStore)(n,(()=>t(e)),(()=>t(e)))};function jd(e){let{name:t,children:n,registerFill:r,unregisterFill:o}=e;const i=Hd(t),a=(0,s.useRef)({name:t,children:n});return(0,s.useLayoutEffect)((()=>{const e=a.current;return r(t,e),()=>o(t,e)}),[]),(0,s.useLayoutEffect)((()=>{a.current.children=n,i&&i.forceUpdate()}),[n]),(0,s.useLayoutEffect)((()=>{t!==a.current.name&&(o(a.current.name,a.current),a.current.name=t,r(t,a.current))}),[t]),i&&i.node?("function"==typeof n&&(n=n(i.props.fillProps)),(0,s.createPortal)(n,i.node)):null}var $d=e=>(0,s.createElement)(Vd.Consumer,null,(t=>{let{registerFill:n,unregisterFill:r}=t;return(0,s.createElement)(jd,a({},e,{registerFill:n,unregisterFill:r}))}));function Wd(e){return"function"==typeof e}class Ud extends s.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;this.isUnmounted=!1,e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:n,registerSlot:r}=this.props;e.name!==t&&(n(e.name),r(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){var e;const{children:t,name:n,fillProps:r={},getFills:o}=this.props,i=(null!==(e=o(n,this))&&void 0!==e?e:[]).map((e=>{const t=Wd(e.children)?e.children(r):e.children;return s.Children.map(t,((e,t)=>{if(!e||"string"==typeof e)return e;const n=e.key||t;return(0,s.cloneElement)(e,{key:n})}))})).filter((e=>!(0,s.isEmptyElement)(e)));return(0,s.createElement)(s.Fragment,null,Wd(t)?t(i):i)}}var Gd,Yd=e=>(0,s.createElement)(Vd.Consumer,null,(t=>{let{registerSlot:n,unregisterSlot:r,getFills:o}=t;return(0,s.createElement)(Ud,a({},e,{registerSlot:n,unregisterSlot:r,getFills:o}))})),qd=new Uint8Array(16);function Kd(){if(!Gd&&!(Gd="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Gd(qd)}var Xd=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var Zd=function(e){return"string"==typeof e&&Xd.test(e)},Jd=[],Qd=0;Qd<256;++Qd)Jd.push((Qd+256).toString(16).substr(1));var ef=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Jd[e[t+0]]+Jd[e[t+1]]+Jd[e[t+2]]+Jd[e[t+3]]+"-"+Jd[e[t+4]]+Jd[e[t+5]]+"-"+Jd[e[t+6]]+Jd[e[t+7]]+"-"+Jd[e[t+8]]+Jd[e[t+9]]+"-"+Jd[e[t+10]]+Jd[e[t+11]]+Jd[e[t+12]]+Jd[e[t+13]]+Jd[e[t+14]]+Jd[e[t+15]]).toLowerCase();if(!Zd(n))throw TypeError("Stringified UUID is invalid");return n};var tf=function(e,t,n){var r=(e=e||{}).random||(e.rng||Kd)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return ef(r)};const nf=new Set,rf=sc()((e=>{let t=tf().replace(/[0-9]/g,"");for(;nf.has(t);)t=tf().replace(/[0-9]/g,"");return nf.add(t),uu({container:e,key:t})}));var of=function(e){const{children:t,document:n}=e;if(!n)return null;const r=rf(n.head);return(0,s.createElement)(Su,{value:r},t)};function af(){const[,e]=(0,s.useState)({}),t=(0,s.useRef)(!0);return(0,s.useEffect)((()=>(t.current=!0,()=>{t.current=!1})),[]),()=>{t.current&&e({})}}function sf(e){let{name:t,children:n}=e;const{registerFill:r,unregisterFill:o,...i}=Fd(t),a=(0,s.useRef)({rerender:af()});if((0,s.useEffect)((()=>(r(a),()=>{o(a)})),[r,o]),!i.ref||!i.ref.current)return null;"function"==typeof n&&(n=n(i.fillProps));const l=(0,s.createElement)(of,{document:i.ref.current.ownerDocument},n);return(0,s.createPortal)(l,i.ref.current)}var lf=(0,s.forwardRef)((function(e,t){let{name:n,fillProps:r={},as:o="div",...i}=e;const{registerSlot:l,unregisterSlot:c,...u}=(0,s.useContext)(Bd),f=(0,s.useRef)();return(0,s.useLayoutEffect)((()=>(l(n,f,r),()=>{c(n,f)})),[l,c,n]),(0,s.useLayoutEffect)((()=>{u.updateSlot(n,r)})),(0,s.createElement)(o,a({ref:(0,d.useMergeRefs)([t,f])},i))})),cf=window.wp.isShallowEqual,uf=n.n(cf);function df(e){let{children:t}=e;const n=function(){const e=(0,s.useRef)(zd()),t=(0,s.useRef)(zd()),n=(0,s.useCallback)(((t,n,r)=>{const o=e.current.get(t)||{};e.current.set(t,Od({...o,ref:n||o.ref,fillProps:r||o.fillProps||{}}))}),[]),r=(0,s.useCallback)(((t,n)=>{var r;(null===(r=e.current.get(t))||void 0===r?void 0:r.ref)===n&&e.current.delete(t)}),[]),o=(0,s.useCallback)(((n,r)=>{const o=e.current.get(n);if(o&&!uf()(o.fillProps,r)){o.fillProps=r;const e=t.current.get(n);e&&e.map((e=>e.current.rerender()))}}),[]),i=(0,s.useCallback)(((e,n)=>{t.current.set(e,Od([...t.current.get(e)||[],n]))}),[]),a=(0,s.useCallback)(((e,n)=>{t.current.get(e)&&t.current.set(e,Od(t.current.get(e).filter((e=>e!==n))))}),[]);return(0,s.useMemo)((()=>({slots:e.current,fills:t.current,registerSlot:n,updateSlot:o,unregisterSlot:r,registerFill:i,unregisterFill:a})),[n,o,r,i,a])}();return(0,s.createElement)(Bd.Provider,{value:n},t)}class ff extends s.Component{constructor(){super(...arguments),this.registerSlot=this.registerSlot.bind(this),this.registerFill=this.registerFill.bind(this),this.unregisterSlot=this.unregisterSlot.bind(this),this.unregisterFill=this.unregisterFill.bind(this),this.getSlot=this.getSlot.bind(this),this.getFills=this.getFills.bind(this),this.hasFills=this.hasFills.bind(this),this.subscribe=this.subscribe.bind(this),this.slots={},this.fills={},this.listeners=[],this.contextValue={registerSlot:this.registerSlot,unregisterSlot:this.unregisterSlot,registerFill:this.registerFill,unregisterFill:this.unregisterFill,getSlot:this.getSlot,getFills:this.getFills,hasFills:this.hasFills,subscribe:this.subscribe}}registerSlot(e,t){const n=this.slots[e];this.slots[e]=t,this.triggerListeners(),this.forceUpdateSlot(e),n&&n.forceUpdate()}registerFill(e,t){this.fills[e]=[...this.fills[e]||[],t],this.forceUpdateSlot(e)}unregisterSlot(e,t){this.slots[e]===t&&(delete this.slots[e],this.triggerListeners())}unregisterFill(e,t){var n,r;this.fills[e]=null!==(n=null===(r=this.fills[e])||void 0===r?void 0:r.filter((e=>e!==t)))&&void 0!==n?n:[],this.forceUpdateSlot(e)}getSlot(e){return this.slots[e]}getFills(e,t){return this.slots[e]!==t?[]:this.fills[e]}hasFills(e){return this.fills[e]&&!!this.fills[e].length}forceUpdateSlot(e){const t=this.getSlot(e);t&&t.forceUpdate()}triggerListeners(){this.listeners.forEach((e=>e()))}subscribe(e){return this.listeners.push(e),()=>{this.listeners=this.listeners.filter((t=>t!==e))}}render(){return(0,s.createElement)(Vd.Provider,{value:this.contextValue},this.props.children)}}function pf(e){return(0,s.createElement)(s.Fragment,null,(0,s.createElement)($d,e),(0,s.createElement)(sf,e))}const mf=(0,s.forwardRef)(((e,t)=>{let{bubblesVirtually:n,...r}=e;return n?(0,s.createElement)(lf,a({},r,{ref:t})):(0,s.createElement)(Yd,r)}));function hf(e){let{children:t,...n}=e;return(0,s.createElement)(ff,n,(0,s.createElement)(df,null,t))}function gf(e){const t=t=>(0,s.createElement)(pf,a({name:e},t));t.displayName=e+"Fill";const n=t=>(0,s.createElement)(mf,a({name:e},t));return n.displayName=e+"Slot",n.__unstableName=e,{Fill:t,Slot:n}}const vf={bottom:"bottom",top:"top","middle left":"left","middle right":"right","bottom left":"bottom-end","bottom center":"bottom","bottom right":"bottom-start","top left":"top-end","top center":"top","top right":"top-start","middle left left":"left","middle left right":"left","middle left bottom":"left-end","middle left top":"left-start","middle right left":"right","middle right right":"right","middle right bottom":"right-end","middle right top":"right-start","bottom left left":"bottom-end","bottom left right":"bottom-end","bottom left bottom":"bottom-end","bottom left top":"bottom-end","bottom center left":"bottom","bottom center right":"bottom","bottom center bottom":"bottom","bottom center top":"bottom","bottom right left":"bottom-start","bottom right right":"bottom-start","bottom right bottom":"bottom-start","bottom right top":"bottom-start","top left left":"top-end","top left right":"top-end","top left bottom":"top-end","top left top":"top-end","top center left":"top","top center right":"top","top center bottom":"top","top center top":"top","top right left":"top-start","top right right":"top-start","top right bottom":"top-start","top right top":"top-start",middle:"bottom","middle center":"bottom","middle center bottom":"bottom","middle center left":"bottom","middle center right":"bottom","middle center top":"bottom"},bf=e=>{var t;return null!==(t=vf[e])&&void 0!==t?t:"bottom"},yf={top:{originX:.5,originY:1},"top-start":{originX:0,originY:1},"top-end":{originX:1,originY:1},right:{originX:0,originY:.5},"right-start":{originX:0,originY:0},"right-end":{originX:0,originY:1},bottom:{originX:.5,originY:0},"bottom-start":{originX:0,originY:0},"bottom-end":{originX:1,originY:0},left:{originX:1,originY:.5},"left-start":{originX:1,originY:0},"left-end":{originX:1,originY:1}},wf=e=>{var t;const n=null==e||null===(t=e.defaultView)||void 0===t?void 0:t.frameElement;if(!n)return;const r=n.getBoundingClientRect();return{x:r.left,y:r.top}};function xf(e){return e.split("-")[0]}function _f(e){return["top","bottom"].includes(xf(e))?"x":"y"}function Ef(e){return"x"===e?"y":"x"}const Cf=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{options:e,fn(t){var n;const{x:r,y:o,placement:i,rects:a,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=e,d={x:r,y:o},f=_f(i),p=Ef(f);let m=d[f],h=d[p];const g="function"==typeof l?l(t):l,v="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g},b={x:0,y:0,...null===(n=s.frameOffset)||void 0===n?void 0:n.amount};if(c){const e="y"===f?"height":"width",t=a.reference[f]-a.floating[e]+v.mainAxis+b[f],n=a.reference[f]+a.reference[e]-v.mainAxis+b[f];mn&&(m=n)}if(u){var y,w,x,_;const e="y"===f?"width":"height",t=["top","left"].includes(xf(i)),n=a.reference[p]-a.floating[e]+(t&&null!==(y=null===(w=s.offset)||void 0===w?void 0:w[p])&&void 0!==y?y:0)+(t?0:v.crossAxis)+b[p],r=a.reference[p]+a.reference[e]+(t?0:null!==(x=null===(_=s.offset)||void 0===_?void 0:_[p])&&void 0!==x?x:0)-(t?v.crossAxis:0)+b[p];hr&&(h=r)}return{[f]:m,[p]:h}}}},kf="Popover",Sf=()=>(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:"components-popover__triangle",role:"presentation"},(0,s.createElement)(i.Path,{className:"components-popover__triangle-bg",d:"M 0 0 L 50 50 L 100 0"}),(0,s.createElement)(i.Path,{className:"components-popover__triangle-border",d:"M 0 0 L 50 50 L 100 0",vectorEffect:"non-scaling-stroke"})),Tf=(0,s.forwardRef)(((e,t)=>{let{style:n,placement:r,shouldAnimate:o=!1,...i}=e;const[l,c]=(0,s.useState)(!1),u=function(){!Bt.current&&Ft();const[e]=(0,b.useState)(zt.current);return e}(),{style:d,...f}=(0,s.useMemo)((()=>(e=>{const t=e.startsWith("top")||e.startsWith("bottom")?"translateY":"translateX",n=e.startsWith("top")||e.startsWith("left")?1:-1;return{style:yf[e],initial:{opacity:0,scale:0,[t]:2*n+"em"},animate:{opacity:1,scale:1,[t]:0},transition:{duration:.1,ease:[0,0,.2,1]}}})(r)),[r]),p=(0,s.useCallback)((()=>c(!0)),[]),m=o&&!u?{style:{...d,...n},...f,onAnimationComplete:p,animate:!l&&f.animate}:{animate:!1,style:n};return(0,s.createElement)(Gl.div,a({},m,i,{ref:t}))})),Nf=(0,s.createContext)(void 0),Rf=(0,s.forwardRef)(((e,t)=>{var n,r,o,i;const{animate:l=!0,headerTitle:u,onClose:f,children:p,className:m,noArrow:h=!0,position:g,placement:v="bottom-start",offset:b=0,focusOnMount:y="firstElement",anchor:w,expandOnMobile:x,onFocusOutside:_,__unstableSlotName:E=kf,flip:C=!0,resize:k=!0,shift:S=!1,variant:T,__unstableForcePosition:N,anchorRef:R,anchorRect:I,getAnchorRect:M,isAlternate:P,...O}=e;let D=C,A=k;void 0!==N&&(Kl()("`__unstableForcePosition` prop in wp.components.Popover",{since:"6.1",version:"6.3",alternative:"`flip={ false }` and `resize={ false }`"}),D=!N,A=!N),void 0!==R&&Kl()("`anchorRef` prop in wp.components.Popover",{since:"6.1",alternative:"`anchor` prop"}),void 0!==I&&Kl()("`anchorRect` prop in wp.components.Popover",{since:"6.1",alternative:"`anchor` prop"}),void 0!==M&&Kl()("`getAnchorRect` prop in wp.components.Popover",{since:"6.1",alternative:"`anchor` prop"});const L=P?"toolbar":T;void 0!==P&&Kl()("`isAlternate` prop in wp.components.Popover",{since:"6.2",alternative:"`variant` prop with the `'toolbar'` value"});const z=(0,s.useRef)(null),[B,F]=(0,s.useState)(null),[V,H]=(0,s.useState)(),j=(0,s.useCallback)((e=>{F(e)}),[]),$=(0,d.useViewportMatch)("medium","<"),W=x&&$,U=!W&&!h,G=g?bf(g):v,Y=(0,s.useRef)(wf(V)),q=[{name:"frameOffset",fn(e){let{x:t,y:n}=e;return Y.current?{x:t+Y.current.x,y:n+Y.current.y,data:{amount:Y.current}}:{x:t,y:n}}},Ye(b),D?Ge():void 0,A?Xe({apply(e){var t;const{firstElementChild:n}=null!==(t=oe.floating.current)&&void 0!==t?t:{};n instanceof HTMLElement&&Object.assign(n.style,{maxHeight:`${e.availableHeight}px`,overflow:"auto"})}}):void 0,S?Ke({crossAxis:!0,limiter:Cf(),padding:1}):void 0,At({element:z})].filter((e=>void 0!==e)),K=(0,s.useContext)(Nf)||E,X=Fd(K);let Z;(f||_)&&(Z=(e,t)=>{"focus-outside"===e&&_?_(t):f&&f()});const[J,Q]=(0,d.__experimentalUseDialog)({focusOnMount:y,__unstableOnClose:Z,onClose:Z}),{x:ee,y:te,reference:ne,floating:re,refs:oe,strategy:ie,update:ae,placement:se,middlewareData:{arrow:le}}=Dt({placement:G,middleware:q,whileElementsMounted:(e,t,n)=>function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=o||i?[...ot(e)?Ct(e):e.contextElement?Ct(e.contextElement):[],...Ct(t)]:[];l.forEach((e=>{const t=!ot(e)&&e.toString().includes("V");!o||s&&!t||e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));let c,u=null;a&&(u=new ResizeObserver((()=>{n()})),ot(e)&&!s&&u.observe(e),ot(e)||!e.contextElement||s||u.observe(e.contextElement),u.observe(t));let d=s?bt(e):null;return s&&function t(){const r=bt(e);!d||r.x===d.x&&r.y===d.y&&r.width===d.width&&r.height===d.height||n(),d=r,c=requestAnimationFrame(t)}(),n(),()=>{var e;l.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==(e=u)||e.disconnect(),u=null,s&&cancelAnimationFrame(c)}}(e,t,n,{animationFrame:!0})}),ce=(0,s.useCallback)((e=>{z.current=e,ae()}),[ae]),ue=null==R?void 0:R.top,de=null==R?void 0:R.bottom,fe=null==R?void 0:R.startContainer,pe=null==R?void 0:R.current;(0,s.useLayoutEffect)((()=>{const e=(e=>{var t;let n,{anchor:r,anchorRef:o,anchorRect:i,getAnchorRect:a,fallbackReferenceElement:s,fallbackDocument:l}=e;if(r)n=r.ownerDocument;else if(null!=o&&o.top)n=null==o?void 0:o.top.ownerDocument;else if(null!=o&&o.startContainer)n=o.startContainer.ownerDocument;else if(null!=o&&o.current)n=o.current.ownerDocument;else if(o)n=o.ownerDocument;else if(i&&null!=i&&i.ownerDocument)n=i.ownerDocument;else if(a){var c;n=null===(c=a(s))||void 0===c?void 0:c.ownerDocument}return null!==(t=n)&&void 0!==t?t:l})({anchor:w,anchorRef:R,anchorRect:I,getAnchorRect:M,fallbackReferenceElement:B,fallbackDocument:document}),t=(e=>{var t;let{anchor:n,anchorRef:r,anchorRect:o,getAnchorRect:i,fallbackReferenceElement:a}=e,s=null;return n?s=n:null!=r&&r.top?s={getBoundingClientRect(){const e=r.top.getBoundingClientRect(),t=r.bottom.getBoundingClientRect();return new window.DOMRect(e.x,e.y,e.width,t.bottom-e.top)}}:null!=r&&r.current?s=r.current:r?s=r:o?s={getBoundingClientRect(){return o}}:i?s={getBoundingClientRect(){var e,t,n,r;const o=i(a);return new window.DOMRect(null!==(e=o.x)&&void 0!==e?e:o.left,null!==(t=o.y)&&void 0!==t?t:o.top,null!==(n=o.width)&&void 0!==n?n:o.right-o.left,null!==(r=o.height)&&void 0!==r?r:o.bottom-o.top)}}:a&&(s=a.parentElement),null!==(t=s)&&void 0!==t?t:null})({anchor:w,anchorRef:R,anchorRect:I,getAnchorRect:M,fallbackReferenceElement:B});ne(t),H(e)}),[w,R,ue,de,fe,pe,I,M,B,ne]),(0,s.useLayoutEffect)((()=>{var e,t;if(V===document||V===(null===(e=oe.floating.current)||void 0===e?void 0:e.ownerDocument)||null==V||null===(t=V.defaultView)||void 0===t||!t.frameElement)return void(Y.current=void 0);const{defaultView:n}=V,r=()=>{Y.current=wf(V),ae()};return n.addEventListener("resize",r),r(),()=>{n.removeEventListener("resize",r)}}),[V,ae,oe.floating]);const me=(0,d.useMergeRefs)([re,J,t]);let he=(0,s.createElement)(Tf,a({shouldAnimate:l&&!W,placement:se,className:c()("components-popover",m,{"is-expanded":W,"is-positioned":null!==ee&&null!==te,[`is-${"toolbar"===L?"alternate":L}`]:L})},O,{ref:me},Q,{tabIndex:-1,style:W?void 0:{position:ie,top:0,left:0,x:Math.round(null!=ee?ee:0)||void 0,y:Math.round(null!=te?te:0)||void 0}}),W&&(0,s.createElement)(sd,null),W&&(0,s.createElement)("div",{className:"components-popover__header"},(0,s.createElement)("span",{className:"components-popover__header-title"},u),(0,s.createElement)(rd,{className:"components-popover__close",icon:Yl,onClick:f})),(0,s.createElement)("div",{className:"components-popover__content"},p),U&&(0,s.createElement)("div",{ref:ce,className:["components-popover__arrow",`is-${se.split("-")[0]}`].join(" "),style:{left:void 0!==(null==le?void 0:le.x)&&Number.isFinite(le.x)?`${le.x+(null!==(n=null===(r=Y.current)||void 0===r?void 0:r.x)&&void 0!==n?n:0)}px`:"",top:void 0!==(null==le?void 0:le.y)&&Number.isFinite(le.y)?`${le.y+(null!==(o=null===(i=Y.current)||void 0===i?void 0:i.y)&&void 0!==o?o:0)}px`:""}},(0,s.createElement)(Sf,null)));return X.ref&&(he=(0,s.createElement)(pf,{name:K},he)),R||I||w?he:(0,s.createElement)("span",{ref:j},he)}));Rf.Slot=(0,s.forwardRef)((function(e,t){let{name:n=kf}=e;return(0,s.createElement)(mf,{bubblesVirtually:!0,name:n,className:"popover-slot",ref:t})})),Rf.__unstableSlotNameProvider=Nf.Provider;var If=Rf;var Mf=function(e){const{shortcut:t,className:n}=e;if(!t)return null;let r,o;return"string"==typeof t&&(r=t),null!==t&&"object"==typeof t&&(r=t.display,o=t.ariaLabel),(0,s.createElement)("span",{className:n,"aria-label":o},r)};const Pf=700,Of=(0,s.createElement)("div",{className:"event-catcher"}),Df=e=>{let{eventHandlers:t,child:n,childrenWithPopover:r,mergedRefs:o}=e;return(0,s.cloneElement)((0,s.createElement)("span",{className:"disabled-element-wrapper"},(0,s.cloneElement)(Of,t),(0,s.cloneElement)(n,{children:r,ref:o})),{...t})},Af=e=>{let{child:t,eventHandlers:n,childrenWithPopover:r,mergedRefs:o}=e;return(0,s.cloneElement)(t,{...n,children:r,ref:o})},Lf=(e,t,n)=>{if(1!==s.Children.count(e))return;const r=s.Children.only(e);r.props.disabled||"function"==typeof r.props[t]&&r.props[t](n)};var zf=function(e){var t;const{children:n,position:r="bottom middle",text:o,shortcut:i,delay:l=Pf,...u}=e,[f,p]=(0,s.useState)(!1),[m,h]=(0,s.useState)(!1),g=(0,d.useDebounce)(h,l),[v,b]=(0,s.useState)(null),y=null===(t=s.Children.toArray(n)[0])||void 0===t?void 0:t.ref,w=(0,d.useMergeRefs)([b,y]),x=e=>{"OPTION"!==e.target.tagName&&(Lf(n,"onMouseDown",e),document.addEventListener("mouseup",C),p(!0))},_=e=>{"OPTION"!==e.target.tagName&&(Lf(n,"onMouseUp",e),document.removeEventListener("mouseup",C),p(!1))},E=e=>"mouseUp"===e?_:"mouseDown"===e?x:void 0,C=E("mouseUp"),k=(e,t)=>r=>{if(Lf(n,e,r),r.currentTarget.disabled)return;if("focus"===r.type&&f)return;g.cancel();const o=["focus","mouseenter"].includes(r.type);o!==m&&(t?g(o):h(o))},S=()=>{g.cancel(),document.removeEventListener("mouseup",C)};if((0,s.useEffect)((()=>S),[]),1!==s.Children.count(n))return n;const T={onMouseEnter:k("onMouseEnter",!0),onMouseLeave:k("onMouseLeave"),onClick:k("onClick"),onFocus:k("onFocus"),onBlur:k("onBlur"),onMouseDown:E("mouseDown")},N=s.Children.only(n),{children:R,disabled:I}=N.props,M=I?Df:Af,P=(e=>{let{anchor:t,grandchildren:n,isOver:r,offset:o,position:i,shortcut:l,text:u,className:d,...f}=e;return(0,s.concatChildren)(n,r&&(0,s.createElement)(If,a({focusOnMount:!1,position:i,className:c()("components-tooltip",d),"aria-hidden":"true",animate:!1,offset:o,anchor:t,shift:!0},f),u,(0,s.createElement)(Mf,{className:"components-tooltip__shortcut",shortcut:l})))})({grandchildren:R,...{anchor:v,isOver:m,offset:4,position:r,shortcut:i,text:o},...u});return M({child:N,eventHandlers:T,childrenWithPopover:P,mergedRefs:w})};const Bf=[["top left","top center","top right"],["center left","center center","center right"],["bottom left","bottom center","bottom right"]],Ff={"top left":(0,u.__)("Top Left"),"top center":(0,u.__)("Top Center"),"top right":(0,u.__)("Top Right"),"center left":(0,u.__)("Center Left"),"center center":(0,u.__)("Center"),center:(0,u.__)("Center"),"center right":(0,u.__)("Center Right"),"bottom left":(0,u.__)("Bottom Left"),"bottom center":(0,u.__)("Bottom Center"),"bottom right":(0,u.__)("Bottom Right")},Vf=Bf.flat();function Hf(e){return("center"===e?"center center":e).replace("-"," ")}function jf(e,t){return`${e}-${Hf(t).replace(" ","-")}`}n(1281);function $f(){for(var e=arguments.length,t=new Array(e),n=0;n0:"number"==typeof e},Gf=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Yf=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},qf=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Kf=function(e){return{r:Yf(e.r,0,255),g:Yf(e.g,0,255),b:Yf(e.b,0,255),a:Yf(e.a)}},Xf=function(e){return{r:Gf(e.r),g:Gf(e.g),b:Gf(e.b),a:Gf(e.a,3)}},Zf=/^#([0-9a-f]{3,8})$/i,Jf=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Qf=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),a=i-Math.min(t,n,r),s=a?i===t?(n-r)/a:i===n?2+(r-t)/a:4+(t-n)/a:0;return{h:60*(s<0?s+6:s),s:i?a/i*100:0,v:i/255*100,a:o}},ep=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),a=r*(1-n),s=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:255*[r,s,a,a,l,r][c],g:255*[l,r,r,s,a,a][c],b:255*[a,a,l,r,r,s][c],a:o}},tp=function(e){return{h:qf(e.h),s:Yf(e.s,0,100),l:Yf(e.l,0,100),a:Yf(e.a)}},np=function(e){return{h:Gf(e.h),s:Gf(e.s),l:Gf(e.l),a:Gf(e.a,3)}},rp=function(e){return ep((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},op=function(e){return{h:(t=Qf(e)).h,s:(o=(200-(n=t.s))*(r=t.v)/100)>0&&o<200?n*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,n,r,o},ip=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ap=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,sp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,lp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,cp={string:[[function(e){var t=Zf.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?Gf(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?Gf(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=sp.exec(e)||lp.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Kf({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=ip.exec(e)||ap.exec(e);if(!t)return null;var n,r,o=tp({h:(n=t[1],r=t[2],void 0===r&&(r="deg"),Number(n)*(Wf[r]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return rp(o)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=void 0===o?1:o;return Uf(t)&&Uf(n)&&Uf(r)?Kf({r:Number(t),g:Number(n),b:Number(r),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,o=e.a,i=void 0===o?1:o;if(!Uf(t)||!Uf(n)||!Uf(r))return null;var a=tp({h:Number(t),s:Number(n),l:Number(r),a:Number(i)});return rp(a)},"hsl"],[function(e){var t=e.h,n=e.s,r=e.v,o=e.a,i=void 0===o?1:o;if(!Uf(t)||!Uf(n)||!Uf(r))return null;var a=function(e){return{h:qf(e.h),s:Yf(e.s,0,100),v:Yf(e.v,0,100),a:Yf(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(i)});return ep(a)},"hsv"]]},up=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=Xf(this.rgba)).r,n=e.g,r=e.b,i=(o=e.a)<1?Jf(Gf(255*o)):"","#"+Jf(t)+Jf(n)+Jf(r)+i;var e,t,n,r,o,i},e.prototype.toRgb=function(){return Xf(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Xf(this.rgba)).r,n=e.g,r=e.b,(o=e.a)<1?"rgba("+t+", "+n+", "+r+", "+o+")":"rgb("+t+", "+n+", "+r+")";var e,t,n,r,o},e.prototype.toHsl=function(){return np(op(this.rgba))},e.prototype.toHslString=function(){return t=(e=np(op(this.rgba))).h,n=e.s,r=e.l,(o=e.a)<1?"hsla("+t+", "+n+"%, "+r+"%, "+o+")":"hsl("+t+", "+n+"%, "+r+"%)";var e,t,n,r,o},e.prototype.toHsv=function(){return e=Qf(this.rgba),{h:Gf(e.h),s:Gf(e.s),v:Gf(e.v),a:Gf(e.a,3)};var e},e.prototype.invert=function(){return gp({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),gp(fp(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),gp(fp(this.rgba,-e))},e.prototype.grayscale=function(){return gp(fp(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),gp(mp(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),gp(mp(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?gp({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Gf(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=op(this.rgba);return"number"==typeof e?gp({h:e,s:t.s,l:t.l,a:t.a}):Gf(t.h)},e.prototype.isEqual=function(e){return this.toHex()===gp(e).toHex()},e}(),gp=function(e){return e instanceof hp?e:new hp(e)},vp=[],bp=function(e){e.forEach((function(e){vp.indexOf(e)<0&&(e(hp,cp),vp.push(e))}))};function yp(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var o in n)r[n[o]]=o;var i={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,a,s=r[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var l=this.toRgb(),c=1/0,u="black";if(!i.length)for(var d in n)i[d]=new e(n[d]).toRgb();for(var f in n){var p=(o=l,a=i[f],Math.pow(o.r-a.r,2)+Math.pow(o.g-a.g,2)+Math.pow(o.b-a.b,2));p0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return gp(e).alpha(t).toRgbString()}bp([yp]);const xp="#fff",_p={900:"#1e1e1e",800:"#2f2f2f",700:"#757575",600:"#949494",400:"#ccc",300:"#ddd",200:"#e0e0e0",100:"#f0f0f0"},Ep="var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #006ba1))",Cp={theme:"var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba))",themeDark10:Ep,background:xp,backgroundDisabled:_p[100],border:_p[600],borderHover:_p[700],borderFocus:Ep,borderDisabled:_p[400],textDisabled:_p[600],textDark:xp,darkGrayPlaceholder:wp(_p[900],.62),lightGrayPlaceholder:wp(xp,.65)},kp=Object.freeze({gray:_p,white:xp,alert:{yellow:"#f0b849",red:"#d94f4f",green:"#4ab866"},ui:Cp});function Sp(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transition";switch(t){case"transition":e="transition-duration: 0ms;";break;case"animation":e="animation-duration: 1ms;";break;default:e="\n\t\t\t\tanimation-duration: 1ms;\n\t\t\t\ttransition-duration: 0ms;\n\t\t\t"}return`\n\t\t@media ( prefers-reduced-motion: reduce ) {\n\t\t\t${e};\n\t\t}\n\t`}var Tp={name:"93uojk",styles:"border-radius:2px;box-sizing:border-box;direction:ltr;display:grid;grid-template-columns:repeat( 3, 1fr );outline:none"};const Np=()=>Tp,Rp=Zu("div",{target:"ecapk1j3"})(Np,";border:1px solid transparent;cursor:pointer;grid-template-columns:auto;",(e=>{let{size:t=92}=e;return $f("grid-template-rows:repeat( 3, calc( ",t,"px / 3 ) );width:",t,"px;","")}),";"),Ip=Zu("div",{target:"ecapk1j2"})({name:"1x5gbbj",styles:"box-sizing:border-box;display:grid;grid-template-columns:repeat( 3, 1fr )"}),Mp=e=>$f("background:currentColor;box-sizing:border-box;display:grid;margin:auto;transition:all 120ms linear;",Sp("transition")," ",(e=>{let{isActive:t}=e;return $f("box-shadow:",t?`0 0 0 2px ${kp.gray[900]}`:null,";color:",t?kp.gray[900]:kp.gray[400],";*:hover>&{color:",t?kp.gray[900]:kp.ui.theme,";}","")})(e),";",""),Pp=Zu("span",{target:"ecapk1j1"})("height:6px;width:6px;",Mp,";"),Op=Zu("span",{target:"ecapk1j0"})({name:"rjf3ub",styles:"appearance:none;border:none;box-sizing:border-box;margin:0;display:flex;position:relative;outline:none;align-items:center;justify-content:center;padding:0"});function Dp(e){let{isActive:t=!1,value:n,...r}=e;const o=Ff[n];return(0,s.createElement)(zf,{text:o},(0,s.createElement)(Se,a({as:Op,role:"gridcell"},r),(0,s.createElement)(ed,null,n),(0,s.createElement)(Pp,{isActive:t,role:"presentation"})))}function Ap(e){return(0,b.useState)(e)[0]}function Lp(e){for(var t,n=[[]],r=function(){var e=t.value,r=n.find((function(t){return!t[0]||t[0].groupId===e.groupId}));r?r.push(e):n.push([e])},o=v(e);!(t=o()).done;)r();return n}function zp(e){for(var t,n=[],r=v(e);!(t=r()).done;){var o=t.value;n.push.apply(n,o)}return n}function Bp(e){return e.slice().reverse()}function Fp(e,t){if(t)return null==e?void 0:e.find((function(e){return e.id===t&&!e.disabled}))}function Vp(e,t){return function(e){return"function"==typeof e}(e)?e(t):e}function Hp(e){void 0===e&&(e={});var t=Ap(e).baseId,n=(0,b.useContext)(we),r=(0,b.useRef)(0),o=(0,b.useState)((function(){return t||n()}));return{baseId:o[0],setBaseId:o[1],unstable_idCountRef:r}}function jp(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function $p(e,t){return e.findIndex((function(e){return!(!e.ref.current||!t.ref.current)&&jp(t.ref.current,e.ref.current)}))}function Wp(e){for(var t,n=0,r=v(e);!(t=r()).done;){var o=t.value.length;o>n&&(n=o)}return n}function Up(e){for(var t=Lp(e),n=Wp(t),r=[],o=0;oi&&(n=!0),-1):(r$f({gridTemplateRows:"repeat( 3, calc( 21px / 3))",padding:1.5,maxHeight:24,maxWidth:24},"","")),";",(e=>{let{disablePointerEvents:t}=e;return $f({pointerEvents:t?"none":void 0},"","")}),";"),vm=Zu("span",{target:"erowt50"})("height:2px;width:2px;",Mp,";",(e=>{let{isActive:t}=e;return $f("box-shadow:",t?"0 0 0 1px currentColor":null,";color:currentColor;*:hover>&{color:currentColor;}","")}),";"),bm=Op,ym=24;var wm=function(e){let{className:t,disablePointerEvents:n=!0,size:r=ym,style:o={},value:i="center",...l}=e;const u=function(){const e=Hf(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"center"),t=Vf.indexOf(e);return t>-1?t:void 0}(i),d=(r/ym).toFixed(2),f=c()("component-alignment-matrix-control-icon",t),p={...o,transform:`scale(${d})`};return(0,s.createElement)(gm,a({},l,{className:f,disablePointerEvents:n,role:"presentation",style:p}),Vf.map(((e,t)=>{const n=u===t;return(0,s.createElement)(bm,{key:e},(0,s.createElement)(vm,{isActive:n}))})))};const xm=()=>{};function _m(e){let{className:t,id:n,label:r=(0,u.__)("Alignment Matrix Control"),defaultValue:o="center center",value:i,onChange:l=xm,width:f=92,...p}=e;const[m]=(0,s.useState)(null!=i?i:o),h=function(e){const t=(0,d.useInstanceId)(_m,"alignment-matrix-control");return e||t}(n),g=jf(h,m),v=rm({baseId:h,currentId:g,rtl:(0,u.isRTL)()}),{setCurrentId:b}=v;(0,s.useEffect)((()=>{void 0!==i&&b(jf(h,i))}),[i,b,h]);const y=c()("component-alignment-matrix-control",t);return(0,s.createElement)(fm,a({},p,v,{"aria-label":r,as:Rp,className:y,role:"grid",size:f}),Bf.map(((e,t)=>(0,s.createElement)(hm,a({},v,{as:Ip,role:"row",key:t}),e.map((e=>{const t=jf(h,e),n=v.currentId===t;return(0,s.createElement)(Dp,a({},v,{id:t,isActive:n,key:e,value:e,onFocus:()=>{l(e)},tabIndex:n?0:-1}))}))))))}_m.Icon=wm;var Em=_m;function Cm(e){return"appear"===e?"top":"left"}function km(e){if("loading"===e.type)return c()("components-animate__loading");const{type:t,origin:n=Cm(t)}=e;if("appear"===t){const[e,t="center"]=n.split(" ");return c()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?c()("components-animate__slide-in","is-from-"+n):void 0}function Sm(e){let{type:t,options:n={},children:r}=e;return r({className:km({type:t,...n})})}function Tm(){const e=(0,b.useRef)(!1);return $t((()=>(e.current=!0,()=>{e.current=!1})),[]),e}class Nm extends b.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Rm({children:e,isPresent:t}){const n=(0,b.useId)(),r=(0,b.useRef)(null),o=(0,b.useRef)({width:0,height:0,top:0,left:0});return(0,b.useInsertionEffect)((()=>{const{width:e,height:i,top:a,left:s}=o.current;if(t||!r.current||!e||!i)return;r.current.dataset.motionPopId=n;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${n}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${i}px !important;\n top: ${a}px !important;\n left: ${s}px !important;\n }\n `),()=>{document.head.removeChild(l)}}),[t]),b.createElement(Nm,{isPresent:t,childRef:r,sizeRef:o},b.cloneElement(e,{ref:r}))}const Im=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:a})=>{const s=nn(Mm),l=(0,b.useId)(),c=(0,b.useMemo)((()=>({id:l,initial:t,isPresent:n,custom:o,onExitComplete:e=>{s.set(e,!0);for(const e of s.values())if(!e)return;r&&r()},register:e=>(s.set(e,!1),()=>s.delete(e))})),i?void 0:[n]);return(0,b.useMemo)((()=>{s.forEach(((e,t)=>s.set(t,!1)))}),[n]),b.useEffect((()=>{!n&&!s.size&&r&&r()}),[n]),"popLayout"===a&&(e=b.createElement(Rm,{isPresent:n},e)),b.createElement(jt.Provider,{value:c},e)};function Mm(){return new Map}const Pm=e=>e.key||"";const Om=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:o,presenceAffectsLayout:i=!0,mode:a="sync"})=>{o&&(a="wait",Gr(!1,"Replace exitBeforeEnter with mode='wait'"));let[s]=function(){const e=Tm(),[t,n]=(0,b.useState)(0),r=(0,b.useCallback)((()=>{e.current&&n(t+1)}),[t]);return[(0,b.useCallback)((()=>vo.postRender(r)),[r]),t]}();const l=(0,b.useContext)(an).forceRender;l&&(s=l);const c=Tm(),u=function(e){const t=[];return b.Children.forEach(e,(e=>{(0,b.isValidElement)(e)&&t.push(e)})),t}(e);let d=u;const f=new Set,p=(0,b.useRef)(d),m=(0,b.useRef)(new Map).current,h=(0,b.useRef)(!0);if($t((()=>{h.current=!1,function(e,t){e.forEach((e=>{const n=Pm(e);t.set(n,e)}))}(u,m),p.current=d})),Hr((()=>{h.current=!0,m.clear(),f.clear()})),h.current)return b.createElement(b.Fragment,null,d.map((e=>b.createElement(Im,{key:Pm(e),isPresent:!0,initial:!!n&&void 0,presenceAffectsLayout:i,mode:a},e))));d=[...d];const g=p.current.map(Pm),v=u.map(Pm),y=g.length;for(let e=0;e{if(-1!==v.indexOf(e))return;const n=m.get(e);if(!n)return;const o=g.indexOf(e);d.splice(o,0,b.createElement(Im,{key:Pm(n),isPresent:!1,onExitComplete:()=>{m.delete(e),f.delete(e);const t=p.current.findIndex((t=>t.key===e));if(p.current.splice(t,1),!f.size){if(p.current=u,!1===c.current)return;s(),r&&r()}},custom:t,presenceAffectsLayout:i,mode:a},n))})),d=d.map((e=>{const t=e.key;return f.has(t)?e:b.createElement(Im,{key:Pm(e),isPresent:!0,presenceAffectsLayout:i,mode:a},e)})),"production"!==Wr&&"wait"===a&&d.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.'),b.createElement(b.Fragment,null,f.size?d:d.map((e=>(0,b.cloneElement)(e))))},Dm=(0,s.createContext)({flexItemDisplay:void 0});const Am={name:"zjik7",styles:"display:flex"},Lm={name:"qgaee5",styles:"display:block;max-height:100%;max-width:100%;min-height:0;min-width:0"},zm={name:"82a6rk",styles:"flex:1"},Bm={name:"13nosa1",styles:">*{min-height:0;}"},Fm={name:"1pwxzk4",styles:">*{min-width:0;}"};function Vm(e){const{className:t,display:n,isBlock:r=!1,...o}=Fu(e,"FlexItem"),i={},a=(0,s.useContext)(Dm).flexItemDisplay;i.Base=$f({display:n||a},"","");return{...o,className:Bu()(Lm,i.Base,r&&zm,t)}}var Hm=Vu((function(e,t){const n=function(e){return Vm({isBlock:!0,...Fu(e,"FlexBlock")})}(e);return(0,s.createElement)(Qu,a({},n,{ref:t}))}),"FlexBlock");var jm=Vu((function(e,t){const n=Vm(e);return(0,s.createElement)(Qu,a({},n,{ref:t}))}),"FlexItem");var $m=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));var Wm=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M7 11.5h10V13H7z"}));const Um=["40em","52em","64em"],Gm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{defaultIndex:t=0}=e;if("number"!=typeof t)throw new TypeError(`Default breakpoint index should be a number. Got: ${t}, ${typeof t}`);if(t<0||t>Um.length-1)throw new RangeError(`Default breakpoint index out of range. Theme has ${Um.length} breakpoints, got index ${t}`);const[n,r]=(0,s.useState)(t);return(0,s.useEffect)((()=>{const e=()=>{const e=Um.filter((e=>"undefined"!=typeof window&&window.matchMedia(`screen and (min-width: ${e})`).matches)).length;n!==e&&r(e)};return e(),"undefined"!=typeof window&&window.addEventListener("resize",e),()=>{"undefined"!=typeof window&&window.removeEventListener("resize",e)}}),[n]),n};function Ym(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=Gm(t);if(!Array.isArray(e)&&"function"!=typeof e)return e;const r=e||[];return r[n>=r.length?r.length-1:n]}function qm(e){var t,n;if(void 0===e)return;if(!e)return"0";const r="number"==typeof e?e:Number(e);return"undefined"!=typeof window&&null!==(t=window.CSS)&&void 0!==t&&null!==(n=t.supports)&&void 0!==n&&n.call(t,"margin",e.toString())||Number.isNaN(r)?e.toString():`calc(4px * ${e})`}function Km(e){const{align:t="center",className:n,direction:r="row",expanded:o=!0,gap:i=2,justify:a="space-between",wrap:l=!1,...c}=Fu(function(e){const{isReversed:t,...n}=e;return void 0!==t?(Kl()("Flex isReversed",{alternative:'Flex direction="row-reverse" or "column-reverse"',since:"5.9"}),{...n,direction:t?"row-reverse":"row"}):n}(e),"Flex"),u=Ym(Array.isArray(r)?r:[r]),d="string"==typeof u&&!!u.includes("column"),f=Bu();return{...c,className:(0,s.useMemo)((()=>{const e=$f({alignItems:d?"normal":t,flexDirection:u,flexWrap:l?"wrap":void 0,gap:qm(i),justifyContent:a,height:d&&o?"100%":void 0,width:!d&&o?"100%":void 0},"","");return f(Am,e,d?Bm:Fm,n)}),[t,n,f,u,o,i,d,a,l]),isColumn:d}}var Xm=Vu((function(e,t){const{children:n,isColumn:r,...o}=Km(e);return(0,s.createElement)(Dm.Provider,{value:{flexItemDisplay:r?"block":void 0}},(0,s.createElement)(Qu,a({},o,{ref:t}),n))}),"Flex");const Zm={name:"hdknak",styles:"display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"};function Jm(e){return null!=e}function Qm(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;return null!==(e=t.find(Jm))&&void 0!==e?e:n}const eh=e=>"string"==typeof e?(e=>parseFloat(e))(e):e,th="…",nh={auto:"auto",head:"head",middle:"middle",tail:"tail",none:"none"},rh={ellipsis:th,ellipsizeMode:nh.auto,limit:0,numberOfLines:0};function oh(e,t,n,r){if("string"!=typeof e)return"";const o=e.length,i=~~t,a=~~n,s=Jm(r)?r:th;return 0===i&&0===a||i>=o||a>=o||i+a>=o?e:0===a?e.slice(0,i)+s:e.slice(0,i)+s+e.slice(o-a)}function ih(e){const{className:t,children:n,ellipsis:r=th,ellipsizeMode:o=nh.auto,limit:i=0,numberOfLines:a=0,...l}=Fu(e,"Truncate"),c=Bu(),u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;const n={...rh,...t},{ellipsis:r,ellipsizeMode:o,limit:i}=n;if(o===nh.none)return e;let a,s;switch(o){case nh.head:a=0,s=i;break;case nh.middle:a=Math.floor(i/2),s=Math.floor(i/2);break;default:a=i,s=0}return o!==nh.auto?oh(e,a,s,r):e}("string"==typeof n?n:"",{ellipsis:r,ellipsizeMode:o,limit:i,numberOfLines:a}),d=o===nh.auto;return{...l,className:(0,s.useMemo)((()=>c(d&&!a&&Zm,d&&!!a&&$f("-webkit-box-orient:vertical;-webkit-line-clamp:",a,";display:-webkit-box;overflow:hidden;",""),t)),[t,c,a,d]),children:u}}let ah;bp([yp]);const sh=sc()((function(e){var t,n;if("string"!=typeof e)return"";if("string"==typeof(n=e)&&gp(n).isValid())return e;if(!e.includes("var("))return"";if("undefined"==typeof document)return"";const r=function(){if("undefined"!=typeof document){if(!ah){const e=document.createElement("div");e.setAttribute("data-g2-color-computation-node",""),document.body.appendChild(e),ah=e}return ah}}();if(!r)return"";r.style.background=e;const o=null===(t=window)||void 0===t?void 0:t.getComputedStyle(r).background;return r.style.background="",o||""}));function lh(e){const t=function(e){const t=sh(e);return gp(t).isLight()?"#000000":"#ffffff"}(e);return"#000000"===t?"dark":"light"}const ch="36px",uh="12px",dh={controlSurfaceColor:kp.white,controlTextActiveColor:kp.ui.theme,controlPaddingX:uh,controlPaddingXLarge:"calc(12px * 1.3334)",controlPaddingXSmall:"calc(12px / 1.3334)",controlBackgroundColor:kp.white,controlBorderRadius:"2px",controlBoxShadow:"transparent",controlBoxShadowFocus:`0 0 0 0.5px ${kp.ui.theme}`,controlDestructiveBorderColor:kp.alert.red,controlHeight:ch,controlHeightXSmall:"calc( 36px * 0.6 )",controlHeightSmall:"calc( 36px * 0.8 )",controlHeightLarge:"calc( 36px * 1.2 )",controlHeightXLarge:"calc( 36px * 1.4 )"},fh={toggleGroupControlBackgroundColor:dh.controlBackgroundColor,toggleGroupControlBorderColor:kp.ui.border,toggleGroupControlBackdropBackgroundColor:dh.controlSurfaceColor,toggleGroupControlBackdropBorderColor:kp.ui.border,toggleGroupControlButtonColorActive:dh.controlBackgroundColor};var ph=Object.assign({},dh,fh,{colorDivider:"rgba(0, 0, 0, 0.1)",colorScrollbarThumb:"rgba(0, 0, 0, 0.2)",colorScrollbarThumbHover:"rgba(0, 0, 0, 0.5)",colorScrollbarTrack:"rgba(0, 0, 0, 0.04)",elevationIntensity:1,radiusBlockUi:"2px",borderWidth:"1px",borderWidthFocus:"1.5px",borderWidthTab:"4px",spinnerSize:16,fontSize:"13px",fontSizeH1:"calc(2.44 * 13px)",fontSizeH2:"calc(1.95 * 13px)",fontSizeH3:"calc(1.56 * 13px)",fontSizeH4:"calc(1.25 * 13px)",fontSizeH5:"13px",fontSizeH6:"calc(0.8 * 13px)",fontSizeInputMobile:"16px",fontSizeMobile:"15px",fontSizeSmall:"calc(0.92 * 13px)",fontSizeXSmall:"calc(0.75 * 13px)",fontLineHeightBase:"1.2",fontWeight:"normal",fontWeightHeading:"600",gridBase:"4px",cardBorderRadius:"2px",cardPaddingXSmall:`${qm(2)}`,cardPaddingSmall:`${qm(4)}`,cardPaddingMedium:`${qm(4)} ${qm(6)}`,cardPaddingLarge:`${qm(6)} ${qm(8)}`,surfaceBackgroundColor:kp.white,surfaceBackgroundSubtleColor:"#F3F3F3",surfaceBackgroundTintColor:"#F5F5F5",surfaceBorderColor:"rgba(0, 0, 0, 0.1)",surfaceBorderBoldColor:"rgba(0, 0, 0, 0.15)",surfaceBorderSubtleColor:"rgba(0, 0, 0, 0.05)",surfaceBackgroundTertiaryColor:kp.white,surfaceColor:kp.white,transitionDuration:"200ms",transitionDurationFast:"160ms",transitionDurationFaster:"120ms",transitionDurationFastest:"100ms",transitionTimingFunction:"cubic-bezier(0.08, 0.52, 0.52, 1)",transitionTimingFunctionControl:"cubic-bezier(0.12, 0.8, 0.32, 1)"});const mh=$f("color:",kp.gray[900],";line-height:",ph.fontLineHeightBase,";margin:0;",""),hh={name:"4zleql",styles:"display:block"},gh=$f("color:",kp.alert.green,";",""),vh=$f("color:",kp.alert.red,";",""),bh=$f("color:",kp.gray[700],";",""),yh=$f("mark{background:",kp.alert.yellow,";border-radius:2px;box-shadow:0 0 0 1px rgba( 0, 0, 0, 0.05 ) inset,0 -1px 0 rgba( 0, 0, 0, 0.1 ) inset;}",""),wh={name:"50zrmy",styles:"text-transform:uppercase"};var xh=n(3138);const _h=sc()((e=>{const t={};for(const n in e)t[n.toLowerCase()]=e[n];return t}));const Eh={body:13,caption:10,footnote:11,largeTitle:28,subheadline:12,title:20},Ch=[1,2,3,4,5,6].flatMap((e=>[e,e.toString()]));function kh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:13;if(e in Eh)return kh(Eh[e]);if("number"!=typeof e){const t=parseFloat(e);if(Number.isNaN(t))return e;e=t}const t=`(${e} / 13)`;return`calc(${t} * ${ph.fontSize})`}function Sh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(!Ch.includes(e))return kh(e);const t=`fontSizeH${e}`;return ph[t]}var Th={name:"50zrmy",styles:"text-transform:uppercase"};function Nh(t){const{adjustLineHeightForInnerControls:n,align:r,children:o,className:i,color:a,ellipsizeMode:l,isDestructive:c=!1,display:u,highlightEscape:d=!1,highlightCaseSensitive:f=!1,highlightWords:p,highlightSanitize:m,isBlock:h=!1,letterSpacing:g,lineHeight:v,optimizeReadabilityFor:b,size:y,truncate:w=!1,upperCase:x=!1,variant:_,weight:E=ph.fontWeight,...C}=Fu(t,"Text");let k=o;const S=Array.isArray(p),T="caption"===y;if(S){if("string"!=typeof o)throw new TypeError("`children` of `Text` must only be `string` types when `highlightWords` is defined");k=function(e){let{activeClassName:t="",activeIndex:n=-1,activeStyle:r,autoEscape:o,caseSensitive:i=!1,children:a,findChunks:l,highlightClassName:c="",highlightStyle:u={},highlightTag:d="mark",sanitize:f,searchWords:p=[],unhighlightClassName:m="",unhighlightStyle:h}=e;if(!a)return null;if("string"!=typeof a)return a;const g=a,v=(0,xh.findAll)({autoEscape:o,caseSensitive:i,findChunks:l,sanitize:f,searchWords:p,textToHighlight:g}),b=d;let y,w=-1,x="";const _=v.map(((e,o)=>{const a=g.substr(e.start,e.end-e.start);if(e.highlight){let e;w++,"object"==typeof c?i?e=c[a]:(c=_h(c),e=c[a.toLowerCase()]):e=c;const l=w===+n;x=`${e} ${l?t:""}`,y=!0===l&&null!==r?Object.assign({},u,r):u;const d={children:a,className:x,key:o,style:y};return"string"!=typeof b&&(d.highlightIndex=w),(0,s.createElement)(b,d)}return(0,s.createElement)("span",{children:a,className:m,key:o,style:h})}));return _}({autoEscape:d,children:o,caseSensitive:f,searchWords:p,sanitize:m})}const N=Bu();let R;!0===w&&(R="auto"),!1===w&&(R="none");const I=ih({...C,className:(0,s.useMemo)((()=>{const t={},o=function(e,t){if(t)return t;if(!e)return;let n=`calc(${ph.controlHeight} + ${qm(2)})`;switch(e){case"large":n=`calc(${ph.controlHeightLarge} + ${qm(2)})`;break;case"small":n=`calc(${ph.controlHeightSmall} + ${qm(2)})`;break;case"xSmall":n=`calc(${ph.controlHeightXSmall} + ${qm(2)})`}return n}(n,v);if(t.Base=$f({color:a,display:u,fontSize:kh(y),fontWeight:E,lineHeight:o,letterSpacing:g,textAlign:r},"",""),t.upperCase=Th,t.optimalTextColor=null,b){const e="dark"===lh(b);t.optimalTextColor=$f(e?{color:kp.gray[900]}:{color:kp.white},"","")}return N(mh,t.Base,t.optimalTextColor,c&&vh,!!S&&yh,h&&hh,T&&bh,_&&e[_],x&&t.upperCase,i)}),[n,r,i,a,N,u,h,T,c,S,g,v,b,y,x,_,E]),children:o,ellipsizeMode:l||R});return!w&&Array.isArray(o)&&(k=s.Children.map(o,(e=>{if("object"!=typeof e||null===e||!("props"in e))return e;return $u(e,["Link"])?(0,s.cloneElement)(e,{size:e.props.size||"inherit"}):e}))),{...I,children:w?I.children:k}}var Rh=Vu((function(e,t){const n=Nh(e);return(0,s.createElement)(Qu,a({as:"span"},n,{ref:t}))}),"Text");const Ih={name:"9amh4a",styles:"font-size:11px;font-weight:500;line-height:1.4;text-transform:uppercase"},Mh=new RegExp(/-left/g),Ph=new RegExp(/-right/g),Oh=new RegExp(/Left/g),Dh=new RegExp(/Right/g);function Ah(e){return"left"===e?"right":"right"===e?"left":Mh.test(e)?e.replace(Mh,"-right"):Ph.test(e)?e.replace(Ph,"-left"):Oh.test(e)?e.replace(Oh,"Right"):Dh.test(e)?e.replace(Dh,"Left"):e}const Lh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.fromEntries(Object.entries(e).map((e=>{let[t,n]=e;return[Ah(t),n]})))};function zh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return()=>t?(0,u.isRTL)()?$f(t,""):$f(e,""):(0,u.isRTL)()?$f(Lh(e),""):$f(e,"")}zh.watch=()=>(0,u.isRTL)();var Bh={name:"1739oy8",styles:"z-index:1"};const Fh=e=>{let{isFocused:t}=e;return t?Bh:""},Vh=Zu(Xm,{target:"em5sgkm7"})("box-sizing:border-box;position:relative;border-radius:2px;padding-top:0;",Fh,";");var Hh={name:"1d3w5wq",styles:"width:100%"};const jh=Zu("div",{target:"em5sgkm6"})("align-items:center;box-sizing:border-box;border-radius:inherit;display:flex;flex:1;position:relative;",(e=>{let{disabled:t}=e;return $f({backgroundColor:t?kp.ui.backgroundDisabled:kp.ui.background},"","")})," ",(e=>{let{__unstableInputWidth:t,labelPosition:n}=e;return t?"side"===n?"":$f("edge"===n?{flex:`0 0 ${t}`}:{width:t},"",""):Hh}),";"),$h=e=>{let{inputSize:t,__next36pxDefaultSize:n}=e;const r={default:{height:36,lineHeight:1,minHeight:36,paddingLeft:qm(4),paddingRight:qm(4)},small:{height:24,lineHeight:1,minHeight:24,paddingLeft:qm(2),paddingRight:qm(2)},"__unstable-large":{height:40,lineHeight:1,minHeight:40,paddingLeft:qm(4),paddingRight:qm(4)}};return n||(r.default={height:30,lineHeight:1,minHeight:30,paddingLeft:qm(2),paddingRight:qm(2)}),r[t]||r.default},Wh=Zu("input",{target:"em5sgkm5"})("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:",kp.gray[900],";display:block;font-family:inherit;margin:0;outline:none;width:100%;",(e=>{let t,n,{isDragging:r,dragCursor:o}=e;return r&&(t=$f("cursor:",o,";user-select:none;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}","")),r&&o&&(n=$f("&:active{cursor:",o,";}","")),$f(t," ",n,";","")})," ",(e=>{let{disabled:t}=e;return t?$f({color:kp.ui.textDisabled},"",""):""})," ",(e=>{let{inputSize:t}=e;const n={default:"13px",small:"11px","__unstable-large":"13px"},r=n[t]||n.default;return r?$f("font-size:","16px",";@media ( min-width: 600px ){font-size:",r,";}",""):""})," ",(e=>$f($h(e),"",""))," ",(e=>{let{paddingInlineStart:t,paddingInlineEnd:n}=e;return $f({paddingInlineStart:t,paddingInlineEnd:n},"","")})," &::-webkit-input-placeholder{line-height:normal;}}"),Uh=Zu(Rh,{target:"em5sgkm4"})("&&&{",Ih,";box-sizing:border-box;display:block;padding-top:0;padding-bottom:0;max-width:100%;z-index:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}"),Gh=e=>(0,s.createElement)(Uh,a({},e,{as:"label"})),Yh=Zu(jm,{target:"em5sgkm3"})({name:"1b6uupn",styles:"max-width:calc( 100% - 10px )"}),qh=Zu("div",{target:"em5sgkm2"})("&&&{box-sizing:border-box;border-radius:inherit;bottom:0;left:0;margin:0;padding:0;pointer-events:none;position:absolute;right:0;top:0;",(e=>{let t,{disabled:n,isFocused:r}=e,o=r?kp.ui.borderFocus:kp.ui.border;return r&&(t=`0 0 0 1px ${kp.ui.borderFocus} inset`),n&&(o=kp.ui.borderDisabled),$f({boxShadow:t,borderColor:o,borderStyle:"solid",borderWidth:1},"","")})," ",zh({paddingLeft:2}),";}"),Kh=Zu("span",{target:"em5sgkm1"})({name:"pvvbxf",styles:"box-sizing:border-box;display:block"}),Xh=Zu("span",{target:"em5sgkm0"})({name:"jgf79h",styles:"align-items:center;align-self:stretch;box-sizing:border-box;display:flex"});const Zh=(0,s.memo)((function(e){let{disabled:t=!1,isFocused:n=!1}=e;return(0,s.createElement)(qh,{"aria-hidden":"true",className:"components-input-control__backdrop",disabled:t,isFocused:n})}));var Jh=Zh;function Qh(e){let{children:t,hideLabelFromVision:n,htmlFor:r,...o}=e;return t?n?(0,s.createElement)(ed,{as:"label",htmlFor:r},t):(0,s.createElement)(Yh,null,(0,s.createElement)(Gh,a({htmlFor:r},o),t)):null}function eg(e,t){let{__next36pxDefaultSize:n,__unstableInputWidth:r,children:o,className:i,disabled:l=!1,hideLabelFromVision:c=!1,labelPosition:u,id:f,isFocused:p=!1,label:m,prefix:h,size:g="default",suffix:v,...b}=e;const y=function(e){const t=(0,d.useInstanceId)(eg);return e||`input-base-control-${t}`}(f),w=c||!m,{paddingLeft:x,paddingRight:_}=$h({inputSize:g,__next36pxDefaultSize:n}),E=(0,s.useMemo)((()=>({InputControlPrefixWrapper:{paddingLeft:x},InputControlSuffixWrapper:{paddingRight:_}})),[x,_]);return(0,s.createElement)(Vh,a({},b,function(e){const t={};switch(e){case"top":t.direction="column",t.expanded=!1,t.gap=0;break;case"bottom":t.direction="column-reverse",t.expanded=!1,t.gap=0;break;case"edge":t.justify="space-between"}return t}(u),{className:i,gap:2,isFocused:p,labelPosition:u,ref:t}),(0,s.createElement)(Qh,{className:"components-input-control__label",hideLabelFromVision:c,labelPosition:u,htmlFor:y},m),(0,s.createElement)(jh,{__unstableInputWidth:r,className:"components-input-control__container",disabled:l,hideLabel:w,labelPosition:u},(0,s.createElement)(oc,{value:E},h&&(0,s.createElement)(Kh,{className:"components-input-control__prefix"},h),o,v&&(0,s.createElement)(Xh,{className:"components-input-control__suffix"},v)),(0,s.createElement)(Jh,{disabled:l,isFocused:p})))}var tg=(0,s.forwardRef)(eg);const ng={toVector(e,t){return void 0===e&&(e=t),Array.isArray(e)?e:[e,e]},add(e,t){return[e[0]+t[0],e[1]+t[1]]},sub(e,t){return[e[0]-t[0],e[1]-t[1]]},addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function rg(e,t,n){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*n):e*t*n/(t+n*e)}function og(e,t,n,r=.15){return 0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):en?+rg(e-n,n-t,r)+n:e}function ig(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function ag(e,t,n){return(t=ig(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lg(e){for(var t=1;t{var n,r;return t.target===e.currentTarget||(null===(n=e.currentTarget)||void 0===n||null===(r=n.contains)||void 0===r?void 0:r.call(n,t.target))}))}(e).map((e=>e.identifier))}function yg(e){const t=vg(e);return hg(e)?t.identifier:t.pointerId}function wg(e){const t=vg(e);return[t.clientX,t.clientY]}function xg(e,...t){return"function"==typeof e?e(...t):e}function _g(){}function Eg(...e){return 0===e.length?_g:1===e.length?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function Cg(e,t){return Object.assign({},t,e||{})}class kg{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:n,args:r}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?xg(n.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:n,shared:r}=this;t.args=this.args;let o=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,function(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i})}return t}(e)),r.down=r.pressed=r.buttons%2==1||r.touches>0,o=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const e=t._delta.map(Math.abs);ng.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);const[i,a]=t._movement,[s,l]=n.threshold,{_step:c,values:u}=t;if(n.hasCustomTransform?(!1===c[0]&&(c[0]=Math.abs(i)>=s&&u[0]),!1===c[1]&&(c[1]=Math.abs(a)>=l&&u[1])):(!1===c[0]&&(c[0]=Math.abs(i)>=s&&Math.sign(i)*s),!1===c[1]&&(c[1]=Math.abs(a)>=l&&Math.sign(a)*l)),t.intentional=!1!==c[0]||!1!==c[1],!t.intentional)return;const d=[0,0];if(n.hasCustomTransform){const[e,t]=u;d[0]=!1!==c[0]?e-c[0]:0,d[1]=!1!==c[1]?t-c[1]:0}else d[0]=!1!==c[0]?i-c[0]:0,d[1]=!1!==c[1]?a-c[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);const f=t.offset,p=t._active&&!t._blocked||t.active;p&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in n&&(t._bounds=xg(n.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));const[m,h]=t.offset,[[g,v],[b,y]]=t._bounds;t.overflow=[mv?1:0,hy?1:0],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);const w=t._active&&n.rubberband||[0,0];if(t.offset=function(e,[t,n],[r,o]){const[[i,a],[s,l]]=e;return[og(t,i,a,r),og(n,s,l,o)]}(t._bounds,t.offset,w),t.delta=ng.sub(t.offset,f),this.computeMovement(),p&&(!t.last||o>32)){t.delta=ng.sub(t.offset,f);const e=t.delta.map(Math.abs);ng.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&o>0&&(t.velocity=[e[0]/o,e[1]/o],t.timeDelta=o)}}emit(){const e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;const r=this.handler(lg(lg(lg({},t),e),{},{[this.aliasKey]:e.values}));void 0!==r&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class Sg extends kg{constructor(...e){super(...e),ag(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=ng.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=ng.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,n=this.config;if(!t.axis&&e){const r="object"==typeof n.axisThreshold?n.axisThreshold[gg(e)]:n.axisThreshold;t.axis=function([e,t],n){const r=Math.abs(e),o=Math.abs(t);return r>o&&r>n?"x":o>r&&o>n?"y":void 0}(t._movement,r)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}const Tg=e=>e,Ng={enabled(e=!0){return e},eventOptions(e,t,n){return lg(lg({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return ng.toVector(e)}},from(e){return"function"==typeof e?e:null!=e?ng.toVector(e):void 0},transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||Tg},threshold(e){return ng.toVector(e,0)}};const Rg=lg(lg({},Ng),{},{axis(e,t,{axis:n}){if(this.lockDirection="lock"===n,!this.lockDirection)return n},axisThreshold(e=0){return e},bounds(e={}){if("function"==typeof e)return t=>Rg.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:o=1/0}=e;return[[t,n],[r,o]]}}),Ig={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};const Mg="undefined"!=typeof window&&window.document&&window.document.createElement;function Pg(){return Mg&&"ontouchstart"in window||Mg&&window.navigator.maxTouchPoints>1}const Og={isBrowser:Mg,gesture:function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),touch:Pg(),touchscreen:Pg(),pointer:Mg&&"onpointerdown"in window,pointerLock:Mg&&"exitPointerLock"in window.document},Dg={mouse:0,touch:0,pen:8},Ag=lg(lg({},Rg),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:o=!1}={}}){return this.pointerLock=r&&Og.pointerLock,Og.touch&&n?"touch":this.pointerLock?"mouse":Og.pointer&&!o?"pointer":Og.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay="number"==typeof n?n:n||void 0===n&&e?250:void 0,Og.touchscreen&&!1!==n)return e||(void 0!==n?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:o=!0}={}}){return this.pointerButtons=r,this.keys=o,!this.pointerLock&&"pointer"===this.device&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:o}){const i=ng.toVector(e,n?r:o?1:0);return this.filterTaps=n,this.tapsThreshold=r,i},swipe({velocity:e=.5,distance:t=50,duration:n=250}={}){return{velocity:this.transform(ng.toVector(e)),distance:this.transform(ng.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold(e){return e?lg(lg({},Dg),e):Dg},keyboardDisplacement(e=10){return e}});lg(lg({},Ng),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!Og.touch&&Og.gesture)return"gesture";if(Og.touch&&r)return"touch";if(Og.touchscreen){if(Og.pointer)return"pointer";if(Og.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const o=e=>{const t=Cg(xg(n,e),{min:-1/0,max:1/0});return[t.min,t.max]},i=e=>{const t=Cg(xg(r,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof n&&"function"!=typeof r?[o(),i()]:e=>[o(e),i(e)]},threshold(e,t,n){this.lockDirection="lock"===n.axis;return ng.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return void 0===e?"ctrlKey":e},pinchOnWheel(e=!0){return e}});lg(lg({},Rg),{},{mouseOnly:(e=!0)=>e});const Lg=lg(lg({},Rg),{},{mouseOnly:(e=!0)=>e}),zg=new Map,Bg=new Map;function Fg(e){zg.set(e.key,e.engine),Bg.set(e.key,e.resolver)}const Vg={key:"drag",engine:class extends Sg{constructor(...e){super(...e),ag(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),r={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=Rg.bounds(r)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout((()=>{this.compute(),this.emit()}),0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,n=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;const r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),r&&r.size>1&&n._pointerActive||(this.start(e),this.setupPointer(e),n._pointerId=yg(e),n._pointerActive=!0,this.computeValues(wg(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==gg(e)?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,n=this.config;if(!t._pointerActive)return;if(t.type===e.type&&e.timeStamp===t.timeStamp)return;const r=yg(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;const o=wg(e);return document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=ng.sub(o,t._values),this.computeValues(o)),ng.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional?(this.timeoutStore.remove("dragDelay"),t.active=!1,void this.startPointerDrag(e)):n.preventScrollAxis&&!t._preventScroll?t.axis?t.axis===n.preventScrollAxis||"xy"===n.preventScrollAxis?(t._active=!1,void this.clean()):(this.timeoutStore.remove("startPointerDrag"),void this.startPointerDrag(e)):void 0:void this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch(e){0}const t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;const r=yg(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[o,i]=t._distance;if(t.tap=o<=n.tapsThreshold&&i<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{const[e,r]=t._delta,[o,i]=t._movement,[a,s]=n.swipe.velocity,[l,c]=n.swipe.distance,u=n.swipe.duration;if(t.elapsedTimea&&Math.abs(o)>l&&(t.swipe[0]=Math.sign(e)),u>s&&Math.abs(i)>c&&(t.swipe[1]=Math.sign(r))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,function(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",(()=>{this.state._step=[0,0],this.startPointerDrag(e)}),this.config.delay)}keyDown(e){const t=Ig[e.key];if(t){const n=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,r),n._keyboardActive=!0,ng.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in Ig&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:Ag},Hg={key:"hover",engine:class extends Sg{constructor(...e){super(...e),ag(this,"ingKey","hovering")}enter(e){this.config.mouseOnly&&"mouse"!==e.pointerType||(this.start(e),this.computeValues(wg(e)),this.compute(e),this.emit())}leave(e){if(this.config.mouseOnly&&"mouse"!==e.pointerType)return;const t=this.state;if(!t._active)return;t._active=!1;const n=wg(e);t._movement=t._delta=ng.sub(n,t._values),this.computeValues(n),this.compute(e),t.delta=t.movement,this.emit()}bind(e){e("pointer","enter",this.enter.bind(this)),e("pointer","leave",this.leave.bind(this))}},resolver:Lg};function jg(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const $g={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=(Og.isBrowser?window:void 0)){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},Wg=["target","eventOptions","window","enabled","transform"];function Ug(e={},t){const n={};for(const[r,o]of Object.entries(t))switch(typeof o){case"function":n[r]=o.call(n,e[r],r,e);break;case"object":n[r]=Ug(e[r],o);break;case"boolean":o&&(n[r]=e[r])}return n}class Gg{constructor(e,t){ag(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,r,o){const i=this._listeners,a=function(e,t=""){const n=cg[e];return e+(n&&n[t]||t)}(t,n),s=lg(lg({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),o);e.addEventListener(a,r,s);const l=()=>{e.removeEventListener(a,r,s),i.delete(l)};return i.add(l),l}clean(){this._listeners.forEach((e=>e())),this._listeners.clear()}}class Yg{constructor(){ag(this,"_timeouts",new Map)}add(e,t,n=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...r))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach((e=>{window.clearTimeout(e)})),this._timeouts.clear()}}class qg{constructor(e){ag(this,"gestures",new Set),ag(this,"_targetEventStore",new Gg(this)),ag(this,"gestureEventStores",{}),ag(this,"gestureTimeoutStores",{}),ag(this,"handlers",{}),ag(this,"config",{}),ag(this,"pointerIds",new Set),ag(this,"touchIds",new Set),ag(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&Kg(e,"drag");t.wheel&&Kg(e,"wheel");t.scroll&&Kg(e,"scroll");t.move&&Kg(e,"move");t.pinch&&Kg(e,"pinch");t.hover&&Kg(e,"hover")}(this,e)}setEventIds(e){return hg(e)?(this.touchIds=new Set(bg(e)),this.touchIds):"pointerId"in e?("pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds):void 0}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,n={}){const r=e,{target:o,eventOptions:i,window:a,enabled:s,transform:l}=r,c=jg(r,Wg);if(n.shared=Ug({target:o,eventOptions:i,window:a,enabled:s,transform:l},$g),t){const e=Bg.get(t);n[t]=Ug(lg({shared:n.shared},c),e)}else for(const e in c){const t=Bg.get(e);t&&(n[e]=Ug(lg({shared:n.shared},c[e]),t))}return n}(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,n={};let r;if(!t.target||(r=t.target(),r)){if(t.enabled){for(const t of this.gestures){const o=this.config[t],i=Xg(n,o.eventOptions,!!r);if(o.enabled){new(zg.get(t))(this,e,t).bind(i)}}const o=Xg(n,t.eventOptions,!!r);for(const t in this.nativeHandlers)o(t,"",(n=>this.nativeHandlers[t](lg(lg({},this.state.shared),{},{event:n,args:e}))),void 0,!0)}for(const e in n)n[e]=Eg(...n[e]);if(!r)return n;for(const e in n){const{device:t,capture:o,passive:i}=mg(e);this._targetEventStore.add(r,t,"",n[e],{capture:o,passive:i})}}}}function Kg(e,t){e.gestures.add(t),e.gestureEventStores[t]=new Gg(e,t),e.gestureTimeoutStores[t]=new Yg}const Xg=(e,t,n)=>(r,o,i,a={},s=!1)=>{var l,c;const u=null!==(l=a.capture)&&void 0!==l?l:t.capture,d=null!==(c=a.passive)&&void 0!==c?c:t.passive;let f=s?r:fg(r,o,u);n&&d&&(f+="Passive"),e[f]=e[f]||[],e[f].push(i)};function Zg(e,t={},n,r){const o=y().useMemo((()=>new qg(e)),[]);if(o.applyHandlers(e,r),o.applyConfig(t,n),y().useEffect(o.effect.bind(o)),y().useEffect((()=>o.clean.bind(o)),[]),void 0===t.target)return o.bind.bind(o)}const Jg=e=>e,Qg={error:null,initialValue:"",isDirty:!1,isDragEnabled:!1,isDragging:!1,isPressEnterToChange:!1,value:""},ev="CHANGE",tv="COMMIT",nv="CONTROL",rv="DRAG_END",ov="DRAG_START",iv="DRAG",av="INVALIDATE",sv="PRESS_DOWN",lv="PRESS_ENTER",cv="PRESS_UP",uv="RESET";function dv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qg;const{value:t}=e;return{...Qg,...e,initialValue:t}}function fv(e){return(t,n)=>{const r={...t};switch(n.type){case nv:return r.value=n.payload.value,r.isDirty=!1,r._event=void 0,r;case cv:case sv:r.isDirty=!1;break;case ov:r.isDragging=!0;break;case rv:r.isDragging=!1;break;case ev:r.error=null,r.value=n.payload.value,t.isPressEnterToChange&&(r.isDirty=!0);break;case tv:r.value=n.payload.value,r.isDirty=!1;break;case uv:r.error=null,r.isDirty=!1,r.value=n.payload.value||t.initialValue;break;case av:r.error=n.payload.error}return r._event=n.payload.event,e(r,n)}}const pv=()=>{};const mv=(0,s.forwardRef)((function(e,t){let{disabled:n=!1,dragDirection:r="n",dragThreshold:o=10,id:i,isDragEnabled:l=!1,isFocused:c,isPressEnterToChange:u=!1,onBlur:d=pv,onChange:f=pv,onDrag:p=pv,onDragEnd:m=pv,onDragStart:h=pv,onFocus:g=pv,onKeyDown:v=pv,onValidate:b=pv,size:y="default",setIsFocused:w,stateReducer:x=(e=>e),value:_,type:E,...C}=e;const{state:k,change:S,commit:T,drag:N,dragEnd:R,dragStart:I,invalidate:M,pressDown:P,pressEnter:O,pressUp:D,reset:A}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jg,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qg,n=arguments.length>2?arguments[2]:void 0;const[r,o]=(0,s.useReducer)(fv(e),dv(t)),i=e=>(t,n)=>{o({type:e,payload:{value:t,event:n}})},a=e=>t=>{o({type:e,payload:{event:t}})},l=e=>t=>{o({type:e,payload:t})},c=i(ev),u=(e,t)=>o({type:av,payload:{error:e,event:t}}),d=i(uv),f=i(tv),p=l(ov),m=l(iv),h=l(rv),g=a(cv),v=a(sv),b=a(lv),y=(0,s.useRef)(r),w=(0,s.useRef)({value:t.value,onChangeHandler:n});return(0,s.useLayoutEffect)((()=>{y.current=r,w.current={value:t.value,onChangeHandler:n}})),(0,s.useLayoutEffect)((()=>{var e;void 0===y.current._event||r.value===w.current.value||r.isDirty||w.current.onChangeHandler(null!==(e=r.value)&&void 0!==e?e:"",{event:y.current._event})}),[r.value,r.isDirty]),(0,s.useLayoutEffect)((()=>{var e;t.value===y.current.value||y.current.isDirty||o({type:nv,payload:{value:null!==(e=t.value)&&void 0!==e?e:""}})}),[t.value]),{change:c,commit:f,dispatch:o,drag:m,dragEnd:h,dragStart:p,invalidate:u,pressDown:v,pressEnter:b,pressUp:g,reset:d,state:r}}(x,{isDragEnabled:l,value:_,isPressEnterToChange:u},f),{value:L,isDragging:z,isDirty:B}=k,F=(0,s.useRef)(!1),V=function(e,t){const n=function(e){let t="ns-resize";switch(e){case"n":case"s":t="ns-resize";break;case"e":case"w":t="ew-resize"}return t}(t);return(0,s.useEffect)((()=>{document.documentElement.style.cursor=e?n:null}),[e,n]),n}(z,r),H=e=>{const t=e.currentTarget.value;try{b(t),T(t,e)}catch(t){M(t,e)}},j=($=e=>{const{distance:t,dragging:n,event:r,target:o}=e;if(e.event={...e.event,target:o},t){if(r.stopPropagation(),!n)return m(e),void R(e);p(e),N(e),z||(h(e),I(e))}},W={axis:"e"===r||"w"===r?"x":"y",threshold:o,enabled:l,pointer:{capture:!1}},Fg(Vg),Zg({drag:$},W||{},"drag"));var $,W;const U=l?j():{};let G;return"number"===E&&(G=e=>{var t;null===(t=C.onMouseDown)||void 0===t||t.call(C,e),e.currentTarget!==e.currentTarget.ownerDocument.activeElement&&e.currentTarget.focus()}),(0,s.createElement)(Wh,a({},C,U,{className:"components-input-control__input",disabled:n,dragCursor:V,isDragging:z,id:i,onBlur:e=>{d(e),null==w||w(!1),!B&&e.target.validity.valid||(F.current=!0,H(e))},onChange:e=>{const t=e.target.value;S(t,e)},onFocus:e=>{g(e),null==w||w(!0)},onKeyDown:e=>{const{key:t}=e;switch(v(e),t){case"ArrowUp":D(e);break;case"ArrowDown":P(e);break;case"Enter":O(e),u&&(e.preventDefault(),H(e));break;case"Escape":u&&B&&(e.preventDefault(),A(_,e))}},onMouseDown:G,ref:t,inputSize:y,value:null!=L?L:"",type:E}))}));var hv=mv,gv={"default.fontFamily":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif","default.fontSize":"13px","helpText.fontSize":"12px",mobileTextMinFontSize:"16px"};function vv(e){return(0,ec.get)(gv,e,"")}const bv={name:"kv6lnz",styles:"box-sizing:border-box;*,*::before,*::after{box-sizing:inherit;}"};const yv=Zu("div",{target:"ej5x27r4"})("font-family:",vv("default.fontFamily"),";font-size:",vv("default.fontSize"),";",bv,";"),wv=Zu("div",{target:"ej5x27r3"})((e=>{let{__nextHasNoMarginBottom:t=!1}=e;return!t&&$f("margin-bottom:",qm(2),";","")})," .components-panel__row &{margin-bottom:inherit;}"),xv=$f(Ih,";display:inline-block;margin-bottom:",qm(2),";padding:0;",""),_v=Zu("label",{target:"ej5x27r2"})(xv,";");var Ev={name:"11yad0w",styles:"margin-bottom:revert"};const Cv=Zu("p",{target:"ej5x27r1"})("margin-top:",qm(2),";margin-bottom:0;font-size:",vv("helpText.fontSize"),";font-style:normal;color:",kp.gray[700],";",(e=>{let{__nextHasNoMarginBottom:t=!1}=e;return!t&&Ev}),";"),kv=Zu("span",{target:"ej5x27r0"})(xv,";"),Sv=e=>{let{__nextHasNoMarginBottom:t=!1,id:n,label:r,hideLabelFromVision:o=!1,help:i,className:a,children:l}=e;return(0,s.createElement)(yv,{className:c()("components-base-control",a)},(0,s.createElement)(wv,{className:"components-base-control__field",__nextHasNoMarginBottom:t},r&&n&&(o?(0,s.createElement)(ed,{as:"label",htmlFor:n},r):(0,s.createElement)(_v,{className:"components-base-control__label",htmlFor:n},r)),r&&!n&&(o?(0,s.createElement)(ed,{as:"label"},r):(0,s.createElement)(Sv.VisualLabel,null,r)),l),!!i&&(0,s.createElement)(Cv,{id:n?n+"__help":void 0,className:"components-base-control__help",__nextHasNoMarginBottom:t},i))};Sv.VisualLabel=e=>{let{className:t,children:n,...r}=e;return(0,s.createElement)(kv,a({},r,{className:c()("components-base-control__label",t)}),n)};var Tv=Sv;const Nv=()=>{};const Rv=(0,s.forwardRef)((function(e,t){let{__next36pxDefaultSize:n,__unstableStateReducer:r=(e=>e),__unstableInputWidth:o,className:i,disabled:l=!1,help:u,hideLabelFromVision:f=!1,id:p,isPressEnterToChange:m=!1,label:h,labelPosition:g="top",onChange:v=Nv,onValidate:b=Nv,onKeyDown:y=Nv,prefix:w,size:x="default",style:_,suffix:E,value:C,...k}=e;const[S,T]=(0,s.useState)(!1),N=function(e){const t=(0,d.useInstanceId)(Rv);return e||`inspector-input-control-${t}`}(p),R=c()("components-input-control",i),I=function(e){const t=(0,s.useRef)(e.value),[n,r]=(0,s.useState)({}),o=void 0!==n.value?n.value:e.value;return(0,s.useLayoutEffect)((()=>{const{current:o}=t;t.current=e.value,void 0===n.value||n.isStale?n.isStale&&e.value!==o&&r({}):r({...n,isStale:!0})}),[e.value,n]),{value:o,onBlur:t=>{var n;r({}),null===(n=e.onBlur)||void 0===n||n.call(e,t)},onChange:(t,n)=>{r((e=>Object.assign(e,{value:t,isStale:!1}))),e.onChange(t,n)}}}({value:C,onBlur:k.onBlur,onChange:v}),M=u?{["string"==typeof u?"aria-describedby":"aria-details"]:`${N}__help`}:{};return(0,s.createElement)(Tv,{className:R,help:u,id:N,__nextHasNoMarginBottom:!0},(0,s.createElement)(tg,{__next36pxDefaultSize:n,__unstableInputWidth:o,disabled:l,gap:3,hideLabelFromVision:f,id:N,isFocused:S,justify:"left",label:h,labelPosition:g,prefix:w,size:x,style:_,suffix:E},(0,s.createElement)(hv,a({},k,M,{__next36pxDefaultSize:n,className:"components-input-control__input",disabled:l,id:N,isFocused:S,isPressEnterToChange:m,onKeyDown:y,onValidate:b,paddingInlineStart:w?qm(2):void 0,paddingInlineEnd:E?qm(2):void 0,ref:t,setIsFocused:T,size:x,stateReducer:r},I))))}));var Iv=Rv;var Mv={name:"euqsgg",styles:"input[type='number']::-webkit-outer-spin-button,input[type='number']::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}input[type='number']{-moz-appearance:textfield;}"};const Pv=e=>{let{hideHTMLArrows:t}=e;return t?Mv:""},Ov=Zu(Iv,{target:"ep09it41"})(Pv,";"),Dv=e=>{let{size:t}=e;return"small"!==t?"":$f("width:",qm(5),";min-width:",qm(5),";height:",qm(5),";","")},Av=Zu(rd,{target:"ep09it40"})("&&&&&{color:",kp.ui.theme,";",Dv,";}");function Lv(e){const t=Number(e);return isNaN(t)?0:t}function zv(){for(var e=arguments.length,t=new Array(e),n=0;ne+Lv(t)),0)}function Bv(e){const t=(e+"").split(".");return void 0!==t[1]?t[1].length:0}function Fv(e,t,n){const r=Lv(e);return Math.max(t,Math.min(r,n))}function Vv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const o=Lv(e),i=Lv(r),a=Bv(r),s=Math.round(o/i)*i,l=Fv(s,t,n);return a?Lv(l.toFixed(a)):l}const Hv={bottom:{align:"flex-end",justify:"center"},bottomLeft:{align:"flex-start",justify:"flex-end"},bottomRight:{align:"flex-end",justify:"flex-end"},center:{align:"center",justify:"center"},edge:{align:"center",justify:"space-between"},left:{align:"center",justify:"flex-start"},right:{align:"center",justify:"flex-end"},stretch:{align:"stretch"},top:{align:"flex-start",justify:"center"},topLeft:{align:"flex-start",justify:"flex-start"},topRight:{align:"flex-start",justify:"flex-end"}},jv={bottom:{justify:"flex-end",align:"center"},bottomLeft:{justify:"flex-start",align:"flex-end"},bottomRight:{justify:"flex-end",align:"flex-end"},center:{justify:"center",align:"center"},edge:{justify:"space-between",align:"center"},left:{justify:"center",align:"flex-start"},right:{justify:"center",align:"flex-end"},stretch:{justify:"stretch"},top:{justify:"flex-start",align:"center"},topLeft:{justify:"flex-start",align:"flex-start"},topRight:{justify:"flex-start",align:"flex-end"}};function $v(e){return"string"==typeof e?[e]:s.Children.toArray(e).filter((e=>(0,s.isValidElement)(e)))}function Wv(e){const{alignment:t="edge",children:n,direction:r,spacing:o=2,...i}=Fu(e,"HStack"),l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"row";if(!Jm(e))return{};const n="column"===t?jv:Hv;return e in n?n[e]:{align:e}}(t,r),c=$v(n).map(((e,t)=>{if($u(e,["Spacer"])){const n=e,r=n.key||`hstack-${t}`;return(0,s.createElement)(jm,a({isBlock:!0,key:r},n.props))}return e}));return Km({children:c,direction:r,justify:"center",...l,...i,gap:o})}var Uv=Vu((function(e,t){const n=Wv(e);return(0,s.createElement)(Qu,a({},n,{ref:t}))}),"HStack");const Gv=e=>null!=e;const Yv=Vu((function(e,t){const n=function(e){const{className:t,margin:n,marginBottom:r=2,marginLeft:o,marginRight:i,marginTop:a,marginX:s,marginY:l,padding:c,paddingBottom:u,paddingLeft:d,paddingRight:f,paddingTop:p,paddingX:m,paddingY:h,...g}=Fu(e,"Spacer");return{...g,className:Bu()(Gv(n)&&$f("margin:",qm(n),";",""),Gv(l)&&$f("margin-bottom:",qm(l),";margin-top:",qm(l),";",""),Gv(s)&&$f("margin-left:",qm(s),";margin-right:",qm(s),";",""),Gv(a)&&$f("margin-top:",qm(a),";",""),Gv(r)&&$f("margin-bottom:",qm(r),";",""),Gv(o)&&zh({marginLeft:qm(o)})(),Gv(i)&&zh({marginRight:qm(i)})(),Gv(c)&&$f("padding:",qm(c),";",""),Gv(h)&&$f("padding-bottom:",qm(h),";padding-top:",qm(h),";",""),Gv(m)&&$f("padding-left:",qm(m),";padding-right:",qm(m),";",""),Gv(p)&&$f("padding-top:",qm(p),";",""),Gv(u)&&$f("padding-bottom:",qm(u),";",""),Gv(d)&&zh({paddingLeft:qm(d)})(),Gv(f)&&zh({paddingRight:qm(f)})(),t)}}(e);return(0,s.createElement)(Qu,a({},n,{ref:t}))}),"Spacer");var qv=Yv;const Kv=()=>{};const Xv=(0,s.forwardRef)((function(e,t){let{__unstableStateReducer:n,className:r,dragDirection:o="n",hideHTMLArrows:i=!1,spinControls:l="native",isDragEnabled:f=!0,isShiftStepEnabled:p=!0,label:m,max:h=1/0,min:g=-1/0,required:v=!1,shiftStep:b=10,step:y=1,type:w="number",value:x,size:_="default",suffix:E,onChange:C=Kv,...k}=e;i&&(Kl()("wp.components.NumberControl hideHTMLArrows prop ",{alternative:'spinControls="none"',since:"6.2",version:"6.3"}),l="none");const S=(0,s.useRef)(),T=(0,d.useMergeRefs)([S,t]),N="any"===y,R=N?1:eh(y),I=Vv(0,g,h,R),M=(e,t)=>N?Math.min(h,Math.max(g,eh(e))):Vv(e,g,h,null!=t?t:R),P="number"===w?"off":void 0,O=c()("components-number-control",r),D=(e,t,n)=>{null==n||n.preventDefault();const r=(null==n?void 0:n.shiftKey)&&p,o=r?eh(b)*R:R;let i=function(e){const t=""===e;return!Jm(e)||t}(e)?I:e;return"up"===t?i=zv(i,o):"down"===t&&(i=function(){for(var e=arguments.length,t=new Array(e),n=0;n{const r=Lv(t);return 0===n?r:e-r}),0)}(i,o)),M(i,r?o:void 0)},A=e=>t=>C(String(D(x,e,t)),{event:{...t,target:S.current}});return(0,s.createElement)(Ov,a({autoComplete:P,inputMode:"numeric"},k,{className:O,dragDirection:o,hideHTMLArrows:"native"!==l,isDragEnabled:f,label:m,max:h,min:g,ref:T,required:v,step:y,type:w,value:x,__unstableStateReducer:(e,t)=>{var r;const i=((e,t)=>{const n={...e},{type:r,payload:i}=t,a=i.event,s=n.value;if(r!==cv&&r!==sv||(n.value=D(s,r===cv?"up":"down",a)),r===iv&&f){const[e,t]=i.delta,r=i.shiftKey&&p,a=r?eh(b)*R:R;let l,c;switch(o){case"n":c=t,l=-1;break;case"e":c=e,l=(0,u.isRTL)()?-1:1;break;case"s":c=t,l=1;break;case"w":c=e,l=(0,u.isRTL)()?1:-1}if(0!==c){c=Math.ceil(Math.abs(c))*Math.sign(c);const e=c*a*l;n.value=M(zv(s,e),r?a:void 0)}}if(r===lv||r===tv){const e=!1===v&&""===s;n.value=e?s:M(s)}return n})(e,t);return null!==(r=null==n?void 0:n(i,t))&&void 0!==r?r:i},size:_,suffix:"custom"===l?(0,s.createElement)(s.Fragment,null,E,(0,s.createElement)(qv,{marginBottom:0,marginRight:2},(0,s.createElement)(Uv,{spacing:1},(0,s.createElement)(Av,{icon:$m,isSmall:!0,"aria-hidden":"true","aria-label":(0,u.__)("Increment"),tabIndex:-1,onClick:A("up"),size:_}),(0,s.createElement)(Av,{icon:Wm,isSmall:!0,"aria-hidden":"true","aria-label":(0,u.__)("Decrement"),tabIndex:-1,onClick:A("down"),size:_})))):E,onChange:C}))}));var Zv=Xv;const Jv=e=>{let{__nextHasNoMarginBottom:t}=e;return t?"":$f("margin-bottom:",qm(2),";","")},Qv=Zu(Xm,{target:"e65ony43"})(Jv,";"),eb=Zu("div",{target:"e65ony42"})("border-radius:50%;border:",ph.borderWidth," solid ",kp.ui.border,";box-sizing:border-box;cursor:grab;height:",32,"px;overflow:hidden;width:",32,"px;"),tb=Zu("div",{target:"e65ony41"})({name:"1r307gh",styles:"box-sizing:border-box;position:relative;width:100%;height:100%;:focus-visible{outline:none;}"}),nb=Zu("div",{target:"e65ony40"})("background:",kp.ui.theme,";border-radius:50%;border:",3,"px solid ",kp.ui.theme,";bottom:0;box-sizing:border-box;display:block;height:0px;left:0;margin:auto;position:absolute;right:0;top:-",16,"px;width:0px;");var rb=function(e){let{value:t,onChange:n,...r}=e;const o=(0,s.useRef)(),i=(0,s.useRef)(),l=(0,s.useRef)(),c=e=>{const{x:t,y:r}=i.current;e.preventDefault(),e.target.focus(),n(function(e,t,n,r){const o=r-t,i=n-e,a=Math.atan2(o,i),s=Math.round(a*(180/Math.PI))+90;if(s<0)return 360+s;return s}(t,r,e.clientX,e.clientY))},{startDrag:u,isDragging:f}=(0,d.__experimentalUseDragging)({onDragStart:e=>{(()=>{const e=o.current.getBoundingClientRect();i.current={x:e.x+e.width/2,y:e.y+e.height/2}})(),c(e)},onDragMove:c,onDragEnd:c});return(0,s.useEffect)((()=>{f?(void 0===l.current&&(l.current=document.body.style.cursor),document.body.style.cursor="grabbing"):(document.body.style.cursor=l.current||null,l.current=void 0)}),[f]),(0,s.createElement)(eb,a({ref:o,onMouseDown:u,className:"components-angle-picker-control__angle-circle",style:f?{cursor:"grabbing"}:void 0},r),(0,s.createElement)(tb,{style:t?{transform:`rotate(${t}deg)`}:void 0,className:"components-angle-picker-control__angle-circle-indicator-wrapper",tabIndex:-1},(0,s.createElement)(nb,{className:"components-angle-picker-control__angle-circle-indicator"})))};function ob(e){let{__nextHasNoMarginBottom:t=!1,className:n,label:r=(0,u.__)("Angle"),onChange:o,value:i}=e;t||Kl()("Bottom margin styles for wp.components.AnglePickerControl",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const a=c()("components-angle-picker-control",n);return(0,s.createElement)(Qv,{__nextHasNoMarginBottom:t,className:a,gap:4},(0,s.createElement)(Hm,null,(0,s.createElement)(Zv,{label:r,className:"components-angle-picker-control__input-field",max:360,min:0,onChange:e=>{const t=""!==e?parseInt(e,10):0;o(t)},size:"__unstable-large",step:"1",value:i,spinControls:"none",suffix:(0,s.createElement)(qv,{as:Rh,marginBottom:0,marginRight:qm(3),style:{color:kp.ui.theme}},"°")})),(0,s.createElement)(jm,{style:{marginBottom:qm(1),marginTop:"auto"}},(0,s.createElement)(rb,{"aria-hidden":"true",value:i,onChange:o})))}var ib=n(4793),ab=n.n(ib),sb=window.wp.richText,lb=window.wp.a11y;const cb=new RegExp(`[${["-","~","­","֊","־","᐀","᠆","‐","‑","‒","–","—","―","⁓","⁻","₋","−","⸗","⸺","⸻","〜","〰","゠","︱","︲","﹘","﹣","-"].join("")}]`,"g"),ub=e=>ab()(e).toLocaleLowerCase().replace(cb,"-");function db(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}function fb(e){return t=>{const[n,r]=(0,s.useState)([]);return(0,s.useLayoutEffect)((()=>{const{options:n,isDebounced:o}=e,i=(0,d.debounce)((()=>{const o=Promise.resolve("function"==typeof n?n(t):n).then((n=>{if(o.canceled)return;const i=n.map(((t,n)=>({key:`${e.name}-${n}`,value:t,label:e.getOptionLabel(t),keywords:e.getOptionKeywords?e.getOptionKeywords(t):[],isDisabled:!!e.isOptionDisabled&&e.isOptionDisabled(t)}))),a=new RegExp("(?:\\b|\\s|^)"+db(t),"i");r(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;const r=[];for(let o=0;oe.test(ab()(t))))&&(r.push(i),r.length===n))break}return r}(a,i))}));return o}),o?250:0),a=i();return()=>{i.cancel(),a&&(a.canceled=!0)}}),[t]),[n]}}function pb(e){const t=e.useItems?e.useItems:fb(e);return function(e){let{filterValue:n,instanceId:r,listBoxId:o,className:i,selectedIndex:a,onChangeOptions:l,onSelect:u,onReset:d,reset:f,value:p,contentRef:m}=e;const[h]=t(n),g=(0,sb.useAnchor)({editableContentElement:m.current,value:p}),v=(0,s.useRef)();return function(e,t){(0,s.useEffect)((()=>{const n=n=>{e.current&&!e.current.contains(n.target)&&t(n)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}}),[t])}(v,f),(0,s.useLayoutEffect)((()=>{l(h)}),[h]),!h.length>0?null:(0,s.createElement)(If,{focusOnMount:!1,onClose:d,placement:"top-start",className:"components-autocomplete__popover",anchor:g,ref:v},(0,s.createElement)("div",{id:o,role:"listbox",className:"components-autocomplete__results"},h.map(((e,t)=>(0,s.createElement)(rd,{key:e.key,id:`components-autocomplete-item-${r}-${e.key}`,role:"option","aria-selected":t===a,disabled:e.isDisabled,className:c()("components-autocomplete__result",i,{"is-selected":t===a}),onClick:()=>u(e)},e.label)))))}}function mb(e){let{record:t,onChange:n,onReplace:r,completers:o,contentRef:i}=e;const a=(0,d.useDebounce)(lb.speak,500),l=(0,d.useInstanceId)(mb),[c,f]=(0,s.useState)(0),[p,m]=(0,s.useState)([]),[h,g]=(0,s.useState)(""),[v,b]=(0,s.useState)(null),[y,w]=(0,s.useState)(null),x=(0,s.useRef)(!1);function _(e){const{getOptionCompletion:o}=v||{};if(!e.isDisabled){if(o){const i=o(e.value,h),{action:a,value:l}=void 0===i.action||void 0===i.value?{action:"insert-at-caret",value:i}:i;if("replace"===a)return void r([l]);"insert-at-caret"===a&&function(e){const r=t.start,o=r-v.triggerPrefix.length-h.length,i=(0,sb.create)({html:(0,s.renderToString)(e)});n((0,sb.insert)(t,i,o,r))}(l)}E()}}function E(){f(0),m([]),g(""),b(null),w(null)}const C=(0,s.useMemo)((()=>{if((0,sb.isCollapsed)(t))return(0,sb.getTextContent)((0,sb.slice)(t,0))}),[t]);(0,s.useEffect)((()=>{if(!C)return void E();const e=ab()(C),n=(0,sb.getTextContent)((0,sb.slice)(t,void 0,(0,sb.getTextContent)(t).length)),r=null==o?void 0:o.find((t=>{let{triggerPrefix:r,allowContext:o}=t;const i=e.lastIndexOf(r);if(-1===i)return!1;const a=e.slice(i+r.length);if(a.length>50)return!1;const s=0===p.length,l=1===a.split(/\s/).length,c=x.current&&a.split(/\s/).length<=3;return!(s&&!c&&!l)&&(!(o&&!o(e.slice(0,i),n))&&(!/^\s/.test(a)&&!/\s\s+$/.test(a)&&/[\u0000-\uFFFF]*$/.test(a)))}));if(!r)return void E();const i=db(r.triggerPrefix),a=e.slice(e.lastIndexOf(r.triggerPrefix)).match(new RegExp(`${i}([\0-￿]*)$`)),s=a&&a[1];b(r),w((()=>r!==v?pb(r):y)),g(s)}),[C]);const{key:k=""}=p[c]||{},{className:S}=v||{},T=!!v&&p.length>0,N=T?`components-autocomplete-listbox-${l}`:null;return{listBoxId:N,activeId:T?`components-autocomplete-item-${l}-${k}`:null,onKeyDown:function(e){if(x.current="Backspace"===e.key,v&&0!==p.length&&!e.defaultPrevented&&!e.isComposing&&229!==e.keyCode){switch(e.key){case"ArrowUp":f((0===c?p.length:c)-1);break;case"ArrowDown":f((c+1)%p.length);break;case"Escape":b(null),w(null),e.preventDefault();break;case"Enter":_(p[c]);break;case"ArrowLeft":case"ArrowRight":return void E();default:return}e.preventDefault()}},popover:void 0!==t.start&&y&&(0,s.createElement)(y,{className:S,filterValue:h,instanceId:l,listBoxId:N,selectedIndex:c,onChangeOptions:function(e){f(e.length===p.length?c:0),m(e),function(e){a&&(e.length?a((0,u.sprintf)((0,u._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):a((0,u.__)("No results."),"assertive"))}(e)},onSelect:_,value:t,contentRef:i,reset:E})}}function hb(e){const[t,n]=(0,s.useState)(!1),r=(0,s.useRef)(),o=(0,s.useRef)(),i=(0,s.useRef)(),{popover:a,listBoxId:l,activeId:c,onKeyDown:u}=mb({...e,contentRef:r});i.current=u,(0,s.useEffect)((()=>{t&&(o.current?o.current.start===e.record.start&&o.current.end===e.record.end||(n(!1),o.current=null):o.current=e.record)}),[e.record]);const f=(0,d.useMergeRefs)([r,(0,d.useRefEffect)((e=>{function t(e){i.current(e)}function r(){n(!0),o.current=null}return e.addEventListener("keydown",t),e.addEventListener("input",r),()=>{e.removeEventListener("keydown",t),e.removeEventListener("input",r)}}),[])]);return t?{ref:f,children:a,"aria-autocomplete":l?"list":void 0,"aria-owns":l,"aria-activedescendant":c}:{ref:f}}function gb(e){let{children:t,isSelected:n,...r}=e;const{popover:o,...i}=mb(r);return(0,s.createElement)(s.Fragment,null,t(i),n&&o)}function vb(e){const{help:t,id:n,...r}=e,o=(0,d.useInstanceId)(Tv,"wp-components-base-control",n);return{baseControlProps:{id:o,help:t,...r},controlProps:{id:o,...t?{["string"==typeof t?"aria-describedby":"aria-details"]:`${o}__help`}:{}}}}var bb=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"}));var yb=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));const wb=$f("",""),xb={name:"bjn8wh",styles:"position:relative"},_b=e=>{const{color:t=kp.gray[200],style:n="solid",width:r=ph.borderWidth}=e||{};return`${t} ${!!r&&"0"!==r||!!t?n||"solid":n} ${r!==ph.borderWidth?`clamp(1px, ${r}, 10px)`:r}`},Eb={name:"1nwbfnf",styles:"grid-column:span 2;margin:0 auto"};function Cb(e){const{className:t,size:n="default",...r}=Fu(e,"BorderBoxControlLinkedButton"),o=Bu();return{...r,className:(0,s.useMemo)((()=>o((e=>$f("position:absolute;top:","__unstable-large"===e?"8px":"3px",";",zh({right:0})()," line-height:0;",""))(n),t)),[t,o,n])}}var kb=Vu(((e,t)=>{const{className:n,isLinked:r,...o}=Cb(e),i=r?(0,u.__)("Unlink sides"):(0,u.__)("Link sides");return(0,s.createElement)(zf,{text:i},(0,s.createElement)(Qu,{className:n},(0,s.createElement)(rd,a({},o,{isSmall:!0,icon:r?bb:yb,iconSize:24,"aria-label":i,ref:t}))))}),"BorderBoxControlLinkedButton");function Sb(e){const{className:t,value:n,size:r="default",...o}=Fu(e,"BorderBoxControlVisualizer"),i=Bu(),a=(0,s.useMemo)((()=>i(((e,t)=>$f("position:absolute;top:","__unstable-large"===t?"20px":"15px",";right:","__unstable-large"===t?"39px":"29px",";bottom:","__unstable-large"===t?"20px":"15px",";left:","__unstable-large"===t?"39px":"29px",";border-top:",_b(null==e?void 0:e.top),";border-bottom:",_b(null==e?void 0:e.bottom),";",zh({borderLeft:_b(null==e?void 0:e.left)})()," ",zh({borderRight:_b(null==e?void 0:e.right)})(),";",""))(n,r),t)),[i,t,n,r]);return{...o,className:a,value:n}}var Tb=Vu(((e,t)=>{const{value:n,...r}=Sb(e);return(0,s.createElement)(Qu,a({},r,{ref:t}))}),"BorderBoxControlVisualizer");var Nb=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));var Rb=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M5 11.25h14v1.5H5z"}));var Ib=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{fillRule:"evenodd",d:"M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"}));var Mb=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{fillRule:"evenodd",d:"M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",clipRule:"evenodd"}));const Pb=Zu(Zv,{target:"e1bagdl32"})("&&&{input{display:block;width:100%;}",qh,"{transition:box-shadow 0.1s linear;}}"),Ob=e=>{let{selectSize:t}=e;const n={default:$f("box-sizing:border-box;padding:2px 1px;width:20px;color:",kp.gray[800],";font-size:8px;line-height:1;letter-spacing:-0.5px;text-transform:uppercase;text-align-last:center;",""),large:$f("box-sizing:border-box;min-width:24px;max-width:48px;height:24px;margin-inline-end:",qm(2),";padding:",qm(1),";color:",kp.ui.theme,";font-size:13px;line-height:1;text-align-last:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;","")};return"__unstable-large"===t?n.large:n.default},Db=Zu("div",{target:"e1bagdl31"})("&&&{pointer-events:none;",Ob,";color:",kp.gray[900],";}"),Ab=Zu("select",{target:"e1bagdl30"})("&&&{appearance:none;background:transparent;border-radius:2px;border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;",Ob,";",(e=>{let{selectSize:t="default"}=e;const n={default:$f("height:100%;border:1px solid transparent;transition:box-shadow 0.1s linear,border 0.1s linear;",zh({borderTopLeftRadius:0,borderBottomLeftRadius:0})()," &:not(:disabled):hover{background-color:",kp.gray[100],";}&:focus{border:1px solid ",kp.ui.borderFocus,";box-shadow:inset 0 0 0 ",ph.borderWidth+" "+kp.ui.borderFocus,";outline-offset:0;outline:2px solid transparent;z-index:1;}",""),large:$f("display:flex;justify-content:center;align-items:center;&:hover{color:",kp.ui.borderFocus,";box-shadow:inset 0 0 0 ",ph.borderWidth+" "+kp.ui.borderFocus,";outline:",ph.borderWidth," solid transparent;}&:focus{box-shadow:0 0 0 ",ph.borderWidthFocus+" "+kp.ui.borderFocus,";outline:",ph.borderWidthFocus," solid transparent;}","")};return"__unstable-large"===t?n.large:n.default}),";&:not( :disabled ){cursor:pointer;}}");const Lb={name:"f3vz0n",styles:"font-weight:500"},zb=$f("box-shadow:inset 0 0 0 ",ph.borderWidth," ",kp.ui.borderFocus,";",""),Bb=$f("border:0;padding:0;margin:0;",bv,";",""),Fb=$f(Pb,"{flex:0 0 auto;}",""),Vb=(e,t)=>{const{style:n}=e||{};return $f("border-radius:9999px;border:2px solid transparent;",n?(e=>{const{color:t,style:n}=e||{},r=n&&"none"!==n?kp.gray[300]:void 0;return $f("border-style:","none"===n?"solid":n,";border-color:",t||r,";","")})(e):void 0," width:","__unstable-large"===t?"24px":"22px",";height:","__unstable-large"===t?"24px":"22px",";padding:","__unstable-large"===t?"2px":"1px",";&>span{height:",qm(4),";width:",qm(4),";background:linear-gradient(\n\t\t\t\t-45deg,\n\t\t\t\ttransparent 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 52%,\n\t\t\t\ttransparent 52%\n\t\t\t);}","")},Hb=$f("width:",228,"px;>div:first-of-type>",_v,"{margin-bottom:0;",Lb,";}&& ",_v,"+button:not( .has-text ){min-width:24px;padding:0;}",""),jb=$f("",""),$b=$f("",""),Wb=$f("justify-content:center;width:100%;&&{border-top:",ph.borderWidth," solid ",kp.gray[200],";border-top-left-radius:0;border-top-right-radius:0;height:46px;}",""),Ub=$f(_v,"{",Lb,";}",""),Gb={name:"1486260",styles:"&&&&&{min-width:30px;width:30px;height:30px;padding:3px;}"};const Yb=[{label:(0,u.__)("Solid"),icon:Rb,value:"solid"},{label:(0,u.__)("Dashed"),icon:Ib,value:"dashed"},{label:(0,u.__)("Dotted"),icon:Mb,value:"dotted"}],qb=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,s.createElement)(ed,{as:"label"},t):(0,s.createElement)(_v,null,t):null};var Kb=Vu(((e,t)=>{const{buttonClassName:n,hideLabelFromVision:r,label:o,onChange:i,value:l,...c}=function(e){const{className:t,...n}=Fu(e,"BorderControlStylePicker"),r=Bu();return{...n,className:(0,s.useMemo)((()=>r(Ub,t)),[t,r]),buttonClassName:(0,s.useMemo)((()=>r(Gb)),[r])}}(e);return(0,s.createElement)(Qu,a({},c,{ref:t}),(0,s.createElement)(qb,{label:o,hideLabelFromVision:r}),(0,s.createElement)(Xm,{justify:"flex-start",gap:1},Yb.map((e=>(0,s.createElement)(rd,{key:e.value,className:n,icon:e.icon,isSmall:!0,isPressed:e.value===l,onClick:()=>i(e.value===l?void 0:e.value),"aria-label":e.label,label:e.label,showTooltip:!0})))))}),"BorderControlStylePicker");var Xb=(0,s.forwardRef)((function(e,t){const{className:n,colorValue:r,...o}=e;return(0,s.createElement)("span",a({className:c()("component-color-indicator",n),style:{background:r},ref:t},o))})),Zb=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Jb=function(e){return.2126*Zb(e.r)+.7152*Zb(e.g)+.0722*Zb(e.b)};function Qb(e){e.prototype.luminance=function(){return e=Jb(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,r,o,i,a,s,l,c=t instanceof e?t:new e(t);return i=this.rgba,a=c.toRgb(),n=(s=Jb(i))>(l=Jb(a))?(s+.05)/(l+.05):(l+.05)/(s+.05),void 0===(r=2)&&(r=0),void 0===o&&(o=Math.pow(10,r)),Math.floor(o*n)/o+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(a=void 0===(i=(n=t).size)?"normal":i,"AAA"===(o=void 0===(r=n.level)?"AA":r)&&"normal"===a?7:"AA"===o&&"large"===a?3:4.5);var n,r,o,i,a}}const ey=(0,s.forwardRef)((function(e,t){let{renderContent:n,renderToggle:r,className:o,contentClassName:i,expandOnMobile:l,headerTitle:u,focusOnMount:f,popoverProps:p,onClose:m,onToggle:h,style:g,position:v}=e;void 0!==v&&Kl()("`position` prop in wp.components.Dropdown",{since:"6.2",alternative:"`popoverProps.placement` prop",hint:"Note that the `position` prop will override any values passed through the `popoverProps.placement` prop."});const[b,y]=(0,s.useState)(null),w=(0,s.useRef)(),[x,_]=function(e,t){const[n,r]=(0,s.useState)(e);return[n,e=>{r(e),t&&t(e)}]}(!1,h);function E(){m&&m(),_(!1)}(0,s.useEffect)((()=>()=>{h&&x&&h(!1)}),[h,x]);const C={isOpen:x,onToggle:function(){_(!x)},onClose:E},k=!!(null!=p&&p.anchor||null!=p&&p.anchorRef||null!=p&&p.getAnchorRect||null!=p&&p.anchorRect);return(0,s.createElement)("div",{className:c()("components-dropdown",o),ref:(0,d.useMergeRefs)([w,t,y]),tabIndex:-1,style:g},r(C),x&&(0,s.createElement)(If,a({position:v,onClose:E,onFocusOutside:function(){var e;if(!w.current)return;const{ownerDocument:t}=w.current,n=null==t||null===(e=t.activeElement)||void 0===e?void 0:e.closest('[role="dialog"]');w.current.contains(t.activeElement)||n&&!n.contains(w.current)||E()},expandOnMobile:l,headerTitle:u,focusOnMount:f,offset:13,anchor:k?void 0:b},p,{className:c()("components-dropdown__content",null==p?void 0:p.className,i)}),n(C)))}));var ty=ey;var ny=Vu((function(e,t){const n=Fu(e,"InputControlSuffixWrapper");return(0,s.createElement)(qv,a({marginBottom:0},n,{ref:t}))}),"InputControlSuffixWrapper");const ry=Zu("select",{target:"e1mv6sxx2"})("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:",kp.gray[900],";display:block;font-family:inherit;margin:0;width:100%;max-width:none;cursor:pointer;white-space:nowrap;text-overflow:ellipsis;",(e=>{let{disabled:t}=e;return t?$f({color:kp.ui.textDisabled},"",""):""}),";",(e=>{let{selectSize:t="default"}=e;const n={default:"13px",small:"11px","__unstable-large":"13px"}[t];return n?$f("font-size:","16px",";@media ( min-width: 600px ){font-size:",n,";}",""):""}),";",(e=>{let{__next36pxDefaultSize:t,multiple:n,selectSize:r="default"}=e;if(n)return;const o={default:{height:36,minHeight:36,paddingTop:0,paddingBottom:0},small:{height:24,minHeight:24,paddingTop:0,paddingBottom:0},"__unstable-large":{height:40,minHeight:40,paddingTop:0,paddingBottom:0}};t||(o.default={height:30,minHeight:30,paddingTop:0,paddingBottom:0});return $f(o[r]||o.default,"","")}),";",(e=>{let{__next36pxDefaultSize:t,multiple:n,selectSize:r="default"}=e;const o={default:16,small:8,"__unstable-large":16};t||(o.default=8);const i=o[r]||o.default;return zh({paddingLeft:i,paddingRight:i+18,...n?{paddingTop:i,paddingBottom:i}:{}})}),";",(e=>{let{multiple:t}=e;return{overflow:t?"auto":"hidden"}}),";}"),oy=Zu("div",{target:"e1mv6sxx1"})("margin-inline-end:",qm(-1),";line-height:0;"),iy=Zu(ny,{target:"e1mv6sxx0"})("position:absolute;pointer-events:none;",zh({right:0}),";");var ay=function(e){let{icon:t,size:n=24,...r}=e;return(0,s.cloneElement)(t,{width:n,height:n,...r})};var sy=(0,s.createElement)(i.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(i.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));var ly=()=>(0,s.createElement)(iy,null,(0,s.createElement)(oy,null,(0,s.createElement)(ay,{icon:sy,size:18})));const cy=()=>{};const uy=(0,s.forwardRef)((function(e,t){let{className:n,disabled:r=!1,help:o,hideLabelFromVision:i,id:l,label:u,multiple:f=!1,onBlur:p=cy,onChange:m=cy,onFocus:h=cy,options:g=[],size:v="default",value:b,labelPosition:y="top",children:w,prefix:x,suffix:_,__next36pxDefaultSize:E=!1,__nextHasNoMarginBottom:C=!1,...k}=e;const[S,T]=(0,s.useState)(!1),N=function(e){const t=(0,d.useInstanceId)(uy);return e||`inspector-select-control-${t}`}(l),R=o?`${N}__help`:void 0;if(!(null!=g&&g.length||w))return null;const I=c()("components-select-control",n);return(0,s.createElement)(Tv,{help:o,id:N,__nextHasNoMarginBottom:C},(0,s.createElement)(tg,{className:I,disabled:r,hideLabelFromVision:i,id:N,isFocused:S,label:u,size:v,suffix:_||!f&&(0,s.createElement)(ly,null),prefix:x,labelPosition:y,__next36pxDefaultSize:E},(0,s.createElement)(ry,a({},k,{__next36pxDefaultSize:E,"aria-describedby":R,className:"components-select-control__input",disabled:r,id:N,multiple:f,onBlur:e=>{p(e),T(!1)},onChange:e=>{if(f){const t=Array.from(e.target.options).filter((e=>{let{selected:t}=e;return t})),n=t.map((e=>{let{value:t}=e;return t}));m(n)}else m(e.target.value,{event:e})},onFocus:e=>{h(e),T(!0)},ref:t,selectSize:v,value:b}),w||g.map(((e,t)=>{const n=e.id||`${e.label}-${e.value}-${t}`;return(0,s.createElement)("option",{key:n,value:e.value,disabled:e.disabled},e.label)})))))}));var dy=uy;const fy={initial:void 0,fallback:""};var py=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fy;const{initial:n,fallback:r}={...fy,...t},[o,i]=(0,s.useState)(e),a=Jm(e);(0,s.useEffect)((()=>{a&&o&&i(void 0)}),[a,o]);const l=Qm([e,o,n],r),c=(0,s.useCallback)((e=>{a||i(e)}),[a]);return[l,c]};function my(e,t,n){return"number"!=typeof e?null:parseFloat(`${Fv(e,t,n)}`)}const hy=()=>$f({height:30,minHeight:30},"",""),gy=12,vy=Zu("div",{target:"e1epgpqk14"})({name:"1se47kl",styles:"-webkit-tap-highlight-color:transparent;align-items:flex-start;display:flex;justify-content:flex-start;padding:0;position:relative;touch-action:none;width:100%"}),by=Zu("div",{target:"e1epgpqk13"})("display:block;flex:1;position:relative;width:100%;",(e=>{let{color:t=kp.ui.borderFocus}=e;return $f({color:t},"","")}),";",hy,";",(e=>{let{marks:t,__nextHasNoMarginBottom:n}=e;return n?"":$f({marginBottom:t?16:void 0},"","")}),";"),yy=Zu("span",{target:"e1epgpqk12"})("display:flex;margin-top:",4,"px;",zh({marginRight:6}),";"),wy=Zu("span",{target:"e1epgpqk11"})("display:flex;margin-top:",4,"px;",zh({marginLeft:6}),";"),xy=Zu("span",{target:"e1epgpqk10"})("background-color:",kp.gray[300],";left:0;pointer-events:none;right:0;display:block;height:",4,"px;position:absolute;margin-top:",13,"px;top:0;border-radius:",4,"px;",(e=>{let{disabled:t,railColor:n}=e,r=n||"";return t&&(r=kp.ui.backgroundDisabled),$f({background:r},"","")}),";"),_y=Zu("span",{target:"e1epgpqk9"})("background-color:currentColor;border-radius:",4,"px;height:",4,"px;pointer-events:none;display:block;position:absolute;margin-top:",13,"px;top:0;",(e=>{let{disabled:t,trackColor:n}=e,r=n||"currentColor";return t&&(r=kp.gray[400]),$f({background:r},"","")}),";"),Ey=Zu("span",{target:"e1epgpqk8"})({name:"l7tjj5",styles:"display:block;pointer-events:none;position:relative;width:100%;user-select:none"}),Cy=Zu("span",{target:"e1epgpqk7"})("height:",gy,"px;left:0;position:absolute;top:-4px;width:1px;",(e=>{let{disabled:t,isFilled:n}=e,r=n?"currentColor":kp.gray[300];return t&&(r=kp.gray[400]),$f({backgroundColor:r},"","")}),";"),ky=Zu("span",{target:"e1epgpqk6"})("color:",kp.gray[300],";left:0;font-size:11px;position:absolute;top:12px;transform:translateX( -50% );white-space:nowrap;",(e=>{let{isFilled:t}=e;return $f({color:t?kp.gray[700]:kp.gray[300]},"","")}),";"),Sy=e=>{let{disabled:t}=e;return $f("background-color:",t?kp.gray[400]:kp.ui.theme,";","")},Ty=Zu("span",{target:"e1epgpqk5"})("align-items:center;display:flex;height:",gy,"px;justify-content:center;margin-top:",9,"px;outline:0;pointer-events:none;position:absolute;top:0;user-select:none;width:",gy,"px;border-radius:50%;",Sy,";",zh({marginLeft:-10}),";",zh({transform:"translateX( 4.5px )"},{transform:"translateX( -4.5px )"}),";"),Ny=Zu("span",{target:"e1epgpqk4"})("align-items:center;border-radius:50%;height:100%;outline:0;position:absolute;user-select:none;width:100%;",Sy,";",(e=>{let{isFocused:t}=e;return t?$f("&::before{content:' ';position:absolute;background-color:",kp.ui.theme,";opacity:0.4;border-radius:50%;height:",20,"px;width:",20,"px;top:-4px;left:-4px;}",""):""}),";"),Ry=Zu("input",{target:"e1epgpqk3"})("box-sizing:border-box;cursor:pointer;display:block;height:100%;left:0;margin:0 -",6,"px;opacity:0;outline:none;position:absolute;right:0;top:0;width:calc( 100% + ",gy,"px );");var Iy={name:"1cypxip",styles:"top:-80%"},My={name:"1lr98c4",styles:"bottom:-80%"};const Py=Zu("span",{target:"e1epgpqk2"})("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;color:white;display:inline-block;font-size:12px;min-width:32px;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;transition:opacity 120ms ease;user-select:none;line-height:1.4;",(e=>{let{show:t}=e;return $f({opacity:t?1:0},"","")}),";",(e=>{let{position:t}=e;return"bottom"===t?My:Iy}),";",Sp("transition"),";",zh({transform:"translateX(-50%)"},{transform:"translateX(50%)"}),";"),Oy=Zu(Zv,{target:"e1epgpqk1"})("display:inline-block;font-size:13px;margin-top:0;width:",qm(16),"!important;input[type='number']&{",hy,";}",zh({marginLeft:`${qm(4)} !important`}),";"),Dy=Zu("span",{target:"e1epgpqk0"})("display:block;margin-top:0;button,button.is-small{margin-left:0;",hy,";}",zh({marginLeft:8}),";");var Ay=(0,s.forwardRef)((function(e,t){const{describedBy:n,label:r,value:o,...i}=e;return(0,s.createElement)(Ry,a({},i,{"aria-describedby":n,"aria-label":r,"aria-hidden":!1,ref:t,tabIndex:0,type:"range",value:o}))}));function Ly(e){const{className:t,isFilled:n=!1,label:r,style:o={},...i}=e,l=c()("components-range-control__mark",n&&"is-filled",t),u=c()("components-range-control__mark-label",n&&"is-filled");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Cy,a({},i,{"aria-hidden":"true",className:l,isFilled:n,style:o})),r&&(0,s.createElement)(ky,{"aria-hidden":"true",className:u,isFilled:n,style:o},r))}function zy(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:l=0,...c}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(xy,a({disabled:t},c)),n&&(0,s.createElement)(By,{disabled:t,marks:n,min:r,max:o,step:i,value:l}))}function By(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:l=0}=e,c=function(e){let{marks:t,min:n=0,max:r=100,step:o=1,value:i=0}=e;if(!t)return[];const a=r-n;if(!Array.isArray(t)){t=[];const e=1+Math.round(a/o);for(;e>t.push({value:o*t.length+n}););}const s=[];return t.forEach(((e,t)=>{if(e.valuer)return;const o=`mark-${t}`,l=e.value<=i,c=(e.value-n)/a*100+"%",d={[(0,u.isRTL)()?"right":"left"]:c};s.push({...e,isFilled:l,key:o,style:d})})),s}({marks:n,min:r,max:o,step:"any"===i?1:i,value:l});return(0,s.createElement)(Ey,{"aria-hidden":"true",className:"components-range-control__marks"},c.map((e=>(0,s.createElement)(Ly,a({},e,{key:e.key,"aria-hidden":"true",disabled:t})))))}function Fy(e){const{className:t,inputRef:n,tooltipPosition:r,show:o=!1,style:i={},value:l=0,renderTooltipContent:u=(e=>e),zIndex:d=100,...f}=e,p=function(e){let{inputRef:t,tooltipPosition:n}=e;const[r,o]=(0,s.useState)(),i=(0,s.useCallback)((()=>{t&&t.current&&o(n)}),[n,t]);return(0,s.useEffect)((()=>{i()}),[i]),(0,s.useEffect)((()=>(window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}))),r}({inputRef:n,tooltipPosition:r}),m=c()("components-simple-tooltip",t),h={...i,zIndex:d};return(0,s.createElement)(Py,a({},f,{"aria-hidden":o,className:m,position:p,show:o,role:"tooltip",style:h}),u(l))}const Vy=()=>{};const Hy=(0,s.forwardRef)((function e(t,n){var r;const{__nextHasNoMarginBottom:o=!1,afterIcon:i,allowReset:l=!1,beforeIcon:f,className:p,color:m=kp.ui.theme,currentInput:h,disabled:g=!1,help:v,hideLabelFromVision:b=!1,initialPosition:y,isShiftStepEnabled:w=!0,label:x,marks:_=!1,max:E=100,min:C=0,onBlur:k=Vy,onChange:S=Vy,onFocus:T=Vy,onMouseLeave:N=Vy,onMouseMove:R=Vy,railColor:I,renderTooltipContent:M=(e=>e),resetFallbackValue:P,shiftStep:O=10,showTooltip:D,step:A=1,trackColor:L,value:z,withInputField:B=!0,...F}=t,[V,H]=function(e){const{min:t,max:n,value:r,initial:o}=e,[i,a]=py(my(r,t,n),{initial:my(null!=o?o:null,t,n),fallback:null});return[i,(0,s.useCallback)((e=>{a(null===e?null:my(e,t,n))}),[t,n,a])]}({min:C,max:E,value:null!=z?z:null,initial:y}),j=(0,s.useRef)(!1);let $=D,W=B;"any"===A&&($=!1,W=!1);const[U,G]=(0,s.useState)($),[Y,q]=(0,s.useState)(!1),K=(0,s.useRef)(),X=null===(r=K.current)||void 0===r?void 0:r.matches(":focus"),Z=!g&&Y,J=null===V,Q=J?"":void 0!==V?V:h,ee=J?(E-C)/2+C:V,te=`${Fv(J?50:(V-C)/(E-C)*100,0,100)}%`,ne=c()("components-range-control",p),re=c()("components-range-control__wrapper",!!_&&"is-marked"),oe=(0,d.useInstanceId)(e,"inspector-range-control"),ie=v?`${oe}__help`:void 0,ae=!1!==$&&Number.isFinite(V),se=()=>{let e=parseFloat(`${P}`),t=e;isNaN(e)&&(e=null,t=void 0),H(e),S(t)},le={[(0,u.isRTL)()?"right":"left"]:te};return(0,s.createElement)(Tv,{__nextHasNoMarginBottom:o,className:ne,label:x,hideLabelFromVision:b,id:`${oe}`,help:v},(0,s.createElement)(vy,{className:"components-range-control__root"},f&&(0,s.createElement)(yy,null,(0,s.createElement)(Zl,{icon:f})),(0,s.createElement)(by,{__nextHasNoMarginBottom:o,className:re,color:m,marks:!!_},(0,s.createElement)(Ay,a({},F,{className:"components-range-control__slider",describedBy:ie,disabled:g,id:`${oe}`,label:x,max:E,min:C,onBlur:e=>{k(e),q(!1),G(!1)},onChange:e=>{const t=parseFloat(e.target.value);H(t),S(t)},onFocus:e=>{T(e),q(!0),G(!0)},onMouseMove:R,onMouseLeave:N,ref:(0,d.useMergeRefs)([K,n]),step:A,value:null!=Q?Q:void 0})),(0,s.createElement)(zy,{"aria-hidden":!0,disabled:g,marks:_,max:E,min:C,railColor:I,step:A,value:ee}),(0,s.createElement)(_y,{"aria-hidden":!0,className:"components-range-control__track",disabled:g,style:{width:te},trackColor:L}),(0,s.createElement)(Ty,{className:"components-range-control__thumb-wrapper",style:le,disabled:g},(0,s.createElement)(Ny,{"aria-hidden":!0,isFocused:Z,disabled:g})),ae&&(0,s.createElement)(Fy,{className:"components-range-control__tooltip",inputRef:K,tooltipPosition:"bottom",renderTooltipContent:M,show:X||U,style:le,value:V})),i&&(0,s.createElement)(wy,null,(0,s.createElement)(Zl,{icon:i})),W&&(0,s.createElement)(Oy,{"aria-label":x,className:"components-range-control__number",disabled:g,inputMode:"decimal",isShiftStepEnabled:w,max:E,min:C,onBlur:()=>{j.current&&(se(),j.current=!1)},onChange:e=>{let t=parseFloat(e);H(t),isNaN(t)?l&&(j.current=!0):((tE)&&(t=my(t,C,E)),S(t),j.current=!1)},shiftStep:O,step:A,value:Q}),l&&(0,s.createElement)(Dy,null,(0,s.createElement)(rd,{className:"components-range-control__reset",disabled:g||void 0===V,variant:"secondary",isSmall:!0,onClick:se},(0,u.__)("Reset")))))}));var jy=Hy;const $y=Zu(Zv,{target:"ez9hsf47"})(jh,"{width:",qm(24),";}"),Wy=Zu(dy,{target:"ez9hsf46"})("margin-left:",qm(-2),";width:5em;",qh,"{display:none;}"),Uy=Zu(jy,{target:"ez9hsf45"})("flex:1;margin-right:",qm(2),";"),Gy=`\n.react-colorful__interactive {\n\twidth: calc( 100% - ${qm(2)} );\n\tmargin-left: ${qm(1)};\n}`,Yy=Zu("div",{target:"ez9hsf44"})("padding-top:",qm(2),";padding-right:0;padding-left:0;padding-bottom:0;"),qy=Zu(Uv,{target:"ez9hsf43"})("padding-left:",qm(4),";padding-right:",qm(4),";"),Ky=Zu(Xm,{target:"ez9hsf42"})("padding-top:",qm(4),";padding-left:",qm(4),";padding-right:",qm(3),";padding-bottom:",qm(5),";"),Xy=Zu("div",{target:"ez9hsf41"})(bv,";width:216px;.react-colorful{display:flex;flex-direction:column;align-items:center;width:216px;height:auto;overflow:hidden;}.react-colorful__saturation{width:100%;border-radius:0;height:216px;margin-bottom:",qm(4),";border-bottom:none;}.react-colorful__hue,.react-colorful__alpha{width:184px;height:16px;border-radius:16px;margin-bottom:",qm(2),";}.react-colorful__pointer{height:16px;width:16px;border:none;box-shadow:0 0 2px 0 rgba( 0, 0, 0, 0.25 );outline:2px solid transparent;}.react-colorful__pointer-fill{box-shadow:inset 0 0 0 ",ph.borderWidthFocus," #fff;}",Gy,";"),Zy=Zu(rd,{target:"ez9hsf40"})("&&&&&{min-width:",qm(6),";padding:0;>svg{margin-right:0;}}");var Jy=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"}));function Qy(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function ew(e){return e instanceof Qy(e).Element||e instanceof Element}function tw(e){return e instanceof Qy(e).HTMLElement||e instanceof HTMLElement}function nw(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Qy(e).ShadowRoot||e instanceof ShadowRoot)}var rw=Math.max,ow=Math.min,iw=Math.round;function aw(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function sw(){return!/^((?!chrome|android).)*safari/i.test(aw())}function lw(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&tw(e)&&(o=e.offsetWidth>0&&iw(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&iw(r.height)/e.offsetHeight||1);var a=(ew(e)?Qy(e):window).visualViewport,s=!sw()&&n,l=(r.left+(s&&a?a.offsetLeft:0))/o,c=(r.top+(s&&a?a.offsetTop:0))/i,u=r.width/o,d=r.height/i;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l,x:l,y:c}}function cw(e){var t=Qy(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function uw(e){return e?(e.nodeName||"").toLowerCase():null}function dw(e){return((ew(e)?e.ownerDocument:e.document)||window.document).documentElement}function fw(e){return lw(dw(e)).left+cw(e).scrollLeft}function pw(e){return Qy(e).getComputedStyle(e)}function mw(e){var t=pw(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function hw(e,t,n){void 0===n&&(n=!1);var r=tw(t),o=tw(t)&&function(e){var t=e.getBoundingClientRect(),n=iw(t.width)/e.offsetWidth||1,r=iw(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),i=dw(t),a=lw(e,o,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&(("body"!==uw(t)||mw(i))&&(s=function(e){return e!==Qy(e)&&tw(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:cw(e);var t}(t)),tw(t)?((l=lw(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=fw(i))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function gw(e){var t=lw(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function vw(e){return"html"===uw(e)?e:e.assignedSlot||e.parentNode||(nw(e)?e.host:null)||dw(e)}function bw(e){return["html","body","#document"].indexOf(uw(e))>=0?e.ownerDocument.body:tw(e)&&mw(e)?e:bw(vw(e))}function yw(e,t){var n;void 0===t&&(t=[]);var r=bw(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=Qy(r),a=o?[i].concat(i.visualViewport||[],mw(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(yw(vw(a)))}function ww(e){return["table","td","th"].indexOf(uw(e))>=0}function xw(e){return tw(e)&&"fixed"!==pw(e).position?e.offsetParent:null}function _w(e){for(var t=Qy(e),n=xw(e);n&&ww(n)&&"static"===pw(n).position;)n=xw(n);return n&&("html"===uw(n)||"body"===uw(n)&&"static"===pw(n).position)?t:n||function(e){var t=/firefox/i.test(aw());if(/Trident/i.test(aw())&&tw(e)&&"fixed"===pw(e).position)return null;var n=vw(e);for(nw(n)&&(n=n.host);tw(n)&&["html","body"].indexOf(uw(n))<0;){var r=pw(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var Ew="top",Cw="bottom",kw="right",Sw="left",Tw="auto",Nw=[Ew,Cw,kw,Sw],Rw="start",Iw="end",Mw="viewport",Pw="popper",Ow=Nw.reduce((function(e,t){return e.concat([t+"-"+Rw,t+"-"+Iw])}),[]),Dw=[].concat(Nw,[Tw]).reduce((function(e,t){return e.concat([t,t+"-"+Rw,t+"-"+Iw])}),[]),Aw=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Lw(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}var zw={placement:"bottom",modifiers:[],strategy:"absolute"};function Bw(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function Uw(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?jw(o):null,a=o?$w(o):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case Ew:t={x:s,y:n.y-r.height};break;case Cw:t={x:s,y:n.y+n.height};break;case kw:t={x:n.x+n.width,y:l};break;case Sw:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=i?Ww(i):null;if(null!=c){var u="y"===c?"height":"width";switch(a){case Rw:t[c]=t[c]-(n[u]/2-r[u]/2);break;case Iw:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}var Gw={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Uw({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},Yw={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qw(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=a.x,p=void 0===f?0:f,m=a.y,h=void 0===m?0:m,g="function"==typeof u?u({x:p,y:h}):{x:p,y:h};p=g.x,h=g.y;var v=a.hasOwnProperty("x"),b=a.hasOwnProperty("y"),y=Sw,w=Ew,x=window;if(c){var _=_w(n),E="clientHeight",C="clientWidth";if(_===Qy(n)&&"static"!==pw(_=dw(n)).position&&"absolute"===s&&(E="scrollHeight",C="scrollWidth"),o===Ew||(o===Sw||o===kw)&&i===Iw)w=Cw,h-=(d&&_===x&&x.visualViewport?x.visualViewport.height:_[E])-r.height,h*=l?1:-1;if(o===Sw||(o===Ew||o===Cw)&&i===Iw)y=kw,p-=(d&&_===x&&x.visualViewport?x.visualViewport.width:_[C])-r.width,p*=l?1:-1}var k,S=Object.assign({position:s},c&&Yw),T=!0===u?function(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:iw(n*o)/o||0,y:iw(r*o)/o||0}}({x:p,y:h},Qy(n)):{x:p,y:h};return p=T.x,h=T.y,l?Object.assign({},S,((k={})[w]=b?"0":"",k[y]=v?"0":"",k.transform=(x.devicePixelRatio||1)<=1?"translate("+p+"px, "+h+"px)":"translate3d("+p+"px, "+h+"px, 0)",k)):Object.assign({},S,((t={})[w]=b?h+"px":"",t[y]=v?p+"px":"",t.transform="",t))}var Kw={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,l=void 0===s||s,c={placement:jw(t.placement),variation:$w(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,qw(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,qw(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var Xw={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];tw(o)&&uw(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});tw(r)&&uw(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var Zw={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=Dw.reduce((function(e,n){return e[n]=function(e,t,n){var r=jw(e),o=[Sw,Ew].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[Sw,kw].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}},Jw={left:"right",right:"left",bottom:"top",top:"bottom"};function Qw(e){return e.replace(/left|right|bottom|top/g,(function(e){return Jw[e]}))}var ex={start:"end",end:"start"};function tx(e){return e.replace(/start|end/g,(function(e){return ex[e]}))}function nx(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&nw(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function rx(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ox(e,t,n){return t===Mw?rx(function(e,t){var n=Qy(e),r=dw(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var c=sw();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s+fw(e),y:l}}(e,n)):ew(t)?function(e,t){var n=lw(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):rx(function(e){var t,n=dw(e),r=cw(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=rw(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=rw(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+fw(e),l=-r.scrollTop;return"rtl"===pw(o||n).direction&&(s+=rw(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(dw(e)))}function ix(e,t,n,r){var o="clippingParents"===t?function(e){var t=yw(vw(e)),n=["absolute","fixed"].indexOf(pw(e).position)>=0&&tw(e)?_w(e):e;return ew(n)?t.filter((function(e){return ew(e)&&nx(e,n)&&"body"!==uw(e)})):[]}(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce((function(t,n){var o=ox(e,n,r);return t.top=rw(o.top,t.top),t.right=ow(o.right,t.right),t.bottom=ow(o.bottom,t.bottom),t.left=rw(o.left,t.left),t}),ox(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function ax(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function sx(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function lx(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.strategy,a=void 0===i?e.strategy:i,s=n.boundary,l=void 0===s?"clippingParents":s,c=n.rootBoundary,u=void 0===c?Mw:c,d=n.elementContext,f=void 0===d?Pw:d,p=n.altBoundary,m=void 0!==p&&p,h=n.padding,g=void 0===h?0:h,v=ax("number"!=typeof g?g:sx(g,Nw)),b=f===Pw?"reference":Pw,y=e.rects.popper,w=e.elements[m?b:f],x=ix(ew(w)?w:w.contextElement||dw(e.elements.popper),l,u,a),_=lw(e.elements.reference),E=Uw({reference:_,element:y,strategy:"absolute",placement:o}),C=rx(Object.assign({},y,E)),k=f===Pw?C:_,S={top:x.top-k.top+v.top,bottom:k.bottom-x.bottom+v.bottom,left:x.left-k.left+v.left,right:k.right-x.right+v.right},T=e.modifiersData.offset;if(f===Pw&&T){var N=T[o];Object.keys(S).forEach((function(e){var t=[kw,Cw].indexOf(e)>=0?1:-1,n=[Ew,Cw].indexOf(e)>=0?"y":"x";S[e]+=N[n]*t}))}return S}var cx={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,m=void 0===p||p,h=n.allowedAutoPlacements,g=t.options.placement,v=jw(g),b=l||(v===g||!m?[Qw(g)]:function(e){if(jw(e)===Tw)return[];var t=Qw(e);return[tx(e),t,tx(t)]}(g)),y=[g].concat(b).reduce((function(e,n){return e.concat(jw(n)===Tw?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?Dw:l,u=$w(r),d=u?s?Ow:Ow.filter((function(e){return $w(e)===u})):Nw,f=d.filter((function(e){return c.indexOf(e)>=0}));0===f.length&&(f=d);var p=f.reduce((function(t,n){return t[n]=lx(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[jw(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:m,allowedAutoPlacements:h}):n)}),[]),w=t.rects.reference,x=t.rects.popper,_=new Map,E=!0,C=y[0],k=0;k=0,I=R?"width":"height",M=lx(t,{placement:S,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),P=R?N?kw:Sw:N?Cw:Ew;w[I]>x[I]&&(P=Qw(P));var O=Qw(P),D=[];if(i&&D.push(M[T]<=0),s&&D.push(M[P]<=0,M[O]<=0),D.every((function(e){return e}))){C=S,E=!1;break}_.set(S,D)}if(E)for(var A=function(e){var t=y.find((function(t){var n=_.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return C=t,"break"},L=m?3:1;L>0;L--){if("break"===A(L))break}t.placement!==C&&(t.modifiersData[r]._skip=!0,t.placement=C,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ux(e,t,n){return rw(e,ow(t,n))}var dx={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=void 0===f||f,m=n.tetherOffset,h=void 0===m?0:m,g=lx(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=jw(t.placement),b=$w(t.placement),y=!b,w=Ww(v),x="x"===w?"y":"x",_=t.modifiersData.popperOffsets,E=t.rects.reference,C=t.rects.popper,k="function"==typeof h?h(Object.assign({},t.rects,{placement:t.placement})):h,S="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,N={x:0,y:0};if(_){if(i){var R,I="y"===w?Ew:Sw,M="y"===w?Cw:kw,P="y"===w?"height":"width",O=_[w],D=O+g[I],A=O-g[M],L=p?-C[P]/2:0,z=b===Rw?E[P]:C[P],B=b===Rw?-C[P]:-E[P],F=t.elements.arrow,V=p&&F?gw(F):{width:0,height:0},H=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},j=H[I],$=H[M],W=ux(0,E[P],V[P]),U=y?E[P]/2-L-W-j-S.mainAxis:z-W-j-S.mainAxis,G=y?-E[P]/2+L+W+$+S.mainAxis:B+W+$+S.mainAxis,Y=t.elements.arrow&&_w(t.elements.arrow),q=Y?"y"===w?Y.clientTop||0:Y.clientLeft||0:0,K=null!=(R=null==T?void 0:T[w])?R:0,X=O+G-K,Z=ux(p?ow(D,O+U-K-q):D,O,p?rw(A,X):A);_[w]=Z,N[w]=Z-O}if(s){var J,Q="x"===w?Ew:Sw,ee="x"===w?Cw:kw,te=_[x],ne="y"===x?"height":"width",re=te+g[Q],oe=te-g[ee],ie=-1!==[Ew,Sw].indexOf(v),ae=null!=(J=null==T?void 0:T[x])?J:0,se=ie?re:te-E[ne]-C[ne]-ae+S.altAxis,le=ie?te+E[ne]+C[ne]-ae-S.altAxis:oe,ce=p&&ie?function(e,t,n){var r=ux(e,t,n);return r>n?n:r}(se,te,le):ux(p?se:re,te,p?le:oe);_[x]=ce,N[x]=ce-te}t.modifiersData[r]=N}},requiresIfExists:["offset"]};var fx={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=jw(n.placement),l=Ww(s),c=[Sw,kw].indexOf(s)>=0?"height":"width";if(i&&a){var u=function(e,t){return ax("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:sx(e,Nw))}(o.padding,n),d=gw(i),f="y"===l?Ew:Sw,p="y"===l?Cw:kw,m=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],h=a[l]-n.rects.reference[l],g=_w(i),v=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=m/2-h/2,y=u[f],w=v-d[c]-u[p],x=v/2-d[c]/2+b,_=ux(y,x,w),E=l;n.modifiersData[r]=((t={})[E]=_,t.centerOffset=_-x,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&nx(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function px(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function mx(e){return[Ew,kw,Cw,Sw].some((function(t){return e[t]>=0}))}var hx={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=lx(t,{elementContext:"reference"}),s=lx(t,{altBoundary:!0}),l=px(a,r),c=px(s,o,i),u=mx(l),d=mx(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}},gx=Fw({defaultModifiers:[Hw,Gw,Kw,Xw,Zw,cx,dx,fx,hx]});function vx(e){void 0===e&&(e={});var t,n,r=Ap(e),o=r.visible,i=void 0!==o&&o,a=r.animated,s=void 0!==a&&a,l=Hp(h(r,["visible","animated"])),c=(0,b.useState)(i),u=c[0],d=c[1],f=(0,b.useState)(s),p=f[0],g=f[1],v=(0,b.useState)(!1),y=v[0],w=v[1],x=(t=u,n=(0,b.useRef)(null),U((function(){n.current=t}),[t]),n),_=null!=x.current&&x.current!==u;p&&!y&&_&&w(!0),(0,b.useEffect)((function(){if("number"==typeof p&&y){var e=setTimeout((function(){return w(!1)}),p);return function(){clearTimeout(e)}}return function(){}}),[p,y]);var E=(0,b.useCallback)((function(){return d(!0)}),[]),C=(0,b.useCallback)((function(){return d(!1)}),[]),k=(0,b.useCallback)((function(){return d((function(e){return!e}))}),[]),S=(0,b.useCallback)((function(){return w(!1)}),[]);return m(m({},l),{},{visible:u,animated:p,animating:y,show:E,hide:C,toggle:k,setVisible:d,setAnimated:g,stopAnimation:S})}var bx=ee("Mac")&&!ee("Chrome")&&ee("Safari");function yx(e){return function(t){return e&&!A(t,e)?e:t}}function wx(e){void 0===e&&(e={});var t=Ap(e),n=t.gutter,r=void 0===n?12:n,o=t.placement,i=void 0===o?"bottom":o,a=t.unstable_flip,s=void 0===a||a,l=t.unstable_offset,c=t.unstable_preventOverflow,u=void 0===c||c,d=t.unstable_fixed,f=void 0!==d&&d,p=t.modal,g=void 0!==p&&p,v=h(t,["gutter","placement","unstable_flip","unstable_offset","unstable_preventOverflow","unstable_fixed","modal"]),y=(0,b.useRef)(null),w=(0,b.useRef)(null),x=(0,b.useRef)(null),_=(0,b.useRef)(null),E=(0,b.useState)(i),C=E[0],k=E[1],S=(0,b.useState)(i),T=S[0],N=S[1],R=(0,b.useState)(l||[0,r])[0],I=(0,b.useState)({position:"fixed",left:"100%",top:"100%"}),M=I[0],P=I[1],O=(0,b.useState)({}),D=O[0],A=O[1],L=function(e){void 0===e&&(e={});var t=Ap(e),n=t.modal,r=void 0===n||n,o=vx(h(t,["modal"])),i=(0,b.useState)(r),a=i[0],s=i[1],l=(0,b.useRef)(null);return m(m({},o),{},{modal:a,setModal:s,unstable_disclosureRef:l})}(m({modal:g},v)),z=(0,b.useCallback)((function(){return!!y.current&&(y.current.forceUpdate(),!0)}),[]),B=(0,b.useCallback)((function(e){e.placement&&N(e.placement),e.styles&&(P(yx(e.styles.popper)),_.current&&A(yx(e.styles.arrow)))}),[]);return U((function(){return w.current&&x.current&&(y.current=gx(w.current,x.current,{placement:C,strategy:f?"fixed":"absolute",onFirstUpdate:bx?B:void 0,modifiers:[{name:"eventListeners",enabled:L.visible},{name:"applyStyles",enabled:!1},{name:"flip",enabled:s,options:{padding:8}},{name:"offset",options:{offset:R}},{name:"preventOverflow",enabled:u,options:{tetherOffset:function(){var e;return(null===(e=_.current)||void 0===e?void 0:e.clientWidth)||0}}},{name:"arrow",enabled:!!_.current,options:{element:_.current}},{name:"updateState",phase:"write",requires:["computeStyles"],enabled:L.visible&&!0,fn:function(e){var t=e.state;return B(t)}}]})),function(){y.current&&(y.current.destroy(),y.current=null)}}),[C,f,L.visible,s,R,u]),(0,b.useEffect)((function(){if(L.visible){var e=window.requestAnimationFrame((function(){var e;null===(e=y.current)||void 0===e||e.forceUpdate()}));return function(){window.cancelAnimationFrame(e)}}}),[L.visible]),m(m({},L),{},{unstable_referenceRef:w,unstable_popoverRef:x,unstable_arrowRef:_,unstable_popoverStyles:M,unstable_arrowStyles:D,unstable_update:z,unstable_originalPlacement:C,placement:T,place:k})}var xx={currentTooltipId:null,listeners:new Set,subscribe:function(e){var t=this;return this.listeners.add(e),function(){t.listeners.delete(e)}},show:function(e){this.currentTooltipId=e,this.listeners.forEach((function(t){return t(e)}))},hide:function(e){this.currentTooltipId===e&&(this.currentTooltipId=null,this.listeners.forEach((function(e){return e(null)})))}};var _x=["baseId","unstable_idCountRef","visible","animated","animating","setBaseId","show","hide","toggle","setVisible","setAnimated","stopAnimation","unstable_disclosureRef","unstable_referenceRef","unstable_popoverRef","unstable_arrowRef","unstable_popoverStyles","unstable_arrowStyles","unstable_originalPlacement","unstable_update","placement","place","unstable_timeout","unstable_setTimeout"],Ex=[].concat(_x,["unstable_portal"]),Cx=F({name:"TooltipReference",compose:re,keys:_x,useProps:function(e,t){var n=t.ref,r=t.onFocus,o=t.onBlur,i=t.onMouseEnter,a=t.onMouseLeave,s=h(t,["ref","onFocus","onBlur","onMouseEnter","onMouseLeave"]),l=G(r),c=G(o),u=G(i),d=G(a),f=(0,b.useCallback)((function(t){var n,r;null===(n=l.current)||void 0===n||n.call(l,t),t.defaultPrevented||null===(r=e.show)||void 0===r||r.call(e)}),[e.show]),p=(0,b.useCallback)((function(t){var n,r;null===(n=c.current)||void 0===n||n.call(c,t),t.defaultPrevented||null===(r=e.hide)||void 0===r||r.call(e)}),[e.hide]),g=(0,b.useCallback)((function(t){var n,r;null===(n=u.current)||void 0===n||n.call(u,t),t.defaultPrevented||null===(r=e.show)||void 0===r||r.call(e)}),[e.show]),v=(0,b.useCallback)((function(t){var n,r;null===(n=d.current)||void 0===n||n.call(d,t),t.defaultPrevented||null===(r=e.hide)||void 0===r||r.call(e)}),[e.hide]);return m({ref:H(e.unstable_referenceRef,n),tabIndex:0,onFocus:f,onBlur:p,onMouseEnter:g,onMouseLeave:v,"aria-describedby":e.baseId},s)}}),kx=z({as:"div",useHook:Cx});const Sx=(0,s.createContext)({});var Tx=F({name:"DisclosureContent",compose:re,keys:["baseId","unstable_idCountRef","visible","animated","animating","setBaseId","show","hide","toggle","setVisible","setAnimated","stopAnimation"],useProps:function(e,t){var n=t.onTransitionEnd,r=t.onAnimationEnd,o=t.style,i=h(t,["onTransitionEnd","onAnimationEnd","style"]),a=e.animated&&e.animating,s=(0,b.useState)(null),l=s[0],c=s[1],u=!e.visible&&!a,d=u?m({display:"none"},o):o,f=G(n),p=G(r),g=(0,b.useRef)(0);(0,b.useEffect)((function(){if(e.animated)return g.current=window.requestAnimationFrame((function(){g.current=window.requestAnimationFrame((function(){e.visible?c("enter"):c(a?"leave":null)}))})),function(){return window.cancelAnimationFrame(g.current)}}),[e.animated,e.visible,a]);var v=(0,b.useCallback)((function(t){var n;Y(t)&&(a&&!0===e.animated&&(null===(n=e.stopAnimation)||void 0===n||n.call(e)))}),[e.animated,a,e.stopAnimation]),y=(0,b.useCallback)((function(e){var t;null===(t=f.current)||void 0===t||t.call(f,e),v(e)}),[v]),w=(0,b.useCallback)((function(e){var t;null===(t=p.current)||void 0===t||t.call(p,e),v(e)}),[v]);return m({id:e.baseId,"data-enter":"enter"===l?"":void 0,"data-leave":"leave"===l?"":void 0,onTransitionEnd:y,onAnimationEnd:w,hidden:u,style:d},i)}}),Nx=z({as:"div",useHook:Tx});function Rx(){return W?document.body:null}var Ix=(0,b.createContext)(Rx());function Mx(e){var t=e.children,n=(0,b.useContext)(Ix)||Rx(),r=(0,b.useState)((function(){if(W){var e=document.createElement("div");return e.className=Mx.__className,e}return null}))[0];return U((function(){if(r&&n)return n.appendChild(r),function(){n.removeChild(r)}}),[r,n]),r?(0,Mt.createPortal)((0,b.createElement)(Ix.Provider,{value:r},t),r):null}function Px(e){e.defaultPrevented||"Escape"===e.key&&xx.show(null)}Mx.__className="__reakit-portal",Mx.__selector="."+Mx.__className;var Ox=F({name:"Tooltip",compose:Tx,keys:Ex,useOptions:function(e){var t=e.unstable_portal;return m({unstable_portal:void 0===t||t},h(e,["unstable_portal"]))},useProps:function(e,t){var n=t.ref,r=t.style,o=t.wrapElement,i=h(t,["ref","style","wrapElement"]);(0,b.useEffect)((function(){var t;j(null===(t=e.unstable_popoverRef)||void 0===t?void 0:t.current).addEventListener("keydown",Px)}),[]);var a=(0,b.useCallback)((function(t){return e.unstable_portal&&(t=(0,b.createElement)(Mx,null,t)),o?o(t):t}),[e.unstable_portal,o]);return m({ref:H(e.unstable_popoverRef,n),role:"tooltip",style:m(m({},e.unstable_popoverStyles),{},{pointerEvents:"none"},r),wrapElement:a},i)}}),Dx=z({as:"div",memo:!0,useHook:Ox});var Ax=Vu((function(e,t){const{as:n="span",shortcut:r,className:o,...i}=Fu(e,"Shortcut");if(!r)return null;let l,c;return"string"==typeof r?l=r:(l=r.display,c=r.ariaLabel),(0,s.createElement)(Qu,a({as:n,className:o,"aria-label":c,ref:t},i),l)}),"Shortcut");const Lx=$f("z-index:",1000002,";box-sizing:border-box;opacity:0;outline:none;transform-origin:top center;transition:opacity ",ph.transitionDurationFastest," ease;font-size:",ph.fontSize,";&[data-enter]{opacity:1;}",""),zx=Zu("div",{target:"e7tfjmw1"})("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;box-shadow:0 0 0 1px rgba( 255, 255, 255, 0.04 );color:",kp.white,";padding:4px 8px;"),Bx={name:"12mkfdx",styles:"outline:none"},Fx=Zu(Ax,{target:"e7tfjmw0"})("display:inline-block;margin-left:",qm(1),";"),{TooltipPopoverView:Vx}=t;var Hx=Vu((function(e,t){const{children:n,className:r,...o}=Fu(e,"TooltipContent"),{tooltip:i}=(0,s.useContext)(Sx),l=Bu()(Lx,r);return(0,s.createElement)(Dx,a({as:Qu},o,i,{className:l,ref:t}),(0,s.createElement)(Vx,null,n))}),"TooltipContent");const jx=Vu((function(e,t){const{animated:n=!0,animationDuration:r=160,baseId:o,children:i,content:l,focusable:c=!0,gutter:u=4,id:d,modal:f=!0,placement:p,visible:g=!1,shortcut:v,...y}=Fu(e,"Tooltip"),w=function(e){void 0===e&&(e={});var t=Ap(e),n=t.placement,r=void 0===n?"top":n,o=t.unstable_timeout,i=void 0===o?0:o,a=h(t,["placement","unstable_timeout"]),s=(0,b.useState)(i),l=s[0],c=s[1],u=(0,b.useRef)(null),d=(0,b.useRef)(null),f=wx(m(m({},a),{},{placement:r})),p=(f.modal,f.setModal,h(f,["modal","setModal"])),g=(0,b.useCallback)((function(){null!==u.current&&window.clearTimeout(u.current),null!==d.current&&window.clearTimeout(d.current)}),[]),v=(0,b.useCallback)((function(){g(),p.hide(),d.current=window.setTimeout((function(){xx.hide(p.baseId)}),l)}),[g,p.hide,l,p.baseId]),y=(0,b.useCallback)((function(){g(),!l||xx.currentTooltipId?(xx.show(p.baseId),p.show()):(xx.show(null),u.current=window.setTimeout((function(){xx.show(p.baseId),p.show()}),l))}),[g,l,p.show,p.baseId]);return(0,b.useEffect)((function(){return xx.subscribe((function(e){e!==p.baseId&&(g(),p.visible&&p.hide())}))}),[p.baseId,g,p.visible,p.hide]),(0,b.useEffect)((function(){return function(){g(),xx.hide(p.baseId)}}),[g,p.baseId]),m(m({},p),{},{hide:v,show:y,unstable_timeout:l,unstable_setTimeout:c})}({animated:n?r:void 0,baseId:o||d,gutter:u,placement:p,visible:g,...y}),x=(0,s.useMemo)((()=>({tooltip:w})),[w]);return(0,s.createElement)(Sx.Provider,{value:x},l&&(0,s.createElement)(Hx,{unstable_portal:f,ref:t},l,v&&(0,s.createElement)(Fx,{shortcut:v})),i&&(0,s.createElement)(kx,a({},w,i.props,{ref:null==i?void 0:i.ref}),(e=>(c||(e.tabIndex=void 0),(0,s.cloneElement)(i,e)))))}),"Tooltip");var $x=jx;const Wx=e=>{const{color:t,colorType:n}=e,[r,o]=(0,s.useState)(null),i=(0,s.useRef)(),a=(0,d.useCopyToClipboard)((()=>{switch(n){case"hsl":return t.toHslString();case"rgb":return t.toRgbString();default:return t.toHex()}}),(()=>{i.current&&clearTimeout(i.current),o(t.toHex()),i.current=setTimeout((()=>{o(null),i.current=void 0}),3e3)}));return(0,s.useEffect)((()=>()=>{i.current&&clearTimeout(i.current)}),[]),(0,s.createElement)($x,{content:(0,s.createElement)(Rh,{color:"white"},r===t.toHex()?(0,u.__)("Copied!"):(0,u.__)("Copy")),placement:"bottom"},(0,s.createElement)(Zy,{isSmall:!0,ref:a,icon:Jy,showTooltip:!1}))},Ux=e=>{let{min:t,max:n,label:r,abbreviation:o,onChange:i,value:a}=e;return(0,s.createElement)(Uv,{spacing:4},(0,s.createElement)($y,{min:t,max:n,label:r,hideLabelFromVision:!0,value:a,onChange:e=>{i(e?"string"!=typeof e?e:parseInt(e,10):0)},prefix:(0,s.createElement)(qv,{as:Rh,paddingLeft:qm(4),color:kp.ui.theme,lineHeight:1},o),spinControls:"none",size:"__unstable-large"}),(0,s.createElement)(Uy,{__nextHasNoMarginBottom:!0,label:r,hideLabelFromVision:!0,min:t,max:n,value:a,onChange:i,withInputField:!1}))},Gx=e=>{let{color:t,onChange:n,enableAlpha:r}=e;const{r:o,g:i,b:a,a:l}=t.toRgb();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ux,{min:0,max:255,label:"Red",abbreviation:"R",value:o,onChange:e=>n(gp({r:e,g:i,b:a,a:l}))}),(0,s.createElement)(Ux,{min:0,max:255,label:"Green",abbreviation:"G",value:i,onChange:e=>n(gp({r:o,g:e,b:a,a:l}))}),(0,s.createElement)(Ux,{min:0,max:255,label:"Blue",abbreviation:"B",value:a,onChange:e=>n(gp({r:o,g:i,b:e,a:l}))}),r&&(0,s.createElement)(Ux,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*l),onChange:e=>n(gp({r:o,g:i,b:a,a:e/100}))}))},Yx=e=>{let{color:t,onChange:n,enableAlpha:r}=e;const{h:o,s:i,l:a,a:l}=t.toHsl();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ux,{min:0,max:359,label:"Hue",abbreviation:"H",value:o,onChange:e=>{n(gp({h:e,s:i,l:a,a:l}))}}),(0,s.createElement)(Ux,{min:0,max:100,label:"Saturation",abbreviation:"S",value:i,onChange:e=>{n(gp({h:o,s:e,l:a,a:l}))}}),(0,s.createElement)(Ux,{min:0,max:100,label:"Lightness",abbreviation:"L",value:a,onChange:e=>{n(gp({h:o,s:i,l:e,a:l}))}}),r&&(0,s.createElement)(Ux,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*l),onChange:e=>{n(gp({h:o,s:i,l:a,a:e/100}))}}))},qx=e=>{let{color:t,onChange:n,enableAlpha:r}=e;return(0,s.createElement)(Rv,{prefix:(0,s.createElement)(qv,{as:Rh,marginLeft:qm(4),color:kp.ui.theme,lineHeight:1},"#"),value:t.toHex().slice(1).toUpperCase(),onChange:e=>{if(!e)return;const t=e.startsWith("#")?e:"#"+e;n(gp(t))},maxLength:r?9:7,label:(0,u.__)("Hex color"),hideLabelFromVision:!0,size:"__unstable-large",__unstableStateReducer:(e,t)=>{var n,r,o,i;const a=null===(n=t.payload)||void 0===n||null===(r=n.event)||void 0===r?void 0:r.nativeEvent;if("insertFromPaste"!==(null==a?void 0:a.inputType))return{...e};const s=null!==(o=e.value)&&void 0!==o&&o.startsWith("#")?e.value.slice(1).toUpperCase():null===(i=e.value)||void 0===i?void 0:i.toUpperCase();return{...e,value:s}},__unstableInputWidth:"9em"})},Kx=e=>{let{colorType:t,color:n,onChange:r,enableAlpha:o}=e;const i={color:n,onChange:r,enableAlpha:o};switch(t){case"hsl":return(0,s.createElement)(Yx,i);case"rgb":return(0,s.createElement)(Gx,i);default:return(0,s.createElement)(qx,i)}};function Xx(){return(Xx=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function Jx(e){var t=(0,b.useRef)(e),n=(0,b.useRef)((function(e){t.current&&t.current(e)}));return t.current=e,n.current}var Qx=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e0:e.buttons>0)&&o.current?i(n_(o.current,e,s.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=l.current,i=t_(o.current),a=n?i.addEventListener:i.removeEventListener;a(r?"touchmove":"mousemove",e),a(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=o.current;if(r&&(r_(t),!function(e,t){return t&&!e_(e)}(t,l.current)&&r)){if(e_(t)){l.current=!0;var a=t.changedTouches||[];a.length&&(s.current=a[0].identifier)}r.focus(),i(n_(r,t,s.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),a({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]}),[a,i]),u=c[0],d=c[1],f=c[2];return(0,b.useEffect)((function(){return f}),[f]),b.createElement("div",Xx({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:o,onKeyDown:d,tabIndex:0,role:"slider"}))})),i_=function(e){return e.filter(Boolean).join(" ")},a_=function(e){var t=e.color,n=e.left,r=e.top,o=void 0===r?.5:r,i=i_(["react-colorful__pointer",e.className]);return b.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},b.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},s_=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},l_=(Math.PI,function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:s_(e.h),s:s_(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:s_(o/2),a:s_(r,2)}}),c_=function(e){var t=l_(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},u_=function(e){var t=l_(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},d_=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),a=r*(1-n),s=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:s_(255*[r,s,a,a,l,r][c]),g:s_(255*[l,r,r,s,a,a][c]),b:s_(255*[a,a,l,r,r,s][c]),a:s_(o,2)}},f_=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?m_({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},p_=f_,m_=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),a=i-Math.min(t,n,r),s=a?i===t?(n-r)/a:i===n?2+(r-t)/a:4+(t-n)/a:0;return{h:s_(60*(s<0?s+6:s)),s:s_(i?a/i*100:0),v:s_(i/255*100),a:o}},h_=b.memo((function(e){var t=e.hue,n=e.onChange,r=i_(["react-colorful__hue",e.className]);return b.createElement("div",{className:r},b.createElement(o_,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:Qx(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":s_(t),"aria-valuemax":"360","aria-valuemin":"0"},b.createElement(a_,{className:"react-colorful__hue-pointer",left:t/360,color:c_({h:t,s:100,v:100,a:1})})))})),g_=b.memo((function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:c_({h:t.h,s:100,v:100,a:1})};return b.createElement("div",{className:"react-colorful__saturation",style:r},b.createElement(o_,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:Qx(t.s+100*e.left,0,100),v:Qx(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+s_(t.s)+"%, Brightness "+s_(t.v)+"%"},b.createElement(a_,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:c_(t)})))})),v_=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},b_=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")};function y_(e,t,n){var r=Jx(n),o=(0,b.useState)((function(){return e.toHsva(t)})),i=o[0],a=o[1],s=(0,b.useRef)({color:t,hsva:i});(0,b.useEffect)((function(){if(!e.equal(t,s.current.color)){var n=e.toHsva(t);s.current={hsva:n,color:t},a(n)}}),[t,e]),(0,b.useEffect)((function(){var t;v_(i,s.current.hsva)||e.equal(t=e.fromHsva(i),s.current.color)||(s.current={hsva:i,color:t},r(t))}),[i,e,r]);var l=(0,b.useCallback)((function(e){a((function(t){return Object.assign({},t,e)}))}),[]);return[i,l]}var w_,x_="undefined"!=typeof window?b.useLayoutEffect:b.useEffect,__=new Map,E_=function(e){x_((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!__.has(t)){var r=t.createElement("style");r.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',__.set(t,r);var o=w_||n.nc;o&&r.setAttribute("nonce",o),t.head.appendChild(r)}}),[])},C_=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,a=Zx(e,["className","colorModel","color","onChange"]),s=(0,b.useRef)(null);E_(s);var l=y_(n,o,i),c=l[0],u=l[1],d=i_(["react-colorful",t]);return b.createElement("div",Xx({},a,{ref:s,className:d}),b.createElement(g_,{hsva:c,onChange:u}),b.createElement(h_,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},k_=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+u_(Object.assign({},n,{a:0}))+", "+u_(Object.assign({},n,{a:1}))+")"},i=i_(["react-colorful__alpha",t]),a=s_(100*n.a);return b.createElement("div",{className:i},b.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),b.createElement(o_,{onMove:function(e){r({a:e.left})},onKey:function(e){r({a:Qx(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},b.createElement(a_,{className:"react-colorful__alpha-pointer",left:n.a,color:u_(n)})))},S_=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,a=Zx(e,["className","colorModel","color","onChange"]),s=(0,b.useRef)(null);E_(s);var l=y_(n,o,i),c=l[0],u=l[1],d=i_(["react-colorful",t]);return b.createElement("div",Xx({},a,{ref:s,className:d}),b.createElement(g_,{hsva:c,onChange:u}),b.createElement(h_,{hue:c.h,onChange:u}),b.createElement(k_,{hsva:c,onChange:u,className:"react-colorful__last-control"}))},T_={defaultColor:"rgba(0, 0, 0, 1)",toHsva:f_,fromHsva:function(e){var t=d_(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:b_},N_=function(e){return b.createElement(S_,Xx({},e,{colorModel:T_}))},R_={defaultColor:"rgb(0, 0, 0)",toHsva:p_,fromHsva:function(e){var t=d_(e);return"rgb("+t.r+", "+t.g+", "+t.b+")"},equal:b_},I_=function(e){return b.createElement(C_,Xx({},e,{colorModel:R_}))};const M_=e=>{let{color:t,enableAlpha:n,onChange:r}=e;const o=n?N_:I_,i=(0,s.useMemo)((()=>t.toRgbString()),[t]);return(0,s.createElement)(o,{color:i,onChange:e=>{r(gp(e))}})};function P_(e){let{defaultValue:t,onChange:n,value:r}=e;const o=void 0!==r,i=o?r:t,[a,l]=(0,s.useState)(i);let c;return c=o&&"function"==typeof n?n:o||"function"!=typeof n?l:e=>{n(e),l(e)},[o?r:a,c]}bp([yp]);const O_=[{label:"RGB",value:"rgb"},{label:"HSL",value:"hsl"},{label:"Hex",value:"hex"}],D_=Vu(((e,t)=>{const{enableAlpha:n=!1,color:r,onChange:o,defaultValue:i="#fff",copyFormat:l,...c}=Fu(e,"ColorPicker"),[f,p]=P_({onChange:o,value:r,defaultValue:i}),m=(0,s.useMemo)((()=>gp(f||"")),[f]),h=(0,d.useDebounce)(p),g=(0,s.useCallback)((e=>{h(e.toHex())}),[h]),[v,b]=(0,s.useState)(l||"hex");return(0,s.createElement)(Xy,a({ref:t},c),(0,s.createElement)(M_,{onChange:g,color:m,enableAlpha:n}),(0,s.createElement)(Yy,null,(0,s.createElement)(qy,{justify:"space-between"},(0,s.createElement)(Wy,{__nextHasNoMarginBottom:!0,options:O_,value:v,onChange:e=>b(e),label:(0,u.__)("Color format"),hideLabelFromVision:!0}),(0,s.createElement)(Wx,{color:m,colorType:l||v})),(0,s.createElement)(Ky,{direction:"column",gap:2},(0,s.createElement)(Kx,{colorType:v,color:m,onChange:g,enableAlpha:n}))))}),"ColorPicker");var A_=D_;function L_(e){if(void 0!==e)return"string"==typeof e?e:e.hex?e.hex:void 0}const z_=sc()((e=>{const t=gp(e),n=t.toHex(),r=t.toRgb(),o=t.toHsv(),i=t.toHsl();return{hex:n,rgb:r,hsv:o,hsl:i,source:"hex",oldHue:i.h}}));const B_=e=>(0,s.createElement)(A_,function(e){const{onChangeComplete:t}=e,n=(0,s.useCallback)((e=>{t(z_(e))}),[t]);return function(e){var t;return void 0!==e.onChangeComplete||void 0!==e.disableAlpha||"string"==typeof(null===(t=e.color)||void 0===t?void 0:t.hex)}(e)?{color:L_(e.color),enableAlpha:!e.disableAlpha,onChange:n}:{...e,color:e.color,enableAlpha:e.enableAlpha,onChange:e.onChange}}(e));var F_=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));function V_(e){const{actions:t,className:n,options:r,children:o}=e;return(0,s.createElement)("div",{className:c()("components-circular-option-picker",n)},(0,s.createElement)("div",{className:"components-circular-option-picker__swatches"},r),o,t&&(0,s.createElement)("div",{className:"components-circular-option-picker__custom-clear-wrapper"},t))}V_.Option=function(e){const{className:t,isSelected:n,selectedIconProps:r,tooltipText:o,...i}=e,l=(0,s.createElement)(rd,a({isPressed:n,className:"components-circular-option-picker__option"},i));return(0,s.createElement)("div",{className:c()(t,"components-circular-option-picker__option-wrapper")},o?(0,s.createElement)(zf,{text:o},l):l,n&&(0,s.createElement)(ay,a({icon:F_},r||{})))},V_.ButtonAction=function(e){const{className:t,children:n,...r}=e;return(0,s.createElement)(rd,a({className:c()("components-circular-option-picker__clear",t),variant:"tertiary"},r),n)},V_.DropdownLinkAction=function(e){const{buttonProps:t,className:n,dropdownProps:r,linkText:o}=e;return(0,s.createElement)(ty,a({className:c()("components-circular-option-picker__dropdown-link-action",n),renderToggle:e=>{let{isOpen:n,onToggle:r}=e;return(0,s.createElement)(rd,a({"aria-expanded":n,"aria-haspopup":"true",onClick:r,variant:"link"},t),o)}},r))};var H_=Vu((function(e,t){const n=function(e){const{expanded:t=!1,...n}=Fu(e,"VStack");return Wv({direction:"column",expanded:t,...n})}(e);return(0,s.createElement)(Qu,a({},n,{ref:t}))}),"VStack");var j_=Vu((function(e,t){const n=ih(e);return(0,s.createElement)(Qu,a({as:"span"},n,{ref:t}))}),"Truncate");var $_=Vu((function(e,t){const n=function(e){const{as:t,level:n=2,...r}=Fu(e,"Heading"),o=t||`h${n}`,i={};return"string"==typeof o&&"h"!==o[0]&&(i.role="heading",i["aria-level"]="string"==typeof n?parseInt(n):n),{...Nh({color:kp.gray[900],size:Sh(n),isBlock:!0,weight:ph.fontWeightHeading,...r}),...i,as:o}}(e);return(0,s.createElement)(Qu,a({},n,{ref:t}))}),"Heading");const W_=Zu($_,{target:"ev9wop70"})({name:"13lxv2o",styles:"text-transform:uppercase;line-height:24px;font-weight:500;&&&{font-size:11px;margin-bottom:0;}"}),U_=Zu("div",{target:"eovvns30"})("margin-left:",qm(-2),";margin-right:",qm(-2),";&:first-of-type{margin-top:",qm(-2),";}&:last-of-type{margin-bottom:",qm(-2),";}",(e=>{let{paddingSize:t="small"}=e;if("none"===t)return;const n={small:qm(2),medium:qm(4)};return $f("padding:",n[t]||n.small,";","")}),";");var G_=Vu((function(e,t){const{paddingSize:n="small",...r}=Fu(e,"DropdownContentWrapper");return(0,s.createElement)(U_,a({},r,{paddingSize:n,ref:t}))}),"DropdownContentWrapper");bp([yp,Qb]);const Y_=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.colors)&&!("color"in t);var t}));function q_(e){let{className:t,clearColor:n,colors:r,onChange:o,value:i,actions:a}=e;const l=(0,s.useMemo)((()=>r.map(((e,t)=>{let{color:r,name:a}=e;const l=gp(r),c=i===r;return(0,s.createElement)(V_.Option,{key:`${r}-${t}`,isSelected:c,selectedIconProps:c?{fill:l.contrast()>l.contrast("#000")?"#fff":"#000"}:{},tooltipText:a||(0,u.sprintf)((0,u.__)("Color code: %s"),r),style:{backgroundColor:r,color:r},onClick:c?n:()=>o(r,t),"aria-label":a?(0,u.sprintf)((0,u.__)("Color: %s"),a):(0,u.sprintf)((0,u.__)("Color code: %s"),r)})}))),[r,i,o,n]);return(0,s.createElement)(V_,{className:t,options:l,actions:a})}function K_(e){let{className:t,clearColor:n,colors:r,onChange:o,value:i,actions:a}=e;return 0===r.length?null:(0,s.createElement)(H_,{spacing:3,className:t},r.map(((e,t)=>{let{name:l,colors:c}=e;return(0,s.createElement)(H_,{spacing:2,key:t},(0,s.createElement)(W_,null,l),(0,s.createElement)(q_,{clearColor:n,colors:c,onChange:e=>o(e,t),value:i,actions:r.length===t+1?a:null}))})))}function X_(e){let{isRenderedInSidebar:t,popoverProps:n,...r}=e;const o=(0,s.useMemo)((()=>({shift:!0,...t?{placement:"left-start",offset:34}:{placement:"bottom",offset:8},...n})),[t,n]);return(0,s.createElement)(ty,a({contentClassName:"components-color-palette__custom-color-dropdown-content",popoverProps:o},r))}bp([yp,Qb]);const Z_=(0,s.forwardRef)((function(e,t){const{clearable:n=!0,colors:r=[],disableCustomColors:o=!1,enableAlpha:i=!1,onChange:l,value:c,__experimentalIsRenderedInSidebar:d=!1,...f}=e,[p,m]=(0,s.useState)(c),h=(0,s.useCallback)((()=>l(void 0)),[l]),g=(0,s.useCallback)((e=>{m(((e,t)=>{if(!/^var\(/.test(null!=e?e:"")||null===t)return e;const{ownerDocument:n}=t,{defaultView:r}=n,o=null==r?void 0:r.getComputedStyle(t).backgroundColor;return o?gp(o).toHex():e})(c,e))}),[c]),v=Y_(r),b=(0,s.useMemo)((()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return"";const r=/^var\(/.test(e),o=r?e:gp(e).toHex(),i=n?t:[{colors:t}];for(const{colors:e}of i)for(const{name:t,color:n}of e)if(o===(r?n:gp(n).toHex()))return t;return(0,u.__)("Custom")}(c,r,v)),[c,r,v]),y=gp(null!=p?p:""),w=null!=c&&c.startsWith("#")?c.substring(1):null!=c?c:"",x=w?(0,u.sprintf)((0,u.__)('Custom color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),b,w):(0,u.__)("Custom color picker."),_={clearable:n,clearColor:h,onChange:l,value:c,actions:!!n&&(0,s.createElement)(V_.ButtonAction,{onClick:h},(0,u.__)("Clear"))};return(0,s.createElement)(H_,a({spacing:3,ref:t},f),!o&&(0,s.createElement)(X_,{isRenderedInSidebar:d,renderContent:()=>(0,s.createElement)(G_,{paddingSize:"none"},(0,s.createElement)(B_,{color:p,onChange:e=>l(e),enableAlpha:i})),renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(Xm,{as:"button",ref:g,justify:"space-between",align:"flex-start",className:"components-color-palette__custom-color","aria-expanded":t,"aria-haspopup":"true",onClick:n,"aria-label":x,style:(r=c,void 0===r||0===gp(r).alpha()?{color:"#000"}:{background:c,color:y.contrast()>y.contrast("#000")?"#fff":"#000"})},(0,s.createElement)(jm,{isBlock:!0,as:j_,className:"components-color-palette__custom-color-name"},b),(0,s.createElement)(jm,{as:"span",className:"components-color-palette__custom-color-value"},w));var r}}),v?(0,s.createElement)(K_,a({},_,{colors:r})):(0,s.createElement)(q_,a({},_,{colors:r})))}));var J_=Z_;const Q_="web"===s.Platform.OS,eE={px:{value:"px",label:Q_?"px":(0,u.__)("Pixels (px)"),a11yLabel:(0,u.__)("Pixels (px)"),step:1},"%":{value:"%",label:Q_?"%":(0,u.__)("Percentage (%)"),a11yLabel:(0,u.__)("Percent (%)"),step:.1},em:{value:"em",label:Q_?"em":(0,u.__)("Relative to parent font size (em)"),a11yLabel:(0,u._x)("ems","Relative to parent font size (em)"),step:.01},rem:{value:"rem",label:Q_?"rem":(0,u.__)("Relative to root font size (rem)"),a11yLabel:(0,u._x)("rems","Relative to root font size (rem)"),step:.01},vw:{value:"vw",label:Q_?"vw":(0,u.__)("Viewport width (vw)"),a11yLabel:(0,u.__)("Viewport width (vw)"),step:.1},vh:{value:"vh",label:Q_?"vh":(0,u.__)("Viewport height (vh)"),a11yLabel:(0,u.__)("Viewport height (vh)"),step:.1},vmin:{value:"vmin",label:Q_?"vmin":(0,u.__)("Viewport smallest dimension (vmin)"),a11yLabel:(0,u.__)("Viewport smallest dimension (vmin)"),step:.1},vmax:{value:"vmax",label:Q_?"vmax":(0,u.__)("Viewport largest dimension (vmax)"),a11yLabel:(0,u.__)("Viewport largest dimension (vmax)"),step:.1},ch:{value:"ch",label:Q_?"ch":(0,u.__)("Width of the zero (0) character (ch)"),a11yLabel:(0,u.__)("Width of the zero (0) character (ch)"),step:.01},ex:{value:"ex",label:Q_?"ex":(0,u.__)("x-height of the font (ex)"),a11yLabel:(0,u.__)("x-height of the font (ex)"),step:.01},cm:{value:"cm",label:Q_?"cm":(0,u.__)("Centimeters (cm)"),a11yLabel:(0,u.__)("Centimeters (cm)"),step:.001},mm:{value:"mm",label:Q_?"mm":(0,u.__)("Millimeters (mm)"),a11yLabel:(0,u.__)("Millimeters (mm)"),step:.1},in:{value:"in",label:Q_?"in":(0,u.__)("Inches (in)"),a11yLabel:(0,u.__)("Inches (in)"),step:.001},pc:{value:"pc",label:Q_?"pc":(0,u.__)("Picas (pc)"),a11yLabel:(0,u.__)("Picas (pc)"),step:1},pt:{value:"pt",label:Q_?"pt":(0,u.__)("Points (pt)"),a11yLabel:(0,u.__)("Points (pt)"),step:1}},tE=Object.values(eE),nE=[eE.px,eE["%"],eE.em,eE.rem,eE.vw,eE.vh],rE=eE.px;function oE(e,t,n){return aE(t?`${null!=e?e:""}${t}`:e,n)}function iE(e){return Array.isArray(e)&&!!e.length}function aE(e){var t,n;let r,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tE;if(void 0!==e||null===e){r=`${e}`.trim();const t=parseFloat(r);o=isFinite(t)?t:void 0}const a=null===(t=r)||void 0===t?void 0:t.match(/[\d.\-\+]*\s*(.*)/),s=null==a||null===(n=a[1])||void 0===n?void 0:n.toLowerCase();let l;if(iE(i)){const e=i.find((e=>e.value===s));l=null==e?void 0:e.value}else l=rE.value;return[o,l]}function sE(e,t,n,r){const[o,i]=aE(e,t),a=null!=o?o:n;let s=i||r;return!s&&iE(t)&&(s=t[0].value),[a,s]}const lE=e=>{let{units:t=tE,availableUnits:n=[],defaultValues:r}=e;const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return Array.isArray(t)?t.filter((t=>e.includes(t.value))):[]}(n,t);return r&&o.forEach(((e,t)=>{if(r[e.value]){const[n]=aE(r[e.value]);o[t].default=n}})),o};function cE(e){const{border:t,className:n,colors:r=[],enableAlpha:o=!1,enableStyle:i=!0,onChange:a,previousStyleSelection:l,size:c="default",__experimentalIsRenderedInSidebar:u=!1,...d}=Fu(e,"BorderControlDropdown"),[f]=aE(null==t?void 0:t.width),p=0===f,m=Bu(),h=(0,s.useMemo)((()=>m((e=>$f("background:#fff;&&>button{height:","__unstable-large"===e?"40px":"30px",";width:","__unstable-large"===e?"40px":"30px",";padding:0;display:flex;align-items:center;justify-content:center;",zh({borderRadius:"2px 0 0 2px"},{borderRadius:"0 2px 2px 0"})()," border:",ph.borderWidth," solid ",kp.ui.border,";&:focus,&:hover:not( :disabled ){",zb," border-color:",kp.ui.borderFocus,";z-index:1;position:relative;}}",""))(c),n)),[n,m,c]),g=(0,s.useMemo)((()=>m($b)),[m]),v=(0,s.useMemo)((()=>m(Vb(t,c))),[t,m,c]),b=(0,s.useMemo)((()=>m(Hb)),[m]),y=(0,s.useMemo)((()=>m(jb)),[m]),w=(0,s.useMemo)((()=>m(Wb)),[m]);return{...d,border:t,className:h,colors:r,enableAlpha:o,enableStyle:i,indicatorClassName:g,indicatorWrapperClassName:v,onColorChange:e=>{const n="none"===(null==t?void 0:t.style)?l:null==t?void 0:t.style,r=p&&e?"1px":null==t?void 0:t.width;a({color:e,style:n,width:r})},onStyleChange:e=>{const n=p&&e?"1px":null==t?void 0:t.width;a({...t,style:e,width:n})},onReset:()=>{a({...t,color:void 0,style:void 0})},popoverContentClassName:y,popoverControlsClassName:b,resetButtonClassName:w,__experimentalIsRenderedInSidebar:u}}const uE=Vu(((e,t)=>{const{__experimentalIsRenderedInSidebar:n,border:r,colors:o,disableCustomColors:i,enableAlpha:l,enableStyle:c,indicatorClassName:d,indicatorWrapperClassName:f,onReset:p,onColorChange:m,onStyleChange:h,popoverContentClassName:g,popoverControlsClassName:v,resetButtonClassName:b,showDropdownHeader:y,__unstablePopoverProps:w,...x}=cE(e),{color:_,style:E}=r||{},C=((e,t)=>{if(e&&t){if(Y_(t)){let n;return t.some((t=>t.colors.some((t=>t.color===e&&(n=t,!0))))),n}return t.find((t=>t.color===e))}})(_,o),k=((e,t,n,r)=>r?t?n?(0,u.sprintf)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s". The currently selected style is "%3$s".',t.name,t.color,n):(0,u.sprintf)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s".',t.name,t.color):e?n?(0,u.sprintf)('Border color and style picker. The currently selected color has a value of "%1$s". The currently selected style is "%2$s".',e,n):(0,u.sprintf)('Border color and style picker. The currently selected color has a value of "%1$s".',e):(0,u.__)("Border color and style picker."):t?(0,u.sprintf)('Border color picker. The currently selected color is called "%1$s" and has a value of "%2$s".',t.name,t.color):e?(0,u.sprintf)('Border color picker. The currently selected color has a value of "%1$s".',e):(0,u.__)("Border color picker."))(_,C,E,c),S=_||E&&"none"!==E,T=n?"bottom left":void 0;return(0,s.createElement)(ty,a({renderToggle:e=>{let{onToggle:t}=e;return(0,s.createElement)(rd,{onClick:t,variant:"tertiary","aria-label":k,tooltipPosition:T,label:(0,u.__)("Border color and style picker"),showTooltip:!0},(0,s.createElement)("span",{className:f},(0,s.createElement)(Xb,{className:d,colorValue:_})))},renderContent:e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(G_,{paddingSize:"medium"},(0,s.createElement)(H_,{className:v,spacing:6},y?(0,s.createElement)(Uv,null,(0,s.createElement)(_v,null,(0,u.__)("Border color")),(0,s.createElement)(rd,{isSmall:!0,label:(0,u.__)("Close border color"),icon:Nb,onClick:t})):void 0,(0,s.createElement)(J_,{className:g,value:_,onChange:m,colors:o,disableCustomColors:i,__experimentalIsRenderedInSidebar:n,clearable:!1,enableAlpha:l}),c&&(0,s.createElement)(Kb,{label:(0,u.__)("Style"),value:E,onChange:h}))),S&&(0,s.createElement)(G_,{paddingSize:"none"},(0,s.createElement)(rd,{className:b,variant:"tertiary",onClick:()=>{p(),t()}},(0,u.__)("Reset to default"))))},popoverProps:{...w}},x,{ref:t}))}),"BorderControlDropdown");var dE=uE;function fE(e){let{className:t,isUnitSelectTabbable:n=!0,onChange:r,size:o="default",unit:i="px",units:l=nE,...u}=e;if(!iE(l)||1===(null==l?void 0:l.length))return(0,s.createElement)(Db,{className:"components-unit-control__unit-label",selectSize:o},i);const d=c()("components-unit-control__select",t);return(0,s.createElement)(Ab,a({className:d,onChange:e=>{const{value:t}=e.target,n=l.find((e=>e.value===t));null==r||r(t,{event:e,data:n})},selectSize:o,tabIndex:n?void 0:-1,value:i},u),l.map((e=>(0,s.createElement)("option",{value:e.value,key:e.value},e.label))))}const pE=(0,s.forwardRef)((function(e,t){const{__unstableStateReducer:n,autoComplete:r="off",children:o,className:i,disabled:l=!1,disableUnits:d=!1,isPressEnterToChange:f=!1,isResetValueOnUnitChange:p=!1,isUnitSelectTabbable:m=!0,label:h,onChange:g,onUnitChange:v,size:b="default",unit:y,units:w=nE,value:x,onBlur:_,onFocus:E,...C}=e;"unit"in e&&Kl()("UnitControl unit prop",{since:"5.6",hint:"The unit should be provided within the `value` prop.",version:"6.2"});const k=null!=x?x:void 0,S=(0,s.useMemo)((()=>function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:tE;const r=Array.isArray(n)?[...n]:[],[,o]=oE(e,t,tE);return o&&!r.some((e=>e.value===o))&&eE[o]&&r.unshift(eE[o]),r}(k,y,w)),[k,y,w]),[T,N]=oE(k,y,S),[R,I]=py(1===S.length?S[0].value:y,{initial:N,fallback:""});(0,s.useEffect)((()=>{void 0!==N&&I(N)}),[N,I]);const M=(0,s.useRef)(void 0),P=c()("components-unit-control","components-unit-control-wrapper",i),O=e=>{if(!isNaN(Number(e.currentTarget.value)))return void(M.current=void 0);const[t,n]=sE(e.currentTarget.value,S,T,R);if(M.current=t,f&&n!==R){const t={event:e,data:Array.isArray(S)?S.find((e=>e.value===n)):void 0};null==v||v(n,t),I(n)}},D=(e,t)=>{const n={...e};var r;t.type===tv&&(void 0!==M.current&&(n.value=(null!==(r=M.current)&&void 0!==r?r:"").toString(),M.current=void 0));return n};let A=D;n&&(A=(e,t)=>{const r=D(e,t);return n(r,t)});const L=d?null:(0,s.createElement)(fE,{"aria-label":(0,u.__)("Select unit"),disabled:l,isUnitSelectTabbable:m,onChange:(e,t)=>{const{data:n}=t;let r=`${null!=T?T:""}${e}`;p&&void 0!==(null==n?void 0:n.default)&&(r=`${n.default}${e}`),null==g||g(r,t),null==v||v(e,t),I(e)},size:b,unit:R,units:S,onBlur:_,onFocus:E});let z=C.step;if(!z&&S){var B;const e=S.find((e=>e.value===R));z=null!==(B=null==e?void 0:e.step)&&void 0!==B?B:1}return(0,s.createElement)(Pb,a({type:f?"text":"number"},C,{autoComplete:r,className:P,disabled:l,spinControls:"none",isPressEnterToChange:f,label:h,onBlur:e=>{O(e),null==_||_(e)},onKeyDown:e=>{const{key:t}=e;"Enter"===t&&O(e)},onChange:(e,t)=>{if(""===e||null==e)return void(null==g||g("",t));const n=sE(e,S,T,R).join("");null==g||g(n,t)},ref:t,size:b,suffix:L,value:null!=T?T:"",step:z,__unstableStateReducer:A,onFocus:E}))}));var mE=pE;function hE(e){const{className:t,colors:n=[],isCompact:r,onChange:o,enableAlpha:i=!0,enableStyle:a=!0,shouldSanitizeBorder:l=!0,size:c="default",value:u,width:d,__experimentalIsRenderedInSidebar:f=!1,...p}=Fu(e,"BorderControl"),[m,h]=aE(null==u?void 0:u.width),g=h||"px",v=0===m,[b,y]=(0,s.useState)(),[w,x]=(0,s.useState)(),_=(0,s.useCallback)((e=>{if(l)return o((e=>{const t=void 0===(null==e?void 0:e.width)||""===e.width,n=void 0===(null==e?void 0:e.color);if(!t||!n)return e})(e));o(e)}),[o,l]),E=(0,s.useCallback)((e=>{const t=""===e?void 0:e,[n]=aE(e),r=0===n,o={...u,width:t};r&&!v&&(y(null==u?void 0:u.color),x(null==u?void 0:u.style),o.color=void 0,o.style="none"),!r&&v&&(void 0===o.color&&(o.color=b),"none"===o.style&&(o.style=w)),_(o)}),[u,v,b,w,_]),C=(0,s.useCallback)((e=>{E(`${e}${g}`)}),[E,g]),k=Bu(),S=(0,s.useMemo)((()=>k(Bb,t)),[t,k]);let T=d;r&&(T="__unstable-large"===c?"116px":"90px");const N=(0,s.useMemo)((()=>{const e=!!T&&Fb,t=(e=>$f("height:","__unstable-large"===e?"40px":"30px",";",""))(c);return k($f(Pb,"{flex:1 1 40%;}&& ",Ab,"{min-height:0;}",""),e,t)}),[T,k,c]),R=(0,s.useMemo)((()=>k($f("flex:1 1 60%;",zh({marginRight:qm(3)})(),";",""))),[k]);return{...p,className:S,colors:n,enableAlpha:i,enableStyle:a,innerWrapperClassName:N,inputWidth:T,onBorderChange:_,onSliderChange:C,onWidthChange:E,previousStyleSelection:w,sliderClassName:R,value:u,widthUnit:g,widthValue:m,size:c,__experimentalIsRenderedInSidebar:f}}const gE=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,s.createElement)(ed,{as:"legend"},t):(0,s.createElement)(_v,{as:"legend"},t):null},vE=Vu(((e,t)=>{const{colors:n,disableCustomColors:r,disableUnits:o,enableAlpha:i,enableStyle:l,hideLabelFromVision:c,innerWrapperClassName:d,inputWidth:f,label:p,onBorderChange:m,onSliderChange:h,onWidthChange:g,placeholder:v,__unstablePopoverProps:b,previousStyleSelection:y,showDropdownHeader:w,size:x,sliderClassName:_,value:E,widthUnit:C,widthValue:k,withSlider:S,__experimentalIsRenderedInSidebar:T,...N}=hE(e);return(0,s.createElement)(Qu,a({as:"fieldset"},N,{ref:t}),(0,s.createElement)(gE,{label:p,hideLabelFromVision:c}),(0,s.createElement)(Uv,{spacing:4,className:d},(0,s.createElement)(mE,{prefix:(0,s.createElement)(dE,{border:E,colors:n,__unstablePopoverProps:b,disableCustomColors:r,enableAlpha:i,enableStyle:l,onChange:m,previousStyleSelection:y,showDropdownHeader:w,__experimentalIsRenderedInSidebar:T,size:x}),label:(0,u.__)("Border width"),hideLabelFromVision:!0,min:0,onChange:g,value:(null==E?void 0:E.width)||"",placeholder:v,disableUnits:o,__unstableInputWidth:f,size:x}),S&&(0,s.createElement)(jy,{__nextHasNoMarginBottom:!0,label:(0,u.__)("Border width"),hideLabelFromVision:!0,className:_,initialPosition:0,max:100,min:0,onChange:h,step:["px","%"].includes(C)?1:.1,value:k||void 0,withInputField:!1})))}),"BorderControl");var bE=vE;const yE={bottom:{alignItems:"flex-end",justifyContent:"center"},bottomLeft:{alignItems:"flex-start",justifyContent:"flex-end"},bottomRight:{alignItems:"flex-end",justifyContent:"flex-end"},center:{alignItems:"center",justifyContent:"center"},spaced:{alignItems:"center",justifyContent:"space-between"},left:{alignItems:"center",justifyContent:"flex-start"},right:{alignItems:"center",justifyContent:"flex-end"},stretch:{alignItems:"stretch"},top:{alignItems:"flex-start",justifyContent:"center"},topLeft:{alignItems:"flex-start",justifyContent:"flex-start"},topRight:{alignItems:"flex-start",justifyContent:"flex-end"}};function wE(e){const{align:t,alignment:n,className:r,columnGap:o,columns:i=2,gap:a=3,isInline:l=!1,justify:c,rowGap:u,rows:d,templateColumns:f,templateRows:p,...m}=Fu(e,"Grid"),h=Ym(Array.isArray(i)?i:[i]),g=Ym(Array.isArray(d)?d:[d]),v=f||!!i&&`repeat( ${h}, 1fr )`,b=p||!!d&&`repeat( ${g}, 1fr )`,y=Bu();return{...m,className:(0,s.useMemo)((()=>{const e=function(e){return e?yE[e]:{}}(n),i=$f({alignItems:t,display:l?"inline-grid":"grid",gap:`calc( ${ph.gridBase} * ${a} )`,gridTemplateColumns:v||void 0,gridTemplateRows:b||void 0,gridRowGap:u,gridColumnGap:o,justifyContent:c,verticalAlign:l?"middle":void 0,...e},"","");return y(i,r)}),[t,n,r,o,y,a,v,b,l,c,u])}}var xE=Vu((function(e,t){const n=wE(e);return(0,s.createElement)(Qu,a({},n,{ref:t}))}),"Grid");function _E(e){const{className:t,colors:n=[],enableAlpha:r=!1,enableStyle:o=!0,size:i="default",__experimentalIsRenderedInSidebar:a=!1,...l}=Fu(e,"BorderBoxControlSplitControls"),c=Bu(),u=(0,s.useMemo)((()=>c((e=>$f("position:relative;flex:1;width:","__unstable-large"===e?void 0:"80%",";",""))(i),t)),[c,t,i]);return{...l,centeredClassName:(0,s.useMemo)((()=>c(Eb,t)),[c,t]),className:u,colors:n,enableAlpha:r,enableStyle:o,rightAlignedClassName:(0,s.useMemo)((()=>c($f(zh({marginLeft:"auto"})(),";",""),t)),[c,t]),size:i,__experimentalIsRenderedInSidebar:a}}var EE=Vu(((e,t)=>{const{centeredClassName:n,colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:l,onChange:c,popoverPlacement:f,popoverOffset:p,rightAlignedClassName:m,size:h="default",value:g,__experimentalIsRenderedInSidebar:v,...b}=_E(e),[y,w]=(0,s.useState)(null),x=(0,s.useMemo)((()=>f?{placement:f,offset:p,anchor:y,shift:!0}:void 0),[f,p,y]),_={colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:l,isCompact:!0,__experimentalIsRenderedInSidebar:v,size:h},E=(0,d.useMergeRefs)([w,t]);return(0,s.createElement)(xE,a({},b,{ref:E,gap:4}),(0,s.createElement)(Tb,{value:g,size:h}),(0,s.createElement)(bE,a({className:n,hideLabelFromVision:!0,label:(0,u.__)("Top border"),onChange:e=>c(e,"top"),__unstablePopoverProps:x,value:null==g?void 0:g.top},_)),(0,s.createElement)(bE,a({hideLabelFromVision:!0,label:(0,u.__)("Left border"),onChange:e=>c(e,"left"),__unstablePopoverProps:x,value:null==g?void 0:g.left},_)),(0,s.createElement)(bE,a({className:m,hideLabelFromVision:!0,label:(0,u.__)("Right border"),onChange:e=>c(e,"right"),__unstablePopoverProps:x,value:null==g?void 0:g.right},_)),(0,s.createElement)(bE,a({className:n,hideLabelFromVision:!0,label:(0,u.__)("Bottom border"),onChange:e=>c(e,"bottom"),__unstablePopoverProps:x,value:null==g?void 0:g.bottom},_)))}),"BorderBoxControlSplitControls");const CE=/^([\d.\-+]*)\s*(fr|cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|vw|vh|vmin|vmax|%|cap|ic|rlh|vi|vb|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?$/;const kE=["top","right","bottom","left"],SE=["color","style","width"],TE=e=>!e||!SE.some((t=>void 0!==e[t])),NE=e=>{if(!e)return!1;if(RE(e)){return!kE.every((t=>TE(e[t])))}return!TE(e)},RE=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).some((e=>-1!==kE.indexOf(e)))},IE=e=>{if(!RE(e))return!1;const t=kE.map((t=>ME(null==e?void 0:e[t])));return!t.every((e=>e===t[0]))},ME=(e,t)=>{if(TE(e))return t;const{color:n,style:r,width:o}=t||{},{color:i=n,style:a=r,width:s=o}=e;return[s,!!s&&"0"!==s||!!i?a||"solid":a,i].filter(Boolean).join(" ")},PE=e=>function(e){if(0===e.length)return;const t={};let n,r=0;return e.forEach((e=>{t[e]=void 0===t[e]?1:t[e]+1,t[e]>r&&(n=e,r=t[e])})),n}(e.map((e=>void 0===e?void 0:function(e){const t=e.trim().match(CE);if(!t)return[void 0,void 0];const[,n,r]=t;let o=parseFloat(n);return o=Number.isNaN(o)?void 0:o,[o,r]}(`${e}`)[1])).filter((e=>void 0!==e)));function OE(e){const{className:t,colors:n=[],onChange:r,enableAlpha:o=!1,enableStyle:i=!0,size:a="default",value:l,__experimentalIsRenderedInSidebar:c=!1,...u}=Fu(e,"BorderBoxControl"),d=IE(l),f=RE(l),p=f?(e=>{if(!e)return;const t=[],n=[],r=[];kE.forEach((o=>{var i,a,s;t.push(null===(i=e[o])||void 0===i?void 0:i.color),n.push(null===(a=e[o])||void 0===a?void 0:a.style),r.push(null===(s=e[o])||void 0===s?void 0:s.width)}));const o=t.every((e=>e===t[0])),i=n.every((e=>e===n[0])),a=r.every((e=>e===r[0]));return{color:o?t[0]:void 0,style:i?n[0]:void 0,width:a?r[0]:PE(r)}})(l):l,m=f?l:(e=>{if(e&&!TE(e))return{top:e,right:e,bottom:e,left:e}})(l),h=!isNaN(parseFloat(`${null==p?void 0:p.width}`)),[g,v]=(0,s.useState)(!d),b=Bu(),y=(0,s.useMemo)((()=>b(wb,t)),[b,t]),w=(0,s.useMemo)((()=>b($f("flex:1;",zh({marginRight:"24px"})(),";",""))),[b]),x=(0,s.useMemo)((()=>b(xb)),[b]);return{...u,className:y,colors:n,disableUnits:d&&!h,enableAlpha:o,enableStyle:i,hasMixedBorders:d,isLinked:g,linkedControlClassName:w,onLinkedChange:e=>{if(!e)return r(void 0);if(!d||(t=e)&&SE.every((e=>void 0!==t[e])))return r(TE(e)?void 0:e);var t;const n=((e,t)=>{const n={};return e.color!==t.color&&(n.color=t.color),e.style!==t.style&&(n.style=t.style),e.width!==t.width&&(n.width=t.width),n})(p,e),o={top:{...null==l?void 0:l.top,...n},right:{...null==l?void 0:l.right,...n},bottom:{...null==l?void 0:l.bottom,...n},left:{...null==l?void 0:l.left,...n}};if(IE(o))return r(o);const i=TE(o.top)?void 0:o.top;r(i)},onSplitChange:(e,t)=>{const n={...m,[t]:e};IE(n)?r(n):r(e)},toggleLinked:()=>v(!g),linkedValue:p,size:a,splitValue:m,wrapperClassName:x,__experimentalIsRenderedInSidebar:c}}const DE=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,s.createElement)(ed,{as:"label"},t):(0,s.createElement)(_v,null,t):null},AE=Vu(((e,t)=>{const{className:n,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:l,enableStyle:c,hasMixedBorders:f,hideLabelFromVision:p,isLinked:m,label:h,linkedControlClassName:g,linkedValue:v,onLinkedChange:b,onSplitChange:y,popoverPlacement:w,popoverOffset:x,size:_,splitValue:E,toggleLinked:C,wrapperClassName:k,__experimentalIsRenderedInSidebar:S,...T}=OE(e),[N,R]=(0,s.useState)(null),I=(0,s.useMemo)((()=>w?{placement:w,offset:x,anchor:N,shift:!0}:void 0),[w,x,N]),M=(0,d.useMergeRefs)([R,t]);return(0,s.createElement)(Qu,a({className:n},T,{ref:M}),(0,s.createElement)(DE,{label:h,hideLabelFromVision:p}),(0,s.createElement)(Qu,{className:k},m?(0,s.createElement)(bE,{className:g,colors:r,disableUnits:i,disableCustomColors:o,enableAlpha:l,enableStyle:c,onChange:b,placeholder:f?(0,u.__)("Mixed"):void 0,__unstablePopoverProps:I,shouldSanitizeBorder:!1,value:v,withSlider:!0,width:"__unstable-large"===_?"116px":"110px",__experimentalIsRenderedInSidebar:S,size:_}):(0,s.createElement)(EE,{colors:r,disableCustomColors:o,enableAlpha:l,enableStyle:c,onChange:y,popoverPlacement:w,popoverOffset:x,value:E,__experimentalIsRenderedInSidebar:S,size:_}),(0,s.createElement)(kb,{onClick:C,isLinked:m,size:_})))}),"BorderBoxControl");var LE=AE;const zE=Zu("div",{target:"e7pk0lh6"})({name:"14bvcyk",styles:"box-sizing:border-box;max-width:235px;padding-bottom:12px;width:100%"}),BE=Zu(Xm,{target:"e7pk0lh5"})({name:"5bhc30",styles:"margin-bottom:8px"}),FE=Zu(Xm,{target:"e7pk0lh4"})({name:"aujtid",styles:"min-height:30px;gap:0"}),VE=Zu("div",{target:"e7pk0lh3"})({name:"112jwab",styles:"box-sizing:border-box;max-width:80px"}),HE=Zu(Xm,{target:"e7pk0lh2"})({name:"xy18ro",styles:"justify-content:center;padding-top:8px"}),jE=Zu(Xm,{target:"e7pk0lh1"})({name:"3tw5wk",styles:"position:relative;height:100%;width:100%;justify-content:flex-start"});var $E={name:"1ch9yvl",styles:"border-radius:0"},WE={name:"tg3mx0",styles:"border-radius:2px"};const UE=e=>{let{isFirst:t,isLast:n,isOnly:r}=e;return t?zh({borderTopRightRadius:0,borderBottomRightRadius:0})():n?zh({borderTopLeftRadius:0,borderBottomLeftRadius:0})():r?WE:$E},GE=e=>{let{isFirst:t,isOnly:n}=e;return zh({marginLeft:t||n?0:-1})()},YE=Zu(mE,{target:"e7pk0lh0"})("max-width:60px;",UE,";",GE,";"),qE=()=>{};function KE(e){let{isFirst:t,isLast:n,isOnly:r,onHoverOn:o=qE,onHoverOff:i=qE,label:l,value:c,...u}=e;const d=(f=e=>{let{event:t,...n}=e;n.hovering?o(t,n):i(t,n)},Fg(Hg),Zg({hover:f},p||{},"hover"));var f,p;return(0,s.createElement)(VE,d(),(0,s.createElement)(XE,{text:l},(0,s.createElement)(YE,a({"aria-label":l,className:"component-box-control__unit-control",isFirst:t,isLast:n,isOnly:r,isPressEnterToChange:!0,isResetValueOnUnitChange:!1,value:c},u))))}function XE(e){let{children:t,text:n}=e;return n?(0,s.createElement)(zf,{text:n,position:"top"},(0,s.createElement)("div",null,t)):t}const ZE={all:(0,u.__)("All"),top:(0,u.__)("Top"),bottom:(0,u.__)("Bottom"),left:(0,u.__)("Left"),right:(0,u.__)("Right"),mixed:(0,u.__)("Mixed"),vertical:(0,u.__)("Vertical"),horizontal:(0,u.__)("Horizontal")},JE={top:void 0,right:void 0,bottom:void 0,left:void 0},QE=["top","right","bottom","left"];function eC(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function tC(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:QE;const r=aC(n),o=r.map((t=>aE(e[t]))),i=o.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),a=o.map((e=>e[1])),s=i.every((e=>e===i[0]))?i[0]:"";let l;var c;"number"==typeof s?l=eC(a):l=null!==(c=nC(t))&&void 0!==c?c:eC(a);return[s,l].join("")}function nC(e){if(!e||"object"!=typeof e)return;return eC(Object.values(e).filter(Boolean))}function rC(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:QE;const r=tC(e,t,n),o=isNaN(parseFloat(r));return o}function oC(e){return void 0!==e&&Object.values(e).filter((e=>!!e&&/\d/.test(e))).length>0}function iC(e,t){let n="all";return e||(n=t?"vertical":"top"),n}function aC(e){const t=[];if(null==e||!e.length)return QE;if(e.includes("vertical"))t.push("top","bottom");else if(e.includes("horizontal"))t.push("left","right");else{const n=QE.filter((t=>e.includes(t)));t.push(...n)}return t}function sC(e,t,n){const r={...e};return null!=n&&n.length?n.forEach((e=>{"vertical"===e?(r.top=t,r.bottom=t):"horizontal"===e?(r.left=t,r.right=t):r[e]=t})):QE.forEach((e=>r[e]=t)),r}const lC=()=>{};function cC(e){let{onChange:t=lC,onFocus:n=lC,onHoverOn:r=lC,onHoverOff:o=lC,values:i,sides:l,selectedUnits:c,setSelectedUnits:u,...d}=e;const f=tC(i,c,l),p=oC(i)&&rC(i,c,l),m=p?ZE.mixed:null;return(0,s.createElement)(KE,a({},d,{disableUnits:p,isOnly:!0,value:f,onChange:e=>{const n=!isNaN(parseFloat(e)),r=sC(i,n?e:void 0,l);t(r)},onUnitChange:e=>{const t=sC(c,e,l);u(t)},onFocus:e=>{n(e,{side:"all"})},onHoverOn:()=>{r({top:!0,bottom:!0,left:!0,right:!0})},onHoverOff:()=>{o({top:!1,bottom:!1,left:!1,right:!1})},placeholder:m}))}const uC=()=>{};function dC(e){let{onChange:t=uC,onFocus:n=uC,onHoverOn:r=uC,onHoverOff:o=uC,values:i,selectedUnits:l,setSelectedUnits:c,sides:u,...d}=e;const f=e=>t=>{n(t,{side:e})},p=e=>()=>{r({[e]:!0})},m=e=>()=>{o({[e]:!1})},h=e=>(n,r)=>{let{event:o}=r;const{altKey:a}=o,s={...i},l=!isNaN(parseFloat(n))?n:void 0;if(s[e]=l,a)switch(e){case"top":s.bottom=l;break;case"bottom":s.top=l;break;case"left":s.right=l;break;case"right":s.left=l}(e=>{t(e)})(s)},g=e=>t=>{const n={...l};n[e]=t,c(n)},v=null!=u&&u.length?QE.filter((e=>u.includes(e))):QE,b=v[0],y=v[v.length-1],w=b===y&&b;return(0,s.createElement)(HE,{className:"component-box-control__input-controls-wrapper"},(0,s.createElement)(jE,{gap:0,align:"top",className:"component-box-control__input-controls"},v.map((e=>{const[t,n]=aE(i[e]),r=i[e]?n:l[e];return(0,s.createElement)(KE,a({},d,{isFirst:b===e,isLast:y===e,isOnly:w===e,value:[t,r].join(""),onChange:h(e),onUnitChange:g(e),onFocus:f(e),onHoverOn:p(e),onHoverOff:m(e),label:ZE[e],key:`box-control-${e}`}))}))))}const fC=["vertical","horizontal"];function pC(e){let{onChange:t,onFocus:n,onHoverOn:r,onHoverOff:o,values:i,selectedUnits:l,setSelectedUnits:c,sides:u,...d}=e;const f=e=>t=>{n&&n(t,{side:e})},p=e=>()=>{r&&("vertical"===e&&r({top:!0,bottom:!0}),"horizontal"===e&&r({left:!0,right:!0}))},m=e=>()=>{o&&("vertical"===e&&o({top:!1,bottom:!1}),"horizontal"===e&&o({left:!1,right:!1}))},h=e=>n=>{if(!t)return;const r={...i},o=!isNaN(parseFloat(n))?n:void 0;"vertical"===e&&(r.top=o,r.bottom=o),"horizontal"===e&&(r.left=o,r.right=o),t(r)},g=e=>t=>{const n={...l};"vertical"===e&&(n.top=t,n.bottom=t),"horizontal"===e&&(n.left=t,n.right=t),c(n)},v=null!=u&&u.length?fC.filter((e=>u.includes(e))):fC,b=v[0],y=v[v.length-1],w=b===y&&b;return(0,s.createElement)(jE,{gap:0,align:"top",className:"component-box-control__vertical-horizontal-input-controls"},v.map((e=>{const[t,n]=aE("vertical"===e?i.top:i.left),r="vertical"===e?l.top:l.left;return(0,s.createElement)(KE,a({},d,{isFirst:b===e,isLast:y===e,isOnly:w===e,value:[t,null!=r?r:n].join(""),onChange:h(e),onUnitChange:g(e),onFocus:f(e),onHoverOn:p(e),onHoverOff:m(e),label:ZE[e],key:e}))})))}const mC=Zu("span",{target:"eaw9yqk8"})({name:"1w884gc",styles:"box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px"}),hC=Zu("span",{target:"eaw9yqk7"})({name:"i6vjox",styles:"box-sizing:border-box;display:block;position:relative;width:100%;height:100%"}),gC=Zu("span",{target:"eaw9yqk6"})("box-sizing:border-box;display:block;pointer-events:none;position:absolute;",(e=>{let{isFocused:t}=e;return $f({backgroundColor:"currentColor",opacity:t?1:.3},"","")}),";"),vC=Zu(gC,{target:"eaw9yqk5"})({name:"1k2w39q",styles:"bottom:3px;top:3px;width:2px"}),bC=Zu(gC,{target:"eaw9yqk4"})({name:"1q9b07k",styles:"height:2px;left:3px;right:3px"}),yC=Zu(bC,{target:"eaw9yqk3"})({name:"abcix4",styles:"top:0"}),wC=Zu(vC,{target:"eaw9yqk2"})({name:"1wf8jf",styles:"right:0"}),xC=Zu(bC,{target:"eaw9yqk1"})({name:"8tapst",styles:"bottom:0"}),_C=Zu(vC,{target:"eaw9yqk0"})({name:"1ode3cm",styles:"left:0"});function EC(e){let{size:t=24,side:n="all",sides:r,...o}=e;const i=e=>!(e=>(null==r?void 0:r.length)&&!r.includes(e))(e)&&("all"===n||n===e),l=i("top")||i("vertical"),c=i("right")||i("horizontal"),u=i("bottom")||i("vertical"),d=i("left")||i("horizontal"),f=t/24;return(0,s.createElement)(mC,a({style:{transform:`scale(${f})`}},o),(0,s.createElement)(hC,null,(0,s.createElement)(yC,{isFocused:l}),(0,s.createElement)(wC,{isFocused:c}),(0,s.createElement)(xC,{isFocused:u}),(0,s.createElement)(_C,{isFocused:d})))}function CC(e){let{isLinked:t,...n}=e;const r=t?(0,u.__)("Unlink sides"):(0,u.__)("Link sides");return(0,s.createElement)(zf,{text:r},(0,s.createElement)(rd,a({},n,{className:"component-box-control__linked-button",isSmall:!0,icon:t?bb:yb,iconSize:24,"aria-label":r})))}const kC={min:0},SC=()=>{};function TC(e){let{id:t,inputProps:n=kC,onChange:r=SC,label:o=(0,u.__)("Box Control"),values:i,units:l,sides:c,splitOnAxis:f=!1,allowReset:p=!0,resetValues:m=JE,onMouseOver:h,onMouseOut:g}=e;const[v,b]=py(i,{fallback:JE}),y=v||JE,w=oC(i),x=1===(null==c?void 0:c.length),[_,E]=(0,s.useState)(w),[C,k]=(0,s.useState)(!w||!rC(y)||x),[S,T]=(0,s.useState)(iC(C,f)),[N,R]=(0,s.useState)({top:aE(null==i?void 0:i.top)[1],right:aE(null==i?void 0:i.right)[1],bottom:aE(null==i?void 0:i.bottom)[1],left:aE(null==i?void 0:i.left)[1]}),I=function(e){const t=(0,d.useInstanceId)(TC,"inspector-box-control");return e||t}(t),M=`${I}-heading`,P={...n,onChange:e=>{r(e),b(e),E(!0)},onFocus:(e,t)=>{let{side:n}=t;T(n)},isLinked:C,units:l,selectedUnits:N,setSelectedUnits:R,sides:c,values:y,onMouseOver:h,onMouseOut:g};return(0,s.createElement)(zE,{id:I,role:"group","aria-labelledby":M},(0,s.createElement)(BE,{className:"component-box-control__header"},(0,s.createElement)(jm,null,(0,s.createElement)(Sv.VisualLabel,{id:M},o)),p&&(0,s.createElement)(jm,null,(0,s.createElement)(rd,{className:"component-box-control__reset-button",isSecondary:!0,isSmall:!0,onClick:()=>{r(m),b(m),R(m),E(!1)},disabled:!_},(0,u.__)("Reset")))),(0,s.createElement)(FE,{className:"component-box-control__header-control-wrapper"},(0,s.createElement)(jm,null,(0,s.createElement)(EC,{side:S,sides:c})),C&&(0,s.createElement)(Hm,null,(0,s.createElement)(cC,a({"aria-label":o},P))),!C&&f&&(0,s.createElement)(Hm,null,(0,s.createElement)(pC,P)),!x&&(0,s.createElement)(jm,null,(0,s.createElement)(CC,{onClick:()=>{k(!C),T(iC(!C,f))},isLinked:C}))),!C&&!f&&(0,s.createElement)(dC,P))}var NC=(0,s.forwardRef)((function(e,t){const{className:n,...r}=e,o=c()("components-button-group",n);return(0,s.createElement)("div",a({ref:t,role:"group",className:o},r))}));const RC={name:"12ip69d",styles:"background:transparent;display:block;margin:0!important;pointer-events:none;position:absolute;will-change:box-shadow"};function IC(e){return`0 ${e}px ${2*e}px 0\n\t${`rgba(0, 0, 0, ${e/20})`}`}const MC=Vu((function(e,t){const n=function(e){const{active:t,borderRadius:n="inherit",className:r,focus:o,hover:i,isInteractive:a=!1,offset:l=0,value:c=0,...u}=Fu(e,"Elevation"),d=Bu();return{...u,className:(0,s.useMemo)((()=>{let e=Jm(i)?i:2*c,s=Jm(t)?t:c/2;a||(e=Jm(i)?i:void 0,s=Jm(t)?t:void 0);const u=`box-shadow ${ph.transitionDuration} ${ph.transitionTimingFunction}`,f={};return f.Base=$f({borderRadius:n,bottom:l,boxShadow:IC(c),opacity:ph.elevationIntensity,left:l,right:l,top:l,transition:u},Sp("transition"),"",""),Jm(e)&&(f.hover=$f("*:hover>&{box-shadow:",IC(e),";}","")),Jm(s)&&(f.active=$f("*:active>&{box-shadow:",IC(s),";}","")),Jm(o)&&(f.focus=$f("*:focus>&{box-shadow:",IC(o),";}","")),d(RC,f.Base,f.hover,f.focus,f.active,r)}),[t,n,r,d,o,i,a,l,c]),"aria-hidden":!0}}(e);return(0,s.createElement)(Qu,a({},n,{ref:t}))}),"Elevation");var PC=MC;const OC=`calc(${ph.cardBorderRadius} - 1px)`,DC=$f("box-shadow:0 0 0 1px ",ph.surfaceBorderColor,";outline:none;",""),AC={name:"1showjb",styles:"border-bottom:1px solid;box-sizing:border-box;&:last-child{border-bottom:none;}"},LC={name:"14n5oej",styles:"border-top:1px solid;box-sizing:border-box;&:first-of-type{border-top:none;}"},zC={name:"13udsys",styles:"height:100%"},BC={name:"6ywzd",styles:"box-sizing:border-box;height:auto;max-height:100%"},FC={name:"dq805e",styles:"box-sizing:border-box;overflow:hidden;&>img,&>iframe{display:block;height:auto;max-width:100%;width:100%;}"},VC={name:"c990dr",styles:"box-sizing:border-box;display:block;width:100%"},HC=$f("&:first-of-type{border-top-left-radius:",OC,";border-top-right-radius:",OC,";}&:last-of-type{border-bottom-left-radius:",OC,";border-bottom-right-radius:",OC,";}",""),jC=$f("border-color:",ph.colorDivider,";",""),$C={name:"1t90u8d",styles:"box-shadow:none"},WC={name:"1e1ncky",styles:"border:none"},UC=$f("border-radius:",OC,";",""),GC=$f("padding:",ph.cardPaddingXSmall,";",""),YC={large:$f("padding:",ph.cardPaddingLarge,";",""),medium:$f("padding:",ph.cardPaddingMedium,";",""),small:$f("padding:",ph.cardPaddingSmall,";",""),xSmall:GC,extraSmall:GC},qC=$f("background-color:",kp.ui.backgroundDisabled,";",""),KC=$f("background-color:",ph.surfaceColor,";color:",kp.gray[900],";position:relative;","");ph.surfaceBackgroundColor;function XC(e){let{borderBottom:t,borderLeft:n,borderRight:r,borderTop:o}=e;const i=`1px solid ${ph.surfaceBorderColor}`;return $f({borderBottom:t?i:void 0,borderLeft:n?i:void 0,borderRight:r?i:void 0,borderTop:o?i:void 0},"","")}const ZC=$f("",""),JC=$f("background:",ph.surfaceBackgroundTintColor,";",""),QC=$f("background:",ph.surfaceBackgroundTertiaryColor,";",""),ek=e=>[e,e].join(" "),tk=e=>["90deg",[ph.surfaceBackgroundColor,e].join(" "),"transparent 1%"].join(","),nk=e=>[[ph.surfaceBackgroundColor,e].join(" "),"transparent 1%"].join(","),rk=(e,t)=>$f("background:",(e=>[`linear-gradient( ${tk(e)} ) center`,`linear-gradient( ${nk(e)} ) center`,ph.surfaceBorderBoldColor].join(","))(t),";background-size:",ek(e),";",""),ok=[`linear-gradient( ${[`${ph.surfaceBorderSubtleColor} 1px`,"transparent 1px"].join(",")} )`,`linear-gradient( ${["90deg",`${ph.surfaceBorderSubtleColor} 1px`,"transparent 1px"].join(",")} )`].join(","),ik=(e,t,n)=>{switch(e){case"dotted":return rk(t,n);case"grid":return(e=>$f("background:",ph.surfaceBackgroundColor,";background-image:",ok,";background-size:",ek(e),";",""))(t);case"primary":return ZC;case"secondary":return JC;case"tertiary":return QC}};function ak(e){const{backgroundSize:t=12,borderBottom:n=!1,borderLeft:r=!1,borderRight:o=!1,borderTop:i=!1,className:a,variant:l="primary",...c}=Fu(e,"Surface"),u=Bu();return{...c,className:(0,s.useMemo)((()=>{const e={borders:XC({borderBottom:n,borderLeft:r,borderRight:o,borderTop:i})};return u(KC,e.borders,ik(l,`${t}px`,t-1+"px"),a)}),[t,n,r,o,i,a,u,l])}}function sk(e){const{className:t,elevation:n=0,isBorderless:r=!1,isRounded:o=!0,size:i="medium",...a}=Fu(function(e){let{elevation:t,isElevated:n,...r}=e;const o={...r};let i=t;var a;return n&&(Kl()("Card isElevated prop",{since:"5.9",alternative:"elevation"}),null!==(a=i)&&void 0!==a||(i=2)),void 0!==i&&(o.elevation=i),o}(e),"Card"),l=Bu();return{...ak({...a,className:(0,s.useMemo)((()=>l(DC,r&&$C,o&&UC,t)),[t,l,r,o])}),elevation:n,isBorderless:r,isRounded:o,size:i}}var lk=Vu((function(e,t){const{children:n,elevation:r,isBorderless:o,isRounded:i,size:l,...c}=sk(e),u=i?ph.cardBorderRadius:0,d=Bu(),f=(0,s.useMemo)((()=>d($f({borderRadius:u},"",""))),[d,u]),p=(0,s.useMemo)((()=>{const e={size:l,isBorderless:o};return{CardBody:e,CardHeader:e,CardFooter:e}}),[o,l]);return(0,s.createElement)(oc,{value:p},(0,s.createElement)(Qu,a({},c,{ref:t}),(0,s.createElement)(Qu,{className:d(zC)},n),(0,s.createElement)(PC,{className:f,isInteractive:!1,value:r?1:0}),(0,s.createElement)(PC,{className:f,isInteractive:!1,value:r})))}),"Card");const ck=$f("@media only screen and ( min-device-width: 40em ){&::-webkit-scrollbar{height:12px;width:12px;}&::-webkit-scrollbar-track{background-color:transparent;}&::-webkit-scrollbar-track{background:",ph.colorScrollbarTrack,";border-radius:8px;}&::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:",ph.colorScrollbarThumb,";border:2px solid rgba( 0, 0, 0, 0 );border-radius:7px;}&:hover::-webkit-scrollbar-thumb{background-color:",ph.colorScrollbarThumbHover,";}}",""),uk={name:"13udsys",styles:"height:100%"},dk={name:"7zq9w",styles:"scroll-behavior:smooth"},fk={name:"q33xhg",styles:"overflow-x:auto;overflow-y:hidden"},pk={name:"103x71s",styles:"overflow-x:hidden;overflow-y:auto"},mk={name:"umwchj",styles:"overflow-y:auto"};var hk=Vu((function(e,t){const n=function(e){const{className:t,scrollDirection:n="y",smoothScroll:r=!1,...o}=Fu(e,"Scrollable"),i=Bu();return{...o,className:(0,s.useMemo)((()=>i(uk,ck,r&&dk,"x"===n&&fk,"y"===n&&pk,"auto"===n&&mk,t)),[t,i,n,r])}}(e);return(0,s.createElement)(Qu,a({},n,{ref:t}))}),"Scrollable");var gk=Vu((function(e,t){const{isScrollable:n,...r}=function(e){const{className:t,isScrollable:n=!1,isShady:r=!1,size:o="medium",...i}=Fu(e,"CardBody"),a=Bu();return{...i,className:(0,s.useMemo)((()=>a(BC,HC,YC[o],r&&qC,"components-card__body",t)),[t,a,r,o]),isScrollable:n}}(e);return n?(0,s.createElement)(hk,a({},r,{ref:t})):(0,s.createElement)(Qu,a({},r,{ref:t}))}),"CardBody"),vk=F({name:"Separator",compose:re,keys:["orientation"],useOptions:function(e){var t=e.orientation;return m({orientation:void 0===t?"horizontal":t},h(e,["orientation"]))},useProps:function(e,t){return m({role:"separator","aria-orientation":e.orientation},t)}}),bk=z({as:"hr",memo:!0,useHook:vk});const yk={vertical:{start:"marginLeft",end:"marginRight"},horizontal:{start:"marginTop",end:"marginBottom"}};var wk={name:"1u4hpl4",styles:"display:inline"};const xk=Zu("hr",{target:"e19on6iw0"})("border:0;margin:0;",(e=>{let{"aria-orientation":t="horizontal"}=e;return"vertical"===t?wk:void 0})," ",(e=>{let{"aria-orientation":t="horizontal"}=e;return $f({["vertical"===t?"borderRight":"borderBottom"]:"1px solid currentColor"},"","")})," ",(e=>{let{"aria-orientation":t="horizontal"}=e;return $f({height:"vertical"===t?"auto":0,width:"vertical"===t?0:"auto"},"","")})," ",(e=>{let{"aria-orientation":t="horizontal",margin:n,marginStart:r,marginEnd:o}=e;return $f(zh({[yk[t].start]:qm(null!=r?r:n),[yk[t].end]:qm(null!=o?o:n)})(),"","")}),";");var _k=Vu((function(e,t){const n=Fu(e,"Divider");return(0,s.createElement)(bk,a({as:xk},n,{ref:t}))}),"Divider");var Ek=Vu((function(e,t){const n=function(e){const{className:t,...n}=Fu(e,"CardDivider"),r=Bu();return{...n,className:(0,s.useMemo)((()=>r(VC,jC,"components-card__divider",t)),[t,r])}}(e);return(0,s.createElement)(_k,a({},n,{ref:t}))}),"CardDivider");var Ck=Vu((function(e,t){const n=function(e){const{className:t,justify:n,isBorderless:r=!1,isShady:o=!1,size:i="medium",...a}=Fu(e,"CardFooter"),l=Bu();return{...a,className:(0,s.useMemo)((()=>l(LC,HC,jC,YC[i],r&&WC,o&&qC,"components-card__footer",t)),[t,l,r,o,i]),justify:n}}(e);return(0,s.createElement)(Xm,a({},n,{ref:t}))}),"CardFooter");var kk=Vu((function(e,t){const n=function(e){const{className:t,isBorderless:n=!1,isShady:r=!1,size:o="medium",...i}=Fu(e,"CardHeader"),a=Bu();return{...i,className:(0,s.useMemo)((()=>a(AC,HC,jC,YC[o],n&&WC,r&&qC,"components-card__header",t)),[t,a,n,r,o])}}(e);return(0,s.createElement)(Xm,a({},n,{ref:t}))}),"CardHeader");var Sk=Vu((function(e,t){const n=function(e){const{className:t,...n}=Fu(e,"CardMedia"),r=Bu();return{...n,className:(0,s.useMemo)((()=>r(FC,HC,"components-card__media",t)),[t,r])}}(e);return(0,s.createElement)(Qu,a({},n,{ref:t}))}),"CardMedia");var Tk=function e(t){const{__nextHasNoMarginBottom:n,label:r,className:o,heading:i,checked:l,indeterminate:u,help:f,onChange:p,...m}=t;i&&Kl()("`heading` prop in `CheckboxControl`",{alternative:"a separate element to implement a heading",since:"5.8"});const[h,g]=(0,s.useState)(!1),[v,b]=(0,s.useState)(!1),y=(0,d.useRefEffect)((e=>{e&&(e.indeterminate=!!u,g(e.matches(":checked")),b(e.matches(":indeterminate")))}),[l,u]),w=`inspector-checkbox-control-${(0,d.useInstanceId)(e)}`;return(0,s.createElement)(Tv,{__nextHasNoMarginBottom:n,label:i,id:w,help:f,className:c()("components-checkbox-control",o)},(0,s.createElement)("span",{className:"components-checkbox-control__input-container"},(0,s.createElement)("input",a({ref:y,id:w,className:"components-checkbox-control__input",type:"checkbox",value:"1",onChange:e=>p(e.target.checked),checked:l,"aria-describedby":f?w+"__help":void 0},m)),v?(0,s.createElement)(ay,{icon:Wm,className:"components-checkbox-control__indeterminate",role:"presentation"}):null,h?(0,s.createElement)(ay,{icon:F_,className:"components-checkbox-control__checked",role:"presentation"}):null),(0,s.createElement)("label",{className:"components-checkbox-control__label",htmlFor:w},r))};function Nk(e){let{className:t,children:n,onCopy:r,onFinishCopy:o,text:i,...l}=e;Kl()("wp.components.ClipboardButton",{since:"5.8",alternative:"wp.compose.useCopyToClipboard"});const u=(0,s.useRef)(),f=(0,d.useCopyToClipboard)(i,(()=>{r(),clearTimeout(u.current),o&&(u.current=setTimeout((()=>o()),4e3))}));(0,s.useEffect)((()=>{clearTimeout(u.current)}),[]);const p=c()("components-clipboard-button",t);return(0,s.createElement)(rd,a({},l,{className:p,ref:f,onCopy:e=>{e.target.focus()}}),n)}var Rk=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));const Ik=$f("appearance:none;border:1px solid transparent;cursor:pointer;background:none;text-align:start;&:hover{color:",kp.ui.theme,";}&:focus{background-color:transparent;color:",kp.ui.theme,";border-color:",kp.ui.theme,";outline:3px solid transparent;}",""),Mk={name:"1bcj5ek",styles:"width:100%;display:block"},Pk={name:"150ruhm",styles:"box-sizing:border-box;width:100%;display:block;margin:0;color:inherit"},Ok=$f("border:1px solid ",ph.surfaceBorderColor,";",""),Dk=$f(">*:not( marquee )>*{border-bottom:1px solid ",ph.surfaceBorderColor,";}>*:last-of-type>*:not( :focus ){border-bottom-color:transparent;}",""),Ak=ph.controlBorderRadius,Lk=$f("border-radius:",Ak,";",""),zk=$f("border-radius:",Ak,";>*:first-of-type>*{border-top-left-radius:",Ak,";border-top-right-radius:",Ak,";}>*:last-of-type>*{border-bottom-left-radius:",Ak,";border-bottom-right-radius:",Ak,";}",""),Bk=`calc(${ph.fontSize} * ${ph.fontLineHeightBase})`,Fk=`calc((${ph.controlHeight} - ${Bk} - 2px) / 2)`,Vk=`calc((${ph.controlHeightSmall} - ${Bk} - 2px) / 2)`,Hk=`calc((${ph.controlHeightLarge} - ${Bk} - 2px) / 2)`,jk={small:$f("padding:",Vk," ",ph.controlPaddingXSmall,";",""),medium:$f("padding:",Fk," ",ph.controlPaddingX,";",""),large:$f("padding:",Hk," ",ph.controlPaddingXLarge,";","")};const $k=(0,s.createContext)({size:"medium"}),Wk=()=>(0,s.useContext)($k);var Uk=Vu((function(e,t){const{isBordered:n,isSeparated:r,size:o,...i}=function(e){const{className:t,isBordered:n=!1,isRounded:r=!0,isSeparated:o=!1,role:i="list",...a}=Fu(e,"ItemGroup");return{isBordered:n,className:Bu()(n&&Ok,o&&Dk,r&&zk,t),role:i,isSeparated:o,...a}}(e),{size:l}=Wk(),c={spacedAround:!n&&!r,size:o||l};return(0,s.createElement)($k.Provider,{value:c},(0,s.createElement)(Qu,a({},i,{ref:t})))}),"ItemGroup");function Gk(e){return Math.max(0,Math.min(100,e))}function Yk(e,t,n){const r=e.slice();return r[t]=n,r}function qk(e,t,n){if(function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const o=e[t].position,i=Math.min(o,n),a=Math.max(o,n);return e.some(((e,o)=>{let{position:s}=e;return o!==t&&(Math.abs(s-n)({placement:"bottom",offset:8})),[]),i=c()("components-custom-gradient-picker__control-point-dropdown",n);return(0,s.createElement)(X_,a({isRenderedInSidebar:t,popoverProps:o,className:i},r))}function Qk(e){let{disableRemove:t,disableAlpha:n,gradientPickerDomRef:r,ignoreMarkerPosition:o,value:i,onChange:a,onStartControlPointChange:l,onStopControlPointChange:c,__experimentalIsRenderedInSidebar:d}=e;const f=(0,s.useRef)(),p=e=>{const t=Xk(e.clientX,r.current),{initialPosition:n,index:o,significantMoveHappened:s}=f.current;!s&&Math.abs(n-t)>=5&&(f.current.significantMoveHappened=!0),a(qk(i,o,t))},m=()=>{window&&window.removeEventListener&&f.current&&f.current.listenersActivated&&(window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",m),c(),f.current.listenersActivated=!1)},h=(0,s.useRef)();return h.current=m,(0,s.useEffect)((()=>()=>{h.current()}),[]),i.map(((e,r)=>{const h=null==e?void 0:e.position;return o!==h&&(0,s.createElement)(Jk,{isRenderedInSidebar:d,key:r,onClose:c,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(Zk,{key:r,onClick:()=>{f.current&&f.current.significantMoveHappened||(n?c():l(),o())},onMouseDown:()=>{window&&window.addEventListener&&(f.current={initialPosition:h,index:r,significantMoveHappened:!1,listenersActivated:!0},l(),window.addEventListener("mousemove",p),window.addEventListener("mouseup",m))},onKeyDown:t=>{"ArrowLeft"===t.code?(t.stopPropagation(),a(qk(i,r,Gk(e.position-10)))):"ArrowRight"===t.code&&(t.stopPropagation(),a(qk(i,r,Gk(e.position+10))))},isOpen:n,position:e.position,color:e.color})},renderContent:o=>{let{onClose:l}=o;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(B_,{enableAlpha:!n,color:e.color,onChange:e=>{a(Kk(i,r,gp(e).toRgbString()))}}),!t&&i.length>2&&(0,s.createElement)(Uv,{className:"components-custom-gradient-picker__remove-control-point-wrapper",alignment:"center"},(0,s.createElement)(rd,{onClick:()=>{a(function(e,t){return e.filter(((e,n)=>n!==t))}(i,r)),l()},variant:"link"},(0,u.__)("Remove Control Point"))))},style:{left:`${e.position}%`,transform:"translateX( -50% )"}})}))}Qk.InsertPoint=function(e){let{value:t,onChange:n,onOpenInserter:r,onCloseInserter:o,insertPosition:i,disableAlpha:a,__experimentalIsRenderedInSidebar:l}=e;const[c,u]=(0,s.useState)(!1);return(0,s.createElement)(Jk,{isRenderedInSidebar:l,className:"components-custom-gradient-picker__inserter",onClose:()=>{o()},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(rd,{"aria-expanded":t,"aria-haspopup":"true",onClick:()=>{t?o():(u(!1),r()),n()},className:"components-custom-gradient-picker__insert-point-dropdown",icon:$m})},renderContent:()=>(0,s.createElement)(B_,{enableAlpha:!a,onChange:e=>{c?n(function(e,t,n){const r=e.findIndex((e=>e.position===t));return Kk(e,r,n)}(t,i,gp(e).toRgbString())):(n(function(e,t,n){const r=e.findIndex((e=>e.position>t)),o={color:n,position:t},i=e.slice();return i.splice(r-1,0,o),i}(t,i,gp(e).toRgbString())),u(!0))}}),style:null!==i?{left:`${i}%`,transform:"translateX( -50% )"}:void 0})};var eS=Qk;function tS(e,t){switch(t.type){case"MOVE_INSERTER":if("IDLE"===e.id||"MOVING_INSERTER"===e.id)return{id:"MOVING_INSERTER",insertPosition:t.insertPosition};break;case"STOP_INSERTER_MOVE":if("MOVING_INSERTER"===e.id)return{id:"IDLE"};break;case"OPEN_INSERTER":if("MOVING_INSERTER"===e.id)return{id:"INSERTING_CONTROL_POINT",insertPosition:e.insertPosition};break;case"CLOSE_INSERTER":if("INSERTING_CONTROL_POINT"===e.id)return{id:"IDLE"};break;case"START_CONTROL_CHANGE":if("IDLE"===e.id)return{id:"MOVING_CONTROL_POINT"};break;case"STOP_CONTROL_CHANGE":if("MOVING_CONTROL_POINT"===e.id)return{id:"IDLE"}}return e}const nS={id:"IDLE"};function rS(e){let{background:t,hasGradient:n,value:r,onChange:o,disableInserter:i=!1,disableAlpha:a=!1,__experimentalIsRenderedInSidebar:l}=e;const u=(0,s.useRef)(),[d,f]=(0,s.useReducer)(tS,nS),p=e=>{const t=Xk(e.clientX,u.current);r.some((e=>{let{position:n}=e;return Math.abs(t-n)<10}))?"MOVING_INSERTER"===d.id&&f({type:"STOP_INSERTER_MOVE"}):f({type:"MOVE_INSERTER",insertPosition:t})},m="MOVING_INSERTER"===d.id,h="INSERTING_CONTROL_POINT"===d.id;return(0,s.createElement)("div",{className:c()("components-custom-gradient-picker__gradient-bar",{"has-gradient":n}),onMouseEnter:p,onMouseMove:p,style:{background:t},onMouseLeave:()=>{f({type:"STOP_INSERTER_MOVE"})}},(0,s.createElement)("div",{ref:u,className:"components-custom-gradient-picker__markers-container"},!i&&(m||h)&&(0,s.createElement)(eS.InsertPoint,{__experimentalIsRenderedInSidebar:l,disableAlpha:a,insertPosition:d.insertPosition,value:r,onChange:o,onOpenInserter:()=>{f({type:"OPEN_INSERTER"})},onCloseInserter:()=>{f({type:"CLOSE_INSERTER"})}}),(0,s.createElement)(eS,{__experimentalIsRenderedInSidebar:l,disableAlpha:a,disableRemove:i,gradientPickerDomRef:u,ignoreMarkerPosition:h?d.insertPosition:void 0,value:r,onChange:o,onStartControlPointChange:()=>{f({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{f({type:"STOP_CONTROL_CHANGE"})}})))}var oS=n(7115);const iS="linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)",aS={type:"angular",value:90},sS=[{value:"linear-gradient",label:(0,u.__)("Linear")},{value:"radial-gradient",label:(0,u.__)("Radial")}],lS={top:0,"top right":45,"right top":45,right:90,"right bottom":135,"bottom right":135,bottom:180,"bottom left":225,"left bottom":225,left:270,"top left":315,"left top":315};function cS(e){let{type:t,value:n,length:r}=e;return`${function(e){let{type:t,value:n}=e;return"literal"===t?n:"hex"===t?`#${n}`:`${t}(${n.join(",")})`}({type:t,value:n})} ${function(e){if(!e)return"";const{value:t,type:n}=e;return`${t}${n}`}(r)}`}function uS(e){let{type:t,orientation:n,colorStops:r}=e;const o=function(e){if(e&&"angular"===e.type)return`${e.value}deg`}(n);return`${t}(${[o,...r.sort(((e,t)=>{var n,r,o,i;return(null!==(n=null==e||null===(r=e.length)||void 0===r?void 0:r.value)&&void 0!==n?n:0)-(null!==(o=null==t||null===(i=t.length)||void 0===i?void 0:i.value)&&void 0!==o?o:0)})).map(cS)].filter(Boolean).join(",")})`}function dS(e){return void 0===e.length||"%"!==e.length.type}function fS(e){switch(e.type){case"hex":return`#${e.value}`;case"literal":return e.value;case"rgb":case"rgba":return`${e.type}(${e.value.join(",")})`;default:return"transparent"}}bp([yp]);const pS=Zu(Hm,{target:"e99xvul1"})({name:"1gvx10y",styles:"flex-grow:5"}),mS=Zu(Hm,{target:"e99xvul0"})({name:"1gvx10y",styles:"flex-grow:5"}),hS=e=>{var t,n;let{gradientAST:r,hasGradient:o,onChange:i}=e;const a=null!==(t=null==r||null===(n=r.orientation)||void 0===n?void 0:n.value)&&void 0!==t?t:180;return(0,s.createElement)(ob,{__nextHasNoMarginBottom:!0,onChange:e=>{i(uS({...r,orientation:{type:"angular",value:e}}))},labelPosition:"top",value:o?a:""})},gS=e=>{let{gradientAST:t,hasGradient:n,onChange:r}=e;const{type:o}=t;return(0,s.createElement)(dy,{__nextHasNoMarginBottom:!0,className:"components-custom-gradient-picker__type-picker",label:(0,u.__)("Type"),labelPosition:"top",onChange:e=>{"linear-gradient"===e&&r(uS({...t,...t.orientation?{}:{orientation:aS},type:"linear-gradient"})),"radial-gradient"===e&&(()=>{const{orientation:e,...n}=t;r(uS({...n,type:"radial-gradient"}))})()},options:sS,size:"__unstable-large",value:n&&o})};function vS(e){let{__nextHasNoMargin:t=!1,value:n,onChange:r,__experimentalIsRenderedInSidebar:o}=e;const i=function(e){var t;let n;try{n=oS.parse(e)[0],n.value=e}catch(e){n=oS.parse(iS)[0],n.value=iS}if("directional"===(null===(t=n.orientation)||void 0===t?void 0:t.type)&&(n.orientation.type="angular",n.orientation.value=lS[n.orientation.value].toString()),n.colorStops.some(dS)){const{colorStops:e}=n,t=100/(e.length-1);e.forEach(((e,n)=>{e.length={value:t*n,type:"%"}})),n.value=uS(n)}return n}(n),a=function(e){return uS({type:"linear-gradient",orientation:aS,colorStops:e.colorStops})}(i),l=i.value!==iS,u=i.colorStops.map((e=>({color:fS(e),position:parseInt(e.length.value)})));return t||Kl()("Outer margin styles for wp.components.CustomGradientPicker",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMargin` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,s.createElement)(H_,{spacing:4,className:c()("components-custom-gradient-picker",{"is-next-has-no-margin":t})},(0,s.createElement)(rS,{__experimentalIsRenderedInSidebar:o,background:a,hasGradient:l,value:u,onChange:e=>{r(uS(function(e,t){return{...e,colorStops:t.map((e=>{let{position:t,color:n}=e;const{r:r,g:o,b:i,a:a}=gp(n).toRgb();return{length:{type:"%",value:null==t?void 0:t.toString()},type:a<1?"rgba":"rgb",value:a<1?[r,o,i,a]:[r,o,i]}}))}}(i,e)))}}),(0,s.createElement)(Xm,{gap:3,className:"components-custom-gradient-picker__ui-line"},(0,s.createElement)(pS,null,(0,s.createElement)(gS,{gradientAST:i,hasGradient:l,onChange:r})),(0,s.createElement)(mS,null,"linear-gradient"===i.type&&(0,s.createElement)(hS,{gradientAST:i,hasGradient:l,onChange:r}))))}const bS=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.gradients)&&!("gradient"in t);var t}));function yS(e){let{className:t,clearGradient:n,gradients:r,onChange:o,value:i,actions:a}=e;const l=(0,s.useMemo)((()=>r.map(((e,t)=>{let{gradient:r,name:a}=e;return(0,s.createElement)(V_.Option,{key:r,value:r,isSelected:i===r,tooltipText:a||(0,u.sprintf)((0,u.__)("Gradient code: %s"),r),style:{color:"rgba( 0,0,0,0 )",background:r},onClick:i===r?n:()=>o(r,t),"aria-label":a?(0,u.sprintf)((0,u.__)("Gradient: %s"),a):(0,u.sprintf)((0,u.__)("Gradient code: %s"),r)})}))),[r,i,o,n]);return(0,s.createElement)(V_,{className:t,options:l,actions:a})}function wS(e){let{className:t,clearGradient:n,gradients:r,onChange:o,value:i,actions:l}=e;return(0,s.createElement)(H_,{spacing:3,className:t},r.map(((e,t)=>{let{name:c,gradients:u}=e;return(0,s.createElement)(H_,{spacing:2,key:t},(0,s.createElement)(W_,null,c),(0,s.createElement)(yS,a({clearGradient:n,gradients:u,onChange:e=>o(e,t),value:i},r.length===t+1?{actions:l}:{})))})))}function xS(e){let{__nextHasNoMargin:t=!1,className:n,gradients:r,onChange:o,value:i,clearable:l=!0,disableCustomGradients:c=!1,__experimentalIsRenderedInSidebar:d}=e;const f=(0,s.useCallback)((()=>o(void 0)),[o]),p=bS(r)?wS:yS;t||Kl()("Outer margin styles for wp.components.GradientPicker",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMargin` prop to true to start opting into the new styles, which will become the default in a future version"});const m=t?{}:{marginTop:null!=r&&r.length?void 0:3,marginBottom:l?0:6};return(0,s.createElement)(qv,a({marginBottom:0},m),(0,s.createElement)(H_,{spacing:null!=r&&r.length?4:0},!c&&(0,s.createElement)(vS,{__nextHasNoMargin:!0,__experimentalIsRenderedInSidebar:d,value:i,onChange:o}),((null==r?void 0:r.length)||l)&&(0,s.createElement)(p,{className:n,clearable:l,clearGradient:f,gradients:r,onChange:o,value:i,actions:l&&!c&&(0,s.createElement)(V_.ButtonAction,{onClick:f},(0,u.__)("Clear"))})))}var _S=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z"})),ES=window.wp.dom;const CS=()=>{},kS=["menuitem","menuitemradio","menuitemcheckbox"];class SS extends s.Component{constructor(){super(...arguments),this.onKeyDown=this.onKeyDown.bind(this),this.bindContainer=this.bindContainer.bind(this),this.getFocusableContext=this.getFocusableContext.bind(this),this.getFocusableIndex=this.getFocusableIndex.bind(this)}componentDidMount(){this.container.addEventListener("keydown",this.onKeyDown),this.container.addEventListener("focus",this.onFocus)}componentWillUnmount(){this.container.removeEventListener("keydown",this.onKeyDown),this.container.removeEventListener("focus",this.onFocus)}bindContainer(e){const{forwardedRef:t}=this.props;this.container=e,"function"==typeof t?t(e):t&&"current"in t&&(t.current=e)}getFocusableContext(e){const{onlyBrowserTabstops:t}=this.props,n=(t?ES.focus.tabbable:ES.focus.focusable).find(this.container),r=this.getFocusableIndex(n,e);return r>-1&&e?{index:r,target:e,focusables:n}:null}getFocusableIndex(e,t){const n=e.indexOf(t);if(-1!==n)return n}onKeyDown(e){this.props.onKeyDown&&this.props.onKeyDown(e);const{getFocusableContext:t}=this,{cycle:n=!0,eventToOffset:r,onNavigate:o=CS,stopNavigationEvents:i}=this.props,a=r(e);if(void 0!==a&&i){e.stopImmediatePropagation();const t=e.target.getAttribute("role"),n=kS.includes(t),r="Tab"===e.code;(n||r)&&e.preventDefault()}if(!a)return;const s=t(e.target.ownerDocument.activeElement);if(!s)return;const{index:l,focusables:c}=s,u=n?function(e,t,n){const r=e+n;return r<0?t+r:r>=t?r-t:r}(l,c.length,a):l+a;u>=0&&u(0,s.createElement)(SS,a({},e,{forwardedRef:t}));TS.displayName="NavigableContainer";var NS=(0,s.forwardRef)(TS);var RS=(0,s.forwardRef)((function(e,t){let{role:n="menu",orientation:r="vertical",...o}=e;return(0,s.createElement)(NS,a({ref:t,stopNavigationEvents:!0,onlyBrowserTabstops:!1,role:n,"aria-orientation":"presentation"===n?null:r,eventToOffset:e=>{const{code:t}=e;let n=["ArrowDown"],o=["ArrowUp"];return"horizontal"===r&&(n=["ArrowRight"],o=["ArrowLeft"]),"both"===r&&(n=["ArrowRight","ArrowDown"],o=["ArrowLeft","ArrowUp"]),n.includes(t)?1:o.includes(t)?-1:["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(t)?0:void 0}},o))}));function IS(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={...e,...t};return t.className&&e.className&&(n.className=c()(t.className,e.className)),n}function MS(e){return"function"==typeof e}var PS=function(e){const{children:t,className:n,controls:r,icon:o=_S,label:i,popoverProps:l,toggleProps:u,menuProps:d,disableOpenOnArrowDown:f=!1,text:p,noIcons:m}=e;if(!(null!=r&&r.length||MS(t)))return null;let h;null!=r&&r.length&&(h=r,Array.isArray(h[0])||(h=[h]));const g=IS({className:"components-dropdown-menu__popover"},l);return(0,s.createElement)(ty,{className:c()("components-dropdown-menu",n),popoverProps:g,renderToggle:e=>{var t;let{isOpen:n,onToggle:r}=e;const{as:l=rd,...d}=null!=u?u:{},m=IS({className:c()("components-dropdown-menu__toggle",{"is-opened":n})},d);return(0,s.createElement)(l,a({},m,{icon:o,onClick:e=>{r(e),m.onClick&&m.onClick(e)},onKeyDown:e=>{(e=>{f||n||"ArrowDown"!==e.code||(e.preventDefault(),r())})(e),m.onKeyDown&&m.onKeyDown(e)},"aria-haspopup":"true","aria-expanded":n,label:i,text:p,showTooltip:null===(t=null==u?void 0:u.showTooltip)||void 0===t||t}),m.children)},renderContent:e=>{var n;const r=IS({"aria-label":i,className:c()("components-dropdown-menu__menu",{"no-icons":m})},d);return(0,s.createElement)(RS,a({},r,{role:"menu"}),MS(t)?t(e):null,null===(n=h)||void 0===n?void 0:n.flatMap(((t,n)=>t.map(((t,r)=>(0,s.createElement)(rd,{key:[n,r].join(),onClick:n=>{n.stopPropagation(),e.onClose(),t.onClick&&t.onClick()},className:c()("components-dropdown-menu__menu-item",{"has-separator":n>0&&0===r,"is-active":t.isActive,"is-icon-only":!t.title}),icon:t.icon,label:t.label,"aria-checked":"menuitemcheckbox"===t.role||"menuitemradio"===t.role?t.isActive:void 0,role:"menuitemcheckbox"===t.role||"menuitemradio"===t.role?t.role:"menuitem",disabled:t.isDisabled},t.title))))))}})};const OS=Zu(V_.Option,{target:"e5bw3229"})("width:",qm(6),";height:",qm(6),";pointer-events:none;"),DS=Zu(Iv,{target:"e5bw3228"})(jh,"{background:",kp.gray[100],";border-radius:",ph.controlBorderRadius,";",Wh,Wh,Wh,Wh,"{height:",qm(8),";}",qh,qh,qh,"{border-color:transparent;box-shadow:none;}}"),AS=Zu(Qu,{target:"e5bw3227"})("padding:3px 0 3px ",qm(3),";height:calc( 40px - ",ph.borderWidth," );border:1px solid ",ph.surfaceBorderColor,";border-bottom-color:transparent;&:first-of-type{border-top-left-radius:",ph.controlBorderRadius,";border-top-right-radius:",ph.controlBorderRadius,";}&:last-of-type{border-bottom-left-radius:",ph.controlBorderRadius,";border-bottom-right-radius:",ph.controlBorderRadius,";border-bottom-color:",ph.surfaceBorderColor,";}&.is-selected+&{border-top-color:transparent;}&.is-selected{border-color:",kp.ui.theme,";}"),LS=Zu("div",{target:"e5bw3226"})("line-height:",qm(8),";margin-left:",qm(2),";margin-right:",qm(2),";white-space:nowrap;overflow:hidden;",AS,":hover &{color:",kp.ui.theme,";}"),zS=Zu($_,{target:"e5bw3225"})("text-transform:uppercase;line-height:",qm(6),";font-weight:500;&&&{font-size:11px;margin-bottom:0;}"),BS=Zu(Qu,{target:"e5bw3224"})("height:",qm(6),";display:flex;"),FS=Zu(Uv,{target:"e5bw3223"})("margin-bottom:",qm(2),";"),VS=Zu(Qu,{target:"e5bw3222"})({name:"u6wnko",styles:"&&&{.components-button.has-icon{min-width:0;padding:0;}}"}),HS=Zu(rd,{target:"e5bw3221"})("&&{color:",kp.ui.theme,";}"),jS=Zu(rd,{target:"e5bw3220"})("&&{margin-top:",qm(1),";}"),$S="#000";function WS(e){let{value:t,onChange:n,label:r}=e;return(0,s.createElement)(DS,{label:r,hideLabelFromVision:!0,value:t,onChange:n})}function US(e){let{isGradient:t,element:n,onChange:r,onClose:o=(()=>{})}=e;return(0,s.createElement)(If,{placement:"left-start",offset:20,className:"components-palette-edit__popover",onClose:o},!t&&(0,s.createElement)(B_,{color:n.color,enableAlpha:!0,onChange:e=>r({...n,color:e})}),t&&(0,s.createElement)("div",{className:"components-palette-edit__popover-gradient-picker"},(0,s.createElement)(vS,{__nextHasNoMargin:!0,__experimentalIsRenderedInSidebar:!0,value:n.gradient,onChange:e=>r({...n,gradient:e})})))}function GS(e){let{canOnlyChangeValues:t,element:n,onChange:r,isEditing:o,onStartEditing:i,onRemove:l,onStopEditing:c,slugPrefix:f,isGradient:p}=e;const m=(0,d.__experimentalUseFocusOutside)(c),h=p?n.gradient:n.color;return(0,s.createElement)(AS,a({className:o?"is-selected":void 0,as:"div",onClick:i},o?{...m}:{style:{cursor:"pointer"}}),(0,s.createElement)(Uv,{justify:"flex-start"},(0,s.createElement)(jm,null,(0,s.createElement)(OS,{style:{background:h,color:"transparent"}})),(0,s.createElement)(jm,null,o&&!t?(0,s.createElement)(WS,{label:p?(0,u.__)("Gradient name"):(0,u.__)("Color name"),value:n.name,onChange:e=>r({...n,name:e,slug:f+(0,ec.kebabCase)(e)})}):(0,s.createElement)(LS,null,n.name)),o&&!t&&(0,s.createElement)(jm,null,(0,s.createElement)(jS,{isSmall:!0,icon:Rb,label:(0,u.__)("Remove color"),onClick:l}))),o&&(0,s.createElement)(US,{isGradient:p,onChange:r,element:n}))}function YS(e,t){let{slug:n,color:r,gradient:o}=t;return new RegExp(`^${e}color-([\\d]+)$`).test(n)&&(!!r&&r===$S||!!o&&o===iS)}function qS(e){let{elements:t,onChange:n,editingElement:r,setEditingElement:o,canOnlyChangeValues:i,slugPrefix:a,isGradient:l}=e;const c=(0,s.useRef)();(0,s.useEffect)((()=>{c.current=t}),[t]),(0,s.useEffect)((()=>()=>{if(c.current.some(((e,t)=>YS(a,e)))){const e=c.current.filter((e=>!YS(a,e)));n(e.length?e:void 0)}}),[]);const u=(0,d.useDebounce)(n,100);return(0,s.createElement)(H_,{spacing:3},(0,s.createElement)(Uk,{isRounded:!0},t.map(((e,c)=>(0,s.createElement)(GS,{isGradient:l,canOnlyChangeValues:i,key:c,element:e,onStartEditing:()=>{r!==c&&o(c)},onChange:e=>{u(t.map(((t,n)=>n===c?e:t)))},onRemove:()=>{o(null);const e=t.filter(((e,t)=>t!==c));n(e.length?e:void 0)},isEditing:c===r,onStopEditing:()=>{c===r&&o(null)},slugPrefix:a})))))}const KS=[];function XS(e){let{gradients:t,colors:n=KS,onChange:r,paletteLabel:o,emptyMessage:i,canOnlyChangeValues:a,canReset:l,slugPrefix:c=""}=e;const f=!!t,p=f?t:n,[m,h]=(0,s.useState)(!1),[g,v]=(0,s.useState)(null),b=m&&g&&p[g]&&!p[g].slug,y=p.length>0,w=(0,d.useDebounce)(r,100),x=(0,s.useCallback)(((e,t)=>{const n=p[t];n&&n[f?"gradient":"color"]===e?v(t):h(!0)}),[f,p]);return(0,s.createElement)(VS,null,(0,s.createElement)(FS,null,(0,s.createElement)(zS,null,o),(0,s.createElement)(BS,null,y&&m&&(0,s.createElement)(HS,{isSmall:!0,onClick:()=>{h(!1),v(null)}},(0,u.__)("Done")),!a&&(0,s.createElement)(rd,{isSmall:!0,isPressed:b,icon:$m,label:f?(0,u.__)("Add gradient"):(0,u.__)("Add color"),onClick:()=>{const e=function(e,t){const n=new RegExp(`^${t}color-([\\d]+)$`),r=e.reduce(((e,t)=>{if("string"==typeof(null==t?void 0:t.slug)){const r=null==t?void 0:t.slug.match(n);if(r){const t=parseInt(r[1],10);if(t>=e)return t+1}}return e}),1);return(0,u.sprintf)((0,u.__)("Color %s"),r)}(p,c);r([...p,{...f?{gradient:iS}:{color:$S},name:e,slug:c+(0,ec.kebabCase)(e)}]),h(!0),v(p.length)}}),y&&(!m||!a||l)&&(0,s.createElement)(PS,{icon:Rk,label:f?(0,u.__)("Gradient options"):(0,u.__)("Color options"),toggleProps:{isSmall:!0}},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(RS,{role:"menu"},!m&&(0,s.createElement)(rd,{variant:"tertiary",onClick:()=>{h(!0),t()},className:"components-palette-edit__menu-button"},(0,u.__)("Show details")),!a&&(0,s.createElement)(rd,{variant:"tertiary",onClick:()=>{v(null),h(!1),r(),t()},className:"components-palette-edit__menu-button"},f?(0,u.__)("Remove all gradients"):(0,u.__)("Remove all colors")),l&&(0,s.createElement)(rd,{variant:"tertiary",onClick:()=>{v(null),r(),t()}},f?(0,u.__)("Reset gradient"):(0,u.__)("Reset colors"))))})))),y&&(0,s.createElement)(s.Fragment,null,m&&(0,s.createElement)(qS,{canOnlyChangeValues:a,elements:p,onChange:r,editingElement:g,setEditingElement:v,slugPrefix:c,isGradient:f}),!m&&null!==g&&(0,s.createElement)(US,{isGradient:f,onClose:()=>v(null),onChange:e=>{w(p.map(((t,n)=>n===g?e:t)))},element:p[g]}),!m&&(f?(0,s.createElement)(xS,{__nextHasNoMargin:!0,gradients:t,onChange:x,clearable:!1,disableCustomGradients:!0}):(0,s.createElement)(J_,{colors:n,onChange:x,clearable:!1,disableCustomColors:!0}))),!y&&i)}const ZS=e=>{let{__next36pxDefaultSize:t}=e;return!t&&$f("height:28px;padding-left:",qm(1),";padding-right:",qm(1),";","")},JS=Zu(Xm,{target:"evuatpg0"})("height:34px;padding-left:",qm(2),";padding-right:",qm(2),";",ZS,";");const QS=(0,s.forwardRef)((function(e,t){const{value:n,isExpanded:r,instanceId:o,selectedSuggestionIndex:i,className:l,onChange:u,onFocus:d,onBlur:f,...p}=e,[m,h]=(0,s.useState)(!1),g=n?n.length+1:0;return(0,s.createElement)("input",a({ref:t,id:`components-form-token-input-${o}`,type:"text"},p,{value:n||"",onChange:e=>{u&&u({value:e.target.value})},onFocus:e=>{h(!0),null==d||d(e)},onBlur:e=>{h(!1),null==f||f(e)},size:g,className:c()(l,"components-form-token-field__input"),autoComplete:"off",role:"combobox","aria-expanded":r,"aria-autocomplete":"list","aria-owns":r?`components-form-token-suggestions-${o}`:void 0,"aria-activedescendant":m&&-1!==i&&r?`components-form-token-suggestions-${o}-${i}`:void 0,"aria-describedby":`components-form-token-suggestions-howto-${o}`}))}));var eT=QS,tT=n(5425),nT=n.n(tT);const rT=e=>{e.preventDefault()};var oT=function(e){let{selectedIndex:t,scrollIntoView:n,match:r,onHover:o,onSelect:i,suggestions:a=[],displayTransform:l,instanceId:u,__experimentalRenderItem:f}=e;const[p,m]=(0,s.useState)(!1),h=(0,d.useRefEffect)((e=>{let r;return t>-1&&n&&e.children[t]&&(m(!0),nT()(e.children[t],e,{onlyScrollIfNeeded:!0}),r=requestAnimationFrame((()=>{m(!1)}))),()=>{void 0!==r&&cancelAnimationFrame(r)}}),[t,n]),g=e=>()=>{p||null==o||o(e)},v=e=>()=>{null==i||i(e)};return(0,s.createElement)("ul",{ref:h,className:"components-form-token-field__suggestions-list",id:`components-form-token-suggestions-${u}`,role:"listbox"},a.map(((e,n)=>{const o=(e=>{const t=l(r).toLocaleLowerCase();if(0===t.length)return null;const n=l(e),o=n.toLocaleLowerCase().indexOf(t);return{suggestionBeforeMatch:n.substring(0,o),suggestionMatch:n.substring(o,o+t.length),suggestionAfterMatch:n.substring(o+t.length)}})(e),i=c()("components-form-token-field__suggestion",{"is-selected":n===t});let a;return a="function"==typeof f?f({item:e}):o?(0,s.createElement)("span",{"aria-label":l(e)},o.suggestionBeforeMatch,(0,s.createElement)("strong",{className:"components-form-token-field__suggestion-match"},o.suggestionMatch),o.suggestionAfterMatch):l(e),(0,s.createElement)("li",{id:`components-form-token-suggestions-${u}-${n}`,role:"option",className:i,key:"object"==typeof e&&"value"in e?null==e?void 0:e.value:l(e),onMouseDown:rT,onClick:v(e),onMouseEnter:g(e),"aria-selected":n===t},a)})))},iT=(0,d.createHigherOrderComponent)((e=>t=>{const[n,r]=(0,s.useState)(),o=(0,s.useCallback)((e=>r((()=>null!=e&&e.handleFocusOutside?e.handleFocusOutside.bind(e):void 0))),[]);return(0,s.createElement)("div",(0,d.__experimentalUseFocusOutside)(n),(0,s.createElement)(e,a({ref:o},t)))}),"withFocusOutside");const aT=()=>{},sT=iT(class extends s.Component{handleFocusOutside(e){this.props.onFocusOutside(e)}render(){return this.props.children}});var lT=function e(t){var n;let{__nextHasNoMarginBottom:r=!1,__next36pxDefaultSize:o,value:i,label:a,options:l,onChange:f,onFilterValueChange:p=aT,hideLabelFromVision:m,help:h,allowReset:g=!0,className:v,messages:b={selected:(0,u.__)("Item selected.")},__experimentalRenderItem:y}=t;const[w,x]=P_({value:i,onChange:f}),_=l.find((e=>e.value===w)),E=null!==(n=null==_?void 0:_.label)&&void 0!==n?n:"",C=(0,d.useInstanceId)(e,"combobox-control"),[k,S]=(0,s.useState)(_||null),[T,N]=(0,s.useState)(!1),[R,I]=(0,s.useState)(!1),[M,P]=(0,s.useState)(""),O=(0,s.useRef)(),D=(0,s.useMemo)((()=>{const e=[],t=[],n=ub(M);return l.forEach((r=>{const o=ub(r.label).indexOf(n);0===o?e.push(r):o>0&&t.push(r)})),e.concat(t)}),[M,l]),A=e=>{x(e.value),(0,lb.speak)(b.selected,"assertive"),S(e),P(""),N(!1)},L=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const t=D.indexOf(k);let n=t+e;n<0?n=D.length-1:n>=D.length&&(n=0),S(D[n]),N(!0)};return(0,s.useEffect)((()=>{const e=D.length>0,t=D.indexOf(k)>0;e&&!t&&S(D[0])}),[D,k]),(0,s.useEffect)((()=>{const e=D.length>0;if(T){const t=e?(0,u.sprintf)((0,u._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",D.length),D.length):(0,u.__)("No results.");(0,lb.speak)(t,"polite")}}),[D,T]),(0,s.createElement)(sT,{onFocusOutside:()=>{N(!1)}},(0,s.createElement)(Tv,{__nextHasNoMarginBottom:r,className:c()(v,"components-combobox-control"),tabIndex:"-1",label:a,id:`components-form-token-input-${C}`,hideLabelFromVision:m,help:h},(0,s.createElement)("div",{className:"components-combobox-control__suggestions-container",tabIndex:"-1",onKeyDown:e=>{let t=!1;if(!e.defaultPrevented&&!e.nativeEvent.isComposing&&229!==e.keyCode){switch(e.code){case"Enter":k&&(A(k),t=!0);break;case"ArrowUp":L(-1),t=!0;break;case"ArrowDown":L(1),t=!0;break;case"Escape":N(!1),S(null),t=!0}t&&e.preventDefault()}}},(0,s.createElement)(JS,{__next36pxDefaultSize:o},(0,s.createElement)(Hm,null,(0,s.createElement)(eT,{className:"components-combobox-control__input",instanceId:C,ref:O,value:T?M:E,onFocus:()=>{I(!0),N(!0),p(""),P("")},onBlur:()=>{I(!1)},isExpanded:T,selectedSuggestionIndex:D.indexOf(k),onChange:e=>{const t=e.value;P(t),p(t),R&&N(!0)}})),g&&(0,s.createElement)(jm,null,(0,s.createElement)(rd,{className:"components-combobox-control__reset",icon:Nb,disabled:!w,onClick:()=>{x(null),O.current.focus()},label:(0,u.__)("Reset")}))),T&&(0,s.createElement)(oT,{instanceId:C,match:{label:M},displayTransform:e=>e.label,suggestions:D,selectedIndex:D.indexOf(k),onHover:S,onSelect:A,scrollIntoView:!0,__experimentalRenderItem:y}))))};const cT=new Set(["alert","status","log","marquee","timer"]);let uT=[],dT=!1;function fT(e){if(dT)return;Array.from(document.body.children).forEach((t=>{t!==e&&function(e){const t=e.getAttribute("role");return!("SCRIPT"===e.tagName||e.hasAttribute("aria-hidden")||e.hasAttribute("aria-live")||t&&cT.has(t))}(t)&&(t.setAttribute("aria-hidden","true"),uT.push(t))})),dT=!0}let pT=0;const mT=(0,s.forwardRef)((function(e,t){const{bodyOpenClassName:n="modal-open",role:r="dialog",title:o=null,focusOnMount:i=!0,shouldCloseOnEsc:l=!0,shouldCloseOnClickOutside:f=!0,isDismissible:p=!0,aria:m={labelledby:void 0,describedby:void 0},onRequestClose:h,icon:g,closeButtonLabel:v,children:b,style:y,overlayClassName:w,className:x,contentLabel:_,onKeyDown:E,isFullScreen:C=!1,__experimentalHideHeader:k=!1}=e,S=(0,s.useRef)(),T=(0,d.useInstanceId)(mT),N=o?`components-modal-header-${T}`:m.labelledby,R=(0,d.useFocusOnMount)(i),I=(0,d.useConstrainedTabbing)(),M=(0,d.useFocusReturn)(),P=(0,d.__experimentalUseFocusOutside)(h),[O,D]=(0,s.useState)(!1);(0,s.useEffect)((()=>(pT++,1===pT&&(fT(S.current),document.body.classList.add(n)),()=>{pT--,0===pT&&(document.body.classList.remove(n),dT&&(uT.forEach((e=>{e.removeAttribute("aria-hidden")})),uT=[],dT=!1))})),[n]);const A=(0,s.useCallback)((e=>{var t,n;const r=null!==(t=null==e||null===(n=e.currentTarget)||void 0===n?void 0:n.scrollTop)&&void 0!==t?t:-1;!O&&r>0?D(!0):O&&r<=0&&D(!1)}),[O]);return(0,s.createPortal)((0,s.createElement)("div",{ref:(0,d.useMergeRefs)([S,t]),className:c()("components-modal__screen-overlay",w),onKeyDown:function(e){e.nativeEvent.isComposing||229===e.keyCode||l&&"Escape"===e.code&&!e.defaultPrevented&&(e.preventDefault(),h&&h(e))}},(0,s.createElement)(of,{document:document},(0,s.createElement)("div",a({className:c()("components-modal__frame",x,{"is-full-screen":C}),style:y,ref:(0,d.useMergeRefs)([I,M,R]),role:r,"aria-label":_,"aria-labelledby":_?void 0:N,"aria-describedby":m.describedby,tabIndex:-1},f?P:{},{onKeyDown:E}),(0,s.createElement)("div",{className:c()("components-modal__content",{"hide-header":k,"has-scrolled-content":O}),role:"document",onScroll:A},!k&&(0,s.createElement)("div",{className:"components-modal__header"},(0,s.createElement)("div",{className:"components-modal__header-heading-container"},g&&(0,s.createElement)("span",{className:"components-modal__icon-container","aria-hidden":!0},g),o&&(0,s.createElement)("h1",{id:N,className:"components-modal__header-heading"},o)),p&&(0,s.createElement)(rd,{onClick:h,icon:Yl,label:v||(0,u.__)("Close")})),b)))),document.body)}));var hT=mT;const gT={name:"7g5ii0",styles:"&&{z-index:1000001;}"};var vT=Vu((function(e,t){const{isOpen:n,onConfirm:r,onCancel:o,children:i,confirmButtonText:l,cancelButtonText:c,...d}=Fu(e,"ConfirmDialog"),f=Bu()(gT),[p,m]=(0,s.useState)(),[h,g]=(0,s.useState)();(0,s.useEffect)((()=>{const e=void 0!==n;m(!e||n),g(!e)}),[n]);const v=(0,s.useCallback)((e=>t=>{null==e||e(t),h&&m(!1)}),[h,m]),b=(0,s.useCallback)((e=>{"Enter"===e.key&&v(r)(e)}),[v,r]),y=null!=c?c:(0,u.__)("Cancel"),w=null!=l?l:(0,u.__)("OK");return(0,s.createElement)(s.Fragment,null,p&&(0,s.createElement)(hT,a({onRequestClose:v(o),onKeyDown:b,closeButtonLabel:y,isDismissible:!0,ref:t,overlayClassName:f,__experimentalHideHeader:!0},d),(0,s.createElement)(H_,{spacing:8},(0,s.createElement)(Rh,null,i),(0,s.createElement)(Xm,{direction:"row",justify:"flex-end"},(0,s.createElement)(rd,{variant:"tertiary",onClick:v(o)},y),(0,s.createElement)(rd,{variant:"primary",onClick:v(r)},w)))))}),"ConfirmDialog"),bT=n(2652),yT=n.n(bT);n(2797);function wT(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function xT(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function _T(e,t){if(e.clientHeightt||i>e&&a=t&&s>=n?i-e-r:a>t&&sn?a-t+o:0}var CT=function(){return CT=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0&&C>=0&&E<=h&&_<=m&&x>=O&&E<=A&&C>=L&&_<=D)return T;var z=getComputedStyle(R),B=parseInt(z.borderLeftWidth,10),F=parseInt(z.borderTopWidth,10),V=parseInt(z.borderRightWidth,10),H=parseInt(z.borderBottomWidth,10),j=0,$=0,W="offsetWidth"in R?R.offsetWidth-R.clientWidth-B-V:0,U="offsetHeight"in R?R.offsetHeight-R.clientHeight-F-H:0,G="offsetWidth"in R?0===R.offsetWidth?0:P/R.offsetWidth:0,Y="offsetHeight"in R?0===R.offsetHeight?0:M/R.offsetHeight:0;if(d===R)j="start"===o?k:"end"===o?k-h:"nearest"===o?ET(v,v+h,h,F,H,v+k,v+k+y,y):k-h/2,$="start"===i?S:"center"===i?S-m/2:"end"===i?S-m:ET(g,g+m,m,B,V,g+S,g+S+w,w),j=Math.max(0,j+v),$=Math.max(0,$+g);else{j="start"===o?k-O-F:"end"===o?k-A+H+U:"nearest"===o?ET(O,A,M,F,H+U,k,k+y,y):k-(O+M/2)+U/2,$="start"===i?S-L-B:"center"===i?S-(L+P/2)+W/2:"end"===i?S-D+V+W:ET(L,D,P,B,V+W,S,S+w,w);var q=R.scrollLeft,K=R.scrollTop;k+=K-(j=Math.max(0,Math.min(K+j/Y,R.scrollHeight-M/Y+U))),S+=q-($=Math.max(0,Math.min(q+$/G,R.scrollWidth-P/G+W)))}T.push({el:R,top:j,left:$})}return T}(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach((e=>{let{el:t,top:n,left:r}=e;t.scrollTop=n,t.scrollLeft=r}))}function NT(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function RT(e,t){let n;function r(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,i=new Array(o),a=0;a{n=null,e(...i)}),t)}return o.cancel=r,o}function IT(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;o(t&&t(e,...r),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault)))}}function MT(){for(var e=arguments.length,t=new Array(e),n=0;n{t.forEach((t=>{"function"==typeof t?t(e):t&&(t.current=e)}))}}function PT(){return String(kT++)}function OT(e){let{isOpen:t,resultCount:n,previousResultCount:r}=e;return t?n?n!==r?`${n} result${1===n?" is":"s are"} available, use up and down arrow keys to navigate. Press Enter key to select.`:"":"No results are available.":""}function DT(e,t){return Object.keys(e).reduce(((n,r)=>(n[r]=AT(t,r)?t[r]:e[r],n)),{})}function AT(e,t){return void 0!==e[t]}function LT(e){const{key:t,keyCode:n}=e;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?`Arrow${t}`:t}function zT(e,t,n,r,o){if(void 0===o&&(o=!0),0===n)return-1;const i=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:i+1);let a=t+e;a<0?a=o?i:0:a>i&&(a=o?0:i);const s=BT(e,a,n,r,o);return-1===s?t>=n?-1:t:s}function BT(e,t,n,r,o){const i=r(t);if(!i||!i.hasAttribute("disabled"))return t;if(e>0){for(let e=t+1;e=0;e--)if(!r(e).hasAttribute("disabled"))return e;return o?e>0?BT(1,0,n,r,!1):BT(-1,n-1,n,r,!1):-1}function FT(e,t,n,r){return void 0===r&&(r=!0),t.some((t=>t&&(NT(t,e,n)||r&&NT(t,n.document.activeElement,n))))}const VT=RT((e=>{jT(e).textContent=""}),500);function HT(e,t){const n=jT(t);e&&(n.textContent=e,VT(t))}function jT(e){void 0===e&&(e=document);let t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}const $T={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function WT(e,t,n){const{props:r,type:o}=e,i={};Object.keys(t).forEach((r=>{!function(e,t,n,r){const{props:o,type:i}=t,a=`on${XT(e)}Change`;o[a]&&void 0!==r[e]&&r[e]!==n[e]&&o[a]({type:i,...r})}(r,e,t,n),n[r]!==t[r]&&(i[r]=n[r])})),r.onStateChange&&Object.keys(i).length&&r.onStateChange({type:o,...i})}const UT=RT(((e,t)=>{HT(e(),t)}),200),GT="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?b.useLayoutEffect:b.useEffect;function YT(e){let{id:t=`downshift-${PT()}`,labelId:n,menuId:r,getItemId:o,toggleButtonId:i,inputId:a}=e;const s=(0,b.useRef)({labelId:n||`${t}-label`,menuId:r||`${t}-menu`,getItemId:o||(e=>`${t}-item-${e}`),toggleButtonId:i||`${t}-toggle-button`,inputId:a||`${t}-input`});return s.current}function qT(e,t,n){return void 0!==e?e:0===n.length?-1:n.indexOf(t)}function KT(e){return/^\S{1}$/.test(e)}function XT(e){return`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}function ZT(e){const t=(0,b.useRef)(e);return t.current=e,t}function JT(e,t,n){const r=(0,b.useRef)(),o=(0,b.useRef)(),i=(0,b.useCallback)(((t,n)=>{o.current=n,t=DT(t,n.props);const r=e(t,n);return n.props.stateReducer(t,{...n,changes:r})}),[e]),[a,s]=(0,b.useReducer)(i,t),l=ZT(n),c=(0,b.useCallback)((e=>s({props:l.current,...e})),[l]),u=o.current;return(0,b.useEffect)((()=>{u&&r.current&&r.current!==a&&WT(u,DT(r.current,u.props),a),r.current=a}),[a,n,u]),[a,c]}function QT(e,t,n){const[r,o]=JT(e,t,n);return[DT(r,n),o]}const eN={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){const{selectedItem:t,itemToString:n}=e;return t?`${n(t)} has been selected.`:""},scrollIntoView:TT,circularNavigation:!1,environment:"undefined"==typeof window?{}:window};function tN(e,t,n){void 0===n&&(n=$T);const r=e[`default${XT(t)}`];return void 0!==r?r:n[t]}function nN(e,t,n){void 0===n&&(n=$T);const r=e[t];if(void 0!==r)return r;const o=e[`initial${XT(t)}`];return void 0!==o?o:tN(e,t,n)}function rN(e){const t=nN(e,"selectedItem"),n=nN(e,"isOpen"),r=nN(e,"highlightedIndex"),o=nN(e,"inputValue");return{highlightedIndex:r<0&&t&&n?e.items.indexOf(t):r,isOpen:n,selectedItem:t,inputValue:o}}function oN(e,t,n,r){const{items:o,initialHighlightedIndex:i,defaultHighlightedIndex:a}=e,{selectedItem:s,highlightedIndex:l}=t;return 0===o.length?-1:void 0!==i&&l===i?i:void 0!==a?a:s?0===n?o.indexOf(s):zT(n,o.indexOf(s),o.length,r,!1):0===n?-1:n<0?o.length-1:0}function iN(e,t,n,r){const o=(0,b.useRef)({isMouseDown:!1,isTouchMove:!1});return(0,b.useEffect)((()=>{const i=()=>{o.current.isMouseDown=!0},a=i=>{o.current.isMouseDown=!1,e&&!FT(i.target,t.map((e=>e.current)),n)&&r()},s=()=>{o.current.isTouchMove=!1},l=()=>{o.current.isTouchMove=!0},c=i=>{!e||o.current.isTouchMove||FT(i.target,t.map((e=>e.current)),n,!1)||r()};return n.addEventListener("mousedown",i),n.addEventListener("mouseup",a),n.addEventListener("touchstart",s),n.addEventListener("touchmove",l),n.addEventListener("touchend",c),function(){n.removeEventListener("mousedown",i),n.removeEventListener("mouseup",a),n.removeEventListener("touchstart",s),n.removeEventListener("touchmove",l),n.removeEventListener("touchend",c)}}),[e,n]),o}let aN=()=>ST;function sN(e,t,n){let{isInitialMount:r,highlightedIndex:o,items:i,environment:a,...s}=n;(0,b.useEffect)((()=>{r||UT((()=>e({highlightedIndex:o,highlightedItem:i[o],resultCount:i.length,...s})),a.document)}),t)}function lN(e){let{highlightedIndex:t,isOpen:n,itemRefs:r,getItemNodeFromIndex:o,menuElement:i,scrollIntoView:a}=e;const s=(0,b.useRef)(!0);return GT((()=>{t<0||!n||!Object.keys(r.current).length||(!1===s.current?s.current=!0:a(o(t),i))}),[t]),s}let cN=ST;function uN(e,t,n){const{type:r,props:o}=t;let i;switch(r){case n.ItemMouseMove:i={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:i={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:oN(o,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:oN(o,e,0)};break;case n.FunctionCloseMenu:i={isOpen:!1};break;case n.FunctionSetHighlightedIndex:i={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:i={inputValue:t.inputValue};break;case n.FunctionReset:i={highlightedIndex:tN(o,"highlightedIndex"),isOpen:tN(o,"isOpen"),selectedItem:tN(o,"selectedItem"),inputValue:tN(o,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return{...e,...i}}function dN(e){for(var t=e.keysSoFar,n=e.highlightedIndex,r=e.items,o=e.itemToString,i=e.getItemNodeFromIndex,a=t.toLowerCase(),s=0;s=0&&{selectedItem:r.items[a]}}}break;case 13:i={highlightedIndex:oN(r,e,1,t.getItemNodeFromIndex),isOpen:!0};break;case 14:i={highlightedIndex:oN(r,e,-1,t.getItemNodeFromIndex),isOpen:!0};break;case 5:case 6:i={isOpen:tN(r,"isOpen"),highlightedIndex:tN(r,"highlightedIndex"),...e.highlightedIndex>=0&&{selectedItem:r.items[e.highlightedIndex]}};break;case 3:i={highlightedIndex:BT(1,0,r.items.length,t.getItemNodeFromIndex,!1)};break;case 4:i={highlightedIndex:BT(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1)};break;case 2:case 8:i={isOpen:!1,highlightedIndex:-1};break;case 7:{const n=t.key,o=`${e.inputValue}${n}`,a=dN({keysSoFar:o,highlightedIndex:e.highlightedIndex,items:r.items,itemToString:r.itemToString,getItemNodeFromIndex:t.getItemNodeFromIndex});i={inputValue:o,...a>=0&&{highlightedIndex:a}}}break;case 0:i={highlightedIndex:zT(o?5:1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,r.circularNavigation)};break;case 1:i={highlightedIndex:zT(o?-5:-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,r.circularNavigation)};break;case 20:i={selectedItem:t.selectedItem};break;default:return uN(e,t,mN)}return{...e,...i}}function gN(e){void 0===e&&(e={}),pN(e,gN);const t={...fN,...e},{items:n,scrollIntoView:r,environment:o,initialIsOpen:i,defaultIsOpen:a,itemToString:s,getA11ySelectionMessage:l,getA11yStatusMessage:c}=t,u=rN(t),[d,f]=QT(hN,u,t),{isOpen:p,highlightedIndex:m,selectedItem:h,inputValue:g}=d,v=(0,b.useRef)(null),y=(0,b.useRef)(null),w=(0,b.useRef)({}),x=(0,b.useRef)(!0),_=(0,b.useRef)(null),E=YT(t),C=(0,b.useRef)(),k=(0,b.useRef)(!0),S=ZT({state:d,props:t}),T=(0,b.useCallback)((e=>w.current[E.getItemId(e)]),[E]);sN(c,[p,m,g,n],{isInitialMount:k.current,previousResultCount:C.current,items:n,environment:o,itemToString:s,...d}),sN(l,[h],{isInitialMount:k.current,previousResultCount:C.current,items:n,environment:o,itemToString:s,...d});const N=lN({menuElement:y.current,highlightedIndex:m,isOpen:p,itemRefs:w,scrollIntoView:r,getItemNodeFromIndex:T});(0,b.useEffect)((()=>(_.current=RT((e=>{e({type:21,inputValue:""})}),500),()=>{_.current.cancel()})),[]),(0,b.useEffect)((()=>{g&&_.current(f)}),[f,g]),cN({isInitialMount:k.current,props:t,state:d}),(0,b.useEffect)((()=>{k.current?(i||a||p)&&y.current&&y.current.focus():p?y.current&&y.current.focus():o.document.activeElement===y.current&&v.current&&(x.current=!1,v.current.focus())}),[p]),(0,b.useEffect)((()=>{k.current||(C.current=n.length)}));const R=iN(p,[y,v],o,(()=>{f({type:8})})),I=aN();(0,b.useEffect)((()=>{k.current=!1}),[]),(0,b.useEffect)((()=>{p||(w.current={})}),[p]);const M=(0,b.useMemo)((()=>({ArrowDown(e){e.preventDefault(),f({type:13,getItemNodeFromIndex:T,shiftKey:e.shiftKey})},ArrowUp(e){e.preventDefault(),f({type:14,getItemNodeFromIndex:T,shiftKey:e.shiftKey})}})),[f,T]),P=(0,b.useMemo)((()=>({ArrowDown(e){e.preventDefault(),f({type:0,getItemNodeFromIndex:T,shiftKey:e.shiftKey})},ArrowUp(e){e.preventDefault(),f({type:1,getItemNodeFromIndex:T,shiftKey:e.shiftKey})},Home(e){e.preventDefault(),f({type:3,getItemNodeFromIndex:T})},End(e){e.preventDefault(),f({type:4,getItemNodeFromIndex:T})},Escape(){f({type:2})},Enter(e){e.preventDefault(),f({type:5})}," "(e){e.preventDefault(),f({type:6})}})),[f,T]),O=(0,b.useCallback)((()=>{f({type:16})}),[f]),D=(0,b.useCallback)((()=>{f({type:18})}),[f]),A=(0,b.useCallback)((()=>{f({type:17})}),[f]),L=(0,b.useCallback)((e=>{f({type:19,highlightedIndex:e})}),[f]),z=(0,b.useCallback)((e=>{f({type:20,selectedItem:e})}),[f]),B=(0,b.useCallback)((()=>{f({type:22})}),[f]),F=(0,b.useCallback)((e=>{f({type:21,inputValue:e})}),[f]),V=(0,b.useCallback)((e=>({id:E.labelId,htmlFor:E.toggleButtonId,...e})),[E]),H=(0,b.useCallback)((function(e,t){let{onMouseLeave:n,refKey:r="ref",onKeyDown:o,onBlur:i,ref:a,...s}=void 0===e?{}:e,{suppressRefError:l=!1}=void 0===t?{}:t;const c=S.current.state;return I("getMenuProps",l,r,y),{[r]:MT(a,(e=>{y.current=e})),id:E.menuId,role:"listbox","aria-labelledby":E.labelId,tabIndex:-1,...c.isOpen&&c.highlightedIndex>-1&&{"aria-activedescendant":E.getItemId(c.highlightedIndex)},onMouseLeave:IT(n,(()=>{f({type:9})})),onKeyDown:IT(o,(e=>{const t=LT(e);t&&P[t]?P[t](e):KT(t)&&f({type:7,key:t,getItemNodeFromIndex:T})})),onBlur:IT(i,(()=>{if(!1===x.current)return void(x.current=!0);!R.current.isMouseDown&&f({type:8})})),...s}}),[f,S,P,R,I,E,T]),j=(0,b.useCallback)((function(e,t){let{onClick:n,onKeyDown:r,refKey:o="ref",ref:i,...a}=void 0===e?{}:e,{suppressRefError:s=!1}=void 0===t?{}:t;const l=()=>{f({type:12})},c=e=>{const t=LT(e);t&&M[t]?M[t](e):KT(t)&&f({type:15,key:t,getItemNodeFromIndex:T})},u={[o]:MT(i,(e=>{v.current=e})),id:E.toggleButtonId,"aria-haspopup":"listbox","aria-expanded":S.current.state.isOpen,"aria-labelledby":`${E.labelId} ${E.toggleButtonId}`,...a};return a.disabled||(u.onClick=IT(n,l),u.onKeyDown=IT(r,c)),I("getToggleButtonProps",s,o,v),u}),[f,S,M,I,E,T]),$=(0,b.useCallback)((function(e){let{item:t,index:n,onMouseMove:r,onClick:o,refKey:i="ref",ref:a,disabled:s,...l}=void 0===e?{}:e;const{state:c,props:u}=S.current,d=()=>{f({type:11,index:n})},p=qT(n,t,u.items);if(p<0)throw new Error("Pass either item or item index in getItemProps!");const m={disabled:s,role:"option","aria-selected":`${p===c.highlightedIndex}`,id:E.getItemId(p),[i]:MT(a,(e=>{e&&(w.current[E.getItemId(p)]=e)})),...l};return s||(m.onClick=IT(o,d)),m.onMouseMove=IT(r,(()=>{n!==c.highlightedIndex&&(N.current=!1,f({type:10,index:n,disabled:s}))})),m}),[f,S,N,E]);return{getToggleButtonProps:j,getLabelProps:V,getMenuProps:H,getItemProps:$,toggleMenu:O,openMenu:A,closeMenu:D,setHighlightedIndex:L,selectItem:z,reset:B,setInputValue:F,highlightedIndex:m,isOpen:p,selectedItem:h,inputValue:g}}gN.stateChangeTypes=mN;yT().array.isRequired,yT().func,yT().func,yT().func,yT().bool,yT().number,yT().number,yT().number,yT().bool,yT().bool,yT().bool,yT().any,yT().any,yT().any,yT().string,yT().string,yT().string,yT().string,yT().string,yT().string,yT().func,yT().string,yT().string,yT().func,yT().func,yT().func,yT().func,yT().func,yT().func,yT().shape({addEventListener:yT().func,removeEventListener:yT().func,document:yT().shape({getElementById:yT().func,activeElement:yT().any,body:yT().any})});yT().array,yT().array,yT().array,yT().func,yT().func,yT().func,yT().number,yT().number,yT().number,yT().func,yT().func,yT().string,yT().string,yT().shape({addEventListener:yT().func,removeEventListener:yT().func,document:yT().shape({getElementById:yT().func,activeElement:yT().any,body:yT().any})});const vN=e=>e.__nextUnconstrainedWidth?"":$f(jh,"{min-width:130px;}",""),bN=Zu(tg,{target:"eswuck60"})(vN,";"),yN=e=>null==e?void 0:e.name,wN=(e,t)=>{let{selectedItem:n}=e,{type:r,changes:o,props:{items:i}}=t;switch(r){case gN.stateChangeTypes.ToggleButtonKeyDownArrowDown:return{selectedItem:i[n?Math.min(i.indexOf(n)+1,i.length-1):0]};case gN.stateChangeTypes.ToggleButtonKeyDownArrowUp:return{selectedItem:i[n?Math.max(i.indexOf(n)-1,0):i.length-1]};default:return o}};function xN(e){var t;const{__next36pxDefaultSize:n=!1,__nextUnconstrainedWidth:r=!1,className:o,hideLabelFromVision:i,label:l,describedBy:d,options:f,onChange:p,size:m="default",value:h,onMouseOver:g,onMouseOut:v,onFocus:b,onBlur:y,__experimentalShowSelectedHint:w=!1}=e,{getLabelProps:x,getToggleButtonProps:_,getMenuProps:E,getItemProps:C,isOpen:k,highlightedIndex:S,selectedItem:T}=gN({initialSelectedItem:f[0],items:f,itemToString:yN,onSelectedItemChange:p,...null!=h?{selectedItem:h}:void 0,stateReducer:wN}),[N,R]=(0,s.useState)(!1);r||Kl()("Constrained width styles for wp.components.CustomSelectControl",{since:"6.1",version:"6.4",hint:"Set the `__nextUnconstrainedWidth` prop to true to start opting into the new styles, which will become the default in a future version"});const I=E({className:"components-custom-select-control__menu","aria-hidden":!k}),M=(0,s.useCallback)((e=>{var t;e.stopPropagation(),null==I||null===(t=I.onKeyDown)||void 0===t||t.call(I,e)}),[I]);return null!==(t=I["aria-activedescendant"])&&void 0!==t&&t.startsWith("downshift-null")&&delete I["aria-activedescendant"],(0,s.createElement)("div",{className:c()("components-custom-select-control",o)},i?(0,s.createElement)(ed,a({as:"label"},x()),l):(0,s.createElement)(_v,x({className:"components-custom-select-control__label"}),l),(0,s.createElement)(bN,{__next36pxDefaultSize:n,__nextUnconstrainedWidth:r,isFocused:k||N,__unstableInputWidth:r?void 0:"auto",labelPosition:r?void 0:"top",size:m,suffix:(0,s.createElement)(ly,null)},(0,s.createElement)(ry,a({onMouseOver:g,onMouseOut:v,as:"button",onFocus:function(e){R(!0),null==b||b(e)},onBlur:function(e){R(!1),null==y||y(e)},selectSize:m,__next36pxDefaultSize:n},_({"aria-label":l,"aria-labelledby":void 0,className:"components-custom-select-control__button",describedBy:d||(T?(0,u.sprintf)((0,u.__)("Currently selected: %s"),T.name):(0,u.__)("No selection"))})),yN(T),w&&T.__experimentalHint&&(0,s.createElement)("span",{className:"components-custom-select-control__hint"},T.__experimentalHint))),(0,s.createElement)("ul",a({},I,{onKeyDown:M}),k&&f.map(((e,t)=>(0,s.createElement)("li",C({item:e,index:t,key:e.key,className:c()(e.className,"components-custom-select-control__item",{"is-highlighted":t===S,"has-hint":!!e.__experimentalHint,"is-next-36px-default-size":n}),style:e.style}),e.name,e.__experimentalHint&&(0,s.createElement)("span",{className:"components-custom-select-control__item-hint"},e.__experimentalHint),e===T&&(0,s.createElement)(ay,{icon:F_,className:"components-custom-select-control__item-icon"}))))))}function _N(e){return(0,s.createElement)(xN,a({},e,{__experimentalShowSelectedHint:!1}))}function EN(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function CN(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function kN(e){CN(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function SN(e,t){CN(2,arguments);var n=kN(e),r=EN(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function TN(e,t){CN(2,arguments);var n=kN(e),r=EN(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),i=new Date(n.getTime());i.setMonth(n.getMonth()+r+1,0);var a=i.getDate();return o>=a?i:(n.setFullYear(i.getFullYear(),i.getMonth(),o),n)}var NN,RN,IN={};function MN(){return IN}function PN(e,t){var n,r,o,i,a,s,l,c;CN(1,arguments);var u=MN(),d=EN(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=kN(e),p=f.getDay(),m=(p=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=kN(e),p=f.getDay(),m=6+(pr.getTime()}(e,t))&&(VN(e,n)||function(e,t){CN(2,arguments);var n=kN(e),r=kN(t);return n.getTime()-1}),[_]),k=(0,b.useCallback)((function(e,t){E(t?Array.isArray(e)?e:[e]:function(t){return t.concat(Array.isArray(e)?e:[e])})}),[]),S=(0,b.useCallback)((function(e){return E((function(t){return Array.isArray(e)?t.filter((function(t){return!e.map((function(e){return e.getTime()})).includes(t.getTime())})):t.filter((function(t){return!VN(t,e)}))}))}),[]),T=(0,b.useCallback)((function(e,t){return C(e)?S(e):k(e,t)}),[S,C,k]),N=(0,b.useCallback)((function(e,t,n){E(n?LN({start:e,end:t}):function(n){return n.concat(LN({start:e,end:t}))})}),[]),R=(0,b.useCallback)((function(e,t){E((function(n){return n.filter((function(n){return!LN({start:e,end:t}).map((function(e){return e.getTime()})).includes(n.getTime())}))}))}),[]),I=(0,b.useMemo)((function(){return function(e){CN(1,arguments);var t=e||{},n=kN(t.start),r=kN(t.end).getTime(),o=[];if(!(n.getTime()<=r))throw new RangeError("Invalid interval");var i=n;for(i.setHours(0,0,0,0),i.setDate(1);i.getTime()<=r;)o.push(kN(i)),i.setMonth(i.getMonth()+1);return o}({start:zN(d),end:AN(TN(d,c-1))}).map((function(e){return function(e,t){CN(1,arguments);var n=e||{},r=kN(n.start),o=kN(n.end),i=o.getTime();if(!(r.getTime()<=i))throw new RangeError("Invalid interval");var a=PN(r,t),s=PN(o,t);a.setHours(15),s.setHours(15),i=s.getTime();for(var l=[],c=a;c.getTime()<=i;)c.setHours(0),l.push(kN(c)),(c=ON(c,1)).setHours(15);return l}({start:zN(e),end:AN(e)},{weekStartsOn:r}).map((function(e){return LN({start:PN(e,{weekStartsOn:r}),end:BN(e,{weekStartsOn:r})})}))}))}),[d,r,c]);return{clearTime:WN,inRange:$N,viewing:d,setViewing:f,viewToday:p,viewMonth:m,viewPreviousMonth:h,viewNextMonth:g,viewYear:v,viewPreviousYear:y,viewNextYear:w,selected:_,setSelected:E,clearSelected:function(){return E([])},isSelected:C,select:k,deselect:S,toggle:T,selectRange:N,deselectRange:R,calendar:I}};function GN(e){return GN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},GN(e)}function YN(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function qN(e){YN(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===GN(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function KN(e){YN(1,arguments);var t=qN(e);return t.setHours(0,0,0,0),t}function XN(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function ZN(e,t){YN(2,arguments);var n=qN(e),r=XN(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),i=new Date(n.getTime());i.setMonth(n.getMonth()+r+1,0);var a=i.getDate();return o>=a?i:(n.setFullYear(i.getFullYear(),i.getMonth(),o),n)}function JN(e,t){YN(2,arguments);var n=XN(t);return ZN(e,-n)}function QN(e){return YN(1,arguments),e instanceof Date||"object"===GN(e)&&"[object Date]"===Object.prototype.toString.call(e)}function eR(e){if(YN(1,arguments),!QN(e)&&"number"!=typeof e)return!1;var t=qN(e);return!isNaN(Number(t))}function tR(e,t){YN(2,arguments);var n=qN(e).getTime(),r=XN(t);return new Date(n+r)}function nR(e,t){YN(2,arguments);var n=XN(t);return tR(e,-n)}var rR=864e5;function oR(e){YN(1,arguments);var t=1,n=qN(e),r=n.getUTCDay(),o=(r=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function aR(e){YN(1,arguments);var t=iR(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=oR(n);return r}var sR=6048e5;var lR={};function cR(){return lR}function uR(e,t){var n,r,o,i,a,s,l,c;YN(1,arguments);var u=cR(),d=XN(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=qN(e),p=f.getUTCDay(),m=(p=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(d+1,0,p),m.setUTCHours(0,0,0,0);var h=uR(m,t),g=new Date(0);g.setUTCFullYear(d,0,p),g.setUTCHours(0,0,0,0);var v=uR(g,t);return u.getTime()>=h.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}function fR(e,t){var n,r,o,i,a,s,l,c;YN(1,arguments);var u=cR(),d=XN(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==o?o:u.firstWeekContainsDate)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),f=dR(e,t),p=new Date(0);p.setUTCFullYear(f,0,d),p.setUTCHours(0,0,0,0);var m=uR(p,t);return m}var pR=6048e5;function mR(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length0?n:1-n;return mR("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):mR(n+1,2)},d:function(e,t){return mR(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(e,t){return mR(e.getUTCHours()%12||12,t.length)},H:function(e,t){return mR(e.getUTCHours(),t.length)},m:function(e,t){return mR(e.getUTCMinutes(),t.length)},s:function(e,t){return mR(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds();return mR(Math.floor(r*Math.pow(10,n-3)),t.length)}},gR=hR,vR="midnight",bR="noon",yR="morning",wR="afternoon",xR="evening",_R="night",ER={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return gR.y(e,t)},Y:function(e,t,n,r){var o=dR(e,r),i=o>0?o:1-o;return"YY"===t?mR(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):mR(i,t.length)},R:function(e,t){return mR(iR(e),t.length)},u:function(e,t){return mR(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return mR(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return mR(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return gR.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return mR(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=function(e,t){YN(1,arguments);var n=qN(e),r=uR(n,t).getTime()-fR(n,t).getTime();return Math.round(r/pR)+1}(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):mR(o,t.length)},I:function(e,t,n){var r=function(e){YN(1,arguments);var t=qN(e),n=oR(t).getTime()-aR(t).getTime();return Math.round(n/sR)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):mR(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):gR.d(e,t)},D:function(e,t,n){var r=function(e){YN(1,arguments);var t=qN(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),o=n-r;return Math.floor(o/rR)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):mR(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return mR(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return mR(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return mR(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?bR:0===o?vR:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?xR:o>=12?wR:o>=4?yR:_R,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return gR.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):gR.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):mR(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):mR(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):gR.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):gR.s(e,t)},S:function(e,t){return gR.S(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return kR(o);case"XXXX":case"XX":return SR(o);default:return SR(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return kR(o);case"xxxx":case"xx":return SR(o);default:return SR(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+CR(o,":");default:return"GMT"+SR(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+CR(o,":");default:return"GMT"+SR(o,":")}},t:function(e,t,n,r){var o=r._originalDate||e;return mR(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,n,r){return mR((r._originalDate||e).getTime(),t.length)}};function CR(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(0===i)return n+String(o);var a=t||"";return n+String(o)+a+mR(i,2)}function kR(e,t){return e%60==0?(e>0?"-":"+")+mR(Math.abs(e)/60,2):SR(e,t)}function SR(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+mR(Math.floor(o/60),2)+n+mR(o%60,2)}var TR=ER,NR=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},RR=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},IR={p:RR,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return NR(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",NR(o,t)).replace("{{time}}",RR(i,t))}},MR=IR;function PR(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var OR=["D","DD"],DR=["YY","YYYY"];function AR(e){return-1!==OR.indexOf(e)}function LR(e){return-1!==DR.indexOf(e)}function zR(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var BR={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},FR=function(e,t,n){var r,o=BR[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function VR(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var HR={date:VR({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:VR({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:VR({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},jR={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},$R=function(e,t,n,r){return jR[e]};function WR(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,i=null!=n&&n.width?String(n.width):o;r=e.formattingValues[i]||e.formattingValues[o]}else{var a=e.defaultWidth,s=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[s]||e.values[a]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var UR={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:WR({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:WR({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:WR({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:WR({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:WR({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},GR=UR;function YR(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a,s=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?KR(l,(function(e){return e.test(s)})):qR(l,(function(e){return e.test(s)}));a=e.valueCallback?e.valueCallback(c):c,a=n.valueCallback?n.valueCallback(a):a;var u=t.slice(s.length);return{value:a,rest:u}}}function qR(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function KR(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(XR.matchPattern);if(!n)return null;var r=n[0],o=e.match(XR.parsePattern);if(!o)return null;var i=XR.valueCallback?XR.valueCallback(o[0]):o[0];i=t.valueCallback?t.valueCallback(i):i;var a=e.slice(r.length);return{value:i,rest:a}}),era:YR({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:YR({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:YR({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:YR({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:YR({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},JR={code:"en-US",formatDistance:FR,formatLong:HR,formatRelative:$R,localize:GR,match:ZR,options:{weekStartsOn:0,firstWeekContainsDate:1}},QR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,eI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,tI=/^'([^]*?)'?$/,nI=/''/g,rI=/[a-zA-Z]/;function oI(e,t,n){var r,o,i,a,s,l,c,u,d,f,p,m,h,g,v,b,y,w;YN(2,arguments);var x=String(t),_=cR(),E=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:_.locale)&&void 0!==r?r:JR,C=XN(null!==(i=null!==(a=null!==(s=null!==(l=null==n?void 0:n.firstWeekContainsDate)&&void 0!==l?l:null==n||null===(c=n.locale)||void 0===c||null===(u=c.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==s?s:_.firstWeekContainsDate)&&void 0!==a?a:null===(d=_.locale)||void 0===d||null===(f=d.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==i?i:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=XN(null!==(p=null!==(m=null!==(h=null!==(g=null==n?void 0:n.weekStartsOn)&&void 0!==g?g:null==n||null===(v=n.locale)||void 0===v||null===(b=v.options)||void 0===b?void 0:b.weekStartsOn)&&void 0!==h?h:_.weekStartsOn)&&void 0!==m?m:null===(y=_.locale)||void 0===y||null===(w=y.options)||void 0===w?void 0:w.weekStartsOn)&&void 0!==p?p:0);if(!(k>=0&&k<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!E.localize)throw new RangeError("locale must contain localize property");if(!E.formatLong)throw new RangeError("locale must contain formatLong property");var S=qN(e);if(!eR(S))throw new RangeError("Invalid time value");var T=PR(S),N=nR(S,T),R={firstWeekContainsDate:C,weekStartsOn:k,locale:E,_originalDate:S},I=x.match(eI).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,MR[t])(e,E.formatLong):e})).join("").match(QR).map((function(r){if("''"===r)return"'";var o=r[0];if("'"===o)return iI(r);var i=TR[o];if(i)return null!=n&&n.useAdditionalWeekYearTokens||!LR(r)||zR(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!AR(r)||zR(r,t,String(e)),i(N,r,E.localize,R);if(o.match(rI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("");return I}function iI(e){var t=e.match(tI);return t?t[1].replace(nI,"'"):e}function aI(e,t){YN(2,arguments);var n=qN(e),r=qN(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function sI(e,t){YN(2,arguments);var n=qN(e),r=qN(t);return n.getTime()===r.getTime()}function lI(e,t){YN(2,arguments);var n=KN(e),r=KN(t);return n.getTime()===r.getTime()}function cI(e,t){YN(2,arguments);var n=qN(e),r=XN(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function uI(e,t){YN(2,arguments);var n=XN(t),r=7*n;return cI(e,r)}var dI=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"}));var fI=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})),pI=window.wp.date;const mI=Zu("div",{target:"e105ri6r5"})({name:"1khn195",styles:"box-sizing:border-box"}),hI=Zu(Uv,{target:"e105ri6r4"})("margin-bottom:",qm(4),";"),gI=Zu($_,{target:"e105ri6r3"})("font-size:",ph.fontSize,";font-weight:",ph.fontWeight,";strong{font-weight:",ph.fontWeightHeading,";}"),vI=Zu("div",{target:"e105ri6r2"})("column-gap:",qm(2),";display:grid;grid-template-columns:0.5fr repeat( 5, 1fr ) 0.5fr;justify-items:center;row-gap:",qm(2),";"),bI=Zu("div",{target:"e105ri6r1"})("color:",kp.gray[700],";font-size:",ph.fontSize,";line-height:",ph.fontLineHeightBase,";&:nth-of-type( 1 ){justify-self:start;}&:nth-of-type( 7 ){justify-self:end;}"),yI=Zu(rd,{shouldForwardProp:e=>!["column","isSelected","isToday","hasEvents"].includes(e),target:"e105ri6r0"})("grid-column:",(e=>e.column),";position:relative;justify-content:center;",(e=>1===e.column&&"\n\t\tjustify-self: start;\n\t\t")," ",(e=>7===e.column&&"\n\t\tjustify-self: end;\n\t\t")," ",(e=>e.disabled&&"\n\t\tpointer-events: none;\n\t\t")," &&&{border-radius:100%;height:",qm(7),";width:",qm(7),";",(e=>e.isSelected&&`\n\t\t\tbackground: ${kp.ui.theme};\n\t\t\tcolor: ${kp.white};\n\t\t\t`)," ",(e=>!e.isSelected&&e.isToday&&`\n\t\t\tbackground: ${kp.gray[200]};\n\t\t\t`),";}",(e=>e.hasEvents&&`\n\t\t::before {\n\t\t\tbackground: ${e.isSelected?kp.white:kp.ui.theme};\n\t\t\tborder-radius: 2px;\n\t\t\tbottom: 0;\n\t\t\tcontent: " ";\n\t\t\theight: 4px;\n\t\t\tleft: 50%;\n\t\t\tmargin-left: -2px;\n\t\t\tposition: absolute;\n\t\t\twidth: 4px;\n\t\t}\n\t\t`),";");function wI(e){return"string"==typeof e?new Date(e):qN(e)}const xI="yyyy-MM-dd'T'HH:mm:ss";function _I(e){let{day:t,column:n,isSelected:r,isFocusable:o,isFocusAllowed:i,isToday:a,isInvalid:l,numEvents:c,onClick:u,onKeyDown:d}=e;const f=(0,s.useRef)();return(0,s.useEffect)((()=>{f.current&&o&&i&&f.current.focus()}),[o]),(0,s.createElement)(yI,{ref:f,className:"components-datetime__date__day",disabled:l,tabIndex:o?0:-1,"aria-label":EI(t,r,c),column:n,isSelected:r,isToday:a,hasEvents:c>0,onClick:u,onKeyDown:d},(0,pI.dateI18n)("j",t,-t.getTimezoneOffset()))}function EI(e,t,n){const{formats:r}=(0,pI.getSettings)(),o=(0,pI.dateI18n)(r.date,e,-e.getTimezoneOffset());return t&&n>0?(0,u.sprintf)((0,u._n)("%1$s. Selected. There is %2$d event","%1$s. Selected. There are %2$d events",n),o,n):t?(0,u.sprintf)((0,u.__)("%1$s. Selected"),o):n>0?(0,u.sprintf)((0,u._n)("%1$s. There is %2$d event","%1$s. There are %2$d events",n),o,n):o}var CI=function(e){let{currentDate:t,onChange:n,events:r=[],isInvalidDate:o,onMonthPreviewed:i,startOfWeek:a=0}=e;const l=t?wI(t):new Date,{calendar:c,viewing:d,setSelected:f,setViewing:p,isSelected:m,viewPreviousMonth:h,viewNextMonth:g}=UN({selected:[KN(l)],viewing:KN(l),weekStartsOn:a}),[v,b]=(0,s.useState)(KN(l)),[y,w]=(0,s.useState)(!1),[x,_]=(0,s.useState)(t);return t!==x&&(_(t),f([KN(l)]),p(KN(l)),b(KN(l))),(0,s.createElement)(mI,{className:"components-datetime__date",role:"application","aria-label":(0,u.__)("Calendar")},(0,s.createElement)(hI,null,(0,s.createElement)(rd,{icon:(0,u.isRTL)()?dI:fI,variant:"tertiary","aria-label":(0,u.__)("View previous month"),onClick:()=>{h(),b(JN(v,1)),null==i||i(oI(JN(d,1),xI))}}),(0,s.createElement)(gI,{level:3},(0,s.createElement)("strong",null,(0,pI.dateI18n)("F",d,-d.getTimezoneOffset()))," ",(0,pI.dateI18n)("Y",d,-d.getTimezoneOffset())),(0,s.createElement)(rd,{icon:(0,u.isRTL)()?fI:dI,variant:"tertiary","aria-label":(0,u.__)("View next month"),onClick:()=>{g(),b(ZN(v,1)),null==i||i(oI(ZN(d,1),xI))}})),(0,s.createElement)(vI,{onFocus:()=>w(!0),onBlur:()=>w(!1)},c[0][0].map((e=>(0,s.createElement)(bI,{key:e.toString()},(0,pI.dateI18n)("D",e,-e.getTimezoneOffset())))),c[0].map((e=>e.map(((e,t)=>aI(e,d)?(0,s.createElement)(_I,{key:e.toString(),day:e,column:t+1,isSelected:m(e),isFocusable:sI(e,v),isFocusAllowed:y,isToday:lI(e,new Date),isInvalid:!!o&&o(e),numEvents:r.filter((t=>lI(t.date,e))).length,onClick:()=>{f([e]),b(e),null==n||n(oI(new Date(e.getFullYear(),e.getMonth(),e.getDate(),l.getHours(),l.getMinutes(),l.getSeconds(),l.getMilliseconds()),xI))},onKeyDown:t=>{let n;"ArrowLeft"===t.key&&(n=cI(e,(0,u.isRTL)()?1:-1)),"ArrowRight"===t.key&&(n=cI(e,(0,u.isRTL)()?-1:1)),"ArrowUp"===t.key&&(n=function(e,t){YN(2,arguments);var n=XN(t);return uI(e,-n)}(e,1)),"ArrowDown"===t.key&&(n=uI(e,1)),"PageUp"===t.key&&(n=JN(e,1)),"PageDown"===t.key&&(n=ZN(e,1)),"Home"===t.key&&(n=function(e,t){var n,r,o,i,a,s,l,c;YN(1,arguments);var u=cR(),d=XN(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=qN(e),p=f.getDay(),m=(p=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=qN(e),p=f.getDay(),m=6+(p{const{timezone:e}=(0,pI.getSettings)(),t=(new Date).getTimezoneOffset()/60*-1;if(Number(e.offset)===t)return null;const n=Number(e.offset)>=0?"+":"",r=""!==e.abbr&&isNaN(Number(e.abbr))?e.abbr:`UTC${n}${e.offset}`,o="UTC"===e.string?(0,u.__)("Coordinated Universal Time"):`(${r}) ${e.string.replace("_"," ")}`;return(0,s.createElement)(zf,{position:"top center",text:o},(0,s.createElement)(FI,{className:"components-datetime__timezone"},r))};function HI(e,t){return t?(e%12+12)%24:e%12}function jI(e){return(t,n)=>{const r={...t};return n.type!==tv&&n.type!==cv&&n.type!==sv||void 0!==r.value&&(r.value=r.value.toString().padStart(e,"0")),r}}var $I=function(e){let{is12Hour:t,currentTime:n,onChange:r}=e;const[o,i]=(0,s.useState)((()=>n?kI(wI(n)):new Date));(0,s.useEffect)((()=>{i(n?kI(wI(n)):new Date)}),[n]);const{day:a,month:l,year:c,minutes:d,hours:f,am:p}=(0,s.useMemo)((()=>({day:oI(o,"dd"),month:oI(o,"MM"),year:oI(o,"yyyy"),minutes:oI(o,"mm"),hours:oI(o,t?"hh":"HH"),am:oI(o,"a")})),[o,t]),m=e=>(n,a)=>{let{event:s}=a;if(!(s.target instanceof HTMLInputElement))return;if(!s.target.validity.valid)return;let l=Number(n);"hours"===e&&t&&(l=HI(l,"PM"===p));const c=function(e,t){if(YN(2,arguments),"object"!==GN(t)||null===t)throw new RangeError("values parameter must be an object");var n=qN(e);return isNaN(n.getTime())?new Date(NaN):(null!=t.year&&n.setFullYear(t.year),null!=t.month&&(n=TI(n,t.month)),null!=t.date&&n.setDate(XN(t.date)),null!=t.hours&&n.setHours(XN(t.hours)),null!=t.minutes&&n.setMinutes(XN(t.minutes)),null!=t.seconds&&n.setSeconds(XN(t.seconds)),null!=t.milliseconds&&n.setMilliseconds(XN(t.milliseconds)),n)}(o,{[e]:l});i(c),null==r||r(oI(c,xI))};function h(e){return()=>{if(p===e)return;const t=parseInt(f,10),n=function(e,t){YN(2,arguments);var n=qN(e),r=XN(t);return n.setHours(r),n}(o,HI(t,"PM"===e));i(n),null==r||r(oI(n,xI))}}const g=(0,s.createElement)(zI,{className:"components-datetime__time-field components-datetime__time-field-day",label:(0,u.__)("Day"),hideLabelFromVision:!0,__next36pxDefaultSize:!0,value:a,step:1,min:1,max:31,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:m("date")}),v=(0,s.createElement)(AI,null,(0,s.createElement)(LI,{className:"components-datetime__time-field components-datetime__time-field-month",label:(0,u.__)("Month"),hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,value:l,options:[{value:"01",label:(0,u.__)("January")},{value:"02",label:(0,u.__)("February")},{value:"03",label:(0,u.__)("March")},{value:"04",label:(0,u.__)("April")},{value:"05",label:(0,u.__)("May")},{value:"06",label:(0,u.__)("June")},{value:"07",label:(0,u.__)("July")},{value:"08",label:(0,u.__)("August")},{value:"09",label:(0,u.__)("September")},{value:"10",label:(0,u.__)("October")},{value:"11",label:(0,u.__)("November")},{value:"12",label:(0,u.__)("December")}],onChange:e=>{const t=TI(o,Number(e)-1);i(t),null==r||r(oI(t,xI))}}));return(0,s.createElement)(NI,{className:"components-datetime__time"},(0,s.createElement)(RI,null,(0,s.createElement)(Tv.VisualLabel,{as:"legend",className:"components-datetime__time-legend"},(0,u.__)("Time")),(0,s.createElement)(Uv,{className:"components-datetime__time-wrapper"},(0,s.createElement)(II,{className:"components-datetime__time-field components-datetime__time-field-time"},(0,s.createElement)(PI,{className:"components-datetime__time-field-hours-input",label:(0,u.__)("Hours"),hideLabelFromVision:!0,__next36pxDefaultSize:!0,value:f,step:1,min:t?1:0,max:t?12:23,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:m("hours"),__unstableStateReducer:jI(2)}),(0,s.createElement)(OI,{className:"components-datetime__time-separator","aria-hidden":"true"},":"),(0,s.createElement)(DI,{className:"components-datetime__time-field-minutes-input",label:(0,u.__)("Minutes"),hideLabelFromVision:!0,__next36pxDefaultSize:!0,value:d,step:1,min:0,max:59,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:m("minutes"),__unstableStateReducer:jI(2)})),t&&(0,s.createElement)(NC,{className:"components-datetime__time-field components-datetime__time-field-am-pm"},(0,s.createElement)(rd,{className:"components-datetime__time-am-button",variant:"AM"===p?"primary":"secondary",onClick:h("AM")},(0,u.__)("AM")),(0,s.createElement)(rd,{className:"components-datetime__time-pm-button",variant:"PM"===p?"primary":"secondary",onClick:h("PM")},(0,u.__)("PM"))),(0,s.createElement)(qv,null),(0,s.createElement)(VI,null))),(0,s.createElement)(RI,null,(0,s.createElement)(Tv.VisualLabel,{as:"legend",className:"components-datetime__time-legend"},(0,u.__)("Date")),(0,s.createElement)(Uv,{className:"components-datetime__time-wrapper"},t?(0,s.createElement)(s.Fragment,null,v,g):(0,s.createElement)(s.Fragment,null,g,v),(0,s.createElement)(BI,{className:"components-datetime__time-field components-datetime__time-field-year",label:(0,u.__)("Year"),hideLabelFromVision:!0,__next36pxDefaultSize:!0,value:c,step:1,min:1,max:9999,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:m("year"),__unstableStateReducer:jI(4)}))))};const WI=Zu(H_,{target:"e1p5onf01"})({name:"1khn195",styles:"box-sizing:border-box"}),UI=Zu("div",{target:"e1p5onf00"})({name:"l0rwn2",styles:"min-width:260px"}),GI=()=>{};const YI=(0,s.forwardRef)((function(e,t){let{currentDate:n,is12Hour:r,isInvalidDate:o,onMonthPreviewed:i=GI,onChange:a,events:l,startOfWeek:c,__nextRemoveHelpButton:d=!1,__nextRemoveResetButton:f=!1}=e;d||Kl()("Help button in wp.components.DateTimePicker",{since:"13.4",version:"15.8",hint:"Set the `__nextRemoveHelpButton` prop to `true` to remove this warning and opt in to the new behaviour, which will become the default in a future version."}),f||Kl()("Reset button in wp.components.DateTimePicker",{since:"13.4",version:"15.8",hint:"Set the `__nextRemoveResetButton` prop to `true` to remove this warning and opt in to the new behaviour, which will become the default in a future version."});const[p,m]=(0,s.useState)(!1);return(0,s.createElement)(WI,{ref:t,className:"components-datetime",spacing:4},!p&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)($I,{currentTime:n,onChange:a,is12Hour:r}),(0,s.createElement)(CI,{currentDate:n,onChange:a,isInvalidDate:o,events:l,onMonthPreviewed:i,startOfWeek:c})),p&&(0,s.createElement)(UI,{className:"components-datetime__calendar-help"},(0,s.createElement)($_,{level:4},(0,u.__)("Click to Select")),(0,s.createElement)("ul",null,(0,s.createElement)("li",null,(0,u.__)("Click the right or left arrows to select other months in the past or the future.")),(0,s.createElement)("li",null,(0,u.__)("Click the desired day to select it."))),(0,s.createElement)($_,{level:4},(0,u.__)("Navigating with a keyboard")),(0,s.createElement)("ul",null,(0,s.createElement)("li",null,(0,s.createElement)("abbr",{"aria-label":(0,u._x)("Enter","keyboard button")},"↵")," ",(0,s.createElement)("span",null,(0,u.__)("Select the date in focus."))),(0,s.createElement)("li",null,(0,s.createElement)("abbr",{"aria-label":(0,u.__)("Left and Right Arrows")},"←/→")," ",(0,u.__)("Move backward (left) or forward (right) by one day.")),(0,s.createElement)("li",null,(0,s.createElement)("abbr",{"aria-label":(0,u.__)("Up and Down Arrows")},"↑/↓")," ",(0,u.__)("Move backward (up) or forward (down) by one week.")),(0,s.createElement)("li",null,(0,s.createElement)("abbr",{"aria-label":(0,u.__)("Page Up and Page Down")},(0,u.__)("PgUp/PgDn"))," ",(0,u.__)("Move backward (PgUp) or forward (PgDn) by one month.")),(0,s.createElement)("li",null,(0,s.createElement)("abbr",{"aria-label":(0,u.__)("Home and End")},(0,u.__)("Home/End"))," ",(0,u.__)("Go to the first (Home) or last (End) day of a week.")))),(!f||!d)&&(0,s.createElement)(Uv,{className:"components-datetime__buttons"},!f&&!p&&n&&(0,s.createElement)(rd,{className:"components-datetime__date-reset-button",variant:"link",onClick:()=>null==a?void 0:a(null)},(0,u.__)("Reset")),(0,s.createElement)(qv,null),!d&&(0,s.createElement)(rd,{className:"components-datetime__date-help-toggle",variant:"link",onClick:function(){m(!p)}},p?(0,u.__)("Close"):(0,u.__)("Calendar Help"))))}));var qI=YI;var KI=[{name:(0,u._x)("None","Size of a UI element"),slug:"none"},{name:(0,u._x)("Small","Size of a UI element"),slug:"small"},{name:(0,u._x)("Medium","Size of a UI element"),slug:"medium"},{name:(0,u._x)("Large","Size of a UI element"),slug:"large"},{name:(0,u._x)("Extra Large","Size of a UI element"),slug:"xlarge"}];var XI=function(e){const{label:t,value:n,sizes:r=KI,icon:o,onChange:i,className:a=""}=e,l=(0,s.createElement)(s.Fragment,null,o&&(0,s.createElement)(Zl,{icon:o}),t);return(0,s.createElement)(dy,{className:c()(a,"block-editor-dimension-control"),label:l,hideLabelFromVision:!1,value:n,onChange:e=>{const t=((e,t)=>e.find((e=>t===e.slug)))(r,e);t&&n!==t.slug?"function"==typeof i&&i(t.slug):i(void 0)},options:(e=>{const t=e.map((e=>{let{name:t,slug:n}=e;return{label:t,value:n}}));return[{label:(0,u.__)("Default"),value:""}].concat(t)})(r)})};const ZI={name:"u2jump",styles:"position:relative;pointer-events:none;&::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;}*{pointer-events:none;}"},JI=(0,s.createContext)(!1),{Consumer:QI,Provider:eM}=JI;function tM(e){let{className:t,children:n,isDisabled:r=!0,...o}=e;const i=Bu();return(0,s.createElement)(eM,{value:r},(0,s.createElement)("div",a({inert:r?"true":void 0,className:r?i(ZI,t,"components-disabled"):void 0},o),n))}tM.Context=JI,tM.Consumer=QI;var nM=tM;const rM="is-dragging-components-draggable";var oM=function(e){let{children:t,onDragStart:n,onDragOver:r,onDragEnd:o,cloneClassname:i,elementId:a,transferData:l,__experimentalTransferDataType:c="text",__experimentalDragComponent:u}=e;const f=(0,s.useRef)(null),p=(0,s.useRef)((()=>{}));return(0,s.useEffect)((()=>()=>{p.current()}),[]),(0,s.createElement)(s.Fragment,null,t({onDraggableStart:function(e){const{ownerDocument:t}=e.target;e.dataTransfer.setData(c,JSON.stringify(l));const o=t.createElement("div");o.style.top="0",o.style.left="0";const s=t.createElement("div");"function"==typeof e.dataTransfer.setDragImage&&(s.classList.add("components-draggable__invisible-drag-image"),t.body.appendChild(s),e.dataTransfer.setDragImage(s,0,0)),o.classList.add("components-draggable__clone"),i&&o.classList.add(i);let u=0,m=0;if(f.current){u=e.clientX,m=e.clientY,o.style.transform=`translate( ${u}px, ${m}px )`;const n=t.createElement("div");n.innerHTML=f.current.innerHTML,o.appendChild(n),t.body.appendChild(o)}else{const e=t.getElementById(a),n=e.getBoundingClientRect(),r=e.parentNode,i=n.top,s=n.left;o.style.width=`${n.width+0}px`;const l=e.cloneNode(!0);l.id=`clone-${a}`,u=s-0,m=i-0,o.style.transform=`translate( ${u}px, ${m}px )`,Array.from(l.querySelectorAll("iframe")).forEach((e=>{var t;return null===(t=e.parentNode)||void 0===t?void 0:t.removeChild(e)})),o.appendChild(l),null==r||r.appendChild(o)}let h=e.clientX,g=e.clientY;const v=(0,d.throttle)((function(e){if(h===e.clientX&&g===e.clientY)return;const t=u+e.clientX-h,n=m+e.clientY-g;o.style.transform=`translate( ${t}px, ${n}px )`,h=e.clientX,g=e.clientY,u=t,m=n,r&&r(e)}),16);let b;t.addEventListener("dragover",v),t.body.classList.add(rM),e.persist(),n&&(b=setTimeout((()=>n(e)))),p.current=()=>{o&&o.parentNode&&o.parentNode.removeChild(o),s&&s.parentNode&&s.parentNode.removeChild(s),t.body.classList.remove(rM),t.removeEventListener("dragover",v),clearTimeout(b)}},onDraggableEnd:function(e){e.preventDefault(),p.current(),o&&o(e)}}),u&&(0,s.createElement)("div",{className:"components-draggable-drag-component-root",style:{display:"none"},ref:f},u))};var iM=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"}));var aM=function(e){let{className:t,label:n,onFilesDrop:r,onHTMLDrop:o,onDrop:i,...l}=e;const[f,p]=(0,s.useState)(),[m,h]=(0,s.useState)(),[g,v]=(0,s.useState)(),b=(0,d.__experimentalUseDropZone)({onDrop(e){var t;const n=e.dataTransfer?(0,ES.getFilesFromDataTransfer)(e.dataTransfer):[],a=null===(t=e.dataTransfer)||void 0===t?void 0:t.getData("text/html");a&&o?o(a):n.length&&r?r(n):i&&i(e)},onDragStart(e){var t,n;p(!0);let r="default";null!==(t=e.dataTransfer)&&void 0!==t&&t.types.includes("text/html")?r="html":(null!==(n=e.dataTransfer)&&void 0!==n&&n.types.includes("Files")||(e.dataTransfer?(0,ES.getFilesFromDataTransfer)(e.dataTransfer):[]).length>0)&&(r="file"),v(r)},onDragEnd(){p(!1),v(void 0)},onDragEnter(){h(!0)},onDragLeave(){h(!1)}}),y=(0,d.useReducedMotion)();let w;const x={hidden:{scaleY:0,opacity:0},show:{scaleY:1,opacity:1,transition:{type:"tween",duration:.2,delay:.1,delayChildren:.2}},exit:{scaleY:1,opacity:0,transition:{duration:.3,delayChildren:0}}},_={hidden:{opacity:0,scale:.75},show:{opacity:1,scale:1},exit:{opacity:0,scale:.9}};m&&(w=(0,s.createElement)(Gl.div,{variants:x,initial:y?"show":"hidden",animate:"show",exit:y?"show":"exit",className:"components-drop-zone__content",style:{pointerEvents:"none"}},(0,s.createElement)(Gl.div,{variants:_},(0,s.createElement)(ay,{icon:iM,className:"components-drop-zone__content-icon"}),(0,s.createElement)("span",{className:"components-drop-zone__content-text"},n||(0,u.__)("Drop files to upload")))));const E=c()("components-drop-zone",t,{"is-active":(f||m)&&("file"===g&&r||"html"===g&&o||"default"===g&&i),"is-dragging-over-document":f,"is-dragging-over-element":m,[`is-dragging-${g}`]:!!g});return(0,s.createElement)("div",a({},l,{ref:b,className:E}),y?w:(0,s.createElement)(Om,null,w))};function sM(e){let{children:t}=e;return Kl()("wp.components.DropZoneProvider",{since:"5.8",hint:"wp.component.DropZone no longer needs a provider. wp.components.DropZoneProvider is safe to remove from your code."}),t}var lM=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M5 17.7c.4.5.8.9 1.2 1.2l1.1-1.4c-.4-.3-.7-.6-1-1L5 17.7zM5 6.3l1.4 1.1c.3-.4.6-.7 1-1L6.3 5c-.5.4-.9.8-1.3 1.3zm.1 7.8l-1.7.5c.2.6.4 1.1.7 1.6l1.5-.8c-.2-.4-.4-.8-.5-1.3zM4.8 12v-.7L3 11.1v1.8l1.7-.2c.1-.2.1-.5.1-.7zm3 7.9c.5.3 1.1.5 1.6.7l.5-1.7c-.5-.1-.9-.3-1.3-.5l-.8 1.5zM19 6.3c-.4-.5-.8-.9-1.2-1.2l-1.1 1.4c.4.3.7.6 1 1L19 6.3zm-.1 3.6l1.7-.5c-.2-.6-.4-1.1-.7-1.6l-1.5.8c.2.4.4.8.5 1.3zM5.6 8.6l-1.5-.8c-.3.5-.5 1-.7 1.6l1.7.5c.1-.5.3-.9.5-1.3zm2.2-4.5l.8 1.5c.4-.2.8-.4 1.3-.5l-.5-1.7c-.6.2-1.1.4-1.6.7zm8.8 13.5l1.1 1.4c.5-.4.9-.8 1.2-1.2l-1.4-1.1c-.2.3-.5.6-.9.9zm1.8-2.2l1.5.8c.3-.5.5-1.1.7-1.6l-1.7-.5c-.1.5-.3.9-.5 1.3zm2.6-4.3l-1.7.2v1.4l1.7.2V12v-.9zM11.1 3l.2 1.7h1.4l.2-1.7h-1.8zm3 2.1c.5.1.9.3 1.3.5l.8-1.5c-.5-.3-1.1-.5-1.6-.7l-.5 1.7zM12 19.2h-.7l-.2 1.8h1.8l-.2-1.7c-.2-.1-.5-.1-.7-.1zm2.1-.3l.5 1.7c.6-.2 1.1-.4 1.6-.7l-.8-1.5c-.4.2-.8.4-1.3.5z"}));function cM(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"90deg";const n=100/e.length,r=e.map(((e,t)=>`${e} ${t*n}%, ${e} ${(t+1)*n}%`)).join(", ");return`linear-gradient( ${t}, ${r} )`}bp([yp]);var uM=function(e){let{values:t}=e;return t?(0,s.createElement)(Xb,{colorValue:cM(t,"135deg")}):(0,s.createElement)(Zl,{icon:lM})};function dM(e){let{label:t,value:n,colors:r,disableCustomColors:o,enableAlpha:i,onChange:a}=e;const[l,c]=(0,s.useState)(!1);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(rd,{className:"components-color-list-picker__swatch-button",onClick:()=>c((e=>!e))},(0,s.createElement)(Uv,{justify:"flex-start",spacing:2},n?(0,s.createElement)(Xb,{colorValue:n,className:"components-color-list-picker__swatch-color"}):(0,s.createElement)(Zl,{icon:lM}),(0,s.createElement)("span",null,t))),l&&(0,s.createElement)(J_,{className:"components-color-list-picker__color-picker",colors:r,value:n,clearable:!1,onChange:a,disableCustomColors:o,enableAlpha:i}))}var fM=function(e){let{colors:t,labels:n,value:r=[],disableCustomColors:o,enableAlpha:i,onChange:a}=e;return(0,s.createElement)("div",{className:"components-color-list-picker"},n.map(((e,n)=>(0,s.createElement)(dM,{key:n,label:e,value:r[n],colors:t,disableCustomColors:o,enableAlpha:i,onChange:e=>{const t=r.slice();t[n]=e,a(t)}}))))};const pM=["#333","#CCC"];function mM(e){let{value:t,onChange:n}=e;const r=!!t,o=r?t:pM,i=cM(o),a=(l=o).map(((e,t)=>({position:100*t/(l.length-1),color:e})));var l;return(0,s.createElement)(rS,{disableInserter:!0,background:i,hasGradient:r,value:a,onChange:e=>{const t=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((e=>{let{color:t}=e;return t}))}(e);n(t)}})}var hM=function(e){let{clearable:t=!0,unsetable:n=!0,colorPalette:r,duotonePalette:o,disableCustomColors:i,disableCustomDuotone:a,value:l,onChange:c}=e;const[d,f]=(0,s.useMemo)((()=>{return!(e=r)||e.length<2?["#000","#fff"]:e.map((e=>{let{color:t}=e;return{color:t,brightness:gp(t).brightness()}})).reduce(((e,t)=>{let[n,r]=e;return[t.brightness<=n.brightness?t:n,t.brightness>=r.brightness?t:r]}),[{brightness:1},{brightness:0}]).map((e=>{let{color:t}=e;return t}));var e}),[r]),p="unset"===l,m=(0,s.createElement)(V_.Option,{key:"unset",value:"unset",isSelected:p,tooltipText:(0,u.__)("Unset"),className:"components-duotone-picker__color-indicator",onClick:()=>{c(p?void 0:"unset")}}),h=o.map((e=>{let{colors:t,slug:n,name:r}=e;const o={background:cM(t,"135deg"),color:"transparent"},i=null!=r?r:(0,u.sprintf)((0,u.__)("Duotone code: %s"),n),a=r?(0,u.sprintf)((0,u.__)("Duotone: %s"),r):i,d=Ql()(t,l);return(0,s.createElement)(V_.Option,{key:n,value:t,isSelected:d,"aria-label":a,tooltipText:i,style:o,onClick:()=>{c(d?void 0:t)}})}));return(0,s.createElement)(V_,{options:n?[m,...h]:h,actions:!!t&&(0,s.createElement)(V_.ButtonAction,{onClick:()=>c(void 0)},(0,u.__)("Clear"))},(0,s.createElement)(qv,{paddingTop:4},(0,s.createElement)(H_,{spacing:3},!i&&!a&&(0,s.createElement)(mM,{value:p?void 0:l,onChange:c}),!a&&(0,s.createElement)(fM,{labels:[(0,u.__)("Shadows"),(0,u.__)("Highlights")],colors:r,value:p?void 0:l,disableCustomColors:i,enableAlpha:!0,onChange:e=>{e[0]||(e[0]=d),e[1]||(e[1]=f);const t=e.length>=2?e:void 0;c(t)}}))))};var gM=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"}));const vM=Zu(ay,{target:"esh4a730"})({name:"rvs7bx",styles:"width:1em;height:1em;margin:0;vertical-align:middle;fill:currentColor"});var bM=(0,s.forwardRef)((function(e,t){const{href:n,children:r,className:o,rel:i="",...l}=e,d=[...new Set([...i.split(" "),"external","noreferrer","noopener"].filter(Boolean))].join(" "),f=c()("components-external-link",o),p=!(null==n||!n.startsWith("#"));return(0,s.createElement)("a",a({},l,{className:f,href:n,onClick:t=>{p&&t.preventDefault(),e.onClick&&e.onClick(t)},target:"_blank",rel:d,ref:t}),r,(0,s.createElement)(ed,{as:"span"},(0,u.__)("(opens in a new tab)")),(0,s.createElement)(vM,{icon:gM,className:"components-external-link__icon"}))}));const yM={width:200,height:170},wM=["avi","mpg","mpeg","mov","mp4","m4v","ogg","ogv","webm","wmv"];function xM(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=e.split(".");return t[t.length-1]}function _M(e){return Math.round(100*e)}const EM=Zu("div",{target:"eeew7dm8"})({name:"w0nf6b",styles:"background-color:transparent;text-align:center;width:100%"}),CM=Zu("div",{target:"eeew7dm7"})({name:"megach",styles:"align-items:center;box-shadow:0 0 0 1px rgba( 0, 0, 0, 0.2 );cursor:pointer;display:inline-flex;justify-content:center;margin:auto;position:relative;height:100%;img,video{box-sizing:border-box;display:block;height:auto;margin:0;max-height:100%;max-width:100%;pointer-events:none;user-select:none;width:auto;}"}),kM=Zu("div",{target:"eeew7dm6"})("background:",kp.gray[100],";box-sizing:border-box;height:",yM.height,"px;max-width:280px;min-width:",yM.width,"px;width:100%;"),SM=Zu(mE,{target:"eeew7dm5"})({name:"1pzk433",styles:"width:100px"});var TM={name:"1mn7kwb",styles:"padding-bottom:1em"};const NM=e=>{let{__nextHasNoMarginBottom:t}=e;return t?void 0:TM};var RM={name:"1mn7kwb",styles:"padding-bottom:1em"};const IM=e=>{let{hasHelpText:t=!1}=e;return t?RM:void 0},MM=Zu(Xm,{target:"eeew7dm4"})("max-width:320px;padding-top:1em;",IM," ",NM,";"),PM=Zu("div",{target:"eeew7dm3"})("left:50%;overflow:hidden;pointer-events:none;position:absolute;top:50%;transform:translate3d( -50%, -50%, 0 );transition:opacity 120ms linear;z-index:1;opacity:",(e=>{let{showOverlay:t}=e;return t?1:0}),";"),OM=Zu("div",{target:"eeew7dm2"})({name:"1d42i6k",styles:"background:white;box-shadow:0 0 2px rgba( 0, 0, 0, 0.6 );position:absolute;opacity:0.4;transform:translateZ( 0 )"}),DM=Zu(OM,{target:"eeew7dm1"})({name:"1qp910y",styles:"height:1px;left:0;right:0"}),AM=Zu(OM,{target:"eeew7dm0"})({name:"1oz3zka",styles:"width:1px;top:0;bottom:0"}),LM=()=>{};function zM(e){let{__nextHasNoMarginBottom:t,hasHelpText:n,onChange:r=LM,point:o={x:.5,y:.5}}=e;const i=_M(o.x),a=_M(o.y),l=(e,t)=>{if(void 0===e)return;const n=parseInt(e,10);isNaN(n)||r({...o,[t]:n/100})};return(0,s.createElement)(MM,{className:"focal-point-picker__controls",__nextHasNoMarginBottom:t,hasHelpText:n},(0,s.createElement)(BM,{label:(0,u.__)("Left"),value:[i,"%"].join(""),onChange:e=>l(e,"x"),dragDirection:"e"}),(0,s.createElement)(BM,{label:(0,u.__)("Top"),value:[a,"%"].join(""),onChange:e=>l(e,"y"),dragDirection:"s"}))}function BM(e){return(0,s.createElement)(SM,a({className:"focal-point-picker__controls-position-unit-control",labelPosition:"top",max:100,min:0,units:[{value:"%",label:"%"}]},e))}const FM=Zu("div",{target:"e19snlhg0"})("background-color:transparent;cursor:grab;height:48px;margin:-24px 0 0 -24px;position:absolute;user-select:none;width:48px;will-change:transform;z-index:10000;background:rgba( 255, 255, 255, 0.6 );border-radius:50%;backdrop-filter:blur( 4px );box-shadow:rgb( 0 0 0 / 20% ) 0px 0px 10px;",(e=>{let{isDragging:t}=e;return t&&"cursor: grabbing;"}),";");function VM(e){let{left:t="50%",top:n="50%",...r}=e;const o=c()("components-focal-point-picker__icon_container"),i={left:t,top:n};return(0,s.createElement)(FM,a({},r,{className:o,style:i}))}function HM(e){let{bounds:t,...n}=e;return(0,s.createElement)(PM,a({},n,{className:"components-focal-point-picker__grid",style:{width:t.width,height:t.height}}),(0,s.createElement)(DM,{style:{top:"33%"}}),(0,s.createElement)(DM,{style:{top:"66%"}}),(0,s.createElement)(AM,{style:{left:"33%"}}),(0,s.createElement)(AM,{style:{left:"66%"}}))}function jM(e){let{alt:t,autoPlay:n,src:r,onLoad:o,mediaRef:i,muted:l=!0,...c}=e;if(!r)return(0,s.createElement)(kM,a({className:"components-focal-point-picker__media components-focal-point-picker__media--placeholder",ref:i},c));const u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!!e&&(e.startsWith("data:video/")||wM.includes(xM(e)))}(r);return u?(0,s.createElement)("video",a({},c,{autoPlay:n,className:"components-focal-point-picker__media components-focal-point-picker__media--video",loop:!0,muted:l,onLoadedData:o,ref:i,src:r})):(0,s.createElement)("img",a({},c,{alt:t,className:"components-focal-point-picker__media components-focal-point-picker__media--image",onLoad:o,ref:i,src:r}))}var $M=function e(t){let{__nextHasNoMarginBottom:n,autoPlay:r=!0,className:o,help:i,label:l,onChange:f,onDrag:p,onDragEnd:m,onDragStart:h,resolvePoint:g,url:v,value:b={x:.5,y:.5},...y}=t;const[w,x]=(0,s.useState)(b),[_,E]=(0,s.useState)(!1),{startDrag:C,endDrag:k,isDragging:S}=(0,d.__experimentalUseDragging)({onDragStart:e=>{var t;null===(t=R.current)||void 0===t||t.focus();const n=O(e);n&&(null==h||h(n,e),x(n))},onDragMove:e=>{e.preventDefault();const t=O(e);t&&(null==p||p(t,e),x(t))},onDragEnd:()=>{null==m||m(),null==f||f(w)}}),{x:T,y:N}=S?w:b,R=(0,s.useRef)(null),[I,M]=(0,s.useState)(yM),P=(0,s.useRef)((()=>{if(!R.current)return;const{clientWidth:e,clientHeight:t}=R.current;M(e>0&&t>0?{width:e,height:t}:{...yM})}));(0,s.useEffect)((()=>{const e=P.current;if(!R.current)return;const{defaultView:t}=R.current.ownerDocument;return null==t||t.addEventListener("resize",e),()=>null==t?void 0:t.removeEventListener("resize",e)}),[]),(0,d.useIsomorphicLayoutEffect)((()=>{P.current()}),[]);const O=e=>{let{clientX:t,clientY:n,shiftKey:r}=e;if(!R.current)return;const{top:o,left:i}=R.current.getBoundingClientRect();let a=(t-i)/I.width,s=(n-o)/I.height;return r&&(a=.1*Math.round(a/.1),s=.1*Math.round(s/.1)),D({x:a,y:s})},D=e=>{var t;const n=null!==(t=null==g?void 0:g(e))&&void 0!==t?t:e;n.x=Math.max(0,Math.min(n.x,1)),n.y=Math.max(0,Math.min(n.y,1));const r=e=>Math.round(100*e)/100;return{x:r(n.x),y:r(n.y)}},A={left:T*I.width,top:N*I.height},L=c()("components-focal-point-picker-control",o),z=`inspector-focal-point-picker-control-${(0,d.useInstanceId)(e)}`;return tc((()=>{E(!0);const e=window.setTimeout((()=>{E(!1)}),600);return()=>window.clearTimeout(e)}),[T,N]),(0,s.createElement)(Tv,a({},y,{__nextHasNoMarginBottom:n,label:l,id:z,help:i,className:L}),(0,s.createElement)(EM,{className:"components-focal-point-picker-wrapper"},(0,s.createElement)(CM,{className:"components-focal-point-picker",onKeyDown:e=>{const{code:t,shiftKey:n}=e;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t))return;e.preventDefault();const r={x:T,y:N},o=n?.1:.01,i="ArrowUp"===t||"ArrowLeft"===t?-1*o:o,a="ArrowUp"===t||"ArrowDown"===t?"y":"x";r[a]=r[a]+i,null==f||f(D(r))},onMouseDown:C,onBlur:()=>{S&&k()},ref:R,role:"button",tabIndex:-1},(0,s.createElement)(HM,{bounds:I,showOverlay:_}),(0,s.createElement)(jM,{alt:(0,u.__)("Media preview"),autoPlay:r,onLoad:P.current,src:v}),(0,s.createElement)(VM,a({},A,{isDragging:S})))),(0,s.createElement)(zM,{__nextHasNoMarginBottom:n,hasHelpText:!!i,point:{x:T,y:N},onChange:e=>{null==f||f(D(e))}}))};function WM(e){let{iframeRef:t,...n}=e;const r=(0,d.useMergeRefs)([t,(0,d.useFocusableIframe)()]);return Kl()("wp.components.FocusableIframe",{since:"5.9",alternative:"wp.compose.useFocusableIframe"}),(0,s.createElement)("iframe",a({ref:r},n))}var UM=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"}));function GM(e){const[t,...n]=e;if(!t)return null;const[,r]=aE(t.size);return n.every((e=>{const[,t]=aE(e.size);return t===r}))?r:null}const YM=Zu("fieldset",{target:"e8tqeku4"})({name:"1t1ytme",styles:"border:0;margin:0;padding:0"}),qM=Zu(Tv.VisualLabel,{target:"e8tqeku3"})("display:flex;gap:",qm(1),";justify-content:flex-start;margin-bottom:0;"),KM=Zu("span",{target:"e8tqeku2"})("color:",kp.gray[700],";"),XM=Zu("div",{target:"e8tqeku1"})((e=>!e.__nextHasNoMarginBottom&&`margin-bottom: ${qm(6)};`),";"),ZM=Zu(rd,{target:"e8tqeku0"})("&&&{height:",(e=>"__unstable-large"===e.size?"40px":"30px"),";}"),JM={key:"default",name:(0,u.__)("Default"),value:void 0},QM={key:"custom",name:(0,u.__)("Custom")};var eP=e=>{var t;const{fontSizes:n,value:r,disableCustomFontSizes:o,size:i,onChange:a,onSelectCustom:l}=e,c=!!GM(n),d=[JM,...n.map((e=>{let t;if(c){const[n]=aE(e.size);void 0!==n&&(t=String(n))}else(function(e){return/^[\d\.]+(px|em|rem|vw|vh|%)?$/i.test(String(e))})(e.size)&&(t=String(e.size));return{key:e.slug,name:e.name||e.slug,value:e.size,__experimentalHint:t}})),...o?[]:[QM]],f=r?null!==(t=d.find((e=>e.value===r)))&&void 0!==t?t:QM:JM;return(0,s.createElement)(xN,{__nextUnconstrainedWidth:!0,className:"components-font-size-picker__select",label:(0,u.__)("Font size"),hideLabelFromVision:!0,describedBy:(0,u.sprintf)((0,u.__)("Currently selected font size: %s"),f.name),options:d,value:f,__experimentalShowSelectedHint:!0,onChange:e=>{let{selectedItem:t}=e;t===QM?l():a(t.value)},size:i})};const tP=e=>{const t=$f("border-color:",kp.ui.border,";","");return $f(e&&t," &:hover{border-color:",kp.ui.borderHover,";}&:focus-within{border-color:",kp.ui.borderFocus,";box-shadow:",ph.controlBoxShadowFocus,";outline:none;z-index:1;}","")},nP=e=>$f("min-height:",{default:"36px","__unstable-large":"40px"}[e],";",""),rP={name:"7whenc",styles:"display:flex;width:100%"},oP=Zu("div",{target:"eakva831"})("background:",kp.gray[900],";border-radius:",ph.controlBorderRadius,";left:0;position:absolute;top:2px;bottom:2px;transition:transform ",ph.transitionDurationFast," ease;",Sp("transition")," z-index:1;"),iP=Zu("div",{target:"eakva830"})({name:"zjik7",styles:"display:flex"});function aP(e){void 0===e&&(e={});var t=Ap(e),n=t.state,r=t.loop,o=void 0===r||r,i=h(t,["state","loop"]),a=(0,b.useState)(n),s=a[0],l=a[1],c=rm(m(m({},i),{},{loop:o}));return m(m({},c),{},{state:s,setState:l})}var sP=["baseId","unstable_idCountRef","unstable_virtual","rtl","orientation","items","groups","currentId","loop","wrap","shift","unstable_moves","unstable_hasActiveWidget","unstable_includesBaseElement","state","setBaseId","registerItem","unregisterItem","registerGroup","unregisterGroup","move","next","previous","up","down","first","last","sort","unstable_setVirtual","setRTL","setOrientation","setCurrentId","setLoop","setWrap","setShift","reset","unstable_setIncludesBaseElement","unstable_setHasActiveWidget","setState"],lP=[].concat(sP,["value","checked","unstable_checkOnFocus"]),cP=z({as:"div",useHook:F({name:"RadioGroup",compose:dm,keys:sP,useProps:function(e,t){return m({role:"radiogroup"},t)}}),useCreateElement:function(e,t,n){return N(e,t,n)}});var uP=(0,s.memo)((function(e){let{containerRef:t,containerWidth:n,isAdaptiveWidth:r,state:o}=e;const[i,a]=(0,s.useState)(0),[l,c]=(0,s.useState)(0),[u,d]=(0,s.useState)(!1),[f,p]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{const e=null==t?void 0:t.current;if(!e)return;const n=e.querySelector(`[data-value="${o}"]`);if(p(!!n),!n)return;const r=window.setTimeout((()=>{const{width:t,x:r}=n.getBoundingClientRect(),{x:o}=e.getBoundingClientRect();a(r-o-1),c(t)}),100);let i;return u||(i=window.requestAnimationFrame((()=>{d(!0)}))),()=>{window.clearTimeout(r),window.cancelAnimationFrame(i)}}),[u,t,n,o,r]),f?(0,s.createElement)(oP,{role:"presentation",style:{transform:`translateX(${i}px)`,transition:u?void 0:"none",width:l}}):null}));const dP=(0,s.createContext)({});var fP=dP;const pP=(0,s.forwardRef)((function(e,t){let{children:n,isAdaptiveWidth:r,label:o,onChange:i,size:l,value:c,...u}=e;const f=(0,s.useRef)(),[p,m]=(0,d.useResizeObserver)(),h=aP({baseId:(0,d.useInstanceId)(pP,"toggle-group-control-as-radio-group").toString(),state:c}),g=(0,d.usePrevious)(c);return tc((()=>{g!==h.state&&i(h.state)}),[h.state]),tc((()=>{c!==h.state&&h.setState(c)}),[c]),(0,s.createElement)(fP.Provider,{value:{...h,isBlock:!r,size:l}},(0,s.createElement)(cP,a({},h,{"aria-label":o,as:Qu},u,{ref:(0,d.useMergeRefs)([f,t])}),p,(0,s.createElement)(uP,{state:h.state,containerRef:f,containerWidth:m.width,isAdaptiveWidth:r}),n))}));const mP=(0,s.forwardRef)((function(e,t){let{children:n,isAdaptiveWidth:r,label:o,onChange:i,size:l,value:c,...u}=e;const f=(0,s.useRef)(),[p,m]=(0,d.useResizeObserver)(),h=(0,d.useInstanceId)(mP,"toggle-group-control-as-button-group").toString(),[g,v]=(0,s.useState)(c),b={baseId:h,state:g,setState:v},y=(0,d.usePrevious)(c);return tc((()=>{y!==b.state&&i(b.state)}),[b.state]),tc((()=>{c!==b.state&&b.setState(c)}),[c]),(0,s.createElement)(fP.Provider,{value:{...b,isBlock:!r,isDeselectable:!0,size:l}},(0,s.createElement)(Qu,a({"aria-label":o},u,{ref:(0,d.useMergeRefs)([f,t]),role:"group"}),p,(0,s.createElement)(uP,{state:b.state,containerRef:f,containerWidth:m.width,isAdaptiveWidth:r}),n))})),hP=()=>{};const gP=Vu((function(e,t){const{__nextHasNoMarginBottom:n=!1,className:r,isAdaptiveWidth:o=!1,isBlock:i=!1,isDeselectable:l=!1,label:c,hideLabelFromVision:u=!1,help:d,onChange:f=hP,size:p="default",value:m,children:h,...g}=Fu(e,"ToggleGroupControl"),v=Bu(),b=(0,s.useMemo)((()=>v((e=>{let{isBlock:t,isDeselectable:n,size:r}=e;return $f("background:",kp.ui.background,";border:1px solid transparent;border-radius:",ph.controlBorderRadius,";display:inline-flex;min-width:0;padding:2px;position:relative;transition:transform ",ph.transitionDurationFastest," linear;",Sp("transition")," ",nP(r)," ",!n&&tP(t),";","")})({isBlock:i,isDeselectable:l,size:p}),i&&rP,r)),[r,v,i,l,p]),y=l?mP:pP;return(0,s.createElement)(Tv,{help:d,__nextHasNoMarginBottom:n},!u&&(0,s.createElement)(iP,null,(0,s.createElement)(Tv.VisualLabel,null,c)),(0,s.createElement)(y,a({},g,{children:h,className:b,isAdaptiveWidth:o,label:c,onChange:f,ref:t,size:p,value:m})))}),"ToggleGroupControl");var vP=gP;function bP(e){return void 0!==e.checked?e.checked:void 0!==e.value&&e.state===e.value}function yP(e,t){var n=_e(e,"change");Object.defineProperties(n,{type:{value:"change"},target:{value:e},currentTarget:{value:e}}),null==t||t(n)}var wP=F({name:"Radio",compose:ke,keys:lP,useOptions:function(e,t){var n,r=t.value,o=t.checked,i=e.unstable_clickOnEnter,a=void 0!==i&&i,s=e.unstable_checkOnFocus,l=void 0===s||s,c=h(e,["unstable_clickOnEnter","unstable_checkOnFocus"]);return m(m({checked:o,unstable_clickOnEnter:a,unstable_checkOnFocus:l},c),{},{value:null!=(n=c.value)?n:r})},useProps:function(e,t){var n=t.ref,r=t.onChange,o=t.onClick,i=h(t,["ref","onChange","onClick"]),a=(0,b.useRef)(null),s=(0,b.useState)(!0),l=s[0],c=s[1],u=bP(e),d=G(e.currentId===e.id),f=G(r),p=G(o);!function(e){var t=(0,b.useState)((function(){return bP(e)}))[0],n=(0,b.useState)(e.currentId)[0],r=e.id,o=e.setCurrentId;(0,b.useEffect)((function(){t&&r&&n!==r&&(null==o||o(r))}),[t,r,o,n])}(e),(0,b.useEffect)((function(){var e=a.current;e&&("INPUT"===e.tagName&&"radio"===e.type||c(!1))}),[]);var g=(0,b.useCallback)((function(t){var n,r;null===(n=f.current)||void 0===n||n.call(f,t),t.defaultPrevented||e.disabled||null===(r=e.setState)||void 0===r||r.call(e,e.value)}),[e.disabled,e.setState,e.value]),v=(0,b.useCallback)((function(e){var t;null===(t=p.current)||void 0===t||t.call(p,e),e.defaultPrevented||l||yP(e.currentTarget,g)}),[g,l]);return(0,b.useEffect)((function(){var t=a.current;t&&e.unstable_moves&&d.current&&e.unstable_checkOnFocus&&yP(t,g)}),[e.unstable_moves,e.unstable_checkOnFocus,g]),m({ref:H(a,n),role:l?void 0:"radio",type:l?"radio":void 0,value:l?e.value:void 0,name:l?e.baseId:void 0,"aria-checked":u,checked:u,onChange:g,onClick:v},i)}}),xP=z({as:"input",memo:!0,useHook:wP});const _P=Zu("div",{target:"et6ln9s1"})({name:"sln1fl",styles:"display:inline-flex;max-width:100%;min-width:0;position:relative"}),EP={name:"82a6rk",styles:"flex:1"},CP=e=>{let{isDeselectable:t,isIcon:n,isPressed:r,size:o}=e;return $f("align-items:center;appearance:none;background:transparent;border:none;border-radius:",ph.controlBorderRadius,";color:",kp.gray[700],";fill:currentColor;cursor:pointer;display:flex;font-family:inherit;height:100%;justify-content:center;line-height:100%;outline:none;padding:0 12px;position:relative;text-align:center;transition:background ",ph.transitionDurationFast," linear,color ",ph.transitionDurationFast," linear,font-weight 60ms linear;",Sp("transition")," user-select:none;width:100%;z-index:2;&::-moz-focus-inner{border:0;}&:active{background:",ph.toggleGroupControlBackgroundColor,";}",t&&SP," ",n&&NP({size:o})," ",r&&kP,";","")},kP=$f("color:",kp.white,";&:active{background:transparent;}",""),SP=$f("color:",kp.gray[900],";&:focus{box-shadow:inset 0 0 0 1px ",kp.white,",0 0 0 ",ph.borderWidthFocus," ",kp.ui.theme,";outline:2px solid transparent;}",""),TP=Zu("div",{target:"et6ln9s0"})("display:flex;font-size:",ph.fontSize,";line-height:1;"),NP=e=>{let{size:t="default"}=e;return $f("color:",kp.gray[900],";width:",{default:"30px","__unstable-large":"34px"}[t],";padding-left:0;padding-right:0;","")},{ButtonContentView:RP,LabelView:IP}=o,MP=e=>{let{showTooltip:t,text:n,children:r}=e;return t&&n?(0,s.createElement)(zf,{text:n,position:"top center"},r):(0,s.createElement)(s.Fragment,null,r)};const PP=Vu((function e(t,n){const r=(0,s.useContext)(dP),o=Fu({...t,id:(0,d.useInstanceId)(e,r.baseId||"toggle-group-control-option-base")},"ToggleGroupControlOptionBase"),{isBlock:i=!1,isDeselectable:l=!1,size:c="default",...u}=r,{className:f,isIcon:p=!1,value:m,children:h,showTooltip:g=!1,...v}=o,b=u.state===m,y=Bu(),w=y(i&&EP),x=y(CP({isDeselectable:l,isIcon:p,isPressed:b,size:c}),f),_={...v,className:x,"data-value":m,ref:n};return(0,s.createElement)(IP,{className:w},(0,s.createElement)(MP,{showTooltip:g,text:v["aria-label"]},l?(0,s.createElement)("button",a({},_,{"aria-pressed":b,type:"button",onClick:()=>{l&&b?u.setState(void 0):u.setState(m)}}),(0,s.createElement)(RP,null,h)):(0,s.createElement)(xP,a({},_,u,{as:"button",value:m}),(0,s.createElement)(RP,null,h))))}),"ToggleGroupControlOptionBase");var OP=PP;var DP=(0,s.forwardRef)((function(e,t){const{label:n,...r}=e,o=r["aria-label"]||n;return(0,s.createElement)(OP,a({},r,{"aria-label":o,ref:t}),n)}));const AP=[(0,u.__)("S"),(0,u.__)("M"),(0,u.__)("L"),(0,u.__)("XL"),(0,u.__)("XXL")],LP=[(0,u.__)("Small"),(0,u.__)("Medium"),(0,u.__)("Large"),(0,u.__)("Extra Large"),(0,u.__)("Extra Extra Large")];var zP=e=>{const{fontSizes:t,value:n,__nextHasNoMarginBottom:r,size:o,onChange:i}=e;return(0,s.createElement)(vP,{__nextHasNoMarginBottom:r,label:(0,u.__)("Font size"),hideLabelFromVision:!0,value:n,onChange:i,isBlock:!0,size:o},t.map(((e,t)=>(0,s.createElement)(DP,{key:e.slug,value:e.size,label:AP[t],"aria-label":e.name||LP[t],showTooltip:!0}))))};const BP=(0,s.forwardRef)(((e,t)=>{var n;const{__nextHasNoMarginBottom:r=!1,fallbackFontSize:o,fontSizes:i=[],disableCustomFontSizes:a=!1,onChange:l,size:c="default",value:d,withSlider:f=!1,withReset:p=!0}=e;r||Kl()("Bottom margin styles for wp.components.FontSizePicker",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const m=lE({availableUnits:["px","em","rem"]}),h=i.length>5,g=i.find((e=>e.size===d)),v=!!d&&!g,[b,y]=(0,s.useState)(!a&&v),w=(0,s.useMemo)((()=>{if(b)return(0,u.__)("Custom");if(!h)return g?g.name||LP[i.indexOf(g)]:"";const e=GM(i);return e?`(${e})`:""}),[b,h,g,i]);if(0===i.length&&a)return null;const x="string"==typeof d||"string"==typeof(null===(n=i[0])||void 0===n?void 0:n.size),[_,E]=aE(d,m),C=!!E&&["em","rem"].includes(E);return(0,s.createElement)(YM,{ref:t,className:"components-font-size-picker"},(0,s.createElement)(ed,{as:"legend"},(0,u.__)("Font size")),(0,s.createElement)(qv,null,(0,s.createElement)(Uv,{className:"components-font-size-picker__header"},(0,s.createElement)(qM,{"aria-label":`${(0,u.__)("Size")} ${w||""}`},(0,u.__)("Size"),w&&(0,s.createElement)(KM,{className:"components-font-size-picker__header__hint"},w)),!a&&(0,s.createElement)(rd,{label:b?(0,u.__)("Use size preset"):(0,u.__)("Set custom size"),icon:UM,onClick:()=>{y(!b)},isPressed:b,isSmall:!0}))),(0,s.createElement)(XM,{className:"components-font-size-picker__controls",__nextHasNoMarginBottom:r},!!i.length&&h&&!b&&(0,s.createElement)(eP,{fontSizes:i,value:d,disableCustomFontSizes:a,size:c,onChange:e=>{void 0===e?null==l||l(void 0):null==l||l(x?e:Number(e),i.find((t=>t.size===e)))},onSelectCustom:()=>y(!0)}),!h&&!b&&(0,s.createElement)(zP,{fontSizes:i,value:d,__nextHasNoMarginBottom:r,size:c,onChange:e=>{void 0===e?null==l||l(void 0):null==l||l(x?e:Number(e),i.find((t=>t.size===e)))}}),!a&&b&&(0,s.createElement)(Xm,{className:"components-font-size-picker__custom-size-control"},(0,s.createElement)(jm,{isBlock:!0},(0,s.createElement)(mE,{label:(0,u.__)("Custom"),labelPosition:"top",hideLabelFromVision:!0,value:d,onChange:e=>{void 0===e?null==l||l(void 0):null==l||l(x?e:parseInt(e,10))},size:c,units:x?m:[],min:0})),f&&(0,s.createElement)(jm,{isBlock:!0},(0,s.createElement)(qv,{marginX:2,marginBottom:0},(0,s.createElement)(jy,{__nextHasNoMarginBottom:r,className:"components-font-size-picker__custom-input",label:(0,u.__)("Custom Size"),hideLabelFromVision:!0,value:_,initialPosition:o,withInputField:!1,onChange:e=>{void 0===e?null==l||l(void 0):x?null==l||l(e+(null!=E?E:"px")):null==l||l(e)},min:0,max:C?10:100,step:C?.1:1}))),p&&(0,s.createElement)(jm,null,(0,s.createElement)(ZM,{disabled:void 0===d,onClick:()=>{null==l||l(void 0)},isSmall:!0,variant:"secondary",size:c},(0,u.__)("Reset"))))))}));var FP=BP;var VP=function(e){let{accept:t,children:n,multiple:r=!1,onChange:o,onClick:i,render:l,...c}=e;const u=(0,s.useRef)(null),d=()=>{var e;null===(e=u.current)||void 0===e||e.click()},f=l?l({openFileDialog:d}):(0,s.createElement)(rd,a({onClick:d},c),n);return(0,s.createElement)("div",{className:"components-form-file-upload"},f,(0,s.createElement)("input",{type:"file",ref:u,multiple:r,style:{display:"none"},accept:t,onChange:o,onClick:i,"data-testid":"form-file-upload-input"}))};const HP=()=>{};var jP=function(e){const{className:t,checked:n,id:r,disabled:o,onChange:i=HP,...l}=e,u=c()("components-form-toggle",t,{"is-checked":n,"is-disabled":o});return(0,s.createElement)("span",{className:u},(0,s.createElement)("input",a({className:"components-form-toggle__input",id:r,type:"checkbox",checked:n,onChange:i,disabled:o},l)),(0,s.createElement)("span",{className:"components-form-toggle__track"}),(0,s.createElement)("span",{className:"components-form-toggle__thumb"}))};const $P=()=>{};function WP(e){let{value:t,status:n,title:r,displayTransform:o,isBorderless:i=!1,disabled:a=!1,onClickRemove:l=$P,onMouseEnter:f,onMouseLeave:p,messages:m,termPosition:h,termsCount:g}=e;const v=(0,d.useInstanceId)(WP),b=c()("components-form-token-field__token",{"is-error":"error"===n,"is-success":"success"===n,"is-validating":"validating"===n,"is-borderless":i,"is-disabled":a}),y=o(t),w=(0,u.sprintf)((0,u.__)("%1$s (%2$s of %3$s)"),y,h,g);return(0,s.createElement)("span",{className:b,onMouseEnter:f,onMouseLeave:p,title:r},(0,s.createElement)("span",{className:"components-form-token-field__token-text",id:`components-form-token-field__token-text-${v}`},(0,s.createElement)(ed,{as:"span"},w),(0,s.createElement)("span",{"aria-hidden":"true"},y)),(0,s.createElement)(rd,{className:"components-form-token-field__remove-token",icon:Nb,onClick:a?void 0:()=>l({value:t}),label:m.remove,"aria-describedby":`components-form-token-field__token-text-${v}`}))}const UP=e=>{let{__next36pxDefaultSize:t,hasTokens:n}=e;return!t&&$f("padding-top:",qm(n?1:.5),";padding-bottom:",qm(n?1:.5),";","")},GP=Zu(Xm,{target:"ehq8nmi0"})("padding:5px ",qm(1),";",UP,";"),YP=e=>e;var qP=function e(t){const{autoCapitalize:n,autoComplete:r,maxLength:o,placeholder:i,label:l=(0,u.__)("Add item"),className:f,suggestions:p=[],maxSuggestions:m=100,value:h=[],displayTransform:g=YP,saveTransform:v=(e=>e.trim()),onChange:b=(()=>{}),onInputChange:y=(()=>{}),onFocus:w,isBorderless:x=!1,disabled:_=!1,tokenizeOnSpace:E=!1,messages:C={added:(0,u.__)("Item added."),removed:(0,u.__)("Item removed."),remove:(0,u.__)("Remove item"),__experimentalInvalid:(0,u.__)("Invalid item")},__experimentalRenderItem:k,__experimentalExpandOnFocus:S=!1,__experimentalValidateInput:T=(()=>!0),__experimentalShowHowTo:N=!0,__next36pxDefaultSize:R=!1,__experimentalAutoSelectFirstMatch:I=!1}=t,M=(0,d.useInstanceId)(e),[P,O]=(0,s.useState)(""),[D,A]=(0,s.useState)(0),[L,z]=(0,s.useState)(!1),[B,F]=(0,s.useState)(!1),[V,H]=(0,s.useState)(-1),[j,$]=(0,s.useState)(!1),W=(0,d.usePrevious)(p),U=(0,d.usePrevious)(h),G=(0,s.useRef)(null),Y=(0,s.useRef)(null),q=(0,d.useDebounce)(lb.speak,500);function K(){var e;null===(e=G.current)||void 0===e||e.focus()}function X(){var e;return G.current===(null===(e=G.current)||void 0===e?void 0:e.ownerDocument.activeElement)}function Z(){fe()?z(!1):(O(""),A(0),z(!1),F(!1),H(-1),$(!1))}function J(e){e.target===Y.current&&L&&e.preventDefault()}function Q(e){se(e.value),K()}function ee(e){const t=e.value,n=E?/[ ,\t]+/:/[,\t]+/,r=t.split(n),o=r[r.length-1]||"";r.length>1&&ie(r.slice(0,-1)),O(o),y(o)}function te(e){let t=!1;return X()&&de()&&(e(),t=!0),t}function ne(){const e=ue()-1;e>-1&&se(h[e])}function re(){const e=ue();e!function(e){return h.some((t=>le(e)===le(t)))}(e))))];if(t.length>0){const e=[...h];e.splice(ue(),0,...t),b(e)}}function ae(e){T(e)?(ie([e]),(0,lb.speak)(C.added,"assertive"),O(""),H(-1),$(!1),F(!S),L&&K()):(0,lb.speak)(C.__experimentalInvalid,"assertive")}function se(e){const t=h.filter((t=>le(t)!==le(e)));b(t),(0,lb.speak)(C.removed,"assertive")}function le(e){return"object"==typeof e?e.value:e}function ce(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:m,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:v,i=o(e);const a=[],s=[],l=n.map((e=>"string"==typeof e?e:e.value));return 0===i.length?t=t.filter((e=>!l.includes(e))):(i=i.toLocaleLowerCase(),t.forEach((e=>{const t=e.toLocaleLowerCase().indexOf(i);-1===l.indexOf(e)&&(0===t?a.push(e):t>0&&s.push(e))})),t=a.concat(s)),t.slice(0,r)}function ue(){return h.length-D}function de(){return 0===P.length}function fe(){return v(P).length>0}function pe(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=P.trim().length>1,n=ce(P),r=n.length>0,o=X()&&S;if(F(o||t&&r),e&&(I&&t&&r?(H(0),$(!0)):(H(-1),$(!1))),t){const e=r?(0,u.sprintf)((0,u._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",n.length),n.length):(0,u.__)("No results.");q(e,"assertive")}}function me(e,t,n){const r=le(e),o="string"!=typeof e?e.status:void 0,i=t+1,a=n.length;return(0,s.createElement)(jm,{key:"token-"+r},(0,s.createElement)(WP,{value:r,status:o,title:"string"!=typeof e?e.title:void 0,displayTransform:g,onClickRemove:Q,isBorderless:"string"!=typeof e&&e.isBorderless||x,onMouseEnter:"string"!=typeof e?e.onMouseEnter:void 0,onMouseLeave:"string"!=typeof e?e.onMouseLeave:void 0,disabled:"error"!==o&&_,messages:C,termsCount:a,termPosition:i}))}(0,s.useEffect)((()=>{L&&!X()&&K()}),[L]),(0,s.useEffect)((()=>{const e=!uf()(p,W||[]);(e||h!==U)&&pe(e)}),[p,W,h,U]),(0,s.useEffect)((()=>{pe()}),[P]),(0,s.useEffect)((()=>{pe()}),[I]),_&&L&&(z(!1),O(""));const he=c()(f,"components-form-token-field__input-container",{"is-active":L,"is-disabled":_});let ge={className:"components-form-token-field",tabIndex:-1};const ve=ce();return _||(ge=Object.assign({},ge,{onKeyDown:function(e){let t=!1;if(!e.defaultPrevented&&!e.nativeEvent.isComposing&&229!==e.keyCode){switch(e.key){case"Backspace":t=te(ne);break;case"Enter":t=oe();break;case"ArrowLeft":t=function(){let e=!1;return de()&&(A((e=>Math.min(e+1,h.length))),e=!0),e}();break;case"ArrowUp":H((e=>(0===e?ce(P,p,h,m,v).length:e)-1)),$(!0),t=!0;break;case"ArrowRight":t=function(){let e=!1;return de()&&(A((e=>Math.max(e-1,0))),e=!0),e}();break;case"ArrowDown":H((e=>(e+1)%ce(P,p,h,m,v).length)),$(!0),t=!0;break;case"Delete":t=te(re);break;case"Space":E&&(t=oe());break;case"Escape":t=function(e){return e.target instanceof HTMLInputElement&&(O(e.target.value),F(!1),H(-1),$(!1)),!0}(e)}t&&e.preventDefault()}},onKeyPress:function(e){let t=!1;","===e.key&&(fe()&&ae(P),t=!0);t&&e.preventDefault()},onFocus:function(e){X()||e.target===Y.current?(z(!0),F(S||B)):z(!1),"function"==typeof w&&w(e)}})),(0,s.createElement)("div",ge,(0,s.createElement)(_v,{htmlFor:`components-form-token-input-${M}`,className:"components-form-token-field__label"},l),(0,s.createElement)("div",{ref:Y,className:he,tabIndex:-1,onMouseDown:J,onTouchStart:J},(0,s.createElement)(GP,{justify:"flex-start",align:"center",gap:1,wrap:!0,__next36pxDefaultSize:R,hasTokens:!!h.length},function(){const e=h.map(me);return e.splice(ue(),0,function(){const e={instanceId:M,autoCapitalize:n,autoComplete:r,placeholder:0===h.length?i:"",key:"input",disabled:_,value:P,onBlur:Z,isExpanded:B,selectedSuggestionIndex:V};return(0,s.createElement)(eT,a({},e,{onChange:o&&h.length>=o?void 0:ee,ref:G}))}()),e}()),B&&(0,s.createElement)(oT,{instanceId:M,match:v(P),displayTransform:g,suggestions:ve,selectedIndex:V,scrollIntoView:j,onHover:function(e){const t=ce().indexOf(e);t>=0&&(H(t),$(!1))},onSelect:function(e){ae(e)},__experimentalRenderItem:k})),N&&(0,s.createElement)("p",{id:`components-form-token-suggestions-howto-${M}`,className:"components-form-token-field__help"},E?(0,u.__)("Separate with commas, spaces, or the Enter key."):(0,u.__)("Separate with commas or the Enter key.")))};const KP=e=>{let{isSelected:t}=e;return(0,s.createElement)(i.SVG,{width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(i.Circle,{cx:"4",cy:"4",r:"4",fill:t?"#419ECD":"#E1E3E6"}))};function XP(e){let{currentPage:t,numberOfPages:n,setCurrentPage:r}=e;return(0,s.createElement)("ul",{className:"components-guide__page-control","aria-label":(0,u.__)("Guide controls")},Array.from({length:n}).map(((e,o)=>(0,s.createElement)("li",{key:o,"aria-current":o===t?"step":void 0},(0,s.createElement)(rd,{key:o,icon:(0,s.createElement)(KP,{isSelected:o===t}),"aria-label":(0,u.sprintf)((0,u.__)("Page %1$d of %2$d"),o+1,n),onClick:()=>r(o)})))))}function ZP(e){let{children:t,className:n,contentLabel:r,finishButtonText:o,onFinish:i,pages:a=[]}=e;const l=(0,s.useRef)(),[d,f]=(0,s.useState)(0);(0,s.useEffect)((()=>{s.Children.count(t)&&Kl()("Passing children to ",{since:"5.5",alternative:"the `pages` prop"})}),[t]),(0,s.useEffect)((()=>{var e,t;l.current&&(null===(e=ES.focus.tabbable.find(l.current))||void 0===e||null===(t=e[0])||void 0===t||t.focus())}),[d]),s.Children.count(t)&&(a=s.Children.map(t,(e=>({content:e}))));const p=d>0,m=d{p&&f(d-1)},g=()=>{m&&f(d+1)};return 0===a.length?null:(0,s.createElement)(hT,{className:c()("components-guide",n),contentLabel:r,onRequestClose:i,onKeyDown:e=>{"ArrowLeft"===e.code?(h(),e.preventDefault()):"ArrowRight"===e.code&&(g(),e.preventDefault())},ref:l},(0,s.createElement)("div",{className:"components-guide__container"},(0,s.createElement)("div",{className:"components-guide__page"},a[d].image,a.length>1&&(0,s.createElement)(XP,{currentPage:d,numberOfPages:a.length,setCurrentPage:f}),a[d].content),(0,s.createElement)("div",{className:"components-guide__footer"},p&&(0,s.createElement)(rd,{className:"components-guide__back-button",onClick:h},(0,u.__)("Previous")),m&&(0,s.createElement)(rd,{className:"components-guide__forward-button",onClick:g},(0,u.__)("Next")),!m&&(0,s.createElement)(rd,{className:"components-guide__finish-button",onClick:i},o||(0,u.__)("Finish")))))}function JP(e){return(0,s.useEffect)((()=>{Kl()("",{since:"5.5",alternative:"the `pages` prop in "})}),[]),(0,s.createElement)("div",e)}var QP=(0,s.forwardRef)((function(e,t){let{label:n,labelPosition:r,size:o,tooltip:i,...l}=e;return Kl()("wp.components.IconButton",{since:"5.4",alternative:"wp.components.Button",version:"6.2"}),(0,s.createElement)(rd,a({},l,{ref:t,tooltipPosition:r,iconSize:o,showTooltip:void 0!==i?!!i:void 0,label:i||n}))}));var eO=Vu((function(e,t){const{role:n,wrapperClassName:r,...o}=function(e){const{as:t,className:n,onClick:r,role:o="listitem",size:i,...a}=Fu(e,"Item"),{spacedAround:l,size:c}=Wk(),u=i||c,d=t||(void 0!==r?"button":"div"),f=Bu(),p=(0,s.useMemo)((()=>f("button"===d&&Ik,jk[u]||jk.medium,Pk,l&&Lk,n)),[d,n,f,u,l]),m=f(Mk);return{as:d,className:p,onClick:r,wrapperClassName:m,role:o,...a}}(e);return(0,s.createElement)("div",{role:n,className:r},(0,s.createElement)(Qu,a({},o,{ref:t})))}),"Item");var tO=Vu((function(e,t){const n=Fu(e,"InputControlPrefixWrapper");return(0,s.createElement)(qv,a({marginBottom:0},n,{ref:t}))}),"InputControlPrefixWrapper");function nO(e){let{target:t,callback:n,shortcut:r,bindGlobal:o,eventName:i}=e;return(0,d.useKeyboardShortcut)(r,n,{bindGlobal:o,target:t,eventName:i}),null}var rO=function(e){let{children:t,shortcuts:n,bindGlobal:r,eventName:o}=e;const i=(0,s.useRef)(null),a=Object.entries(null!=n?n:{}).map((e=>{let[t,n]=e;return(0,s.createElement)(nO,{key:t,shortcut:t,callback:n,bindGlobal:r,eventName:o,target:i})}));return s.Children.count(t)?(0,s.createElement)("div",{ref:i},a,t):(0,s.createElement)(s.Fragment,null,a)};var oO=function e(t){const{children:n,className:r="",label:o,hideSeparator:i}=t,a=(0,d.useInstanceId)(e);if(!s.Children.count(n))return null;const l=`components-menu-group-label-${a}`,u=c()(r,"components-menu-group",{"has-hidden-separator":i});return(0,s.createElement)("div",{className:u},o&&(0,s.createElement)("div",{className:"components-menu-group__label",id:l,"aria-hidden":"true"},o),(0,s.createElement)("div",{role:"group","aria-labelledby":o?l:void 0},n))};var iO=(0,s.forwardRef)((function(e,t){let{children:n,info:r,className:o,icon:i,iconPosition:l="right",shortcut:u,isSelected:d,role:f="menuitem",suffix:p,...m}=e;return o=c()("components-menu-item__button",o),r&&(n=(0,s.createElement)("span",{className:"components-menu-item__info-wrapper"},(0,s.createElement)("span",{className:"components-menu-item__item"},n),(0,s.createElement)("span",{className:"components-menu-item__info"},r))),i&&"string"!=typeof i&&(i=(0,s.cloneElement)(i,{className:c()("components-menu-items__item-icon",{"has-icon-right":"right"===l})})),(0,s.createElement)(rd,a({ref:t,"aria-checked":"menuitemcheckbox"===f||"menuitemradio"===f?d:void 0,role:f,icon:"left"===l?i:void 0,className:o},m),(0,s.createElement)("span",{className:"components-menu-item__item"},n),!p&&(0,s.createElement)(Mf,{className:"components-menu-item__shortcut",shortcut:u}),!p&&i&&"right"===l&&(0,s.createElement)(Zl,{icon:i}),p)}));const aO=()=>{};function sO(e){let{choices:t=[],onHover:n=aO,onSelect:r,value:o}=e;return t.map((e=>{const t=o===e.value;return(0,s.createElement)(iO,{key:e.value,role:"menuitemradio",icon:t&&F_,info:e.info,isSelected:t,shortcut:e.shortcut,className:"components-menu-items-choice",onClick:()=>{t||r(e.value)},onMouseEnter:()=>n(e.value),onMouseLeave:()=>n(null),"aria-label":e["aria-label"]},e.label)}))}var lO=(0,s.forwardRef)((function(e,t){let{eventToOffset:n,...r}=e;return(0,s.createElement)(NS,a({ref:t,stopNavigationEvents:!0,onlyBrowserTabstops:!0,eventToOffset:e=>{const{code:t,shiftKey:r}=e;return"Tab"===t?r?-1:1:n?n(e):void 0}},r))}));const cO="root",uO=()=>{},dO=(0,s.createContext)({activeItem:void 0,activeMenu:cO,setActiveMenu:uO,isMenuEmpty:uO,navigationTree:{items:{},getItem:uO,addItem:uO,removeItem:uO,menus:{},getMenu:uO,addMenu:uO,removeMenu:uO,childMenu:{},traverseMenu:uO,isMenuEmpty:uO}}),fO=()=>(0,s.useContext)(dO);var pO=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));const mO=(0,s.forwardRef)((function(e,t){let{__nextHasNoMarginBottom:n,className:r,onChange:o,onKeyDown:i,value:l,label:f,placeholder:p=(0,u.__)("Search"),hideLabelFromVision:m=!0,help:h,onClose:g,...v}=e;const b=(0,s.useRef)(),y=`components-search-control-${(0,d.useInstanceId)(mO)}`;return(0,s.createElement)(Tv,{__nextHasNoMarginBottom:n,label:f,id:y,hideLabelFromVision:m,help:h,className:c()(r,"components-search-control")},(0,s.createElement)("div",{className:"components-search-control__input-wrapper"},(0,s.createElement)("input",a({},v,{ref:(0,d.useMergeRefs)([b,t]),className:"components-search-control__input",id:y,type:"search",placeholder:p,onChange:e=>o(e.target.value),onKeyDown:i,autoComplete:"off",value:l||""})),(0,s.createElement)("div",{className:"components-search-control__icon"},g?(0,s.createElement)(rd,{icon:Nb,label:(0,u.__)("Close search"),onClick:g}):l?(0,s.createElement)(rd,{icon:Nb,label:(0,u.__)("Reset search"),onClick:()=>{var e;o(""),null===(e=b.current)||void 0===e||e.focus()}}):(0,s.createElement)(ay,{icon:pO}))))}));var hO=mO;const gO=Zu("div",{target:"ejwewyf11"})("width:100%;box-sizing:border-box;padding:0 ",qm(4),";overflow:hidden;"),vO=Zu("div",{target:"ejwewyf10"})("margin-top:",qm(6),";margin-bottom:",qm(6),";display:flex;flex-direction:column;ul{padding:0;margin:0;list-style:none;}.components-navigation__back-button{margin-bottom:",qm(6),";}.components-navigation__group+.components-navigation__group{margin-top:",qm(6),";}"),bO=Zu(rd,{target:"ejwewyf9"})({name:"26l0q2",styles:"&.is-tertiary{color:inherit;opacity:0.7;&:hover:not( :disabled ){opacity:1;box-shadow:none;color:inherit;}&:active:not( :disabled ){background:transparent;opacity:1;color:inherit;}}"}),yO=Zu("div",{target:"ejwewyf8"})({name:"1aubja5",styles:"overflow:hidden;width:100%"}),wO=Zu("span",{target:"ejwewyf7"})("height:",qm(6),";.components-button.is-small{color:inherit;opacity:0.7;margin-right:",qm(1),";padding:0;&:active:not( :disabled ){background:none;opacity:1;color:inherit;}&:hover:not( :disabled ){box-shadow:none;opacity:1;color:inherit;}}"),xO=Zu(hO,{target:"ejwewyf6"})({name:"za3n3e",styles:"input[type='search'].components-search-control__input{margin:0;background:#303030;color:#fff;&:focus{background:#434343;color:#fff;}&::placeholder{color:rgba( 255, 255, 255, 0.6 );}}svg{fill:white;}.components-button.has-icon{padding:0;min-width:auto;}"}),_O=Zu($_,{target:"ejwewyf5"})("min-height:",qm(12),";align-items:center;color:inherit;display:flex;justify-content:space-between;margin-bottom:",qm(2),";padding:",(()=>(0,u.isRTL)()?`${qm(1)} ${qm(4)} ${qm(1)} ${qm(2)}`:`${qm(1)} ${qm(2)} ${qm(1)} ${qm(4)}`),";"),EO=Zu("li",{target:"ejwewyf4"})("border-radius:2px;color:inherit;margin-bottom:0;>button,>a.components-button,>a{width:100%;color:inherit;opacity:0.7;padding:",qm(2)," ",qm(4),";",zh({textAlign:"left"},{textAlign:"right"})," &:hover,&:focus:not( [aria-disabled='true'] ):active,&:active:not( [aria-disabled='true'] ):active{color:inherit;opacity:1;}}&.is-active{background-color:",kp.ui.theme,";color:",kp.white,";>button,>a{color:",kp.white,";opacity:1;}}>svg path{color:",kp.gray[600],";}"),CO=Zu("div",{target:"ejwewyf3"})("display:flex;align-items:center;height:auto;min-height:40px;margin:0;padding:",qm(1.5)," ",qm(4),";font-weight:400;line-height:20px;width:100%;color:inherit;opacity:0.7;"),kO=Zu("span",{target:"ejwewyf2"})("display:flex;margin-right:",qm(2),";"),SO=Zu("span",{target:"ejwewyf1"})("margin-left:",(()=>(0,u.isRTL)()?"0":qm(2)),";margin-right:",(()=>(0,u.isRTL)()?qm(2):"0"),";display:inline-flex;padding:",qm(1)," ",qm(3),";border-radius:2px;animation:fade-in 250ms ease-out;@keyframes fade-in{from{opacity:0;}to{opacity:1;}}",Sp("animation"),";"),TO=Zu(Rh,{target:"ejwewyf0"})((()=>(0,u.isRTL)()?"margin-left: auto;":"margin-right: auto;")," font-size:14px;line-height:20px;color:inherit;"),NO=()=>{const[e,t]=(0,s.useState)({});return{nodes:e,getNode:t=>e[t],addNode:(e,n)=>{const{children:r,...o}=n;return t((t=>({...t,[e]:o})))},removeNode:e=>t((t=>{const{[e]:n,...r}=t;return r}))}},RO=()=>{};function IO(e){let{activeItem:t,activeMenu:n=cO,children:r,className:o,onActivateMenu:i=RO}=e;const[a,l]=(0,s.useState)(n),[d,f]=(0,s.useState)(),p=(()=>{const{nodes:e,getNode:t,addNode:n,removeNode:r}=NO(),{nodes:o,getNode:i,addNode:a,removeNode:l}=NO(),[c,u]=(0,s.useState)({}),d=e=>c[e]||[],f=(e,t)=>{const n=[];let r,o=[e];for(;o.length>0&&(r=i(o.shift()),!r||n.includes(r.menu)||(n.push(r.menu),o=[...o,...d(r.menu)],!1!==t(r))););};return{items:e,getItem:t,addItem:n,removeItem:r,menus:o,getMenu:i,addMenu:(e,t)=>{u((n=>{const r={...n};return r[t.parentMenu]||(r[t.parentMenu]=[]),r[t.parentMenu].push(e),r})),a(e,t)},removeMenu:l,childMenu:c,traverseMenu:f,isMenuEmpty:e=>{let t=!0;return f(e,(e=>{if(!e.isEmpty)return t=!1,!1})),t}}})(),m=(0,u.isRTL)()?"right":"left",h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m;p.getMenu(e)&&(f(t),l(e),i(e))},g=(0,s.useRef)(!1);(0,s.useEffect)((()=>{g.current||(g.current=!0)}),[]),(0,s.useEffect)((()=>{n!==a&&h(n)}),[n]);const v={activeItem:t,activeMenu:a,setActiveMenu:h,navigationTree:p},b=c()("components-navigation",o),y=km({type:"slide-in",origin:d});return(0,s.createElement)(gO,{className:b},(0,s.createElement)("div",{key:a,className:c()({[y]:g.current&&d})},(0,s.createElement)(dO.Provider,{value:v},r)))}var MO=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));var PO=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var OO=(0,s.forwardRef)((function(e,t){var n;let{backButtonLabel:r,className:o,href:i,onClick:a,parentMenu:l}=e;const{setActiveMenu:d,navigationTree:f}=fO(),p=c()("components-navigation__back-button",o),m=null===(n=f.getMenu(l))||void 0===n?void 0:n.title,h=(0,u.isRTL)()?MO:PO;return(0,s.createElement)(bO,{className:p,href:i,variant:"tertiary",ref:t,onClick:e=>{"function"==typeof a&&a(e);const t=(0,u.isRTL)()?"left":"right";l&&!e.defaultPrevented&&d(l,t)}},(0,s.createElement)(ay,{icon:h}),r||m||(0,u.__)("Back"))}));const DO=(0,s.createContext)({group:void 0});let AO=0;function LO(e){let{children:t,className:n,title:r}=e;const[o]=(0,s.useState)("group-"+ ++AO),{navigationTree:{items:i}}=fO(),a={group:o};if(!Object.values(i).some((e=>e.group===o&&e._isVisible)))return(0,s.createElement)(DO.Provider,{value:a},t);const l=`components-navigation__group-title-${o}`,u=c()("components-navigation__group",n);return(0,s.createElement)(DO.Provider,{value:a},(0,s.createElement)("li",{className:u},r&&(0,s.createElement)(_O,{className:"components-navigation__group-title",id:l,level:3},r),(0,s.createElement)("ul",{"aria-labelledby":l,role:"group"},t)))}function zO(e){const{badge:t,title:n}=e;return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(TO,{className:"components-navigation__item-title",variant:"body.small",as:"span"},n),t&&(0,s.createElement)(SO,{className:"components-navigation__item-badge"},t))}const BO=(0,s.createContext)({menu:void 0,search:""}),FO=()=>(0,s.useContext)(BO),VO=e=>ab()(e).replace(/^\//,"").toLowerCase(),HO=(e,t)=>{const{activeMenu:n,navigationTree:{addItem:r,removeItem:o}}=fO(),{group:i}=(0,s.useContext)(DO),{menu:a,search:l}=FO();(0,s.useEffect)((()=>{const s=n===a,c=!l||((e,t)=>-1!==VO(e).indexOf(VO(t)))(t.title,l);return r(e,{...t,group:i,menu:a,_isVisible:s&&c}),()=>{o(e)}}),[n,l])};let jO=0;function $O(e){var t;const{children:n,className:r,title:o,href:i,...l}=e,[u]=(0,s.useState)("item-"+ ++jO);HO(u,e);const{navigationTree:d}=fO();if(null===(t=d.getItem(u))||void 0===t||!t._isVisible)return null;const f=c()("components-navigation__item",r);return(0,s.createElement)(EO,a({className:f},l),n)}const WO=()=>{};function UO(e){const{badge:t,children:n,className:r,href:o,item:i,navigateToMenu:l,onClick:d=WO,title:f,icon:p,hideIfTargetMenuEmpty:m,isText:h,...g}=e,{activeItem:v,setActiveMenu:b,navigationTree:{isMenuEmpty:y}}=fO();if(m&&l&&y(l))return null;const w=i&&v===i,x=c()(r,{"is-active":w}),_=(0,u.isRTL)()?PO:MO,E=n?e:{...e,onClick:void 0},C=h?g:{as:rd,href:o,onClick:e=>{l&&b(l),d(e)},"aria-current":w?"page":void 0,...g};return(0,s.createElement)($O,a({},E,{className:x}),n||(0,s.createElement)(CO,C,p&&(0,s.createElement)(kO,null,(0,s.createElement)(ay,{icon:p})),(0,s.createElement)(zO,{title:f,badge:t}),l&&(0,s.createElement)(ay,{icon:_})))}var GO=(0,d.createHigherOrderComponent)((e=>t=>(0,s.createElement)(e,a({},t,{speak:lb.speak,debouncedSpeak:(0,d.useDebounce)(lb.speak,500)}))),"withSpokenMessages");var YO=GO((function(e){let{debouncedSpeak:t,onCloseSearch:n,onSearch:r,search:o,title:i}=e;const{navigationTree:{items:a}}=fO(),{menu:l}=FO(),c=(0,s.useRef)();(0,s.useEffect)((()=>{const e=setTimeout((()=>{c.current.focus()}),100);return()=>{clearTimeout(e)}}),[]),(0,s.useEffect)((()=>{if(!o)return;const e=Object.values(a).filter((e=>e._isVisible)).length,n=(0,u.sprintf)((0,u._n)("%d result found.","%d results found.",e),e);t(n)}),[a,o]);const d=()=>{r(""),n()},f=`components-navigation__menu-title-search-${l}`,p=(0,u.sprintf)((0,u.__)("Search %s"),null==i?void 0:i.toLowerCase()).trim();return(0,s.createElement)("div",{className:"components-navigation__menu-title-search"},(0,s.createElement)(xO,{autoComplete:"off",className:"components-navigation__menu-search-input",id:f,onChange:e=>r(e),onKeyDown:function(e){"Escape"!==e.code||e.defaultPrevented||(e.preventDefault(),d())},placeholder:p,onClose:d,ref:c,type:"search",value:o}))}));function qO(e){let{hasSearch:t,onSearch:n,search:r,title:o,titleAction:i}=e;const[a,l]=(0,s.useState)(!1),{menu:c}=FO(),d=(0,s.useRef)();if(!o)return null;const f=`components-navigation__menu-title-${c}`,p=(0,u.sprintf)((0,u.__)("Search in %s"),o);return(0,s.createElement)(yO,{className:"components-navigation__menu-title"},!a&&(0,s.createElement)(_O,{as:"h2",className:"components-navigation__menu-title-heading",level:3},(0,s.createElement)("span",{id:f},o),(t||i)&&(0,s.createElement)(wO,null,i,t&&(0,s.createElement)(rd,{isSmall:!0,variant:"tertiary",label:p,onClick:()=>l(!0),ref:d},(0,s.createElement)(ay,{icon:pO})))),a&&(0,s.createElement)("div",{className:km({type:"slide-in",origin:"left"})},(0,s.createElement)(YO,{onCloseSearch:()=>{l(!1),setTimeout((()=>{d.current.focus()}),100)},onSearch:n,search:r,title:o})))}function KO(e){let{search:t}=e;const{navigationTree:{items:n}}=fO(),r=Object.values(n).filter((e=>e._isVisible)).length;return!t||r?null:(0,s.createElement)(EO,null,(0,s.createElement)(CO,null,(0,u.__)("No results found.")," "))}function XO(e){const{backButtonLabel:t,children:n,className:r,hasSearch:o,menu:i=cO,onBackButtonClick:a,onSearch:l,parentMenu:u,search:d,isSearchDebouncing:f,title:p,titleAction:m}=e,[h,g]=(0,s.useState)("");(e=>{const{navigationTree:{addMenu:t,removeMenu:n}}=fO(),r=e.menu||cO;(0,s.useEffect)((()=>(t(r,{...e,menu:r}),()=>{n(r)})),[])})(e);const{activeMenu:v}=fO(),b={menu:i,search:h};if(v!==i)return(0,s.createElement)(BO.Provider,{value:b},n);const y=!!l,w=y?d:h,x=y?l:g,_=`components-navigation__menu-title-${i}`,E=c()("components-navigation__menu",r);return(0,s.createElement)(BO.Provider,{value:b},(0,s.createElement)(vO,{className:E},(u||a)&&(0,s.createElement)(OO,{backButtonLabel:t,parentMenu:u,onClick:a}),p&&(0,s.createElement)(qO,{hasSearch:o,onSearch:x,search:w,title:p,titleAction:m}),(0,s.createElement)(RS,null,(0,s.createElement)("ul",{"aria-labelledby":_},n,w&&!f&&(0,s.createElement)(KO,{search:w})))))}const ZO=(0,s.createContext)({location:{},goTo:()=>{},goBack:()=>{},goToParent:()=>{},addScreen:()=>{},removeScreen:()=>{},params:{}});function JO(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||95===l))break;a+=e[s++]}if(!a)throw new TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:a}),n=s}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),r=t.prefixes,o=void 0===r?"./":r,i="[^".concat(eD(t.delimiter||"/#?"),"]+?"),a=[],s=0,l=0,c="",u=function(e){if(l-1:void 0===E;o||(g+="(?:".concat(h,"(?=").concat(m,"))?")),C||(g+="(?=".concat(h,"|").concat(m,")"))}return new RegExp(g,tD(n))}(JO(e,n),t,n)}function rD(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,o=n.exec(e.source);o;)t.push({name:o[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),o=n.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,n){var r=e.map((function(e){return rD(e,t,n).source}));return new RegExp("(?:".concat(r.join("|"),")"),tD(n))}(e,t,n):nD(e,t,n)}function oD(e,t){return QO(t,{decode:decodeURIComponent})(e)}function iD(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"add":return[...e,t.screen];case"remove":return e.filter((e=>e.id!==t.screen.id))}return e}var aD={name:"15bx5k",styles:"overflow-x:hidden"};const sD=Vu((function(e,t){const{initialPath:n,children:r,className:o,...i}=Fu(e,"NavigatorProvider"),[l,c]=(0,s.useState)([{path:n}]),u=(0,s.useRef)([]),[d,f]=(0,s.useReducer)(iD,[]),p=(0,s.useRef)([]);(0,s.useEffect)((()=>{p.current=d}),[d]),(0,s.useEffect)((()=>{u.current=l}),[l]);const m=(0,s.useRef)(),h=(0,s.useMemo)((()=>{let e;if(0===l.length||void 0===(e=l[l.length-1].path))return void(m.current=void 0);const t=(e=>{const t=function(e,t){for(const n of t){const t=oD(e,n.path);if(t)return{params:t.params,id:n.id}}}(e,d);return m.current&&t&&uf()(t.params,m.current.params)&&t.id===m.current.id?m.current:t})(e);return m.current=t,t}),[d,l]),g=(0,s.useCallback)((e=>f({type:"add",screen:e})),[]),v=(0,s.useCallback)((e=>f({type:"remove",screen:e})),[]),b=(0,s.useCallback)((()=>{c((e=>e.length<=1?e:[...e.slice(0,-2),{...e[e.length-2],isBack:!0,hasRestoredFocus:!1}]))}),[]),y=(0,s.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{focusTargetSelector:n,isBack:r=!1,...o}=t,i=r&&u.current.length>1&&u.current[u.current.length-2].path===e;i?b():c((t=>{const i={...o,path:e,isBack:r,hasRestoredFocus:!1};return t.length<1?[i]:[...t.slice(t.length>49?1:0,-1),{...t[t.length-1],focusTargetSelector:n},i]}))}),[b]),w=(0,s.useCallback)((()=>{const e=u.current[u.current.length-1].path;if(void 0===e)return;const t=function(e,t){if(!e.startsWith("/"))return;const n=e.split("/");let r;for(;n.length>1&&void 0===r;){n.pop();const e=""===n.join("/")?"/":n.join("/");t.find((t=>!1!==oD(e,t.path)))&&(r=e)}return r}(e,p.current);void 0!==t&&y(t,{isBack:!0})}),[y]),x=(0,s.useMemo)((()=>({location:{...l[l.length-1],isInitial:1===l.length},params:h?h.params:{},match:h?h.id:void 0,goTo:y,goBack:b,goToParent:w,addScreen:g,removeScreen:v})),[l,h,y,b,w,g,v]),_=Bu(),E=(0,s.useMemo)((()=>_(aD,o)),[o,_]);return(0,s.createElement)(Qu,a({ref:t,className:E},i),(0,s.createElement)(ZO.Provider,{value:x},r))}),"NavigatorProvider");var lD=sD,cD=window.wp.escapeHtml;var uD={name:"14x3t6z",styles:"overflow-x:auto;max-height:100%"};const dD=Vu((function(e,t){const n=(0,s.useId)(),{children:r,className:o,path:i,...l}=Fu(e,"NavigatorScreen"),c=(0,d.useReducedMotion)(),{location:f,match:p,addScreen:m,removeScreen:h}=(0,s.useContext)(ZO),g=p===n,v=(0,s.useRef)(null);(0,s.useEffect)((()=>{const e={id:n,path:(0,cD.escapeAttribute)(i)};return m(e),()=>h(e)}),[n,i,m,h]);const b=Bu(),y=(0,s.useMemo)((()=>b(uD,o)),[o,b]),w=(0,s.useRef)(f);(0,s.useEffect)((()=>{w.current=f}),[f]);const x=f.isInitial&&!f.isBack;(0,s.useEffect)((()=>{if(x||!g||!v.current||w.current.hasRestoredFocus)return;const e=v.current.ownerDocument.activeElement;if(v.current.contains(e))return;let t=null;if(f.isBack&&null!=f&&f.focusTargetSelector&&(t=v.current.querySelector(f.focusTargetSelector)),!t){const e=ES.focus.tabbable.find(v.current)[0];t=null!=e?e:v.current}w.current.hasRestoredFocus=!0,t.focus()}),[x,g,f.isBack,f.focusTargetSelector]);const _=(0,d.useMergeRefs)([t,v]);if(!g)return null;if(c)return(0,s.createElement)(Qu,a({ref:_,className:y},l),r);const E={opacity:1,transition:{delay:0,duration:.14,ease:"easeInOut"},x:0},C={opacity:0,x:(0,u.isRTL)()&&f.isBack||!(0,u.isRTL)()&&!f.isBack?50:-50},k={animate:E,exit:{delay:0,opacity:0,x:!(0,u.isRTL)()&&f.isBack||(0,u.isRTL)()&&!f.isBack?50:-50,transition:{duration:.14,ease:"easeInOut"}},initial:C};return(0,s.createElement)(Gl.div,a({ref:_,className:y},l,k),r)}),"NavigatorScreen");var fD=dD;var pD=function(){const{location:e,params:t,goTo:n,goBack:r,goToParent:o}=(0,s.useContext)(ZO);return{location:e,goTo:n,goBack:r,goToParent:o,params:t}};var mD=Vu((function(e,t){const n=function(e){const{path:t,onClick:n,as:r=rd,attributeName:o="id",...i}=Fu(e,"NavigatorButton"),a=(0,cD.escapeAttribute)(t),{goTo:l}=pD();return{as:r,onClick:(0,s.useCallback)((e=>{var t,r;e.preventDefault(),l(a,{focusTargetSelector:(t=o,r=a,`[${t}="${r}"]`)}),null==n||n(e)}),[l,n,o,a]),...i,[o]:a}}(e);return(0,s.createElement)(Qu,a({ref:t},n))}),"NavigatorButton");function hD(e){const{onClick:t,as:n=rd,goToParent:r=!1,...o}=Fu(e,"NavigatorBackButton"),{goBack:i,goToParent:a}=pD();return{as:n,onClick:(0,s.useCallback)((e=>{e.preventDefault(),r?a():i(),null==t||t(e)}),[r,a,i,t]),...o}}var gD=Vu((function(e,t){const n=hD(e);return(0,s.createElement)(Qu,a({ref:t},n))}),"NavigatorBackButton");var vD=Vu((function(e,t){const n=hD({...e,goToParent:!0});return(0,s.createElement)(Qu,a({ref:t},n))}),"NavigatorToParentButton");const bD=()=>{};function yD(e){switch(e){case"success":case"warning":case"info":return"polite";default:return"assertive"}}var wD=function(e){let{className:t,status:n="info",children:r,spokenMessage:o=r,onRemove:i=bD,isDismissible:a=!0,actions:l=[],politeness:d=yD(n),__unstableHTML:f,onDismiss:p=bD}=e;!function(e,t){const n="string"==typeof e?e:(0,s.renderToString)(e);(0,s.useEffect)((()=>{n&&(0,lb.speak)(n,t)}),[n,t])}(o,d);const m=c()(t,"components-notice","is-"+n,{"is-dismissible":a});return f&&"string"==typeof r&&(r=(0,s.createElement)(s.RawHTML,null,r)),(0,s.createElement)("div",{className:m},(0,s.createElement)("div",{className:"components-notice__content"},r,(0,s.createElement)("div",{className:"components-notice__actions"},l.map(((e,t)=>{let{className:n,label:r,isPrimary:o,variant:i,noDefaultClasses:a=!1,onClick:l,url:u}=e,d=i;return"primary"===i||a||(d=u?"link":"secondary"),void 0===d&&o&&(d="primary"),(0,s.createElement)(rd,{key:t,href:u,variant:d,onClick:u?void 0:l,className:c()("components-notice__action",n)},r)})))),a&&(0,s.createElement)(rd,{className:"components-notice__dismiss",icon:Yl,label:(0,u.__)("Dismiss this notice"),onClick:e=>{var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),p(),i()},showTooltip:!1}))};const xD=()=>{};var _D=function(e){let{notices:t,onRemove:n=xD,className:r,children:o}=e;const i=e=>()=>n(e);return r=c()("components-notice-list",r),(0,s.createElement)("div",{className:r},o,[...t].reverse().map((e=>{const{content:t,...n}=e;return(0,s.createElement)(wD,a({},n,{key:e.id,onRemove:i(e.id)}),e.content)})))};var ED=function(e){let{label:t,children:n}=e;return(0,s.createElement)("div",{className:"components-panel__header"},t&&(0,s.createElement)("h2",null,t),n)};var CD=(0,s.forwardRef)((function(e,t){let{header:n,className:r,children:o}=e;const i=c()(r,"components-panel");return(0,s.createElement)("div",{className:i,ref:t},n&&(0,s.createElement)(ED,{label:n}),o)}));var kD=(0,s.createElement)(i.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(i.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));const SD=()=>{};const TD=(0,s.forwardRef)(((e,t)=>{let{isOpened:n,icon:r,title:o,...i}=e;return o?(0,s.createElement)("h2",{className:"components-panel__body-title"},(0,s.createElement)(rd,a({className:"components-panel__body-toggle","aria-expanded":n,ref:t},i),(0,s.createElement)("span",{"aria-hidden":"true"},(0,s.createElement)(Zl,{className:"components-panel__arrow",icon:n?kD:sy})),o,r&&(0,s.createElement)(Zl,{icon:r,className:"components-panel__icon",size:20}))):null})),ND=(0,s.forwardRef)((function(e,t){let{buttonProps:n={},children:r,className:o,icon:i,initialOpen:l,onToggle:u=SD,opened:f,title:p,scrollAfterOpen:m=!0}=e;const[h,g]=py(f,{initial:void 0===l||l}),v=(0,s.useRef)(),b=(0,d.useReducedMotion)()?"auto":"smooth",y=(0,s.useRef)();y.current=m,tc((()=>{var e;h&&y.current&&null!==(e=v.current)&&void 0!==e&&e.scrollIntoView&&v.current.scrollIntoView({inline:"nearest",block:"nearest",behavior:b})}),[h,b]);const w=c()("components-panel__body",o,{"is-opened":h});return(0,s.createElement)("div",{className:w,ref:(0,d.useMergeRefs)([v,t])},(0,s.createElement)(TD,a({icon:i,isOpened:h,onClick:e=>{e.preventDefault();const t=!h;g(t),u(t)},title:p},n)),"function"==typeof r?r({opened:h}):h&&r)}));ND.displayName="PanelBody";var RD=ND;var ID=(0,s.forwardRef)(((e,t)=>{let{className:n,children:r}=e;return(0,s.createElement)("div",{className:c()("components-panel__row",n),ref:t},r)}));const MD=(0,s.createElement)(i.SVG,{className:"components-placeholder__illustration",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",preserveAspectRatio:"none"},(0,s.createElement)(i.Path,{vectorEffect:"non-scaling-stroke",d:"M60 60 0 0"}));var PD=function(e){const{icon:t,children:n,label:r,instructions:o,className:i,notices:l,preview:u,isColumnLayout:f,withIllustration:p,...m}=e,[h,{width:g}]=(0,d.useResizeObserver)();let v;"number"==typeof g&&(v={"is-large":g>=480,"is-medium":g>=160&&g<480,"is-small":g<160});const b=c()("components-placeholder",i,v,p?"has-illustration":null),y=c()("components-placeholder__fieldset",{"is-column-layout":f});return(0,s.createElement)("div",a({},m,{className:b}),p?MD:null,h,l,u&&(0,s.createElement)("div",{className:"components-placeholder__preview"},u),(0,s.createElement)("div",{className:"components-placeholder__label"},(0,s.createElement)(Zl,{icon:t}),r),(0,s.createElement)("fieldset",{className:y},!!o&&(0,s.createElement)("legend",{className:"components-placeholder__instructions"},o),n))};function OD(e){const t=e.map((e=>({children:[],parent:null,...e,id:String(e.id)}))),n=(0,ec.groupBy)(t,"parent");if(n.null&&n.null.length)return t;const r=e=>e.map((e=>{const t=n[e.id];return{...e,children:t&&t.length?r(t):[]}}));return r(n[0]||[])}var DD=window.wp.htmlEntities;function AD(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.flatMap((e=>[{value:e.id,label:" ".repeat(3*t)+(0,DD.decodeEntities)(e.name)},...AD(e.children||[],t+1)]))}var LD=function(e){let{label:t,noOptionLabel:n,onChange:r,selectedId:o,tree:i=[],...l}=e;const c=(0,s.useMemo)((()=>[n&&{value:"",label:n},...AD(i)].filter((e=>!!e))),[n,i]);return(0,s.createElement)(uy,a({label:t,options:c,onChange:r,value:o},l))};function zD(e){let{label:t,noOptionLabel:n,authorList:r,selectedAuthorId:o,onChange:i}=e;if(!r)return null;const a=OD(r);return(0,s.createElement)(LD,{label:t,noOptionLabel:n,onChange:i,tree:a,selectedId:void 0!==o?String(o):void 0})}function BD(e){let{label:t,noOptionLabel:n,categoriesList:r,selectedCategoryId:o,onChange:i,...l}=e;const c=(0,s.useMemo)((()=>OD(r)),[r]);return(0,s.createElement)(LD,a({label:t,noOptionLabel:n,onChange:i,tree:c,selectedId:void 0!==o?String(o):void 0},l))}const FD=1,VD=100;function HD(e){return"categoriesList"in e}function jD(e){return"categorySuggestions"in e}var $D=function(e){let{authorList:t,selectedAuthorId:n,numberOfItems:r,order:o,orderBy:i,maxItems:a=VD,minItems:l=FD,onAuthorChange:c,onNumberOfItemsChange:d,onOrderChange:f,onOrderByChange:p,...m}=e;return(0,s.createElement)(s.Fragment,null,[f&&p&&(0,s.createElement)(dy,{__nextHasNoMarginBottom:!0,key:"query-controls-order-select",label:(0,u.__)("Order by"),value:`${i}/${o}`,options:[{label:(0,u.__)("Newest to oldest"),value:"date/desc"},{label:(0,u.__)("Oldest to newest"),value:"date/asc"},{label:(0,u.__)("A → Z"),value:"title/asc"},{label:(0,u.__)("Z → A"),value:"title/desc"}],onChange:e=>{if("string"!=typeof e)return;const[t,n]=e.split("/");n!==o&&f(n),t!==i&&p(t)}}),HD(m)&&m.categoriesList&&m.onCategoryChange&&(0,s.createElement)(BD,{key:"query-controls-category-select",categoriesList:m.categoriesList,label:(0,u.__)("Category"),noOptionLabel:(0,u.__)("All"),selectedCategoryId:m.selectedCategoryId,onChange:m.onCategoryChange}),jD(m)&&m.categorySuggestions&&m.onCategoryChange&&(0,s.createElement)(qP,{key:"query-controls-categories-select",label:(0,u.__)("Categories"),value:m.selectedCategories&&m.selectedCategories.map((e=>({id:e.id,value:e.name||e.value}))),suggestions:Object.keys(m.categorySuggestions),onChange:m.onCategoryChange,maxSuggestions:20}),c&&(0,s.createElement)(zD,{key:"query-controls-author-select",authorList:t,label:(0,u.__)("Author"),noOptionLabel:(0,u.__)("All"),selectedAuthorId:n,onChange:c}),d&&(0,s.createElement)(jy,{__nextHasNoMarginBottom:!0,key:"query-controls-range-control",label:(0,u.__)("Number of items"),value:r,onChange:d,min:l,max:a,required:!0})])};var WD=(0,s.createContext)({state:null,setState:()=>{}});var UD=(0,s.forwardRef)((function(e,t){let{children:n,value:r,...o}=e;const i=(0,s.useContext)(WD),l=i.state===r;return(0,s.createElement)(xP,a({ref:t,as:rd,variant:l?"primary":"secondary",value:r},i,o),n||r)}));var GD=(0,s.forwardRef)((function(e,t){let{label:n,checked:r,defaultChecked:o,disabled:i,onChange:l,...c}=e;const u=aP({state:o,baseId:c.id}),d={...u,disabled:i,state:null!=r?r:u.state,setState:null!=l?l:u.setState};return(0,s.createElement)(WD.Provider,{value:d},(0,s.createElement)(cP,a({ref:t,as:NC,"aria-label":n},u,c)))}));var YD=function e(t){const{label:n,className:r,selected:o,help:i,onChange:l,hideLabelFromVision:u,options:f=[],...p}=t,m=`inspector-radio-control-${(0,d.useInstanceId)(e)}`,h=e=>l(e.target.value);return null!=f&&f.length?(0,s.createElement)(Tv,{__nextHasNoMarginBottom:!0,label:n,id:m,hideLabelFromVision:u,help:i,className:c()(r,"components-radio-control")},(0,s.createElement)(H_,{spacing:1},f.map(((e,t)=>(0,s.createElement)("div",{key:`${m}-${t}`,className:"components-radio-control__option"},(0,s.createElement)("input",a({id:`${m}-${t}`,className:"components-radio-control__input",type:"radio",name:m,value:e.value,onChange:h,checked:e.value===o,"aria-describedby":i?`${m}__help`:void 0},p)),(0,s.createElement)("label",{htmlFor:`${m}-${t}`},e.label)))))):null},qD=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),KD=function(){return KD=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{},hA={bottom:"bottom",corner:"corner"};function gA(e){let{axis:t,fadeTimeout:n=180,onResize:r=mA,position:o=hA.bottom,showPx:i=!1}=e;const[a,l]=(0,d.useResizeObserver)(),c=!!t,[u,f]=(0,s.useState)(!1),[p,m]=(0,s.useState)(!1),{width:h,height:g}=l,v=(0,s.useRef)(g),b=(0,s.useRef)(h),y=(0,s.useRef)(),w=(0,s.useCallback)((()=>{y.current&&window.clearTimeout(y.current),y.current=window.setTimeout((()=>{c||(f(!1),m(!1))}),n)}),[n,c]);(0,s.useEffect)((()=>{if(!(null!==h||null!==g))return;const e=h!==b.current,t=g!==v.current;if(e||t){if(h&&!b.current&&g&&!v.current)return b.current=h,void(v.current=g);e&&(f(!0),b.current=h),t&&(m(!0),v.current=g),r({width:h,height:g}),w()}}),[h,g,r,w]);const x=function(e){let{axis:t,height:n,moveX:r=!1,moveY:o=!1,position:i=hA.bottom,showPx:a=!1,width:s}=e;if(!r&&!o)return;if(i===hA.corner)return`${s} x ${n}`;const l=a?" px":"";if(t){if("x"===t&&r)return`${s}${l}`;if("y"===t&&o)return`${n}${l}`}if(r&&o)return`${s} x ${n}`;if(r)return`${s}${l}`;if(o)return`${n}${l}`;return}({axis:t,height:g,moveX:u,moveY:p,position:o,showPx:i,width:h});return{label:x,resizeListener:a}}const vA=Zu("div",{target:"ekdag503"})({name:"1cd7zoc",styles:"bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0"}),bA=Zu("div",{target:"ekdag502"})({name:"ajymcs",styles:"align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear"}),yA=Zu("div",{target:"ekdag501"})("background:",kp.gray[900],";border-radius:2px;box-sizing:border-box;font-size:12px;color:",kp.ui.textDark,";padding:4px 8px;position:relative;"),wA=Zu(Rh,{target:"ekdag500"})("&&&{color:",kp.ui.textDark,";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}");const xA=(0,s.forwardRef)((function(e,t){let{label:n,position:r=hA.corner,zIndex:o=1e3,...i}=e;const l=!!n,c=r===hA.bottom,d=r===hA.corner;if(!l)return null;let f={opacity:l?1:void 0,zIndex:o},p={};return c&&(f={...f,position:"absolute",bottom:-10,left:"50%",transform:"translate(-50%, 0)"},p={transform:"translate(0, 100%)"}),d&&(f={...f,position:"absolute",top:4,right:(0,u.isRTL)()?void 0:4,left:(0,u.isRTL)()?4:void 0}),(0,s.createElement)(bA,a({"aria-hidden":"true",className:"components-resizable-tooltip__tooltip-wrapper",ref:t,style:f},i),(0,s.createElement)(yA,{className:"components-resizable-tooltip__tooltip",style:p},(0,s.createElement)(wA,{as:"span"},n)))}));var _A=xA;const EA=()=>{};const CA=(0,s.forwardRef)((function(e,t){let{axis:n,className:r,fadeTimeout:o=180,isVisible:i=!0,labelRef:l,onResize:u=EA,position:d=hA.bottom,showPx:f=!0,zIndex:p=1e3,...m}=e;const{label:h,resizeListener:g}=gA({axis:n,fadeTimeout:o,onResize:u,showPx:f,position:d});if(!i)return null;const v=c()("components-resize-tooltip",r);return(0,s.createElement)(vA,a({"aria-hidden":"true",className:v,ref:t},m),g,(0,s.createElement)(_A,{"aria-hidden":m["aria-hidden"],label:h,position:d,ref:l,zIndex:p}))}));var kA=CA;const SA="components-resizable-box__handle",TA="components-resizable-box__side-handle",NA="components-resizable-box__corner-handle",RA={top:c()(SA,TA,"components-resizable-box__handle-top"),right:c()(SA,TA,"components-resizable-box__handle-right"),bottom:c()(SA,TA,"components-resizable-box__handle-bottom"),left:c()(SA,TA,"components-resizable-box__handle-left"),topLeft:c()(SA,NA,"components-resizable-box__handle-top","components-resizable-box__handle-left"),topRight:c()(SA,NA,"components-resizable-box__handle-top","components-resizable-box__handle-right"),bottomRight:c()(SA,NA,"components-resizable-box__handle-bottom","components-resizable-box__handle-right"),bottomLeft:c()(SA,NA,"components-resizable-box__handle-bottom","components-resizable-box__handle-left")},IA={width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0},MA={top:IA,right:IA,bottom:IA,left:IA,topLeft:IA,topRight:IA,bottomRight:IA,bottomLeft:IA};const PA=(0,s.forwardRef)((function(e,t){let{className:n,children:r,showHandle:o=!0,__experimentalShowTooltip:i=!1,__experimentalTooltipProps:l={},...u}=e;return(0,s.createElement)(pA,a({className:c()("components-resizable-box__container",o&&"has-show-handle",n),handleClasses:RA,handleStyles:MA,ref:t},u),r,i&&(0,s.createElement)(kA,l))}));var OA=PA;var DA=function(e){let{naturalWidth:t,naturalHeight:n,children:r,isInline:o=!1}=e;const[i,{width:a}]=(0,d.useResizeObserver)();if(1!==s.Children.count(r))return null;const l={paddingBottom:t<(null!=a?a:0)?n:n/t*100+"%"},u=o?"span":"div";return(0,s.createElement)(u,{className:"components-responsive-wrapper"},i,(0,s.createElement)(u,{style:l}),(0,s.cloneElement)(r,{className:c()("components-responsive-wrapper__content",r.props.className)}))};const AA=function(){const{MutationObserver:e}=window;if(!e||!document.body||!window.parent)return;function t(){const e=document.body.getBoundingClientRect();window.parent.postMessage({action:"resize",width:e.width,height:e.height},"*")}function n(e){e.style&&["width","height","minHeight","maxHeight"].forEach((function(t){/^\\d+(vmin|vmax|vh|vw)$/.test(e.style[t])&&(e.style[t]="")}))}new e(t).observe(document.body,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),window.addEventListener("load",t,!0),Array.prototype.forEach.call(document.querySelectorAll("[style]"),n),Array.prototype.forEach.call(document.styleSheets,(function(e){Array.prototype.forEach.call(e.cssRules||e.rules,n)})),document.body.style.position="absolute",document.body.style.width="100%",document.body.setAttribute("data-resizable-iframe-connected",""),t(),window.addEventListener("resize",t,!0)},LA="\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div {\n\t\twidth: 100%;\n\t}\n\thtml.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio > div,\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t}\n\tbody > div > * {\n\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\tmargin-bottom: 0 !important;\n\t}\n";var zA=function(e){let{html:t="",title:n="",type:r,styles:o=[],scripts:i=[],onFocus:a}=e;const l=(0,s.useRef)(),[c,u]=(0,s.useState)(0),[f,p]=(0,s.useState)(0);function m(){try{var e,t;return!(null===(e=l.current)||void 0===e||null===(t=e.contentDocument)||void 0===t||!t.body)}catch(e){return!1}}function h(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!m())return;const{contentDocument:a,ownerDocument:c}=l.current;if(!e&&null!==(null==a?void 0:a.body.getAttribute("data-resizable-iframe-connected")))return;const u=(0,s.createElement)("html",{lang:c.documentElement.lang,className:r},(0,s.createElement)("head",null,(0,s.createElement)("title",null,n),(0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:LA}}),o.map(((e,t)=>(0,s.createElement)("style",{key:t,dangerouslySetInnerHTML:{__html:e}})))),(0,s.createElement)("body",{"data-resizable-iframe-connected":"data-resizable-iframe-connected",className:r},(0,s.createElement)("div",{dangerouslySetInnerHTML:{__html:t}}),(0,s.createElement)("script",{type:"text/javascript",dangerouslySetInnerHTML:{__html:`(${AA.toString()})();`}}),i.map((e=>(0,s.createElement)("script",{key:e,src:e})))));a.open(),a.write(""+(0,s.renderToString)(u)),a.close()}return(0,s.useEffect)((()=>{var e;function t(){h(!1)}function n(e){const t=l.current;if(!t||t.contentWindow!==e.source)return;let n=e.data||{};if("string"==typeof n)try{n=JSON.parse(n)}catch(e){}"resize"===n.action&&(u(n.width),p(n.height))}h();const r=l.current,o=null==r||null===(e=r.ownerDocument)||void 0===e?void 0:e.defaultView;return null==r||r.addEventListener("load",t,!1),null==o||o.addEventListener("message",n),()=>{null==r||r.removeEventListener("load",t,!1),null==o||o.addEventListener("message",n)}}),[]),(0,s.useEffect)((()=>{h()}),[n,o,i]),(0,s.useEffect)((()=>{h(!0)}),[t,r]),(0,s.createElement)("iframe",{ref:(0,d.useMergeRefs)([l,(0,d.useFocusableIframe)()]),title:n,className:"components-sandbox",sandbox:"allow-scripts allow-same-origin allow-presentation",onFocus:a,width:Math.ceil(c),height:Math.ceil(f)})};const BA=(0,s.forwardRef)((function(e,t){let{className:n,children:r,spokenMessage:o=r,politeness:i="polite",actions:a=[],onRemove:l,icon:d=null,explicitDismiss:f=!1,onDismiss:p,listRef:m}=e;function h(e){var t;e&&e.preventDefault&&e.preventDefault(),null==m||null===(t=m.current)||void 0===t||t.focus(),null==p||p(),null==l||l()}!function(e,t){const n="string"==typeof e?e:(0,s.renderToString)(e);(0,s.useEffect)((()=>{n&&(0,lb.speak)(n,t)}),[n,t])}(o,i),(0,s.useEffect)((()=>{const e=setTimeout((()=>{f||(null==p||p(),null==l||l())}),1e4);return()=>clearTimeout(e)}),[p,l,f]);const g=c()(n,"components-snackbar",{"components-snackbar-explicit-dismiss":!!f});a&&a.length>1&&("undefined"!=typeof process&&process.env,a=[a[0]]);const v=c()("components-snackbar__content",{"components-snackbar__content-with-icon":!!d});return(0,s.createElement)("div",{ref:t,className:g,onClick:f?void 0:h,tabIndex:0,role:f?"":"button",onKeyPress:f?void 0:h,"aria-label":f?"":(0,u.__)("Dismiss this notice")},(0,s.createElement)("div",{className:v},d&&(0,s.createElement)("div",{className:"components-snackbar__icon"},d),r,a.map(((e,t)=>{let{label:n,onClick:r,url:o}=e;return(0,s.createElement)(rd,{key:t,href:o,variant:"tertiary",onClick:e=>function(e,t){e.stopPropagation(),null==l||l(),t&&t(e)}(e,r),className:"components-snackbar__action"},n)})),f&&(0,s.createElement)("span",{role:"button","aria-label":"Dismiss this notice",tabIndex:0,className:"components-snackbar__dismiss-button",onClick:h,onKeyPress:h},"✕")))}));var FA=BA;const VA={init:{height:0,opacity:0},open:{height:"auto",opacity:1,transition:{height:{stiffness:1e3,velocity:-100}}},exit:{opacity:0,transition:{duration:.5}}};var HA=function(e){let{notices:t,className:n,children:r,onRemove:o}=e;const i=(0,s.useRef)(null),l=(0,d.useReducedMotion)();n=c()("components-snackbar-list",n);const u=e=>()=>null==o?void 0:o(e.id);return(0,s.createElement)("div",{className:n,tabIndex:-1,ref:i},r,(0,s.createElement)(Om,null,t.map((e=>{const{content:t,...n}=e;return(0,s.createElement)(Gl.div,{layout:!l,initial:"init",animate:"open",exit:"exit",key:e.id,variants:l?void 0:VA},(0,s.createElement)("div",{className:"components-snackbar-list__notice-container"},(0,s.createElement)(FA,a({},n,{onRemove:u(e),listRef:i}),e.content)))}))))};const jA=(function(){var e=$f.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}})` from { transform: rotate(0deg); } to { transform: rotate(360deg); } - `,GA=Ju("svg",{target:"ea4tfvq2"})("width:",mh.spinnerSize,"px;height:",mh.spinnerSize,"px;display:inline-block;margin:5px 11px 0;position:relative;color:",Sp.ui.theme,";overflow:visible;"),YA={name:"9s4963",styles:"fill:transparent;stroke-width:1.5px"},qA=Ju("circle",{target:"ea4tfvq1"})(YA,";stroke:",Sp.gray[300],";"),KA=Ju("path",{target:"ea4tfvq0"})(YA,";stroke:currentColor;stroke-linecap:round;transform-origin:50% 50%;animation:1.4s linear infinite both ",UA,";");const XA=(0,s.forwardRef)((function(e,t){let{className:n,...r}=e;return(0,s.createElement)(GA,a({className:c()("components-spinner",n),viewBox:"0 0 100 100",width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",role:"presentation",focusable:"false"},r,{ref:t}),(0,s.createElement)(qA,{cx:"50",cy:"50",r:"50",vectorEffect:"non-scaling-stroke"}),(0,s.createElement)(KA,{d:"m 50 0 a 50 50 0 0 1 50 50",vectorEffect:"non-scaling-stroke"}))}));var ZA=XA;var JA=Hu((function(e,t){const n=sk(e);return(0,s.createElement)(ed,a({},n,{ref:t}))}),"Surface");const QA=e=>{let{tabId:t,children:n,selected:r,...o}=e;return(0,s.createElement)(od,a({role:"tab",tabIndex:r?void 0:-1,"aria-selected":r,id:t,__experimentalIsFocusable:!0},o),n)};var eL=function e(t){var n;let{className:r,children:o,tabs:i,selectOnMove:a=!0,initialTabName:l,orientation:u="horizontal",activeClass:f="is-active",onSelect:p}=t;const m=(0,d.useInstanceId)(e,"tab-panel"),[h,g]=(0,s.useState)(),v=(0,s.useCallback)((e=>{g(e),null==p||p(e)}),[p]),b=i.find((e=>{let{name:t}=e;return t===h})),y=`${m}-${null!==(n=null==b?void 0:b.name)&&void 0!==n?n:"none"}`;return(0,s.useEffect)((()=>{if(b)return;const e=i.find((e=>e.name===l));if(!l||e)if(e&&!e.disabled)v(e.name);else{const e=i.find((e=>!e.disabled));e&&v(e.name)}}),[i,b,l,v]),(0,s.useEffect)((()=>{if(null==b||!b.disabled)return;const e=i.find((e=>!e.disabled));e&&v(e.name)}),[i,null==b?void 0:b.disabled,v]),(0,s.createElement)("div",{className:r},(0,s.createElement)(IS,{role:"tablist",orientation:u,onNavigate:a?(e,t)=>{t.click()}:void 0,className:"components-tab-panel__tabs"},i.map((e=>(0,s.createElement)(QA,{className:c()("components-tab-panel__tabs-item",e.className,{[f]:e.name===h}),tabId:`${m}-${e.name}`,"aria-controls":`${m}-${e.name}-view`,selected:e.name===h,key:e.name,onClick:()=>v(e.name),disabled:e.disabled,label:e.icon&&e.title,icon:e.icon,showTooltip:!!e.icon},!e.icon&&e.title)))),b&&(0,s.createElement)("div",{key:y,"aria-labelledby":y,role:"tabpanel",id:`${y}-view`,className:"components-tab-panel__tab-content"},o(b)))};const tL=(0,s.forwardRef)((function(e,t){const{__nextHasNoMarginBottom:n,label:r,hideLabelFromVision:o,value:i,help:l,className:c,onChange:u,type:f="text",...p}=e,m=`inspector-text-control-${(0,d.useInstanceId)(tL)}`;return(0,s.createElement)(Nv,{__nextHasNoMarginBottom:n,label:r,hideLabelFromVision:o,id:m,help:l,className:c},(0,s.createElement)("input",a({className:"components-text-control__input",type:f,id:m,value:i,onChange:e=>u(e.target.value),"aria-describedby":l?m+"__help":void 0,ref:t},p)))}));var nL=tL;const rL=Wf("box-shadow:0 0 0 transparent;transition:box-shadow 0.1s linear;border-radius:",mh.radiusBlockUi,";border:",mh.borderWidth," solid ",Sp.ui.border,";",""),oL=Wf("border-color:",Sp.ui.theme,";box-shadow:0 0 0 calc( ",mh.borderWidthFocus," - ",mh.borderWidth," ) ",Sp.ui.theme,";outline:2px solid transparent;","");var iL={huge:"1440px",wide:"1280px","x-large":"1080px",large:"960px",medium:"782px",small:"600px",mobile:"480px","zoomed-in":"280px"};const aL=Wf("font-family:",bv("default.fontFamily"),";padding:6px 8px;",rL,";font-size:",bv("mobileTextMinFontSize"),";line-height:normal;",`@media (min-width: ${iL["small"]})`,"{font-size:",bv("default.fontSize"),";line-height:normal;}&:focus{",oL,";}&::-webkit-input-placeholder{color:",Sp.ui.darkGrayPlaceholder,";}&::-moz-placeholder{opacity:1;color:",Sp.ui.darkGrayPlaceholder,";}&:-ms-input-placeholder{color:",Sp.ui.darkGrayPlaceholder,";}.is-dark-theme &{&::-webkit-input-placeholder{color:",Sp.ui.lightGrayPlaceholder,";}&::-moz-placeholder{opacity:1;color:",Sp.ui.lightGrayPlaceholder,";}&:-ms-input-placeholder{color:",Sp.ui.lightGrayPlaceholder,";}}","");const sL=Ju("textarea",{target:"e1w5nnrk0"})("width:100%;",aL,";");var lL=function e(t){const{__nextHasNoMarginBottom:n,label:r,hideLabelFromVision:o,value:i,help:l,onChange:c,rows:u=4,className:f,...p}=t,m=`inspector-textarea-control-${(0,d.useInstanceId)(e)}`;return(0,s.createElement)(Nv,{__nextHasNoMarginBottom:n,label:r,hideLabelFromVision:o,id:m,help:l,className:f},(0,s.createElement)(sL,a({className:"components-textarea-control__input",id:m,rows:u,onChange:e=>c(e.target.value),"aria-describedby":l?m+"__help":void 0,value:i},p)))};var cL=e=>{const{text:t="",highlight:n=""}=e,r=n.trim();if(!r)return(0,s.createElement)(s.Fragment,null,t);const o=new RegExp(`(${fb(r)})`,"gi");return(0,s.createInterpolateElement)(t.replace(o,"$&"),{mark:(0,s.createElement)("mark",null)})};var uL=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M12 15.8c-3.7 0-6.8-3-6.8-6.8s3-6.8 6.8-6.8c3.7 0 6.8 3 6.8 6.8s-3.1 6.8-6.8 6.8zm0-12C9.1 3.8 6.8 6.1 6.8 9s2.4 5.2 5.2 5.2c2.9 0 5.2-2.4 5.2-5.2S14.9 3.8 12 3.8zM8 17.5h8V19H8zM10 20.5h4V22h-4z"}));var dL=function(e){const{children:t}=e;return(0,s.createElement)("div",{className:"components-tip"},(0,s.createElement)(sy,{icon:uL}),(0,s.createElement)("p",null,t))};var fL=function e(t){let{__nextHasNoMarginBottom:n,label:r,checked:o,help:i,className:a,onChange:l,disabled:c}=t;const u=`inspector-toggle-control-${(0,d.useInstanceId)(e)}`,f=Fu()("components-toggle-control",a,!n&&Wf({marginBottom:Km(3)},"",""));let p,m;return i&&("function"==typeof i?void 0!==o&&(m=i(o)):m=i,m&&(p=u+"__help")),(0,s.createElement)(Nv,{id:u,help:m,className:f,__nextHasNoMarginBottom:!0},(0,s.createElement)(Gv,{justify:"flex-start",spacing:3},(0,s.createElement)(UP,{id:u,checked:o,onChange:function(e){l(e.target.checked)},"aria-describedby":p,disabled:c}),(0,s.createElement)(jm,{as:"label",htmlFor:u,className:"components-toggle-control__label"},r)))};const pL=(0,s.forwardRef)((function(e,t){const{icon:n,label:r,...o}=e;return(0,s.createElement)(LP,a({},o,{isIcon:!0,"aria-label":r,showTooltip:!0,ref:t}),(0,s.createElement)(Xl,{icon:n}))}));var mL=pL,hL=["baseId","unstable_idCountRef","unstable_virtual","rtl","orientation","items","groups","currentId","loop","wrap","shift","unstable_moves","unstable_hasActiveWidget","unstable_includesBaseElement","setBaseId","registerItem","unregisterItem","registerGroup","unregisterGroup","move","next","previous","up","down","first","last","sort","unstable_setVirtual","setRTL","setOrientation","setCurrentId","setLoop","setWrap","setShift","reset","unstable_setIncludesBaseElement","unstable_setHasActiveWidget"],gL=hL,vL=z({as:"button",memo:!0,useHook:F({name:"ToolbarItem",compose:ke,keys:gL})});var bL=(0,s.createContext)();var yL=(0,s.forwardRef)((function(e,t){let{children:n,as:r,...o}=e;const i=(0,s.useContext)(bL);if("function"!=typeof n&&!r)return"undefined"!=typeof process&&process.env,null;const l={...o,ref:t,"data-toolbar-item":!0};return i?(0,s.createElement)(vL,a({},i,l,{as:r}),n):r?(0,s.createElement)(r,l,n):n(l)}));var wL=e=>(0,s.createElement)("div",{className:e.className},e.children);var xL=(0,s.forwardRef)((function(e,t){let{containerClassName:n,className:r,extraProps:o,children:i,title:l,isActive:u,isDisabled:d,...f}=e;return(0,s.useContext)(bL)?(0,s.createElement)(yL,a({className:c()("components-toolbar-button",r)},o,f,{ref:t}),(e=>(0,s.createElement)(od,a({label:l,isPressed:u,disabled:d},e),i))):(0,s.createElement)(wL,{className:n},(0,s.createElement)(od,a({ref:t,icon:f.icon,label:l,shortcut:f.shortcut,"data-subscript":f.subscript,onClick:e=>{e.stopPropagation(),f.onClick&&f.onClick(e)},className:c()("components-toolbar__control",r),isPressed:u,disabled:d,"data-toolbar-item":!0},o,f),i))}));var _L=e=>{let{className:t,children:n,...r}=e;return(0,s.createElement)("div",a({className:t},r),n)};var EL=function(e){let{controls:t=[],toggleProps:n,...r}=e;const o=e=>(0,s.createElement)(OS,a({controls:t,toggleProps:{...e,"data-toolbar-item":!0}},r));return(0,s.useContext)(bL)?(0,s.createElement)(yL,n,o):o(n)};var CL=function(e){var t;let{controls:n=[],children:r,className:o,isCollapsed:i,title:l,...u}=e;const d=(0,s.useContext)(bL);if(!(n&&n.length||r))return null;const f=c()(d?"components-toolbar-group":"components-toolbar",o);let p=n;return Array.isArray(p[0])||(p=[p]),i?(0,s.createElement)(EL,a({label:l,controls:p,className:f,children:r},u)):(0,s.createElement)(_L,a({className:f},u),null===(t=p)||void 0===t?void 0:t.flatMap(((e,t)=>e.map(((e,n)=>(0,s.createElement)(xL,a({key:[t,n].join(),containerClassName:t>0&&0===n?"has-left-divider":null},e)))))),r)};var kL=F({name:"Toolbar",compose:fm,keys:hL,useProps:function(e,t){return m({role:"toolbar","aria-orientation":e.orientation},t)}}),SL=z({as:"div",useHook:kL,useCreateElement:function(e,t,n){return N(e,t,n)}});var TL=(0,s.forwardRef)((function(e,t){let{label:n,...r}=e;const o=function(e){void 0===e&&(e={});var t=Lp(e),n=t.orientation;return om(m({orientation:void 0===n?"horizontal":n},h(t,["orientation"])))}({loop:!0,baseId:r.id,rtl:(0,u.isRTL)()});return(0,s.createElement)(bL.Provider,{value:o},(0,s.createElement)(SL,a({ref:t,"aria-label":n},o,r)))}));var NL=(0,s.forwardRef)((function(e,t){let{className:n,label:r,...o}=e;if(!r)return ql()("Using Toolbar without label prop",{since:"5.6",alternative:"ToolbarGroup component",link:"https://developer.wordpress.org/block-editor/components/toolbar/"}),(0,s.createElement)(CL,a({},o,{className:n}));const i=c()("components-accessible-toolbar",n);return(0,s.createElement)(TL,a({className:i,label:r,ref:t},o))}));var RL=(0,s.forwardRef)((function(e,t){return(0,s.useContext)(bL)?(0,s.createElement)(yL,a({ref:t},e.toggleProps),(t=>(0,s.createElement)(OS,a({},e,{popoverProps:{variant:"toolbar",...e.popoverProps},toggleProps:t})))):(0,s.createElement)(OS,e)}));const IL={columns:e=>Wf("grid-template-columns:",`repeat( ${e}, minmax(0, 1fr) )`,";",""),spacing:Wf("column-gap:",Km(2),";row-gap:",Km(4),";",""),item:{fullWidth:{name:"18iuzk9",styles:"grid-column:1/-1"}}},ML={name:"huufmu",styles:">div:not( :first-of-type ){display:none;}"},PL=Wf(IL.item.fullWidth," gap:",Km(2),";.components-dropdown-menu{margin:",Km(-1)," 0;line-height:0;}&&&& .components-dropdown-menu__toggle{padding:0;min-width:",Km(6),";}",""),OL={name:"1pmxm02",styles:"font-size:inherit;font-weight:500;line-height:normal;&&{margin:0;}"},DL=Wf(IL.item.fullWidth,"&>div,&>fieldset{padding-bottom:0;margin-bottom:0;max-width:100%;}&& ",wv,"{margin-bottom:0;",xv,":last-child{margin-bottom:0;}}",kv,"{margin-bottom:0;}&& ",qh,"{label{line-height:1.4em;}}",""),AL={name:"eivff4",styles:"display:none"},LL={name:"16gsvie",styles:"min-width:200px"},zL=Ju("span",{target:"ews648u0"})("color:",Sp.ui.themeDark10,";font-size:11px;font-weight:500;line-height:1.4;",Bh({marginLeft:Km(3)})," text-transform:uppercase;"),BL=Wf("color:",Sp.gray[900],";&&[aria-disabled='true']{color:",Sp.gray[700],";opacity:1;&:hover{color:",Sp.gray[700],";}",zL,"{opacity:0.3;}}",""),FL=()=>{},VL=(0,s.createContext)({menuItems:{default:{},optional:{}},hasMenuItems:!1,isResetting:!1,shouldRenderPlaceholderItems:!1,registerPanelItem:FL,deregisterPanelItem:FL,flagItemCustomization:FL,areAllOptionalControlsHidden:!0}),HL=()=>(0,s.useContext)(VL);const jL=e=>{let{itemClassName:t,items:n,toggleItem:r}=e;if(!n.length)return null;const o=(0,s.createElement)(zL,{"aria-hidden":!0},(0,u.__)("Reset"));return(0,s.createElement)(sO,{label:(0,u.__)("Defaults")},n.map((e=>{let[n,i]=e;return i?(0,s.createElement)(lO,{key:n,className:t,role:"menuitem",label:(0,u.sprintf)((0,u.__)("Reset %s"),n),onClick:()=>{r(n),(0,cb.speak)((0,u.sprintf)((0,u.__)("%s reset to default"),n),"assertive")},suffix:o},n):(0,s.createElement)(lO,{key:n,className:t,role:"menuitemcheckbox",isSelected:!0,"aria-disabled":!0},n)})))},$L=e=>{let{items:t,toggleItem:n}=e;return t.length?(0,s.createElement)(sO,{label:(0,u.__)("Tools")},t.map((e=>{let[t,r]=e;const o=r?(0,u.sprintf)((0,u.__)("Hide and reset %s"),t):(0,u.sprintf)((0,u.__)("Show %s"),t);return(0,s.createElement)(lO,{key:t,icon:r&&V_,isSelected:r,label:o,onClick:()=>{r?(0,cb.speak)((0,u.sprintf)((0,u.__)("%s hidden and reset to default"),t),"assertive"):(0,cb.speak)((0,u.sprintf)((0,u.__)("%s is now visible"),t),"assertive"),n(t)},role:"menuitemcheckbox"},t)}))):null};var WL=Hu(((e,t)=>{const{areAllOptionalControlsHidden:n,defaultControlsItemClassName:r,dropdownMenuClassName:o,hasMenuItems:i,headingClassName:l,label:c,menuItems:d,resetAll:f,toggleItem:p,...m}=function(e){const{className:t,...n}=Vu(e,"ToolsPanelHeader"),r=Fu(),o=(0,s.useMemo)((()=>r(PL,t)),[t,r]),i=(0,s.useMemo)((()=>r(LL)),[r]),a=(0,s.useMemo)((()=>r(OL)),[r]),l=(0,s.useMemo)((()=>r(BL)),[r]),{menuItems:c,hasMenuItems:u,areAllOptionalControlsHidden:d}=HL();return{...n,areAllOptionalControlsHidden:d,defaultControlsItemClassName:l,dropdownMenuClassName:i,hasMenuItems:u,headingClassName:a,menuItems:c,className:o}}(e);if(!c)return null;const h=Object.entries((null==d?void 0:d.default)||{}),g=Object.entries((null==d?void 0:d.optional)||{}),v=n?Wm:Ik,b=(0,u.sprintf)((0,u._x)("%s options","Button label to reveal tool panel options"),c),y=n?(0,u.__)("All options are currently hidden"):void 0,w=[...h,...g].some((e=>{let[,t]=e;return t}));return(0,s.createElement)(Gv,a({},m,{ref:t}),(0,s.createElement)(W_,{level:2,className:l},c),i&&(0,s.createElement)(OS,{icon:v,label:b,menuProps:{className:o},toggleProps:{isSmall:!0,describedBy:y}},(()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(jL,{items:h,toggleItem:p,itemClassName:r}),(0,s.createElement)($L,{items:g,toggleItem:p}),(0,s.createElement)(sO,null,(0,s.createElement)(lO,{"aria-disabled":!w,variant:"tertiary",onClick:()=>{w&&(f(),(0,cb.speak)((0,u.__)("All options reset"),"assertive"))}},(0,u.__)("Reset all")))))))}),"ToolsPanelHeader");const UL=e=>{let{panelItems:t,shouldReset:n,currentMenuItems:r}=e;const o={default:{},optional:{}};return t.forEach((e=>{var t;let{hasValue:i,isShownByDefault:a,label:s}=e;const l=a?"default":"optional",c=null==r||null===(t=r[l])||void 0===t?void 0:t[s],u=c||i();o[l][s]=!n&&u})),o},GL=e=>e&&0===Object.keys(e).length;function YL(e){const{className:t,resetAll:n,panelId:r,hasInnerWrapper:o,shouldRenderPlaceholderItems:i,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l,...c}=Vu(e,"ToolsPanel"),u=(0,s.useRef)(!1),d=u.current;(0,s.useEffect)((()=>{d&&(u.current=!1)}),[d]);const[f,p]=(0,s.useState)([]),m=(0,s.useCallback)((e=>{p((t=>{const n=[...t],r=n.findIndex((t=>t.label===e.label));return-1!==r&&n.splice(r,1),[...n,e]}))}),[p]),h=(0,s.useCallback)((e=>{p((t=>{const n=[...t],r=n.findIndex((t=>t.label===e));return-1!==r&&n.splice(r,1),n}))}),[p]),[g,v]=(0,s.useState)({default:{},optional:{}});(0,s.useEffect)((()=>{v((e=>UL({panelItems:f,shouldReset:!1,currentMenuItems:e})))}),[f,v]);const b=(0,s.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";v((n=>({...n,[t]:{...n[t],[e]:!0}})))}),[v]),[y,w]=(0,s.useState)(!1);(0,s.useEffect)((()=>{if(GL(null==g?void 0:g.default)&&!GL(null==g?void 0:g.optional)){const e=!Object.entries(g.optional).some((e=>{let[,t]=e;return t}));w(e)}}),[g,w]);const x=Fu(),_=(0,s.useMemo)((()=>{const e=o&&Wf(">div:not( :first-of-type ){display:grid;",IL.columns(2)," ",IL.spacing," ",IL.item.fullWidth,";}","");const n=GL(null==g?void 0:g.default)&&y&&ML;return x((e=>Wf(IL.columns(e)," ",IL.spacing," border-top:",mh.borderWidth," solid ",Sp.gray[300],";margin-top:-1px;padding:",Km(4),";",""))(2),e,n,t)}),[y,t,x,o,g]),E=(0,s.useCallback)((e=>{const t=f.find((t=>t.label===e));if(!t)return;const n=t.isShownByDefault?"default":"optional",r={...g,[n]:{...g[n],[e]:!g[n][e]}};v(r)}),[g,f,v]),C=(0,s.useCallback)((()=>{if("function"==typeof n){u.current=!0;const e=[];f.forEach((t=>{t.resetAllFilter&&e.push(t.resetAllFilter)})),n(e)}const e=UL({panelItems:f,shouldReset:!0});v(e)}),[f,n,v]),k=e=>{const t=g.optional||{},n=e.find((e=>e.isShownByDefault||!!t[e.label]));return null==n?void 0:n.label},S=k(f),T=k([...f].reverse());return{...c,panelContext:(0,s.useMemo)((()=>({areAllOptionalControlsHidden:y,deregisterPanelItem:h,firstDisplayedItem:S,flagItemCustomization:b,hasMenuItems:!!f.length,isResetting:u.current,lastDisplayedItem:T,menuItems:g,panelId:r,registerPanelItem:m,shouldRenderPlaceholderItems:i,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l})),[y,h,S,b,T,g,r,f,m,i,a,l]),resetAllItems:C,toggleItem:E,className:_}}var qL=Hu(((e,t)=>{const{children:n,label:r,panelContext:o,resetAllItems:i,toggleItem:l,...c}=YL(e);return(0,s.createElement)(_E,a({},c,{columns:2,ref:t}),(0,s.createElement)(VL.Provider,{value:o},(0,s.createElement)(WL,{label:r,resetAll:i,toggleItem:l}),n))}),"ToolsPanel");var KL=Hu(((e,t)=>{const{children:n,isShown:r,shouldRenderPlaceholder:o,...i}=function(e){var t,n,r;const{className:o,hasValue:i,isShownByDefault:a,label:l,panelId:c,resetAllFilter:u,onDeselect:f,onSelect:p,...m}=Vu(e,"ToolsPanelItem"),{panelId:h,menuItems:g,registerPanelItem:v,deregisterPanelItem:b,flagItemCustomization:y,isResetting:w,shouldRenderPlaceholderItems:x,firstDisplayedItem:_,lastDisplayedItem:E,__experimentalFirstVisibleItemClass:C,__experimentalLastVisibleItemClass:k}=HL(),S=(0,s.useCallback)(i,[c,i]),T=(0,s.useCallback)(u,[c,u]),N=(0,d.usePrevious)(h),R=h===c||null===h;(0,s.useEffect)((()=>(R&&null!==N&&v({hasValue:S,isShownByDefault:a,label:l,resetAllFilter:T,panelId:c}),()=>{(null===N&&h||h===c)&&b(l)})),[h,R,a,l,S,c,N,T,v,b]);const I=a?"default":"optional",M=null==g||null===(t=g[I])||void 0===t?void 0:t[l],P=(0,d.usePrevious)(M),O=void 0!==(null==g||null===(n=g[I])||void 0===n?void 0:n[l]),D=i(),A=(0,d.usePrevious)(D),L=D&&!A;(0,s.useEffect)((()=>{L&&(a||null===h)&&y(l,I)}),[h,L,a,I,l,y]),(0,s.useEffect)((()=>{O&&!w&&R&&(!M||D||P||null==p||p(),!M&&P&&(null==f||f()))}),[R,M,O,w,D,P,p,f]);const z=a?void 0!==(null==g||null===(r=g[I])||void 0===r?void 0:r[l]):M,B=Fu(),F=(0,s.useMemo)((()=>B(DL,x&&!z&&AL,o,_===l&&C,E===l&&k)),[z,x,o,B,_,E,C,k,l]);return{...m,isShown:z,shouldRenderPlaceholder:x,className:F}}(e);return r?(0,s.createElement)(ed,a({},i,{ref:t}),n):o?(0,s.createElement)(ed,a({},i,{ref:t})):null}),"ToolsPanelItem"),XL=window.wp.keycodes;const ZL=(0,s.createContext)(),JL=ZL.Provider;function QL(e){let{children:t}=e;const[n,r]=(0,s.useState)(),o=(0,s.useMemo)((()=>({lastFocusedElement:n,setLastFocusedElement:r})),[n]);return(0,s.createElement)(JL,{value:o},t)}function ez(e){const t=CS.focus.focusable.find(e,{sequential:!0});if(t&&t.length)return t.filter((t=>t.closest('[role="row"]')===e))}var tz=(0,s.forwardRef)((function(e,t){let{children:n,onExpandRow:r=(()=>{}),onCollapseRow:o=(()=>{}),onFocusRow:i=(()=>{}),applicationAriaLabel:l,...c}=e;const u=(0,s.useCallback)((e=>{const{keyCode:t,metaKey:n,ctrlKey:a,altKey:s}=e;if(n||a||s||![XL.UP,XL.DOWN,XL.LEFT,XL.RIGHT,XL.HOME,XL.END].includes(t))return;e.stopPropagation();const{activeElement:l}=document,{currentTarget:c}=e;if(!c.contains(l))return;const u=l.closest('[role="row"]'),d=ez(u),f=d.indexOf(l),p=0===f,m=p&&"false"===u.getAttribute("aria-expanded")&&t===XL.RIGHT;if([XL.LEFT,XL.RIGHT].includes(t)){let n;if(n=t===XL.LEFT?Math.max(0,f-1):Math.min(f+1,d.length-1),p){if(t===XL.LEFT){var h,g,v;if("true"===u.getAttribute("aria-expanded"))return o(u),void e.preventDefault();const t=Math.max(parseInt(null!==(h=null==u?void 0:u.getAttribute("aria-level"))&&void 0!==h?h:1,10)-1,1),n=Array.from(c.querySelectorAll('[role="row"]'));let r=u;for(let e=n.indexOf(u);e>=0;e--)if(parseInt(n[e].getAttribute("aria-level"),10)===t){r=n[e];break}null===(g=ez(r))||void 0===g||null===(v=g[0])||void 0===v||v.focus()}if(t===XL.RIGHT){if("false"===u.getAttribute("aria-expanded"))return r(u),void e.preventDefault();const t=ez(u);var b;if(t.length>0)null===(b=t[n])||void 0===b||b.focus()}return void e.preventDefault()}if(m)return;d[n].focus(),e.preventDefault()}else if([XL.UP,XL.DOWN].includes(t)){const n=Array.from(c.querySelectorAll('[role="row"]')),r=n.indexOf(u);let o;if(o=t===XL.UP?Math.max(0,r-1):Math.min(r+1,n.length-1),o===r)return void e.preventDefault();const a=ez(n[o]);if(!a||!a.length)return void e.preventDefault();a[Math.min(f,a.length-1)].focus(),i(e,u,n[o]),e.preventDefault()}else if([XL.HOME,XL.END].includes(t)){const n=Array.from(c.querySelectorAll('[role="row"]')),r=n.indexOf(u);let o;if(o=t===XL.HOME?0:n.length-1,o===r)return void e.preventDefault();const a=ez(n[o]);if(!a||!a.length)return void e.preventDefault();a[Math.min(f,a.length-1)].focus(),i(e,u,n[o]),e.preventDefault()}}),[r,o,i]);return(0,s.createElement)(QL,null,(0,s.createElement)("div",{role:"application","aria-label":l},(0,s.createElement)("table",a({},c,{role:"treegrid",onKeyDown:u,ref:t}),(0,s.createElement)("tbody",null,n))))}));var nz=(0,s.forwardRef)((function(e,t){let{children:n,level:r,positionInSet:o,setSize:i,isExpanded:l,...c}=e;return(0,s.createElement)("tr",a({},c,{ref:t,role:"row","aria-level":r,"aria-posinset":o,"aria-setsize":i,"aria-expanded":l}),n)})),rz=(0,s.forwardRef)((function(e,t){let{children:n,as:r,...o}=e;const i=(0,s.useRef)(),a=t||i,{lastFocusedElement:l,setLastFocusedElement:c}=(0,s.useContext)(ZL);let u;l&&(u=l===a.current?0:-1);const d={ref:a,tabIndex:u,onFocus:e=>c(e.target),...o};return"function"==typeof n?n(d):(0,s.createElement)(r,d,n)})),oz=(0,s.forwardRef)((function(e,t){let{children:n,...r}=e;return(0,s.createElement)(rz,a({ref:t},r),n)})),iz=(0,s.forwardRef)((function(e,t){let{children:n,withoutGridItem:r=!1,...o}=e;return(0,s.createElement)("td",a({},o,{role:"gridcell"}),r?n:(0,s.createElement)(oz,{ref:t},n))}));function az(e){e.stopPropagation()}var sz=(0,s.forwardRef)(((e,t)=>(ql()("wp.components.IsolatedEventContainer",{since:"5.7"}),(0,s.createElement)("div",a({},e,{ref:t,onMouseDown:az})))));function lz(e){return zd((0,s.useContext)(Fd).fills,{sync:!0}).get(e)}const cz=Ju("div",{target:"ebn2ljm1"})({name:"5ob2ly",styles:"display:flex;position:relative"}),uz=Ju("div",{target:"ebn2ljm0"})((e=>{let{isLayered:t,offsetAmount:n}=e;return Wf(t?Bh({marginLeft:n})():Bh({right:-1*n})(),"","")})," ",(e=>{let{isLayered:t}=e;return t?dz:fz})," ",(e=>{let{zIndex:t}=e;return Wf({zIndex:t},"","")}),";"),dz={name:"a4hmbt",styles:"position:absolute"},fz={name:"bjn8wh",styles:"position:relative"};const pz=Hu((function(e,t){const{children:n,className:r,isLayered:o=!0,isReversed:i=!1,offset:l=0,...c}=Vu(e,"ZStack"),u=Wv(n),d=u.length-1,f=u.map(((e,t)=>{const n=i?d-t:t,r=l*t,a=(0,s.isValidElement)(e)?e.key:t;return(0,s.createElement)(uz,{isLayered:o,offsetAmount:r,zIndex:n,key:a},e)}));return(0,s.createElement)(cz,a({},c,{className:r,ref:t}),f)}),"ZStack");var mz=pz;const hz={previous:[{modifier:"ctrlShift",character:"`"},{modifier:"ctrlShift",character:"~"},{modifier:"access",character:"p"}],next:[{modifier:"ctrl",character:"`"},{modifier:"access",character:"n"}]};function gz(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hz;const t=(0,s.useRef)(),[n,r]=(0,s.useState)(!1);function o(e){const n=Array.from(t.current.querySelectorAll('[role="region"][tabindex="-1"]'));if(!n.length)return;let o=n[0];const i=n.indexOf(t.current.ownerDocument.activeElement.closest('[role="region"][tabindex="-1"]'));if(-1!==i){let t=i+e;t=-1===t?n.length-1:t,t=t===n.length?0:t,o=n[t]}o.focus(),r(!0)}const i=(0,d.useRefEffect)((e=>{function t(){r(!1)}return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}),[r]);return{ref:(0,d.useMergeRefs)([t,i]),className:n?"is-focusing-regions":"",onKeyDown(t){e.previous.some((e=>{let{modifier:n,character:r}=e;return XL.isKeyboardEvent[n](t,r)}))?o(-1):e.next.some((e=>{let{modifier:n,character:r}=e;return XL.isKeyboardEvent[n](t,r)}))&&o(1)}}}var vz=(0,d.createHigherOrderComponent)((e=>t=>{let{shortcuts:n,...r}=t;return(0,s.createElement)("div",gz(n),(0,s.createElement)(e,r))}),"navigateRegions");var bz=(0,d.createHigherOrderComponent)((e=>function(t){const n=(0,d.useConstrainedTabbing)();return(0,s.createElement)("div",{ref:n,tabIndex:-1},(0,s.createElement)(e,t))}),"withConstrainedTabbing"),yz=e=>(0,d.createHigherOrderComponent)((t=>class extends s.Component{constructor(){super(...arguments),this.nodeRef=this.props.node,this.state={fallbackStyles:void 0,grabStylesCompleted:!1},this.bindRef=this.bindRef.bind(this)}bindRef(e){e&&(this.nodeRef=e)}componentDidMount(){this.grabFallbackStyles()}componentDidUpdate(){this.grabFallbackStyles()}grabFallbackStyles(){const{grabStylesCompleted:t,fallbackStyles:n}=this.state;if(this.nodeRef&&!t){const t=e(this.nodeRef,this.props);Jl()(t,n)||this.setState({fallbackStyles:t,grabStylesCompleted:Object.values(t).every(Boolean)})}}render(){const e=(0,s.createElement)(t,a({},this.props,this.state.fallbackStyles));return this.props.node?e:(0,s.createElement)("div",{ref:this.bindRef}," ",e," ")}}),"withFallbackStyles"),wz=window.wp.hooks;function xz(e){return(0,d.createHigherOrderComponent)((t=>{const n="core/with-filters/"+e;let r;class o extends s.Component{constructor(){super(...arguments),void 0===r&&(r=(0,wz.applyFilters)(e,t))}componentDidMount(){o.instances.push(this),1===o.instances.length&&((0,wz.addAction)("hookRemoved",n,a),(0,wz.addAction)("hookAdded",n,a))}componentWillUnmount(){o.instances=o.instances.filter((e=>e!==this)),0===o.instances.length&&((0,wz.removeAction)("hookRemoved",n),(0,wz.removeAction)("hookAdded",n))}render(){return(0,s.createElement)(r,this.props)}}o.instances=[];const i=(0,d.debounce)((()=>{r=(0,wz.applyFilters)(e,t),o.instances.forEach((e=>{e.forceUpdate()}))}),16);function a(t){t===e&&i()}return o}),"withFilters")}var _z=(0,d.createHigherOrderComponent)((e=>{const t=function(){let{onFocusReturn:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>n=>{const r=(0,d.useFocusReturn)(e);return(0,s.createElement)("div",{ref:r},(0,s.createElement)(t,n))}};if((n=e)instanceof s.Component||"function"==typeof n){const n=e;return t()(n)}var n;return t(e)}),"withFocusReturn");const Ez=e=>{let{children:t}=e;return ql()("wp.components.FocusReturnProvider component",{since:"5.7",hint:"This provider is not used anymore. You can just remove it from your codebase"}),t};var Cz=(0,d.createHigherOrderComponent)((e=>{function t(t,r){const[o,i]=(0,s.useState)([]),l=(0,s.useMemo)((()=>{const e=e=>{const t=e.id?e:{...e,id:nf()};i((e=>[...e,t]))};return{createNotice:e,createErrorNotice:t=>{e({status:"error",content:t})},removeNotice:e=>{i((t=>t.filter((t=>t.id!==e))))},removeAllNotices:()=>{i([])}}}),[]),c={...t,noticeList:o,noticeOperations:l,noticeUI:o.length>0&&(0,s.createElement)(kD,{className:"components-with-notices-ui",notices:o,onRemove:l.removeNotice})};return n?(0,s.createElement)(e,a({},c,{ref:r})):(0,s.createElement)(e,c)}let n;const{render:r}=e;return"function"==typeof r?(n=!0,(0,s.forwardRef)(t)):t})),kz=window.wp.privateApis;const{lock:Sz,unlock:Tz}=(0,kz.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/components"),Nz={};Sz(Nz,{CustomSelectControl:_N,__experimentalPopoverLegacyPositionToPlacement:yf})}(),(window.wp=window.wp||{}).components=r}(); \ No newline at end of file + `,$A=Zu("svg",{target:"ea4tfvq2"})("width:",ph.spinnerSize,"px;height:",ph.spinnerSize,"px;display:inline-block;margin:5px 11px 0;position:relative;color:",kp.ui.theme,";overflow:visible;"),WA={name:"9s4963",styles:"fill:transparent;stroke-width:1.5px"},UA=Zu("circle",{target:"ea4tfvq1"})(WA,";stroke:",kp.gray[300],";"),GA=Zu("path",{target:"ea4tfvq0"})(WA,";stroke:currentColor;stroke-linecap:round;transform-origin:50% 50%;animation:1.4s linear infinite both ",jA,";");const YA=(0,s.forwardRef)((function(e,t){let{className:n,...r}=e;return(0,s.createElement)($A,a({className:c()("components-spinner",n),viewBox:"0 0 100 100",width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",role:"presentation",focusable:"false"},r,{ref:t}),(0,s.createElement)(UA,{cx:"50",cy:"50",r:"50",vectorEffect:"non-scaling-stroke"}),(0,s.createElement)(GA,{d:"m 50 0 a 50 50 0 0 1 50 50",vectorEffect:"non-scaling-stroke"}))}));var qA=YA;var KA=Vu((function(e,t){const n=ak(e);return(0,s.createElement)(Qu,a({},n,{ref:t}))}),"Surface");const XA=e=>{let{tabId:t,children:n,selected:r,...o}=e;return(0,s.createElement)(rd,a({role:"tab",tabIndex:r?void 0:-1,"aria-selected":r,id:t,__experimentalIsFocusable:!0},o),n)};var ZA=function e(t){var n;let{className:r,children:o,tabs:i,selectOnMove:a=!0,initialTabName:l,orientation:u="horizontal",activeClass:f="is-active",onSelect:p}=t;const m=(0,d.useInstanceId)(e,"tab-panel"),[h,g]=(0,s.useState)(),v=(0,s.useCallback)((e=>{g(e),null==p||p(e)}),[p]),b=i.find((e=>{let{name:t}=e;return t===h})),y=`${m}-${null!==(n=null==b?void 0:b.name)&&void 0!==n?n:"none"}`;return(0,s.useEffect)((()=>{if(b)return;const e=i.find((e=>e.name===l));if(!l||e)if(e&&!e.disabled)v(e.name);else{const e=i.find((e=>!e.disabled));e&&v(e.name)}}),[i,b,l,v]),(0,s.useEffect)((()=>{if(null==b||!b.disabled)return;const e=i.find((e=>!e.disabled));e&&v(e.name)}),[i,null==b?void 0:b.disabled,v]),(0,s.createElement)("div",{className:r},(0,s.createElement)(RS,{role:"tablist",orientation:u,onNavigate:a?(e,t)=>{t.click()}:void 0,className:"components-tab-panel__tabs"},i.map((e=>(0,s.createElement)(XA,{className:c()("components-tab-panel__tabs-item",e.className,{[f]:e.name===h}),tabId:`${m}-${e.name}`,"aria-controls":`${m}-${e.name}-view`,selected:e.name===h,key:e.name,onClick:()=>v(e.name),disabled:e.disabled,label:e.icon&&e.title,icon:e.icon,showTooltip:!!e.icon},!e.icon&&e.title)))),b&&(0,s.createElement)("div",{key:y,"aria-labelledby":y,role:"tabpanel",id:`${y}-view`,className:"components-tab-panel__tab-content"},o(b)))};const JA=(0,s.forwardRef)((function(e,t){const{__nextHasNoMarginBottom:n,label:r,hideLabelFromVision:o,value:i,help:l,className:c,onChange:u,type:f="text",...p}=e,m=`inspector-text-control-${(0,d.useInstanceId)(JA)}`;return(0,s.createElement)(Tv,{__nextHasNoMarginBottom:n,label:r,hideLabelFromVision:o,id:m,help:l,className:c},(0,s.createElement)("input",a({className:"components-text-control__input",type:f,id:m,value:i,onChange:e=>u(e.target.value),"aria-describedby":l?m+"__help":void 0,ref:t},p)))}));var QA=JA;const eL=$f("box-shadow:0 0 0 transparent;transition:box-shadow 0.1s linear;border-radius:",ph.radiusBlockUi,";border:",ph.borderWidth," solid ",kp.ui.border,";",""),tL=$f("border-color:",kp.ui.theme,";box-shadow:0 0 0 calc( ",ph.borderWidthFocus," - ",ph.borderWidth," ) ",kp.ui.theme,";outline:2px solid transparent;","");var nL={huge:"1440px",wide:"1280px","x-large":"1080px",large:"960px",medium:"782px",small:"600px",mobile:"480px","zoomed-in":"280px"};const rL=$f("font-family:",vv("default.fontFamily"),";padding:6px 8px;",eL,";font-size:",vv("mobileTextMinFontSize"),";line-height:normal;",`@media (min-width: ${nL["small"]})`,"{font-size:",vv("default.fontSize"),";line-height:normal;}&:focus{",tL,";}&::-webkit-input-placeholder{color:",kp.ui.darkGrayPlaceholder,";}&::-moz-placeholder{opacity:1;color:",kp.ui.darkGrayPlaceholder,";}&:-ms-input-placeholder{color:",kp.ui.darkGrayPlaceholder,";}.is-dark-theme &{&::-webkit-input-placeholder{color:",kp.ui.lightGrayPlaceholder,";}&::-moz-placeholder{opacity:1;color:",kp.ui.lightGrayPlaceholder,";}&:-ms-input-placeholder{color:",kp.ui.lightGrayPlaceholder,";}}","");const oL=Zu("textarea",{target:"e1w5nnrk0"})("width:100%;",rL,";");var iL=function e(t){const{__nextHasNoMarginBottom:n,label:r,hideLabelFromVision:o,value:i,help:l,onChange:c,rows:u=4,className:f,...p}=t,m=`inspector-textarea-control-${(0,d.useInstanceId)(e)}`;return(0,s.createElement)(Tv,{__nextHasNoMarginBottom:n,label:r,hideLabelFromVision:o,id:m,help:l,className:f},(0,s.createElement)(oL,a({className:"components-textarea-control__input",id:m,rows:u,onChange:e=>c(e.target.value),"aria-describedby":l?m+"__help":void 0,value:i},p)))};var aL=e=>{const{text:t="",highlight:n=""}=e,r=n.trim();if(!r)return(0,s.createElement)(s.Fragment,null,t);const o=new RegExp(`(${db(r)})`,"gi");return(0,s.createInterpolateElement)(t.replace(o,"$&"),{mark:(0,s.createElement)("mark",null)})};var sL=(0,s.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(i.Path,{d:"M12 15.8c-3.7 0-6.8-3-6.8-6.8s3-6.8 6.8-6.8c3.7 0 6.8 3 6.8 6.8s-3.1 6.8-6.8 6.8zm0-12C9.1 3.8 6.8 6.1 6.8 9s2.4 5.2 5.2 5.2c2.9 0 5.2-2.4 5.2-5.2S14.9 3.8 12 3.8zM8 17.5h8V19H8zM10 20.5h4V22h-4z"}));var lL=function(e){const{children:t}=e;return(0,s.createElement)("div",{className:"components-tip"},(0,s.createElement)(ay,{icon:sL}),(0,s.createElement)("p",null,t))};var cL=function e(t){let{__nextHasNoMarginBottom:n,label:r,checked:o,help:i,className:a,onChange:l,disabled:c}=t;const u=`inspector-toggle-control-${(0,d.useInstanceId)(e)}`,f=Bu()("components-toggle-control",a,!n&&$f({marginBottom:qm(3)},"",""));let p,m;return i&&("function"==typeof i?void 0!==o&&(m=i(o)):m=i,m&&(p=u+"__help")),(0,s.createElement)(Tv,{id:u,help:m,className:f,__nextHasNoMarginBottom:!0},(0,s.createElement)(Uv,{justify:"flex-start",spacing:3},(0,s.createElement)(jP,{id:u,checked:o,onChange:function(e){l(e.target.checked)},"aria-describedby":p,disabled:c}),(0,s.createElement)(Hm,{as:"label",htmlFor:u,className:"components-toggle-control__label"},r)))};const uL=(0,s.forwardRef)((function(e,t){const{icon:n,label:r,...o}=e;return(0,s.createElement)(OP,a({},o,{isIcon:!0,"aria-label":r,showTooltip:!0,ref:t}),(0,s.createElement)(Zl,{icon:n}))}));var dL=uL,fL=["baseId","unstable_idCountRef","unstable_virtual","rtl","orientation","items","groups","currentId","loop","wrap","shift","unstable_moves","unstable_hasActiveWidget","unstable_includesBaseElement","setBaseId","registerItem","unregisterItem","registerGroup","unregisterGroup","move","next","previous","up","down","first","last","sort","unstable_setVirtual","setRTL","setOrientation","setCurrentId","setLoop","setWrap","setShift","reset","unstable_setIncludesBaseElement","unstable_setHasActiveWidget"],pL=fL,mL=z({as:"button",memo:!0,useHook:F({name:"ToolbarItem",compose:ke,keys:pL})});var hL=(0,s.createContext)();var gL=(0,s.forwardRef)((function(e,t){let{children:n,as:r,...o}=e;const i=(0,s.useContext)(hL);if("function"!=typeof n&&!r)return"undefined"!=typeof process&&process.env,null;const l={...o,ref:t,"data-toolbar-item":!0};return i?(0,s.createElement)(mL,a({},i,l,{as:r}),n):r?(0,s.createElement)(r,l,n):n(l)}));var vL=e=>(0,s.createElement)("div",{className:e.className},e.children);var bL=(0,s.forwardRef)((function(e,t){let{containerClassName:n,className:r,extraProps:o,children:i,title:l,isActive:u,isDisabled:d,...f}=e;return(0,s.useContext)(hL)?(0,s.createElement)(gL,a({className:c()("components-toolbar-button",r)},o,f,{ref:t}),(e=>(0,s.createElement)(rd,a({label:l,isPressed:u,disabled:d},e),i))):(0,s.createElement)(vL,{className:n},(0,s.createElement)(rd,a({ref:t,icon:f.icon,label:l,shortcut:f.shortcut,"data-subscript":f.subscript,onClick:e=>{e.stopPropagation(),f.onClick&&f.onClick(e)},className:c()("components-toolbar__control",r),isPressed:u,disabled:d,"data-toolbar-item":!0},o,f),i))}));var yL=e=>{let{className:t,children:n,...r}=e;return(0,s.createElement)("div",a({className:t},r),n)};var wL=function(e){let{controls:t=[],toggleProps:n,...r}=e;const o=e=>(0,s.createElement)(PS,a({controls:t,toggleProps:{...e,"data-toolbar-item":!0}},r));return(0,s.useContext)(hL)?(0,s.createElement)(gL,n,o):o(n)};var xL=function(e){var t;let{controls:n=[],children:r,className:o,isCollapsed:i,title:l,...u}=e;const d=(0,s.useContext)(hL);if(!(n&&n.length||r))return null;const f=c()(d?"components-toolbar-group":"components-toolbar",o);let p=n;return Array.isArray(p[0])||(p=[p]),i?(0,s.createElement)(wL,a({label:l,controls:p,className:f,children:r},u)):(0,s.createElement)(yL,a({className:f},u),null===(t=p)||void 0===t?void 0:t.flatMap(((e,t)=>e.map(((e,n)=>(0,s.createElement)(bL,a({key:[t,n].join(),containerClassName:t>0&&0===n?"has-left-divider":null},e)))))),r)};var _L=F({name:"Toolbar",compose:dm,keys:fL,useProps:function(e,t){return m({role:"toolbar","aria-orientation":e.orientation},t)}}),EL=z({as:"div",useHook:_L,useCreateElement:function(e,t,n){return N(e,t,n)}});var CL=(0,s.forwardRef)((function(e,t){let{label:n,...r}=e;const o=function(e){void 0===e&&(e={});var t=Ap(e),n=t.orientation;return rm(m({orientation:void 0===n?"horizontal":n},h(t,["orientation"])))}({loop:!0,baseId:r.id,rtl:(0,u.isRTL)()});return(0,s.createElement)(hL.Provider,{value:o},(0,s.createElement)(EL,a({ref:t,"aria-label":n},o,r)))}));var kL=(0,s.forwardRef)((function(e,t){let{className:n,label:r,...o}=e;if(!r)return Kl()("Using Toolbar without label prop",{since:"5.6",alternative:"ToolbarGroup component",link:"https://developer.wordpress.org/block-editor/components/toolbar/"}),(0,s.createElement)(xL,a({},o,{className:n}));const i=c()("components-accessible-toolbar",n);return(0,s.createElement)(CL,a({className:i,label:r,ref:t},o))}));var SL=(0,s.forwardRef)((function(e,t){return(0,s.useContext)(hL)?(0,s.createElement)(gL,a({ref:t},e.toggleProps),(t=>(0,s.createElement)(PS,a({},e,{popoverProps:{variant:"toolbar",...e.popoverProps},toggleProps:t})))):(0,s.createElement)(PS,e)}));const TL={columns:e=>$f("grid-template-columns:",`repeat( ${e}, minmax(0, 1fr) )`,";",""),spacing:$f("column-gap:",qm(2),";row-gap:",qm(4),";",""),item:{fullWidth:{name:"18iuzk9",styles:"grid-column:1/-1"}}},NL={name:"huufmu",styles:">div:not( :first-of-type ){display:none;}"},RL=$f(TL.item.fullWidth," gap:",qm(2),";.components-dropdown-menu{margin:",qm(-1)," 0;line-height:0;}&&&& .components-dropdown-menu__toggle{padding:0;min-width:",qm(6),";}",""),IL={name:"1pmxm02",styles:"font-size:inherit;font-weight:500;line-height:normal;&&{margin:0;}"},ML=$f(TL.item.fullWidth,"&>div,&>fieldset{padding-bottom:0;margin-bottom:0;max-width:100%;}&& ",yv,"{margin-bottom:0;",wv,":last-child{margin-bottom:0;}}",Cv,"{margin-bottom:0;}&& ",Yh,"{label{line-height:1.4em;}}",""),PL={name:"eivff4",styles:"display:none"},OL={name:"16gsvie",styles:"min-width:200px"},DL=Zu("span",{target:"ews648u0"})("color:",kp.ui.themeDark10,";font-size:11px;font-weight:500;line-height:1.4;",zh({marginLeft:qm(3)})," text-transform:uppercase;"),AL=$f("color:",kp.gray[900],";&&[aria-disabled='true']{color:",kp.gray[700],";opacity:1;&:hover{color:",kp.gray[700],";}",DL,"{opacity:0.3;}}",""),LL=()=>{},zL=(0,s.createContext)({menuItems:{default:{},optional:{}},hasMenuItems:!1,isResetting:!1,shouldRenderPlaceholderItems:!1,registerPanelItem:LL,deregisterPanelItem:LL,flagItemCustomization:LL,areAllOptionalControlsHidden:!0}),BL=()=>(0,s.useContext)(zL);const FL=e=>{let{itemClassName:t,items:n,toggleItem:r}=e;if(!n.length)return null;const o=(0,s.createElement)(DL,{"aria-hidden":!0},(0,u.__)("Reset"));return(0,s.createElement)(oO,{label:(0,u.__)("Defaults")},n.map((e=>{let[n,i]=e;return i?(0,s.createElement)(iO,{key:n,className:t,role:"menuitem",label:(0,u.sprintf)((0,u.__)("Reset %s"),n),onClick:()=>{r(n),(0,lb.speak)((0,u.sprintf)((0,u.__)("%s reset to default"),n),"assertive")},suffix:o},n):(0,s.createElement)(iO,{key:n,className:t,role:"menuitemcheckbox",isSelected:!0,"aria-disabled":!0},n)})))},VL=e=>{let{items:t,toggleItem:n}=e;return t.length?(0,s.createElement)(oO,{label:(0,u.__)("Tools")},t.map((e=>{let[t,r]=e;const o=r?(0,u.sprintf)((0,u.__)("Hide and reset %s"),t):(0,u.sprintf)((0,u.__)("Show %s"),t);return(0,s.createElement)(iO,{key:t,icon:r&&F_,isSelected:r,label:o,onClick:()=>{r?(0,lb.speak)((0,u.sprintf)((0,u.__)("%s hidden and reset to default"),t),"assertive"):(0,lb.speak)((0,u.sprintf)((0,u.__)("%s is now visible"),t),"assertive"),n(t)},role:"menuitemcheckbox"},t)}))):null};var HL=Vu(((e,t)=>{const{areAllOptionalControlsHidden:n,defaultControlsItemClassName:r,dropdownMenuClassName:o,hasMenuItems:i,headingClassName:l,label:c,menuItems:d,resetAll:f,toggleItem:p,...m}=function(e){const{className:t,...n}=Fu(e,"ToolsPanelHeader"),r=Bu(),o=(0,s.useMemo)((()=>r(RL,t)),[t,r]),i=(0,s.useMemo)((()=>r(OL)),[r]),a=(0,s.useMemo)((()=>r(IL)),[r]),l=(0,s.useMemo)((()=>r(AL)),[r]),{menuItems:c,hasMenuItems:u,areAllOptionalControlsHidden:d}=BL();return{...n,areAllOptionalControlsHidden:d,defaultControlsItemClassName:l,dropdownMenuClassName:i,hasMenuItems:u,headingClassName:a,menuItems:c,className:o}}(e);if(!c)return null;const h=Object.entries((null==d?void 0:d.default)||{}),g=Object.entries((null==d?void 0:d.optional)||{}),v=n?$m:Rk,b=(0,u.sprintf)((0,u._x)("%s options","Button label to reveal tool panel options"),c),y=n?(0,u.__)("All options are currently hidden"):void 0,w=[...h,...g].some((e=>{let[,t]=e;return t}));return(0,s.createElement)(Uv,a({},m,{ref:t}),(0,s.createElement)($_,{level:2,className:l},c),i&&(0,s.createElement)(PS,{icon:v,label:b,menuProps:{className:o},toggleProps:{isSmall:!0,describedBy:y}},(()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(FL,{items:h,toggleItem:p,itemClassName:r}),(0,s.createElement)(VL,{items:g,toggleItem:p}),(0,s.createElement)(oO,null,(0,s.createElement)(iO,{"aria-disabled":!w,variant:"tertiary",onClick:()=>{w&&(f(),(0,lb.speak)((0,u.__)("All options reset"),"assertive"))}},(0,u.__)("Reset all")))))))}),"ToolsPanelHeader");const jL=e=>{let{panelItems:t,shouldReset:n,currentMenuItems:r}=e;const o={default:{},optional:{}};return t.forEach((e=>{var t;let{hasValue:i,isShownByDefault:a,label:s}=e;const l=a?"default":"optional",c=null==r||null===(t=r[l])||void 0===t?void 0:t[s],u=c||i();o[l][s]=!n&&u})),o},$L=e=>e&&0===Object.keys(e).length;function WL(e){const{className:t,resetAll:n,panelId:r,hasInnerWrapper:o,shouldRenderPlaceholderItems:i,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l,...c}=Fu(e,"ToolsPanel"),u=(0,s.useRef)(!1),d=u.current;(0,s.useEffect)((()=>{d&&(u.current=!1)}),[d]);const[f,p]=(0,s.useState)([]),m=(0,s.useCallback)((e=>{p((t=>{const n=[...t],r=n.findIndex((t=>t.label===e.label));return-1!==r&&n.splice(r,1),[...n,e]}))}),[p]),h=(0,s.useCallback)((e=>{p((t=>{const n=[...t],r=n.findIndex((t=>t.label===e));return-1!==r&&n.splice(r,1),n}))}),[p]),[g,v]=(0,s.useState)({default:{},optional:{}});(0,s.useEffect)((()=>{v((e=>jL({panelItems:f,shouldReset:!1,currentMenuItems:e})))}),[f,v]);const b=(0,s.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";v((n=>({...n,[t]:{...n[t],[e]:!0}})))}),[v]),[y,w]=(0,s.useState)(!1);(0,s.useEffect)((()=>{if($L(null==g?void 0:g.default)&&!$L(null==g?void 0:g.optional)){const e=!Object.entries(g.optional).some((e=>{let[,t]=e;return t}));w(e)}}),[g,w]);const x=Bu(),_=(0,s.useMemo)((()=>{const e=o&&$f(">div:not( :first-of-type ){display:grid;",TL.columns(2)," ",TL.spacing," ",TL.item.fullWidth,";}","");const n=$L(null==g?void 0:g.default)&&y&&NL;return x((e=>$f(TL.columns(e)," ",TL.spacing," border-top:",ph.borderWidth," solid ",kp.gray[300],";margin-top:-1px;padding:",qm(4),";",""))(2),e,n,t)}),[y,t,x,o,g]),E=(0,s.useCallback)((e=>{const t=f.find((t=>t.label===e));if(!t)return;const n=t.isShownByDefault?"default":"optional",r={...g,[n]:{...g[n],[e]:!g[n][e]}};v(r)}),[g,f,v]),C=(0,s.useCallback)((()=>{if("function"==typeof n){u.current=!0;const e=[];f.forEach((t=>{t.resetAllFilter&&e.push(t.resetAllFilter)})),n(e)}const e=jL({panelItems:f,shouldReset:!0});v(e)}),[f,n,v]),k=e=>{const t=g.optional||{},n=e.find((e=>e.isShownByDefault||!!t[e.label]));return null==n?void 0:n.label},S=k(f),T=k([...f].reverse());return{...c,panelContext:(0,s.useMemo)((()=>({areAllOptionalControlsHidden:y,deregisterPanelItem:h,firstDisplayedItem:S,flagItemCustomization:b,hasMenuItems:!!f.length,isResetting:u.current,lastDisplayedItem:T,menuItems:g,panelId:r,registerPanelItem:m,shouldRenderPlaceholderItems:i,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l})),[y,h,S,b,T,g,r,f,m,i,a,l]),resetAllItems:C,toggleItem:E,className:_}}var UL=Vu(((e,t)=>{const{children:n,label:r,panelContext:o,resetAllItems:i,toggleItem:l,...c}=WL(e);return(0,s.createElement)(xE,a({},c,{columns:2,ref:t}),(0,s.createElement)(zL.Provider,{value:o},(0,s.createElement)(HL,{label:r,resetAll:i,toggleItem:l}),n))}),"ToolsPanel");var GL=Vu(((e,t)=>{const{children:n,isShown:r,shouldRenderPlaceholder:o,...i}=function(e){var t,n,r;const{className:o,hasValue:i,isShownByDefault:a,label:l,panelId:c,resetAllFilter:u,onDeselect:f,onSelect:p,...m}=Fu(e,"ToolsPanelItem"),{panelId:h,menuItems:g,registerPanelItem:v,deregisterPanelItem:b,flagItemCustomization:y,isResetting:w,shouldRenderPlaceholderItems:x,firstDisplayedItem:_,lastDisplayedItem:E,__experimentalFirstVisibleItemClass:C,__experimentalLastVisibleItemClass:k}=BL(),S=(0,s.useCallback)(i,[c,i]),T=(0,s.useCallback)(u,[c,u]),N=(0,d.usePrevious)(h),R=h===c||null===h;(0,s.useEffect)((()=>(R&&null!==N&&v({hasValue:S,isShownByDefault:a,label:l,resetAllFilter:T,panelId:c}),()=>{(null===N&&h||h===c)&&b(l)})),[h,R,a,l,S,c,N,T,v,b]);const I=a?"default":"optional",M=null==g||null===(t=g[I])||void 0===t?void 0:t[l],P=(0,d.usePrevious)(M),O=void 0!==(null==g||null===(n=g[I])||void 0===n?void 0:n[l]),D=i(),A=(0,d.usePrevious)(D),L=D&&!A;(0,s.useEffect)((()=>{L&&(a||null===h)&&y(l,I)}),[h,L,a,I,l,y]),(0,s.useEffect)((()=>{O&&!w&&R&&(!M||D||P||null==p||p(),!M&&P&&(null==f||f()))}),[R,M,O,w,D,P,p,f]);const z=a?void 0!==(null==g||null===(r=g[I])||void 0===r?void 0:r[l]):M,B=Bu(),F=(0,s.useMemo)((()=>B(ML,x&&!z&&PL,o,_===l&&C,E===l&&k)),[z,x,o,B,_,E,C,k,l]);return{...m,isShown:z,shouldRenderPlaceholder:x,className:F}}(e);return r?(0,s.createElement)(Qu,a({},i,{ref:t}),n):o?(0,s.createElement)(Qu,a({},i,{ref:t})):null}),"ToolsPanelItem"),YL=window.wp.keycodes;const qL=(0,s.createContext)(),KL=qL.Provider;function XL(e){let{children:t}=e;const[n,r]=(0,s.useState)(),o=(0,s.useMemo)((()=>({lastFocusedElement:n,setLastFocusedElement:r})),[n]);return(0,s.createElement)(KL,{value:o},t)}function ZL(e){const t=ES.focus.focusable.find(e,{sequential:!0});if(t&&t.length)return t.filter((t=>t.closest('[role="row"]')===e))}var JL=(0,s.forwardRef)((function(e,t){let{children:n,onExpandRow:r=(()=>{}),onCollapseRow:o=(()=>{}),onFocusRow:i=(()=>{}),applicationAriaLabel:l,...c}=e;const u=(0,s.useCallback)((e=>{const{keyCode:t,metaKey:n,ctrlKey:a,altKey:s}=e;if(n||a||s||![YL.UP,YL.DOWN,YL.LEFT,YL.RIGHT,YL.HOME,YL.END].includes(t))return;e.stopPropagation();const{activeElement:l}=document,{currentTarget:c}=e;if(!c.contains(l))return;const u=l.closest('[role="row"]'),d=ZL(u),f=d.indexOf(l),p=0===f,m=p&&"false"===u.getAttribute("aria-expanded")&&t===YL.RIGHT;if([YL.LEFT,YL.RIGHT].includes(t)){let n;if(n=t===YL.LEFT?Math.max(0,f-1):Math.min(f+1,d.length-1),p){if(t===YL.LEFT){var h,g,v;if("true"===u.getAttribute("aria-expanded"))return o(u),void e.preventDefault();const t=Math.max(parseInt(null!==(h=null==u?void 0:u.getAttribute("aria-level"))&&void 0!==h?h:1,10)-1,1),n=Array.from(c.querySelectorAll('[role="row"]'));let r=u;for(let e=n.indexOf(u);e>=0;e--)if(parseInt(n[e].getAttribute("aria-level"),10)===t){r=n[e];break}null===(g=ZL(r))||void 0===g||null===(v=g[0])||void 0===v||v.focus()}if(t===YL.RIGHT){if("false"===u.getAttribute("aria-expanded"))return r(u),void e.preventDefault();const t=ZL(u);var b;if(t.length>0)null===(b=t[n])||void 0===b||b.focus()}return void e.preventDefault()}if(m)return;d[n].focus(),e.preventDefault()}else if([YL.UP,YL.DOWN].includes(t)){const n=Array.from(c.querySelectorAll('[role="row"]')),r=n.indexOf(u);let o;if(o=t===YL.UP?Math.max(0,r-1):Math.min(r+1,n.length-1),o===r)return void e.preventDefault();const a=ZL(n[o]);if(!a||!a.length)return void e.preventDefault();a[Math.min(f,a.length-1)].focus(),i(e,u,n[o]),e.preventDefault()}else if([YL.HOME,YL.END].includes(t)){const n=Array.from(c.querySelectorAll('[role="row"]')),r=n.indexOf(u);let o;if(o=t===YL.HOME?0:n.length-1,o===r)return void e.preventDefault();const a=ZL(n[o]);if(!a||!a.length)return void e.preventDefault();a[Math.min(f,a.length-1)].focus(),i(e,u,n[o]),e.preventDefault()}}),[r,o,i]);return(0,s.createElement)(XL,null,(0,s.createElement)("div",{role:"application","aria-label":l},(0,s.createElement)("table",a({},c,{role:"treegrid",onKeyDown:u,ref:t}),(0,s.createElement)("tbody",null,n))))}));var QL=(0,s.forwardRef)((function(e,t){let{children:n,level:r,positionInSet:o,setSize:i,isExpanded:l,...c}=e;return(0,s.createElement)("tr",a({},c,{ref:t,role:"row","aria-level":r,"aria-posinset":o,"aria-setsize":i,"aria-expanded":l}),n)})),ez=(0,s.forwardRef)((function(e,t){let{children:n,as:r,...o}=e;const i=(0,s.useRef)(),a=t||i,{lastFocusedElement:l,setLastFocusedElement:c}=(0,s.useContext)(qL);let u;l&&(u=l===a.current?0:-1);const d={ref:a,tabIndex:u,onFocus:e=>c(e.target),...o};return"function"==typeof n?n(d):(0,s.createElement)(r,d,n)})),tz=(0,s.forwardRef)((function(e,t){let{children:n,...r}=e;return(0,s.createElement)(ez,a({ref:t},r),n)})),nz=(0,s.forwardRef)((function(e,t){let{children:n,withoutGridItem:r=!1,...o}=e;return(0,s.createElement)("td",a({},o,{role:"gridcell"}),r?n:(0,s.createElement)(tz,{ref:t},n))}));function rz(e){e.stopPropagation()}var oz=(0,s.forwardRef)(((e,t)=>(Kl()("wp.components.IsolatedEventContainer",{since:"5.7"}),(0,s.createElement)("div",a({},e,{ref:t,onMouseDown:rz})))));function iz(e){return Ld((0,s.useContext)(Bd).fills,{sync:!0}).get(e)}const az=Zu("div",{target:"ebn2ljm1"})({name:"5ob2ly",styles:"display:flex;position:relative"}),sz=Zu("div",{target:"ebn2ljm0"})((e=>{let{isLayered:t,offsetAmount:n}=e;return $f(t?zh({marginLeft:n})():zh({right:-1*n})(),"","")})," ",(e=>{let{isLayered:t}=e;return t?lz:cz})," ",(e=>{let{zIndex:t}=e;return $f({zIndex:t},"","")}),";"),lz={name:"a4hmbt",styles:"position:absolute"},cz={name:"bjn8wh",styles:"position:relative"};const uz=Vu((function(e,t){const{children:n,className:r,isLayered:o=!0,isReversed:i=!1,offset:l=0,...c}=Fu(e,"ZStack"),u=$v(n),d=u.length-1,f=u.map(((e,t)=>{const n=i?d-t:t,r=l*t,a=(0,s.isValidElement)(e)?e.key:t;return(0,s.createElement)(sz,{isLayered:o,offsetAmount:r,zIndex:n,key:a},e)}));return(0,s.createElement)(az,a({},c,{className:r,ref:t}),f)}),"ZStack");var dz=uz;const fz={previous:[{modifier:"ctrlShift",character:"`"},{modifier:"ctrlShift",character:"~"},{modifier:"access",character:"p"}],next:[{modifier:"ctrl",character:"`"},{modifier:"access",character:"n"}]};function pz(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fz;const t=(0,s.useRef)(),[n,r]=(0,s.useState)(!1);function o(e){const n=Array.from(t.current.querySelectorAll('[role="region"][tabindex="-1"]'));if(!n.length)return;let o=n[0];const i=n.indexOf(t.current.ownerDocument.activeElement.closest('[role="region"][tabindex="-1"]'));if(-1!==i){let t=i+e;t=-1===t?n.length-1:t,t=t===n.length?0:t,o=n[t]}o.focus(),r(!0)}const i=(0,d.useRefEffect)((e=>{function t(){r(!1)}return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}),[r]);return{ref:(0,d.useMergeRefs)([t,i]),className:n?"is-focusing-regions":"",onKeyDown(t){e.previous.some((e=>{let{modifier:n,character:r}=e;return YL.isKeyboardEvent[n](t,r)}))?o(-1):e.next.some((e=>{let{modifier:n,character:r}=e;return YL.isKeyboardEvent[n](t,r)}))&&o(1)}}}var mz=(0,d.createHigherOrderComponent)((e=>t=>{let{shortcuts:n,...r}=t;return(0,s.createElement)("div",pz(n),(0,s.createElement)(e,r))}),"navigateRegions");var hz=(0,d.createHigherOrderComponent)((e=>function(t){const n=(0,d.useConstrainedTabbing)();return(0,s.createElement)("div",{ref:n,tabIndex:-1},(0,s.createElement)(e,t))}),"withConstrainedTabbing"),gz=e=>(0,d.createHigherOrderComponent)((t=>class extends s.Component{constructor(){super(...arguments),this.nodeRef=this.props.node,this.state={fallbackStyles:void 0,grabStylesCompleted:!1},this.bindRef=this.bindRef.bind(this)}bindRef(e){e&&(this.nodeRef=e)}componentDidMount(){this.grabFallbackStyles()}componentDidUpdate(){this.grabFallbackStyles()}grabFallbackStyles(){const{grabStylesCompleted:t,fallbackStyles:n}=this.state;if(this.nodeRef&&!t){const t=e(this.nodeRef,this.props);Ql()(t,n)||this.setState({fallbackStyles:t,grabStylesCompleted:Object.values(t).every(Boolean)})}}render(){const e=(0,s.createElement)(t,a({},this.props,this.state.fallbackStyles));return this.props.node?e:(0,s.createElement)("div",{ref:this.bindRef}," ",e," ")}}),"withFallbackStyles"),vz=window.wp.hooks;function bz(e){return(0,d.createHigherOrderComponent)((t=>{const n="core/with-filters/"+e;let r;class o extends s.Component{constructor(){super(...arguments),void 0===r&&(r=(0,vz.applyFilters)(e,t))}componentDidMount(){o.instances.push(this),1===o.instances.length&&((0,vz.addAction)("hookRemoved",n,a),(0,vz.addAction)("hookAdded",n,a))}componentWillUnmount(){o.instances=o.instances.filter((e=>e!==this)),0===o.instances.length&&((0,vz.removeAction)("hookRemoved",n),(0,vz.removeAction)("hookAdded",n))}render(){return(0,s.createElement)(r,this.props)}}o.instances=[];const i=(0,d.debounce)((()=>{r=(0,vz.applyFilters)(e,t),o.instances.forEach((e=>{e.forceUpdate()}))}),16);function a(t){t===e&&i()}return o}),"withFilters")}var yz=(0,d.createHigherOrderComponent)((e=>{const t=function(){let{onFocusReturn:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>n=>{const r=(0,d.useFocusReturn)(e);return(0,s.createElement)("div",{ref:r},(0,s.createElement)(t,n))}};if((n=e)instanceof s.Component||"function"==typeof n){const n=e;return t()(n)}var n;return t(e)}),"withFocusReturn");const wz=e=>{let{children:t}=e;return Kl()("wp.components.FocusReturnProvider component",{since:"5.7",hint:"This provider is not used anymore. You can just remove it from your codebase"}),t};var xz=(0,d.createHigherOrderComponent)((e=>{function t(t,r){const[o,i]=(0,s.useState)([]),l=(0,s.useMemo)((()=>{const e=e=>{const t=e.id?e:{...e,id:tf()};i((e=>[...e,t]))};return{createNotice:e,createErrorNotice:t=>{e({status:"error",content:t})},removeNotice:e=>{i((t=>t.filter((t=>t.id!==e))))},removeAllNotices:()=>{i([])}}}),[]),c={...t,noticeList:o,noticeOperations:l,noticeUI:o.length>0&&(0,s.createElement)(_D,{className:"components-with-notices-ui",notices:o,onRemove:l.removeNotice})};return n?(0,s.createElement)(e,a({},c,{ref:r})):(0,s.createElement)(e,c)}let n;const{render:r}=e;return"function"==typeof r?(n=!0,(0,s.forwardRef)(t)):t})),_z=window.wp.privateApis;const{lock:Ez,unlock:Cz}=(0,_z.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/components"),kz={};Ez(kz,{CustomSelectControl:xN,__experimentalPopoverLegacyPositionToPlacement:bf})}(),(window.wp=window.wp||{}).components=r}(); \ No newline at end of file diff --git a/wp-includes/js/dist/edit-site.js b/wp-includes/js/dist/edit-site.js index 3a5ec5a3f0..7d7d971808 100644 --- a/wp-includes/js/dist/edit-site.js +++ b/wp-includes/js/dist/edit-site.js @@ -6986,8 +6986,7 @@ function NewTemplate(_ref) { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { - setTemplate, - setCanvasMode + setTemplate } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); async function createTemplate(template) { @@ -7032,13 +7031,12 @@ function NewTemplate(_ref) { throwOnError: true }); // Set template before navigating away to avoid initial stale value. - setTemplate(newTemplate.id, newTemplate.slug); // Switch to edit mode. - - setCanvasMode('edit'); // Navigate to the created template editor. + setTemplate(newTemplate.id, newTemplate.slug); // Navigate to the created template editor. history.push({ postId: newTemplate.id, - postType: newTemplate.type + postType: newTemplate.type, + canvas: 'edit' }); createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Title of the created template e.g: "Category". (0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'), title), { @@ -7346,8 +7344,6 @@ const getCleanTemplatePartSlug = title => { - - function NewTemplatePart(_ref) { let { postType, @@ -7362,9 +7358,6 @@ function NewTemplatePart(_ref) { const { saveEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - const { - setCanvasMode - } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); const existingTemplateParts = useExistingTemplateParts(); async function createTemplatePart(_ref2) { @@ -7391,13 +7384,12 @@ function NewTemplatePart(_ref) { }, { throwOnError: true }); - setIsModalOpen(false); // Switch to edit mode. - - setCanvasMode('edit'); // Navigate to the created template part editor. + setIsModalOpen(false); // Navigate to the created template part editor. history.push({ postId: templatePart.id, - postType: 'wp_template_part' + postType: 'wp_template_part', + canvas: 'edit' }); // TODO: Add a success notice? } catch (error) { const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while creating the template part.'); @@ -17187,13 +17179,15 @@ function useInitEditedEntityFromURL() { url } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { - getSite + getSite, + getUnstableBase } = select(external_wp_coreData_namespaceObject.store); const siteData = getSite(); + const base = getUnstableBase(); return { - isRequestingSite: !siteData, + isRequestingSite: !base, homepageId: (siteData === null || siteData === void 0 ? void 0 : siteData.show_on_front) === 'page' ? siteData.page_on_front : null, - url: siteData === null || siteData === void 0 ? void 0 : siteData.url + url: base === null || base === void 0 ? void 0 : base.home }; }, []); const { @@ -17330,6 +17324,7 @@ function SiteIcon(_ref) { + /** * Internal dependencies */ @@ -17405,7 +17400,7 @@ const SiteHub = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) className: "edit-site-layout__view-mode-toggle-icon" }))), showLabels && (0,external_wp_element_namespaceObject.createElement)("div", { className: "edit-site-site-hub__site-title" - }, siteTitle))); + }, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteTitle)))); }); /* harmony default export */ var site_hub = (SiteHub); diff --git a/wp-includes/js/dist/edit-site.min.js b/wp-includes/js/dist/edit-site.min.js index a9fa9c143c..b0ba32a262 100644 --- a/wp-includes/js/dist/edit-site.min.js +++ b/wp-includes/js/dist/edit-site.min.js @@ -9,4 +9,4 @@ Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/!function(){"use strict";var a={}.hasOwnProperty;function r(){for(var e=[],t=0;t2096103.424&&p!==d))return navigator.msSaveBlob?navigator.msSaveBlob(y(c),_):E(c);s=(c=y(c)).type||i}else if(/([\x80-\xff])/.test(c)){for(var g=0,v=new Uint8Array(c.length),f=v.length;g({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),M=(e,t)=>n=>{let{registry:a,dispatch:r}=n;if(!t)return;a.select(T.store).get(e,"isComplementaryAreaVisible")||a.dispatch(T.store).set(e,"isComplementaryAreaVisible",!0),r({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},I=e=>t=>{let{registry:n}=t;n.select(T.store).get(e,"isComplementaryAreaVisible")&&n.dispatch(T.store).set(e,"isComplementaryAreaVisible",!1)},P=(e,t)=>n=>{let{registry:a}=n;if(!t)return;const r=a.select(T.store).get(e,"pinnedItems");!0!==(null==r?void 0:r[t])&&a.dispatch(T.store).set(e,"pinnedItems",{...r,[t]:!0})},B=(e,t)=>n=>{let{registry:a}=n;if(!t)return;const r=a.select(T.store).get(e,"pinnedItems");a.dispatch(T.store).set(e,"pinnedItems",{...r,[t]:!1})};function z(e,t){return function(n){let{registry:a}=n;p()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),a.dispatch(T.store).toggle(e,t)}}function V(e,t,n){return function(a){let{registry:r}=a;p()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),r.dispatch(T.store).set(e,t,!!n)}}function R(e,t){return function(n){let{registry:a}=n;p()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),a.dispatch(T.store).setDefaults(e,t)}}const A=(0,m.createRegistrySelector)((e=>(t,n)=>{var a;const r=e(T.store).get(n,"isComplementaryAreaVisible");if(void 0!==r)return r?null==t||null===(a=t.complementaryAreas)||void 0===a?void 0:a[n]:null})),L=(0,m.createRegistrySelector)((e=>(t,n,a)=>{var r;const l=e(T.store).get(n,"pinnedItems");return null===(r=null==l?void 0:l[a])||void 0===r||r})),D=(0,m.createRegistrySelector)((e=>(t,n,a)=>(p()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(T.store).get(n,a))));var O=(0,m.combineReducers)({complementaryAreas:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:n,area:a}=t;return e[n]?e:{...e,[n]:a}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:n,area:a}=t;return{...e,[n]:a}}}return e}});const F=(0,m.createReduxStore)("core/interface",{reducer:O,actions:e,selectors:t});(0,m.register)(F);var G=window.wp.plugins,H=(0,G.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));var $=H((function(e){let{as:t=y.Button,scope:n,identifier:a,icon:r,selectedIcon:l,name:o,...i}=e;const c=t,u=(0,m.useSelect)((e=>e(F).getActiveComplementaryArea(n)===a),[a]),{enableComplementaryArea:d,disableComplementaryArea:p}=(0,m.useDispatch)(F);return(0,s.createElement)(c,g({icon:l&&u?l:r,onClick:()=>{u?p(n):d(n,a)}},i))}));var U=e=>{let{smallScreenTitle:t,children:n,className:a,toggleButtonProps:r}=e;const l=(0,s.createElement)($,g({icon:C},r));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},t&&(0,s.createElement)("span",{className:"interface-complementary-area-header__small-title"},t),l),(0,s.createElement)("div",{className:f()("components-panel__header","interface-complementary-area-header",a),tabIndex:-1},n,l))};const W=()=>{};function j(e){let{name:t,as:n=y.Button,onClick:a,...r}=e;return(0,s.createElement)(y.Fill,{name:t},(e=>{let{onClick:t}=e;return(0,s.createElement)(n,g({onClick:a||t?function(){(a||W)(...arguments),(t||W)(...arguments)}:void 0},r))}))}j.Slot=function(e){let{name:t,as:n=y.ButtonGroup,fillProps:a={},bubblesVirtually:r,...l}=e;return(0,s.createElement)(y.Slot,{name:t,bubblesVirtually:r,fillProps:a},(e=>{if(!s.Children.toArray(e).length)return null;const t=[];s.Children.forEach(e,(e=>{let{props:{__unstableExplicitMenuItem:n,__unstableTarget:a}}=e;a&&n&&t.push(a)}));const a=s.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&t.includes(e.props.__unstableTarget)?null:e));return(0,s.createElement)(n,l,a)}))};var q=j;const Y=e=>{let{__unstableExplicitMenuItem:t,__unstableTarget:n,...a}=e;return(0,s.createElement)(y.MenuItem,a)};function X(e){let{scope:t,target:n,__unstableExplicitMenuItem:a,...r}=e;return(0,s.createElement)($,g({as:e=>(0,s.createElement)(q,g({__unstableExplicitMenuItem:a,__unstableTarget:`${t}/${n}`,as:Y,name:`${t}/plugin-more-menu`},e)),role:"menuitemcheckbox",selectedIcon:w,name:n,scope:t},r))}function Z(e){let{scope:t,...n}=e;return(0,s.createElement)(y.Fill,g({name:`PinnedItems/${t}`},n))}Z.Slot=function(e){let{scope:t,className:n,...a}=e;return(0,s.createElement)(y.Slot,g({name:`PinnedItems/${t}`},a),(e=>(null==e?void 0:e.length)>0&&(0,s.createElement)("div",{className:f()(n,"interface-pinned-items")},e)))};var K=Z;function Q(e){let{scope:t,children:n,className:a}=e;return(0,s.createElement)(y.Fill,{name:`ComplementaryArea/${t}`},(0,s.createElement)("div",{className:a},n))}const J=H((function(e){let{children:t,className:n,closeLabel:a=(0,E.__)("Close plugin"),identifier:r,header:l,headerClassName:o,icon:i,isPinnable:c=!0,panelClassName:u,scope:d,name:p,smallScreenTitle:_,title:h,toggleShortcut:g,isActiveByDefault:v,showIconLabels:b=!1}=e;const{isActive:C,isPinned:T,activeArea:N,isSmall:M,isLarge:I}=(0,m.useSelect)((e=>{const{getActiveComplementaryArea:t,isItemPinned:n}=e(F),a=t(d);return{isActive:a===r,isPinned:n(d,r),activeArea:a,isSmall:e(k.store).isViewportMatch("< medium"),isLarge:e(k.store).isViewportMatch("large")}}),[r,d]);!function(e,t,n,a,r){const l=(0,s.useRef)(!1),o=(0,s.useRef)(!1),{enableComplementaryArea:i,disableComplementaryArea:c}=(0,m.useDispatch)(F);(0,s.useEffect)((()=>{a&&r&&!l.current?(c(e),o.current=!0):o.current&&!r&&l.current?(o.current=!1,i(e,t)):o.current&&n&&n!==t&&(o.current=!1),r!==l.current&&(l.current=r)}),[a,r,e,t,n])}(d,r,N,C,M);const{enableComplementaryArea:P,disableComplementaryArea:B,pinItem:z,unpinItem:V}=(0,m.useDispatch)(F);return(0,s.useEffect)((()=>{v&&void 0===N&&!M&&P(d,r)}),[N,v,d,r,M]),(0,s.createElement)(s.Fragment,null,c&&(0,s.createElement)(K,{scope:d},T&&(0,s.createElement)($,{scope:d,identifier:r,isPressed:C&&(!b||I),"aria-expanded":C,label:h,icon:b?w:i,showTooltip:!b,variant:b?"tertiary":void 0})),p&&c&&(0,s.createElement)(X,{target:p,scope:d,icon:i},h),C&&(0,s.createElement)(Q,{className:f()("interface-complementary-area",n),scope:d},(0,s.createElement)(U,{className:o,closeLabel:a,onClose:()=>B(d),smallScreenTitle:_,toggleButtonProps:{label:a,shortcut:g,scope:d,identifier:r}},l||(0,s.createElement)(s.Fragment,null,(0,s.createElement)("strong",null,h),c&&(0,s.createElement)(y.Button,{className:"interface-complementary-area__pin-unpin-item",icon:T?S:x,label:T?(0,E.__)("Unpin from toolbar"):(0,E.__)("Pin to toolbar"),onClick:()=>(T?V:z)(d,r),isPressed:T,"aria-expanded":T}))),(0,s.createElement)(y.Panel,{className:u},t)))}));J.Slot=function(e){let{scope:t,...n}=e;return(0,s.createElement)(y.Slot,g({name:`ComplementaryArea/${t}`},n))};var ee=J,te=window.wp.compose;function ne(e){let{children:t,className:n,ariaLabel:a,as:r="div",...l}=e;return(0,s.createElement)(r,g({className:f()("interface-navigable-region",n),"aria-label":a,role:"region",tabIndex:"-1"},l),t)}var ae=(0,s.forwardRef)((function(e,t){let{isDistractionFree:n,footer:a,header:r,editorNotices:l,sidebar:o,secondarySidebar:i,notices:c,content:u,actions:m,labels:d,className:p,enableRegionNavigation:_=!0,shortcuts:h}=e;const v=(0,y.__unstableUseNavigateRegions)(h);!function(e){(0,s.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const b={...{header:(0,E.__)("Header"),body:(0,E.__)("Content"),secondarySidebar:(0,E.__)("Block Library"),sidebar:(0,E.__)("Settings"),actions:(0,E.__)("Publish"),footer:(0,E.__)("Footer")},...d},w={hidden:n?{opacity:0}:{opacity:1},hover:{opacity:1,transition:{type:"tween",delay:.2,delayChildren:.2}}};return(0,s.createElement)("div",g({},_?v:{},{ref:(0,te.useMergeRefs)([t,_?v.ref:void 0]),className:f()(p,"interface-interface-skeleton",v.className,!!a&&"has-footer")}),(0,s.createElement)("div",{className:"interface-interface-skeleton__editor"},!!r&&n&&(0,s.createElement)(ne,{as:y.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":b.header,initial:n?"hidden":"hover",whileHover:"hover",variants:w,transition:{type:"tween",delay:.8}},r),!!r&&!n&&(0,s.createElement)(ne,{className:"interface-interface-skeleton__header",ariaLabel:b.header},r),n&&(0,s.createElement)("div",{className:"interface-interface-skeleton__header"},l),(0,s.createElement)("div",{className:"interface-interface-skeleton__body"},!!i&&(0,s.createElement)(ne,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:b.secondarySidebar},i),!!c&&(0,s.createElement)("div",{className:"interface-interface-skeleton__notices"},c),(0,s.createElement)(ne,{className:"interface-interface-skeleton__content",ariaLabel:b.body},u),!!o&&(0,s.createElement)(ne,{className:"interface-interface-skeleton__sidebar",ariaLabel:b.sidebar},o),!!m&&(0,s.createElement)(ne,{className:"interface-interface-skeleton__actions",ariaLabel:b.actions},m))),!!a&&(0,s.createElement)(ne,{className:"interface-interface-skeleton__footer",ariaLabel:b.footer},a))}));var re=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function le(e){let{as:t=y.DropdownMenu,className:n,label:a=(0,E.__)("Options"),popoverProps:r,toggleProps:l,children:o}=e;return(0,s.createElement)(t,{className:f()("interface-more-menu-dropdown",n),icon:re,label:a,popoverProps:{placement:"bottom-end",...r,className:f()("interface-more-menu-dropdown__content",null==r?void 0:r.className)},toggleProps:{tooltipPosition:"bottom",...l}},(e=>o(e)))}function oe(e){let{closeModal:t,children:n}=e;return(0,s.createElement)(y.Modal,{className:"interface-preferences-modal",title:(0,E.__)("Preferences"),onRequestClose:t},n)}var ie=function(e){let{icon:t,size:n=24,...a}=e;return(0,s.cloneElement)(t,{width:n,height:n,...a})};var se=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var ce=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));const ue="preferences-menu";function me(e){let{sections:t}=e;const n=(0,te.useViewportMatch)("medium"),[a,r]=(0,s.useState)(ue),{tabs:l,sectionsContentMap:o}=(0,s.useMemo)((()=>{let e={tabs:[],sectionsContentMap:{}};return t.length&&(e=t.reduce(((e,t)=>{let{name:n,tabLabel:a,content:r}=t;return e.tabs.push({name:n,title:a}),e.sectionsContentMap[n]=r,e}),{tabs:[],sectionsContentMap:{}})),e}),[t]),i=(0,s.useCallback)((e=>o[e.name]||null),[o]);let c;return c=n?(0,s.createElement)(y.TabPanel,{className:"interface-preferences__tabs",tabs:l,initialTabName:a!==ue?a:void 0,onSelect:r,orientation:"vertical"},i):(0,s.createElement)(y.__experimentalNavigatorProvider,{initialPath:"/",className:"interface-preferences__provider"},(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/"},(0,s.createElement)(y.Card,{isBorderless:!0,size:"small"},(0,s.createElement)(y.CardBody,null,(0,s.createElement)(y.__experimentalItemGroup,null,l.map((e=>(0,s.createElement)(y.__experimentalNavigatorButton,{key:e.name,path:e.name,as:y.__experimentalItem,isAction:!0},(0,s.createElement)(y.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(y.__experimentalTruncate,null,e.title)),(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(ie,{icon:(0,E.isRTL)()?se:ce})))))))))),t.length&&t.map((e=>(0,s.createElement)(y.__experimentalNavigatorScreen,{key:`${e.name}-menu`,path:e.name},(0,s.createElement)(y.Card,{isBorderless:!0,size:"large"},(0,s.createElement)(y.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6"},(0,s.createElement)(y.__experimentalNavigatorBackButton,{icon:(0,E.isRTL)()?ce:se,"aria-label":(0,E.__)("Navigate to the previous view")}),(0,s.createElement)(y.__experimentalText,{size:"16"},e.tabLabel)),(0,s.createElement)(y.CardBody,null,e.content)))))),c}var de=e=>{let{description:t,title:n,children:a}=e;return(0,s.createElement)("fieldset",{className:"interface-preferences-modal__section"},(0,s.createElement)("legend",{className:"interface-preferences-modal__section-legend"},(0,s.createElement)("h2",{className:"interface-preferences-modal__section-title"},n),t&&(0,s.createElement)("p",{className:"interface-preferences-modal__section-description"},t)),a)};var pe=function(e){let{help:t,label:n,isChecked:a,onChange:r,children:l}=e;return(0,s.createElement)("div",{className:"interface-preferences-modal__option"},(0,s.createElement)(y.ToggleControl,{__nextHasNoMarginBottom:!0,help:t,label:n,checked:a,onChange:r}),l)},_e=window.wp.widgets,he=window.wp.hooks,ge=window.wp.mediaUtils;(0,he.addFilter)("editor.MediaUpload","core/edit-site/components/media-upload",(()=>ge.MediaUpload));var ve=window.lodash,fe=window.wp.blockEditor,ye=window.wp.notices,Ee={grad:.9,turn:360,rad:360/(2*Math.PI)},be=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},we=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Se=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},xe=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},ke=function(e){return{r:Se(e.r,0,255),g:Se(e.g,0,255),b:Se(e.b,0,255),a:Se(e.a)}},Ce=function(e){return{r:we(e.r),g:we(e.g),b:we(e.b),a:we(e.a,3)}},Te=/^#([0-9a-f]{3,8})$/i,Ne=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Me=function(e){var t=e.r,n=e.g,a=e.b,r=e.a,l=Math.max(t,n,a),o=l-Math.min(t,n,a),i=o?l===t?(n-a)/o:l===n?2+(a-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:l?o/l*100:0,v:l/255*100,a:r}},Ie=function(e){var t=e.h,n=e.s,a=e.v,r=e.a;t=t/360*6,n/=100,a/=100;var l=Math.floor(t),o=a*(1-n),i=a*(1-(t-l)*n),s=a*(1-(1-t+l)*n),c=l%6;return{r:255*[a,i,o,o,s,a][c],g:255*[s,a,a,i,o,o][c],b:255*[o,o,s,a,a,i][c],a:r}},Pe=function(e){return{h:xe(e.h),s:Se(e.s,0,100),l:Se(e.l,0,100),a:Se(e.a)}},Be=function(e){return{h:we(e.h),s:we(e.s),l:we(e.l),a:we(e.a,3)}},ze=function(e){return Ie((n=(t=e).s,{h:t.h,s:(n*=((a=t.l)<50?a:100-a)/100)>0?2*n/(a+n)*100:0,v:a+n,a:t.a}));var t,n,a},Ve=function(e){return{h:(t=Me(e)).h,s:(r=(200-(n=t.s))*(a=t.v)/100)>0&&r<200?n*a/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,a,r},Re=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ae=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Le=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,De=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Oe={string:[[function(e){var t=Te.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?we(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?we(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Le.exec(e)||De.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:ke({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Re.exec(e)||Ae.exec(e);if(!t)return null;var n,a,r=Pe({h:(n=t[1],a=t[2],void 0===a&&(a="deg"),Number(n)*(Ee[a]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return ze(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,a=e.b,r=e.a,l=void 0===r?1:r;return be(t)&&be(n)&&be(a)?ke({r:Number(t),g:Number(n),b:Number(a),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,a=e.l,r=e.a,l=void 0===r?1:r;if(!be(t)||!be(n)||!be(a))return null;var o=Pe({h:Number(t),s:Number(n),l:Number(a),a:Number(l)});return ze(o)},"hsl"],[function(e){var t=e.h,n=e.s,a=e.v,r=e.a,l=void 0===r?1:r;if(!be(t)||!be(n)||!be(a))return null;var o=function(e){return{h:xe(e.h),s:Se(e.s,0,100),v:Se(e.v,0,100),a:Se(e.a)}}({h:Number(t),s:Number(n),v:Number(a),a:Number(l)});return Ie(o)},"hsv"]]},Fe=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=Ce(this.rgba)).r,n=e.g,a=e.b,l=(r=e.a)<1?Ne(we(255*r)):"","#"+Ne(t)+Ne(n)+Ne(a)+l;var e,t,n,a,r,l},e.prototype.toRgb=function(){return Ce(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Ce(this.rgba)).r,n=e.g,a=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+a+", "+r+")":"rgb("+t+", "+n+", "+a+")";var e,t,n,a,r},e.prototype.toHsl=function(){return Be(Ve(this.rgba))},e.prototype.toHslString=function(){return t=(e=Be(Ve(this.rgba))).h,n=e.s,a=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+a+"%, "+r+")":"hsl("+t+", "+n+"%, "+a+"%)";var e,t,n,a,r},e.prototype.toHsv=function(){return e=Me(this.rgba),{h:we(e.h),s:we(e.s),v:we(e.v),a:we(e.a,3)};var e},e.prototype.invert=function(){return je({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),je(He(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),je(He(this.rgba,-e))},e.prototype.grayscale=function(){return je(He(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),je(Ue(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),je(Ue(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?je({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):we(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Ve(this.rgba);return"number"==typeof e?je({h:e,s:t.s,l:t.l,a:t.a}):we(t.h)},e.prototype.isEqual=function(e){return this.toHex()===je(e).toHex()},e}(),je=function(e){return e instanceof We?e:new We(e)},qe=[],Ye=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Xe=function(e){return.2126*Ye(e.r)+.7152*Ye(e.g)+.0722*Ye(e.b)};var Ze=window.wp.privateApis;const{lock:Ke,unlock:Qe}=(0,Ze.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/edit-site"),{useGlobalSetting:Je}=Qe(fe.privateApis);!function(e){e.forEach((function(e){qe.indexOf(e)<0&&(e(We,Oe),qe.push(e))}))}([function(e){e.prototype.luminance=function(){return e=Xe(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,a,r,l,o,i,s,c=t instanceof e?t:new e(t);return l=this.rgba,o=c.toRgb(),n=(i=Xe(l))>(s=Xe(o))?(i+.05)/(s+.05):(s+.05)/(i+.05),void 0===(a=2)&&(a=0),void 0===r&&(r=Math.pow(10,a)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(o=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(a=n.level)?"AA":a)&&"normal"===o?7:"AA"===r&&"large"===o?3:4.5);var n,a,r,l,o}}]);const et=["background","backgroundColor","color","linkColor","buttonColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","textDecoration","padding","contentSize","wideSize","blockGap"];function tt(e){var t,n,a,r,l,o,i,s,u;if(!e)return et;const m=(0,c.getBlockType)(e);if(!m)return[];const d=[];return null==m||null===(t=m.supports)||void 0===t||null===(n=t.spacing)||void 0===n||!n.blockGap||!0===(null==m||null===(a=m.supports)||void 0===a||null===(r=a.spacing)||void 0===r?void 0:r.__experimentalSkipSerialization)||null!=m&&null!==(l=m.supports)&&void 0!==l&&null!==(o=l.spacing)&&void 0!==o&&null!==(i=o.__experimentalSkipSerialization)&&void 0!==i&&null!==(s=i.some)&&void 0!==s&&s.call(i,(e=>"blockGap"===e))||d.push("blockGap"),null!=m&&null!==(u=m.supports)&&void 0!==u&&u.shadow&&d.push("shadow"),Object.keys(c.__EXPERIMENTAL_STYLE_PROPERTY).forEach((e=>{if(c.__EXPERIMENTAL_STYLE_PROPERTY[e].support)return c.__EXPERIMENTAL_STYLE_PROPERTY[e].requiresOptOut&&c.__EXPERIMENTAL_STYLE_PROPERTY[e].support[0]in m.supports&&!1!==(0,ve.get)(m.supports,c.__EXPERIMENTAL_STYLE_PROPERTY[e].support)||(0,ve.get)(m.supports,c.__EXPERIMENTAL_STYLE_PROPERTY[e].support,!1)?d.push(e):void 0})),d}function nt(e){const[t]=Je("color.palette.custom",e),[n]=Je("color.palette.theme",e),[a]=Je("color.palette.default",e),[r]=Je("color.defaultPalette");return(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,E._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&a&&a.length&&e.push({name:(0,E._x)("Default","Indicates this palette comes from WordPress."),colors:a}),t&&t.length&&e.push({name:(0,E._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,a])}function at(e){const[t]=Je("color.gradients.custom",e),[n]=Je("color.gradients.theme",e),[a]=Je("color.gradients.default",e),[r]=Je("color.defaultGradients");return(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,E._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),r&&a&&a.length&&e.push({name:(0,E._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),t&&t.length&&e.push({name:(0,E._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,a])}const{GlobalStylesContext:rt}=Qe(fe.privateApis),lt={"color.background":"color","color.text":"color","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient","typography.fontSize":"font-size","typography.fontFamily":"font-family"},ot={"color.background":"backgroundColor","color.text":"textColor","color.gradient":"gradient","typography.fontSize":"fontSize","typography.fontFamily":"fontFamily"};function it(e){return e?JSON.parse(JSON.stringify(e)):{}}function st(e){let{name:t,attributes:n,setAttributes:a}=e;const r=(0,s.useMemo)((()=>function(e,t){return tt(e).flatMap((e=>{if(!c.__EXPERIMENTAL_STYLE_PROPERTY[e])return[];const{value:n}=c.__EXPERIMENTAL_STYLE_PROPERTY[e],a=n.join("."),r=t[ot[a]],l=r?`var:preset|${lt[a]}|${r}`:(0,ve.get)(t.style,n);return l?[{path:n,value:l}]:[]}))}(t,n)),[t,n]),{user:l,setUserConfig:o}=(0,s.useContext)(rt),{__unstableMarkNextChangeAsNotPersistent:i}=(0,m.useDispatch)(fe.store),{createSuccessNotice:u}=(0,m.useDispatch)(ye.store),d=(0,s.useCallback)((()=>{if(0===r.length)return;const{style:e}=n,s=it(e),m=it(l);for(const{path:e,value:n}of r)(0,ve.set)(s,e,void 0),(0,ve.set)(m,["styles","blocks",t,...e],n);i(),a({style:s}),o((()=>m),{undoIgnore:!0}),u((0,E.sprintf)((0,E.__)("%s styles applied."),(0,c.getBlockType)(t).title),{type:"snackbar",actions:[{label:(0,E.__)("Undo"),onClick(){i(),a({style:e}),o((()=>l),{undoIgnore:!0})}}]})}),[r,n,l,t]);return(0,s.createElement)(y.BaseControl,{className:"edit-site-push-changes-to-global-styles-control",help:(0,E.sprintf)((0,E.__)("Apply this block’s typography, spacing, dimensions, and color styles to all %s blocks."),(0,c.getBlockType)(t).title)},(0,s.createElement)(y.BaseControl.VisualLabel,null,(0,E.__)("Styles")),(0,s.createElement)(y.Button,{variant:"primary",disabled:0===r.length,onClick:d},(0,E.__)("Apply globally")))}const ct=(0,te.createHigherOrderComponent)((e=>t=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(fe.InspectorAdvancedControls,null,(0,s.createElement)(st,t)))));var ut;(0,he.addFilter)("editor.BlockEdit","core/edit-site/push-changes-to-global-styles",ct),function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(ut||(ut={}));var mt=function(e){return e};var dt="beforeunload",pt="popstate";function _t(e){e.preventDefault(),e.returnValue=""}function ht(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function gt(){return Math.random().toString(36).substr(2,8)}function vt(e){var t=e.pathname,n=void 0===t?"/":t,a=e.search,r=void 0===a?"":a,l=e.hash,o=void 0===l?"":l;return r&&"?"!==r&&(n+="?"===r.charAt(0)?r:"?"+r),o&&"#"!==o&&(n+="#"===o.charAt(0)?o:"#"+o),n}function ft(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var a=e.indexOf("?");a>=0&&(t.search=e.substr(a),e=e.substr(0,a)),e&&(t.pathname=e)}return t}var yt=window.wp.url;const Et=function(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,a=n.history;function r(){var e=n.location,t=e.pathname,r=e.search,l=e.hash,o=a.state||{};return[o.idx,mt({pathname:t,search:r,hash:l,state:o.usr||null,key:o.key||"default"})]}var l=null;n.addEventListener(pt,(function(){if(l)m.call(l),l=null;else{var e=ut.Pop,t=r(),n=t[0],a=t[1];if(m.length){if(null!=n){var o=s-n;o&&(l={action:e,location:a,retry:function(){f(-1*o)}},f(o))}}else v(e)}}));var o=ut.Pop,i=r(),s=i[0],c=i[1],u=ht(),m=ht();function d(e){return"string"==typeof e?e:vt(e)}function p(e,t){return void 0===t&&(t=null),mt(g({pathname:c.pathname,hash:"",search:""},"string"==typeof e?ft(e):e,{state:t,key:gt()}))}function _(e,t){return[{usr:e.state,key:e.key,idx:t},d(e)]}function h(e,t,n){return!m.length||(m.call({action:e,location:t,retry:n}),!1)}function v(e){o=e;var t=r();s=t[0],c=t[1],u.call({action:o,location:c})}function f(e){a.go(e)}null==s&&(s=0,a.replaceState(g({},a.state,{idx:s}),""));var y={get action(){return o},get location(){return c},createHref:d,push:function e(t,r){var l=ut.Push,o=p(t,r);if(h(l,o,(function(){e(t,r)}))){var i=_(o,s+1),c=i[0],u=i[1];try{a.pushState(c,"",u)}catch(e){n.location.assign(u)}v(l)}},replace:function e(t,n){var r=ut.Replace,l=p(t,n);if(h(r,l,(function(){e(t,n)}))){var o=_(l,s),i=o[0],c=o[1];a.replaceState(i,"",c),v(r)}},go:f,back:function(){f(-1)},forward:function(){f(1)},listen:function(e){return u.push(e)},block:function(e){var t=m.push(e);return 1===m.length&&n.addEventListener(dt,_t),function(){t(),m.length||n.removeEventListener(dt,_t)}}};return y}(),bt=Et.push,wt=Et.replace;Et.push=function(e,t){const n=(0,yt.getQueryArgs)(window.location.href),a=(0,yt.removeQueryArgs)(window.location.href,...Object.keys(n)),r=(0,yt.addQueryArgs)(a,e);return bt.call(Et,r,t)},Et.replace=function(e,t){const n=(0,yt.getQueryArgs)(window.location.href),a=(0,yt.removeQueryArgs)(window.location.href,...Object.keys(n)),r=(0,yt.addQueryArgs)(a,e);return wt.call(Et,r,t)};var St=Et;const xt=(0,s.createContext)(),kt=(0,s.createContext)();function Ct(){return(0,s.useContext)(xt)}function Tt(){return(0,s.useContext)(kt)}function Nt(e){const t=new URLSearchParams(e.search);return{...e,params:Object.fromEntries(t.entries())}}function Mt(e){let{children:t}=e;const[n,a]=(0,s.useState)((()=>Nt(St.location)));return(0,s.useEffect)((()=>St.listen((e=>{let{location:t}=e;a(Nt(t))}))),[]),(0,s.createElement)(kt.Provider,{value:St},(0,s.createElement)(xt.Provider,{value:n},t))}function It(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const a=Tt();function r(r){r.preventDefault(),n?a.replace(e,t):a.push(e,t)}const l=(0,yt.getQueryArgs)(window.location.href),o=(0,yt.removeQueryArgs)(window.location.href,...Object.keys(l)),i=(0,yt.addQueryArgs)(o,e);return{href:i,onClick:r}}function Pt(e){let{params:t={},state:n,replace:a=!1,children:r,...l}=e;const{href:o,onClick:i}=It(t,n,a);return(0,s.createElement)("a",g({href:o,onClick:i},l),r)}function Bt(e){let{attributes:t}=e;const{theme:n,slug:a}=t,{params:r}=Ct(),l=(0,m.useSelect)((e=>e(_.store).getEntityRecord("postType","wp_template_part",`${n}//${a}`)),[n,a]),o=It({postId:null==l?void 0:l.id,postType:null==l?void 0:l.type},{fromTemplateId:r.postId});return l?(0,s.createElement)(fe.BlockControls,{group:"other"},(0,s.createElement)(y.ToolbarButton,g({},o,{onClick:e=>{o.onClick(e)}}),(0,E.__)("Edit"))):null}const zt=(0,te.createHigherOrderComponent)((e=>t=>{const{attributes:n,name:a}=t,r="core/template-part"===a&&n.slug;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),r&&(0,s.createElement)(Bt,{attributes:n}))}),"withEditBlockControls");(0,he.addFilter)("editor.BlockEdit","core/edit-site/template-part-edit-button",zt);var Vt=(0,m.combineReducers)({deviceType:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Desktop",t=arguments.length>1?arguments[1]:void 0;return"SET_PREVIEW_DEVICE_TYPE"===t.type?t.deviceType:e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},editedPost:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_EDITED_POST":return{postType:t.postType,id:t.id,context:t.context};case"SET_EDITED_POST_CONTEXT":return{...e,context:t.context}}return e},blockInserterPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value;case"SET_CANVAS_MODE":return!1}return e},listViewPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen;case"SET_CANVAS_MODE":return!1}return e},saveViewPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_IS_SAVE_VIEW_OPENED":return t.isOpen;case"SET_CANVAS_MODE":return!1}return e},canvasMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"init",t=arguments.length>1?arguments[1]:void 0;return"SET_CANVAS_MODE"===t.type?t.mode:e}}),Rt=window.wp.apiFetch,At=n.n(Rt),Lt=window.wp.a11y;const Dt="core/edit-site";function Ot(e){return!!e&&("custom"===(null==e?void 0:e.source)&&(null==e?void 0:e.has_theme_file))}function Ft(e){return function(t){let{registry:n}=t;p()("select( 'core/edit-site' ).toggleFeature( featureName )",{since:"6.0",alternative:"select( 'core/preferences').toggle( 'core/edit-site', featureName )"}),n.dispatch(T.store).toggle("core/edit-site",e)}}function Gt(e){return{type:"SET_PREVIEW_DEVICE_TYPE",deviceType:e}}const Ht=(e,t)=>async n=>{let{dispatch:a,registry:r}=n;if(!t)try{const n=await r.resolveSelect(_.store).getEntityRecord("postType","wp_template",e);t=null==n?void 0:n.slug}catch(e){}a({type:"SET_EDITED_POST",postType:"wp_template",id:e,context:{templateSlug:t}})},$t=e=>async t=>{let{dispatch:n,registry:a}=t;const r=await a.dispatch(_.store).saveEntityRecord("postType","wp_template",e);e.content&&a.dispatch(_.store).editEntityRecord("postType","wp_template",r.id,{blocks:(0,c.parse)(e.content)},{undoIgnore:!0}),n({type:"SET_EDITED_POST",postType:"wp_template",id:r.id,context:{templateSlug:r.slug}})},Ut=e=>async t=>{let{registry:n}=t;try{await n.dispatch(_.store).deleteEntityRecord("postType",e.type,e.id,{force:!0});const t=n.select(_.store).getLastEntityDeleteError("postType",e.type,e.id);if(t)throw t;n.dispatch(ye.store).createSuccessNotice((0,E.sprintf)((0,E.__)('"%s" deleted.'),e.title.rendered),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while deleting the template.");n.dispatch(ye.store).createErrorNotice(t,{type:"snackbar"})}};function Wt(e){return{type:"SET_EDITED_POST",postType:"wp_template_part",id:e}}function jt(){return p()("dispatch( 'core/edit-site' ).setHomeTemplateId",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}function qt(e){return{type:"SET_EDITED_POST_CONTEXT",context:e}}const Yt=e=>async t=>{var n;let{dispatch:a,registry:r}=t;if(!e.path&&null!==(n=e.context)&&void 0!==n&&n.postId){const t=await r.resolveSelect(_.store).getEntityRecord("postType",e.context.postType||"post",e.context.postId);e.path=(0,yt.getPathAndQueryString)(null==t?void 0:t.link)}const l=await r.resolveSelect(_.store).__experimentalGetTemplateForLink(e.path);if(l)return a({type:"SET_EDITED_POST",postType:"wp_template",id:l.id,context:{...e.context,templateSlug:l.slug}}),l.id};function Xt(){return p()("dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}function Zt(){return p()("dispatch( 'core/edit-site' ).openNavigationPanelToMenu",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}function Kt(){return p()("dispatch( 'core/edit-site' ).setIsNavigationPanelOpened",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}function Qt(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function Jt(e){return{type:"UPDATE_SETTINGS",settings:e}}function en(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}function tn(e){return{type:"SET_IS_SAVE_VIEW_OPENED",isOpen:e}}const nn=function(e){let{allowUndo:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async n=>{let{registry:a}=n;if(Ot(e))try{var r;const n=a.select(_.store).getEntityConfig("postType",e.type);if(!n)return void a.dispatch(ye.store).createErrorNotice((0,E.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const l=(0,yt.addQueryArgs)(`${n.baseURL}/${e.id}`,{context:"edit",source:"theme"}),o=await At()({path:l});if(!o)return void a.dispatch(ye.store).createErrorNotice((0,E.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const i=e=>{let{blocks:t=[]}=e;return(0,c.__unstableSerializeAndClean)(t)},s=a.select(_.store).getEditedEntityRecord("postType",e.type,e.id);a.dispatch(_.store).editEntityRecord("postType",e.type,e.id,{content:i,blocks:s.blocks,source:"custom"},{undoIgnore:!0});const u=(0,c.parse)(null==o||null===(r=o.content)||void 0===r?void 0:r.raw);if(a.dispatch(_.store).editEntityRecord("postType",e.type,o.id,{content:i,blocks:u,source:"theme"}),t){const t=()=>{a.dispatch(_.store).editEntityRecord("postType",e.type,s.id,{content:i,blocks:s.blocks,source:"custom"})};a.dispatch(ye.store).createSuccessNotice((0,E.__)("Template reverted."),{type:"snackbar",actions:[{label:(0,E.__)("Undo"),onClick:t}]})}else a.dispatch(ye.store).createSuccessNotice((0,E.__)("Template reverted."))}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("Template revert failed. Please reload.");a.dispatch(ye.store).createErrorNotice(t,{type:"snackbar"})}else a.dispatch(ye.store).createErrorNotice((0,E.__)("This template is not revertable."),{type:"snackbar"})}},an=e=>t=>{let{registry:n}=t;n.dispatch(F).enableComplementaryArea(Dt,e)},rn=()=>e=>{let{registry:t}=e;t.dispatch(F).disableComplementaryArea(Dt)},ln=e=>t=>{let{registry:n}=t;n.dispatch("core/preferences").set("core/edit-site","editorMode",e),"visual"!==e&&n.dispatch(fe.store).clearSelectedBlock(),"visual"===e?(0,Lt.speak)((0,E.__)("Visual editor selected"),"assertive"):"mosaic"===e&&(0,Lt.speak)((0,E.__)("Mosaic view selected"),"assertive")},on=e=>t=>{let{registry:n,dispatch:a}=t;n.dispatch(fe.store).__unstableSetEditorMode("edit"),a({type:"SET_CANVAS_MODE",mode:e}),"edit"===e&&n.select(T.store).get("core/edit-site","showListViewByDefault")&&a.setIsListViewOpened(!0)};var sn={};function cn(e){return[e]}function un(e,t,n){var a;if(e.length!==t.length)return!1;for(a=n;a0&&void 0!==arguments[0]?arguments[0]:dn,t=arguments.length>1?arguments[1]:void 0;const n=t?t.reduce(((e,t)=>({...e,[t.id]:t})),{}):{},a=[],r=[...e];for(;r.length;){const{innerBlocks:e,...t}=r.shift();if(r.unshift(...e),(0,c.isTemplatePart)(t)){const{attributes:{theme:e,slug:r}}=t,l=n[`${e}//${r}`];l&&a.push({templatePart:l,block:t})}}return a})),_n=(0,m.createRegistrySelector)((e=>(t,n)=>e(T.store).get("core/edit-site",n)));function hn(e,t){return p()("select( 'core/interface' ).isFeatureActive",{since:"6.0",alternative:"select( 'core/preferences' ).get"}),!!_n(e,t)}function gn(e){return e.deviceType}const vn=(0,m.createRegistrySelector)((e=>()=>e(_.store).canUser("create","media"))),fn=(0,m.createRegistrySelector)((e=>()=>"web"===s.Platform.OS?e(_.store).getEntityRecords("postType","wp_block",{per_page:-1}):[])),yn=function(e,t){var n,a=t||cn;function r(e){var t,a,r,l,o,i=n,s=!0;for(t=0;t{const n={...e.settings,outlineMode:!0,focusMode:!!_n(e,"focusMode"),hasFixedToolbar:!!_n(e,"fixedToolbar"),keepCaretInsideBlock:!!_n(e,"keepCaretInsideBlock"),showIconLabels:!!_n(e,"showIconLabels"),__experimentalSetIsInserterOpened:t,__experimentalReusableBlocks:fn(e),__experimentalPreferPatternsOnRoot:"wp_template"===bn(e)};return vn(e)?(n.mediaUpload=t=>{let{onError:n,...a}=t;(0,ge.uploadMedia)({wpAllowedMimeTypes:e.settings.allowedMimeTypes,onError:e=>{let{message:t}=e;return n(t)},...a})},n):n}),(e=>[vn(e),e.settings,_n(e,"focusMode"),_n(e,"fixedToolbar"),_n(e,"keepCaretInsideBlock"),_n(e,"showIconLabels"),fn(e),bn(e)]));function En(){p()("select( 'core/edit-site' ).getHomeTemplateId",{since:"6.2",version:"6.4"})}function bn(e){return e.editedPost.postType}function wn(e){return e.editedPost.id}function Sn(e){return e.editedPost.context}function xn(e){return{context:e.editedPost.context}}function kn(e){return!!e.blockInserterPanel}function Cn(e){const{rootClientId:t,insertionIndex:n,filterValue:a}=e.blockInserterPanel;return{rootClientId:t,insertionIndex:n,filterValue:a}}function Tn(e){return e.listViewPanel}function Nn(e){return e.saveViewPanel}const Mn=(0,m.createRegistrySelector)((e=>t=>{const n=bn(t),a=wn(t),r=e(_.store).getEditedEntityRecord("postType",n,a),l=e(_.store).getEntityRecords("postType","wp_template_part",{per_page:-1});return pn(r.blocks,l)}));function In(e){return _n(e,"editorMode")}function Pn(){p()("dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu",{since:"6.2",version:"6.4"})}function Bn(){p()("dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu",{since:"6.2",version:"6.4"})}function zn(){p()("dispatch( 'core/edit-site' ).isNavigationOpened",{since:"6.2",version:"6.4"})}function Vn(e){return e.canvasMode}const Rn={reducer:Vt,actions:r,selectors:o},An=(0,m.createReduxStore)(Dt,Rn);(0,m.register)(An),Qe(An).registerPrivateSelectors(i),Qe(An).registerPrivateActions(l);var Ln=window.wp.keyboardShortcuts;(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"}));var Dn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));var On=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"}));function Fn(e){return(0,s.createElement)(y.Button,g({},e,{className:f()("edit-site-sidebar-button",e.className)}))}function Gn(e){let{isRoot:t,title:n,actions:a,content:r,description:l}=e;const{dashboardLink:o}=(0,m.useSelect)((e=>{const{getSettings:t}=Qe(e(An));return{dashboardLink:t().__experimentalDashboardLink}}),[]);return(0,s.createElement)(y.__experimentalVStack,{spacing:2},(0,s.createElement)(y.__experimentalHStack,{spacing:4,justify:"flex-start",className:"edit-site-sidebar-navigation-screen__title-icon"},t?(0,s.createElement)(Fn,{icon:(0,E.isRTL)()?ce:se,"aria-label":(0,E.__)("Navigate to the Dashboard"),href:o||"index.php",label:(0,E.__)("Dashboard")}):(0,s.createElement)(y.__experimentalNavigatorToParentButton,{as:Fn,icon:(0,E.isRTL)()?ce:se,"aria-label":(0,E.__)("Back")}),(0,s.createElement)("h2",{className:"edit-site-sidebar-navigation-screen__title"},n),a),(0,s.createElement)("nav",{className:"edit-site-sidebar-navigation-screen__content"},l&&(0,s.createElement)("p",{className:"edit-site-sidebar-navigation-screen__description"},l),r))}function Hn(e){let{className:t,icon:n,withChevron:a=!1,children:r,...l}=e;return(0,s.createElement)(y.__experimentalItem,g({className:f()("edit-site-sidebar-navigation-item",t)},l),n&&(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(ie,{style:{fill:"currentcolor"},icon:n,size:24}),(0,s.createElement)(y.FlexBlock,null,r),a&&(0,s.createElement)(ie,{style:{fill:"currentcolor"},icon:ce,size:24})),!n&&r)}function $n(){const{navigationMenus:e}=(0,m.useSelect)((e=>{const{getEntityRecords:t}=e(_.store);return{navigationMenus:t("postType","wp_navigation",{per_page:-1,status:"publish"})}}));return(0,s.createElement)(Gn,{isRoot:!0,title:(0,E.__)("Design"),description:(0,E.__)("Customize the appearance of your website using the block editor."),content:(0,s.createElement)(y.__experimentalItemGroup,null,false,(0,s.createElement)(y.__experimentalNavigatorButton,{as:Hn,path:"/wp_template",withChevron:!0,icon:Dn},(0,E.__)("Templates")),(0,s.createElement)(y.__experimentalNavigatorButton,{as:Hn,path:"/wp_template_part",withChevron:!0,icon:On},(0,E.__)("Template Parts")))})}var Un=window.wp.htmlEntities;var Wn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"}));var jn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"}));var qn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"}));var Yn=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5zM8 12.8h8v-1.5H8v1.5zm0 3h8v-1.5H8v1.5z"}));var Xn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));var Zn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm.5 12c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v10zm-11-7.6h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-.9 3.5H6.3l1.2-1.7v1.7zm5.6-3.2c-.4-.2-.8-.4-1.2-.4-.5 0-.9.1-1.2.4-.4.2-.6.6-.8 1-.2.4-.3.9-.3 1.5s.1 1.1.3 1.6c.2.4.5.8.8 1 .4.2.8.4 1.2.4.5 0 .9-.1 1.2-.4.4-.2.6-.6.8-1 .2-.4.3-1 .3-1.6 0-.6-.1-1.1-.3-1.5-.1-.5-.4-.8-.8-1zm0 3.6c-.1.3-.3.5-.5.7-.2.1-.4.2-.7.2-.3 0-.5-.1-.7-.2-.2-.1-.4-.4-.5-.7-.1-.3-.2-.7-.2-1.2 0-.7.1-1.2.4-1.5.3-.3.6-.5 1-.5s.7.2 1 .5c.3.3.4.8.4 1.5-.1.5-.1.9-.2 1.2zm5-3.9h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-1 3.5H16l1.2-1.7v1.7z"}));var Kn=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"}));var Qn=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"}));var Jn=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z",fillRule:"evenodd",clipRule:"evenodd"}));var ea=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{fillRule:"evenodd",d:"M8.95 11.25H4v1.5h4.95v4.5H13V18c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75h-2.55v-7.5H13V9c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75H8.95v4.5ZM14.5 15v3c0 .3.2.5.5.5h3c.3 0 .5-.2.5-.5v-3c0-.3-.2-.5-.5-.5h-3c-.3 0-.5.2-.5.5Zm0-6V6c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5Z",clipRule:"evenodd"}));var ta=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z"}),(0,s.createElement)(b.Path,{d:"M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"}));var na=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"}));var aa=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"}));var ra=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));function la(){const e="edit-site-template-actions-loading-screen-modal";return(0,s.createElement)(y.Modal,{isFullScreen:!0,isDismissible:!1,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,onRequestClose:()=>{},__experimentalHideHeader:!0,className:e},(0,s.createElement)("div",{className:`${e}__content`},(0,s.createElement)(y.Spinner,null)))}const oa=()=>(0,m.useSelect)((e=>e(_.store).getEntityRecords("postType","wp_template",{per_page:-1})),[]),ia=()=>(0,m.useSelect)((e=>e(h.store).__experimentalGetDefaultTemplateTypes()),[]),sa=()=>{const e=(0,m.useSelect)((e=>e(_.store).getPostTypes({per_page:-1})),[]);return(0,s.useMemo)((()=>{const t=["attachment"];return null==e?void 0:e.filter((e=>{let{viewable:n,slug:a}=e;return n&&!t.includes(a)}))}),[e])};function ca(e){const t=(0,s.useMemo)((()=>null==e?void 0:e.reduce(((e,t)=>{let{labels:n}=t;const a=n.singular_name.toLowerCase();return e[a]=(e[a]||0)+1,e}),{})));return(0,s.useCallback)((e=>{let{labels:n,slug:a}=e;const r=n.singular_name.toLowerCase();return t[r]>1&&r!==a}),[t])}function ua(){const e=sa(),t=(0,s.useMemo)((()=>null==e?void 0:e.filter((e=>e.has_archive))),[e]),n=oa(),a=ca(t);return(0,s.useMemo)((()=>(null==t?void 0:t.filter((e=>!(n||[]).some((t=>t.slug==="archive-"+e.slug)))).map((e=>{var t;let n;return n=a(e)?(0,E.sprintf)((0,E.__)("Archive: %1$s (%2$s)"),e.labels.singular_name,e.slug):(0,E.sprintf)((0,E.__)("Archive: %s"),e.labels.singular_name),{slug:"archive-"+e.slug,description:(0,E.sprintf)((0,E.__)("Displays an archive with the latests posts of type: %s."),e.labels.singular_name),title:n,icon:null!==(t=e.icon)&&void 0!==t&&t.startsWith("dashicons-")?e.icon.slice(10):Yn,templatePrefix:"archive"}})))||[]),[t,n,a])}const ma=e=>{const t=(()=>{const e=(0,m.useSelect)((e=>e(_.store).getTaxonomies({per_page:-1})),[]);return(0,s.useMemo)((()=>null==e?void 0:e.filter((e=>{let{visibility:t}=e;return null==t?void 0:t.publicly_queryable}))),[e])})(),n=oa(),a=ia(),r=(0,s.useMemo)((()=>null==t?void 0:t.reduce(((e,t)=>{let{slug:n}=t,a=n;return["category","post_tag"].includes(n)||(a=`taxonomy-${a}`),"post_tag"===n&&(a="tag"),e[n]=a,e}),{})),[t]),l=null==t?void 0:t.reduce(((e,t)=>{let{labels:n}=t;const a=n.singular_name.toLowerCase();return e[a]=(e[a]||0)+1,e}),{}),o=ga("taxonomy",r),i=(n||[]).map((e=>{let{slug:t}=e;return t})),c=(t||[]).reduce(((t,n)=>{var s;const{slug:c,labels:u}=n,m=r[c],d=null==a?void 0:a.find((e=>{let{slug:t}=e;return t===m})),p=null==i?void 0:i.includes(m),_=((e,t)=>{if(["category","post_tag"].includes(t))return!1;const n=e.singular_name.toLowerCase();return l[n]>1&&n!==t})(u,c);let h=u.singular_name;_&&(h=(0,E.sprintf)((0,E.__)("%1$s (%2$s)"),u.singular_name,c));const g=d?{...d,templatePrefix:r[c]}:{slug:m,title:h,description:(0,E.sprintf)((0,E.__)("Displays taxonomy: %s."),u.singular_name),icon:ea,templatePrefix:r[c]},v=null==o||null===(s=o[c])||void 0===s?void 0:s.hasEntities;return v&&(g.onClick=t=>{e({type:"taxonomy",slug:c,config:{queryArgs:e=>{let{search:t}=e;return{_fields:"id,name,slug,link",orderBy:t?"name":"count",exclude:o[c].existingEntitiesIds}},getSpecificTemplate:e=>{const t=`${r[c]}-${e.slug}`;return{title:t,slug:t,templatePrefix:r[c]}}},labels:u,hasGeneralTemplate:p,template:t})}),p&&!v||t.push(g),t}),[]);return(0,s.useMemo)((()=>c.reduce(((e,t)=>{const{slug:n}=t;let a="taxonomiesMenuItems";return["category","tag"].includes(n)&&(a="defaultTaxonomiesMenuItems"),e[a].push(t),e}),{defaultTaxonomiesMenuItems:[],taxonomiesMenuItems:[]})),[c])},da={user:"author"},pa={user:{who:"authors"}};const _a=e=>{const t=oa();return(0,s.useMemo)((()=>Object.entries(e||{}).reduce(((e,n)=>{let[a,r]=n;const l=(t||[]).reduce(((e,t)=>{const n=`${r}-`;return t.slug.startsWith(n)&&e.push(t.slug.substring(n.length)),e}),[]);return l.length&&(e[a]=l),e}),{})),[e,t])},ha=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=_a(t),r=(0,m.useSelect)((t=>Object.entries(a||{}).reduce(((a,r)=>{let[l,o]=r;const i=t(_.store).getEntityRecords(e,l,{_fields:"id",context:"view",slug:o,...n[l]});return null!=i&&i.length&&(a[l]=i),a}),{})),[a]);return r},ga=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=ha(e,t,n),r=(0,m.useSelect)((r=>Object.keys(t||{}).reduce(((t,l)=>{var o,i;const s=(null==a||null===(o=a[l])||void 0===o?void 0:o.map((e=>{let{id:t}=e;return t})))||[];return t[l]={hasEntities:!(null===(i=r(_.store).getEntityRecords(e,l,{per_page:1,_fields:"id",context:"view",exclude:s,...n[l]}))||void 0===i||!i.length),existingEntitiesIds:s},t}),{})),[t,a]);return r},va=[];function fa(e){let{suggestion:t,search:n,onSelect:a,entityForSuggestions:r,composite:l}=e;const o="edit-site-custom-template-modal__suggestions_list__list-item";return(0,s.createElement)(y.__unstableCompositeItem,g({role:"option",as:y.Button},l,{className:o,onClick:()=>a(r.config.getSpecificTemplate(t))}),(0,s.createElement)("span",{className:`${o}__title`},(0,s.createElement)(y.TextHighlight,{text:(0,Un.decodeEntities)(t.name),highlight:n})),t.link&&(0,s.createElement)("span",{className:`${o}__info`},t.link))}function ya(e,t){const{config:n}=e,a=(0,s.useMemo)((()=>({order:"asc",context:"view",search:t,per_page:t?20:10,...n.queryArgs(t)})),[t,n]),{records:r,hasResolved:l}=(0,_.useEntityRecords)(e.type,e.slug,a),[o,i]=(0,s.useState)(va);return(0,s.useEffect)((()=>{if(!l)return;let e=va;var t,a;null!=r&&r.length&&(e=r,n.recordNamePath&&(t=e,a=n.recordNamePath,e=(t||[]).map((e=>({...e,name:(0,Un.decodeEntities)((0,ve.get)(e,a))}))))),i(e)}),[r,l]),o}function Ea(e){let{entityForSuggestions:t,onSelect:n}=e;const a=(0,y.__unstableUseCompositeState)({orientation:"vertical"}),[r,l,o]=function(){const[e,t]=(0,s.useState)(""),[n,a]=(0,s.useState)(""),r=(0,te.useDebounce)(a,250);return(0,s.useEffect)((()=>{n!==e&&r(e)}),[n,e]),[e,t,n]}(),i=ya(t,o),{labels:c}=t,[u,m]=(0,s.useState)(!1);return!u&&(null==i?void 0:i.length)>9&&m(!0),(0,s.createElement)(s.Fragment,null,u&&(0,s.createElement)(y.SearchControl,{__nextHasNoMarginBottom:!0,onChange:l,value:r,label:c.search_items,placeholder:c.search_items}),!(null==i||!i.length)&&(0,s.createElement)(y.__unstableComposite,g({},a,{role:"listbox",className:"edit-site-custom-template-modal__suggestions_list","aria-label":(0,E.__)("Suggestions list")}),i.map((e=>(0,s.createElement)(fa,{key:e.slug,suggestion:e,search:o,onSelect:n,entityForSuggestions:t,composite:a})))),o&&!(null!=i&&i.length)&&(0,s.createElement)(y.__experimentalText,{as:"p",className:"edit-site-custom-template-modal__no-results"},c.not_found))}var ba=function(e){let{onClose:t,onSelect:n,entityForSuggestions:a,isCreatingTemplate:r}=e;const[l,o]=(0,s.useState)(a.hasGeneralTemplate),i="edit-site-custom-template-modal";return(0,s.createElement)(y.Modal,{title:(0,E.sprintf)((0,E.__)("Add template: %s"),a.labels.singular_name),className:i,onRequestClose:t},r&&(0,s.createElement)(la,null),!l&&(0,s.createElement)(y.__experimentalVStack,{spacing:4},(0,s.createElement)(y.__experimentalText,{as:"p"},(0,E.__)("Select whether to create a single template for all items or a specific one.")),(0,s.createElement)(y.Flex,{className:`${i}__contents`,gap:"4",align:"initial"},(0,s.createElement)(y.FlexItem,{isBlock:!0,as:y.Button,onClick:()=>{const{slug:e,title:t,description:r,templatePrefix:l}=a.template;n({slug:e,title:t,description:r,templatePrefix:l})}},(0,s.createElement)(y.__experimentalText,{as:"span",weight:600},a.labels.all_items),(0,s.createElement)(y.__experimentalText,{as:"span"},(0,E.__)("For all items"))),(0,s.createElement)(y.FlexItem,{isBlock:!0,as:y.Button,onClick:()=>{o(!0)}},(0,s.createElement)(y.__experimentalText,{as:"span",weight:600},a.labels.singular_name),(0,s.createElement)(y.__experimentalText,{as:"span"},(0,E.__)("For a specific item"))))),l&&(0,s.createElement)(y.__experimentalVStack,{spacing:4},(0,s.createElement)(y.__experimentalText,{as:"p"},(0,E.__)("This template will be used only for the specific item chosen.")),(0,s.createElement)(Ea,{entityForSuggestions:a,onSelect:n})))};var wa=function(e){let{onClose:t,createTemplate:n,isCreatingTemplate:a}=e;const[r,l]=(0,s.useState)(""),o=(0,E.__)("Custom Template"),[i,c]=(0,s.useState)(!1);return(0,s.createElement)(y.Modal,{title:(0,E.__)("Create custom template"),onRequestClose:()=>{t()},overlayClassName:"edit-site-custom-generic-template__modal"},a&&(0,s.createElement)(la,null),(0,s.createElement)("form",{onSubmit:async function(e){if(e.preventDefault(),!i){c(!0);try{await n({slug:"wp-custom-template-"+(0,ve.kebabCase)(r||o),title:r||o},!1)}finally{c(!1)}}}},(0,s.createElement)(y.__experimentalVStack,{spacing:6},(0,s.createElement)(y.TextControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Name"),value:r,onChange:l,placeholder:o,disabled:i,help:(0,E.__)('Describe the template, e.g. "Post with sidebar".')}),(0,s.createElement)(y.__experimentalHStack,{className:"edit-site-custom-generic-template__modal-actions",justify:"right"},(0,s.createElement)(y.Button,{variant:"tertiary",onClick:()=>{t()}},(0,E.__)("Cancel")),(0,s.createElement)(y.Button,{variant:"primary",type:"submit",isBusy:i,"aria-disabled":i},(0,E.__)("Create"))))))};const Sa=["front-page","single","page","index","archive","author","category","date","tag","taxonomy","search","404"],xa={"front-page":Wn,single:jn,page:qn,archive:Yn,search:Xn,404:Zn,index:Kn,category:Qn,author:Jn,taxonomy:ea,date:ta,tag:na,attachment:aa};function ka(e){let{postType:t,toggleProps:n,showIcon:a=!0}=e;const[r,l]=(0,s.useState)(!1),[o,i]=(0,s.useState)(!1),[c,u]=(0,s.useState)({}),[d,p]=(0,s.useState)(!1),h=Tt(),{saveEntityRecord:g}=(0,m.useDispatch)(_.store),{createErrorNotice:v,createSuccessNotice:f}=(0,m.useDispatch)(ye.store),{setTemplate:b,setCanvasMode:w}=Qe((0,m.useDispatch)(An));async function S(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!d){p(!0);try{const{title:n,description:a,slug:r,templatePrefix:l}=e;let o=e.content;if(!o){o=(await At()({path:(0,yt.addQueryArgs)("/wp/v2/templates/lookup",{slug:r,is_custom:!t,template_prefix:l})})).content.raw}const i=await g("postType","wp_template",{description:a,slug:r.toString(),status:"publish",title:n,content:o,is_wp_suggestion:t},{throwOnError:!0});b(i.id,i.slug),w("edit"),h.push({postId:i.id,postType:i.type}),f((0,E.sprintf)((0,E.__)('"%s" successfully created.'),n),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while creating the template.");v(t,{type:"snackbar"})}finally{p(!1)}}}const x=function(e,t){const n=oa(),a=ia(),r=(n||[]).map((e=>{let{slug:t}=e;return t})),l=(a||[]).filter((e=>Sa.includes(e.slug)&&!r.includes(e.slug))),o=n=>{t(!0),e(n)},i=[...l],{defaultTaxonomiesMenuItems:c,taxonomiesMenuItems:u}=ma(o),{defaultPostTypesMenuItems:m,postTypesMenuItems:d}=(e=>{const t=sa(),n=oa(),a=ia(),r=ca(t),l=(0,s.useMemo)((()=>null==t?void 0:t.reduce(((e,t)=>{let{slug:n}=t,a=n;return"page"!==n&&(a=`single-${a}`),e[n]=a,e}),{})),[t]),o=ga("postType",l),i=(n||[]).map((e=>{let{slug:t}=e;return t})),c=(t||[]).reduce(((t,n)=>{var s;const{slug:c,labels:u,icon:m}=n,d=l[c],p=null==a?void 0:a.find((e=>{let{slug:t}=e;return t===d})),_=null==i?void 0:i.includes(d),h=r(n);let g=(0,E.sprintf)((0,E.__)("Single item: %s"),u.singular_name);h&&(g=(0,E.sprintf)((0,E.__)("Single item: %1$s (%2$s)"),u.singular_name,c));const v=p?{...p,templatePrefix:l[c]}:{slug:d,title:g,description:(0,E.sprintf)((0,E.__)("Displays a single item: %s."),u.singular_name),icon:null!=m&&m.startsWith("dashicons-")?m.slice(10):jn,templatePrefix:l[c]},f=null==o||null===(s=o[c])||void 0===s?void 0:s.hasEntities;return f&&(v.onClick=t=>{e({type:"postType",slug:c,config:{recordNamePath:"title.rendered",queryArgs:e=>{let{search:t}=e;return{_fields:"id,title,slug,link",orderBy:t?"relevance":"modified",exclude:o[c].existingEntitiesIds}},getSpecificTemplate:e=>{const t=`${l[c]}-${e.slug}`;return{title:t,slug:t,templatePrefix:l[c]}}},labels:u,hasGeneralTemplate:_,template:t})}),_&&!f||t.push(v),t}),[]);return(0,s.useMemo)((()=>c.reduce(((e,t)=>{const{slug:n}=t;let a="postTypesMenuItems";return"page"===n&&(a="defaultPostTypesMenuItems"),e[a].push(t),e}),{defaultPostTypesMenuItems:[],postTypesMenuItems:[]})),[c])})(o),p=function(e){var t,n;const a=oa(),r=ia(),l=ga("root",da,pa);let o=null==r?void 0:r.find((e=>{let{slug:t}=e;return"author"===t}));o||(o={description:(0,E.__)("Displays latest posts written by a single author."),slug:"author",title:"Author"});const i=!(null==a||!a.find((e=>{let{slug:t}=e;return"author"===t})));if(null!==(t=l.user)&&void 0!==t&&t.hasEntities&&(o={...o,templatePrefix:"author"},o.onClick=t=>{e({type:"root",slug:"user",config:{queryArgs:e=>{let{search:t}=e;return{_fields:"id,name,slug,link",orderBy:t?"name":"registered_date",exclude:l.user.existingEntitiesIds,who:"authors"}},getSpecificTemplate:e=>{const t=`author-${e.slug}`;return{title:t,slug:t,templatePrefix:"author"}}},labels:{singular_name:(0,E.__)("Author"),search_items:(0,E.__)("Search Authors"),not_found:(0,E.__)("No authors found."),all_items:(0,E.__)("All Authors")},hasGeneralTemplate:i,template:t})}),!i||null!==(n=l.user)&&void 0!==n&&n.hasEntities)return o}(o);[...c,...m,p].forEach((e=>{if(!e)return;const t=i.findIndex((t=>t.slug===e.slug));t>-1?i[t]=e:i.push(e)})),null==i||i.sort(((e,t)=>Sa.indexOf(e.slug)-Sa.indexOf(t.slug)));return[...i,...ua(),...d,...u]}(u,l);if(!x.length)return null;const k=(0,E.__)("A custom template can be manually applied to any post or page.");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.DropdownMenu,{className:"edit-site-new-template-dropdown",icon:a?ra:null,text:a?null:t.labels.add_new,label:t.labels.add_new_item,popoverProps:{noArrow:!1},toggleProps:n},(()=>(0,s.createElement)(s.Fragment,null,d&&(0,s.createElement)(la,null),(0,s.createElement)("div",{className:"edit-site-new-template-dropdown__menu-groups"},(0,s.createElement)(y.MenuGroup,{label:t.labels.add_new_item},x.map((e=>{const{title:t,description:n,slug:a,onClick:r,icon:l}=e;return(0,s.createElement)(y.Tooltip,{key:a,position:"top right",text:n,className:"edit-site-new-template-dropdown__menu-item-tooltip"},(0,s.createElement)(y.MenuItem,{icon:l||xa[a]||jn,iconPosition:"left",onClick:()=>r?r(e):S(e)},t,(0,s.createElement)(y.VisuallyHidden,null,n)))}))),(0,s.createElement)(y.MenuGroup,null,(0,s.createElement)(y.Tooltip,{position:"top right",text:k,className:"edit-site-new-template-dropdown__menu-item-tooltip"},(0,s.createElement)(y.MenuItem,{icon:Dn,iconPosition:"left",onClick:()=>i(!0)},(0,E.__)("Custom template"),(0,s.createElement)(y.VisuallyHidden,null,k)))))))),r&&(0,s.createElement)(ba,{onClose:()=>l(!1),onSelect:S,entityForSuggestions:c,isCreatingTemplate:d}),o&&(0,s.createElement)(wa,{onClose:()=>i(!1),createTemplate:S,isCreatingTemplate:d}))}function Ca(e){let{closeModal:t,onCreate:n}=e;const[a,r]=(0,s.useState)(""),[l,o]=(0,s.useState)("uncategorized"),[i,c]=(0,s.useState)(!1),u=(0,te.useInstanceId)(Ca),d=(0,m.useSelect)((e=>e(h.store).__experimentalGetDefaultTemplatePartAreas()),[]);return(0,s.createElement)(y.Modal,{title:(0,E.__)("Create a template part"),onRequestClose:t,overlayClassName:"edit-site-create-template-part-modal"},(0,s.createElement)("form",{onSubmit:async e=>{e.preventDefault(),a&&(c(!0),await n({title:a,area:l}))}},(0,s.createElement)(y.__experimentalVStack,{spacing:"4"},(0,s.createElement)(y.TextControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Name"),value:a,onChange:r,required:!0}),(0,s.createElement)(y.BaseControl,{label:(0,E.__)("Area"),id:`edit-site-create-template-part-modal__area-selection-${u}`,className:"edit-site-create-template-part-modal__area-base-control"},(0,s.createElement)(y.__experimentalRadioGroup,{label:(0,E.__)("Area"),className:"edit-site-create-template-part-modal__area-radio-group",id:`edit-site-create-template-part-modal__area-selection-${u}`,onChange:o,checked:l},d.map((e=>{let{icon:t,label:n,area:a,description:r}=e;return(0,s.createElement)(y.__experimentalRadio,{key:n,value:a,className:"edit-site-create-template-part-modal__area-radio"},(0,s.createElement)(y.Flex,{align:"start",justify:"start"},(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(y.Icon,{icon:t})),(0,s.createElement)(y.FlexBlock,{className:"edit-site-create-template-part-modal__option-label"},n,(0,s.createElement)("div",null,r)),(0,s.createElement)(y.FlexItem,{className:"edit-site-create-template-part-modal__checkbox"},l===a&&(0,s.createElement)(y.Icon,{icon:w}))))})))),(0,s.createElement)(y.Flex,{className:"edit-site-create-template-part-modal__modal-actions",justify:"flex-end"},(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(y.Button,{variant:"secondary",onClick:()=>{t()}},(0,E.__)("Cancel"))),(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(y.Button,{variant:"primary",type:"submit",disabled:!a,isBusy:i},(0,E.__)("Create")))))))}const Ta=()=>(0,m.useSelect)((e=>e(_.store).getEntityRecords("postType","wp_template_part",{per_page:-1})),[]),Na=(e,t)=>{const n=e.toLowerCase(),a=t.map((e=>e.title.rendered.toLowerCase()));if(!a.includes(n))return e;let r=2;for(;a.includes(`${n} ${r}`);)r++;return`${e} ${r}`},Ma=e=>(0,ve.kebabCase)(e).replace(/[^\w-]+/g,"")||"wp-custom-part";function Ia(e){let{postType:t,showIcon:n=!0,toggleProps:a}=e;const r=Tt(),[l,o]=(0,s.useState)(!1),{createErrorNotice:i}=(0,m.useDispatch)(ye.store),{saveEntityRecord:c}=(0,m.useDispatch)(_.store),{setCanvasMode:u}=Qe((0,m.useDispatch)(An)),d=Ta();const{as:p=y.Button,...h}=null!=a?a:{};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p,g({},h,{onClick:()=>{o(!0)},icon:n?ra:null,label:t.labels.add_new}),n?null:t.labels.add_new),l&&(0,s.createElement)(Ca,{closeModal:()=>o(!1),onCreate:async function(e){let{title:t,area:n}=e;if(t)try{const e=Na(t,d),a=Ma(e),l=await c("postType","wp_template_part",{slug:a,title:e,content:"",area:n},{throwOnError:!0});o(!1),u("edit"),r.push({postId:l.id,postType:"wp_template_part"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while creating the template part.");i(t,{type:"snackbar"}),o(!1)}else i((0,E.__)("Title is not defined."),{type:"snackbar"})}}))}function Pa(e){let{templateType:t="wp_template",...n}=e;const a=(0,m.useSelect)((e=>e(_.store).getPostType(t)),[t]);return a?"wp_template"===t?(0,s.createElement)(ka,g({},n,{postType:a})):"wp_template_part"===t?(0,s.createElement)(Ia,g({},n,{postType:a})):null:null}const Ba={wp_template:{labels:{title:(0,E.__)("Templates"),loading:(0,E.__)("Loading templates"),notFound:(0,E.__)("No templates found"),manage:(0,E.__)("Manage all templates"),description:(0,E.__)("Express the layout of your site with templates.")}},wp_template_part:{labels:{title:(0,E.__)("Template parts"),loading:(0,E.__)("Loading template parts"),notFound:(0,E.__)("No template parts found"),manage:(0,E.__)("Manage all template parts"),description:(0,E.__)("Template Parts are small pieces of a layout that can be reused across multiple templates and always appear the same way. Common template parts include the site header, footer, or sidebar.")}}},za=e=>{let{postType:t,postId:n,...a}=e;const r=It({postType:t,postId:n});return(0,s.createElement)(Hn,g({},r,a))};function Va(){const{params:{postType:e}}=(0,y.__experimentalUseNavigator)(),t=(0,te.useViewportMatch)("medium","<"),n=(0,m.useSelect)((e=>!!e(An).getSettings().supportsTemplatePartsMode),[]),{records:a,isResolving:r}=(0,_.useEntityRecords)("postType",e,{per_page:-1}),l=a?[...a]:[];l.sort(((e,t)=>e.slug.localeCompare(t.slug)));const o=It({path:"/"+e+"/all"}),i=!t&&!n;return(0,s.createElement)(Gn,{isRoot:n,title:Ba[e].labels.title,description:Ba[e].labels.description,actions:i&&(0,s.createElement)(Pa,{templateType:e,toggleProps:{as:Fn}}),content:(0,s.createElement)(s.Fragment,null,r&&Ba[e].labels.loading,!r&&(0,s.createElement)(y.__experimentalItemGroup,null,!(null!=a&&a.length)&&(0,s.createElement)(y.__experimentalItem,null,Ba[e].labels.notFound),l.map((t=>{var n;return(0,s.createElement)(za,{postType:e,postId:t.id,key:t.id},(0,Un.decodeEntities)((null===(n=t.title)||void 0===n?void 0:n.rendered)||t.slug))})),!t&&(0,s.createElement)(Hn,g({className:"edit-site-sidebar-navigation-screen-templates__see-all"},o,{children:Ba[e].labels.manage}))))})}var Ra=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));function Aa(e,t){const{record:n,title:a,description:r,isLoaded:l}=(0,m.useSelect)((n=>{const{getEditedPostType:a,getEditedPostId:r}=n(An),{getEditedEntityRecord:l}=n(_.store),{__experimentalGetTemplateInfo:o}=n(h.store),i=null!=e?e:a(),s=null!=t?t:r(),c=l("postType",i,s),u=!!s,m=o(c);return{record:c,title:m.title,description:m.description,isLoaded:u}}),[e,t]);return{isLoaded:l,record:n,getTitle:()=>a?(0,Un.decodeEntities)(a):null,getDescription:()=>r?(0,Un.decodeEntities)(r):null}}function La(){const{params:e}=(0,y.__experimentalUseNavigator)(),{postType:t,postId:n}=e,{setCanvasMode:a}=Qe((0,m.useDispatch)(An)),{getDescription:r,getTitle:l,record:o}=Aa(t,n);let i=r();return i||("wp_template"===o.type&&o.is_custom?i=(0,E.__)("This is a custom template that can be applied manually to any Post or Page."):"wp_template_part"===o.type&&(i=(0,E.sprintf)((0,E.__)("This is your %s template part."),l()))),(0,s.createElement)(Gn,{title:l(),actions:(0,s.createElement)(Fn,{onClick:()=>a("edit"),label:(0,E.__)("Edit"),icon:Ra}),description:i})}function Da(e){var t;let n=null!==(t=null==e?void 0:e.path)&&void 0!==t?t:"/";if(null!=e&&e.postType&&null!=e&&e.postId)switch(e.postType){case"wp_template":case"wp_template_part":n=`/${encodeURIComponent(e.postType)}/${encodeURIComponent(e.postId)}`;break;default:n=`/navigation/${encodeURIComponent(e.postType)}/${encodeURIComponent(e.postId)}`}return n}function Oa(){return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"edit-site-sidebar-navigation-screen-navigation-menus__placeholder"}),(0,s.createElement)("div",{className:"edit-site-sidebar-navigation-screen-navigation-menus__placeholder"}),(0,s.createElement)("div",{className:"edit-site-sidebar-navigation-screen-navigation-menus__placeholder"}))}function Fa(e){let{rootClientId:t,onSelect:n}=e;const{clientIdsTree:a,isLoading:r}=(0,m.useSelect)((e=>{const{__unstableGetClientIdsTree:n,areInnerBlocksControlled:a}=e(fe.store);return{clientIdsTree:n(t),isLoading:!a(t)}}),[t]),{replaceBlock:l,__unstableMarkNextChangeAsNotPersistent:o}=(0,m.useDispatch)(fe.store),{OffCanvasEditor:i,LeafMoreMenu:u}=Qe(fe.privateApis),d=(0,s.useCallback)((e=>{"core/navigation-link"!==e.name||e.attributes.url?n(e):(o(),l(e.clientId,(0,c.createBlock)("core/navigation-link",e.attributes)))}),[n,o,l]);return(0,s.createElement)(s.Fragment,null,r&&(0,s.createElement)(Oa,null),!r&&(0,s.createElement)(i,{blocks:a,onSelect:d,LeafMoreMenu:u,showAppender:!1}),(0,s.createElement)("div",{style:{visibility:"hidden"}},(0,s.createElement)(fe.BlockTools,null,(0,s.createElement)(fe.BlockList,null))))}const Ga=()=>{},Ha={per_page:-1,status:"publish"};function $a(e){let{children:t,actions:n}=e;return(0,s.createElement)(Gn,{title:(0,E.__)("Navigation"),actions:n,description:(0,E.__)("Browse your site, edit pages, and manage your primary navigation menu."),content:t})}function Ua(){var e;const t=Tt(),{navigationMenus:n,hasResolvedNavigationMenus:a,storedSettings:r}=(0,m.useSelect)((e=>{const{getSettings:t}=Qe(e(An)),{getEntityRecords:n,hasFinishedResolution:a}=e(_.store),r=["postType","wp_navigation",Ha];return{storedSettings:t(!1),navigationMenus:n(...r),hasResolvedNavigationMenus:a("getEntityRecords",r)}}),[]),l=(0,s.useMemo)((()=>null==n?void 0:n.sort(((e,t)=>{const n=new Date(e.date),a=new Date(t.date);return n.getTime()>a.getTime()}))),[n]),o=null==l||null===(e=l[0])||void 0===e?void 0:e.id,i=(0,s.useMemo)((()=>[(0,c.createBlock)("core/navigation",{ref:o})]),[o]),u=!a,d=!(null==n||!n.length),p=(0,s.useCallback)((e=>{const{attributes:n,name:a}=e;"post-type"===n.kind&&n.id&&n.type&&t&&t.push({postType:n.type,postId:n.id}),"core/page-list-item"===a&&n.id&&t&&t.push({postType:"page",postId:n.id})}),[t]);return a&&!d?(0,s.createElement)($a,null,(0,E.__)("There are no Navigation Menus.")):!a||u?(0,s.createElement)($a,null,(0,s.createElement)(Oa,null)):(0,s.createElement)(fe.BlockEditorProvider,{settings:r,value:i,onChange:Ga,onInput:Ga},(0,s.createElement)($a,null,(0,s.createElement)("div",{className:"edit-site-sidebar-navigation-screen-navigation-menus__content"},(0,s.createElement)(Fa,{rootClientId:i[0].clientId,onSelect:p}))))}const Wa={wp_template:{title:(0,E.__)("All templates"),description:(0,E.__)("Create new templates, or reset any customizations made to the templates supplied by your theme.")},wp_template_part:{title:(0,E.__)("All template parts"),description:(0,E.__)("Create new template parts, or reset any customizations made to the template parts supplied by your theme.")}};function ja(){const{params:{postType:e}}=(0,y.__experimentalUseNavigator)();return(0,s.createElement)(Gn,{title:Wa[e].title,description:Wa[e].description})}var qa=window.wp.keycodes;function Ya(){const{countUnsavedChanges:e,isDirty:t,isSaving:n,isSaveViewOpen:a}=(0,m.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,isSavingEntityRecord:n}=e(_.store),a=t(),{isSaveViewOpened:r}=e(An);return{isDirty:a.length>0,isSaving:a.some((e=>n(e.kind,e.name,e.key))),isSaveViewOpen:r(),countUnsavedChanges:a.length}}),[]),{setIsSaveViewOpened:r}=(0,m.useDispatch)(An),l=!t||n,o=l?(0,E.__)("Saved"):(0,E.__)("Save");return(0,s.createElement)(y.__experimentalHStack,{className:"edit-site-save-hub",alignment:"right",spacing:4},t&&(0,s.createElement)("span",null,(0,E.sprintf)((0,E._n)("%d unsaved change","%d unsaved changes",e),e)),(0,s.createElement)(y.Button,{className:"edit-site-save-hub__button",variant:l?void 0:"primary","aria-disabled":l,"aria-expanded":a,isBusy:n,onClick:l?void 0:()=>r(!0),label:o,shortcut:l?void 0:qa.displayShortcut.primary("s"),icon:l?w:void 0},o))}function Xa(){var e,t;const{setCanvasMode:n}=Qe((0,m.useDispatch)(An)),{params:{postType:a,postId:r}}=(0,y.__experimentalUseNavigator)(),{record:l}=(0,_.useEntityRecord)("postType",a,r);return(0,s.createElement)(Gn,{title:l?(0,Un.decodeEntities)(null==l||null===(e=l.title)||void 0===e?void 0:e.rendered):null,actions:(0,s.createElement)(Fn,{onClick:()=>n("edit"),label:(0,E.__)("Edit"),icon:Ra}),description:"page"===a?(0,E.__)("Pages are static and are not listed by date. Pages do not use tags or categories."):(0,E.__)("Posts are entries listed in reverse chronological order on the site homepage or on the posts page."),content:(0,s.createElement)(s.Fragment,null,null!=l&&l.link?(0,s.createElement)(y.ExternalLink,{className:"edit-site-sidebar-navigation-screen__page-link",href:l.link},l.link):null,l?(0,Un.decodeEntities)(null==l||null===(t=l.description)||void 0===t?void 0:t.rendered):null)})}function Za(){return function(){const e=Tt(),{params:t}=Ct(),{location:n,params:a,goTo:r}=(0,y.__experimentalUseNavigator)(),l=(0,s.useRef)(t),o=(0,s.useRef)(n.path),i=(0,s.useRef)(!0);(0,s.useEffect)((()=>{function t(t){if(Object.entries(t).every((e=>{let[t,n]=e;return l.current[t]===n})))return;const n={...l.current,...t};l.current=n,e.push(n)}i.current?i.current=!1:null!=a&&a.postType&&null!=a&&a.postId?t({postType:null==a?void 0:a.postType,postId:null==a?void 0:a.postId,path:void 0}):t({postType:void 0,postId:void 0,path:"/"===n.path?void 0:n.path})}),[null==n?void 0:n.path,a,e]),(0,s.useEffect)((()=>{l.current=t;const e=Da(t);o.current!==e&&(o.current=e,r(e))}),[t,r])}(),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/"},(0,s.createElement)($n,null)),(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/navigation"},(0,s.createElement)(Ua,null)),(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/navigation/:postType/:postId"},(0,s.createElement)(Xa,null)),(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/:postType(wp_template|wp_template_part)"},(0,s.createElement)(Va,null)),(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/:postType(wp_template|wp_template_part)/all"},(0,s.createElement)(ja,null)),(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/:postType(wp_template|wp_template_part)/:postId"},(0,s.createElement)(La,null)))}var Ka=(0,s.memo)((function(){const{params:e}=Ct(),t=(0,s.useRef)(Da(e));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.__experimentalNavigatorProvider,{className:"edit-site-sidebar__content",initialPath:t.current},(0,s.createElement)(Za,null)),(0,s.createElement)("div",{className:"edit-site-sidebar__footer"},(0,s.createElement)(Ya,null)))}));var Qa=(0,s.createElement)(b.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"}));var Ja=(0,s.createElement)(b.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"}));function er(e){let{className:t,identifier:n,title:a,icon:r,children:l,closeLabel:o,header:i,headerClassName:c,panelClassName:u}=e;const d=(0,m.useSelect)((e=>e(An).getSettings().showIconLabels),[]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ee,{className:t,scope:"core/edit-site",identifier:n,title:a,icon:r,closeLabel:o,header:i,headerClassName:c,panelClassName:u,showIconLabels:d},l),(0,s.createElement)(X,{scope:"core/edit-site",identifier:n,icon:r},a))}var tr=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"}));var nr=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z"}));function ar(e){let{className:t,...n}=e;return(0,s.createElement)(y.Icon,g({className:f()(t,"edit-site-global-styles-icon-with-current-color")},n))}function rr(e){let{icon:t,children:n,...a}=e;return(0,s.createElement)(y.__experimentalItem,a,t&&(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(ar,{icon:t,size:24}),(0,s.createElement)(y.FlexItem,null,n)),!t&&n)}function lr(e){return(0,s.createElement)(y.__experimentalNavigatorButton,g({as:rr},e))}var or=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M6.9 7L3 17.8h1.7l1-2.8h4.1l1 2.8h1.7L8.6 7H6.9zm-.7 6.6l1.5-4.3 1.5 4.3h-3zM21.6 17c-.1.1-.2.2-.3.2-.1.1-.2.1-.4.1s-.3-.1-.4-.2c-.1-.1-.1-.3-.1-.6V12c0-.5 0-1-.1-1.4-.1-.4-.3-.7-.5-1-.2-.2-.5-.4-.9-.5-.4 0-.8-.1-1.3-.1s-1 .1-1.4.2c-.4.1-.7.3-1 .4-.2.2-.4.3-.6.5-.1.2-.2.4-.2.7 0 .3.1.5.2.8.2.2.4.3.8.3.3 0 .6-.1.8-.3.2-.2.3-.4.3-.7 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.6-.4.2-.2.4-.3.7-.4.3-.1.6-.1.8-.1.3 0 .6 0 .8.1.2.1.4.3.5.5.1.2.2.5.2.9v1.1c0 .3-.1.5-.3.6-.2.2-.5.3-.9.4-.3.1-.7.3-1.1.4-.4.1-.8.3-1.1.5-.3.2-.6.4-.8.7-.2.3-.3.7-.3 1.2 0 .6.2 1.1.5 1.4.3.4.9.5 1.6.5.5 0 1-.1 1.4-.3.4-.2.8-.6 1.1-1.1 0 .4.1.7.3 1 .2.3.6.4 1.2.4.4 0 .7-.1.9-.2.2-.1.5-.3.7-.4h-.3zm-3-.9c-.2.4-.5.7-.8.8-.3.2-.6.2-.8.2-.4 0-.6-.1-.9-.3-.2-.2-.3-.6-.3-1.1 0-.5.1-.9.3-1.2s.5-.5.8-.7c.3-.2.7-.3 1-.5.3-.1.6-.3.7-.6v3.4z"}));var ir=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"}));var sr=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"m6.6 15.6-1.2.8c.6.9 1.3 1.6 2.2 2.2l.8-1.2c-.7-.5-1.3-1.1-1.8-1.8zM5.5 12c0-.4 0-.9.1-1.3l-1.5-.3c0 .5-.1 1.1-.1 1.6s.1 1.1.2 1.6l1.5-.3c-.2-.4-.2-.9-.2-1.3zm11.9-3.6 1.2-.8c-.6-.9-1.3-1.6-2.2-2.2l-.8 1.2c.7.5 1.3 1.1 1.8 1.8zM5.3 7.6l1.2.8c.5-.7 1.1-1.3 1.8-1.8l-.7-1.3c-.9.6-1.7 1.4-2.3 2.3zm14.5 2.8-1.5.3c.1.4.1.8.1 1.3s0 .9-.1 1.3l1.5.3c.1-.5.2-1 .2-1.6s-.1-1.1-.2-1.6zM12 18.5c-.4 0-.9 0-1.3-.1l-.3 1.5c.5.1 1 .2 1.6.2s1.1-.1 1.6-.2l-.3-1.5c-.4.1-.9.1-1.3.1zm3.6-1.1.8 1.2c.9-.6 1.6-1.3 2.2-2.2l-1.2-.8c-.5.7-1.1 1.3-1.8 1.8zM10.4 4.2l.3 1.5c.4-.1.8-.1 1.3-.1s.9 0 1.3.1l.3-1.5c-.5-.1-1.1-.2-1.6-.2s-1.1.1-1.6.2z"}));var cr=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z"}));const{useGlobalSetting:ur,useGlobalStyle:mr}=Qe(fe.privateApis);function dr(e){return[pr(e),_r(e),hr(e),gr(e)].some(Boolean)}function pr(e){const t=tt(e);return ur("border.color",e)[0]&&t.includes("borderColor")}function _r(e){const t=tt(e);return ur("border.radius",e)[0]&&t.includes("borderRadius")}function hr(e){const t=tt(e);return ur("border.style",e)[0]&&t.includes("borderStyle")}function gr(e){const t=tt(e);return ur("border.width",e)[0]&&t.includes("borderWidth")}function vr(e){return e?e.style||!e.color&&!e.width?e:{...e,style:"solid"}:e}function fr(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",[r]=mr(`${a}border`,t,"user"),[l,o]=mr(`${a}border`,t),i=nt(t),c=pr(t),u=hr(t),m=gr(t),d=_r(t),[p,_]=mr(`${a}border.radius`,t),h=()=>{const e=null==r?void 0:r.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},g=(0,s.useCallback)((()=>o(void 0)),[o]),v=(0,s.useCallback)((e=>{const t=function(e){return e?(0,y.__experimentalHasSplitBorders)(e)?{top:vr(e.top),right:vr(e.right),bottom:vr(e.bottom),left:vr(e.left)}:vr(e):e}(e),n=(0,y.__experimentalHasSplitBorders)(t)?{color:null,style:null,width:null,...t}:{top:t,right:t,bottom:t,left:t};o({radius:null==l?void 0:l.radius,...n})}),[o]);return(0,s.createElement)(y.__experimentalToolsPanel,{label:(0,E.__)("Border"),resetAll:g},(m||c)&&(0,s.createElement)(y.__experimentalToolsPanelItem,{hasValue:()=>(0,y.__experimentalIsDefinedBorder)(r),label:(0,E.__)("Border"),onDeselect:()=>(()=>{if(h())return o({radius:r.radius});o(void 0)})(),isShownByDefault:!0},(0,s.createElement)(y.__experimentalBorderBoxControl,{colors:i,enableAlpha:!0,enableStyle:u,onChange:v,popoverOffset:40,popoverPlacement:"left-start",value:l,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large"})),d&&(0,s.createElement)(y.__experimentalToolsPanelItem,{hasValue:h,label:(0,E.__)("Radius"),onDeselect:()=>_(void 0),isShownByDefault:!0},(0,s.createElement)(fe.__experimentalBorderRadiusControl,{values:p,onChange:e=>{_(e||void 0)}})))}function yr(e){const t=tt(e);return t.includes("color")||t.includes("backgroundColor")||t.includes("background")||t.includes("linkColor")}var Er=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));var br=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"}));const{useGlobalSetting:wr,useGlobalStyle:Sr}=Qe(fe.privateApis),xr=["horizontal","vertical"];function kr(e){const t=Cr(e),n=Tr(e),a=Nr(e),r=Mr(e),l=Ir(e),o=Pr(e);return t||n||a||r||l||o}function Cr(e){const t=tt(e),[n]=wr("layout.contentSize",e);return n&&t.includes("contentSize")}function Tr(e){const t=tt(e),[n]=wr("layout.wideSize",e);return n&&t.includes("wideSize")}function Nr(e){const t=tt(e),[n]=wr("spacing.padding",e);return n&&t.includes("padding")}function Mr(e){const t=tt(e),[n]=wr("spacing.margin",e);return n&&t.includes("margin")}function Ir(e){const t=tt(e),[n]=wr("spacing.blockGap",e);return n&&t.includes("blockGap")}function Pr(e){const t=tt(e),[n]=wr("dimensions.minHeight",e);return n&&t.includes("minHeight")}function Br(e,t){if(!t)return e;const n={};return t.forEach((t=>{"vertical"===t&&(n.top=e.top,n.bottom=e.bottom),"horizontal"===t&&(n.left=e.left,n.right=e.right),n[t]=e[t]})),n}function zr(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function Vr(e){return e&&"string"==typeof e?{top:e}:e?{...e,right:null==e?void 0:e.left,bottom:null==e?void 0:e.top}:e}function Rr(e){let{name:t,variation:n=""}=e;const a=Cr(t),r=Tr(t),l=Nr(t),o=Mr(t),i=Ir(t),c=Pr(t),u=function(){var e,t;const[n]=wr("spacing.spacingSizes"),{custom:a,theme:r,default:l}=n||{},o=null!==(e=null!==(t=null!=a?a:r)&&void 0!==t?t:l)&&void 0!==e?e:[];return n&&o.length>0}(),m=(0,y.__experimentalUseCustomUnits)({availableUnits:wr("spacing.units",t)[0]||["%","px","em","rem","vw"]}),{contentSizeValue:d,setContentSizeValue:p,hasUserSetContentSizeValue:_,resetContentSizeValue:h}=function(e){const[t,n]=wr("layout.contentSize",e),[a]=wr("layout.contentSize",e,"user");return{contentSizeValue:t,setContentSizeValue:n,hasUserSetContentSizeValue:()=>!!a,resetContentSizeValue:()=>n("")}}(t),{wideSizeValue:g,setWideSizeValue:v,hasUserSetWideSizeValue:b,resetWideSizeValue:w}=function(e){const[t,n]=wr("layout.wideSize",e),[a]=wr("layout.wideSize",e,"user");return{wideSizeValue:t,setWideSizeValue:n,hasUserSetWideSizeValue:()=>!!a,resetWideSizeValue:()=>n("")}}(t),{paddingValues:S,paddingSides:x,isAxialPadding:k,setPaddingValues:C,resetPaddingValue:T,hasPaddingValue:N}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t?`variations.${t}.`:"",[a,r]=Sr(n+"spacing.padding",e),l=zr(a),o=(0,fe.__experimentalUseCustomSides)(e,"padding"),i=o&&o.some((e=>xr.includes(e))),s=e=>{const t=Br(e,o);r(t)},c=()=>s({}),[u]=Sr(n+"spacing.padding",e,"user");return{paddingValues:l,paddingSides:o,isAxialPadding:i,setPaddingValues:s,resetPaddingValue:c,hasPaddingValue:()=>!!u}}(t,n),{marginValues:M,marginSides:I,isAxialMargin:P,setMarginValues:B,resetMarginValue:z,hasMarginValue:V}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t?`variations.${t}.`:"",[a,r]=Sr(n+"spacing.margin",e),l=zr(a),o=(0,fe.__experimentalUseCustomSides)(e,"margin"),i=o&&o.some((e=>xr.includes(e))),s=e=>{const t=Br(e,o);r(t)},c=()=>s({});return{marginValues:l,marginSides:o,isAxialMargin:i,setMarginValues:s,resetMarginValue:c,hasMarginValue:()=>!!l&&Object.keys(l).length}}(t,n),{gapValue:R,gapValues:A,gapSides:L,isAxialGap:D,setGapValue:O,setGapValues:F,resetGapValue:G,hasGapValue:H}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t?`variations.${t}.`:"",[a,r]=Sr(n+"spacing.blockGap",e),l=Vr(a),o=(0,fe.__experimentalUseCustomSides)(e,"blockGap"),i=o&&o.some((e=>xr.includes(e))),s=()=>r(void 0),[c]=Sr(n+"spacing.blockGap",e,"user"),u=e=>{e||r(null),!i&&null!=e&&e.hasOwnProperty("top")?r(e.top):r({top:null==e?void 0:e.top,left:null==e?void 0:e.left})};return{gapValue:a,gapValues:l,gapSides:o,isAxialGap:i,setGapValue:r,setGapValues:u,resetGapValue:s,hasGapValue:()=>!!c}}(t,n),{minHeightValue:$,setMinHeightValue:U,resetMinHeightValue:W,hasMinHeightValue:j}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t?`variations.${t}.`:"",[a,r]=Sr(n+"dimensions.minHeight",e),l=()=>r(void 0);return{minHeightValue:a,setMinHeightValue:r,resetMinHeightValue:l,hasMinHeightValue:()=>!!a}}(t,n);return(0,s.createElement)(y.__experimentalToolsPanel,{label:(0,E.__)("Dimensions"),resetAll:()=>{T(),z(),G(),h(),w()}},(a||r)&&(0,s.createElement)("span",{className:"span-columns"},(0,E.__)("Set the width of the main content area.")),a&&(0,s.createElement)(y.__experimentalToolsPanelItem,{className:"single-column",label:(0,E.__)("Content size"),hasValue:_,onDeselect:h,isShownByDefault:!0},(0,s.createElement)(y.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,s.createElement)(y.__experimentalUnitControl,{label:(0,E.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:d||"",onChange:e=>{p(e)},units:m}),(0,s.createElement)(y.__experimentalView,null,(0,s.createElement)(ie,{icon:Er})))),r&&(0,s.createElement)(y.__experimentalToolsPanelItem,{className:"single-column",label:(0,E.__)("Wide size"),hasValue:b,onDeselect:w,isShownByDefault:!0},(0,s.createElement)(y.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,s.createElement)(y.__experimentalUnitControl,{label:(0,E.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:g||"",onChange:e=>{v(e)},units:m}),(0,s.createElement)(y.__experimentalView,null,(0,s.createElement)(ie,{icon:br})))),l&&(0,s.createElement)(y.__experimentalToolsPanelItem,{hasValue:N,label:(0,E.__)("Padding"),onDeselect:T,isShownByDefault:!0,className:f()({"tools-panel-item-spacing":u})},!u&&(0,s.createElement)(y.__experimentalBoxControl,{values:S,onChange:C,label:(0,E.__)("Padding"),sides:x,units:m,allowReset:!1,splitOnAxis:k}),u&&(0,s.createElement)(fe.__experimentalSpacingSizesControl,{values:S,onChange:C,label:(0,E.__)("Padding"),sides:x,units:m,allowReset:!1,splitOnAxis:k})),o&&(0,s.createElement)(y.__experimentalToolsPanelItem,{hasValue:V,label:(0,E.__)("Margin"),onDeselect:z,isShownByDefault:!0,className:f()({"tools-panel-item-spacing":u})},!u&&(0,s.createElement)(y.__experimentalBoxControl,{values:M,onChange:B,label:(0,E.__)("Margin"),sides:I,units:m,allowReset:!1,splitOnAxis:P}),u&&(0,s.createElement)(fe.__experimentalSpacingSizesControl,{values:M,onChange:B,label:(0,E.__)("Margin"),sides:I,units:m,allowReset:!1,splitOnAxis:P})),i&&(0,s.createElement)(y.__experimentalToolsPanelItem,{hasValue:H,label:(0,E.__)("Block spacing"),onDeselect:G,isShownByDefault:!0,className:f()({"tools-panel-item-spacing":u})},!u&&(D?(0,s.createElement)(y.__experimentalBoxControl,{label:(0,E.__)("Block spacing"),min:0,onChange:F,units:m,sides:L,values:A,allowReset:!1,splitOnAxis:D}):(0,s.createElement)(y.__experimentalUnitControl,{label:(0,E.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:O,units:m,value:R})),u&&(0,s.createElement)(fe.__experimentalSpacingSizesControl,{label:(0,E.__)("Block spacing"),min:0,onChange:F,sides:D?L:["top"],values:A,allowReset:!1,splitOnAxis:D})),c&&(0,s.createElement)(y.__experimentalToolsPanelItem,{hasValue:j,label:(0,E.__)("Min. height"),onDeselect:W,isShownByDefault:!0},(0,s.createElement)(fe.HeightControl,{label:(0,E.__)("Min. height"),value:$,onChange:U})))}const{useGlobalSetting:Ar,useGlobalStyle:Lr}=Qe(fe.privateApis);function Dr(e){const t=Or(e),n=Fr(e),a=Gr(e),r=Hr(e),l=tt(e);return t||n||a||r||l.includes("fontSize")}function Or(e){const t=tt(e),[n]=Ar("typography.fontFamilies",e),a=(null==n?void 0:n.custom)||(null==n?void 0:n.theme)||(null==n?void 0:n.default);return t.includes("fontFamily")&&!(null==a||!a.length)}function Fr(e){const t=tt(e);return Ar("typography.lineHeight",e)[0]&&t.includes("lineHeight")}function Gr(e){const t=tt(e),n=Ar("typography.fontStyle",e)[0]&&t.includes("fontStyle"),a=Ar("typography.fontWeight",e)[0]&&t.includes("fontWeight");return n||a}function Hr(e,t){if(!Ar("typography.letterSpacing",e)[0])return!1;if(!e&&"heading"===t)return!0;return tt(e).includes("letterSpacing")}function $r(e,t){const[n,a]=Lr(e,t),[r]=Lr(e,t,"user");return[n,a,()=>!!r,()=>a(void 0)]}function Ur(e){let{name:t,element:n,headingLevel:a,variation:r=""}=e;const l=tt(t);let o="";"heading"===n?o=`elements.${a}.`:n&&"text"!==n&&(o=`elements.${n}.`),r&&(o=o?`variations.${r}.${o}`:`variations.${r}`);const[i]=Ar("typography.fontSizes",t),c=(null==i?void 0:i.custom)||(null==i?void 0:i.theme)||(null==i?void 0:i.default),u=!Ar("typography.customFontSize",t)[0],[m]=Ar("typography.fontFamilies",t),d=(null==m?void 0:m.custom)||(null==m?void 0:m.theme)||(null==m?void 0:m.default),p=Ar("typography.fontStyle",t)[0]&&l.includes("fontStyle"),_=Ar("typography.fontWeight",t)[0]&&l.includes("fontWeight"),h=Or(t),g=Fr(t),v=Gr(t),f=function(e){const t=tt(e),n=Ar("typography.fontStyle",e)[0]&&t.includes("fontStyle"),a=Ar("typography.fontWeight",e)[0]&&t.includes("fontWeight");return n?a?(0,E.__)("Appearance"):(0,E.__)("Font style"):(0,E.__)("Font weight")}(t),b=Hr(t,n),w=function(e,t){return!!Ar("typography.textTransform",e)[0]&&(!e&&"heading"===t||tt(e).includes("textTransform"))}(t,n),S=function(e,t){return!e&&"link"===t}(t,n);let x=l.includes("fontSize");"heading"===n&&"heading"===a&&(x=!1);const[k,C,T,N]=$r(o+"typography.fontFamily",t),{fontSize:M,setFontSize:I,hasFontSize:P,resetFontSize:B}=function(e,t){const[n,a]=Lr(e,t),[r]=Lr(e,t,"user");return{fontSize:n,setFontSize:(e,t)=>{null!=t&&t.slug&&(e=`var:preset|font-size|${null==t?void 0:t.slug}`),a(e)},hasFontSize:()=>!!r,resetFontSize:()=>a(void 0)}}(o+"typography.fontSize",t),{fontStyle:z,setFontStyle:V,fontWeight:R,setFontWeight:A,hasFontAppearance:L,resetFontAppearance:D}=function(e,t){const[n,a]=Lr(e+"typography.fontStyle",t),[r]=Lr(e+"typography.fontStyle",t,"user"),[l,o]=Lr(e+"typography.fontWeight",t),[i]=Lr(e+"typography.fontWeight",t,"user");return{fontStyle:n,setFontStyle:a,fontWeight:l,setFontWeight:o,hasFontAppearance:()=>!!r||!!i,resetFontAppearance:()=>{a(void 0),o(void 0)}}}(o,t),[O,F,G,H]=$r(o+"typography.lineHeight",t),[$,U,W,j]=$r(o+"typography.letterSpacing",t),[q,Y,X,Z]=$r(o+"typography.textTransform",t),[K,Q,J,ee]=$r(o+"typography.textDecoration",t);return(0,s.createElement)(y.__experimentalToolsPanel,{label:(0,E.__)("Typography"),resetAll:()=>{N(),B(),D(),H(),j(),Z()}},h&&(0,s.createElement)(y.__experimentalToolsPanelItem,{label:(0,E.__)("Font family"),hasValue:T,onDeselect:N,isShownByDefault:!0},(0,s.createElement)(fe.__experimentalFontFamilyControl,{fontFamilies:d,value:k,onChange:C,size:"__unstable-large",__nextHasNoMarginBottom:!0})),x&&(0,s.createElement)(y.__experimentalToolsPanelItem,{label:(0,E.__)("Font size"),hasValue:P,onDeselect:B,isShownByDefault:!0},(0,s.createElement)(y.FontSizePicker,{value:M,onChange:I,fontSizes:c,disableCustomFontSizes:u,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})),v&&(0,s.createElement)(y.__experimentalToolsPanelItem,{className:"single-column",label:f,hasValue:L,onDeselect:D,isShownByDefault:!0},(0,s.createElement)(fe.__experimentalFontAppearanceControl,{value:{fontStyle:z,fontWeight:R},onChange:e=>{let{fontStyle:t,fontWeight:n}=e;V(t),A(n)},hasFontStyles:p,hasFontWeights:_,size:"__unstable-large",__nextHasNoMarginBottom:!0})),g&&(0,s.createElement)(y.__experimentalToolsPanelItem,{className:"single-column",label:(0,E.__)("Line height"),hasValue:G,onDeselect:H,isShownByDefault:!0},(0,s.createElement)(fe.LineHeightControl,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:O,onChange:F,size:"__unstable-large"})),b&&(0,s.createElement)(y.__experimentalToolsPanelItem,{className:"single-column",label:(0,E.__)("Letter spacing"),hasValue:W,onDeselect:j,isShownByDefault:!0},(0,s.createElement)(fe.__experimentalLetterSpacingControl,{value:$,onChange:U,size:"__unstable-large",__unstableInputWidth:"auto"})),w&&(0,s.createElement)(y.__experimentalToolsPanelItem,{label:(0,E.__)("Letter case"),hasValue:X,onDeselect:Z,isShownByDefault:!0},(0,s.createElement)(fe.__experimentalTextTransformControl,{value:q,onChange:Y,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})),S&&(0,s.createElement)(y.__experimentalToolsPanelItem,{className:"single-column",label:(0,E.__)("Text decoration"),hasValue:J,onDeselect:ee,isShownByDefault:!0},(0,s.createElement)(fe.__experimentalTextDecorationControl,{value:K,onChange:Q,size:"__unstable-large",__unstableInputWidth:"auto"})))}function Wr(e){return null==e?void 0:e.filter((e=>"block"===e.source))}function jr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t.includes("variations"),a=(0,m.useSelect)((t=>{const{getBlockStyles:n}=t(c.store);return n(e)}),[e]),r=Wr(a);return!(null==r||!r.length||n)}function qr(e){let{name:t}=e;const n=Wr((0,m.useSelect)((e=>{const{getBlockStyles:n}=e(c.store);return n(t)}),[t]));return(0,s.createElement)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},n.map(((e,n)=>null!=e&&e.isDefault?null:(0,s.createElement)(lr,{key:n,path:"/blocks/"+encodeURIComponent(t)+"/variations/"+encodeURIComponent(e.name),"aria-label":e.label},e.label))))}function Yr(e){let{blockName:t,styleName:n}=e;return(0,s.createElement)(sl,{parentMenu:"/blocks/"+encodeURIComponent(t)+"/variations/"+encodeURIComponent(n),name:t})}var Xr=function(e){let{title:t,description:n}=e;return(0,s.createElement)(y.__experimentalVStack,{spacing:0},(0,s.createElement)(y.__experimentalView,null,(0,s.createElement)(y.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3},(0,s.createElement)(y.__experimentalHStack,{spacing:2},(0,s.createElement)(y.__experimentalNavigatorToParentButton,{style:{minWidth:24,padding:0},icon:(0,E.isRTL)()?ce:se,isSmall:!0,"aria-label":(0,E.__)("Navigate to the previous view")}),(0,s.createElement)(y.__experimentalSpacer,null,(0,s.createElement)(y.__experimentalHeading,{level:5},t))))),n&&(0,s.createElement)("p",{className:"edit-site-global-styles-header__description"},n))};var Zr=e=>{var t;let{name:n,variation:a=""}=e;const r=null===(t=(0,c.getBlockType)(n))||void 0===t?void 0:t.example,l={...r,attributes:{...null==r?void 0:r.attributes,className:a}},o=r&&(0,c.getBlockFromExample)(n,a?l:r),i=(null==r?void 0:r.viewportWidth)||null,u="150px";return r?(0,s.createElement)(y.__experimentalSpacer,{marginX:4,marginBottom:4},(0,s.createElement)("div",{className:"edit-site-global-styles__block-preview-panel",style:{maxHeight:u,boxSizing:"initial"}},(0,s.createElement)(fe.BlockPreview,{blocks:o,viewportWidth:i,minHeight:u,additionalStyles:[{css:"\n\t\t\t\t\t\t\t\tbody{\n\t\t\t\t\t\t\t\t\tmin-height:150px;\n\t\t\t\t\t\t\t\t\tdisplay:flex;align-items:center;justify-content:center;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t"}]}))):null};var Kr=function(e){let{children:t}=e;return(0,s.createElement)(y.__experimentalHeading,{className:"edit-site-global-styles-subtitle",level:2},t)};function Qr(e){let{name:t,path:n=""}=e;return jr(t,n)?(0,s.createElement)("div",{className:"edit-site-global-styles-screen-variations"},(0,s.createElement)(y.__experimentalVStack,{spacing:3},(0,s.createElement)(Kr,null,(0,E.__)("Style Variations")),(0,s.createElement)(qr,{name:t}))):null}function Jr(e){let{blockName:t,style:n}=e;const{name:a,label:r}=n;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:r}),(0,s.createElement)(Zr,{name:t,variation:`is-style-${a}`}),(0,s.createElement)(Yr,{blockName:t,styleName:a}))}const{useGlobalSetting:el,useGlobalStyle:tl}=Qe(fe.privateApis);function nl(e){return tt(e).includes("shadow")}function al(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",[r,l]=tl(`${a}shadow`,t),[o]=tl(`${a}shadow`,t,"user"),i=()=>l(void 0),c=(0,s.useCallback)((()=>i()),[i]);return(0,s.createElement)(y.__experimentalToolsPanel,{label:(0,E.__)("Shadow"),resetAll:c},(0,s.createElement)(y.__experimentalToolsPanelItem,{label:(0,E.__)("Shadow"),hasValue:()=>!!o,onDeselect:i,isShownByDefault:!0},(0,s.createElement)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(rl,{shadow:r,onShadowChange:l}))))}const rl=e=>{let{shadow:t,onShadowChange:n}=e;return(0,s.createElement)(y.Dropdown,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"edit-site-global-styles__shadow-dropdown",renderToggle:e=>{let{onToggle:t,isOpen:n}=e;const a={onClick:t,className:f()({"is-open":n}),"aria-expanded":n};return(0,s.createElement)(y.Button,a,(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(ar,{icon:cr,size:24}),(0,s.createElement)(y.FlexItem,{className:"edit-site-global-styles__shadow-label"},(0,E.__)("Shadow"))))},renderContent:()=>(0,s.createElement)(y.__experimentalDropdownContentWrapper,{paddingSize:"medium"},(0,s.createElement)(ll,{shadow:t,onShadowChange:n}))})};function ll(e){let{shadow:t,onShadowChange:n}=e;const[a]=el("shadow.presets.default"),[r]=el("shadow.presets.theme"),[l]=el("shadow.defaultPresets"),o=[...l?a:[],...r||[]];return(0,s.createElement)("div",{className:"edit-site-global-styles__shadow-panel"},(0,s.createElement)(y.__experimentalVStack,{spacing:4},(0,s.createElement)(y.__experimentalHeading,{level:5},(0,E.__)("Shadow")),(0,s.createElement)(ol,{presets:o,activeShadow:t,onSelect:n})))}function ol(e){let{presets:t,activeShadow:n,onSelect:a}=e;return t?(0,s.createElement)(y.__experimentalGrid,{columns:6,gap:0,align:"center",justify:"center"},t.map((e=>{let{name:t,slug:r,shadow:l}=e;return(0,s.createElement)(il,{key:r,label:t,isActive:l===n,onSelect:()=>a(l===n?void 0:l),shadow:l})}))):null}function il(e){let{label:t,isActive:n,onSelect:a,shadow:r}=e;return(0,s.createElement)("div",{className:"edit-site-global-styles__shadow-indicator-wrapper"},(0,s.createElement)(y.Button,{className:"edit-site-global-styles__shadow-indicator",onClick:a,label:t,style:{boxShadow:r},showTooltip:!0},n&&(0,s.createElement)(ie,{icon:w})))}var sl=function(e){let{name:t,parentMenu:n=""}=e;const a=Dr(t),r=yr(t),l=dr(t),o=nl(t),i=kr(t),c=jr(t,n),{canEditCSS:u}=(0,m.useSelect)((e=>{var t,n;const{getEntityRecord:a,__experimentalGetCurrentGlobalStylesId:r}=e(_.store),l=r(),o=l?a("root","globalStyles",l):void 0;return{canEditCSS:null!==(t=!(null==o||null===(n=o._links)||void 0===n||!n["wp:action-edit-css"]))&&void 0!==t&&t}}),[]),d=n.includes("blocks")&&!n.includes("variations");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.__experimentalItemGroup,null,a&&(0,s.createElement)(lr,{icon:or,path:n+"/typography","aria-label":(0,E.__)("Typography styles")},(0,E.__)("Typography")),r&&(0,s.createElement)(lr,{icon:ir,path:n+"/colors","aria-label":(0,E.__)("Colors styles")},(0,E.__)("Colors")),l&&(0,s.createElement)(lr,{icon:sr,path:n+"/border","aria-label":(0,E.__)("Border")},(0,E.__)("Border")),o&&(0,s.createElement)(lr,{icon:cr,path:n+"/effects","aria-label":(0,E.__)("Shadow")},(0,E.__)("Shadow")),i&&(0,s.createElement)(lr,{icon:Dn,path:n+"/layout","aria-label":(0,E.__)("Layout styles")},(0,E.__)("Layout")),c&&(0,s.createElement)(Qr,{name:t,path:n}),d&&u&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.CardDivider,null),(0,s.createElement)(y.CardBody,null,(0,s.createElement)(y.__experimentalSpacer,{as:"p",paddingTop:2,marginBottom:4},(0,E.__)("Add your own CSS to customize the block appearance.")),(0,s.createElement)(y.__experimentalItemGroup,null,(0,s.createElement)(lr,{path:n+"/css","aria-label":(0,E.__)("Additional block CSS")},(0,s.createElement)(y.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(y.FlexItem,null,(0,E.__)("Additional block CSS")),(0,s.createElement)(ar,{icon:(0,E.isRTL)()?se:ce}))))),(0,s.createElement)(y.CardDivider,null))))};const{useGlobalSetting:cl,useGlobalStyle:ul,useGlobalStylesOutput:ml}=Qe(fe.privateApis),dl={start:{scale:1,opacity:1},hover:{scale:0,opacity:0}},pl={hover:{opacity:1},start:{opacity:.5}},_l={hover:{scale:1,opacity:1},start:{scale:0,opacity:0}};var hl=e=>{let{label:t,isFocused:n,withHoverView:a}=e;const[r]=ul("typography.fontWeight"),[l="serif"]=ul("typography.fontFamily"),[o=l]=ul("elements.h1.typography.fontFamily"),[i=r]=ul("elements.h1.typography.fontWeight"),[c="black"]=ul("color.text"),[u=c]=ul("elements.h1.color.text"),[m="white"]=ul("color.background"),[d]=ul("color.gradient"),[p]=ml(),_=(0,te.useReducedMotion)(),[h]=cl("color.palette.core"),[g]=cl("color.palette.theme"),[v]=cl("color.palette.custom"),[f,E]=(0,s.useState)(!1),[b,{width:w}]=(0,te.useResizeObserver)(),S=w?w/248:1,x=(null!=g?g:[]).concat(null!=v?v:[]).concat(null!=h?h:[]),k=x.filter((e=>{let{color:t}=e;return t!==m&&t!==u})).slice(0,2),C=(0,s.useMemo)((()=>p?[...p,{css:"html{overflow:hidden}body{min-width: 0;padding: 0;border: none;}",isGlobalStyles:!0}]:p),[p]);return(0,s.createElement)(fe.__unstableIframe,{className:"edit-site-global-styles-preview__iframe",head:(0,s.createElement)(fe.__unstableEditorStyles,{styles:C}),style:{height:152*S,visibility:w?"visible":"hidden"},onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),tabIndex:-1},b,(0,s.createElement)(y.__unstableMotion.div,{style:{height:152*S,width:"100%",background:null!=d?d:m,cursor:"pointer"},initial:"start",animate:(f||n)&&!_&&t?"hover":"start"},(0,s.createElement)(y.__unstableMotion.div,{variants:dl,style:{height:"100%",overflow:"hidden"}},(0,s.createElement)(y.__experimentalHStack,{spacing:10*S,justify:"center",style:{height:"100%",overflow:"hidden"}},(0,s.createElement)(y.__unstableMotion.div,{style:{fontFamily:o,fontSize:65*S,color:u,fontWeight:i},animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:.3,type:"tween"}},"Aa"),(0,s.createElement)(y.__experimentalVStack,{spacing:4*S},k.map(((e,t)=>{let{slug:n,color:a}=e;return(0,s.createElement)(y.__unstableMotion.div,{key:n,style:{height:32*S,width:32*S,background:a,borderRadius:32*S/2},animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:1===t?.2:.1}})}))))),(0,s.createElement)(y.__unstableMotion.div,{variants:a&&pl,style:{height:"100%",width:"100%",position:"absolute",top:0,overflow:"hidden",filter:"blur(60px)",opacity:.1}},(0,s.createElement)(y.__experimentalHStack,{spacing:0,justify:"flex-start",style:{height:"100%",overflow:"hidden"}},x.slice(0,4).map(((e,t)=>{let{color:n}=e;return(0,s.createElement)("div",{key:t,style:{height:"100%",background:n,flexGrow:1}})})))),(0,s.createElement)(y.__unstableMotion.div,{variants:_l,style:{height:"100%",width:"100%",overflow:"hidden",position:"absolute",top:0}},(0,s.createElement)(y.__experimentalVStack,{spacing:3*S,justify:"center",style:{height:"100%",overflow:"hidden",padding:10*S,boxSizing:"border-box"}},t&&(0,s.createElement)("div",{style:{fontSize:40*S,fontFamily:o,color:u,fontWeight:i,lineHeight:"1em",textAlign:"center"}},t)))))};var gl=function(){const{useGlobalStyle:e}=Qe(fe.privateApis),[t]=e("css"),{variations:n,canEditCSS:a}=(0,m.useSelect)((e=>{var t,n;const{getEntityRecord:a,__experimentalGetCurrentGlobalStylesId:r,__experimentalGetCurrentThemeGlobalStylesVariations:l}=e(_.store),o=r(),i=o?a("root","globalStyles",o):void 0;return{variations:l(),canEditCSS:null!==(t=!(null==i||null===(n=i._links)||void 0===n||!n["wp:action-edit-css"]))&&void 0!==t&&t}}),[]);return(0,s.createElement)(y.Card,{size:"small"},(0,s.createElement)(y.CardBody,null,(0,s.createElement)(y.__experimentalVStack,{spacing:4},(0,s.createElement)(y.Card,null,(0,s.createElement)(y.CardMedia,null,(0,s.createElement)(hl,null))),!(null==n||!n.length)&&(0,s.createElement)(y.__experimentalItemGroup,null,(0,s.createElement)(lr,{path:"/variations","aria-label":(0,E.__)("Browse styles")},(0,s.createElement)(y.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(y.FlexItem,null,(0,E.__)("Browse styles")),(0,s.createElement)(ar,{icon:(0,E.isRTL)()?se:ce})))),(0,s.createElement)(sl,null))),(0,s.createElement)(y.CardDivider,null),(0,s.createElement)(y.CardBody,null,(0,s.createElement)(y.__experimentalSpacer,{as:"p",paddingTop:2,paddingX:"13px",marginBottom:4},(0,E.__)("Customize the appearance of specific blocks for the whole site.")),(0,s.createElement)(y.__experimentalItemGroup,null,(0,s.createElement)(lr,{path:"/blocks","aria-label":(0,E.__)("Blocks styles")},(0,s.createElement)(y.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(y.FlexItem,null,(0,E.__)("Blocks")),(0,s.createElement)(ar,{icon:(0,E.isRTL)()?se:ce}))))),a&&!!t&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.CardDivider,null),(0,s.createElement)(y.CardBody,null,(0,s.createElement)(y.__experimentalSpacer,{as:"p",paddingTop:2,paddingX:"13px",marginBottom:4},(0,E.__)("Add your own CSS to customize the appearance and layout of your site.")),(0,s.createElement)(y.__experimentalItemGroup,null,(0,s.createElement)(lr,{path:"/css","aria-label":(0,E.__)("Additional CSS")},(0,s.createElement)(y.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(y.FlexItem,null,(0,E.__)("Additional CSS")),(0,s.createElement)(ar,{icon:(0,E.isRTL)()?se:ce})))))))};function vl(e){let{block:t}=e;const n=Dr(t.name),a=yr(t.name),r=dr(t.name),l=kr(t.name),o=r||l,i=jr(t.name);if(!(n||a||o||i))return null;const c=(0,E.sprintf)((0,E.__)("%s block styles"),t.title);return(0,s.createElement)(lr,{path:"/blocks/"+encodeURIComponent(t.name),"aria-label":c},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(fe.BlockIcon,{icon:t.icon}),(0,s.createElement)(y.FlexItem,null,t.title)))}var fl=function(){const e=function(){const e=(0,m.useSelect)((e=>e(c.store).getBlockTypes()),[]),{core:t,noncore:n}=e.reduce(((e,t)=>{const{core:n,noncore:a}=e;return(t.name.startsWith("core/")?n:a).push(t),e}),{core:[],noncore:[]});return[...t,...n]}(),[t,n]=(0,s.useState)(""),a=(0,te.useDebounce)(Lt.speak,500),r=(0,m.useSelect)((e=>e(c.store).isMatchingSearchTerm),[]),l=(0,s.useMemo)((()=>t?e.filter((e=>r(e,t))):e),[t,e,r]),o=(0,s.useRef)();return(0,s.useEffect)((()=>{if(!t)return;const e=o.current.childElementCount,n=(0,E.sprintf)((0,E._n)("%d result found.","%d results found.",e),e);a(n,e)}),[t,a]),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Blocks"),description:(0,E.__)("Customize the appearance of specific blocks and for the whole site.")}),(0,s.createElement)(y.SearchControl,{__nextHasNoMarginBottom:!0,className:"edit-site-block-types-search",onChange:n,value:t,label:(0,E.__)("Search for blocks"),placeholder:(0,E.__)("Search")}),(0,s.createElement)("div",{ref:o,className:"edit-site-block-types-item-list"},l.map((e=>(0,s.createElement)(vl,{block:e,key:"menu-itemblock-"+e.name})))))};var yl=function(e){let{name:t}=e;const n=(0,c.getBlockType)(t);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:n.title}),(0,s.createElement)(Zr,{name:t}),(0,s.createElement)(sl,{parentMenu:"/blocks/"+encodeURIComponent(t),name:t}))};function El(e){return e?`is-style-${e}`:""}const{useGlobalStyle:bl}=Qe(fe.privateApis);function wl(e){let{name:t,parentMenu:n,element:a,label:r}=e;const l=!t,o="text"!==a&&a?`elements.${a}.`:"",i="link"===a?{textDecoration:"underline"}:{},[c]=bl(o+"typography.fontFamily",t),[u]=bl(o+"typography.fontStyle",t),[m]=bl(o+"typography.fontWeight",t),[d]=bl(o+"typography.letterSpacing",t),[p]=bl(o+"color.background",t),[_]=bl(o+"color.gradient",t),[h]=bl(o+"color.text",t);if(!l)return null;const g=(0,E.sprintf)((0,E.__)("Typography %s styles"),r);return(0,s.createElement)(lr,{path:n+"/typography/"+a,"aria-label":g},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(y.FlexItem,{className:"edit-site-global-styles-screen-typography__indicator",style:{fontFamily:null!=c?c:"serif",background:null!=_?_:p,color:h,fontStyle:u,fontWeight:m,letterSpacing:d,...i}},(0,E.__)("Aa")),(0,s.createElement)(y.FlexItem,null,r)))}var Sl=function(e){let{name:t,variation:n=""}=e;const a=void 0===t?"":"/blocks/"+t,r=El(n);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Typography"),description:(0,E.__)("Manage the typography settings for different elements.")}),(0,s.createElement)(Zr,{name:t,variation:r}),!t&&(0,s.createElement)("div",{className:"edit-site-global-styles-screen-typography"},(0,s.createElement)(y.__experimentalVStack,{spacing:3},(0,s.createElement)(Kr,null,(0,E.__)("Elements")),(0,s.createElement)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(wl,{name:t,parentMenu:a,element:"text",label:(0,E.__)("Text")}),(0,s.createElement)(wl,{name:t,parentMenu:a,element:"link",label:(0,E.__)("Links")}),(0,s.createElement)(wl,{name:t,parentMenu:a,element:"heading",label:(0,E.__)("Headings")}),(0,s.createElement)(wl,{name:t,parentMenu:a,element:"button",label:(0,E.__)("Buttons")})))),!!t&&(0,s.createElement)(Ur,{name:t,variation:n,element:"text"}))};const{useGlobalStyle:xl}=Qe(fe.privateApis);function kl(e){let{name:t,element:n,headingLevel:a}=e,r="";"heading"===n?r=`elements.${a}.`:n&&"text"!==n&&(r=`elements.${n}.`);const[l]=xl(r+"typography.fontFamily",t),[o]=xl(r+"color.gradient",t),[i]=xl(r+"color.background",t),[c]=xl(r+"color.text",t),[u]=xl(r+"typography.fontSize",t),[m]=xl(r+"typography.fontStyle",t),[d]=xl(r+"typography.fontWeight",t),[p]=xl(r+"typography.letterSpacing",t),_="link"===n?{textDecoration:"underline"}:{};return(0,s.createElement)("div",{className:"edit-site-typography-preview",style:{fontFamily:null!=l?l:"serif",background:null!=o?o:i,color:c,fontSize:u,fontStyle:m,fontWeight:d,letterSpacing:p,..._}},"Aa")}const Cl={text:{description:(0,E.__)("Manage the fonts used on the site."),title:(0,E.__)("Text")},link:{description:(0,E.__)("Manage the fonts and typography used on the links."),title:(0,E.__)("Links")},heading:{description:(0,E.__)("Manage the fonts and typography used on headings."),title:(0,E.__)("Headings")},button:{description:(0,E.__)("Manage the fonts and typography used on buttons."),title:(0,E.__)("Buttons")}};var Tl=function(e){let{name:t,element:n}=e;const[a,r]=(0,s.useState)("heading");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:Cl[n].title,description:Cl[n].description}),(0,s.createElement)(y.__experimentalSpacer,{marginX:4},(0,s.createElement)(kl,{name:t,element:n,headingLevel:a})),"heading"===n&&(0,s.createElement)(y.__experimentalSpacer,{marginX:4,marginBottom:"1em"},(0,s.createElement)(y.__experimentalToggleGroupControl,{label:(0,E.__)("Select heading level"),hideLabelFromVision:!0,value:a,onChange:r,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0},(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"heading",label:(0,E.__)("All")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h1",label:(0,E.__)("H1")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h2",label:(0,E.__)("H2")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h3",label:(0,E.__)("H3")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h4",label:(0,E.__)("H4")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h5",label:(0,E.__)("H5")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h6",label:(0,E.__)("H6")}))),(0,s.createElement)(Ur,{name:t,element:n,headingLevel:a}))};var Nl=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/SVG"},(0,s.createElement)(b.Path,{d:"M17.192 6.75L15.47 5.03l1.06-1.06 3.537 3.53-3.537 3.53-1.06-1.06 1.723-1.72h-3.19c-.602 0-.993.202-1.28.498-.309.319-.538.792-.695 1.383-.13.488-.222 1.023-.296 1.508-.034.664-.116 1.413-.303 2.117-.193.721-.513 1.467-1.068 2.04-.575.594-1.359.954-2.357.954H4v-1.5h4.003c.601 0 .993-.202 1.28-.498.308-.319.538-.792.695-1.383.149-.557.216-1.093.288-1.662l.039-.31a9.653 9.653 0 0 1 .272-1.653c.193-.722.513-1.467 1.067-2.04.576-.594 1.36-.954 2.358-.954h3.19zM8.004 6.75c.8 0 1.46.23 1.988.628a6.24 6.24 0 0 0-.684 1.396 1.725 1.725 0 0 0-.024-.026c-.287-.296-.679-.498-1.28-.498H4v-1.5h4.003zM12.699 14.726c-.161.459-.38.94-.684 1.396.527.397 1.188.628 1.988.628h3.19l-1.722 1.72 1.06 1.06L20.067 16l-3.537-3.53-1.06 1.06 1.723 1.72h-3.19c-.602 0-.993-.202-1.28-.498a1.96 1.96 0 0 1-.024-.026z"}));var Ml=function(e){let{className:t,...n}=e;return(0,s.createElement)(y.Flex,g({className:f()("edit-site-global-styles__color-indicator-wrapper",t)},n))};const{useGlobalSetting:Il}=Qe(fe.privateApis),Pl=[];var Bl=function(e){let{name:t}=e;const[n]=Il("color.palette.custom"),[a]=Il("color.palette.theme"),[r]=Il("color.palette.default"),[l]=Il("color.defaultPalette",t),[o]=function(e){const[t,n]=Je("color.palette.theme",e);return window.__experimentalEnableColorRandomizer?[function(){const e=Math.floor(225*Math.random()),a=t.map((t=>{const{color:n}=t,a=je(n).rotate(e).toHex();return{...t,color:a}}));n(a)}]:[]}(),i=(0,s.useMemo)((()=>[...n||Pl,...a||Pl,...r&&l?r:Pl]),[n,a,r,l]),c=t?"/blocks/"+encodeURIComponent(t)+"/colors/palette":"/colors/palette",u=i.length>0?(0,E.sprintf)((0,E._n)("%d color","%d colors",i.length),i.length):(0,E.__)("Add custom colors");return(0,s.createElement)(y.__experimentalVStack,{spacing:3},(0,s.createElement)(Kr,null,(0,E.__)("Palette")),(0,s.createElement)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(lr,{path:c,"aria-label":(0,E.__)("Color palettes")},(0,s.createElement)(y.__experimentalHStack,{direction:0===i.length?"row-reverse":"row"},(0,s.createElement)(y.__experimentalZStack,{isLayered:!1,offset:-8},i.slice(0,5).map(((e,t)=>{let{color:n}=e;return(0,s.createElement)(Ml,{key:`${n}-${t}`},(0,s.createElement)(y.ColorIndicator,{colorValue:n}))}))),(0,s.createElement)(y.FlexItem,null,u)))),o&&(0,s.createElement)(y.Button,{variant:"secondary",icon:Nl,onClick:o},(0,E.__)("Randomize colors")))};const{useGlobalStyle:zl}=Qe(fe.privateApis);function Vl(e){let{name:t,parentMenu:n,variation:a=""}=e;const r=a?`variations.${a}.`:"",l=a?`/variations/${a}`:"",o=tt(t),i=o.includes("backgroundColor")||o.includes("background"),[c]=zl(r+"color.background",t),[u]=zl(r+"color.gradient",t);return i?(0,s.createElement)(lr,{path:n+l+"/colors/background","aria-label":(0,E.__)("Colors background styles")},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:null!=u?u:c,"data-testid":"background-color-indicator"})),(0,s.createElement)(y.FlexItem,{className:"edit-site-global-styles__color-label"},(0,E.__)("Background")))):null}function Rl(e){let{name:t,parentMenu:n,variation:a=""}=e;const r=a?`variations.${a}.`:"",l=a?`/variations/${a}`:"",o=tt(t).includes("color"),[i]=zl(r+"color.text",t);return o?(0,s.createElement)(lr,{path:n+l+"/colors/text","aria-label":(0,E.__)("Colors text styles")},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:i,"data-testid":"text-color-indicator"})),(0,s.createElement)(y.FlexItem,{className:"edit-site-global-styles__color-label"},(0,E.__)("Text")))):null}function Al(e){let{name:t,parentMenu:n,variation:a=""}=e;const r=a?`variations.${a}.`:"",l=a?`/variations/${a}`:"",o=tt(t).includes("linkColor"),[i]=zl(r+"elements.link.color.text",t),[c]=zl(r+"elements.link.:hover.color.text",t);return o?(0,s.createElement)(lr,{path:n+l+"/colors/link","aria-label":(0,E.__)("Colors link styles")},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(y.__experimentalZStack,{isLayered:!1,offset:-8},(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:i})),(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:c}))),(0,s.createElement)(y.FlexItem,{className:"edit-site-global-styles__color-label"},(0,E.__)("Links")))):null}function Ll(e){let{name:t,parentMenu:n,variation:a=""}=e;const r=a?`variations.${a}.`:"",l=a?`/variations/${a}`:"",o=tt(t).includes("color"),[i]=zl(r+"elements.heading.color.text",t),[c]=zl(r+"elements.heading.color.background",t);return o?(0,s.createElement)(lr,{path:n+l+"/colors/heading","aria-label":(0,E.__)("Colors heading styles")},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(y.__experimentalZStack,{isLayered:!1,offset:-8},(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:c})),(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:i}))),(0,s.createElement)(y.FlexItem,null,(0,E.__)("Headings")))):null}function Dl(e){let{name:t,parentMenu:n,variation:a=""}=e;const r=a?`variations.${a}.`:"",l=a?`/variations/${a}`:"",o=tt(t).includes("buttonColor"),[i]=zl(r+"elements.button.color.text",t),[c]=zl(r+"elements.button.color.background",t);return o?(0,s.createElement)(lr,{path:n+l+"/colors/button"},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(y.__experimentalZStack,{isLayered:!1,offset:-8},(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:c})),(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:i}))),(0,s.createElement)(y.FlexItem,{className:"edit-site-global-styles__color-label"},(0,E.__)("Buttons")))):null}var Ol=function(e){let{name:t,variation:n=""}=e;const a=void 0===t?"":"/blocks/"+encodeURIComponent(t),r=El(n);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Colors"),description:(0,E.__)("Manage palettes and the default color of different global elements on the site.")}),(0,s.createElement)(Zr,{name:t,variation:r}),(0,s.createElement)("div",{className:"edit-site-global-styles-screen-colors"},(0,s.createElement)(y.__experimentalVStack,{spacing:10},(0,s.createElement)(Bl,{name:t}),(0,s.createElement)(y.__experimentalVStack,{spacing:3},(0,s.createElement)(Kr,null,(0,E.__)("Elements")),(0,s.createElement)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(Vl,{name:t,parentMenu:a,variation:n}),(0,s.createElement)(Rl,{name:t,parentMenu:a,variation:n}),(0,s.createElement)(Al,{name:t,parentMenu:a,variation:n}),(0,s.createElement)(Ll,{name:t,parentMenu:a,variation:n}),(0,s.createElement)(Dl,{name:t,parentMenu:a,variation:n}))))))};const{useGlobalSetting:Fl}=Qe(fe.privateApis);function Gl(e){let{name:t}=e;const[n,a]=Fl("color.palette.theme",t),[r]=Fl("color.palette.theme",t,"base"),[l,o]=Fl("color.palette.default",t),[i]=Fl("color.palette.default",t,"base"),[c,u]=Fl("color.palette.custom",t),[m]=Fl("color.defaultPalette",t);return(0,s.createElement)(y.__experimentalVStack,{className:"edit-site-global-styles-color-palette-panel",spacing:10},!!n&&!!n.length&&(0,s.createElement)(y.__experimentalPaletteEdit,{canReset:n!==r,canOnlyChangeValues:!0,colors:n,onChange:a,paletteLabel:(0,E.__)("Theme")}),!!l&&!!l.length&&!!m&&(0,s.createElement)(y.__experimentalPaletteEdit,{canReset:l!==i,canOnlyChangeValues:!0,colors:l,onChange:o,paletteLabel:(0,E.__)("Default")}),(0,s.createElement)(y.__experimentalPaletteEdit,{colors:c,onChange:u,paletteLabel:(0,E.__)("Custom"),emptyMessage:(0,E.__)("Custom colors are empty! Add some colors to create your own color palette."),slugPrefix:"custom-"}))}const{useGlobalSetting:Hl}=Qe(fe.privateApis),$l=()=>{};function Ul(e){let{name:t}=e;const[n,a]=Hl("color.gradients.theme",t),[r]=Hl("color.gradients.theme",t,"base"),[l,o]=Hl("color.gradients.default",t),[i]=Hl("color.gradients.default",t,"base"),[c,u]=Hl("color.gradients.custom",t),[m]=Hl("color.defaultGradients",t),[d]=Hl("color.duotone.custom")||[],[p]=Hl("color.duotone.default")||[],[_]=Hl("color.duotone.theme")||[],[h]=Hl("color.defaultDuotone"),g=[...d||[],..._||[],...p&&h?p:[]];return(0,s.createElement)(y.__experimentalVStack,{className:"edit-site-global-styles-gradient-palette-panel",spacing:10},!!n&&!!n.length&&(0,s.createElement)(y.__experimentalPaletteEdit,{canReset:n!==r,canOnlyChangeValues:!0,gradients:n,onChange:a,paletteLabel:(0,E.__)("Theme")}),!!l&&!!l.length&&!!m&&(0,s.createElement)(y.__experimentalPaletteEdit,{canReset:l!==i,canOnlyChangeValues:!0,gradients:l,onChange:o,paletteLabel:(0,E.__)("Default")}),(0,s.createElement)(y.__experimentalPaletteEdit,{gradients:c,onChange:u,paletteLabel:(0,E.__)("Custom"),emptyMessage:(0,E.__)("Custom gradients are empty! Add some gradients to create your own palette."),slugPrefix:"custom-"}),!!g&&!!g.length&&(0,s.createElement)("div",null,(0,s.createElement)(Kr,null,(0,E.__)("Duotone")),(0,s.createElement)(y.__experimentalSpacer,{margin:3}),(0,s.createElement)(y.DuotonePicker,{duotonePalette:g,disableCustomDuotone:!0,disableCustomColors:!0,clearable:!1,onChange:$l})))}var Wl=function(e){let{name:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Palette"),description:(0,E.__)("Palettes are used to provide default color options for blocks and various design tools. Here you can edit the colors with their labels.")}),(0,s.createElement)(y.TabPanel,{tabs:[{name:"solid",title:"Solid",value:"solid"},{name:"gradient",title:"Gradient",value:"gradient"}]},(e=>(0,s.createElement)(s.Fragment,null,"solid"===e.value&&(0,s.createElement)(Gl,{name:t}),"gradient"===e.value&&(0,s.createElement)(Ul,{name:t})))))};const{useGlobalSetting:jl,useGlobalStyle:ql}=Qe(fe.privateApis);var Yl=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",r=tt(t),[l]=jl("color.custom",t),[o]=jl("color.customGradient",t),i=nt(t),c=at(t),[u]=jl("color.background",t),m=r.includes("backgroundColor")&&u&&(i.length>0||l),d=r.includes("background")&&(c.length>0||o),[p,_]=ql(a+"color.background",t),[h]=ql(a+"color.background",t,"user"),[v,y]=ql(a+"color.gradient",t),[b]=ql(a+"color.gradient",t,"user");if(!m&&!d)return null;let w={};m&&(w={colorValue:p,onColorChange:_},p&&(w.clearable=p===h));let S={};d&&(S={gradientValue:v,onGradientChange:y},v&&(S.clearable=v===b));const x={...w,...S};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Background"),description:(0,E.__)("Set a background color or gradient for the whole site.")}),(0,s.createElement)(fe.__experimentalColorGradientControl,g({className:f()("edit-site-screen-background-color__control",{"has-no-tabs":!m||!d}),colors:i,gradients:c,disableCustomColors:!l,disableCustomGradients:!o,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0},x)))};const{useGlobalSetting:Xl,useGlobalStyle:Zl}=Qe(fe.privateApis);var Kl=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",r=tt(t),[l]=Xl("color.custom",t),[o]=Xl("color.text",t),i=nt(t),c=r.includes("color")&&o&&(i.length>0||l),[u,m]=Zl(a+"color.text",t),[d]=Zl(a+"color.text",t,"user");return c?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Text"),description:(0,E.__)("Set the default color used for text across the site.")}),(0,s.createElement)(fe.__experimentalColorGradientControl,{className:"edit-site-screen-text-color__control",colors:i,disableCustomColors:!l,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:u,onColorChange:m,clearable:u===d})):null};const{useGlobalSetting:Ql,useGlobalStyle:Jl}=Qe(fe.privateApis);var eo=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",r=tt(t),[l]=Ql("color.custom",t),o=nt(t),[i]=Ql("color.link",t),c=r.includes("linkColor")&&i&&(o.length>0||l),u={default:{label:(0,E.__)("Default"),value:Jl(a+"elements.link.color.text",t)[0],handler:Jl(a+"elements.link.color.text",t)[1],userValue:Jl(a+"elements.link.color.text",t,"user")[0]},hover:{label:(0,E.__)("Hover"),value:Jl(a+"elements.link.:hover.color.text",t)[0],handler:Jl(a+"elements.link.:hover.color.text",t)[1],userValue:Jl(a+"elements.link.:hover.color.text",t,"user")[0]}};if(!c)return null;const m=Object.entries(u).map((e=>{let[t,n]=e;return{name:t,title:n.label,className:`color-text-${t}`}}));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Links"),description:(0,E.__)("Set the colors used for links across the site.")}),(0,s.createElement)(y.TabPanel,{tabs:m},(e=>{var t;const n=null!==(t=u[e.name])&&void 0!==t?t:null;return n?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fe.__experimentalColorGradientControl,{className:"edit-site-screen-link-color__control",colors:o,disableCustomColors:!l,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:n.value,onColorChange:n.handler,clearable:n.value===n.userValue})):null})))};const{useGlobalSetting:to,useGlobalStyle:no}=Qe(fe.privateApis);var ao=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",[r,l]=(0,s.useState)("heading"),o=tt(t),[i]=to("color.custom",t),[c]=to("color.customGradient",t),[u]=to("color.text",t),[m]=to("color.background",t),d=nt(t),p=at(t),_=o.includes("color")&&u&&(d.length>0||i),h=o.includes("backgroundColor")&&m&&(d.length>0||i),v=o.includes("background")&&(p.length>0||c),[f,b]=no(a+"elements."+r+".color.text",t),[w]=no(a+"elements."+r+".color.text",t,"user"),[S,x]=no(a+"elements."+r+".color.background",t),[k]=no(a+"elements."+r+".color.background",t,"user"),[C,T]=no(a+"elements."+r+".color.gradient",t),[N]=no(a+"elements."+r+".color.gradient",t,"user");if(!_&&!h&&!v)return null;let M={};h&&(M={colorValue:S,onColorChange:x},S&&(M.clearable=S===k));let I={};v&&(I={gradientValue:C,onGradientChange:T},C&&(I.clearable=C===N));const P={...M,...I};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Headings"),description:(0,E.__)("Set the default color used for headings across the site.")}),(0,s.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,s.createElement)("h4",null,(0,E.__)("Select heading level")),(0,s.createElement)(y.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Select heading level"),hideLabelFromVision:!0,value:r,onChange:l,isBlock:!0},(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"heading",label:(0,E.__)("All")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h1",label:(0,E.__)("H1")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h2",label:(0,E.__)("H2")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h3",label:(0,E.__)("H3")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h4",label:(0,E.__)("H4")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h5",label:(0,E.__)("H5")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h6",label:(0,E.__)("H6")}))),_&&(0,s.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,s.createElement)("h4",null,"heading"===r?(0,E.__)("Text color for all heading levels"):(0,E.sprintf)((0,E.__)("Text color for %s"),r.toUpperCase())),(0,s.createElement)(fe.__experimentalColorGradientControl,{className:"edit-site-screen-heading-text-color__control",colors:d,disableCustomColors:!i,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:f,onColorChange:b,clearable:f===w})),h&&(0,s.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,s.createElement)("h4",null,"heading"===r?(0,E.__)("Background color for all heading levels"):(0,E.sprintf)((0,E.__)("Background color for %s"),r.toUpperCase())),(0,s.createElement)(fe.__experimentalColorGradientControl,g({className:"edit-site-screen-heading-background-color__control",colors:d,gradients:p,disableCustomColors:!i,disableCustomGradients:!c,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0},P))))};const{useGlobalSetting:ro,useGlobalStyle:lo}=Qe(fe.privateApis);var oo=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",r=tt(t),l=nt(t),[o]=ro("color.custom",t),[i]=ro("color.background",t),c=r.includes("buttonColor")&&i&&(l.length>0||o),[u,m]=lo(a+"elements.button.color.text",t),[d]=lo("elements.button.color.text",t,"user"),[p,_]=lo("elements.button.color.background",t),[h]=lo("elements.button.color.background",t,"user");return c?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Buttons"),description:(0,E.__)("Set the default colors used for buttons across the site.")}),(0,s.createElement)("h4",{className:"edit-site-global-styles-section-title"},(0,E.__)("Text color")),(0,s.createElement)(fe.__experimentalColorGradientControl,{className:"edit-site-screen-button-color__control",colors:l,disableCustomColors:!o,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:u,onColorChange:m,clearable:u===d}),(0,s.createElement)("h4",{className:"edit-site-global-styles-section-title"},(0,E.__)("Background color")),(0,s.createElement)(fe.__experimentalColorGradientControl,{className:"edit-site-screen-button-color__control",colors:l,disableCustomColors:!o,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:p,onColorChange:_,clearable:p===h})):null};var io=function(e){let{name:t,variation:n=""}=e;const a=kr(t),r=El(n);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Layout")}),(0,s.createElement)(Zr,{name:t,variation:r}),a&&(0,s.createElement)(Rr,{name:t,variation:n}))},so=n(5619),co=n.n(so);function uo(){return(0,s.createElement)("div",{className:"edit-site-canvas-spinner"},(0,s.createElement)(y.Spinner,null))}const{GlobalStylesContext:mo}=Qe(fe.privateApis);function po(e,t){if(Array.isArray(t))return t}function _o(e,t){return(0,ve.mergeWith)({},e,t,po)}const ho=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.fromEntries(Object.entries((0,ve.mapValues)(e,ho)).filter((e=>{let[,t]=e;return Boolean(t)})));return(0,ve.isEmpty)(t)?void 0:t};function go(){const[e,t,n]=function(){const{globalStylesId:e,isReady:t,settings:n,styles:a}=(0,m.useSelect)((e=>{const{getEditedEntityRecord:t,hasFinishedResolution:n}=e(_.store),a=e(_.store).__experimentalGetCurrentGlobalStylesId(),r=a?t("root","globalStyles",a):void 0;let l=!1;return n("__experimentalGetCurrentGlobalStylesId")&&(l=!a||n("getEditedEntityRecord",["root","globalStyles",a])),{globalStylesId:a,isReady:l,settings:null==r?void 0:r.settings,styles:null==r?void 0:r.styles}}),[]),{getEditedEntityRecord:r}=(0,m.useSelect)(_.store),{editEntityRecord:l}=(0,m.useDispatch)(_.store),o=(0,s.useMemo)((()=>({settings:null!=n?n:{},styles:null!=a?a:{}})),[n,a]),i=(0,s.useCallback)((function(t){var n,a;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=r("root","globalStyles",e),s=t({styles:null!==(n=null==i?void 0:i.styles)&&void 0!==n?n:{},settings:null!==(a=null==i?void 0:i.settings)&&void 0!==a?a:{}});l("root","globalStyles",e,{styles:ho(s.styles)||{},settings:ho(s.settings)||{}},o)}),[e]);return[t,o,i]}(),[a,r]=function(){const e=(0,m.useSelect)((e=>e(_.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),l=(0,s.useMemo)((()=>r&&t?_o(r,t):{}),[t,r]);return(0,s.useMemo)((()=>({isReady:e&&a,user:t,base:r,merged:l,setUserConfig:n})),[l,t,r,n,e,a])}function vo(e){let{children:t}=e;const n=go();return n.isReady?(0,s.createElement)(mo.Provider,{value:n},t):(0,s.createElement)(uo,null)}const{GlobalStylesContext:fo}=Qe(fe.privateApis);function yo(e){let{variation:t}=e;const[n,a]=(0,s.useState)(!1),{base:r,user:l,setUserConfig:o}=(0,s.useContext)(fo),i=(0,s.useMemo)((()=>{var e,n;return{user:{settings:null!==(e=t.settings)&&void 0!==e?e:{},styles:null!==(n=t.styles)&&void 0!==n?n:{}},base:r,merged:_o(r,t),setUserConfig:()=>{}}}),[t,r]),c=()=>{o((()=>({settings:t.settings,styles:t.styles})))},u=(0,s.useMemo)((()=>function(e,t){return co()(e.styles,t.styles)&&co()(e.settings,t.settings)}(l,t)),[l,t]);return(0,s.createElement)(fo.Provider,{value:i},(0,s.createElement)("div",{className:f()("edit-site-global-styles-variations_item",{"is-active":u}),role:"button",onClick:c,onKeyDown:e=>{e.keyCode===qa.ENTER&&(e.preventDefault(),c())},tabIndex:"0","aria-label":null==t?void 0:t.title,"aria-current":u,onFocus:()=>a(!0),onBlur:()=>a(!1)},(0,s.createElement)("div",{className:"edit-site-global-styles-variations_item-preview"},(0,s.createElement)(hl,{label:null==t?void 0:t.title,isFocused:n,withHoverView:!0}))))}var Eo=function(){const{variations:e,mode:t}=(0,m.useSelect)((e=>({variations:e(_.store).__experimentalGetCurrentThemeGlobalStylesVariations(),mode:e(fe.store).__unstableGetEditorMode()})),[]),n=(0,s.useMemo)((()=>[{title:(0,E.__)("Default"),settings:{},styles:{}},...e.map((e=>{var t,n;return{...e,settings:null!==(t=e.settings)&&void 0!==t?t:{},styles:null!==(n=e.styles)&&void 0!==n?n:{}}}))]),[e]),{__unstableSetEditorMode:a}=(0,m.useDispatch)(fe.store),r=(0,s.useRef)(null);return(0,s.useEffect)((()=>{"zoom-out"!==t&&(r.current=!1)}),[t]),(0,s.useEffect)((()=>{if("zoom-out"!==t)return a("zoom-out"),r.current=!0,()=>{r.current&&a(t)}}),[]),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{back:"/",title:(0,E.__)("Browse styles"),description:(0,E.__)("Choose a variation to change the look of the site.")}),(0,s.createElement)(y.Card,{size:"small",isBorderless:!0},(0,s.createElement)(y.CardBody,null,(0,s.createElement)(y.__experimentalGrid,{columns:2},null==n?void 0:n.map(((e,t)=>(0,s.createElement)(yo,{key:t,variation:e})))))))};var bo=function(e){let{name:t,variation:n=""}=e;const a=dr(t),r=El(n);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Border")}),(0,s.createElement)(Zr,{name:t,variation:r}),a&&(0,s.createElement)(fr,{name:t,variation:n}))};const{ExperimentalBlockEditorProvider:wo,useGlobalStyle:So}=Qe(fe.privateApis),xo="EditSiteStyleBook",{Slot:ko,Fill:Co}=(0,y.createSlotFill)(xo);function To(){return[{name:"core/heading",title:(0,E.__)("Headings"),category:"text",blocks:[(0,c.createBlock)("core/heading",{content:(0,E.__)("Code Is Poetry"),level:1}),(0,c.createBlock)("core/heading",{content:(0,E.__)("Code Is Poetry"),level:2}),(0,c.createBlock)("core/heading",{content:(0,E.__)("Code Is Poetry"),level:3}),(0,c.createBlock)("core/heading",{content:(0,E.__)("Code Is Poetry"),level:4}),(0,c.createBlock)("core/heading",{content:(0,E.__)("Code Is Poetry"),level:5})]},...(0,c.getBlockTypes)().filter((e=>{const{name:t,example:n,supports:a}=e;return"core/heading"!==t&&!!n&&!1!==a.inserter})).map((e=>({name:e.name,title:e.title,category:e.category,blocks:(0,c.getBlockFromExample)(e.name,e.example)})))]}function No(e){let{isSelected:t,onSelect:n,onClose:a}=e;const[r,l]=(0,te.useResizeObserver)(),o=(0,te.useFocusOnMount)("firstElement"),i=(0,te.useFocusReturn)(),[u]=So("color.text"),[d]=So("color.background"),p=(0,s.useMemo)(To,[]),_=(0,s.useMemo)((()=>(0,c.getCategories)().filter((e=>p.some((t=>t.category===e.slug)))).map((e=>({name:e.slug,title:e.title,icon:e.icon})))),[p]),h=(0,m.useSelect)((e=>e(fe.store).getSettings()),[]),g=(0,s.useMemo)((()=>({...h,__unstableIsPreviewMode:!0})),[h]);return(0,s.createElement)(Co,null,(0,s.createElement)("section",{className:f()("edit-site-style-book",{"is-wide":l.width>600}),style:{color:u,background:d},"aria-label":(0,E.__)("Style Book"),onKeyDown:function(e){e.keyCode!==qa.ESCAPE||e.defaultPrevented||(e.preventDefault(),a())},ref:(0,te.useMergeRefs)([i,o])},r,(0,s.createElement)(y.Button,{className:"edit-site-style-book__close-button",icon:C,label:(0,E.__)("Close Style Book"),onClick:a,showTooltip:!1}),(0,s.createElement)(y.TabPanel,{className:"edit-site-style-book__tab-panel",tabs:_},(e=>(0,s.createElement)(fe.__unstableIframe,{className:"edit-site-style-book__iframe",head:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fe.__unstableEditorStyles,{styles:g.styles}),(0,s.createElement)("style",null,'.is-root-container { display: flow-root; }\n\t\t\t\t\t\t\t\t\t\t\tbody { position: relative; padding: 32px !important; }\n\t.edit-site-style-book__examples {\n\t\tmax-width: 900px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.edit-site-style-book__example {\n\t\tborder-radius: 2px;\n\t\tcursor: pointer;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 40px;\n\t\tmargin-bottom: 40px;\n\t\tpadding: 16px;\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t}\n\n\t.edit-site-style-book__example.is-selected {\n\t\tbox-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t}\n\n\t.edit-site-style-book__example:focus:not(:disabled) {\n\t\tbox-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t\toutline: 3px solid transparent;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example {\n\t\tflex-direction: row;\n\t}\n\n\t.edit-site-style-book__example-title {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\tfont-size: 11px;\n\t\tfont-weight: 500;\n\t\tline-height: normal;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\ttext-transform: uppercase;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example-title {\n\t\ttext-align: right;\n\t\twidth: 120px;\n\t}\n\n\t.edit-site-style-book__example-preview {\n\t\twidth: 100%;\n\t}\n\n\t.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,\n\t.edit-site-style-book__example-preview .block-list-appender {\n\t\tdisplay: none;\n\t}\n\n\t.edit-site-style-book__example-preview .is-root-container > .wp-block:first-child {\n\t\tmargin-top: 0;\n\t}\n\t.edit-site-style-book__example-preview .is-root-container > .wp-block:last-child {\n\t\tmargin-bottom: 0;\n\t}\n')),name:"style-book-canvas",tabIndex:0},g.svgFilters,(0,s.createElement)(Mo,{className:f()("edit-site-style-book__examples",{"is-wide":l.width>600}),examples:p,category:e.name,label:(0,E.sprintf)((0,E.__)("Examples of blocks in the %s category"),e.title),isSelected:t,onSelect:n}))))))}const Mo=(0,s.memo)((e=>{let{className:t,examples:n,category:a,label:r,isSelected:l,onSelect:o}=e;const i=(0,y.__unstableUseCompositeState)({orientation:"vertical"});return(0,s.createElement)(y.__unstableComposite,g({},i,{className:t,"aria-label":r}),n.filter((e=>e.category===a)).map((e=>(0,s.createElement)(Io,{key:e.name,id:`example-${e.name}`,composite:i,title:e.title,blocks:e.blocks,isSelected:l(e.name),onClick:()=>{o(e.name)}}))))})),Io=e=>{let{composite:t,id:n,title:a,blocks:r,isSelected:l,onClick:o}=e;const i=(0,m.useSelect)((e=>e(fe.store).getSettings()),[]),c=(0,s.useMemo)((()=>({...i,__unstableIsPreviewMode:!0})),[i]),u=(0,s.useMemo)((()=>Array.isArray(r)?r:[r]),[r]);return(0,s.createElement)(y.__unstableCompositeItem,g({},t,{className:f()("edit-site-style-book__example",{"is-selected":l}),id:n,"aria-label":(0,E.sprintf)((0,E.__)("Open %s styles in Styles panel"),a),onClick:o,role:"button",as:"div"}),(0,s.createElement)("span",{className:"edit-site-style-book__example-title"},a),(0,s.createElement)("div",{className:"edit-site-style-book__example-preview","aria-hidden":!0},(0,s.createElement)(y.Disabled,{className:"edit-site-style-book__example-preview__content"},(0,s.createElement)(wo,{value:u,settings:c},(0,s.createElement)(fe.BlockList,{renderAppender:!1})))))};No.Slot=ko;var Po=No;var Bo=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));const{useGlobalStyle:zo}=Qe(fe.privateApis);var Vo=function(e){let{blockName:t}=e;const n=t||null,[a,r]=zo("css",n),[l]=zo("css",n,"base"),[o,i]=(0,s.useState)(null),c="/* IgnoreThemeCustomCSS */",u=!a&&l?`/* ${(0,E.__)("Theme Custom CSS start")} */\n${l}\n/* ${(0,E.__)("Theme Custom CSS end")} */`:void 0,m=l&&a&&u!==a?l:void 0;return(0,s.createElement)(s.Fragment,null,m&&(0,s.createElement)(y.Panel,null,(0,s.createElement)(y.PanelBody,{title:(0,E.__)("Original Theme Custom CSS"),initialOpen:!1},(0,s.createElement)("pre",{className:"edit-site-global-styles__custom-css-theme-css"},m))),(0,s.createElement)(y.__experimentalVStack,{spacing:3},(0,s.createElement)(Kr,null,(0,E.__)("ADDITIONAL CSS")),(0,s.createElement)(y.TextareaControl,{__nextHasNoMarginBottom:!0,value:(null==a?void 0:a.replace(c,""))||u,onChange:e=>function(e){if(l&&""===e)r(c);else if(r(e),o){const[t]=(0,fe.transformStyles)([{css:e}],".editor-styles-wrapper");t&&i(null)}}(e),onBlur:function(e){var t;if(null==e||null===(t=e.target)||void 0===t||!t.value)return void i(null);const[n]=(0,fe.transformStyles)([{css:e.target.value}],".editor-styles-wrapper");i(null===n?(0,E.__)("There is an error with your CSS structure."):null)},className:"edit-site-global-styles__custom-css-input",spellCheck:!1}),o&&(0,s.createElement)(y.Tooltip,{text:o},(0,s.createElement)("div",{className:"edit-site-global-styles__custom-css-validation-wrapper"},(0,s.createElement)(y.Icon,{icon:Bo,className:"edit-site-global-styles__custom-css-validation-icon"})))))};var Ro=function(e){let{name:t}=e;const n=(0,c.getBlockType)(t),a=null==n?void 0:n.title,r=void 0!==a?(0,E.sprintf)((0,E.__)("Add your own CSS to customize the appearance of the %s block."),a):(0,E.__)("Add your own CSS to customize the appearance and layout of your site.");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("CSS"),description:(0,s.createElement)(s.Fragment,null,r,(0,s.createElement)(y.ExternalLink,{href:"https://wordpress.org/support/article/css/",className:"edit-site-global-styles-screen-css-help-link"},(0,E.__)("Learn more about CSS")))}),(0,s.createElement)("div",{className:"edit-site-global-styles-screen-css"},(0,s.createElement)(Vo,{blockName:t})))};var Ao=function(e){let{name:t,variation:n=""}=e;const a=El(n),r=nl(t);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Shadow")}),(0,s.createElement)(Zr,{name:t,variation:a}),r&&(0,s.createElement)(al,{name:t,variation:n}))};const{Slot:Lo,Fill:Do}=(0,y.createSlotFill)("GlobalStylesMenu");function Oo(){const{toggle:e}=(0,m.useDispatch)(T.store),{canEditCSS:t}=(0,m.useSelect)((e=>{var t,n;const{getEntityRecord:a,__experimentalGetCurrentGlobalStylesId:r}=e(_.store),l=r(),o=l?a("root","globalStyles",l):void 0;return{canEditCSS:null!==(t=!(null==o||null===(n=o._links)||void 0===n||!n["wp:action-edit-css"]))&&void 0!==t&&t}}),[]),{useGlobalStylesReset:n}=Qe(fe.privateApis),[a,r]=n(),{goTo:l}=(0,y.__experimentalUseNavigator)();return(0,s.createElement)(Do,null,(0,s.createElement)(y.DropdownMenu,{icon:re,label:(0,E.__)("Styles actions"),controls:[{title:(0,E.__)("Reset to defaults"),onClick:r,isDisabled:!a},{title:(0,E.__)("Welcome Guide"),onClick:()=>e("core/edit-site","welcomeGuideStyles")},...t?[{title:(0,E.__)("Additional CSS"),onClick:()=>l("/css")}]:[]]}))}function Fo(e){let{className:t,...n}=e;return(0,s.createElement)(y.__experimentalNavigatorScreen,g({className:["edit-site-global-styles-sidebar__navigator-screen",t].filter(Boolean).join(" ")},n))}function Go(e){let{name:t}=e;const n=(0,m.useSelect)((e=>{const{getBlockStyles:n}=e(c.store);return n(t)}),[t]);return null!=n&&n.length?n.map((e=>(0,s.createElement)($o,{key:e.name+t,name:t,parentMenu:"/blocks/"+encodeURIComponent(t)+"/variations/"+encodeURIComponent(e.name),variation:e.name}))):null}function Ho(e){let{parentMenu:t,blockStyles:n,blockName:a}=e;return n.map(((e,n)=>(0,s.createElement)(Fo,{key:n,path:t+"/variations/"+e.name},(0,s.createElement)(Jr,{blockName:a,style:e}))))}function $o(e){let{name:t,parentMenu:n="",variation:a=""}=e;const r=(0,m.useSelect)((e=>{const{getBlockStyles:n}=e(c.store);return n(t)}),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Fo,{path:n+"/typography"},(0,s.createElement)(Sl,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/typography/text"},(0,s.createElement)(Tl,{name:t,element:"text"})),(0,s.createElement)(Fo,{path:n+"/typography/link"},(0,s.createElement)(Tl,{name:t,element:"link"})),(0,s.createElement)(Fo,{path:n+"/typography/heading"},(0,s.createElement)(Tl,{name:t,element:"heading"})),(0,s.createElement)(Fo,{path:n+"/typography/button"},(0,s.createElement)(Tl,{name:t,element:"button"})),(0,s.createElement)(Fo,{path:n+"/colors"},(0,s.createElement)(Ol,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/colors/palette"},(0,s.createElement)(Wl,{name:t})),(0,s.createElement)(Fo,{path:n+"/colors/background"},(0,s.createElement)(Yl,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/colors/text"},(0,s.createElement)(Kl,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/colors/link"},(0,s.createElement)(eo,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/colors/heading"},(0,s.createElement)(ao,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/colors/button"},(0,s.createElement)(oo,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/border"},(0,s.createElement)(bo,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/effects"},(0,s.createElement)(Ao,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/layout"},(0,s.createElement)(io,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/css"},(0,s.createElement)(Ro,{name:t})),!(null==r||!r.length)&&(0,s.createElement)(Ho,{parentMenu:n,blockStyles:r,blockName:t}))}function Uo(e){let{onClose:t}=e;const n=(0,y.__experimentalUseNavigator)(),{path:a}=n.location;return(0,s.createElement)(Po,{isSelected:e=>a===`/blocks/${encodeURIComponent(e)}`||a.startsWith(`/blocks/${encodeURIComponent(e)}/`),onSelect:e=>{n.goTo("/blocks/"+encodeURIComponent(e))},onClose:t})}var Wo=function(e){let{isStyleBookOpened:t,onCloseStyleBook:n}=e;const a=(0,c.getBlockTypes)();return(0,s.createElement)(y.__experimentalNavigatorProvider,{className:"edit-site-global-styles-sidebar__navigator-provider",initialPath:"/"},(0,s.createElement)(Fo,{path:"/"},(0,s.createElement)(gl,null)),(0,s.createElement)(Fo,{path:"/variations"},(0,s.createElement)(Eo,null)),(0,s.createElement)(Fo,{path:"/blocks"},(0,s.createElement)(fl,null)),a.map((e=>(0,s.createElement)(Fo,{key:"menu-block-"+e.name,path:"/blocks/"+encodeURIComponent(e.name)},(0,s.createElement)(yl,{name:e.name})))),(0,s.createElement)($o,null),a.map((e=>(0,s.createElement)($o,{key:"screens-block-"+e.name,name:e.name,parentMenu:"/blocks/"+encodeURIComponent(e.name)}))),a.map(((e,t)=>(0,s.createElement)(Go,{key:"screens-block-styles-"+e.name+t,name:e.name}))),t&&(0,s.createElement)(Uo,{onClose:n}),(0,s.createElement)(Oo,null))};function jo(){const[e,t]=(0,s.useState)(!1),n=(0,m.useSelect)((e=>e(An).getEditorMode()),[]);return(0,s.useEffect)((()=>{"visual"!==n&&t(!1)}),[n]),(0,s.createElement)(er,{className:"edit-site-global-styles-sidebar",identifier:"edit-site/global-styles",title:(0,E.__)("Styles"),icon:tr,closeLabel:(0,E.__)("Close Styles sidebar"),panelClassName:"edit-site-global-styles-sidebar__panel",header:(0,s.createElement)(y.Flex,{className:"edit-site-global-styles-sidebar__header"},(0,s.createElement)(y.FlexBlock,{style:{minWidth:"min-content"}},(0,s.createElement)("strong",null,(0,E.__)("Styles"))),(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(y.Button,{icon:nr,label:(0,E.__)("Style Book"),isPressed:e,disabled:"visual"!==n,onClick:()=>{t(!e)}})),(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(Lo,null)))},(0,s.createElement)(Wo,{isStyleBookOpened:e,onCloseStyleBook:()=>t(!1)}))}const qo="edit-site/template",Yo="edit-site/block-inspector";var Xo=e=>{let{sidebarName:t}=e;const{enableComplementaryArea:n}=(0,m.useDispatch)(F),[a,r]=t===qo?[(0,E.__)("Template (selected)"),"is-active"]:[(0,E.__)("Template"),""],[l,o]=t===Yo?[(0,E.__)("Block (selected)"),"is-active"]:[(0,E.__)("Block"),""];return(0,s.createElement)("ul",null,(0,s.createElement)("li",null,(0,s.createElement)(y.Button,{onClick:()=>n(Dt,qo),className:`edit-site-sidebar-edit-mode__panel-tab ${r}`,"aria-label":a,"data-label":(0,E.__)("Template")},(0,E.__)("Template"))),(0,s.createElement)("li",null,(0,s.createElement)(y.Button,{onClick:()=>n(Dt,Yo),className:`edit-site-sidebar-edit-mode__panel-tab ${o}`,"aria-label":l,"data-label":(0,E.__)("Block")},(0,E.__)("Block"))))};function Zo(e){let{template:t}=e;const{revertTemplate:n}=(0,m.useDispatch)(An);return Ot(t)?(0,s.createElement)(y.DropdownMenu,{icon:re,label:(0,E.__)("Actions"),className:"edit-site-template-card__actions",toggleProps:{isSmall:!0}},(e=>{let{onClose:a}=e;return(0,s.createElement)(y.MenuGroup,null,(0,s.createElement)(y.MenuItem,{info:(0,E.__)("Use the template as supplied by the theme."),onClick:()=>{n(t),a()}},(0,E.__)("Clear customizations")))})):null}function Ko(e){let{area:t,clientId:n}=e;const{selectBlock:a,toggleBlockHighlight:r}=(0,m.useDispatch)(fe.store),l=(0,m.useSelect)((e=>e(h.store).__experimentalGetDefaultTemplatePartAreas().find((e=>e.area===t))),[t]),o=()=>r(n,!0),i=()=>r(n,!1);return(0,s.createElement)(y.Button,{className:"edit-site-template-card__template-areas-item",icon:null==l?void 0:l.icon,onMouseOver:o,onMouseLeave:i,onFocus:o,onBlur:i,onClick:()=>{a(n)}},null==l?void 0:l.label)}function Qo(){const e=(0,m.useSelect)((e=>e(An).getCurrentTemplateTemplateParts()),[]);return e.length?(0,s.createElement)("section",{className:"edit-site-template-card__template-areas"},(0,s.createElement)(y.__experimentalHeading,{level:3,className:"edit-site-template-card__template-areas-title"},(0,E.__)("Areas")),(0,s.createElement)("ul",{className:"edit-site-template-card__template-areas-list"},e.map((e=>{let{templatePart:t,block:n}=e;return(0,s.createElement)("li",{key:t.slug},(0,s.createElement)(Ko,{area:t.area,clientId:n.clientId}))})))):null}function Jo(){const{info:{title:e,description:t,icon:n},template:a}=(0,m.useSelect)((e=>{const{getEditedPostType:t,getEditedPostId:n}=e(An),{getEditedEntityRecord:a}=e(_.store),{__experimentalGetTemplateInfo:r}=e(h.store),l=a("postType",t(),n());return{info:l?r(l):{},template:l}}),[]);return e||t?(0,s.createElement)("div",{className:"edit-site-template-card"},(0,s.createElement)(y.Icon,{className:"edit-site-template-card__icon",icon:n}),(0,s.createElement)("div",{className:"edit-site-template-card__content"},(0,s.createElement)("div",{className:"edit-site-template-card__header"},(0,s.createElement)("h2",{className:"edit-site-template-card__title"},(0,Un.decodeEntities)(e)),(0,s.createElement)(Zo,{template:a})),(0,s.createElement)("div",{className:"edit-site-template-card__description"},(0,Un.decodeEntities)(t)),(0,s.createElement)(Qo,null))):null}const{Slot:ei,Fill:ti}=(0,y.createSlotFill)("EditSiteSidebarInspector"),ni=ti;function ai(){const{sidebar:e,isEditorSidebarOpened:t,hasBlockSelection:n,supportsGlobalStyles:a}=(0,m.useSelect)((e=>{const t=e(F).getActiveComplementaryArea(Dt),n=[Yo,qo].includes(t),a=e(An).getSettings();return{sidebar:t,isEditorSidebarOpened:n,hasBlockSelection:!!e(fe.store).getBlockSelectionStart(),supportsGlobalStyles:!(null!=a&&a.supportsTemplatePartsMode)}}),[]),{enableComplementaryArea:r}=(0,m.useDispatch)(F);(0,s.useEffect)((()=>{t&&r(Dt,n?Yo:qo)}),[n,t]);let l=e;return t||(l=n?Yo:qo),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(er,{identifier:l,title:(0,E.__)("Settings"),icon:(0,E.isRTL)()?Qa:Ja,closeLabel:(0,E.__)("Close settings sidebar"),header:(0,s.createElement)(Xo,{sidebarName:l}),headerClassName:"edit-site-sidebar-edit-mode__panel-tabs"},l===qo&&(0,s.createElement)(y.PanelBody,null,(0,s.createElement)(Jo,null)),l===Yo&&(0,s.createElement)(ei,{bubblesVirtually:!0})),a&&(0,s.createElement)(jo,null))}var ri=window.wp.reusableBlocks;const li=(e,t)=>`${t}`,oi=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,ii=e=>{const{title:t,foreign_landing_url:n,creator:a,creator_url:r,license:l,license_version:o,license_url:i}=e,s=((e,t)=>{let n=e.trim();return"pdm"!==e&&(n=e.toUpperCase().replace("SAMPLING","Sampling")),t&&(n+=` ${t}`),["pdm","cc0"].includes(e)||(n=`CC ${n}`),n})(l,o),c=(0,Un.decodeEntities)(a);let u;return u=c?t?(0,E.sprintf)((0,E._x)('"%1$s" by %2$s/ %3$s',"caption"),li(n,(0,Un.decodeEntities)(t)),r?li(r,c):c,i?li(`${i}?ref=openverse`,s):s):(0,E.sprintf)((0,E._x)("Work by %2$s/ %3$s","caption"),oi(n),r?li(r,c):c,i?li(`${i}?ref=openverse`,s):s):t?(0,E.sprintf)((0,E._x)('"%1$s"/ %2$s',"caption"),li(n,(0,Un.decodeEntities)(t)),i?li(`${i}?ref=openverse`,s):s):(0,E.sprintf)((0,E._x)("Work/ %3$s","caption"),oi(n),i?li(`${i}?ref=openverse`,s):s),u.replace(/\s{2}/g," ")},si=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=await(0,m.resolveSelect)(_.store).getMediaItems({...e,orderBy:null!=e&&e.search?"relevance":"date"});return t.map((e=>{var t,n,a,r;return{...e,alt:e.alt_text,url:e.source_url,previewUrl:null===(t=e.media_details)||void 0===t||null===(n=t.sizes)||void 0===n||null===(a=n.medium)||void 0===a?void 0:a.source_url,caption:null===(r=e.caption)||void 0===r?void 0:r.raw}}))},ci=[{name:"images",labels:{name:(0,E.__)("Images"),search_items:(0,E.__)("Search images")},mediaType:"image",async fetch(){return si({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},media_type:"image"})}},{name:"videos",labels:{name:(0,E.__)("Videos"),search_items:(0,E.__)("Search videos")},mediaType:"video",async fetch(){return si({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},media_type:"video"})}},{name:"audio",labels:{name:(0,E.__)("Audio"),search_items:(0,E.__)("Search audio")},mediaType:"audio",async fetch(){return si({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},media_type:"audio"})}},{name:"openverse",labels:{name:(0,E.__)("Openverse"),search_items:(0,E.__)("Search Openverse")},mediaType:"image",async fetch(){const e={...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},mature:!1,excluded_source:"flickr,inaturalist,wikimedia",license:"pdm,cc0"},t={per_page:"page_size",search:"q"},n=new URL("https://api.openverse.engineering/v1/images/");Object.entries(e).forEach((e=>{let[a,r]=e;const l=t[a]||a;n.searchParams.set(l,r)}));const a=await window.fetch(n,{headers:{"User-Agent":"WordPress/inserter-media-fetch"}});return(await a.json()).results.map((e=>{var t;return{...e,title:null!==(t=e.title)&&void 0!==t&&t.toLowerCase().startsWith("file:")?e.title.slice(5):e.title,sourceId:e.id,id:void 0,caption:ii(e),previewUrl:e.thumbnail}}))},getReportUrl:e=>{let{sourceId:t}=e;return`https://wordpress.org/openverse/image/${t}/report/`},isExternalResource:!0}];var ui=ci;function mi(e){let{clientId:t}=e;const{getBlocks:n}=(0,m.useSelect)(fe.store),{replaceBlocks:a}=(0,m.useDispatch)(fe.store);return(0,m.useSelect)((e=>e(fe.store).canRemoveBlock(t)),[t])?(0,s.createElement)(fe.BlockSettingsMenuControls,null,(e=>{let{onClose:r}=e;return(0,s.createElement)(y.MenuItem,{onClick:()=>{a(t,n(t)),r()}},(0,E.__)("Detach blocks from template part"))})):null}function di(e){let{clientIds:t,blocks:n}=e;const[a,r]=(0,s.useState)(!1),{replaceBlocks:l}=(0,m.useDispatch)(fe.store),{saveEntityRecord:o}=(0,m.useDispatch)(_.store),{createSuccessNotice:i}=(0,m.useDispatch)(ye.store),u=Ta(),{canCreate:d}=(0,m.useSelect)((e=>{const{supportsTemplatePartsMode:t}=e(An).getSettings();return{canCreate:!t}}),[]);if(!d)return null;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fe.BlockSettingsMenuControls,null,(()=>(0,s.createElement)(y.MenuItem,{icon:On,onClick:()=>{r(!0)}},(0,E.__)("Create Template part")))),a&&(0,s.createElement)(Ca,{closeModal:()=>{r(!1)},onCreate:async e=>{let{title:a,area:r}=e;const s=Na(a,u),m=Ma(s),d=await o("postType","wp_template_part",{slug:m,title:s,content:(0,c.serialize)(n),area:r});l(t,(0,c.createBlock)("core/template-part",{slug:d.slug,theme:d.theme})),i((0,E.__)("Template part created."),{type:"snackbar"})}}))}function pi(){var e;const{clientIds:t,blocks:n}=(0,m.useSelect)((e=>{const{getSelectedBlockClientIds:t,getBlocksByClientId:n}=e(fe.store),a=t();return{clientIds:a,blocks:n(a)}}),[]);return 1===n.length&&"core/template-part"===(null===(e=n[0])||void 0===e?void 0:e.name)?(0,s.createElement)(mi,{clientId:t[0]}):(0,s.createElement)(di,{clientIds:t,blocks:n})}var _i=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"}));var hi=function(){var e;const t=Ct(),n=Tt(),a="wp_template_part"===t.params.postType,r=null===(e=t.state)||void 0===e?void 0:e.fromTemplateId;return a&&r?(0,s.createElement)(y.Button,{className:"edit-site-visual-editor__back-button",icon:_i,onClick:()=>{n.back()}},(0,E.__)("Back")):null};function gi(e){let{variation:t="default",direction:n,resizeWidthBy:a}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("button",{className:`resizable-editor__drag-handle is-${n} is-variation-${t}`,"aria-label":(0,E.__)("Drag to resize"),"aria-describedby":`resizable-editor__resize-help-${n}`,onKeyDown:function(e){const{keyCode:t}=e;"left"===n&&t===qa.LEFT||"right"===n&&t===qa.RIGHT?a(20):("left"===n&&t===qa.RIGHT||"right"===n&&t===qa.LEFT)&&a(-20)}}),(0,s.createElement)(y.VisuallyHidden,{id:`resizable-editor__resize-help-${n}`},(0,E.__)("Use left and right arrow keys to resize the canvas.")))}const vi={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0};var fi=function(e){let{enableResizing:t,height:n,children:a}=e;const[r,l]=(0,s.useState)("100%"),o=(0,s.useRef)(),i=(0,s.useCallback)((e=>{o.current&&l(o.current.offsetWidth+e)}),[]);return(0,s.createElement)(y.ResizableBox,{ref:e=>{o.current=null==e?void 0:e.resizable},size:{width:t?r:"100%",height:t&&n?n:"100%"},onResizeStop:(e,t,n)=>{l(n.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{right:t,left:t},showHandle:t,resizeRatio:2,handleComponent:{left:(0,s.createElement)(gi,{direction:"left",resizeWidthBy:i}),right:(0,s.createElement)(gi,{direction:"right",resizeWidthBy:i})},handleClasses:void 0,handleStyles:{left:vi,right:vi}},a)};var yi=function(e){let{enableResizing:t,settings:n,children:a,...r}=e;const{canvasMode:l,deviceType:o,isZoomOutMode:i}=(0,m.useSelect)((e=>({deviceType:e(An).__experimentalGetPreviewDeviceType(),isZoomOutMode:"zoom-out"===e(fe.store).__unstableGetEditorMode(),canvasMode:Qe(e(An)).getCanvasMode()})),[]),{setCanvasMode:c}=Qe((0,m.useDispatch)(An)),u=(0,fe.__experimentalUseResizeCanvas)(o),d=(0,fe.__unstableUseMouseMoveTypingReset)();return(0,s.createElement)(fe.__unstableIframe,g({scale:i?.45:void 0,frameSize:i?100:void 0,style:t?{}:u,head:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fe.__unstableEditorStyles,{styles:n.styles}),(0,s.createElement)("style",null,`.is-root-container { display: flow-root; }\n\t\t\t\t\t\t\tbody { position: relative;\n\t\t\t\t\t\t\t${"view"===l?"cursor: pointer;":""}}}`),t&&(0,s.createElement)("style",null,".is-root-container { min-height: 0 !important; }")),ref:d,name:"editor-canvas",className:"edit-site-visual-editor__editor-canvas"},r,{role:"view"===l?"button":void 0,onClick:"view"===l?()=>c("edit"):void 0,readonly:"view"===l}),n.svgFilters,a)};const{ExperimentalBlockEditorProvider:Ei}=Qe(fe.privateApis),bi={type:"default",alignments:[]};function wi(){var e,t;const{setIsInserterOpened:n}=(0,m.useDispatch)(An),{storedSettings:a,templateType:r,canvasMode:l}=(0,m.useSelect)((e=>{const{getSettings:t,getEditedPostType:a,getCanvasMode:r}=Qe(e(An));return{storedSettings:t(n),templateType:a(),canvasMode:r()}}),[n]),o=null!==(e=a.__experimentalAdditionalBlockPatterns)&&void 0!==e?e:a.__experimentalBlockPatterns,i=null!==(t=a.__experimentalAdditionalBlockPatternCategories)&&void 0!==t?t:a.__experimentalBlockPatternCategories,{restBlockPatterns:c,restBlockPatternCategories:u}=(0,m.useSelect)((e=>({restBlockPatterns:e(_.store).getBlockPatterns(),restBlockPatternCategories:e(_.store).getBlockPatternCategories()})),[]),d=(0,s.useMemo)((()=>[...o||[],...c||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name)))).filter((e=>{let{postTypes:t}=e;return!t||Array.isArray(t)&&t.includes(r)}))),[o,c,r]),p=(0,s.useMemo)((()=>[...i||[],...u||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))),[i,u]),h=(0,s.useMemo)((()=>{const{__experimentalAdditionalBlockPatterns:e,__experimentalAdditionalBlockPatternCategories:t,...n}=a;return{...n,inserterMediaCategories:ui,__experimentalBlockPatterns:d,__experimentalBlockPatternCategories:p}}),[a,d,p]),[g,v,y]=(0,_.useEntityBlockEditor)("postType",r),E=(0,s.useRef)(),b=(0,te.useMergeRefs)([E,(0,fe.__unstableUseClipboardHandler)(),(0,fe.__unstableUseTypingObserver)()]),w=(0,te.useViewportMatch)("small","<"),{clearSelectedBlock:S}=(0,m.useDispatch)(fe.store),[x,k]=(0,te.useResizeObserver)(),C="wp_template_part"===r,T=0!==g.length,N=C&&"view"!==l&&!w,M="view"===l,I=!(C&&T||M)&&void 0;return(0,s.createElement)(Ei,{settings:h,value:g,onInput:v,onChange:y,useSubRegistry:!1},(0,s.createElement)(pi,null),(0,s.createElement)(ni,null,(0,s.createElement)(fe.BlockInspector,null)),(0,s.createElement)(Po.Slot,null,(e=>{var t;let[n]=e;return n?(0,s.createElement)("div",{className:"edit-site-visual-editor is-focus-mode"},(0,s.createElement)(fi,{enableResizing:!0},n)):(0,s.createElement)(fe.BlockTools,{className:f()("edit-site-visual-editor",{"is-focus-mode":C||!!n,"is-view-mode":M}),__unstableContentRef:E,onClick:e=>{e.target===e.currentTarget&&S()}},(0,s.createElement)(fe.BlockEditorKeyboardShortcuts.Register,null),(0,s.createElement)(hi,null),(0,s.createElement)(fi,{enableResizing:N,height:null!==(t=k.height)&&void 0!==t?t:"100%"},(0,s.createElement)(yi,{enableResizing:N,settings:h,contentRef:b,readonly:"view"===l},x,(0,s.createElement)(fe.BlockList,{className:"edit-site-block-editor__block-list wp-site-blocks",__experimentalLayout:bi,renderAppender:I}))))})),(0,s.createElement)(ri.ReusableBlocksMenuItems,null))}var Si=n(773);function xi(e){let{value:t,onChange:n,onInput:a}=e;const[r,l]=(0,s.useState)(t),[o,i]=(0,s.useState)(!1),c=(0,te.useInstanceId)(xi),u=(0,s.useRef)();o||r===t||l(t);return(0,s.useEffect)((()=>()=>{u.current&&n(u.current)}),[]),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.VisuallyHidden,{as:"label",htmlFor:`code-editor-text-area-${c}`},(0,E.__)("Type text or HTML")),(0,s.createElement)(Si.Z,{autoComplete:"off",dir:"auto",value:r,onChange:e=>{const t=e.target.value;a(t),l(t),i(!0),u.current=t},onBlur:()=>{o&&(n(r),i(!1))},className:"edit-site-code-editor-text-area",id:`code-editor-text-area-${c}`,placeholder:(0,E.__)("Start writing with text or HTML")}))}function ki(){const{templateType:e,shortcut:t}=(0,m.useSelect)((e=>{const{getEditedPostType:t}=e(An),{getShortcutRepresentation:n}=e(Ln.store);return{templateType:t(),shortcut:n("core/edit-site/toggle-mode")}}),[]),[n,a]=(0,_.useEntityProp)("postType",e,"content"),[r,,l]=(0,_.useEntityBlockEditor)("postType",e);let o;o=n instanceof Function?n({blocks:r}):r?(0,c.__unstableSerializeAndClean)(r):n;const{switchEditorMode:i}=(0,m.useDispatch)(An);return(0,s.createElement)("div",{className:"edit-site-code-editor"},(0,s.createElement)("div",{className:"edit-site-code-editor__toolbar"},(0,s.createElement)("h2",null,(0,E.__)("Editing code")),(0,s.createElement)(y.Button,{variant:"tertiary",onClick:()=>i("visual"),shortcut:t},(0,E.__)("Exit code editor"))),(0,s.createElement)("div",{className:"edit-site-code-editor__body"},(0,s.createElement)(xi,{value:o,onChange:e=>{l((0,c.parse)(e),{selection:void 0})},onInput:a})))}var Ci=function(){const{getEditorMode:e}=(0,m.useSelect)(An),t=(0,m.useSelect)((e=>e(An).isListViewOpened()),[]),n=(0,m.useSelect)((e=>e(F).getActiveComplementaryArea(An.name)===Yo),[]),{redo:a,undo:r}=(0,m.useDispatch)(_.store),{setIsListViewOpened:l,switchEditorMode:o}=(0,m.useDispatch)(An),{enableComplementaryArea:i,disableComplementaryArea:s}=(0,m.useDispatch)(F),{replaceBlocks:u}=(0,m.useDispatch)(fe.store),{getBlockName:d,getSelectedBlockClientId:p,getBlockAttributes:h}=(0,m.useSelect)(fe.store),g=(e,t)=>{e.preventDefault();const n=0===t?"core/paragraph":"core/heading",a=p();if(null===a)return;const r=d(a);if("core/paragraph"!==r&&"core/heading"!==r)return;const l=h(a),o="core/paragraph"===r?"align":"textAlign",i="core/paragraph"===n?"align":"textAlign";u(a,(0,c.createBlock)(n,{level:t,content:l.content,[i]:l[o]}))};return(0,Ln.useShortcut)("core/edit-site/undo",(e=>{r(),e.preventDefault()})),(0,Ln.useShortcut)("core/edit-site/redo",(e=>{a(),e.preventDefault()})),(0,Ln.useShortcut)("core/edit-site/toggle-list-view",(()=>{l(!t)})),(0,Ln.useShortcut)("core/edit-site/toggle-block-settings-sidebar",(e=>{e.preventDefault(),n?s(Dt):i(Dt,Yo)})),(0,Ln.useShortcut)("core/edit-site/toggle-mode",(()=>{o("visual"===e()?"text":"visual")})),(0,Ln.useShortcut)("core/edit-site/transform-heading-to-paragraph",(e=>g(e,0))),[1,2,3,4,5,6].forEach((e=>{(0,Ln.useShortcut)(`core/edit-site/transform-paragraph-to-heading-${e}`,(t=>g(t,e)))})),null};var Ti=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function Ni(){const{setIsInserterOpened:e}=(0,m.useDispatch)(An),t=(0,m.useSelect)((e=>e(An).__experimentalGetInsertionPoint()),[]),n=(0,te.useViewportMatch)("medium","<"),a=n?"div":y.VisuallyHidden,[r,l]=(0,te.__experimentalUseDialog)({onClose:()=>e(!1),focusOnMount:null}),o=(0,s.useRef)();return(0,s.useEffect)((()=>{o.current.focusSearch()}),[]),(0,s.createElement)("div",g({ref:r},l,{className:"edit-site-editor__inserter-panel"}),(0,s.createElement)(a,{className:"edit-site-editor__inserter-panel-header"},(0,s.createElement)(y.Button,{icon:Ti,label:(0,E.__)("Close block inserter"),onClick:()=>e(!1)})),(0,s.createElement)("div",{className:"edit-site-editor__inserter-panel-content"},(0,s.createElement)(fe.__experimentalLibrary,{showInserterHelpPanel:!0,shouldFocusBlock:n,rootClientId:t.rootClientId,__experimentalInsertionIndex:t.insertionIndex,__experimentalFilterValue:t.filterValue,ref:o})))}function Mi(){const{setIsListViewOpened:e}=(0,m.useDispatch)(An),t=(0,te.useFocusOnMount)("firstElement"),n=(0,te.useFocusReturn)(),a=(0,te.useFocusReturn)();const r=`edit-site-editor__list-view-panel-label-${(0,te.useInstanceId)(Mi)}`;return(0,s.createElement)("div",{"aria-labelledby":r,className:"edit-site-editor__list-view-panel",onKeyDown:function(t){t.keyCode!==qa.ESCAPE||t.defaultPrevented||e(!1)}},(0,s.createElement)("div",{className:"edit-site-editor__list-view-panel-header",ref:n},(0,s.createElement)("strong",{id:r},(0,E.__)("List View")),(0,s.createElement)(y.Button,{icon:C,label:(0,E.__)("Close List View Sidebar"),onClick:()=>e(!1)})),(0,s.createElement)("div",{className:"edit-site-editor__list-view-panel-content",ref:(0,te.useMergeRefs)([a,t])},(0,s.createElement)(fe.__experimentalListView,null)))}function Ii(e){let{nonAnimatedSrc:t,animatedSrc:n}=e;return(0,s.createElement)("picture",{className:"edit-site-welcome-guide__image"},(0,s.createElement)("source",{srcSet:t,media:"(prefers-reduced-motion: reduce)"}),(0,s.createElement)("img",{src:n,width:"312",height:"240",alt:""}))}function Pi(){const{toggle:e}=(0,m.useDispatch)(T.store);return(0,m.useSelect)((e=>!!e(T.store).get("core/edit-site","welcomeGuide")),[])?(0,s.createElement)(y.Guide,{className:"edit-site-welcome-guide",contentLabel:(0,E.__)("Welcome to the site editor"),finishButtonText:(0,E.__)("Get Started"),onFinish:()=>e("core/edit-site","welcomeGuide"),pages:[{image:(0,s.createElement)(Ii,{nonAnimatedSrc:"https://s.w.org/images/block-editor/edit-your-site.svg?1",animatedSrc:"https://s.w.org/images/block-editor/edit-your-site.gif?1"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,E.__)("Edit your site")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("Design everything on your site — from the header right down to the footer — using blocks.")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,s.createInterpolateElement)((0,E.__)("Click to start designing your blocks, and choose your typography, layout, and colors."),{StylesIconImage:(0,s.createElement)("img",{alt:(0,E.__)("styles"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A"})})))}]}):null}function Bi(){const{toggle:e}=(0,m.useDispatch)(T.store),{isActive:t,isStylesOpen:n}=(0,m.useSelect)((e=>{const t=e(F).getActiveComplementaryArea(An.name);return{isActive:!!e(T.store).get("core/edit-site","welcomeGuideStyles"),isStylesOpen:"edit-site/global-styles"===t}}),[]);return t&&n?(0,s.createElement)(y.Guide,{className:"edit-site-welcome-guide",contentLabel:(0,E.__)("Welcome to styles"),finishButtonText:(0,E.__)("Get Started"),onFinish:()=>e("core/edit-site","welcomeGuideStyles"),pages:[{image:(0,s.createElement)(Ii,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.svg?1",animatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.gif?1"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,E.__)("Welcome to Styles")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.")))},{image:(0,s.createElement)(Ii,{nonAnimatedSrc:"https://s.w.org/images/block-editor/set-the-design.svg?1",animatedSrc:"https://s.w.org/images/block-editor/set-the-design.gif?1"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,E.__)("Set the design")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle! ")))},{image:(0,s.createElement)(Ii,{nonAnimatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.svg?1",animatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.gif?1"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,E.__)("Personalize blocks")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.")))},{image:(0,s.createElement)(Ii,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,E.__)("Learn more")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("New to block themes and styling your site? "),(0,s.createElement)(y.ExternalLink,{href:(0,E.__)("https://wordpress.org/support/article/styles-overview/")},(0,E.__)("Here’s a detailed guide to learn how to make the most of it."))))}]}):null}function zi(){return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Pi,null),(0,s.createElement)(Bi,null))}const{useGlobalStylesOutput:Vi}=Qe(fe.privateApis);function Ri(){return function(){const[e,t,n]=Vi(),{getSettings:a}=(0,m.useSelect)(An),{updateSettings:r}=(0,m.useDispatch)(An);(0,s.useEffect)((()=>{var l;if(!e||!t)return;const o=a(),i=Object.values(null!==(l=o.styles)&&void 0!==l?l:[]).filter((e=>!e.isGlobalStyles));r({...o,styles:[...i,...e],svgFilters:n,__experimentalFeatures:t})}),[e,t])}(),null}function Ai(e){const t=Ct(),n=(0,m.useSelect)((e=>{var t;return null===(t=e(_.store).getEntityRecord("root","site"))||void 0===t?void 0:t.title}),[]),a=(0,s.useRef)(!0);(0,s.useEffect)((()=>{a.current=!1}),[t]),(0,s.useEffect)((()=>{if(!a.current&&e&&n){const t=(0,E.sprintf)((0,E.__)("%1$s ‹ %2$s — WordPress"),(0,Un.decodeEntities)(e),(0,Un.decodeEntities)(n));document.title=t,(0,Lt.speak)((0,E.sprintf)((0,E.__)("Now displaying: %s"),document.title),"assertive")}}),[e,n,t])}const Li={body:(0,E.__)("Editor content"),sidebar:(0,E.__)("Editor settings"),actions:(0,E.__)("Editor publish"),footer:(0,E.__)("Editor footer")};function Di(){const{record:e,getTitle:t,isLoaded:n}=Aa(),{id:a,type:r}=e,{context:l,editorMode:o,canvasMode:i,blockEditorMode:c,isRightSidebarOpen:u,isInserterOpen:d,isListViewOpen:p,showIconLabels:g}=(0,m.useSelect)((e=>{const{getEditedPostContext:t,getEditorMode:n,getCanvasMode:a,isInserterOpened:r,isListViewOpened:l}=Qe(e(An)),{__unstableGetEditorMode:o}=e(fe.store),{getActiveComplementaryArea:i}=e(F);return{context:t(),editorMode:n(),canvasMode:a(),blockEditorMode:o(),isInserterOpen:r(),isListViewOpen:l(),isRightSidebarOpen:i(An.name),showIconLabels:e(T.store).get("core/edit-site","showIconLabels")}}),[]),{setEditedPostContext:v}=(0,m.useDispatch)(An),f="edit"===i,b="view"===i||"visual"===o,w=f&&b&&"zoom-out"!==c,S=f&&b&&d,x=f&&b&&p,k=p?(0,E.__)("List View"):(0,E.__)("Block Library"),C=(0,s.useMemo)((()=>({...l,queryContext:[(null==l?void 0:l.queryContext)||{page:1},e=>v({...l,queryContext:{...null==l?void 0:l.queryContext,...e}})]})),[l,v]);let N;if(n){const e="wp_template"===r?(0,E.__)("Template"):(0,E.__)("Template Part");N=(0,E.sprintf)((0,E.__)("%1$s ‹ %2$s ‹ Editor"),t(),e)}return Ai(n&&N),n?(0,s.createElement)(s.Fragment,null,f&&(0,s.createElement)(zi,null),(0,s.createElement)(_.EntityProvider,{kind:"root",type:"site"},(0,s.createElement)(_.EntityProvider,{kind:"postType",type:r,id:a},(0,s.createElement)(vo,null,(0,s.createElement)(fe.BlockContextProvider,{value:C},(0,s.createElement)(ai,null),(0,s.createElement)(ae,{enableRegionNavigation:!1,className:g&&"show-icon-labels",notices:f&&(0,s.createElement)(h.EditorSnackbars,null),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ri,null),f&&(0,s.createElement)(h.EditorNotices,null),b&&e&&(0,s.createElement)(wi,null),"text"===o&&e&&f&&(0,s.createElement)(ki,null),n&&!e&&(0,s.createElement)(y.Notice,{status:"warning",isDismissible:!1},(0,E.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")),f&&(0,s.createElement)(Ci,null)),secondarySidebar:f&&(S&&(0,s.createElement)(Ni,null)||x&&(0,s.createElement)(Mi,null)),sidebar:f&&u&&(0,s.createElement)(ee.Slot,{scope:"core/edit-site"}),footer:w&&(0,s.createElement)(fe.BlockBreadcrumb,{rootLabelText:(0,E.__)("Template")}),labels:{...Li,secondarySidebar:k}})))))):(0,s.createElement)(uo,null)}function Oi(e){var t;let{templateType:n}=e;const{canCreate:a,postType:r}=(0,m.useSelect)((e=>{const{supportsTemplatePartsMode:t}=e(An).getSettings();return{postType:e(_.store).getPostType(n),canCreate:!t}}),[n]);return r?(0,s.createElement)("header",{className:"edit-site-list-header"},(0,s.createElement)(y.__experimentalHeading,{level:1,className:"edit-site-list-header__title"},null===(t=r.labels)||void 0===t?void 0:t.name),a&&(0,s.createElement)("div",{className:"edit-site-list-header__right"},(0,s.createElement)(Pa,{templateType:n,showIcon:!1,toggleProps:{variant:"primary"}}))):null}function Fi(e){let{template:t,onClose:n}=e;const[a,r]=(0,s.useState)((()=>t.title.rendered)),[l,o]=(0,s.useState)(!1),{editEntityRecord:i,saveEditedEntityRecord:c}=(0,m.useDispatch)(_.store),{createSuccessNotice:u,createErrorNotice:d}=(0,m.useDispatch)(ye.store);if("wp_template"===t.type&&!t.is_custom)return null;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.MenuItem,{onClick:()=>{o(!0),r(t.title.rendered)}},(0,E.__)("Rename")),l&&(0,s.createElement)(y.Modal,{title:(0,E.__)("Rename"),onRequestClose:()=>{o(!1)},overlayClassName:"edit-site-list__rename-modal"},(0,s.createElement)("form",{onSubmit:async function(e){e.preventDefault();try{await i("postType",t.type,t.id,{title:a}),r(""),o(!1),n(),await c("postType",t.type,t.id,{throwOnError:!0}),u((0,E.__)("Entity renamed."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while renaming the entity.");d(t,{type:"snackbar"})}}},(0,s.createElement)(y.__experimentalVStack,{spacing:"5"},(0,s.createElement)(y.TextControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Name"),value:a,onChange:r,required:!0}),(0,s.createElement)(y.__experimentalHStack,{justify:"right"},(0,s.createElement)(y.Button,{variant:"tertiary",onClick:()=>{o(!1)}},(0,E.__)("Cancel")),(0,s.createElement)(y.Button,{variant:"primary",type:"submit"},(0,E.__)("Save")))))))}function Gi(e){let{template:t}=e;const{removeTemplate:n,revertTemplate:a}=(0,m.useDispatch)(An),{saveEditedEntityRecord:r}=(0,m.useDispatch)(_.store),{createSuccessNotice:l,createErrorNotice:o}=(0,m.useDispatch)(ye.store),i=function(e){return!!e&&"custom"===e.source&&!e.has_theme_file}(t),c=Ot(t);if(!i&&!c)return null;return(0,s.createElement)(y.DropdownMenu,{icon:re,label:(0,E.__)("Actions"),className:"edit-site-list-table__actions"},(e=>{let{onClose:u}=e;return(0,s.createElement)(y.MenuGroup,null,i&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Fi,{template:t,onClose:u}),(0,s.createElement)(y.MenuItem,{isDestructive:!0,isTertiary:!0,onClick:()=>{n(t),u()}},(0,E.__)("Delete"))),c&&(0,s.createElement)(y.MenuItem,{info:(0,E.__)("Use the template as supplied by the theme."),onClick:()=>{!async function(){try{await a(t,{allowUndo:!1}),await r("postType",t.type,t.id),l((0,E.__)("Entity reverted."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while reverting the entity.");o(t,{type:"snackbar"})}}(),u()}},(0,E.__)("Clear customizations")))}))}var Hi=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"}));var $i=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"}));var Ui=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"}));const Wi=["wp_template","wp_template_part"];function ji(e){let{text:t,icon:n,imageUrl:a,isCustomized:r,templateType:l}=e;const[o,i]=(0,s.useState)(!1);return(0,s.createElement)(y.__experimentalHStack,{alignment:"left"},a?(0,s.createElement)("div",{className:f()("edit-site-list-added-by__avatar",{"is-loaded":o})},(0,s.createElement)("img",{onLoad:()=>i(!0),alt:"",src:a})):(0,s.createElement)("div",{className:"edit-site-list-added-by__icon"},(0,s.createElement)(y.Icon,{icon:n})),(0,s.createElement)("span",null,t,r&&(0,s.createElement)("span",{className:"edit-site-list-added-by__customized-info"},"wp_template"===l?(0,E._x)("Customized","template"):(0,E._x)("Customized","template part"))))}function qi(e){var t;let{slug:n,isCustomized:a,templateType:r}=e;const l=(0,m.useSelect)((e=>e(_.store).getTheme(n)),[n]);return(0,s.createElement)(ji,{icon:Dn,text:(null==l||null===(t=l.name)||void 0===t?void 0:t.rendered)||n,isCustomized:a,templateType:r})}function Yi(e){let{slug:t,isCustomized:n,templateType:a}=e;const r=(0,m.useSelect)((e=>e(_.store).getPlugin(t)),[t]);return(0,s.createElement)(ji,{icon:Hi,text:(null==r?void 0:r.name)||t,isCustomized:n,templateType:a})}function Xi(e){var t;let{id:n,templateType:a}=e;const r=(0,m.useSelect)((e=>e(_.store).getUser(n)),[n]);return(0,s.createElement)(ji,{icon:$i,imageUrl:null==r||null===(t=r.avatar_urls)||void 0===t?void 0:t[48],text:null==r?void 0:r.nickname,templateType:a})}function Zi(e){let{templateType:t}=e;const{name:n,logoURL:a}=(0,m.useSelect)((e=>{var t;const{getEntityRecord:n,getMedia:a}=e(_.store),r=n("root","__unstableBase");return{name:null==r?void 0:r.name,logoURL:null!=r&&r.site_logo?null===(t=a(r.site_logo))||void 0===t?void 0:t.source_url:void 0}}),[]);return(0,s.createElement)(ji,{icon:Ui,imageUrl:a,text:n,templateType:t})}function Ki(e){let{templateType:t,template:n}=e;if(n){if(Wi.includes(t)){if(n.has_theme_file&&("theme"===n.origin||!n.origin&&["theme","custom"].includes(n.source)))return(0,s.createElement)(qi,{slug:n.theme,isCustomized:"custom"===n.source,templateType:t});if(n.has_theme_file&&"plugin"===n.origin)return(0,s.createElement)(Yi,{slug:n.theme,isCustomized:"custom"===n.source,templateType:t});if(!n.has_theme_file&&"custom"===n.source&&!n.author)return(0,s.createElement)(Zi,{templateType:t})}return(0,s.createElement)(Xi,{id:n.author,templateType:t})}}function Qi(e){let{templateType:t}=e;const{records:n,isResolving:a}=(0,_.useEntityRecords)("postType",t,{per_page:-1}),r=(0,m.useSelect)((e=>e(_.store).getPostType(t)),[t]);if(!n||a)return null;var l,o;if(!n.length)return(0,s.createElement)("div",null,(0,E.sprintf)((0,E.__)("No %s found."),null==r||null===(l=r.labels)||void 0===l||null===(o=l.name)||void 0===o?void 0:o.toLowerCase()));const i=[...n];return i.sort(((e,t)=>e.slug.localeCompare(t.slug))),(0,s.createElement)("table",{className:"edit-site-list-table",role:"table"},(0,s.createElement)("thead",null,(0,s.createElement)("tr",{className:"edit-site-list-table-head",role:"row"},(0,s.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,E.__)("Template")),(0,s.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,E.__)("Added by")),(0,s.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,s.createElement)(y.VisuallyHidden,null,(0,E.__)("Actions"))))),(0,s.createElement)("tbody",null,i.map((e=>{var n;return(0,s.createElement)("tr",{key:e.id,className:"edit-site-list-table-row",role:"row"},(0,s.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,s.createElement)(y.__experimentalHeading,{level:4},(0,s.createElement)(Pt,{params:{postId:e.id,postType:e.type}},(0,Un.decodeEntities)((null===(n=e.title)||void 0===n?void 0:n.rendered)||e.slug))),(0,Un.decodeEntities)(e.description)),(0,s.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,s.createElement)(Ki,{templateType:t,template:e})),(0,s.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,s.createElement)(Gi,{template:e})))}))))}function Ji(){var e,t;const{params:{path:n}}=Ct(),a="/wp_template/all"===n?"wp_template":"wp_template_part";!function(){const{registerShortcut:e}=(0,m.useDispatch)(Ln.store);(0,s.useEffect)((()=>{e({name:"core/edit-site/next-region",category:"global",description:(0,E.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-site/previous-region",category:"global",description:(0,E.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})}),[])}();const{previousShortcut:r,nextShortcut:l}=(0,m.useSelect)((e=>({previousShortcut:e(Ln.store).getAllShortcutKeyCombinations("core/edit-site/previous-region"),nextShortcut:e(Ln.store).getAllShortcutKeyCombinations("core/edit-site/next-region")})),[]),o=(0,m.useSelect)((e=>e(_.store).getPostType(a)),[a]);Ai(null==o||null===(e=o.labels)||void 0===e?void 0:e.name);const i=null==o||null===(t=o.labels)||void 0===t?void 0:t.items_list,c=o?{header:(0,E.sprintf)((0,E.__)("%s - Header"),i),body:(0,E.sprintf)((0,E.__)("%s - Content"),i)}:void 0;return(0,s.createElement)(ae,{className:"edit-site-list",labels:c,header:(0,s.createElement)(Oi,{templateType:a}),notices:(0,s.createElement)(h.EditorSnackbars,null),content:(0,s.createElement)(Qi,{templateType:a}),shortcuts:{previous:r,next:l}})}function es(e){let{text:t,children:n}=e;const a=(0,te.useCopyToClipboard)(t);return(0,s.createElement)(y.Button,{variant:"secondary",ref:a},n)}function ts(e){let{message:t,error:n}=e;const a=[(0,s.createElement)(es,{key:"copy-error",text:n.stack},(0,E.__)("Copy Error"))];return(0,s.createElement)(fe.Warning,{className:"editor-error-boundary",actions:a},t)}class ns extends s.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,he.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){return this.state.error?(0,s.createElement)(ts,{message:(0,E.__)("The editor has encountered an unexpected error."),error:this.state.error}):this.props.children}}var as=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));var rs=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"m12 20-4.5-3.6-.9 1.2L12 22l5.5-4.4-.9-1.2L12 20zm0-16 4.5 3.6.9-1.2L12 2 6.5 6.4l.9 1.2L12 4z"}));var ls=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"}));const os=[{keyCombination:{modifier:"primary",character:"b"},description:(0,E.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,E.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,E.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,E.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,E.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,E.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,E.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,E.__)("Make the selected text inline code.")}];function is(e){let{keyCombination:t,forceAriaLabel:n}=e;const a=t.modifier?qa.displayShortcutList[t.modifier](t.character):t.character,r=t.modifier?qa.shortcutAriaLabel[t.modifier](t.character):t.character;return(0,s.createElement)("kbd",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":n||r},(Array.isArray(a)?a:[a]).map(((e,t)=>"+"===e?(0,s.createElement)(s.Fragment,{key:t},e):(0,s.createElement)("kbd",{key:t,className:"edit-site-keyboard-shortcut-help-modal__shortcut-key"},e))))}function ss(e){let{description:t,keyCombination:n,aliases:a=[],ariaLabel:r}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-description"},t),(0,s.createElement)("div",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-term"},(0,s.createElement)(is,{keyCombination:n,forceAriaLabel:r}),a.map(((e,t)=>(0,s.createElement)(is,{keyCombination:e,forceAriaLabel:r,key:t})))))}function cs(e){let{name:t}=e;const{keyCombination:n,description:a,aliases:r}=(0,m.useSelect)((e=>{const{getShortcutKeyCombination:n,getShortcutDescription:a,getShortcutAliases:r}=e(Ln.store);return{keyCombination:n(t),aliases:r(t),description:a(t)}}),[t]);return n?(0,s.createElement)(ss,{keyCombination:n,description:a,aliases:r}):null}const us=e=>{let{shortcuts:t}=e;return(0,s.createElement)("ul",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-list",role:"list"},t.map(((e,t)=>(0,s.createElement)("li",{className:"edit-site-keyboard-shortcut-help-modal__shortcut",key:t},"string"==typeof e?(0,s.createElement)(cs,{name:e}):(0,s.createElement)(ss,e)))))},ms=e=>{let{title:t,shortcuts:n,className:a}=e;return(0,s.createElement)("section",{className:f()("edit-site-keyboard-shortcut-help-modal__section",a)},!!t&&(0,s.createElement)("h2",{className:"edit-site-keyboard-shortcut-help-modal__section-title"},t),(0,s.createElement)(us,{shortcuts:n}))},ds=e=>{let{title:t,categoryName:n,additionalShortcuts:a=[]}=e;const r=(0,m.useSelect)((e=>e(Ln.store).getCategoryShortcuts(n)),[n]);return(0,s.createElement)(ms,{title:t,shortcuts:r.concat(a)})};function ps(e){let{isModalActive:t,toggleModal:n}=e;return t?(0,s.createElement)(y.Modal,{className:"edit-site-keyboard-shortcut-help-modal",title:(0,E.__)("Keyboard shortcuts"),onRequestClose:n},(0,s.createElement)(ms,{className:"edit-site-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-site/keyboard-shortcuts"]}),(0,s.createElement)(ds,{title:(0,E.__)("Global shortcuts"),categoryName:"global"}),(0,s.createElement)(ds,{title:(0,E.__)("Selection shortcuts"),categoryName:"selection"}),(0,s.createElement)(ds,{title:(0,E.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,E.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,E.__)("Forward-slash")}]}),(0,s.createElement)(ms,{title:(0,E.__)("Text formatting"),shortcuts:os})):null}function _s(e){const{featureName:t,...n}=e,a=(0,m.useSelect)((e=>!!e(T.store).get("core/edit-site",t)),[t]),{toggle:r}=(0,m.useDispatch)(T.store);return(0,s.createElement)(pe,g({onChange:()=>r("core/edit-site",t),isChecked:a},n))}function hs(e){let{isModalActive:t,toggleModal:n}=e;const a=(0,s.useMemo)((()=>[{name:"general",tabLabel:(0,E.__)("General"),content:(0,s.createElement)(de,{title:(0,E.__)("Appearance"),description:(0,E.__)("Customize options related to the block editor interface and editing flow.")},(0,s.createElement)(_s,{featureName:"focusMode",help:(0,E.__)("Highlights the current block and fades other content."),label:(0,E.__)("Spotlight mode")}),(0,s.createElement)(_s,{featureName:"showIconLabels",label:(0,E.__)("Show button text labels"),help:(0,E.__)("Show text instead of icons on buttons.")}),(0,s.createElement)(_s,{featureName:"showListViewByDefault",help:(0,E.__)("Opens the block list view sidebar by default."),label:(0,E.__)("Always open list view")}))},{name:"blocks",tabLabel:(0,E.__)("Blocks"),content:(0,s.createElement)(de,{title:(0,E.__)("Block interactions"),description:(0,E.__)("Customize how you interact with blocks in the block library and editing canvas.")},(0,s.createElement)(_s,{featureName:"keepCaretInsideBlock",help:(0,E.__)("Aids screen readers by stopping text caret from leaving blocks."),label:(0,E.__)("Contain text cursor inside block")}))}]));return t?(0,s.createElement)(oe,{closeModal:n},(0,s.createElement)(me,{sections:a})):null}const{Fill:gs,Slot:vs}=(0,y.createSlotFill)("EditSiteToolsMoreMenuGroup");gs.Slot=e=>{let{fillProps:t}=e;return(0,s.createElement)(vs,{fillProps:t},(e=>!(0,ve.isEmpty)(e)&&e))};var fs=gs,ys=n(8981),Es=n.n(ys);var bs=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"}));function ws(){const{createErrorNotice:e}=(0,m.useDispatch)(ye.store);return(0,s.createElement)(y.MenuItem,{role:"menuitem",icon:bs,onClick:async function(){try{const e=await At()({path:"/wp-block-editor/v1/export",parse:!1,headers:{Accept:"application/zip"}}),t=await e.blob(),n=e.headers.get("content-disposition").match(/=(.+)\.zip/),a=n[1]?n[1]:"edit-site-export";Es()(t,a+".zip","application/zip")}catch(t){let n={};try{n=await t.json()}catch(e){}const a=n.message&&"unknown_error"!==n.code?n.message:(0,E.__)("An error occurred while creating the site export.");e(a,{type:"snackbar"})}},info:(0,E.__)("Download your theme with updated templates and styles.")},(0,E._x)("Export","site exporter menu item"))}function Ss(){const{toggle:e}=(0,m.useDispatch)(T.store);return(0,s.createElement)(y.MenuItem,{onClick:()=>e("core/edit-site","welcomeGuide")},(0,E.__)("Welcome Guide"))}function xs(){const{createNotice:e}=(0,m.useDispatch)(ye.store),t=(0,m.useSelect)((e=>()=>{const{getEditedPostId:t,getEditedPostType:n}=e(An),{getEditedEntityRecord:a}=e(_.store),r=a("postType",n(),t());if(r){if("function"==typeof r.content)return r.content(r);if(r.blocks)return(0,c.__unstableSerializeAndClean)(r.blocks);if(r.content)return r.content}return""}),[]);const n=(0,te.useCopyToClipboard)(t,(function(){e("info",(0,E.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,s.createElement)(y.MenuItem,{ref:n},(0,E.__)("Copy all blocks"))}const ks=[{value:"visual",label:(0,E.__)("Visual editor")},{value:"text",label:(0,E.__)("Code editor")}];var Cs=function(){const{shortcut:e,mode:t}=(0,m.useSelect)((e=>({shortcut:e(Ln.store).getShortcutRepresentation("core/edit-site/toggle-mode"),isRichEditingEnabled:e(An).getSettings().richEditingEnabled,isCodeEditingEnabled:e(An).getSettings().codeEditingEnabled,mode:e(An).getEditorMode()})),[]),{switchEditorMode:n}=(0,m.useDispatch)(An),a=ks.map((n=>n.value!==t?{...n,shortcut:e}:n));return(0,s.createElement)(y.MenuGroup,{label:(0,E.__)("Editor")},(0,s.createElement)(y.MenuItemsChoice,{choices:a,value:t,onSelect:n}))};function Ts(e){let{showIconLabels:t}=e;const[n,a]=(0,s.useReducer)((e=>!e),!1),[r,l]=(0,s.useReducer)((e=>!e),!1);return(0,Ln.useShortcut)("core/edit-site/keyboard-shortcuts",a),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(le,{toggleProps:{showTooltip:!t,...t&&{variant:"tertiary"}}},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.MenuGroup,{label:(0,E._x)("View","noun")},(0,s.createElement)(T.PreferenceToggleMenuItem,{scope:"core/edit-site",name:"fixedToolbar",label:(0,E.__)("Top toolbar"),info:(0,E.__)("Access all block and document tools in a single place"),messageActivated:(0,E.__)("Top toolbar activated"),messageDeactivated:(0,E.__)("Top toolbar deactivated")}),(0,s.createElement)(T.PreferenceToggleMenuItem,{scope:"core/edit-site",name:"focusMode",label:(0,E.__)("Spotlight mode"),info:(0,E.__)("Focus on one block at a time"),messageActivated:(0,E.__)("Spotlight mode activated"),messageDeactivated:(0,E.__)("Spotlight mode deactivated")}),(0,s.createElement)(Cs,null),(0,s.createElement)(q.Slot,{name:"core/edit-site/plugin-more-menu",label:(0,E.__)("Plugins"),as:y.MenuGroup,fillProps:{onClick:t}})),(0,s.createElement)(y.MenuGroup,{label:(0,E.__)("Tools")},(0,s.createElement)(ws,null),(0,s.createElement)(y.MenuItem,{onClick:a,shortcut:qa.displayShortcut.access("h")},(0,E.__)("Keyboard shortcuts")),(0,s.createElement)(Ss,null),(0,s.createElement)(xs,null),(0,s.createElement)(y.MenuItem,{icon:ls,role:"menuitem",href:(0,E.__)("https://wordpress.org/support/article/site-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,E.__)("Help"),(0,s.createElement)(y.VisuallyHidden,{as:"span"},(0,E.__)("(opens in a new tab)"))),(0,s.createElement)(fs.Slot,{fillProps:{onClose:t}})),(0,s.createElement)(y.MenuGroup,null,(0,s.createElement)(y.MenuItem,{onClick:l},(0,E.__)("Preferences"))))})),(0,s.createElement)(ps,{isModalActive:n,toggleModal:a}),(0,s.createElement)(hs,{isModalActive:r,toggleModal:l}))}function Ns(){const{isDirty:e,isSaving:t,isSaveViewOpen:n}=(0,m.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,isSavingEntityRecord:n}=e(_.store),a=t(),{isSaveViewOpened:r}=e(An);return{isDirty:a.length>0,isSaving:a.some((e=>n(e.kind,e.name,e.key))),isSaveViewOpen:r()}}),[]),{setIsSaveViewOpened:a}=(0,m.useDispatch)(An),r=!e||t,l=(0,E.__)("Save");return(0,s.createElement)(y.Button,{variant:"primary",className:"edit-site-save-button__button","aria-disabled":r,"aria-expanded":n,isBusy:t,onClick:r?void 0:()=>a(!0),label:l,shortcut:r?void 0:qa.displayShortcut.primary("s"),showTooltip:!0},l)}var Ms=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"}));var Is=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"}));var Ps=(0,s.forwardRef)((function(e,t){const n=(0,m.useSelect)((e=>e(_.store).hasUndo()),[]),{undo:a}=(0,m.useDispatch)(_.store);return(0,s.createElement)(y.Button,g({},e,{ref:t,icon:(0,E.isRTL)()?Is:Ms,label:(0,E.__)("Undo"),shortcut:qa.displayShortcut.primary("z"),"aria-disabled":!n,onClick:n?a:void 0}))}));var Bs=(0,s.forwardRef)((function(e,t){const n=(0,qa.isAppleOS)()?qa.displayShortcut.primaryShift("z"):qa.displayShortcut.primary("y"),a=(0,m.useSelect)((e=>e(_.store).hasRedo()),[]),{redo:r}=(0,m.useDispatch)(_.store);return(0,s.createElement)(y.Button,g({},e,{ref:t,icon:(0,E.isRTL)()?Ms:Is,label:(0,E.__)("Redo"),shortcut:n,"aria-disabled":!a,onClick:a?r:void 0}))}));var zs=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function Vs(e){let{template:t}=e;const[n,a]=(0,s.useState)(!1),[r,l]=(0,_.useEntityProp)("postType",t.type,"title",t.id);return(0,s.createElement)(y.TextControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Title"),value:n?"":r,help:"wp_template_part"!==t.type?(0,E.__)('Give the template a title that indicates its purpose, e.g. "Full Width".'):null,onChange:e=>{e||n?(a(!1),l(e)):a(!0)},onBlur:()=>a(!1)})}function Rs(e){let{id:t}=e;const[n,a]=(0,_.useEntityProp)("postType","wp_template_part","area",t),r=(0,m.useSelect)((e=>e(h.store).__experimentalGetDefaultTemplatePartAreas()),[]).map((e=>{let{label:t,area:n}=e;return{label:t,value:n}}));return(0,s.createElement)(y.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Area"),labelPosition:"top",options:r,value:n,onChange:a})}function As(e){let{template:t,onClose:n}=e;const{title:a,description:r}=(0,m.useSelect)((e=>e(h.store).__experimentalGetTemplateInfo(t)),[]),{revertTemplate:l}=(0,m.useDispatch)(An),o=It({path:"/"+t.type+"/all"}),i="wp_template_part"===t.type,c=(i||t.is_custom)&&!t.has_theme_file;if(!t)return null;return(0,s.createElement)("div",{className:"edit-site-template-details"},(0,s.createElement)(y.__experimentalVStack,{className:"edit-site-template-details__group",spacing:3},c?(0,s.createElement)(Vs,{template:t}):(0,s.createElement)(y.__experimentalText,{size:16,weight:600,className:"edit-site-template-details__title",as:"p"},(0,Un.decodeEntities)(a)),r&&(0,s.createElement)(y.__experimentalText,{size:"body",className:"edit-site-template-details__description",as:"p"},(0,Un.decodeEntities)(r))),i&&(0,s.createElement)("div",{className:"edit-site-template-details__group"},(0,s.createElement)(Rs,{id:t.id})),Ot(t)&&(0,s.createElement)(y.MenuGroup,{className:"edit-site-template-details__group edit-site-template-details__revert"},(0,s.createElement)(y.MenuItem,{className:"edit-site-template-details__revert-button",info:(0,E.__)("Use the template as supplied by the theme."),onClick:()=>{l(t),n()}},(0,E.__)("Clear customizations"))),(0,s.createElement)(y.Button,g({className:"edit-site-template-details__show-all-button"},o),"wp_template"===(null==t?void 0:t.type)?(0,E.__)("Manage all templates"):(0,E.__)("Manage all template parts")))}function Ls(e){if(e){const t=(0,c.getBlockType)(e.name);return t?(0,c.__experimentalGetBlockLabel)(t,e.attributes):null}return null}function Ds(){const e=(0,m.useSelect)((e=>e(T.store).get("core/edit-site","showIconLabels")),[]),{isLoaded:t,record:n,getTitle:a}=Aa(),{label:r,icon:l}=function(){const{getBlock:e}=(0,m.useSelect)(fe.store),t=(0,m.useSelect)((e=>e(fe.store).__experimentalGetActiveBlockIdByBlockNames(["core/template-part"])),[]),n=(0,fe.useBlockDisplayInformation)(t);return t?{label:Ls(e(t)),isActive:!0,icon:null==n?void 0:n.icon}:{}}(),[o,i]=(0,s.useState)(null),c=(0,s.useMemo)((()=>({anchor:o,placement:"bottom"})),[o]);if(!t)return(0,s.createElement)("div",{className:"edit-site-document-actions"},(0,E.__)("Loading…"));if(!n)return(0,s.createElement)("div",{className:"edit-site-document-actions"},(0,E.__)("Template not found"));const u="wp_template_part"===n.type?(0,E.__)("template part"):(0,E.__)("template");return(0,s.createElement)("div",{className:f()("edit-site-document-actions",{"has-secondary-label":!!r})},(0,s.createElement)("div",{ref:i,className:"edit-site-document-actions__title-wrapper"},(0,s.createElement)(y.__experimentalText,{size:"body",className:"edit-site-document-actions__title",as:"h1"},(0,s.createElement)(y.VisuallyHidden,{as:"span"},(0,E.sprintf)((0,E.__)("Editing %s: "),u)),a()),(0,s.createElement)("div",{className:"edit-site-document-actions__secondary-item"},(0,s.createElement)(fe.BlockIcon,{icon:l,showColors:!0}),(0,s.createElement)(y.__experimentalText,{size:"body"},null!=r?r:"")),(0,s.createElement)(y.Dropdown,{popoverProps:c,renderToggle:t=>{let{isOpen:n,onToggle:a}=t;return(0,s.createElement)(y.Button,{className:"edit-site-document-actions__get-info",icon:zs,"aria-expanded":n,"aria-haspopup":"true",onClick:a,variant:e?"tertiary":void 0,label:(0,E.sprintf)((0,E.__)("Show %s details"),u)},e&&(0,E.__)("Details"))},contentClassName:"edit-site-document-actions__info-dropdown",renderContent:e=>{let{onClose:t}=e;return(0,s.createElement)(As,{template:n,onClose:t})}})))}const Os=e=>{e.preventDefault()};function Fs(){var e;const t=(0,s.useRef)(),{deviceType:n,templateType:a,isInserterOpen:r,isListViewOpen:l,listViewShortcut:o,isVisualMode:i,blockEditorMode:c,homeUrl:u,showIconLabels:d}=(0,m.useSelect)((e=>{var t;const{__experimentalGetPreviewDeviceType:n,getEditedPostType:a,isInserterOpened:r,isListViewOpened:l,getEditorMode:o}=e(An),{getShortcutRepresentation:i}=e(Ln.store),{__unstableGetEditorMode:s}=e(fe.store),c=a(),{getUnstableBase:u}=e(_.store);return{deviceType:n(),templateType:c,isInserterOpen:r(),isListViewOpen:l(),listViewShortcut:i("core/edit-site/toggle-list-view"),isVisualMode:"visual"===o(),blockEditorMode:s(),homeUrl:null===(t=u())||void 0===t?void 0:t.home,showIconLabels:e(T.store).get("core/edit-site","showIconLabels")}}),[]),{__experimentalSetPreviewDeviceType:p,setIsInserterOpened:h,setIsListViewOpened:g}=(0,m.useDispatch)(An),{__unstableSetEditorMode:v}=(0,m.useDispatch)(fe.store),b=(0,te.useViewportMatch)("medium"),w=(0,s.useCallback)((()=>{r?(t.current.focus(),h(!1)):h(!0)}),[r,h]),S=(0,s.useCallback)((()=>g(!l)),[g,l]),x=function(){const e=(0,y.__experimentalUseSlotFills)(xo);return!(null==e||!e.length)}(),k="wp_template_part"===a,C=(0,E._x)("Toggle block inserter","Generic label for block inserter button"),N=r?(0,E.__)("Close"):(0,E.__)("Add"),M=(null===(e=window)||void 0===e?void 0:e.__experimentalEnableZoomedOutView)&&i,I="zoom-out"===c;return(0,s.createElement)("div",{className:f()("edit-site-header-edit-mode",{"show-icon-labels":d})},!x&&(0,s.createElement)(fe.NavigableToolbar,{className:"edit-site-header-edit-mode__start","aria-label":(0,E.__)("Document tools")},(0,s.createElement)("div",{className:"edit-site-header-edit-mode__toolbar"},(0,s.createElement)(y.ToolbarItem,{ref:t,as:y.Button,className:"edit-site-header-edit-mode__inserter-toggle",variant:"primary",isPressed:r,onMouseDown:Os,onClick:w,disabled:!i,icon:ra,label:d?N:C,showTooltip:!d}),b&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.ToolbarItem,{as:fe.ToolSelector,showTooltip:!d,variant:d?"tertiary":void 0,disabled:!i}),(0,s.createElement)(y.ToolbarItem,{as:Ps,showTooltip:!d,variant:d?"tertiary":void 0}),(0,s.createElement)(y.ToolbarItem,{as:Bs,showTooltip:!d,variant:d?"tertiary":void 0}),(0,s.createElement)(y.ToolbarItem,{as:y.Button,className:"edit-site-header-edit-mode__list-view-toggle",disabled:!i||I,icon:as,isPressed:l,label:(0,E.__)("List View"),onClick:S,shortcut:o,showTooltip:!d,variant:d?"tertiary":void 0}),M&&(0,s.createElement)(y.ToolbarItem,{as:y.Button,className:"edit-site-header-edit-mode__zoom-out-view-toggle",icon:rs,isPressed:I,label:(0,E.__)("Zoom-out View"),onClick:()=>{p("desktop"),v(I?"edit":"zoom-out")}})))),(0,s.createElement)("div",{className:"edit-site-header-edit-mode__center"},x?(0,E.__)("Style Book"):(0,s.createElement)(Ds,null)),(0,s.createElement)("div",{className:"edit-site-header-edit-mode__end"},(0,s.createElement)("div",{className:"edit-site-header-edit-mode__actions"},!k&&!x&&(0,s.createElement)("div",{className:f()("edit-site-header-edit-mode__preview-options",{"is-zoomed-out":I})},(0,s.createElement)(fe.__experimentalPreviewOptions,{deviceType:n,setDeviceType:p,viewLabel:(0,E.__)("View")},(0,s.createElement)(y.MenuGroup,null,(0,s.createElement)(y.MenuItem,{href:u,target:"_blank",icon:ls},(0,E.__)("View site"),(0,s.createElement)(y.VisuallyHidden,{as:"span"},(0,E.__)("(opens in a new tab)")))))),(0,s.createElement)(Ns,null),(0,s.createElement)(K.Slot,{scope:"core/edit-site"}),(0,s.createElement)(Ts,{showIconLabels:d}))))}var Gs=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(b.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"}));var Hs=function(e){let{className:t}=e;const{isRequestingSite:n,siteIconUrl:a}=(0,m.useSelect)((e=>{const{getEntityRecord:t,isResolving:n}=e(_.store),a=t("root","__unstableBase",void 0)||{};return{isRequestingSite:n("core","getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:a.site_icon_url}}),[]);if(n&&!a)return null;const r=a?(0,s.createElement)("img",{className:"edit-site-site-icon__image",alt:(0,E.__)("Site Icon"),src:a}):(0,s.createElement)(y.Icon,{className:"edit-site-site-icon__icon",size:"32px",icon:Gs});return(0,s.createElement)("div",{className:f()(t,"edit-site-site-icon")},r)};const $s=(0,s.forwardRef)(((e,t)=>{const{canvasMode:n,dashboardLink:a}=(0,m.useSelect)((e=>{e(An).getEditedPostType();const{getCanvasMode:t,getSettings:n}=Qe(e(An));return{canvasMode:t(),dashboardLink:n().__experimentalDashboardLink}}),[]),r=(0,te.useReducedMotion)(),{setCanvasMode:l}=Qe((0,m.useDispatch)(An)),{clearSelectedBlock:o}=(0,m.useDispatch)(fe.store),i="edit"!==n,c="view"===n?{href:a||"index.php","aria-label":(0,E.__)("Go back to the dashboard")}:{label:(0,E.__)("Open Navigation Sidebar"),onClick:()=>{o(),l("view")}},u=(0,m.useSelect)((e=>{var t;return null===(t=e(_.store).getEntityRecord("root","site"))||void 0===t?void 0:t.title}),[]);return(0,s.createElement)(y.__unstableMotion.div,g({ref:t},e,{className:f()("edit-site-site-hub",e.className),layout:!0,transition:{type:"tween",duration:r?0:.3,ease:"easeOut"}}),(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start",className:"edit-site-site-hub__text-content",spacing:"0"},(0,s.createElement)(y.__unstableMotion.div,{className:"edit-site-site-hub__view-mode-toggle-container",layout:!0,transition:{type:"tween",duration:r?0:.3,ease:"easeOut"}},(0,s.createElement)(y.Button,g({},c,{className:"edit-site-layout__view-mode-toggle"}),(0,s.createElement)(Hs,{className:"edit-site-layout__view-mode-toggle-icon"}))),i&&(0,s.createElement)("div",{className:"edit-site-site-hub__site-title"},u)))}));var Us=$s;function Ws(){const{isSaveViewOpen:e,canvasMode:t}=(0,m.useSelect)((e=>{const{isSaveViewOpened:t,getCanvasMode:n}=Qe(e(An));return{isSaveViewOpen:t(),canvasMode:n()}}),[]),{setIsSaveViewOpened:n}=(0,m.useDispatch)(An),a=()=>n(!1);return"view"===t?e?(0,s.createElement)(y.Modal,{className:"edit-site-save-panel__modal",onRequestClose:a,__experimentalHideHeader:!0,contentLabel:(0,E.__)("Save site, content, and template changes")},(0,s.createElement)(h.EntitiesSavedStates,{close:a})):null:(0,s.createElement)(ne,{className:f()("edit-site-layout__actions",{"is-entity-save-view-open":e}),ariaLabel:(0,E.__)("Save sidebar")},e?(0,s.createElement)(h.EntitiesSavedStates,{close:a}):(0,s.createElement)("div",{className:"edit-site-editor__toggle-save-panel"},(0,s.createElement)(y.Button,{variant:"secondary",className:"edit-site-editor__toggle-save-panel-button",onClick:()=>n(!0),"aria-expanded":!1},(0,E.__)("Open save panel"))))}var js=function(){const{registerShortcut:e}=(0,m.useDispatch)(Ln.store);return(0,s.useEffect)((()=>{e({name:"core/edit-site/save",category:"global",description:(0,E.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/edit-site/undo",category:"global",description:(0,E.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/edit-site/redo",category:"global",description:(0,E.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,qa.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/edit-site/toggle-list-view",category:"global",description:(0,E.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/edit-site/toggle-block-settings-sidebar",category:"global",description:(0,E.__)("Show or hide the block settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/edit-site/keyboard-shortcuts",category:"main",description:(0,E.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/edit-site/next-region",category:"global",description:(0,E.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-site/previous-region",category:"global",description:(0,E.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]}),e({name:"core/edit-site/toggle-mode",category:"global",description:(0,E.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),e({name:"core/edit-site/transform-heading-to-paragraph",category:"block-library",description:(0,E.__)("Transform heading to paragraph."),keyCombination:{modifier:"access",character:"0"}}),[1,2,3,4,5,6].forEach((t=>{e({name:`core/edit-site/transform-paragraph-to-heading-${t}`,category:"block-library",description:(0,E.__)("Transform paragraph to heading."),keyCombination:{modifier:"access",character:`${t}`}})}))}),[e]),null};var qs=function(){const{__experimentalGetDirtyEntityRecords:e,isSavingEntityRecord:t}=(0,m.useSelect)(_.store),{setIsSaveViewOpened:n}=(0,m.useDispatch)(An);return(0,Ln.useShortcut)("core/edit-site/save",(a=>{a.preventDefault();const r=e(),l=!!r.length;!r.some((e=>t(e.kind,e.name,e.key)))&&l&&n(!0)})),null};const Ys=.5,Xs={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0};function Zs(){!function(){const{params:{postId:e,postType:t}={}}=Ct(),{isRequestingSite:n,homepageId:a,url:r}=(0,m.useSelect)((e=>{const{getSite:t}=e(_.store),n=t();return{isRequestingSite:!n,homepageId:"page"===(null==n?void 0:n.show_on_front)?n.page_on_front:null,url:null==n?void 0:n.url}}),[]),{setTemplate:l,setTemplatePart:o,setPage:i}=(0,m.useDispatch)(An);(0,s.useEffect)((()=>{if(t&&e)switch(t){case"wp_template":l(e);break;case"wp_template_part":o(e);break;default:i({context:{postType:t,postId:e}})}else a?i({context:{postType:"page",postId:a}}):n||i({path:r})}),[r,e,t,a,n,i,l,o])}(),function(){const e=Tt(),{params:t}=Ct(),n=(0,m.useSelect)((e=>Qe(e(An)).getCanvasMode()),[]),{setCanvasMode:a}=Qe((0,m.useDispatch)(An)),r=(0,s.useRef)(n),{canvas:l}=t,o=(0,s.useRef)(l),i=(0,s.useRef)(t);(0,s.useEffect)((()=>{i.current=t}),[t]),(0,s.useEffect)((()=>{r.current=n,"init"!==n&&("edit"===n&&o.current!==n&&e.push({...i.current,canvas:"edit"}),"view"===n&&void 0!==o.current&&e.push({...i.current,canvas:void 0}))}),[n,e]),(0,s.useEffect)((()=>{o.current=l,void 0===l&&"view"!==r.current?a("view"):"edit"===l&&"edit"!==r.current&&a("edit")}),[l,a])}();const e=(0,s.useRef)(),{params:t}=Ct(),n=function(e){let{path:t}=e;return"/wp_template/all"===t||"/wp_template_part/all"===t}(t),a=!n,{canvasMode:r,previousShortcut:l,nextShortcut:o}=(0,m.useSelect)((e=>{const{getAllShortcutKeyCombinations:t}=e(Ln.store),{getCanvasMode:n}=Qe(e(An));return{canvasMode:n(),previousShortcut:t("core/edit-site/previous-region"),nextShortcut:t("core/edit-site/next-region")}}),[]),i=(0,y.__unstableUseNavigateRegions)({previous:l,next:o}),c=(0,te.useReducedMotion)(),u=(0,te.useViewportMatch)("medium","<"),d=u?0:24,p=u&&!n||!u&&("view"===r||!a),h=u&&a&&"edit"===r||!u||!a,v=!a&&!u||!u&&a&&"view"===r,b=u&&n||a&&"edit"===r,[w,S]=(0,te.useResizeObserver)(),[x,k]=(0,te.useResizeObserver)(),[C,T]=(0,s.useState)(null),[N,M]=(0,s.useState)(!1),I=!u&&"view"===r,P=u?"100vw":360;let B=N?"100%":k.width;return v&&!N&&(B=S.width-d),"init"===r?null:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(js,null),(0,s.createElement)(qs,null),x,(0,s.createElement)("div",g({},i,{ref:i.ref,className:f()("edit-site-layout",i.className,{"is-full-canvas":b,"is-edit-mode":"edit"===r})}),(0,s.createElement)(Us,{ref:e,className:"edit-site-layout__hub",style:{width:I&&C?C-48:void 0}}),(0,s.createElement)(y.__unstableAnimatePresence,{initial:!1},a&&"edit"===r&&(0,s.createElement)(ne,{className:"edit-site-layout__header",ariaLabel:(0,E.__)("Editor top bar"),as:y.__unstableMotion.div,animate:{y:0},initial:{y:"-100%"},exit:{y:"-100%"},transition:{type:"tween",duration:c?0:Ys,ease:"easeOut"}},"edit"===r&&(0,s.createElement)(Fs,null))),(0,s.createElement)("div",{className:"edit-site-layout__content"},(0,s.createElement)(y.__unstableAnimatePresence,{initial:!1},p&&(0,s.createElement)(y.ResizableBox,{as:y.__unstableMotion.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{type:"tween",duration:c||N?0:Ys,ease:"easeOut"},size:{height:"100%",width:I&&C?C:P},className:"edit-site-layout__sidebar",enable:{right:I},onResizeStop:(e,t,n)=>{T(n.clientWidth),M(!1)},onResizeStart:()=>{M(!0)},onResize:(t,n,a)=>{e.current.style.width=a.clientWidth-48+"px"},handleComponent:{right:(0,s.createElement)(gi,{direction:"right",variation:"separator",resizeWidthBy:e=>{T((null!=C?C:P)+e)}})},handleClasses:void 0,handleStyles:{right:Xs},minWidth:I?320:void 0,maxWidth:I&&k?k.width-360:void 0},(0,s.createElement)(ne,{ariaLabel:(0,E.__)("Navigation sidebar")},(0,s.createElement)(Ka,null)))),(0,s.createElement)(Ws,null),h&&(0,s.createElement)("div",{className:f()("edit-site-layout__canvas-container",{"is-resizing":N}),style:{paddingTop:v?d:0,paddingBottom:v?d:0}},w,!!S.width&&(0,s.createElement)(y.__unstableMotion.div,{whileHover:a&&"view"===r?{scale:1.01,transition:{duration:c||N?0:.2}}:{},initial:!1,layout:"position",className:"edit-site-layout__canvas",transition:{type:"tween",duration:c||N?0:Ys,ease:"easeOut"}},(0,s.createElement)(y.__unstableMotion.div,{style:{position:"absolute",top:0,left:0,bottom:0},initial:!1,animate:{width:B},transition:{type:"tween",duration:c||N?0:Ys,ease:"easeOut"}},(0,s.createElement)(ns,null,a&&(0,s.createElement)(Di,null),n&&(0,s.createElement)(Ji,null))))))))}function Ks(){const{createErrorNotice:e}=(0,m.useDispatch)(ye.store);return(0,s.createElement)(Ln.ShortcutProvider,{style:{height:"100%"}},(0,s.createElement)(y.SlotFillProvider,null,(0,s.createElement)(y.Popover.Slot,null),(0,s.createElement)(h.UnsavedChangesWarning,null),(0,s.createElement)(Mt,null,(0,s.createElement)(Zs,null),(0,s.createElement)(G.PluginArea,{onError:function(t){e((0,E.sprintf)((0,E.__)('The "%s" plugin has encountered an error and cannot be rendered.'),t))}}))))}function Qs(e){let{className:t,...n}=e;const a=(0,m.useSelect)((e=>e(An).getSettings().showIconLabels),[]);return(0,s.createElement)(ee,g({panelClassName:t,className:"edit-site-sidebar-edit-mode",scope:"core/edit-site",showIconLabels:a},n))}function Js(e){return(0,s.createElement)(X,g({__unstableExplicitMenuItem:!0,scope:"core/edit-site"},e))}var ec=(0,te.compose)((0,G.withPluginContext)(((e,t)=>{var n;return{as:null!==(n=t.as)&&void 0!==n?n:y.MenuItem,icon:t.icon||e.icon,name:"core/edit-site/plugin-more-menu"}})))(q);function tc(e,t){const n=document.getElementById(e),a=(0,s.createRoot)(n);t.__experimentalFetchLinkSuggestions=(e,n)=>(0,_.__experimentalFetchLinkSuggestions)(e,n,t),t.__experimentalFetchRichUrlData=_.__experimentalFetchUrlData,(0,m.dispatch)(c.store).__experimentalReapplyBlockTypeFilters();const r=(0,u.__experimentalGetCoreBlocks)().filter((e=>{let{name:t}=e;return"core/freeform"!==t}));return(0,u.registerCoreBlocks)(r),(0,m.dispatch)(c.store).setFreeformFallbackBlockName("core/html"),(0,_e.registerLegacyWidgetBlock)({inserter:!1}),(0,_e.registerWidgetGroupBlock)({inserter:!1}),(0,m.dispatch)(T.store).setDefaults("core/edit-site",{editorMode:"visual",fixedToolbar:!1,focusMode:!1,keepCaretInsideBlock:!1,welcomeGuide:!0,welcomeGuideStyles:!0,showListViewByDefault:!1}),(0,m.dispatch)(F).setDefaultComplementaryArea("core/edit-site","edit-site/template"),(0,m.dispatch)(An).updateSettings(t),(0,m.dispatch)(h.store).updateEditorSettings({defaultTemplateTypes:t.defaultTemplateTypes,defaultTemplatePartAreas:t.defaultTemplatePartAreas}),window.addEventListener("dragover",(e=>e.preventDefault()),!1),window.addEventListener("drop",(e=>e.preventDefault()),!1),a.render((0,s.createElement)(Ks,null)),a}function nc(){p()("wp.editSite.reinitializeEditor",{since:"6.2",version:"6.3"})}}(),(window.wp=window.wp||{}).editSite=a}(); \ No newline at end of file +*/!function(){"use strict";var a={}.hasOwnProperty;function r(){for(var e=[],t=0;t2096103.424&&p!==d))return navigator.msSaveBlob?navigator.msSaveBlob(y(c),_):E(c);s=(c=y(c)).type||i}else if(/([\x80-\xff])/.test(c)){for(var g=0,v=new Uint8Array(c.length),f=v.length;g({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),M=(e,t)=>n=>{let{registry:a,dispatch:r}=n;if(!t)return;a.select(T.store).get(e,"isComplementaryAreaVisible")||a.dispatch(T.store).set(e,"isComplementaryAreaVisible",!0),r({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},I=e=>t=>{let{registry:n}=t;n.select(T.store).get(e,"isComplementaryAreaVisible")&&n.dispatch(T.store).set(e,"isComplementaryAreaVisible",!1)},P=(e,t)=>n=>{let{registry:a}=n;if(!t)return;const r=a.select(T.store).get(e,"pinnedItems");!0!==(null==r?void 0:r[t])&&a.dispatch(T.store).set(e,"pinnedItems",{...r,[t]:!0})},B=(e,t)=>n=>{let{registry:a}=n;if(!t)return;const r=a.select(T.store).get(e,"pinnedItems");a.dispatch(T.store).set(e,"pinnedItems",{...r,[t]:!1})};function z(e,t){return function(n){let{registry:a}=n;p()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),a.dispatch(T.store).toggle(e,t)}}function V(e,t,n){return function(a){let{registry:r}=a;p()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),r.dispatch(T.store).set(e,t,!!n)}}function R(e,t){return function(n){let{registry:a}=n;p()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),a.dispatch(T.store).setDefaults(e,t)}}const A=(0,m.createRegistrySelector)((e=>(t,n)=>{var a;const r=e(T.store).get(n,"isComplementaryAreaVisible");if(void 0!==r)return r?null==t||null===(a=t.complementaryAreas)||void 0===a?void 0:a[n]:null})),L=(0,m.createRegistrySelector)((e=>(t,n,a)=>{var r;const l=e(T.store).get(n,"pinnedItems");return null===(r=null==l?void 0:l[a])||void 0===r||r})),D=(0,m.createRegistrySelector)((e=>(t,n,a)=>(p()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(T.store).get(n,a))));var O=(0,m.combineReducers)({complementaryAreas:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:n,area:a}=t;return e[n]?e:{...e,[n]:a}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:n,area:a}=t;return{...e,[n]:a}}}return e}});const F=(0,m.createReduxStore)("core/interface",{reducer:O,actions:e,selectors:t});(0,m.register)(F);var G=window.wp.plugins,H=(0,G.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));var $=H((function(e){let{as:t=y.Button,scope:n,identifier:a,icon:r,selectedIcon:l,name:o,...i}=e;const c=t,u=(0,m.useSelect)((e=>e(F).getActiveComplementaryArea(n)===a),[a]),{enableComplementaryArea:d,disableComplementaryArea:p}=(0,m.useDispatch)(F);return(0,s.createElement)(c,g({icon:l&&u?l:r,onClick:()=>{u?p(n):d(n,a)}},i))}));var U=e=>{let{smallScreenTitle:t,children:n,className:a,toggleButtonProps:r}=e;const l=(0,s.createElement)($,g({icon:C},r));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},t&&(0,s.createElement)("span",{className:"interface-complementary-area-header__small-title"},t),l),(0,s.createElement)("div",{className:f()("components-panel__header","interface-complementary-area-header",a),tabIndex:-1},n,l))};const W=()=>{};function j(e){let{name:t,as:n=y.Button,onClick:a,...r}=e;return(0,s.createElement)(y.Fill,{name:t},(e=>{let{onClick:t}=e;return(0,s.createElement)(n,g({onClick:a||t?function(){(a||W)(...arguments),(t||W)(...arguments)}:void 0},r))}))}j.Slot=function(e){let{name:t,as:n=y.ButtonGroup,fillProps:a={},bubblesVirtually:r,...l}=e;return(0,s.createElement)(y.Slot,{name:t,bubblesVirtually:r,fillProps:a},(e=>{if(!s.Children.toArray(e).length)return null;const t=[];s.Children.forEach(e,(e=>{let{props:{__unstableExplicitMenuItem:n,__unstableTarget:a}}=e;a&&n&&t.push(a)}));const a=s.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&t.includes(e.props.__unstableTarget)?null:e));return(0,s.createElement)(n,l,a)}))};var q=j;const Y=e=>{let{__unstableExplicitMenuItem:t,__unstableTarget:n,...a}=e;return(0,s.createElement)(y.MenuItem,a)};function X(e){let{scope:t,target:n,__unstableExplicitMenuItem:a,...r}=e;return(0,s.createElement)($,g({as:e=>(0,s.createElement)(q,g({__unstableExplicitMenuItem:a,__unstableTarget:`${t}/${n}`,as:Y,name:`${t}/plugin-more-menu`},e)),role:"menuitemcheckbox",selectedIcon:w,name:n,scope:t},r))}function Z(e){let{scope:t,...n}=e;return(0,s.createElement)(y.Fill,g({name:`PinnedItems/${t}`},n))}Z.Slot=function(e){let{scope:t,className:n,...a}=e;return(0,s.createElement)(y.Slot,g({name:`PinnedItems/${t}`},a),(e=>(null==e?void 0:e.length)>0&&(0,s.createElement)("div",{className:f()(n,"interface-pinned-items")},e)))};var K=Z;function Q(e){let{scope:t,children:n,className:a}=e;return(0,s.createElement)(y.Fill,{name:`ComplementaryArea/${t}`},(0,s.createElement)("div",{className:a},n))}const J=H((function(e){let{children:t,className:n,closeLabel:a=(0,E.__)("Close plugin"),identifier:r,header:l,headerClassName:o,icon:i,isPinnable:c=!0,panelClassName:u,scope:d,name:p,smallScreenTitle:_,title:h,toggleShortcut:g,isActiveByDefault:v,showIconLabels:b=!1}=e;const{isActive:C,isPinned:T,activeArea:N,isSmall:M,isLarge:I}=(0,m.useSelect)((e=>{const{getActiveComplementaryArea:t,isItemPinned:n}=e(F),a=t(d);return{isActive:a===r,isPinned:n(d,r),activeArea:a,isSmall:e(k.store).isViewportMatch("< medium"),isLarge:e(k.store).isViewportMatch("large")}}),[r,d]);!function(e,t,n,a,r){const l=(0,s.useRef)(!1),o=(0,s.useRef)(!1),{enableComplementaryArea:i,disableComplementaryArea:c}=(0,m.useDispatch)(F);(0,s.useEffect)((()=>{a&&r&&!l.current?(c(e),o.current=!0):o.current&&!r&&l.current?(o.current=!1,i(e,t)):o.current&&n&&n!==t&&(o.current=!1),r!==l.current&&(l.current=r)}),[a,r,e,t,n])}(d,r,N,C,M);const{enableComplementaryArea:P,disableComplementaryArea:B,pinItem:z,unpinItem:V}=(0,m.useDispatch)(F);return(0,s.useEffect)((()=>{v&&void 0===N&&!M&&P(d,r)}),[N,v,d,r,M]),(0,s.createElement)(s.Fragment,null,c&&(0,s.createElement)(K,{scope:d},T&&(0,s.createElement)($,{scope:d,identifier:r,isPressed:C&&(!b||I),"aria-expanded":C,label:h,icon:b?w:i,showTooltip:!b,variant:b?"tertiary":void 0})),p&&c&&(0,s.createElement)(X,{target:p,scope:d,icon:i},h),C&&(0,s.createElement)(Q,{className:f()("interface-complementary-area",n),scope:d},(0,s.createElement)(U,{className:o,closeLabel:a,onClose:()=>B(d),smallScreenTitle:_,toggleButtonProps:{label:a,shortcut:g,scope:d,identifier:r}},l||(0,s.createElement)(s.Fragment,null,(0,s.createElement)("strong",null,h),c&&(0,s.createElement)(y.Button,{className:"interface-complementary-area__pin-unpin-item",icon:T?S:x,label:T?(0,E.__)("Unpin from toolbar"):(0,E.__)("Pin to toolbar"),onClick:()=>(T?V:z)(d,r),isPressed:T,"aria-expanded":T}))),(0,s.createElement)(y.Panel,{className:u},t)))}));J.Slot=function(e){let{scope:t,...n}=e;return(0,s.createElement)(y.Slot,g({name:`ComplementaryArea/${t}`},n))};var ee=J,te=window.wp.compose;function ne(e){let{children:t,className:n,ariaLabel:a,as:r="div",...l}=e;return(0,s.createElement)(r,g({className:f()("interface-navigable-region",n),"aria-label":a,role:"region",tabIndex:"-1"},l),t)}var ae=(0,s.forwardRef)((function(e,t){let{isDistractionFree:n,footer:a,header:r,editorNotices:l,sidebar:o,secondarySidebar:i,notices:c,content:u,actions:m,labels:d,className:p,enableRegionNavigation:_=!0,shortcuts:h}=e;const v=(0,y.__unstableUseNavigateRegions)(h);!function(e){(0,s.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const b={...{header:(0,E.__)("Header"),body:(0,E.__)("Content"),secondarySidebar:(0,E.__)("Block Library"),sidebar:(0,E.__)("Settings"),actions:(0,E.__)("Publish"),footer:(0,E.__)("Footer")},...d},w={hidden:n?{opacity:0}:{opacity:1},hover:{opacity:1,transition:{type:"tween",delay:.2,delayChildren:.2}}};return(0,s.createElement)("div",g({},_?v:{},{ref:(0,te.useMergeRefs)([t,_?v.ref:void 0]),className:f()(p,"interface-interface-skeleton",v.className,!!a&&"has-footer")}),(0,s.createElement)("div",{className:"interface-interface-skeleton__editor"},!!r&&n&&(0,s.createElement)(ne,{as:y.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":b.header,initial:n?"hidden":"hover",whileHover:"hover",variants:w,transition:{type:"tween",delay:.8}},r),!!r&&!n&&(0,s.createElement)(ne,{className:"interface-interface-skeleton__header",ariaLabel:b.header},r),n&&(0,s.createElement)("div",{className:"interface-interface-skeleton__header"},l),(0,s.createElement)("div",{className:"interface-interface-skeleton__body"},!!i&&(0,s.createElement)(ne,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:b.secondarySidebar},i),!!c&&(0,s.createElement)("div",{className:"interface-interface-skeleton__notices"},c),(0,s.createElement)(ne,{className:"interface-interface-skeleton__content",ariaLabel:b.body},u),!!o&&(0,s.createElement)(ne,{className:"interface-interface-skeleton__sidebar",ariaLabel:b.sidebar},o),!!m&&(0,s.createElement)(ne,{className:"interface-interface-skeleton__actions",ariaLabel:b.actions},m))),!!a&&(0,s.createElement)(ne,{className:"interface-interface-skeleton__footer",ariaLabel:b.footer},a))}));var re=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function le(e){let{as:t=y.DropdownMenu,className:n,label:a=(0,E.__)("Options"),popoverProps:r,toggleProps:l,children:o}=e;return(0,s.createElement)(t,{className:f()("interface-more-menu-dropdown",n),icon:re,label:a,popoverProps:{placement:"bottom-end",...r,className:f()("interface-more-menu-dropdown__content",null==r?void 0:r.className)},toggleProps:{tooltipPosition:"bottom",...l}},(e=>o(e)))}function oe(e){let{closeModal:t,children:n}=e;return(0,s.createElement)(y.Modal,{className:"interface-preferences-modal",title:(0,E.__)("Preferences"),onRequestClose:t},n)}var ie=function(e){let{icon:t,size:n=24,...a}=e;return(0,s.cloneElement)(t,{width:n,height:n,...a})};var se=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var ce=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));const ue="preferences-menu";function me(e){let{sections:t}=e;const n=(0,te.useViewportMatch)("medium"),[a,r]=(0,s.useState)(ue),{tabs:l,sectionsContentMap:o}=(0,s.useMemo)((()=>{let e={tabs:[],sectionsContentMap:{}};return t.length&&(e=t.reduce(((e,t)=>{let{name:n,tabLabel:a,content:r}=t;return e.tabs.push({name:n,title:a}),e.sectionsContentMap[n]=r,e}),{tabs:[],sectionsContentMap:{}})),e}),[t]),i=(0,s.useCallback)((e=>o[e.name]||null),[o]);let c;return c=n?(0,s.createElement)(y.TabPanel,{className:"interface-preferences__tabs",tabs:l,initialTabName:a!==ue?a:void 0,onSelect:r,orientation:"vertical"},i):(0,s.createElement)(y.__experimentalNavigatorProvider,{initialPath:"/",className:"interface-preferences__provider"},(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/"},(0,s.createElement)(y.Card,{isBorderless:!0,size:"small"},(0,s.createElement)(y.CardBody,null,(0,s.createElement)(y.__experimentalItemGroup,null,l.map((e=>(0,s.createElement)(y.__experimentalNavigatorButton,{key:e.name,path:e.name,as:y.__experimentalItem,isAction:!0},(0,s.createElement)(y.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(y.__experimentalTruncate,null,e.title)),(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(ie,{icon:(0,E.isRTL)()?se:ce})))))))))),t.length&&t.map((e=>(0,s.createElement)(y.__experimentalNavigatorScreen,{key:`${e.name}-menu`,path:e.name},(0,s.createElement)(y.Card,{isBorderless:!0,size:"large"},(0,s.createElement)(y.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6"},(0,s.createElement)(y.__experimentalNavigatorBackButton,{icon:(0,E.isRTL)()?ce:se,"aria-label":(0,E.__)("Navigate to the previous view")}),(0,s.createElement)(y.__experimentalText,{size:"16"},e.tabLabel)),(0,s.createElement)(y.CardBody,null,e.content)))))),c}var de=e=>{let{description:t,title:n,children:a}=e;return(0,s.createElement)("fieldset",{className:"interface-preferences-modal__section"},(0,s.createElement)("legend",{className:"interface-preferences-modal__section-legend"},(0,s.createElement)("h2",{className:"interface-preferences-modal__section-title"},n),t&&(0,s.createElement)("p",{className:"interface-preferences-modal__section-description"},t)),a)};var pe=function(e){let{help:t,label:n,isChecked:a,onChange:r,children:l}=e;return(0,s.createElement)("div",{className:"interface-preferences-modal__option"},(0,s.createElement)(y.ToggleControl,{__nextHasNoMarginBottom:!0,help:t,label:n,checked:a,onChange:r}),l)},_e=window.wp.widgets,he=window.wp.hooks,ge=window.wp.mediaUtils;(0,he.addFilter)("editor.MediaUpload","core/edit-site/components/media-upload",(()=>ge.MediaUpload));var ve=window.lodash,fe=window.wp.blockEditor,ye=window.wp.notices,Ee={grad:.9,turn:360,rad:360/(2*Math.PI)},be=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},we=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Se=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},xe=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},ke=function(e){return{r:Se(e.r,0,255),g:Se(e.g,0,255),b:Se(e.b,0,255),a:Se(e.a)}},Ce=function(e){return{r:we(e.r),g:we(e.g),b:we(e.b),a:we(e.a,3)}},Te=/^#([0-9a-f]{3,8})$/i,Ne=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Me=function(e){var t=e.r,n=e.g,a=e.b,r=e.a,l=Math.max(t,n,a),o=l-Math.min(t,n,a),i=o?l===t?(n-a)/o:l===n?2+(a-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:l?o/l*100:0,v:l/255*100,a:r}},Ie=function(e){var t=e.h,n=e.s,a=e.v,r=e.a;t=t/360*6,n/=100,a/=100;var l=Math.floor(t),o=a*(1-n),i=a*(1-(t-l)*n),s=a*(1-(1-t+l)*n),c=l%6;return{r:255*[a,i,o,o,s,a][c],g:255*[s,a,a,i,o,o][c],b:255*[o,o,s,a,a,i][c],a:r}},Pe=function(e){return{h:xe(e.h),s:Se(e.s,0,100),l:Se(e.l,0,100),a:Se(e.a)}},Be=function(e){return{h:we(e.h),s:we(e.s),l:we(e.l),a:we(e.a,3)}},ze=function(e){return Ie((n=(t=e).s,{h:t.h,s:(n*=((a=t.l)<50?a:100-a)/100)>0?2*n/(a+n)*100:0,v:a+n,a:t.a}));var t,n,a},Ve=function(e){return{h:(t=Me(e)).h,s:(r=(200-(n=t.s))*(a=t.v)/100)>0&&r<200?n*a/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,a,r},Re=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ae=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Le=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,De=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Oe={string:[[function(e){var t=Te.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?we(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?we(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Le.exec(e)||De.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:ke({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Re.exec(e)||Ae.exec(e);if(!t)return null;var n,a,r=Pe({h:(n=t[1],a=t[2],void 0===a&&(a="deg"),Number(n)*(Ee[a]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return ze(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,a=e.b,r=e.a,l=void 0===r?1:r;return be(t)&&be(n)&&be(a)?ke({r:Number(t),g:Number(n),b:Number(a),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,a=e.l,r=e.a,l=void 0===r?1:r;if(!be(t)||!be(n)||!be(a))return null;var o=Pe({h:Number(t),s:Number(n),l:Number(a),a:Number(l)});return ze(o)},"hsl"],[function(e){var t=e.h,n=e.s,a=e.v,r=e.a,l=void 0===r?1:r;if(!be(t)||!be(n)||!be(a))return null;var o=function(e){return{h:xe(e.h),s:Se(e.s,0,100),v:Se(e.v,0,100),a:Se(e.a)}}({h:Number(t),s:Number(n),v:Number(a),a:Number(l)});return Ie(o)},"hsv"]]},Fe=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=Ce(this.rgba)).r,n=e.g,a=e.b,l=(r=e.a)<1?Ne(we(255*r)):"","#"+Ne(t)+Ne(n)+Ne(a)+l;var e,t,n,a,r,l},e.prototype.toRgb=function(){return Ce(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Ce(this.rgba)).r,n=e.g,a=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+a+", "+r+")":"rgb("+t+", "+n+", "+a+")";var e,t,n,a,r},e.prototype.toHsl=function(){return Be(Ve(this.rgba))},e.prototype.toHslString=function(){return t=(e=Be(Ve(this.rgba))).h,n=e.s,a=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+a+"%, "+r+")":"hsl("+t+", "+n+"%, "+a+"%)";var e,t,n,a,r},e.prototype.toHsv=function(){return e=Me(this.rgba),{h:we(e.h),s:we(e.s),v:we(e.v),a:we(e.a,3)};var e},e.prototype.invert=function(){return je({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),je(He(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),je(He(this.rgba,-e))},e.prototype.grayscale=function(){return je(He(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),je(Ue(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),je(Ue(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?je({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):we(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Ve(this.rgba);return"number"==typeof e?je({h:e,s:t.s,l:t.l,a:t.a}):we(t.h)},e.prototype.isEqual=function(e){return this.toHex()===je(e).toHex()},e}(),je=function(e){return e instanceof We?e:new We(e)},qe=[],Ye=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Xe=function(e){return.2126*Ye(e.r)+.7152*Ye(e.g)+.0722*Ye(e.b)};var Ze=window.wp.privateApis;const{lock:Ke,unlock:Qe}=(0,Ze.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/edit-site"),{useGlobalSetting:Je}=Qe(fe.privateApis);!function(e){e.forEach((function(e){qe.indexOf(e)<0&&(e(We,Oe),qe.push(e))}))}([function(e){e.prototype.luminance=function(){return e=Xe(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,a,r,l,o,i,s,c=t instanceof e?t:new e(t);return l=this.rgba,o=c.toRgb(),n=(i=Xe(l))>(s=Xe(o))?(i+.05)/(s+.05):(s+.05)/(i+.05),void 0===(a=2)&&(a=0),void 0===r&&(r=Math.pow(10,a)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(o=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(a=n.level)?"AA":a)&&"normal"===o?7:"AA"===r&&"large"===o?3:4.5);var n,a,r,l,o}}]);const et=["background","backgroundColor","color","linkColor","buttonColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","textDecoration","padding","contentSize","wideSize","blockGap"];function tt(e){var t,n,a,r,l,o,i,s,u;if(!e)return et;const m=(0,c.getBlockType)(e);if(!m)return[];const d=[];return null==m||null===(t=m.supports)||void 0===t||null===(n=t.spacing)||void 0===n||!n.blockGap||!0===(null==m||null===(a=m.supports)||void 0===a||null===(r=a.spacing)||void 0===r?void 0:r.__experimentalSkipSerialization)||null!=m&&null!==(l=m.supports)&&void 0!==l&&null!==(o=l.spacing)&&void 0!==o&&null!==(i=o.__experimentalSkipSerialization)&&void 0!==i&&null!==(s=i.some)&&void 0!==s&&s.call(i,(e=>"blockGap"===e))||d.push("blockGap"),null!=m&&null!==(u=m.supports)&&void 0!==u&&u.shadow&&d.push("shadow"),Object.keys(c.__EXPERIMENTAL_STYLE_PROPERTY).forEach((e=>{if(c.__EXPERIMENTAL_STYLE_PROPERTY[e].support)return c.__EXPERIMENTAL_STYLE_PROPERTY[e].requiresOptOut&&c.__EXPERIMENTAL_STYLE_PROPERTY[e].support[0]in m.supports&&!1!==(0,ve.get)(m.supports,c.__EXPERIMENTAL_STYLE_PROPERTY[e].support)||(0,ve.get)(m.supports,c.__EXPERIMENTAL_STYLE_PROPERTY[e].support,!1)?d.push(e):void 0})),d}function nt(e){const[t]=Je("color.palette.custom",e),[n]=Je("color.palette.theme",e),[a]=Je("color.palette.default",e),[r]=Je("color.defaultPalette");return(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,E._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&a&&a.length&&e.push({name:(0,E._x)("Default","Indicates this palette comes from WordPress."),colors:a}),t&&t.length&&e.push({name:(0,E._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,a])}function at(e){const[t]=Je("color.gradients.custom",e),[n]=Je("color.gradients.theme",e),[a]=Je("color.gradients.default",e),[r]=Je("color.defaultGradients");return(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,E._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),r&&a&&a.length&&e.push({name:(0,E._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),t&&t.length&&e.push({name:(0,E._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,a])}const{GlobalStylesContext:rt}=Qe(fe.privateApis),lt={"color.background":"color","color.text":"color","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient","typography.fontSize":"font-size","typography.fontFamily":"font-family"},ot={"color.background":"backgroundColor","color.text":"textColor","color.gradient":"gradient","typography.fontSize":"fontSize","typography.fontFamily":"fontFamily"};function it(e){return e?JSON.parse(JSON.stringify(e)):{}}function st(e){let{name:t,attributes:n,setAttributes:a}=e;const r=(0,s.useMemo)((()=>function(e,t){return tt(e).flatMap((e=>{if(!c.__EXPERIMENTAL_STYLE_PROPERTY[e])return[];const{value:n}=c.__EXPERIMENTAL_STYLE_PROPERTY[e],a=n.join("."),r=t[ot[a]],l=r?`var:preset|${lt[a]}|${r}`:(0,ve.get)(t.style,n);return l?[{path:n,value:l}]:[]}))}(t,n)),[t,n]),{user:l,setUserConfig:o}=(0,s.useContext)(rt),{__unstableMarkNextChangeAsNotPersistent:i}=(0,m.useDispatch)(fe.store),{createSuccessNotice:u}=(0,m.useDispatch)(ye.store),d=(0,s.useCallback)((()=>{if(0===r.length)return;const{style:e}=n,s=it(e),m=it(l);for(const{path:e,value:n}of r)(0,ve.set)(s,e,void 0),(0,ve.set)(m,["styles","blocks",t,...e],n);i(),a({style:s}),o((()=>m),{undoIgnore:!0}),u((0,E.sprintf)((0,E.__)("%s styles applied."),(0,c.getBlockType)(t).title),{type:"snackbar",actions:[{label:(0,E.__)("Undo"),onClick(){i(),a({style:e}),o((()=>l),{undoIgnore:!0})}}]})}),[r,n,l,t]);return(0,s.createElement)(y.BaseControl,{className:"edit-site-push-changes-to-global-styles-control",help:(0,E.sprintf)((0,E.__)("Apply this block’s typography, spacing, dimensions, and color styles to all %s blocks."),(0,c.getBlockType)(t).title)},(0,s.createElement)(y.BaseControl.VisualLabel,null,(0,E.__)("Styles")),(0,s.createElement)(y.Button,{variant:"primary",disabled:0===r.length,onClick:d},(0,E.__)("Apply globally")))}const ct=(0,te.createHigherOrderComponent)((e=>t=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(fe.InspectorAdvancedControls,null,(0,s.createElement)(st,t)))));var ut;(0,he.addFilter)("editor.BlockEdit","core/edit-site/push-changes-to-global-styles",ct),function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(ut||(ut={}));var mt=function(e){return e};var dt="beforeunload",pt="popstate";function _t(e){e.preventDefault(),e.returnValue=""}function ht(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function gt(){return Math.random().toString(36).substr(2,8)}function vt(e){var t=e.pathname,n=void 0===t?"/":t,a=e.search,r=void 0===a?"":a,l=e.hash,o=void 0===l?"":l;return r&&"?"!==r&&(n+="?"===r.charAt(0)?r:"?"+r),o&&"#"!==o&&(n+="#"===o.charAt(0)?o:"#"+o),n}function ft(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var a=e.indexOf("?");a>=0&&(t.search=e.substr(a),e=e.substr(0,a)),e&&(t.pathname=e)}return t}var yt=window.wp.url;const Et=function(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,a=n.history;function r(){var e=n.location,t=e.pathname,r=e.search,l=e.hash,o=a.state||{};return[o.idx,mt({pathname:t,search:r,hash:l,state:o.usr||null,key:o.key||"default"})]}var l=null;n.addEventListener(pt,(function(){if(l)m.call(l),l=null;else{var e=ut.Pop,t=r(),n=t[0],a=t[1];if(m.length){if(null!=n){var o=s-n;o&&(l={action:e,location:a,retry:function(){f(-1*o)}},f(o))}}else v(e)}}));var o=ut.Pop,i=r(),s=i[0],c=i[1],u=ht(),m=ht();function d(e){return"string"==typeof e?e:vt(e)}function p(e,t){return void 0===t&&(t=null),mt(g({pathname:c.pathname,hash:"",search:""},"string"==typeof e?ft(e):e,{state:t,key:gt()}))}function _(e,t){return[{usr:e.state,key:e.key,idx:t},d(e)]}function h(e,t,n){return!m.length||(m.call({action:e,location:t,retry:n}),!1)}function v(e){o=e;var t=r();s=t[0],c=t[1],u.call({action:o,location:c})}function f(e){a.go(e)}null==s&&(s=0,a.replaceState(g({},a.state,{idx:s}),""));var y={get action(){return o},get location(){return c},createHref:d,push:function e(t,r){var l=ut.Push,o=p(t,r);if(h(l,o,(function(){e(t,r)}))){var i=_(o,s+1),c=i[0],u=i[1];try{a.pushState(c,"",u)}catch(e){n.location.assign(u)}v(l)}},replace:function e(t,n){var r=ut.Replace,l=p(t,n);if(h(r,l,(function(){e(t,n)}))){var o=_(l,s),i=o[0],c=o[1];a.replaceState(i,"",c),v(r)}},go:f,back:function(){f(-1)},forward:function(){f(1)},listen:function(e){return u.push(e)},block:function(e){var t=m.push(e);return 1===m.length&&n.addEventListener(dt,_t),function(){t(),m.length||n.removeEventListener(dt,_t)}}};return y}(),bt=Et.push,wt=Et.replace;Et.push=function(e,t){const n=(0,yt.getQueryArgs)(window.location.href),a=(0,yt.removeQueryArgs)(window.location.href,...Object.keys(n)),r=(0,yt.addQueryArgs)(a,e);return bt.call(Et,r,t)},Et.replace=function(e,t){const n=(0,yt.getQueryArgs)(window.location.href),a=(0,yt.removeQueryArgs)(window.location.href,...Object.keys(n)),r=(0,yt.addQueryArgs)(a,e);return wt.call(Et,r,t)};var St=Et;const xt=(0,s.createContext)(),kt=(0,s.createContext)();function Ct(){return(0,s.useContext)(xt)}function Tt(){return(0,s.useContext)(kt)}function Nt(e){const t=new URLSearchParams(e.search);return{...e,params:Object.fromEntries(t.entries())}}function Mt(e){let{children:t}=e;const[n,a]=(0,s.useState)((()=>Nt(St.location)));return(0,s.useEffect)((()=>St.listen((e=>{let{location:t}=e;a(Nt(t))}))),[]),(0,s.createElement)(kt.Provider,{value:St},(0,s.createElement)(xt.Provider,{value:n},t))}function It(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const a=Tt();function r(r){r.preventDefault(),n?a.replace(e,t):a.push(e,t)}const l=(0,yt.getQueryArgs)(window.location.href),o=(0,yt.removeQueryArgs)(window.location.href,...Object.keys(l)),i=(0,yt.addQueryArgs)(o,e);return{href:i,onClick:r}}function Pt(e){let{params:t={},state:n,replace:a=!1,children:r,...l}=e;const{href:o,onClick:i}=It(t,n,a);return(0,s.createElement)("a",g({href:o,onClick:i},l),r)}function Bt(e){let{attributes:t}=e;const{theme:n,slug:a}=t,{params:r}=Ct(),l=(0,m.useSelect)((e=>e(_.store).getEntityRecord("postType","wp_template_part",`${n}//${a}`)),[n,a]),o=It({postId:null==l?void 0:l.id,postType:null==l?void 0:l.type},{fromTemplateId:r.postId});return l?(0,s.createElement)(fe.BlockControls,{group:"other"},(0,s.createElement)(y.ToolbarButton,g({},o,{onClick:e=>{o.onClick(e)}}),(0,E.__)("Edit"))):null}const zt=(0,te.createHigherOrderComponent)((e=>t=>{const{attributes:n,name:a}=t,r="core/template-part"===a&&n.slug;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),r&&(0,s.createElement)(Bt,{attributes:n}))}),"withEditBlockControls");(0,he.addFilter)("editor.BlockEdit","core/edit-site/template-part-edit-button",zt);var Vt=(0,m.combineReducers)({deviceType:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Desktop",t=arguments.length>1?arguments[1]:void 0;return"SET_PREVIEW_DEVICE_TYPE"===t.type?t.deviceType:e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},editedPost:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_EDITED_POST":return{postType:t.postType,id:t.id,context:t.context};case"SET_EDITED_POST_CONTEXT":return{...e,context:t.context}}return e},blockInserterPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value;case"SET_CANVAS_MODE":return!1}return e},listViewPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen;case"SET_CANVAS_MODE":return!1}return e},saveViewPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_IS_SAVE_VIEW_OPENED":return t.isOpen;case"SET_CANVAS_MODE":return!1}return e},canvasMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"init",t=arguments.length>1?arguments[1]:void 0;return"SET_CANVAS_MODE"===t.type?t.mode:e}}),Rt=window.wp.apiFetch,At=n.n(Rt),Lt=window.wp.a11y;const Dt="core/edit-site";function Ot(e){return!!e&&("custom"===(null==e?void 0:e.source)&&(null==e?void 0:e.has_theme_file))}function Ft(e){return function(t){let{registry:n}=t;p()("select( 'core/edit-site' ).toggleFeature( featureName )",{since:"6.0",alternative:"select( 'core/preferences').toggle( 'core/edit-site', featureName )"}),n.dispatch(T.store).toggle("core/edit-site",e)}}function Gt(e){return{type:"SET_PREVIEW_DEVICE_TYPE",deviceType:e}}const Ht=(e,t)=>async n=>{let{dispatch:a,registry:r}=n;if(!t)try{const n=await r.resolveSelect(_.store).getEntityRecord("postType","wp_template",e);t=null==n?void 0:n.slug}catch(e){}a({type:"SET_EDITED_POST",postType:"wp_template",id:e,context:{templateSlug:t}})},$t=e=>async t=>{let{dispatch:n,registry:a}=t;const r=await a.dispatch(_.store).saveEntityRecord("postType","wp_template",e);e.content&&a.dispatch(_.store).editEntityRecord("postType","wp_template",r.id,{blocks:(0,c.parse)(e.content)},{undoIgnore:!0}),n({type:"SET_EDITED_POST",postType:"wp_template",id:r.id,context:{templateSlug:r.slug}})},Ut=e=>async t=>{let{registry:n}=t;try{await n.dispatch(_.store).deleteEntityRecord("postType",e.type,e.id,{force:!0});const t=n.select(_.store).getLastEntityDeleteError("postType",e.type,e.id);if(t)throw t;n.dispatch(ye.store).createSuccessNotice((0,E.sprintf)((0,E.__)('"%s" deleted.'),e.title.rendered),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while deleting the template.");n.dispatch(ye.store).createErrorNotice(t,{type:"snackbar"})}};function Wt(e){return{type:"SET_EDITED_POST",postType:"wp_template_part",id:e}}function jt(){return p()("dispatch( 'core/edit-site' ).setHomeTemplateId",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}function qt(e){return{type:"SET_EDITED_POST_CONTEXT",context:e}}const Yt=e=>async t=>{var n;let{dispatch:a,registry:r}=t;if(!e.path&&null!==(n=e.context)&&void 0!==n&&n.postId){const t=await r.resolveSelect(_.store).getEntityRecord("postType",e.context.postType||"post",e.context.postId);e.path=(0,yt.getPathAndQueryString)(null==t?void 0:t.link)}const l=await r.resolveSelect(_.store).__experimentalGetTemplateForLink(e.path);if(l)return a({type:"SET_EDITED_POST",postType:"wp_template",id:l.id,context:{...e.context,templateSlug:l.slug}}),l.id};function Xt(){return p()("dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}function Zt(){return p()("dispatch( 'core/edit-site' ).openNavigationPanelToMenu",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}function Kt(){return p()("dispatch( 'core/edit-site' ).setIsNavigationPanelOpened",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}function Qt(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function Jt(e){return{type:"UPDATE_SETTINGS",settings:e}}function en(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}function tn(e){return{type:"SET_IS_SAVE_VIEW_OPENED",isOpen:e}}const nn=function(e){let{allowUndo:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async n=>{let{registry:a}=n;if(Ot(e))try{var r;const n=a.select(_.store).getEntityConfig("postType",e.type);if(!n)return void a.dispatch(ye.store).createErrorNotice((0,E.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const l=(0,yt.addQueryArgs)(`${n.baseURL}/${e.id}`,{context:"edit",source:"theme"}),o=await At()({path:l});if(!o)return void a.dispatch(ye.store).createErrorNotice((0,E.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const i=e=>{let{blocks:t=[]}=e;return(0,c.__unstableSerializeAndClean)(t)},s=a.select(_.store).getEditedEntityRecord("postType",e.type,e.id);a.dispatch(_.store).editEntityRecord("postType",e.type,e.id,{content:i,blocks:s.blocks,source:"custom"},{undoIgnore:!0});const u=(0,c.parse)(null==o||null===(r=o.content)||void 0===r?void 0:r.raw);if(a.dispatch(_.store).editEntityRecord("postType",e.type,o.id,{content:i,blocks:u,source:"theme"}),t){const t=()=>{a.dispatch(_.store).editEntityRecord("postType",e.type,s.id,{content:i,blocks:s.blocks,source:"custom"})};a.dispatch(ye.store).createSuccessNotice((0,E.__)("Template reverted."),{type:"snackbar",actions:[{label:(0,E.__)("Undo"),onClick:t}]})}else a.dispatch(ye.store).createSuccessNotice((0,E.__)("Template reverted."))}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("Template revert failed. Please reload.");a.dispatch(ye.store).createErrorNotice(t,{type:"snackbar"})}else a.dispatch(ye.store).createErrorNotice((0,E.__)("This template is not revertable."),{type:"snackbar"})}},an=e=>t=>{let{registry:n}=t;n.dispatch(F).enableComplementaryArea(Dt,e)},rn=()=>e=>{let{registry:t}=e;t.dispatch(F).disableComplementaryArea(Dt)},ln=e=>t=>{let{registry:n}=t;n.dispatch("core/preferences").set("core/edit-site","editorMode",e),"visual"!==e&&n.dispatch(fe.store).clearSelectedBlock(),"visual"===e?(0,Lt.speak)((0,E.__)("Visual editor selected"),"assertive"):"mosaic"===e&&(0,Lt.speak)((0,E.__)("Mosaic view selected"),"assertive")},on=e=>t=>{let{registry:n,dispatch:a}=t;n.dispatch(fe.store).__unstableSetEditorMode("edit"),a({type:"SET_CANVAS_MODE",mode:e}),"edit"===e&&n.select(T.store).get("core/edit-site","showListViewByDefault")&&a.setIsListViewOpened(!0)};var sn={};function cn(e){return[e]}function un(e,t,n){var a;if(e.length!==t.length)return!1;for(a=n;a0&&void 0!==arguments[0]?arguments[0]:dn,t=arguments.length>1?arguments[1]:void 0;const n=t?t.reduce(((e,t)=>({...e,[t.id]:t})),{}):{},a=[],r=[...e];for(;r.length;){const{innerBlocks:e,...t}=r.shift();if(r.unshift(...e),(0,c.isTemplatePart)(t)){const{attributes:{theme:e,slug:r}}=t,l=n[`${e}//${r}`];l&&a.push({templatePart:l,block:t})}}return a})),_n=(0,m.createRegistrySelector)((e=>(t,n)=>e(T.store).get("core/edit-site",n)));function hn(e,t){return p()("select( 'core/interface' ).isFeatureActive",{since:"6.0",alternative:"select( 'core/preferences' ).get"}),!!_n(e,t)}function gn(e){return e.deviceType}const vn=(0,m.createRegistrySelector)((e=>()=>e(_.store).canUser("create","media"))),fn=(0,m.createRegistrySelector)((e=>()=>"web"===s.Platform.OS?e(_.store).getEntityRecords("postType","wp_block",{per_page:-1}):[])),yn=function(e,t){var n,a=t||cn;function r(e){var t,a,r,l,o,i=n,s=!0;for(t=0;t{const n={...e.settings,outlineMode:!0,focusMode:!!_n(e,"focusMode"),hasFixedToolbar:!!_n(e,"fixedToolbar"),keepCaretInsideBlock:!!_n(e,"keepCaretInsideBlock"),showIconLabels:!!_n(e,"showIconLabels"),__experimentalSetIsInserterOpened:t,__experimentalReusableBlocks:fn(e),__experimentalPreferPatternsOnRoot:"wp_template"===bn(e)};return vn(e)?(n.mediaUpload=t=>{let{onError:n,...a}=t;(0,ge.uploadMedia)({wpAllowedMimeTypes:e.settings.allowedMimeTypes,onError:e=>{let{message:t}=e;return n(t)},...a})},n):n}),(e=>[vn(e),e.settings,_n(e,"focusMode"),_n(e,"fixedToolbar"),_n(e,"keepCaretInsideBlock"),_n(e,"showIconLabels"),fn(e),bn(e)]));function En(){p()("select( 'core/edit-site' ).getHomeTemplateId",{since:"6.2",version:"6.4"})}function bn(e){return e.editedPost.postType}function wn(e){return e.editedPost.id}function Sn(e){return e.editedPost.context}function xn(e){return{context:e.editedPost.context}}function kn(e){return!!e.blockInserterPanel}function Cn(e){const{rootClientId:t,insertionIndex:n,filterValue:a}=e.blockInserterPanel;return{rootClientId:t,insertionIndex:n,filterValue:a}}function Tn(e){return e.listViewPanel}function Nn(e){return e.saveViewPanel}const Mn=(0,m.createRegistrySelector)((e=>t=>{const n=bn(t),a=wn(t),r=e(_.store).getEditedEntityRecord("postType",n,a),l=e(_.store).getEntityRecords("postType","wp_template_part",{per_page:-1});return pn(r.blocks,l)}));function In(e){return _n(e,"editorMode")}function Pn(){p()("dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu",{since:"6.2",version:"6.4"})}function Bn(){p()("dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu",{since:"6.2",version:"6.4"})}function zn(){p()("dispatch( 'core/edit-site' ).isNavigationOpened",{since:"6.2",version:"6.4"})}function Vn(e){return e.canvasMode}const Rn={reducer:Vt,actions:r,selectors:o},An=(0,m.createReduxStore)(Dt,Rn);(0,m.register)(An),Qe(An).registerPrivateSelectors(i),Qe(An).registerPrivateActions(l);var Ln=window.wp.keyboardShortcuts;(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"}));var Dn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));var On=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"}));function Fn(e){return(0,s.createElement)(y.Button,g({},e,{className:f()("edit-site-sidebar-button",e.className)}))}function Gn(e){let{isRoot:t,title:n,actions:a,content:r,description:l}=e;const{dashboardLink:o}=(0,m.useSelect)((e=>{const{getSettings:t}=Qe(e(An));return{dashboardLink:t().__experimentalDashboardLink}}),[]);return(0,s.createElement)(y.__experimentalVStack,{spacing:2},(0,s.createElement)(y.__experimentalHStack,{spacing:4,justify:"flex-start",className:"edit-site-sidebar-navigation-screen__title-icon"},t?(0,s.createElement)(Fn,{icon:(0,E.isRTL)()?ce:se,"aria-label":(0,E.__)("Navigate to the Dashboard"),href:o||"index.php",label:(0,E.__)("Dashboard")}):(0,s.createElement)(y.__experimentalNavigatorToParentButton,{as:Fn,icon:(0,E.isRTL)()?ce:se,"aria-label":(0,E.__)("Back")}),(0,s.createElement)("h2",{className:"edit-site-sidebar-navigation-screen__title"},n),a),(0,s.createElement)("nav",{className:"edit-site-sidebar-navigation-screen__content"},l&&(0,s.createElement)("p",{className:"edit-site-sidebar-navigation-screen__description"},l),r))}function Hn(e){let{className:t,icon:n,withChevron:a=!1,children:r,...l}=e;return(0,s.createElement)(y.__experimentalItem,g({className:f()("edit-site-sidebar-navigation-item",t)},l),n&&(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(ie,{style:{fill:"currentcolor"},icon:n,size:24}),(0,s.createElement)(y.FlexBlock,null,r),a&&(0,s.createElement)(ie,{style:{fill:"currentcolor"},icon:ce,size:24})),!n&&r)}function $n(){const{navigationMenus:e}=(0,m.useSelect)((e=>{const{getEntityRecords:t}=e(_.store);return{navigationMenus:t("postType","wp_navigation",{per_page:-1,status:"publish"})}}));return(0,s.createElement)(Gn,{isRoot:!0,title:(0,E.__)("Design"),description:(0,E.__)("Customize the appearance of your website using the block editor."),content:(0,s.createElement)(y.__experimentalItemGroup,null,false,(0,s.createElement)(y.__experimentalNavigatorButton,{as:Hn,path:"/wp_template",withChevron:!0,icon:Dn},(0,E.__)("Templates")),(0,s.createElement)(y.__experimentalNavigatorButton,{as:Hn,path:"/wp_template_part",withChevron:!0,icon:On},(0,E.__)("Template Parts")))})}var Un=window.wp.htmlEntities;var Wn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"}));var jn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"}));var qn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"}));var Yn=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5zM8 12.8h8v-1.5H8v1.5zm0 3h8v-1.5H8v1.5z"}));var Xn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));var Zn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm.5 12c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v10zm-11-7.6h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-.9 3.5H6.3l1.2-1.7v1.7zm5.6-3.2c-.4-.2-.8-.4-1.2-.4-.5 0-.9.1-1.2.4-.4.2-.6.6-.8 1-.2.4-.3.9-.3 1.5s.1 1.1.3 1.6c.2.4.5.8.8 1 .4.2.8.4 1.2.4.5 0 .9-.1 1.2-.4.4-.2.6-.6.8-1 .2-.4.3-1 .3-1.6 0-.6-.1-1.1-.3-1.5-.1-.5-.4-.8-.8-1zm0 3.6c-.1.3-.3.5-.5.7-.2.1-.4.2-.7.2-.3 0-.5-.1-.7-.2-.2-.1-.4-.4-.5-.7-.1-.3-.2-.7-.2-1.2 0-.7.1-1.2.4-1.5.3-.3.6-.5 1-.5s.7.2 1 .5c.3.3.4.8.4 1.5-.1.5-.1.9-.2 1.2zm5-3.9h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-1 3.5H16l1.2-1.7v1.7z"}));var Kn=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"}));var Qn=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"}));var Jn=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z",fillRule:"evenodd",clipRule:"evenodd"}));var ea=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{fillRule:"evenodd",d:"M8.95 11.25H4v1.5h4.95v4.5H13V18c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75h-2.55v-7.5H13V9c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75H8.95v4.5ZM14.5 15v3c0 .3.2.5.5.5h3c.3 0 .5-.2.5-.5v-3c0-.3-.2-.5-.5-.5h-3c-.3 0-.5.2-.5.5Zm0-6V6c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5Z",clipRule:"evenodd"}));var ta=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z"}),(0,s.createElement)(b.Path,{d:"M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"}));var na=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"}));var aa=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"}));var ra=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));function la(){const e="edit-site-template-actions-loading-screen-modal";return(0,s.createElement)(y.Modal,{isFullScreen:!0,isDismissible:!1,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,onRequestClose:()=>{},__experimentalHideHeader:!0,className:e},(0,s.createElement)("div",{className:`${e}__content`},(0,s.createElement)(y.Spinner,null)))}const oa=()=>(0,m.useSelect)((e=>e(_.store).getEntityRecords("postType","wp_template",{per_page:-1})),[]),ia=()=>(0,m.useSelect)((e=>e(h.store).__experimentalGetDefaultTemplateTypes()),[]),sa=()=>{const e=(0,m.useSelect)((e=>e(_.store).getPostTypes({per_page:-1})),[]);return(0,s.useMemo)((()=>{const t=["attachment"];return null==e?void 0:e.filter((e=>{let{viewable:n,slug:a}=e;return n&&!t.includes(a)}))}),[e])};function ca(e){const t=(0,s.useMemo)((()=>null==e?void 0:e.reduce(((e,t)=>{let{labels:n}=t;const a=n.singular_name.toLowerCase();return e[a]=(e[a]||0)+1,e}),{})));return(0,s.useCallback)((e=>{let{labels:n,slug:a}=e;const r=n.singular_name.toLowerCase();return t[r]>1&&r!==a}),[t])}function ua(){const e=sa(),t=(0,s.useMemo)((()=>null==e?void 0:e.filter((e=>e.has_archive))),[e]),n=oa(),a=ca(t);return(0,s.useMemo)((()=>(null==t?void 0:t.filter((e=>!(n||[]).some((t=>t.slug==="archive-"+e.slug)))).map((e=>{var t;let n;return n=a(e)?(0,E.sprintf)((0,E.__)("Archive: %1$s (%2$s)"),e.labels.singular_name,e.slug):(0,E.sprintf)((0,E.__)("Archive: %s"),e.labels.singular_name),{slug:"archive-"+e.slug,description:(0,E.sprintf)((0,E.__)("Displays an archive with the latests posts of type: %s."),e.labels.singular_name),title:n,icon:null!==(t=e.icon)&&void 0!==t&&t.startsWith("dashicons-")?e.icon.slice(10):Yn,templatePrefix:"archive"}})))||[]),[t,n,a])}const ma=e=>{const t=(()=>{const e=(0,m.useSelect)((e=>e(_.store).getTaxonomies({per_page:-1})),[]);return(0,s.useMemo)((()=>null==e?void 0:e.filter((e=>{let{visibility:t}=e;return null==t?void 0:t.publicly_queryable}))),[e])})(),n=oa(),a=ia(),r=(0,s.useMemo)((()=>null==t?void 0:t.reduce(((e,t)=>{let{slug:n}=t,a=n;return["category","post_tag"].includes(n)||(a=`taxonomy-${a}`),"post_tag"===n&&(a="tag"),e[n]=a,e}),{})),[t]),l=null==t?void 0:t.reduce(((e,t)=>{let{labels:n}=t;const a=n.singular_name.toLowerCase();return e[a]=(e[a]||0)+1,e}),{}),o=ga("taxonomy",r),i=(n||[]).map((e=>{let{slug:t}=e;return t})),c=(t||[]).reduce(((t,n)=>{var s;const{slug:c,labels:u}=n,m=r[c],d=null==a?void 0:a.find((e=>{let{slug:t}=e;return t===m})),p=null==i?void 0:i.includes(m),_=((e,t)=>{if(["category","post_tag"].includes(t))return!1;const n=e.singular_name.toLowerCase();return l[n]>1&&n!==t})(u,c);let h=u.singular_name;_&&(h=(0,E.sprintf)((0,E.__)("%1$s (%2$s)"),u.singular_name,c));const g=d?{...d,templatePrefix:r[c]}:{slug:m,title:h,description:(0,E.sprintf)((0,E.__)("Displays taxonomy: %s."),u.singular_name),icon:ea,templatePrefix:r[c]},v=null==o||null===(s=o[c])||void 0===s?void 0:s.hasEntities;return v&&(g.onClick=t=>{e({type:"taxonomy",slug:c,config:{queryArgs:e=>{let{search:t}=e;return{_fields:"id,name,slug,link",orderBy:t?"name":"count",exclude:o[c].existingEntitiesIds}},getSpecificTemplate:e=>{const t=`${r[c]}-${e.slug}`;return{title:t,slug:t,templatePrefix:r[c]}}},labels:u,hasGeneralTemplate:p,template:t})}),p&&!v||t.push(g),t}),[]);return(0,s.useMemo)((()=>c.reduce(((e,t)=>{const{slug:n}=t;let a="taxonomiesMenuItems";return["category","tag"].includes(n)&&(a="defaultTaxonomiesMenuItems"),e[a].push(t),e}),{defaultTaxonomiesMenuItems:[],taxonomiesMenuItems:[]})),[c])},da={user:"author"},pa={user:{who:"authors"}};const _a=e=>{const t=oa();return(0,s.useMemo)((()=>Object.entries(e||{}).reduce(((e,n)=>{let[a,r]=n;const l=(t||[]).reduce(((e,t)=>{const n=`${r}-`;return t.slug.startsWith(n)&&e.push(t.slug.substring(n.length)),e}),[]);return l.length&&(e[a]=l),e}),{})),[e,t])},ha=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=_a(t),r=(0,m.useSelect)((t=>Object.entries(a||{}).reduce(((a,r)=>{let[l,o]=r;const i=t(_.store).getEntityRecords(e,l,{_fields:"id",context:"view",slug:o,...n[l]});return null!=i&&i.length&&(a[l]=i),a}),{})),[a]);return r},ga=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=ha(e,t,n),r=(0,m.useSelect)((r=>Object.keys(t||{}).reduce(((t,l)=>{var o,i;const s=(null==a||null===(o=a[l])||void 0===o?void 0:o.map((e=>{let{id:t}=e;return t})))||[];return t[l]={hasEntities:!(null===(i=r(_.store).getEntityRecords(e,l,{per_page:1,_fields:"id",context:"view",exclude:s,...n[l]}))||void 0===i||!i.length),existingEntitiesIds:s},t}),{})),[t,a]);return r},va=[];function fa(e){let{suggestion:t,search:n,onSelect:a,entityForSuggestions:r,composite:l}=e;const o="edit-site-custom-template-modal__suggestions_list__list-item";return(0,s.createElement)(y.__unstableCompositeItem,g({role:"option",as:y.Button},l,{className:o,onClick:()=>a(r.config.getSpecificTemplate(t))}),(0,s.createElement)("span",{className:`${o}__title`},(0,s.createElement)(y.TextHighlight,{text:(0,Un.decodeEntities)(t.name),highlight:n})),t.link&&(0,s.createElement)("span",{className:`${o}__info`},t.link))}function ya(e,t){const{config:n}=e,a=(0,s.useMemo)((()=>({order:"asc",context:"view",search:t,per_page:t?20:10,...n.queryArgs(t)})),[t,n]),{records:r,hasResolved:l}=(0,_.useEntityRecords)(e.type,e.slug,a),[o,i]=(0,s.useState)(va);return(0,s.useEffect)((()=>{if(!l)return;let e=va;var t,a;null!=r&&r.length&&(e=r,n.recordNamePath&&(t=e,a=n.recordNamePath,e=(t||[]).map((e=>({...e,name:(0,Un.decodeEntities)((0,ve.get)(e,a))}))))),i(e)}),[r,l]),o}function Ea(e){let{entityForSuggestions:t,onSelect:n}=e;const a=(0,y.__unstableUseCompositeState)({orientation:"vertical"}),[r,l,o]=function(){const[e,t]=(0,s.useState)(""),[n,a]=(0,s.useState)(""),r=(0,te.useDebounce)(a,250);return(0,s.useEffect)((()=>{n!==e&&r(e)}),[n,e]),[e,t,n]}(),i=ya(t,o),{labels:c}=t,[u,m]=(0,s.useState)(!1);return!u&&(null==i?void 0:i.length)>9&&m(!0),(0,s.createElement)(s.Fragment,null,u&&(0,s.createElement)(y.SearchControl,{__nextHasNoMarginBottom:!0,onChange:l,value:r,label:c.search_items,placeholder:c.search_items}),!(null==i||!i.length)&&(0,s.createElement)(y.__unstableComposite,g({},a,{role:"listbox",className:"edit-site-custom-template-modal__suggestions_list","aria-label":(0,E.__)("Suggestions list")}),i.map((e=>(0,s.createElement)(fa,{key:e.slug,suggestion:e,search:o,onSelect:n,entityForSuggestions:t,composite:a})))),o&&!(null!=i&&i.length)&&(0,s.createElement)(y.__experimentalText,{as:"p",className:"edit-site-custom-template-modal__no-results"},c.not_found))}var ba=function(e){let{onClose:t,onSelect:n,entityForSuggestions:a,isCreatingTemplate:r}=e;const[l,o]=(0,s.useState)(a.hasGeneralTemplate),i="edit-site-custom-template-modal";return(0,s.createElement)(y.Modal,{title:(0,E.sprintf)((0,E.__)("Add template: %s"),a.labels.singular_name),className:i,onRequestClose:t},r&&(0,s.createElement)(la,null),!l&&(0,s.createElement)(y.__experimentalVStack,{spacing:4},(0,s.createElement)(y.__experimentalText,{as:"p"},(0,E.__)("Select whether to create a single template for all items or a specific one.")),(0,s.createElement)(y.Flex,{className:`${i}__contents`,gap:"4",align:"initial"},(0,s.createElement)(y.FlexItem,{isBlock:!0,as:y.Button,onClick:()=>{const{slug:e,title:t,description:r,templatePrefix:l}=a.template;n({slug:e,title:t,description:r,templatePrefix:l})}},(0,s.createElement)(y.__experimentalText,{as:"span",weight:600},a.labels.all_items),(0,s.createElement)(y.__experimentalText,{as:"span"},(0,E.__)("For all items"))),(0,s.createElement)(y.FlexItem,{isBlock:!0,as:y.Button,onClick:()=>{o(!0)}},(0,s.createElement)(y.__experimentalText,{as:"span",weight:600},a.labels.singular_name),(0,s.createElement)(y.__experimentalText,{as:"span"},(0,E.__)("For a specific item"))))),l&&(0,s.createElement)(y.__experimentalVStack,{spacing:4},(0,s.createElement)(y.__experimentalText,{as:"p"},(0,E.__)("This template will be used only for the specific item chosen.")),(0,s.createElement)(Ea,{entityForSuggestions:a,onSelect:n})))};var wa=function(e){let{onClose:t,createTemplate:n,isCreatingTemplate:a}=e;const[r,l]=(0,s.useState)(""),o=(0,E.__)("Custom Template"),[i,c]=(0,s.useState)(!1);return(0,s.createElement)(y.Modal,{title:(0,E.__)("Create custom template"),onRequestClose:()=>{t()},overlayClassName:"edit-site-custom-generic-template__modal"},a&&(0,s.createElement)(la,null),(0,s.createElement)("form",{onSubmit:async function(e){if(e.preventDefault(),!i){c(!0);try{await n({slug:"wp-custom-template-"+(0,ve.kebabCase)(r||o),title:r||o},!1)}finally{c(!1)}}}},(0,s.createElement)(y.__experimentalVStack,{spacing:6},(0,s.createElement)(y.TextControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Name"),value:r,onChange:l,placeholder:o,disabled:i,help:(0,E.__)('Describe the template, e.g. "Post with sidebar".')}),(0,s.createElement)(y.__experimentalHStack,{className:"edit-site-custom-generic-template__modal-actions",justify:"right"},(0,s.createElement)(y.Button,{variant:"tertiary",onClick:()=>{t()}},(0,E.__)("Cancel")),(0,s.createElement)(y.Button,{variant:"primary",type:"submit",isBusy:i,"aria-disabled":i},(0,E.__)("Create"))))))};const Sa=["front-page","single","page","index","archive","author","category","date","tag","taxonomy","search","404"],xa={"front-page":Wn,single:jn,page:qn,archive:Yn,search:Xn,404:Zn,index:Kn,category:Qn,author:Jn,taxonomy:ea,date:ta,tag:na,attachment:aa};function ka(e){let{postType:t,toggleProps:n,showIcon:a=!0}=e;const[r,l]=(0,s.useState)(!1),[o,i]=(0,s.useState)(!1),[c,u]=(0,s.useState)({}),[d,p]=(0,s.useState)(!1),h=Tt(),{saveEntityRecord:g}=(0,m.useDispatch)(_.store),{createErrorNotice:v,createSuccessNotice:f}=(0,m.useDispatch)(ye.store),{setTemplate:b}=Qe((0,m.useDispatch)(An));async function w(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!d){p(!0);try{const{title:n,description:a,slug:r,templatePrefix:l}=e;let o=e.content;if(!o){o=(await At()({path:(0,yt.addQueryArgs)("/wp/v2/templates/lookup",{slug:r,is_custom:!t,template_prefix:l})})).content.raw}const i=await g("postType","wp_template",{description:a,slug:r.toString(),status:"publish",title:n,content:o,is_wp_suggestion:t},{throwOnError:!0});b(i.id,i.slug),h.push({postId:i.id,postType:i.type,canvas:"edit"}),f((0,E.sprintf)((0,E.__)('"%s" successfully created.'),n),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while creating the template.");v(t,{type:"snackbar"})}finally{p(!1)}}}const S=function(e,t){const n=oa(),a=ia(),r=(n||[]).map((e=>{let{slug:t}=e;return t})),l=(a||[]).filter((e=>Sa.includes(e.slug)&&!r.includes(e.slug))),o=n=>{t(!0),e(n)},i=[...l],{defaultTaxonomiesMenuItems:c,taxonomiesMenuItems:u}=ma(o),{defaultPostTypesMenuItems:m,postTypesMenuItems:d}=(e=>{const t=sa(),n=oa(),a=ia(),r=ca(t),l=(0,s.useMemo)((()=>null==t?void 0:t.reduce(((e,t)=>{let{slug:n}=t,a=n;return"page"!==n&&(a=`single-${a}`),e[n]=a,e}),{})),[t]),o=ga("postType",l),i=(n||[]).map((e=>{let{slug:t}=e;return t})),c=(t||[]).reduce(((t,n)=>{var s;const{slug:c,labels:u,icon:m}=n,d=l[c],p=null==a?void 0:a.find((e=>{let{slug:t}=e;return t===d})),_=null==i?void 0:i.includes(d),h=r(n);let g=(0,E.sprintf)((0,E.__)("Single item: %s"),u.singular_name);h&&(g=(0,E.sprintf)((0,E.__)("Single item: %1$s (%2$s)"),u.singular_name,c));const v=p?{...p,templatePrefix:l[c]}:{slug:d,title:g,description:(0,E.sprintf)((0,E.__)("Displays a single item: %s."),u.singular_name),icon:null!=m&&m.startsWith("dashicons-")?m.slice(10):jn,templatePrefix:l[c]},f=null==o||null===(s=o[c])||void 0===s?void 0:s.hasEntities;return f&&(v.onClick=t=>{e({type:"postType",slug:c,config:{recordNamePath:"title.rendered",queryArgs:e=>{let{search:t}=e;return{_fields:"id,title,slug,link",orderBy:t?"relevance":"modified",exclude:o[c].existingEntitiesIds}},getSpecificTemplate:e=>{const t=`${l[c]}-${e.slug}`;return{title:t,slug:t,templatePrefix:l[c]}}},labels:u,hasGeneralTemplate:_,template:t})}),_&&!f||t.push(v),t}),[]);return(0,s.useMemo)((()=>c.reduce(((e,t)=>{const{slug:n}=t;let a="postTypesMenuItems";return"page"===n&&(a="defaultPostTypesMenuItems"),e[a].push(t),e}),{defaultPostTypesMenuItems:[],postTypesMenuItems:[]})),[c])})(o),p=function(e){var t,n;const a=oa(),r=ia(),l=ga("root",da,pa);let o=null==r?void 0:r.find((e=>{let{slug:t}=e;return"author"===t}));o||(o={description:(0,E.__)("Displays latest posts written by a single author."),slug:"author",title:"Author"});const i=!(null==a||!a.find((e=>{let{slug:t}=e;return"author"===t})));if(null!==(t=l.user)&&void 0!==t&&t.hasEntities&&(o={...o,templatePrefix:"author"},o.onClick=t=>{e({type:"root",slug:"user",config:{queryArgs:e=>{let{search:t}=e;return{_fields:"id,name,slug,link",orderBy:t?"name":"registered_date",exclude:l.user.existingEntitiesIds,who:"authors"}},getSpecificTemplate:e=>{const t=`author-${e.slug}`;return{title:t,slug:t,templatePrefix:"author"}}},labels:{singular_name:(0,E.__)("Author"),search_items:(0,E.__)("Search Authors"),not_found:(0,E.__)("No authors found."),all_items:(0,E.__)("All Authors")},hasGeneralTemplate:i,template:t})}),!i||null!==(n=l.user)&&void 0!==n&&n.hasEntities)return o}(o);[...c,...m,p].forEach((e=>{if(!e)return;const t=i.findIndex((t=>t.slug===e.slug));t>-1?i[t]=e:i.push(e)})),null==i||i.sort(((e,t)=>Sa.indexOf(e.slug)-Sa.indexOf(t.slug)));return[...i,...ua(),...d,...u]}(u,l);if(!S.length)return null;const x=(0,E.__)("A custom template can be manually applied to any post or page.");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.DropdownMenu,{className:"edit-site-new-template-dropdown",icon:a?ra:null,text:a?null:t.labels.add_new,label:t.labels.add_new_item,popoverProps:{noArrow:!1},toggleProps:n},(()=>(0,s.createElement)(s.Fragment,null,d&&(0,s.createElement)(la,null),(0,s.createElement)("div",{className:"edit-site-new-template-dropdown__menu-groups"},(0,s.createElement)(y.MenuGroup,{label:t.labels.add_new_item},S.map((e=>{const{title:t,description:n,slug:a,onClick:r,icon:l}=e;return(0,s.createElement)(y.Tooltip,{key:a,position:"top right",text:n,className:"edit-site-new-template-dropdown__menu-item-tooltip"},(0,s.createElement)(y.MenuItem,{icon:l||xa[a]||jn,iconPosition:"left",onClick:()=>r?r(e):w(e)},t,(0,s.createElement)(y.VisuallyHidden,null,n)))}))),(0,s.createElement)(y.MenuGroup,null,(0,s.createElement)(y.Tooltip,{position:"top right",text:x,className:"edit-site-new-template-dropdown__menu-item-tooltip"},(0,s.createElement)(y.MenuItem,{icon:Dn,iconPosition:"left",onClick:()=>i(!0)},(0,E.__)("Custom template"),(0,s.createElement)(y.VisuallyHidden,null,x)))))))),r&&(0,s.createElement)(ba,{onClose:()=>l(!1),onSelect:w,entityForSuggestions:c,isCreatingTemplate:d}),o&&(0,s.createElement)(wa,{onClose:()=>i(!1),createTemplate:w,isCreatingTemplate:d}))}function Ca(e){let{closeModal:t,onCreate:n}=e;const[a,r]=(0,s.useState)(""),[l,o]=(0,s.useState)("uncategorized"),[i,c]=(0,s.useState)(!1),u=(0,te.useInstanceId)(Ca),d=(0,m.useSelect)((e=>e(h.store).__experimentalGetDefaultTemplatePartAreas()),[]);return(0,s.createElement)(y.Modal,{title:(0,E.__)("Create a template part"),onRequestClose:t,overlayClassName:"edit-site-create-template-part-modal"},(0,s.createElement)("form",{onSubmit:async e=>{e.preventDefault(),a&&(c(!0),await n({title:a,area:l}))}},(0,s.createElement)(y.__experimentalVStack,{spacing:"4"},(0,s.createElement)(y.TextControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Name"),value:a,onChange:r,required:!0}),(0,s.createElement)(y.BaseControl,{label:(0,E.__)("Area"),id:`edit-site-create-template-part-modal__area-selection-${u}`,className:"edit-site-create-template-part-modal__area-base-control"},(0,s.createElement)(y.__experimentalRadioGroup,{label:(0,E.__)("Area"),className:"edit-site-create-template-part-modal__area-radio-group",id:`edit-site-create-template-part-modal__area-selection-${u}`,onChange:o,checked:l},d.map((e=>{let{icon:t,label:n,area:a,description:r}=e;return(0,s.createElement)(y.__experimentalRadio,{key:n,value:a,className:"edit-site-create-template-part-modal__area-radio"},(0,s.createElement)(y.Flex,{align:"start",justify:"start"},(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(y.Icon,{icon:t})),(0,s.createElement)(y.FlexBlock,{className:"edit-site-create-template-part-modal__option-label"},n,(0,s.createElement)("div",null,r)),(0,s.createElement)(y.FlexItem,{className:"edit-site-create-template-part-modal__checkbox"},l===a&&(0,s.createElement)(y.Icon,{icon:w}))))})))),(0,s.createElement)(y.Flex,{className:"edit-site-create-template-part-modal__modal-actions",justify:"flex-end"},(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(y.Button,{variant:"secondary",onClick:()=>{t()}},(0,E.__)("Cancel"))),(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(y.Button,{variant:"primary",type:"submit",disabled:!a,isBusy:i},(0,E.__)("Create")))))))}const Ta=()=>(0,m.useSelect)((e=>e(_.store).getEntityRecords("postType","wp_template_part",{per_page:-1})),[]),Na=(e,t)=>{const n=e.toLowerCase(),a=t.map((e=>e.title.rendered.toLowerCase()));if(!a.includes(n))return e;let r=2;for(;a.includes(`${n} ${r}`);)r++;return`${e} ${r}`},Ma=e=>(0,ve.kebabCase)(e).replace(/[^\w-]+/g,"")||"wp-custom-part";function Ia(e){let{postType:t,showIcon:n=!0,toggleProps:a}=e;const r=Tt(),[l,o]=(0,s.useState)(!1),{createErrorNotice:i}=(0,m.useDispatch)(ye.store),{saveEntityRecord:c}=(0,m.useDispatch)(_.store),u=Ta();const{as:d=y.Button,...p}=null!=a?a:{};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(d,g({},p,{onClick:()=>{o(!0)},icon:n?ra:null,label:t.labels.add_new}),n?null:t.labels.add_new),l&&(0,s.createElement)(Ca,{closeModal:()=>o(!1),onCreate:async function(e){let{title:t,area:n}=e;if(t)try{const e=Na(t,u),a=Ma(e),l=await c("postType","wp_template_part",{slug:a,title:e,content:"",area:n},{throwOnError:!0});o(!1),r.push({postId:l.id,postType:"wp_template_part",canvas:"edit"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while creating the template part.");i(t,{type:"snackbar"}),o(!1)}else i((0,E.__)("Title is not defined."),{type:"snackbar"})}}))}function Pa(e){let{templateType:t="wp_template",...n}=e;const a=(0,m.useSelect)((e=>e(_.store).getPostType(t)),[t]);return a?"wp_template"===t?(0,s.createElement)(ka,g({},n,{postType:a})):"wp_template_part"===t?(0,s.createElement)(Ia,g({},n,{postType:a})):null:null}const Ba={wp_template:{labels:{title:(0,E.__)("Templates"),loading:(0,E.__)("Loading templates"),notFound:(0,E.__)("No templates found"),manage:(0,E.__)("Manage all templates"),description:(0,E.__)("Express the layout of your site with templates.")}},wp_template_part:{labels:{title:(0,E.__)("Template parts"),loading:(0,E.__)("Loading template parts"),notFound:(0,E.__)("No template parts found"),manage:(0,E.__)("Manage all template parts"),description:(0,E.__)("Template Parts are small pieces of a layout that can be reused across multiple templates and always appear the same way. Common template parts include the site header, footer, or sidebar.")}}},za=e=>{let{postType:t,postId:n,...a}=e;const r=It({postType:t,postId:n});return(0,s.createElement)(Hn,g({},r,a))};function Va(){const{params:{postType:e}}=(0,y.__experimentalUseNavigator)(),t=(0,te.useViewportMatch)("medium","<"),n=(0,m.useSelect)((e=>!!e(An).getSettings().supportsTemplatePartsMode),[]),{records:a,isResolving:r}=(0,_.useEntityRecords)("postType",e,{per_page:-1}),l=a?[...a]:[];l.sort(((e,t)=>e.slug.localeCompare(t.slug)));const o=It({path:"/"+e+"/all"}),i=!t&&!n;return(0,s.createElement)(Gn,{isRoot:n,title:Ba[e].labels.title,description:Ba[e].labels.description,actions:i&&(0,s.createElement)(Pa,{templateType:e,toggleProps:{as:Fn}}),content:(0,s.createElement)(s.Fragment,null,r&&Ba[e].labels.loading,!r&&(0,s.createElement)(y.__experimentalItemGroup,null,!(null!=a&&a.length)&&(0,s.createElement)(y.__experimentalItem,null,Ba[e].labels.notFound),l.map((t=>{var n;return(0,s.createElement)(za,{postType:e,postId:t.id,key:t.id},(0,Un.decodeEntities)((null===(n=t.title)||void 0===n?void 0:n.rendered)||t.slug))})),!t&&(0,s.createElement)(Hn,g({className:"edit-site-sidebar-navigation-screen-templates__see-all"},o,{children:Ba[e].labels.manage}))))})}var Ra=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));function Aa(e,t){const{record:n,title:a,description:r,isLoaded:l}=(0,m.useSelect)((n=>{const{getEditedPostType:a,getEditedPostId:r}=n(An),{getEditedEntityRecord:l}=n(_.store),{__experimentalGetTemplateInfo:o}=n(h.store),i=null!=e?e:a(),s=null!=t?t:r(),c=l("postType",i,s),u=!!s,m=o(c);return{record:c,title:m.title,description:m.description,isLoaded:u}}),[e,t]);return{isLoaded:l,record:n,getTitle:()=>a?(0,Un.decodeEntities)(a):null,getDescription:()=>r?(0,Un.decodeEntities)(r):null}}function La(){const{params:e}=(0,y.__experimentalUseNavigator)(),{postType:t,postId:n}=e,{setCanvasMode:a}=Qe((0,m.useDispatch)(An)),{getDescription:r,getTitle:l,record:o}=Aa(t,n);let i=r();return i||("wp_template"===o.type&&o.is_custom?i=(0,E.__)("This is a custom template that can be applied manually to any Post or Page."):"wp_template_part"===o.type&&(i=(0,E.sprintf)((0,E.__)("This is your %s template part."),l()))),(0,s.createElement)(Gn,{title:l(),actions:(0,s.createElement)(Fn,{onClick:()=>a("edit"),label:(0,E.__)("Edit"),icon:Ra}),description:i})}function Da(e){var t;let n=null!==(t=null==e?void 0:e.path)&&void 0!==t?t:"/";if(null!=e&&e.postType&&null!=e&&e.postId)switch(e.postType){case"wp_template":case"wp_template_part":n=`/${encodeURIComponent(e.postType)}/${encodeURIComponent(e.postId)}`;break;default:n=`/navigation/${encodeURIComponent(e.postType)}/${encodeURIComponent(e.postId)}`}return n}function Oa(){return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"edit-site-sidebar-navigation-screen-navigation-menus__placeholder"}),(0,s.createElement)("div",{className:"edit-site-sidebar-navigation-screen-navigation-menus__placeholder"}),(0,s.createElement)("div",{className:"edit-site-sidebar-navigation-screen-navigation-menus__placeholder"}))}function Fa(e){let{rootClientId:t,onSelect:n}=e;const{clientIdsTree:a,isLoading:r}=(0,m.useSelect)((e=>{const{__unstableGetClientIdsTree:n,areInnerBlocksControlled:a}=e(fe.store);return{clientIdsTree:n(t),isLoading:!a(t)}}),[t]),{replaceBlock:l,__unstableMarkNextChangeAsNotPersistent:o}=(0,m.useDispatch)(fe.store),{OffCanvasEditor:i,LeafMoreMenu:u}=Qe(fe.privateApis),d=(0,s.useCallback)((e=>{"core/navigation-link"!==e.name||e.attributes.url?n(e):(o(),l(e.clientId,(0,c.createBlock)("core/navigation-link",e.attributes)))}),[n,o,l]);return(0,s.createElement)(s.Fragment,null,r&&(0,s.createElement)(Oa,null),!r&&(0,s.createElement)(i,{blocks:a,onSelect:d,LeafMoreMenu:u,showAppender:!1}),(0,s.createElement)("div",{style:{visibility:"hidden"}},(0,s.createElement)(fe.BlockTools,null,(0,s.createElement)(fe.BlockList,null))))}const Ga=()=>{},Ha={per_page:-1,status:"publish"};function $a(e){let{children:t,actions:n}=e;return(0,s.createElement)(Gn,{title:(0,E.__)("Navigation"),actions:n,description:(0,E.__)("Browse your site, edit pages, and manage your primary navigation menu."),content:t})}function Ua(){var e;const t=Tt(),{navigationMenus:n,hasResolvedNavigationMenus:a,storedSettings:r}=(0,m.useSelect)((e=>{const{getSettings:t}=Qe(e(An)),{getEntityRecords:n,hasFinishedResolution:a}=e(_.store),r=["postType","wp_navigation",Ha];return{storedSettings:t(!1),navigationMenus:n(...r),hasResolvedNavigationMenus:a("getEntityRecords",r)}}),[]),l=(0,s.useMemo)((()=>null==n?void 0:n.sort(((e,t)=>{const n=new Date(e.date),a=new Date(t.date);return n.getTime()>a.getTime()}))),[n]),o=null==l||null===(e=l[0])||void 0===e?void 0:e.id,i=(0,s.useMemo)((()=>[(0,c.createBlock)("core/navigation",{ref:o})]),[o]),u=!a,d=!(null==n||!n.length),p=(0,s.useCallback)((e=>{const{attributes:n,name:a}=e;"post-type"===n.kind&&n.id&&n.type&&t&&t.push({postType:n.type,postId:n.id}),"core/page-list-item"===a&&n.id&&t&&t.push({postType:"page",postId:n.id})}),[t]);return a&&!d?(0,s.createElement)($a,null,(0,E.__)("There are no Navigation Menus.")):!a||u?(0,s.createElement)($a,null,(0,s.createElement)(Oa,null)):(0,s.createElement)(fe.BlockEditorProvider,{settings:r,value:i,onChange:Ga,onInput:Ga},(0,s.createElement)($a,null,(0,s.createElement)("div",{className:"edit-site-sidebar-navigation-screen-navigation-menus__content"},(0,s.createElement)(Fa,{rootClientId:i[0].clientId,onSelect:p}))))}const Wa={wp_template:{title:(0,E.__)("All templates"),description:(0,E.__)("Create new templates, or reset any customizations made to the templates supplied by your theme.")},wp_template_part:{title:(0,E.__)("All template parts"),description:(0,E.__)("Create new template parts, or reset any customizations made to the template parts supplied by your theme.")}};function ja(){const{params:{postType:e}}=(0,y.__experimentalUseNavigator)();return(0,s.createElement)(Gn,{title:Wa[e].title,description:Wa[e].description})}var qa=window.wp.keycodes;function Ya(){const{countUnsavedChanges:e,isDirty:t,isSaving:n,isSaveViewOpen:a}=(0,m.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,isSavingEntityRecord:n}=e(_.store),a=t(),{isSaveViewOpened:r}=e(An);return{isDirty:a.length>0,isSaving:a.some((e=>n(e.kind,e.name,e.key))),isSaveViewOpen:r(),countUnsavedChanges:a.length}}),[]),{setIsSaveViewOpened:r}=(0,m.useDispatch)(An),l=!t||n,o=l?(0,E.__)("Saved"):(0,E.__)("Save");return(0,s.createElement)(y.__experimentalHStack,{className:"edit-site-save-hub",alignment:"right",spacing:4},t&&(0,s.createElement)("span",null,(0,E.sprintf)((0,E._n)("%d unsaved change","%d unsaved changes",e),e)),(0,s.createElement)(y.Button,{className:"edit-site-save-hub__button",variant:l?void 0:"primary","aria-disabled":l,"aria-expanded":a,isBusy:n,onClick:l?void 0:()=>r(!0),label:o,shortcut:l?void 0:qa.displayShortcut.primary("s"),icon:l?w:void 0},o))}function Xa(){var e,t;const{setCanvasMode:n}=Qe((0,m.useDispatch)(An)),{params:{postType:a,postId:r}}=(0,y.__experimentalUseNavigator)(),{record:l}=(0,_.useEntityRecord)("postType",a,r);return(0,s.createElement)(Gn,{title:l?(0,Un.decodeEntities)(null==l||null===(e=l.title)||void 0===e?void 0:e.rendered):null,actions:(0,s.createElement)(Fn,{onClick:()=>n("edit"),label:(0,E.__)("Edit"),icon:Ra}),description:"page"===a?(0,E.__)("Pages are static and are not listed by date. Pages do not use tags or categories."):(0,E.__)("Posts are entries listed in reverse chronological order on the site homepage or on the posts page."),content:(0,s.createElement)(s.Fragment,null,null!=l&&l.link?(0,s.createElement)(y.ExternalLink,{className:"edit-site-sidebar-navigation-screen__page-link",href:l.link},l.link):null,l?(0,Un.decodeEntities)(null==l||null===(t=l.description)||void 0===t?void 0:t.rendered):null)})}function Za(){return function(){const e=Tt(),{params:t}=Ct(),{location:n,params:a,goTo:r}=(0,y.__experimentalUseNavigator)(),l=(0,s.useRef)(t),o=(0,s.useRef)(n.path),i=(0,s.useRef)(!0);(0,s.useEffect)((()=>{function t(t){if(Object.entries(t).every((e=>{let[t,n]=e;return l.current[t]===n})))return;const n={...l.current,...t};l.current=n,e.push(n)}i.current?i.current=!1:null!=a&&a.postType&&null!=a&&a.postId?t({postType:null==a?void 0:a.postType,postId:null==a?void 0:a.postId,path:void 0}):t({postType:void 0,postId:void 0,path:"/"===n.path?void 0:n.path})}),[null==n?void 0:n.path,a,e]),(0,s.useEffect)((()=>{l.current=t;const e=Da(t);o.current!==e&&(o.current=e,r(e))}),[t,r])}(),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/"},(0,s.createElement)($n,null)),(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/navigation"},(0,s.createElement)(Ua,null)),(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/navigation/:postType/:postId"},(0,s.createElement)(Xa,null)),(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/:postType(wp_template|wp_template_part)"},(0,s.createElement)(Va,null)),(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/:postType(wp_template|wp_template_part)/all"},(0,s.createElement)(ja,null)),(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/:postType(wp_template|wp_template_part)/:postId"},(0,s.createElement)(La,null)))}var Ka=(0,s.memo)((function(){const{params:e}=Ct(),t=(0,s.useRef)(Da(e));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.__experimentalNavigatorProvider,{className:"edit-site-sidebar__content",initialPath:t.current},(0,s.createElement)(Za,null)),(0,s.createElement)("div",{className:"edit-site-sidebar__footer"},(0,s.createElement)(Ya,null)))}));var Qa=(0,s.createElement)(b.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"}));var Ja=(0,s.createElement)(b.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"}));function er(e){let{className:t,identifier:n,title:a,icon:r,children:l,closeLabel:o,header:i,headerClassName:c,panelClassName:u}=e;const d=(0,m.useSelect)((e=>e(An).getSettings().showIconLabels),[]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ee,{className:t,scope:"core/edit-site",identifier:n,title:a,icon:r,closeLabel:o,header:i,headerClassName:c,panelClassName:u,showIconLabels:d},l),(0,s.createElement)(X,{scope:"core/edit-site",identifier:n,icon:r},a))}var tr=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"}));var nr=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z"}));function ar(e){let{className:t,...n}=e;return(0,s.createElement)(y.Icon,g({className:f()(t,"edit-site-global-styles-icon-with-current-color")},n))}function rr(e){let{icon:t,children:n,...a}=e;return(0,s.createElement)(y.__experimentalItem,a,t&&(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(ar,{icon:t,size:24}),(0,s.createElement)(y.FlexItem,null,n)),!t&&n)}function lr(e){return(0,s.createElement)(y.__experimentalNavigatorButton,g({as:rr},e))}var or=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M6.9 7L3 17.8h1.7l1-2.8h4.1l1 2.8h1.7L8.6 7H6.9zm-.7 6.6l1.5-4.3 1.5 4.3h-3zM21.6 17c-.1.1-.2.2-.3.2-.1.1-.2.1-.4.1s-.3-.1-.4-.2c-.1-.1-.1-.3-.1-.6V12c0-.5 0-1-.1-1.4-.1-.4-.3-.7-.5-1-.2-.2-.5-.4-.9-.5-.4 0-.8-.1-1.3-.1s-1 .1-1.4.2c-.4.1-.7.3-1 .4-.2.2-.4.3-.6.5-.1.2-.2.4-.2.7 0 .3.1.5.2.8.2.2.4.3.8.3.3 0 .6-.1.8-.3.2-.2.3-.4.3-.7 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.6-.4.2-.2.4-.3.7-.4.3-.1.6-.1.8-.1.3 0 .6 0 .8.1.2.1.4.3.5.5.1.2.2.5.2.9v1.1c0 .3-.1.5-.3.6-.2.2-.5.3-.9.4-.3.1-.7.3-1.1.4-.4.1-.8.3-1.1.5-.3.2-.6.4-.8.7-.2.3-.3.7-.3 1.2 0 .6.2 1.1.5 1.4.3.4.9.5 1.6.5.5 0 1-.1 1.4-.3.4-.2.8-.6 1.1-1.1 0 .4.1.7.3 1 .2.3.6.4 1.2.4.4 0 .7-.1.9-.2.2-.1.5-.3.7-.4h-.3zm-3-.9c-.2.4-.5.7-.8.8-.3.2-.6.2-.8.2-.4 0-.6-.1-.9-.3-.2-.2-.3-.6-.3-1.1 0-.5.1-.9.3-1.2s.5-.5.8-.7c.3-.2.7-.3 1-.5.3-.1.6-.3.7-.6v3.4z"}));var ir=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"}));var sr=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"m6.6 15.6-1.2.8c.6.9 1.3 1.6 2.2 2.2l.8-1.2c-.7-.5-1.3-1.1-1.8-1.8zM5.5 12c0-.4 0-.9.1-1.3l-1.5-.3c0 .5-.1 1.1-.1 1.6s.1 1.1.2 1.6l1.5-.3c-.2-.4-.2-.9-.2-1.3zm11.9-3.6 1.2-.8c-.6-.9-1.3-1.6-2.2-2.2l-.8 1.2c.7.5 1.3 1.1 1.8 1.8zM5.3 7.6l1.2.8c.5-.7 1.1-1.3 1.8-1.8l-.7-1.3c-.9.6-1.7 1.4-2.3 2.3zm14.5 2.8-1.5.3c.1.4.1.8.1 1.3s0 .9-.1 1.3l1.5.3c.1-.5.2-1 .2-1.6s-.1-1.1-.2-1.6zM12 18.5c-.4 0-.9 0-1.3-.1l-.3 1.5c.5.1 1 .2 1.6.2s1.1-.1 1.6-.2l-.3-1.5c-.4.1-.9.1-1.3.1zm3.6-1.1.8 1.2c.9-.6 1.6-1.3 2.2-2.2l-1.2-.8c-.5.7-1.1 1.3-1.8 1.8zM10.4 4.2l.3 1.5c.4-.1.8-.1 1.3-.1s.9 0 1.3.1l.3-1.5c-.5-.1-1.1-.2-1.6-.2s-1.1.1-1.6.2z"}));var cr=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z"}));const{useGlobalSetting:ur,useGlobalStyle:mr}=Qe(fe.privateApis);function dr(e){return[pr(e),_r(e),hr(e),gr(e)].some(Boolean)}function pr(e){const t=tt(e);return ur("border.color",e)[0]&&t.includes("borderColor")}function _r(e){const t=tt(e);return ur("border.radius",e)[0]&&t.includes("borderRadius")}function hr(e){const t=tt(e);return ur("border.style",e)[0]&&t.includes("borderStyle")}function gr(e){const t=tt(e);return ur("border.width",e)[0]&&t.includes("borderWidth")}function vr(e){return e?e.style||!e.color&&!e.width?e:{...e,style:"solid"}:e}function fr(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",[r]=mr(`${a}border`,t,"user"),[l,o]=mr(`${a}border`,t),i=nt(t),c=pr(t),u=hr(t),m=gr(t),d=_r(t),[p,_]=mr(`${a}border.radius`,t),h=()=>{const e=null==r?void 0:r.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},g=(0,s.useCallback)((()=>o(void 0)),[o]),v=(0,s.useCallback)((e=>{const t=function(e){return e?(0,y.__experimentalHasSplitBorders)(e)?{top:vr(e.top),right:vr(e.right),bottom:vr(e.bottom),left:vr(e.left)}:vr(e):e}(e),n=(0,y.__experimentalHasSplitBorders)(t)?{color:null,style:null,width:null,...t}:{top:t,right:t,bottom:t,left:t};o({radius:null==l?void 0:l.radius,...n})}),[o]);return(0,s.createElement)(y.__experimentalToolsPanel,{label:(0,E.__)("Border"),resetAll:g},(m||c)&&(0,s.createElement)(y.__experimentalToolsPanelItem,{hasValue:()=>(0,y.__experimentalIsDefinedBorder)(r),label:(0,E.__)("Border"),onDeselect:()=>(()=>{if(h())return o({radius:r.radius});o(void 0)})(),isShownByDefault:!0},(0,s.createElement)(y.__experimentalBorderBoxControl,{colors:i,enableAlpha:!0,enableStyle:u,onChange:v,popoverOffset:40,popoverPlacement:"left-start",value:l,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large"})),d&&(0,s.createElement)(y.__experimentalToolsPanelItem,{hasValue:h,label:(0,E.__)("Radius"),onDeselect:()=>_(void 0),isShownByDefault:!0},(0,s.createElement)(fe.__experimentalBorderRadiusControl,{values:p,onChange:e=>{_(e||void 0)}})))}function yr(e){const t=tt(e);return t.includes("color")||t.includes("backgroundColor")||t.includes("background")||t.includes("linkColor")}var Er=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));var br=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"}));const{useGlobalSetting:wr,useGlobalStyle:Sr}=Qe(fe.privateApis),xr=["horizontal","vertical"];function kr(e){const t=Cr(e),n=Tr(e),a=Nr(e),r=Mr(e),l=Ir(e),o=Pr(e);return t||n||a||r||l||o}function Cr(e){const t=tt(e),[n]=wr("layout.contentSize",e);return n&&t.includes("contentSize")}function Tr(e){const t=tt(e),[n]=wr("layout.wideSize",e);return n&&t.includes("wideSize")}function Nr(e){const t=tt(e),[n]=wr("spacing.padding",e);return n&&t.includes("padding")}function Mr(e){const t=tt(e),[n]=wr("spacing.margin",e);return n&&t.includes("margin")}function Ir(e){const t=tt(e),[n]=wr("spacing.blockGap",e);return n&&t.includes("blockGap")}function Pr(e){const t=tt(e),[n]=wr("dimensions.minHeight",e);return n&&t.includes("minHeight")}function Br(e,t){if(!t)return e;const n={};return t.forEach((t=>{"vertical"===t&&(n.top=e.top,n.bottom=e.bottom),"horizontal"===t&&(n.left=e.left,n.right=e.right),n[t]=e[t]})),n}function zr(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function Vr(e){return e&&"string"==typeof e?{top:e}:e?{...e,right:null==e?void 0:e.left,bottom:null==e?void 0:e.top}:e}function Rr(e){let{name:t,variation:n=""}=e;const a=Cr(t),r=Tr(t),l=Nr(t),o=Mr(t),i=Ir(t),c=Pr(t),u=function(){var e,t;const[n]=wr("spacing.spacingSizes"),{custom:a,theme:r,default:l}=n||{},o=null!==(e=null!==(t=null!=a?a:r)&&void 0!==t?t:l)&&void 0!==e?e:[];return n&&o.length>0}(),m=(0,y.__experimentalUseCustomUnits)({availableUnits:wr("spacing.units",t)[0]||["%","px","em","rem","vw"]}),{contentSizeValue:d,setContentSizeValue:p,hasUserSetContentSizeValue:_,resetContentSizeValue:h}=function(e){const[t,n]=wr("layout.contentSize",e),[a]=wr("layout.contentSize",e,"user");return{contentSizeValue:t,setContentSizeValue:n,hasUserSetContentSizeValue:()=>!!a,resetContentSizeValue:()=>n("")}}(t),{wideSizeValue:g,setWideSizeValue:v,hasUserSetWideSizeValue:b,resetWideSizeValue:w}=function(e){const[t,n]=wr("layout.wideSize",e),[a]=wr("layout.wideSize",e,"user");return{wideSizeValue:t,setWideSizeValue:n,hasUserSetWideSizeValue:()=>!!a,resetWideSizeValue:()=>n("")}}(t),{paddingValues:S,paddingSides:x,isAxialPadding:k,setPaddingValues:C,resetPaddingValue:T,hasPaddingValue:N}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t?`variations.${t}.`:"",[a,r]=Sr(n+"spacing.padding",e),l=zr(a),o=(0,fe.__experimentalUseCustomSides)(e,"padding"),i=o&&o.some((e=>xr.includes(e))),s=e=>{const t=Br(e,o);r(t)},c=()=>s({}),[u]=Sr(n+"spacing.padding",e,"user");return{paddingValues:l,paddingSides:o,isAxialPadding:i,setPaddingValues:s,resetPaddingValue:c,hasPaddingValue:()=>!!u}}(t,n),{marginValues:M,marginSides:I,isAxialMargin:P,setMarginValues:B,resetMarginValue:z,hasMarginValue:V}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t?`variations.${t}.`:"",[a,r]=Sr(n+"spacing.margin",e),l=zr(a),o=(0,fe.__experimentalUseCustomSides)(e,"margin"),i=o&&o.some((e=>xr.includes(e))),s=e=>{const t=Br(e,o);r(t)},c=()=>s({});return{marginValues:l,marginSides:o,isAxialMargin:i,setMarginValues:s,resetMarginValue:c,hasMarginValue:()=>!!l&&Object.keys(l).length}}(t,n),{gapValue:R,gapValues:A,gapSides:L,isAxialGap:D,setGapValue:O,setGapValues:F,resetGapValue:G,hasGapValue:H}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t?`variations.${t}.`:"",[a,r]=Sr(n+"spacing.blockGap",e),l=Vr(a),o=(0,fe.__experimentalUseCustomSides)(e,"blockGap"),i=o&&o.some((e=>xr.includes(e))),s=()=>r(void 0),[c]=Sr(n+"spacing.blockGap",e,"user"),u=e=>{e||r(null),!i&&null!=e&&e.hasOwnProperty("top")?r(e.top):r({top:null==e?void 0:e.top,left:null==e?void 0:e.left})};return{gapValue:a,gapValues:l,gapSides:o,isAxialGap:i,setGapValue:r,setGapValues:u,resetGapValue:s,hasGapValue:()=>!!c}}(t,n),{minHeightValue:$,setMinHeightValue:U,resetMinHeightValue:W,hasMinHeightValue:j}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t?`variations.${t}.`:"",[a,r]=Sr(n+"dimensions.minHeight",e),l=()=>r(void 0);return{minHeightValue:a,setMinHeightValue:r,resetMinHeightValue:l,hasMinHeightValue:()=>!!a}}(t,n);return(0,s.createElement)(y.__experimentalToolsPanel,{label:(0,E.__)("Dimensions"),resetAll:()=>{T(),z(),G(),h(),w()}},(a||r)&&(0,s.createElement)("span",{className:"span-columns"},(0,E.__)("Set the width of the main content area.")),a&&(0,s.createElement)(y.__experimentalToolsPanelItem,{className:"single-column",label:(0,E.__)("Content size"),hasValue:_,onDeselect:h,isShownByDefault:!0},(0,s.createElement)(y.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,s.createElement)(y.__experimentalUnitControl,{label:(0,E.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:d||"",onChange:e=>{p(e)},units:m}),(0,s.createElement)(y.__experimentalView,null,(0,s.createElement)(ie,{icon:Er})))),r&&(0,s.createElement)(y.__experimentalToolsPanelItem,{className:"single-column",label:(0,E.__)("Wide size"),hasValue:b,onDeselect:w,isShownByDefault:!0},(0,s.createElement)(y.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,s.createElement)(y.__experimentalUnitControl,{label:(0,E.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:g||"",onChange:e=>{v(e)},units:m}),(0,s.createElement)(y.__experimentalView,null,(0,s.createElement)(ie,{icon:br})))),l&&(0,s.createElement)(y.__experimentalToolsPanelItem,{hasValue:N,label:(0,E.__)("Padding"),onDeselect:T,isShownByDefault:!0,className:f()({"tools-panel-item-spacing":u})},!u&&(0,s.createElement)(y.__experimentalBoxControl,{values:S,onChange:C,label:(0,E.__)("Padding"),sides:x,units:m,allowReset:!1,splitOnAxis:k}),u&&(0,s.createElement)(fe.__experimentalSpacingSizesControl,{values:S,onChange:C,label:(0,E.__)("Padding"),sides:x,units:m,allowReset:!1,splitOnAxis:k})),o&&(0,s.createElement)(y.__experimentalToolsPanelItem,{hasValue:V,label:(0,E.__)("Margin"),onDeselect:z,isShownByDefault:!0,className:f()({"tools-panel-item-spacing":u})},!u&&(0,s.createElement)(y.__experimentalBoxControl,{values:M,onChange:B,label:(0,E.__)("Margin"),sides:I,units:m,allowReset:!1,splitOnAxis:P}),u&&(0,s.createElement)(fe.__experimentalSpacingSizesControl,{values:M,onChange:B,label:(0,E.__)("Margin"),sides:I,units:m,allowReset:!1,splitOnAxis:P})),i&&(0,s.createElement)(y.__experimentalToolsPanelItem,{hasValue:H,label:(0,E.__)("Block spacing"),onDeselect:G,isShownByDefault:!0,className:f()({"tools-panel-item-spacing":u})},!u&&(D?(0,s.createElement)(y.__experimentalBoxControl,{label:(0,E.__)("Block spacing"),min:0,onChange:F,units:m,sides:L,values:A,allowReset:!1,splitOnAxis:D}):(0,s.createElement)(y.__experimentalUnitControl,{label:(0,E.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:O,units:m,value:R})),u&&(0,s.createElement)(fe.__experimentalSpacingSizesControl,{label:(0,E.__)("Block spacing"),min:0,onChange:F,sides:D?L:["top"],values:A,allowReset:!1,splitOnAxis:D})),c&&(0,s.createElement)(y.__experimentalToolsPanelItem,{hasValue:j,label:(0,E.__)("Min. height"),onDeselect:W,isShownByDefault:!0},(0,s.createElement)(fe.HeightControl,{label:(0,E.__)("Min. height"),value:$,onChange:U})))}const{useGlobalSetting:Ar,useGlobalStyle:Lr}=Qe(fe.privateApis);function Dr(e){const t=Or(e),n=Fr(e),a=Gr(e),r=Hr(e),l=tt(e);return t||n||a||r||l.includes("fontSize")}function Or(e){const t=tt(e),[n]=Ar("typography.fontFamilies",e),a=(null==n?void 0:n.custom)||(null==n?void 0:n.theme)||(null==n?void 0:n.default);return t.includes("fontFamily")&&!(null==a||!a.length)}function Fr(e){const t=tt(e);return Ar("typography.lineHeight",e)[0]&&t.includes("lineHeight")}function Gr(e){const t=tt(e),n=Ar("typography.fontStyle",e)[0]&&t.includes("fontStyle"),a=Ar("typography.fontWeight",e)[0]&&t.includes("fontWeight");return n||a}function Hr(e,t){if(!Ar("typography.letterSpacing",e)[0])return!1;if(!e&&"heading"===t)return!0;return tt(e).includes("letterSpacing")}function $r(e,t){const[n,a]=Lr(e,t),[r]=Lr(e,t,"user");return[n,a,()=>!!r,()=>a(void 0)]}function Ur(e){let{name:t,element:n,headingLevel:a,variation:r=""}=e;const l=tt(t);let o="";"heading"===n?o=`elements.${a}.`:n&&"text"!==n&&(o=`elements.${n}.`),r&&(o=o?`variations.${r}.${o}`:`variations.${r}`);const[i]=Ar("typography.fontSizes",t),c=(null==i?void 0:i.custom)||(null==i?void 0:i.theme)||(null==i?void 0:i.default),u=!Ar("typography.customFontSize",t)[0],[m]=Ar("typography.fontFamilies",t),d=(null==m?void 0:m.custom)||(null==m?void 0:m.theme)||(null==m?void 0:m.default),p=Ar("typography.fontStyle",t)[0]&&l.includes("fontStyle"),_=Ar("typography.fontWeight",t)[0]&&l.includes("fontWeight"),h=Or(t),g=Fr(t),v=Gr(t),f=function(e){const t=tt(e),n=Ar("typography.fontStyle",e)[0]&&t.includes("fontStyle"),a=Ar("typography.fontWeight",e)[0]&&t.includes("fontWeight");return n?a?(0,E.__)("Appearance"):(0,E.__)("Font style"):(0,E.__)("Font weight")}(t),b=Hr(t,n),w=function(e,t){return!!Ar("typography.textTransform",e)[0]&&(!e&&"heading"===t||tt(e).includes("textTransform"))}(t,n),S=function(e,t){return!e&&"link"===t}(t,n);let x=l.includes("fontSize");"heading"===n&&"heading"===a&&(x=!1);const[k,C,T,N]=$r(o+"typography.fontFamily",t),{fontSize:M,setFontSize:I,hasFontSize:P,resetFontSize:B}=function(e,t){const[n,a]=Lr(e,t),[r]=Lr(e,t,"user");return{fontSize:n,setFontSize:(e,t)=>{null!=t&&t.slug&&(e=`var:preset|font-size|${null==t?void 0:t.slug}`),a(e)},hasFontSize:()=>!!r,resetFontSize:()=>a(void 0)}}(o+"typography.fontSize",t),{fontStyle:z,setFontStyle:V,fontWeight:R,setFontWeight:A,hasFontAppearance:L,resetFontAppearance:D}=function(e,t){const[n,a]=Lr(e+"typography.fontStyle",t),[r]=Lr(e+"typography.fontStyle",t,"user"),[l,o]=Lr(e+"typography.fontWeight",t),[i]=Lr(e+"typography.fontWeight",t,"user");return{fontStyle:n,setFontStyle:a,fontWeight:l,setFontWeight:o,hasFontAppearance:()=>!!r||!!i,resetFontAppearance:()=>{a(void 0),o(void 0)}}}(o,t),[O,F,G,H]=$r(o+"typography.lineHeight",t),[$,U,W,j]=$r(o+"typography.letterSpacing",t),[q,Y,X,Z]=$r(o+"typography.textTransform",t),[K,Q,J,ee]=$r(o+"typography.textDecoration",t);return(0,s.createElement)(y.__experimentalToolsPanel,{label:(0,E.__)("Typography"),resetAll:()=>{N(),B(),D(),H(),j(),Z()}},h&&(0,s.createElement)(y.__experimentalToolsPanelItem,{label:(0,E.__)("Font family"),hasValue:T,onDeselect:N,isShownByDefault:!0},(0,s.createElement)(fe.__experimentalFontFamilyControl,{fontFamilies:d,value:k,onChange:C,size:"__unstable-large",__nextHasNoMarginBottom:!0})),x&&(0,s.createElement)(y.__experimentalToolsPanelItem,{label:(0,E.__)("Font size"),hasValue:P,onDeselect:B,isShownByDefault:!0},(0,s.createElement)(y.FontSizePicker,{value:M,onChange:I,fontSizes:c,disableCustomFontSizes:u,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})),v&&(0,s.createElement)(y.__experimentalToolsPanelItem,{className:"single-column",label:f,hasValue:L,onDeselect:D,isShownByDefault:!0},(0,s.createElement)(fe.__experimentalFontAppearanceControl,{value:{fontStyle:z,fontWeight:R},onChange:e=>{let{fontStyle:t,fontWeight:n}=e;V(t),A(n)},hasFontStyles:p,hasFontWeights:_,size:"__unstable-large",__nextHasNoMarginBottom:!0})),g&&(0,s.createElement)(y.__experimentalToolsPanelItem,{className:"single-column",label:(0,E.__)("Line height"),hasValue:G,onDeselect:H,isShownByDefault:!0},(0,s.createElement)(fe.LineHeightControl,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:O,onChange:F,size:"__unstable-large"})),b&&(0,s.createElement)(y.__experimentalToolsPanelItem,{className:"single-column",label:(0,E.__)("Letter spacing"),hasValue:W,onDeselect:j,isShownByDefault:!0},(0,s.createElement)(fe.__experimentalLetterSpacingControl,{value:$,onChange:U,size:"__unstable-large",__unstableInputWidth:"auto"})),w&&(0,s.createElement)(y.__experimentalToolsPanelItem,{label:(0,E.__)("Letter case"),hasValue:X,onDeselect:Z,isShownByDefault:!0},(0,s.createElement)(fe.__experimentalTextTransformControl,{value:q,onChange:Y,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})),S&&(0,s.createElement)(y.__experimentalToolsPanelItem,{className:"single-column",label:(0,E.__)("Text decoration"),hasValue:J,onDeselect:ee,isShownByDefault:!0},(0,s.createElement)(fe.__experimentalTextDecorationControl,{value:K,onChange:Q,size:"__unstable-large",__unstableInputWidth:"auto"})))}function Wr(e){return null==e?void 0:e.filter((e=>"block"===e.source))}function jr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t.includes("variations"),a=(0,m.useSelect)((t=>{const{getBlockStyles:n}=t(c.store);return n(e)}),[e]),r=Wr(a);return!(null==r||!r.length||n)}function qr(e){let{name:t}=e;const n=Wr((0,m.useSelect)((e=>{const{getBlockStyles:n}=e(c.store);return n(t)}),[t]));return(0,s.createElement)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},n.map(((e,n)=>null!=e&&e.isDefault?null:(0,s.createElement)(lr,{key:n,path:"/blocks/"+encodeURIComponent(t)+"/variations/"+encodeURIComponent(e.name),"aria-label":e.label},e.label))))}function Yr(e){let{blockName:t,styleName:n}=e;return(0,s.createElement)(sl,{parentMenu:"/blocks/"+encodeURIComponent(t)+"/variations/"+encodeURIComponent(n),name:t})}var Xr=function(e){let{title:t,description:n}=e;return(0,s.createElement)(y.__experimentalVStack,{spacing:0},(0,s.createElement)(y.__experimentalView,null,(0,s.createElement)(y.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3},(0,s.createElement)(y.__experimentalHStack,{spacing:2},(0,s.createElement)(y.__experimentalNavigatorToParentButton,{style:{minWidth:24,padding:0},icon:(0,E.isRTL)()?ce:se,isSmall:!0,"aria-label":(0,E.__)("Navigate to the previous view")}),(0,s.createElement)(y.__experimentalSpacer,null,(0,s.createElement)(y.__experimentalHeading,{level:5},t))))),n&&(0,s.createElement)("p",{className:"edit-site-global-styles-header__description"},n))};var Zr=e=>{var t;let{name:n,variation:a=""}=e;const r=null===(t=(0,c.getBlockType)(n))||void 0===t?void 0:t.example,l={...r,attributes:{...null==r?void 0:r.attributes,className:a}},o=r&&(0,c.getBlockFromExample)(n,a?l:r),i=(null==r?void 0:r.viewportWidth)||null,u="150px";return r?(0,s.createElement)(y.__experimentalSpacer,{marginX:4,marginBottom:4},(0,s.createElement)("div",{className:"edit-site-global-styles__block-preview-panel",style:{maxHeight:u,boxSizing:"initial"}},(0,s.createElement)(fe.BlockPreview,{blocks:o,viewportWidth:i,minHeight:u,additionalStyles:[{css:"\n\t\t\t\t\t\t\t\tbody{\n\t\t\t\t\t\t\t\t\tmin-height:150px;\n\t\t\t\t\t\t\t\t\tdisplay:flex;align-items:center;justify-content:center;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t"}]}))):null};var Kr=function(e){let{children:t}=e;return(0,s.createElement)(y.__experimentalHeading,{className:"edit-site-global-styles-subtitle",level:2},t)};function Qr(e){let{name:t,path:n=""}=e;return jr(t,n)?(0,s.createElement)("div",{className:"edit-site-global-styles-screen-variations"},(0,s.createElement)(y.__experimentalVStack,{spacing:3},(0,s.createElement)(Kr,null,(0,E.__)("Style Variations")),(0,s.createElement)(qr,{name:t}))):null}function Jr(e){let{blockName:t,style:n}=e;const{name:a,label:r}=n;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:r}),(0,s.createElement)(Zr,{name:t,variation:`is-style-${a}`}),(0,s.createElement)(Yr,{blockName:t,styleName:a}))}const{useGlobalSetting:el,useGlobalStyle:tl}=Qe(fe.privateApis);function nl(e){return tt(e).includes("shadow")}function al(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",[r,l]=tl(`${a}shadow`,t),[o]=tl(`${a}shadow`,t,"user"),i=()=>l(void 0),c=(0,s.useCallback)((()=>i()),[i]);return(0,s.createElement)(y.__experimentalToolsPanel,{label:(0,E.__)("Shadow"),resetAll:c},(0,s.createElement)(y.__experimentalToolsPanelItem,{label:(0,E.__)("Shadow"),hasValue:()=>!!o,onDeselect:i,isShownByDefault:!0},(0,s.createElement)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(rl,{shadow:r,onShadowChange:l}))))}const rl=e=>{let{shadow:t,onShadowChange:n}=e;return(0,s.createElement)(y.Dropdown,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"edit-site-global-styles__shadow-dropdown",renderToggle:e=>{let{onToggle:t,isOpen:n}=e;const a={onClick:t,className:f()({"is-open":n}),"aria-expanded":n};return(0,s.createElement)(y.Button,a,(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(ar,{icon:cr,size:24}),(0,s.createElement)(y.FlexItem,{className:"edit-site-global-styles__shadow-label"},(0,E.__)("Shadow"))))},renderContent:()=>(0,s.createElement)(y.__experimentalDropdownContentWrapper,{paddingSize:"medium"},(0,s.createElement)(ll,{shadow:t,onShadowChange:n}))})};function ll(e){let{shadow:t,onShadowChange:n}=e;const[a]=el("shadow.presets.default"),[r]=el("shadow.presets.theme"),[l]=el("shadow.defaultPresets"),o=[...l?a:[],...r||[]];return(0,s.createElement)("div",{className:"edit-site-global-styles__shadow-panel"},(0,s.createElement)(y.__experimentalVStack,{spacing:4},(0,s.createElement)(y.__experimentalHeading,{level:5},(0,E.__)("Shadow")),(0,s.createElement)(ol,{presets:o,activeShadow:t,onSelect:n})))}function ol(e){let{presets:t,activeShadow:n,onSelect:a}=e;return t?(0,s.createElement)(y.__experimentalGrid,{columns:6,gap:0,align:"center",justify:"center"},t.map((e=>{let{name:t,slug:r,shadow:l}=e;return(0,s.createElement)(il,{key:r,label:t,isActive:l===n,onSelect:()=>a(l===n?void 0:l),shadow:l})}))):null}function il(e){let{label:t,isActive:n,onSelect:a,shadow:r}=e;return(0,s.createElement)("div",{className:"edit-site-global-styles__shadow-indicator-wrapper"},(0,s.createElement)(y.Button,{className:"edit-site-global-styles__shadow-indicator",onClick:a,label:t,style:{boxShadow:r},showTooltip:!0},n&&(0,s.createElement)(ie,{icon:w})))}var sl=function(e){let{name:t,parentMenu:n=""}=e;const a=Dr(t),r=yr(t),l=dr(t),o=nl(t),i=kr(t),c=jr(t,n),{canEditCSS:u}=(0,m.useSelect)((e=>{var t,n;const{getEntityRecord:a,__experimentalGetCurrentGlobalStylesId:r}=e(_.store),l=r(),o=l?a("root","globalStyles",l):void 0;return{canEditCSS:null!==(t=!(null==o||null===(n=o._links)||void 0===n||!n["wp:action-edit-css"]))&&void 0!==t&&t}}),[]),d=n.includes("blocks")&&!n.includes("variations");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.__experimentalItemGroup,null,a&&(0,s.createElement)(lr,{icon:or,path:n+"/typography","aria-label":(0,E.__)("Typography styles")},(0,E.__)("Typography")),r&&(0,s.createElement)(lr,{icon:ir,path:n+"/colors","aria-label":(0,E.__)("Colors styles")},(0,E.__)("Colors")),l&&(0,s.createElement)(lr,{icon:sr,path:n+"/border","aria-label":(0,E.__)("Border")},(0,E.__)("Border")),o&&(0,s.createElement)(lr,{icon:cr,path:n+"/effects","aria-label":(0,E.__)("Shadow")},(0,E.__)("Shadow")),i&&(0,s.createElement)(lr,{icon:Dn,path:n+"/layout","aria-label":(0,E.__)("Layout styles")},(0,E.__)("Layout")),c&&(0,s.createElement)(Qr,{name:t,path:n}),d&&u&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.CardDivider,null),(0,s.createElement)(y.CardBody,null,(0,s.createElement)(y.__experimentalSpacer,{as:"p",paddingTop:2,marginBottom:4},(0,E.__)("Add your own CSS to customize the block appearance.")),(0,s.createElement)(y.__experimentalItemGroup,null,(0,s.createElement)(lr,{path:n+"/css","aria-label":(0,E.__)("Additional block CSS")},(0,s.createElement)(y.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(y.FlexItem,null,(0,E.__)("Additional block CSS")),(0,s.createElement)(ar,{icon:(0,E.isRTL)()?se:ce}))))),(0,s.createElement)(y.CardDivider,null))))};const{useGlobalSetting:cl,useGlobalStyle:ul,useGlobalStylesOutput:ml}=Qe(fe.privateApis),dl={start:{scale:1,opacity:1},hover:{scale:0,opacity:0}},pl={hover:{opacity:1},start:{opacity:.5}},_l={hover:{scale:1,opacity:1},start:{scale:0,opacity:0}};var hl=e=>{let{label:t,isFocused:n,withHoverView:a}=e;const[r]=ul("typography.fontWeight"),[l="serif"]=ul("typography.fontFamily"),[o=l]=ul("elements.h1.typography.fontFamily"),[i=r]=ul("elements.h1.typography.fontWeight"),[c="black"]=ul("color.text"),[u=c]=ul("elements.h1.color.text"),[m="white"]=ul("color.background"),[d]=ul("color.gradient"),[p]=ml(),_=(0,te.useReducedMotion)(),[h]=cl("color.palette.core"),[g]=cl("color.palette.theme"),[v]=cl("color.palette.custom"),[f,E]=(0,s.useState)(!1),[b,{width:w}]=(0,te.useResizeObserver)(),S=w?w/248:1,x=(null!=g?g:[]).concat(null!=v?v:[]).concat(null!=h?h:[]),k=x.filter((e=>{let{color:t}=e;return t!==m&&t!==u})).slice(0,2),C=(0,s.useMemo)((()=>p?[...p,{css:"html{overflow:hidden}body{min-width: 0;padding: 0;border: none;}",isGlobalStyles:!0}]:p),[p]);return(0,s.createElement)(fe.__unstableIframe,{className:"edit-site-global-styles-preview__iframe",head:(0,s.createElement)(fe.__unstableEditorStyles,{styles:C}),style:{height:152*S,visibility:w?"visible":"hidden"},onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),tabIndex:-1},b,(0,s.createElement)(y.__unstableMotion.div,{style:{height:152*S,width:"100%",background:null!=d?d:m,cursor:"pointer"},initial:"start",animate:(f||n)&&!_&&t?"hover":"start"},(0,s.createElement)(y.__unstableMotion.div,{variants:dl,style:{height:"100%",overflow:"hidden"}},(0,s.createElement)(y.__experimentalHStack,{spacing:10*S,justify:"center",style:{height:"100%",overflow:"hidden"}},(0,s.createElement)(y.__unstableMotion.div,{style:{fontFamily:o,fontSize:65*S,color:u,fontWeight:i},animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:.3,type:"tween"}},"Aa"),(0,s.createElement)(y.__experimentalVStack,{spacing:4*S},k.map(((e,t)=>{let{slug:n,color:a}=e;return(0,s.createElement)(y.__unstableMotion.div,{key:n,style:{height:32*S,width:32*S,background:a,borderRadius:32*S/2},animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:1===t?.2:.1}})}))))),(0,s.createElement)(y.__unstableMotion.div,{variants:a&&pl,style:{height:"100%",width:"100%",position:"absolute",top:0,overflow:"hidden",filter:"blur(60px)",opacity:.1}},(0,s.createElement)(y.__experimentalHStack,{spacing:0,justify:"flex-start",style:{height:"100%",overflow:"hidden"}},x.slice(0,4).map(((e,t)=>{let{color:n}=e;return(0,s.createElement)("div",{key:t,style:{height:"100%",background:n,flexGrow:1}})})))),(0,s.createElement)(y.__unstableMotion.div,{variants:_l,style:{height:"100%",width:"100%",overflow:"hidden",position:"absolute",top:0}},(0,s.createElement)(y.__experimentalVStack,{spacing:3*S,justify:"center",style:{height:"100%",overflow:"hidden",padding:10*S,boxSizing:"border-box"}},t&&(0,s.createElement)("div",{style:{fontSize:40*S,fontFamily:o,color:u,fontWeight:i,lineHeight:"1em",textAlign:"center"}},t)))))};var gl=function(){const{useGlobalStyle:e}=Qe(fe.privateApis),[t]=e("css"),{variations:n,canEditCSS:a}=(0,m.useSelect)((e=>{var t,n;const{getEntityRecord:a,__experimentalGetCurrentGlobalStylesId:r,__experimentalGetCurrentThemeGlobalStylesVariations:l}=e(_.store),o=r(),i=o?a("root","globalStyles",o):void 0;return{variations:l(),canEditCSS:null!==(t=!(null==i||null===(n=i._links)||void 0===n||!n["wp:action-edit-css"]))&&void 0!==t&&t}}),[]);return(0,s.createElement)(y.Card,{size:"small"},(0,s.createElement)(y.CardBody,null,(0,s.createElement)(y.__experimentalVStack,{spacing:4},(0,s.createElement)(y.Card,null,(0,s.createElement)(y.CardMedia,null,(0,s.createElement)(hl,null))),!(null==n||!n.length)&&(0,s.createElement)(y.__experimentalItemGroup,null,(0,s.createElement)(lr,{path:"/variations","aria-label":(0,E.__)("Browse styles")},(0,s.createElement)(y.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(y.FlexItem,null,(0,E.__)("Browse styles")),(0,s.createElement)(ar,{icon:(0,E.isRTL)()?se:ce})))),(0,s.createElement)(sl,null))),(0,s.createElement)(y.CardDivider,null),(0,s.createElement)(y.CardBody,null,(0,s.createElement)(y.__experimentalSpacer,{as:"p",paddingTop:2,paddingX:"13px",marginBottom:4},(0,E.__)("Customize the appearance of specific blocks for the whole site.")),(0,s.createElement)(y.__experimentalItemGroup,null,(0,s.createElement)(lr,{path:"/blocks","aria-label":(0,E.__)("Blocks styles")},(0,s.createElement)(y.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(y.FlexItem,null,(0,E.__)("Blocks")),(0,s.createElement)(ar,{icon:(0,E.isRTL)()?se:ce}))))),a&&!!t&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.CardDivider,null),(0,s.createElement)(y.CardBody,null,(0,s.createElement)(y.__experimentalSpacer,{as:"p",paddingTop:2,paddingX:"13px",marginBottom:4},(0,E.__)("Add your own CSS to customize the appearance and layout of your site.")),(0,s.createElement)(y.__experimentalItemGroup,null,(0,s.createElement)(lr,{path:"/css","aria-label":(0,E.__)("Additional CSS")},(0,s.createElement)(y.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(y.FlexItem,null,(0,E.__)("Additional CSS")),(0,s.createElement)(ar,{icon:(0,E.isRTL)()?se:ce})))))))};function vl(e){let{block:t}=e;const n=Dr(t.name),a=yr(t.name),r=dr(t.name),l=kr(t.name),o=r||l,i=jr(t.name);if(!(n||a||o||i))return null;const c=(0,E.sprintf)((0,E.__)("%s block styles"),t.title);return(0,s.createElement)(lr,{path:"/blocks/"+encodeURIComponent(t.name),"aria-label":c},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(fe.BlockIcon,{icon:t.icon}),(0,s.createElement)(y.FlexItem,null,t.title)))}var fl=function(){const e=function(){const e=(0,m.useSelect)((e=>e(c.store).getBlockTypes()),[]),{core:t,noncore:n}=e.reduce(((e,t)=>{const{core:n,noncore:a}=e;return(t.name.startsWith("core/")?n:a).push(t),e}),{core:[],noncore:[]});return[...t,...n]}(),[t,n]=(0,s.useState)(""),a=(0,te.useDebounce)(Lt.speak,500),r=(0,m.useSelect)((e=>e(c.store).isMatchingSearchTerm),[]),l=(0,s.useMemo)((()=>t?e.filter((e=>r(e,t))):e),[t,e,r]),o=(0,s.useRef)();return(0,s.useEffect)((()=>{if(!t)return;const e=o.current.childElementCount,n=(0,E.sprintf)((0,E._n)("%d result found.","%d results found.",e),e);a(n,e)}),[t,a]),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Blocks"),description:(0,E.__)("Customize the appearance of specific blocks and for the whole site.")}),(0,s.createElement)(y.SearchControl,{__nextHasNoMarginBottom:!0,className:"edit-site-block-types-search",onChange:n,value:t,label:(0,E.__)("Search for blocks"),placeholder:(0,E.__)("Search")}),(0,s.createElement)("div",{ref:o,className:"edit-site-block-types-item-list"},l.map((e=>(0,s.createElement)(vl,{block:e,key:"menu-itemblock-"+e.name})))))};var yl=function(e){let{name:t}=e;const n=(0,c.getBlockType)(t);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:n.title}),(0,s.createElement)(Zr,{name:t}),(0,s.createElement)(sl,{parentMenu:"/blocks/"+encodeURIComponent(t),name:t}))};function El(e){return e?`is-style-${e}`:""}const{useGlobalStyle:bl}=Qe(fe.privateApis);function wl(e){let{name:t,parentMenu:n,element:a,label:r}=e;const l=!t,o="text"!==a&&a?`elements.${a}.`:"",i="link"===a?{textDecoration:"underline"}:{},[c]=bl(o+"typography.fontFamily",t),[u]=bl(o+"typography.fontStyle",t),[m]=bl(o+"typography.fontWeight",t),[d]=bl(o+"typography.letterSpacing",t),[p]=bl(o+"color.background",t),[_]=bl(o+"color.gradient",t),[h]=bl(o+"color.text",t);if(!l)return null;const g=(0,E.sprintf)((0,E.__)("Typography %s styles"),r);return(0,s.createElement)(lr,{path:n+"/typography/"+a,"aria-label":g},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(y.FlexItem,{className:"edit-site-global-styles-screen-typography__indicator",style:{fontFamily:null!=c?c:"serif",background:null!=_?_:p,color:h,fontStyle:u,fontWeight:m,letterSpacing:d,...i}},(0,E.__)("Aa")),(0,s.createElement)(y.FlexItem,null,r)))}var Sl=function(e){let{name:t,variation:n=""}=e;const a=void 0===t?"":"/blocks/"+t,r=El(n);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Typography"),description:(0,E.__)("Manage the typography settings for different elements.")}),(0,s.createElement)(Zr,{name:t,variation:r}),!t&&(0,s.createElement)("div",{className:"edit-site-global-styles-screen-typography"},(0,s.createElement)(y.__experimentalVStack,{spacing:3},(0,s.createElement)(Kr,null,(0,E.__)("Elements")),(0,s.createElement)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(wl,{name:t,parentMenu:a,element:"text",label:(0,E.__)("Text")}),(0,s.createElement)(wl,{name:t,parentMenu:a,element:"link",label:(0,E.__)("Links")}),(0,s.createElement)(wl,{name:t,parentMenu:a,element:"heading",label:(0,E.__)("Headings")}),(0,s.createElement)(wl,{name:t,parentMenu:a,element:"button",label:(0,E.__)("Buttons")})))),!!t&&(0,s.createElement)(Ur,{name:t,variation:n,element:"text"}))};const{useGlobalStyle:xl}=Qe(fe.privateApis);function kl(e){let{name:t,element:n,headingLevel:a}=e,r="";"heading"===n?r=`elements.${a}.`:n&&"text"!==n&&(r=`elements.${n}.`);const[l]=xl(r+"typography.fontFamily",t),[o]=xl(r+"color.gradient",t),[i]=xl(r+"color.background",t),[c]=xl(r+"color.text",t),[u]=xl(r+"typography.fontSize",t),[m]=xl(r+"typography.fontStyle",t),[d]=xl(r+"typography.fontWeight",t),[p]=xl(r+"typography.letterSpacing",t),_="link"===n?{textDecoration:"underline"}:{};return(0,s.createElement)("div",{className:"edit-site-typography-preview",style:{fontFamily:null!=l?l:"serif",background:null!=o?o:i,color:c,fontSize:u,fontStyle:m,fontWeight:d,letterSpacing:p,..._}},"Aa")}const Cl={text:{description:(0,E.__)("Manage the fonts used on the site."),title:(0,E.__)("Text")},link:{description:(0,E.__)("Manage the fonts and typography used on the links."),title:(0,E.__)("Links")},heading:{description:(0,E.__)("Manage the fonts and typography used on headings."),title:(0,E.__)("Headings")},button:{description:(0,E.__)("Manage the fonts and typography used on buttons."),title:(0,E.__)("Buttons")}};var Tl=function(e){let{name:t,element:n}=e;const[a,r]=(0,s.useState)("heading");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:Cl[n].title,description:Cl[n].description}),(0,s.createElement)(y.__experimentalSpacer,{marginX:4},(0,s.createElement)(kl,{name:t,element:n,headingLevel:a})),"heading"===n&&(0,s.createElement)(y.__experimentalSpacer,{marginX:4,marginBottom:"1em"},(0,s.createElement)(y.__experimentalToggleGroupControl,{label:(0,E.__)("Select heading level"),hideLabelFromVision:!0,value:a,onChange:r,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0},(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"heading",label:(0,E.__)("All")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h1",label:(0,E.__)("H1")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h2",label:(0,E.__)("H2")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h3",label:(0,E.__)("H3")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h4",label:(0,E.__)("H4")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h5",label:(0,E.__)("H5")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h6",label:(0,E.__)("H6")}))),(0,s.createElement)(Ur,{name:t,element:n,headingLevel:a}))};var Nl=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/SVG"},(0,s.createElement)(b.Path,{d:"M17.192 6.75L15.47 5.03l1.06-1.06 3.537 3.53-3.537 3.53-1.06-1.06 1.723-1.72h-3.19c-.602 0-.993.202-1.28.498-.309.319-.538.792-.695 1.383-.13.488-.222 1.023-.296 1.508-.034.664-.116 1.413-.303 2.117-.193.721-.513 1.467-1.068 2.04-.575.594-1.359.954-2.357.954H4v-1.5h4.003c.601 0 .993-.202 1.28-.498.308-.319.538-.792.695-1.383.149-.557.216-1.093.288-1.662l.039-.31a9.653 9.653 0 0 1 .272-1.653c.193-.722.513-1.467 1.067-2.04.576-.594 1.36-.954 2.358-.954h3.19zM8.004 6.75c.8 0 1.46.23 1.988.628a6.24 6.24 0 0 0-.684 1.396 1.725 1.725 0 0 0-.024-.026c-.287-.296-.679-.498-1.28-.498H4v-1.5h4.003zM12.699 14.726c-.161.459-.38.94-.684 1.396.527.397 1.188.628 1.988.628h3.19l-1.722 1.72 1.06 1.06L20.067 16l-3.537-3.53-1.06 1.06 1.723 1.72h-3.19c-.602 0-.993-.202-1.28-.498a1.96 1.96 0 0 1-.024-.026z"}));var Ml=function(e){let{className:t,...n}=e;return(0,s.createElement)(y.Flex,g({className:f()("edit-site-global-styles__color-indicator-wrapper",t)},n))};const{useGlobalSetting:Il}=Qe(fe.privateApis),Pl=[];var Bl=function(e){let{name:t}=e;const[n]=Il("color.palette.custom"),[a]=Il("color.palette.theme"),[r]=Il("color.palette.default"),[l]=Il("color.defaultPalette",t),[o]=function(e){const[t,n]=Je("color.palette.theme",e);return window.__experimentalEnableColorRandomizer?[function(){const e=Math.floor(225*Math.random()),a=t.map((t=>{const{color:n}=t,a=je(n).rotate(e).toHex();return{...t,color:a}}));n(a)}]:[]}(),i=(0,s.useMemo)((()=>[...n||Pl,...a||Pl,...r&&l?r:Pl]),[n,a,r,l]),c=t?"/blocks/"+encodeURIComponent(t)+"/colors/palette":"/colors/palette",u=i.length>0?(0,E.sprintf)((0,E._n)("%d color","%d colors",i.length),i.length):(0,E.__)("Add custom colors");return(0,s.createElement)(y.__experimentalVStack,{spacing:3},(0,s.createElement)(Kr,null,(0,E.__)("Palette")),(0,s.createElement)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(lr,{path:c,"aria-label":(0,E.__)("Color palettes")},(0,s.createElement)(y.__experimentalHStack,{direction:0===i.length?"row-reverse":"row"},(0,s.createElement)(y.__experimentalZStack,{isLayered:!1,offset:-8},i.slice(0,5).map(((e,t)=>{let{color:n}=e;return(0,s.createElement)(Ml,{key:`${n}-${t}`},(0,s.createElement)(y.ColorIndicator,{colorValue:n}))}))),(0,s.createElement)(y.FlexItem,null,u)))),o&&(0,s.createElement)(y.Button,{variant:"secondary",icon:Nl,onClick:o},(0,E.__)("Randomize colors")))};const{useGlobalStyle:zl}=Qe(fe.privateApis);function Vl(e){let{name:t,parentMenu:n,variation:a=""}=e;const r=a?`variations.${a}.`:"",l=a?`/variations/${a}`:"",o=tt(t),i=o.includes("backgroundColor")||o.includes("background"),[c]=zl(r+"color.background",t),[u]=zl(r+"color.gradient",t);return i?(0,s.createElement)(lr,{path:n+l+"/colors/background","aria-label":(0,E.__)("Colors background styles")},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:null!=u?u:c,"data-testid":"background-color-indicator"})),(0,s.createElement)(y.FlexItem,{className:"edit-site-global-styles__color-label"},(0,E.__)("Background")))):null}function Rl(e){let{name:t,parentMenu:n,variation:a=""}=e;const r=a?`variations.${a}.`:"",l=a?`/variations/${a}`:"",o=tt(t).includes("color"),[i]=zl(r+"color.text",t);return o?(0,s.createElement)(lr,{path:n+l+"/colors/text","aria-label":(0,E.__)("Colors text styles")},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:i,"data-testid":"text-color-indicator"})),(0,s.createElement)(y.FlexItem,{className:"edit-site-global-styles__color-label"},(0,E.__)("Text")))):null}function Al(e){let{name:t,parentMenu:n,variation:a=""}=e;const r=a?`variations.${a}.`:"",l=a?`/variations/${a}`:"",o=tt(t).includes("linkColor"),[i]=zl(r+"elements.link.color.text",t),[c]=zl(r+"elements.link.:hover.color.text",t);return o?(0,s.createElement)(lr,{path:n+l+"/colors/link","aria-label":(0,E.__)("Colors link styles")},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(y.__experimentalZStack,{isLayered:!1,offset:-8},(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:i})),(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:c}))),(0,s.createElement)(y.FlexItem,{className:"edit-site-global-styles__color-label"},(0,E.__)("Links")))):null}function Ll(e){let{name:t,parentMenu:n,variation:a=""}=e;const r=a?`variations.${a}.`:"",l=a?`/variations/${a}`:"",o=tt(t).includes("color"),[i]=zl(r+"elements.heading.color.text",t),[c]=zl(r+"elements.heading.color.background",t);return o?(0,s.createElement)(lr,{path:n+l+"/colors/heading","aria-label":(0,E.__)("Colors heading styles")},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(y.__experimentalZStack,{isLayered:!1,offset:-8},(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:c})),(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:i}))),(0,s.createElement)(y.FlexItem,null,(0,E.__)("Headings")))):null}function Dl(e){let{name:t,parentMenu:n,variation:a=""}=e;const r=a?`variations.${a}.`:"",l=a?`/variations/${a}`:"",o=tt(t).includes("buttonColor"),[i]=zl(r+"elements.button.color.text",t),[c]=zl(r+"elements.button.color.background",t);return o?(0,s.createElement)(lr,{path:n+l+"/colors/button"},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(y.__experimentalZStack,{isLayered:!1,offset:-8},(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:c})),(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:i}))),(0,s.createElement)(y.FlexItem,{className:"edit-site-global-styles__color-label"},(0,E.__)("Buttons")))):null}var Ol=function(e){let{name:t,variation:n=""}=e;const a=void 0===t?"":"/blocks/"+encodeURIComponent(t),r=El(n);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Colors"),description:(0,E.__)("Manage palettes and the default color of different global elements on the site.")}),(0,s.createElement)(Zr,{name:t,variation:r}),(0,s.createElement)("div",{className:"edit-site-global-styles-screen-colors"},(0,s.createElement)(y.__experimentalVStack,{spacing:10},(0,s.createElement)(Bl,{name:t}),(0,s.createElement)(y.__experimentalVStack,{spacing:3},(0,s.createElement)(Kr,null,(0,E.__)("Elements")),(0,s.createElement)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(Vl,{name:t,parentMenu:a,variation:n}),(0,s.createElement)(Rl,{name:t,parentMenu:a,variation:n}),(0,s.createElement)(Al,{name:t,parentMenu:a,variation:n}),(0,s.createElement)(Ll,{name:t,parentMenu:a,variation:n}),(0,s.createElement)(Dl,{name:t,parentMenu:a,variation:n}))))))};const{useGlobalSetting:Fl}=Qe(fe.privateApis);function Gl(e){let{name:t}=e;const[n,a]=Fl("color.palette.theme",t),[r]=Fl("color.palette.theme",t,"base"),[l,o]=Fl("color.palette.default",t),[i]=Fl("color.palette.default",t,"base"),[c,u]=Fl("color.palette.custom",t),[m]=Fl("color.defaultPalette",t);return(0,s.createElement)(y.__experimentalVStack,{className:"edit-site-global-styles-color-palette-panel",spacing:10},!!n&&!!n.length&&(0,s.createElement)(y.__experimentalPaletteEdit,{canReset:n!==r,canOnlyChangeValues:!0,colors:n,onChange:a,paletteLabel:(0,E.__)("Theme")}),!!l&&!!l.length&&!!m&&(0,s.createElement)(y.__experimentalPaletteEdit,{canReset:l!==i,canOnlyChangeValues:!0,colors:l,onChange:o,paletteLabel:(0,E.__)("Default")}),(0,s.createElement)(y.__experimentalPaletteEdit,{colors:c,onChange:u,paletteLabel:(0,E.__)("Custom"),emptyMessage:(0,E.__)("Custom colors are empty! Add some colors to create your own color palette."),slugPrefix:"custom-"}))}const{useGlobalSetting:Hl}=Qe(fe.privateApis),$l=()=>{};function Ul(e){let{name:t}=e;const[n,a]=Hl("color.gradients.theme",t),[r]=Hl("color.gradients.theme",t,"base"),[l,o]=Hl("color.gradients.default",t),[i]=Hl("color.gradients.default",t,"base"),[c,u]=Hl("color.gradients.custom",t),[m]=Hl("color.defaultGradients",t),[d]=Hl("color.duotone.custom")||[],[p]=Hl("color.duotone.default")||[],[_]=Hl("color.duotone.theme")||[],[h]=Hl("color.defaultDuotone"),g=[...d||[],..._||[],...p&&h?p:[]];return(0,s.createElement)(y.__experimentalVStack,{className:"edit-site-global-styles-gradient-palette-panel",spacing:10},!!n&&!!n.length&&(0,s.createElement)(y.__experimentalPaletteEdit,{canReset:n!==r,canOnlyChangeValues:!0,gradients:n,onChange:a,paletteLabel:(0,E.__)("Theme")}),!!l&&!!l.length&&!!m&&(0,s.createElement)(y.__experimentalPaletteEdit,{canReset:l!==i,canOnlyChangeValues:!0,gradients:l,onChange:o,paletteLabel:(0,E.__)("Default")}),(0,s.createElement)(y.__experimentalPaletteEdit,{gradients:c,onChange:u,paletteLabel:(0,E.__)("Custom"),emptyMessage:(0,E.__)("Custom gradients are empty! Add some gradients to create your own palette."),slugPrefix:"custom-"}),!!g&&!!g.length&&(0,s.createElement)("div",null,(0,s.createElement)(Kr,null,(0,E.__)("Duotone")),(0,s.createElement)(y.__experimentalSpacer,{margin:3}),(0,s.createElement)(y.DuotonePicker,{duotonePalette:g,disableCustomDuotone:!0,disableCustomColors:!0,clearable:!1,onChange:$l})))}var Wl=function(e){let{name:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Palette"),description:(0,E.__)("Palettes are used to provide default color options for blocks and various design tools. Here you can edit the colors with their labels.")}),(0,s.createElement)(y.TabPanel,{tabs:[{name:"solid",title:"Solid",value:"solid"},{name:"gradient",title:"Gradient",value:"gradient"}]},(e=>(0,s.createElement)(s.Fragment,null,"solid"===e.value&&(0,s.createElement)(Gl,{name:t}),"gradient"===e.value&&(0,s.createElement)(Ul,{name:t})))))};const{useGlobalSetting:jl,useGlobalStyle:ql}=Qe(fe.privateApis);var Yl=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",r=tt(t),[l]=jl("color.custom",t),[o]=jl("color.customGradient",t),i=nt(t),c=at(t),[u]=jl("color.background",t),m=r.includes("backgroundColor")&&u&&(i.length>0||l),d=r.includes("background")&&(c.length>0||o),[p,_]=ql(a+"color.background",t),[h]=ql(a+"color.background",t,"user"),[v,y]=ql(a+"color.gradient",t),[b]=ql(a+"color.gradient",t,"user");if(!m&&!d)return null;let w={};m&&(w={colorValue:p,onColorChange:_},p&&(w.clearable=p===h));let S={};d&&(S={gradientValue:v,onGradientChange:y},v&&(S.clearable=v===b));const x={...w,...S};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Background"),description:(0,E.__)("Set a background color or gradient for the whole site.")}),(0,s.createElement)(fe.__experimentalColorGradientControl,g({className:f()("edit-site-screen-background-color__control",{"has-no-tabs":!m||!d}),colors:i,gradients:c,disableCustomColors:!l,disableCustomGradients:!o,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0},x)))};const{useGlobalSetting:Xl,useGlobalStyle:Zl}=Qe(fe.privateApis);var Kl=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",r=tt(t),[l]=Xl("color.custom",t),[o]=Xl("color.text",t),i=nt(t),c=r.includes("color")&&o&&(i.length>0||l),[u,m]=Zl(a+"color.text",t),[d]=Zl(a+"color.text",t,"user");return c?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Text"),description:(0,E.__)("Set the default color used for text across the site.")}),(0,s.createElement)(fe.__experimentalColorGradientControl,{className:"edit-site-screen-text-color__control",colors:i,disableCustomColors:!l,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:u,onColorChange:m,clearable:u===d})):null};const{useGlobalSetting:Ql,useGlobalStyle:Jl}=Qe(fe.privateApis);var eo=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",r=tt(t),[l]=Ql("color.custom",t),o=nt(t),[i]=Ql("color.link",t),c=r.includes("linkColor")&&i&&(o.length>0||l),u={default:{label:(0,E.__)("Default"),value:Jl(a+"elements.link.color.text",t)[0],handler:Jl(a+"elements.link.color.text",t)[1],userValue:Jl(a+"elements.link.color.text",t,"user")[0]},hover:{label:(0,E.__)("Hover"),value:Jl(a+"elements.link.:hover.color.text",t)[0],handler:Jl(a+"elements.link.:hover.color.text",t)[1],userValue:Jl(a+"elements.link.:hover.color.text",t,"user")[0]}};if(!c)return null;const m=Object.entries(u).map((e=>{let[t,n]=e;return{name:t,title:n.label,className:`color-text-${t}`}}));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Links"),description:(0,E.__)("Set the colors used for links across the site.")}),(0,s.createElement)(y.TabPanel,{tabs:m},(e=>{var t;const n=null!==(t=u[e.name])&&void 0!==t?t:null;return n?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fe.__experimentalColorGradientControl,{className:"edit-site-screen-link-color__control",colors:o,disableCustomColors:!l,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:n.value,onColorChange:n.handler,clearable:n.value===n.userValue})):null})))};const{useGlobalSetting:to,useGlobalStyle:no}=Qe(fe.privateApis);var ao=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",[r,l]=(0,s.useState)("heading"),o=tt(t),[i]=to("color.custom",t),[c]=to("color.customGradient",t),[u]=to("color.text",t),[m]=to("color.background",t),d=nt(t),p=at(t),_=o.includes("color")&&u&&(d.length>0||i),h=o.includes("backgroundColor")&&m&&(d.length>0||i),v=o.includes("background")&&(p.length>0||c),[f,b]=no(a+"elements."+r+".color.text",t),[w]=no(a+"elements."+r+".color.text",t,"user"),[S,x]=no(a+"elements."+r+".color.background",t),[k]=no(a+"elements."+r+".color.background",t,"user"),[C,T]=no(a+"elements."+r+".color.gradient",t),[N]=no(a+"elements."+r+".color.gradient",t,"user");if(!_&&!h&&!v)return null;let M={};h&&(M={colorValue:S,onColorChange:x},S&&(M.clearable=S===k));let I={};v&&(I={gradientValue:C,onGradientChange:T},C&&(I.clearable=C===N));const P={...M,...I};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Headings"),description:(0,E.__)("Set the default color used for headings across the site.")}),(0,s.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,s.createElement)("h4",null,(0,E.__)("Select heading level")),(0,s.createElement)(y.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Select heading level"),hideLabelFromVision:!0,value:r,onChange:l,isBlock:!0},(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"heading",label:(0,E.__)("All")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h1",label:(0,E.__)("H1")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h2",label:(0,E.__)("H2")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h3",label:(0,E.__)("H3")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h4",label:(0,E.__)("H4")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h5",label:(0,E.__)("H5")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h6",label:(0,E.__)("H6")}))),_&&(0,s.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,s.createElement)("h4",null,"heading"===r?(0,E.__)("Text color for all heading levels"):(0,E.sprintf)((0,E.__)("Text color for %s"),r.toUpperCase())),(0,s.createElement)(fe.__experimentalColorGradientControl,{className:"edit-site-screen-heading-text-color__control",colors:d,disableCustomColors:!i,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:f,onColorChange:b,clearable:f===w})),h&&(0,s.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,s.createElement)("h4",null,"heading"===r?(0,E.__)("Background color for all heading levels"):(0,E.sprintf)((0,E.__)("Background color for %s"),r.toUpperCase())),(0,s.createElement)(fe.__experimentalColorGradientControl,g({className:"edit-site-screen-heading-background-color__control",colors:d,gradients:p,disableCustomColors:!i,disableCustomGradients:!c,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0},P))))};const{useGlobalSetting:ro,useGlobalStyle:lo}=Qe(fe.privateApis);var oo=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",r=tt(t),l=nt(t),[o]=ro("color.custom",t),[i]=ro("color.background",t),c=r.includes("buttonColor")&&i&&(l.length>0||o),[u,m]=lo(a+"elements.button.color.text",t),[d]=lo("elements.button.color.text",t,"user"),[p,_]=lo("elements.button.color.background",t),[h]=lo("elements.button.color.background",t,"user");return c?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Buttons"),description:(0,E.__)("Set the default colors used for buttons across the site.")}),(0,s.createElement)("h4",{className:"edit-site-global-styles-section-title"},(0,E.__)("Text color")),(0,s.createElement)(fe.__experimentalColorGradientControl,{className:"edit-site-screen-button-color__control",colors:l,disableCustomColors:!o,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:u,onColorChange:m,clearable:u===d}),(0,s.createElement)("h4",{className:"edit-site-global-styles-section-title"},(0,E.__)("Background color")),(0,s.createElement)(fe.__experimentalColorGradientControl,{className:"edit-site-screen-button-color__control",colors:l,disableCustomColors:!o,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:p,onColorChange:_,clearable:p===h})):null};var io=function(e){let{name:t,variation:n=""}=e;const a=kr(t),r=El(n);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Layout")}),(0,s.createElement)(Zr,{name:t,variation:r}),a&&(0,s.createElement)(Rr,{name:t,variation:n}))},so=n(5619),co=n.n(so);function uo(){return(0,s.createElement)("div",{className:"edit-site-canvas-spinner"},(0,s.createElement)(y.Spinner,null))}const{GlobalStylesContext:mo}=Qe(fe.privateApis);function po(e,t){if(Array.isArray(t))return t}function _o(e,t){return(0,ve.mergeWith)({},e,t,po)}const ho=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.fromEntries(Object.entries((0,ve.mapValues)(e,ho)).filter((e=>{let[,t]=e;return Boolean(t)})));return(0,ve.isEmpty)(t)?void 0:t};function go(){const[e,t,n]=function(){const{globalStylesId:e,isReady:t,settings:n,styles:a}=(0,m.useSelect)((e=>{const{getEditedEntityRecord:t,hasFinishedResolution:n}=e(_.store),a=e(_.store).__experimentalGetCurrentGlobalStylesId(),r=a?t("root","globalStyles",a):void 0;let l=!1;return n("__experimentalGetCurrentGlobalStylesId")&&(l=!a||n("getEditedEntityRecord",["root","globalStyles",a])),{globalStylesId:a,isReady:l,settings:null==r?void 0:r.settings,styles:null==r?void 0:r.styles}}),[]),{getEditedEntityRecord:r}=(0,m.useSelect)(_.store),{editEntityRecord:l}=(0,m.useDispatch)(_.store),o=(0,s.useMemo)((()=>({settings:null!=n?n:{},styles:null!=a?a:{}})),[n,a]),i=(0,s.useCallback)((function(t){var n,a;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=r("root","globalStyles",e),s=t({styles:null!==(n=null==i?void 0:i.styles)&&void 0!==n?n:{},settings:null!==(a=null==i?void 0:i.settings)&&void 0!==a?a:{}});l("root","globalStyles",e,{styles:ho(s.styles)||{},settings:ho(s.settings)||{}},o)}),[e]);return[t,o,i]}(),[a,r]=function(){const e=(0,m.useSelect)((e=>e(_.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),l=(0,s.useMemo)((()=>r&&t?_o(r,t):{}),[t,r]);return(0,s.useMemo)((()=>({isReady:e&&a,user:t,base:r,merged:l,setUserConfig:n})),[l,t,r,n,e,a])}function vo(e){let{children:t}=e;const n=go();return n.isReady?(0,s.createElement)(mo.Provider,{value:n},t):(0,s.createElement)(uo,null)}const{GlobalStylesContext:fo}=Qe(fe.privateApis);function yo(e){let{variation:t}=e;const[n,a]=(0,s.useState)(!1),{base:r,user:l,setUserConfig:o}=(0,s.useContext)(fo),i=(0,s.useMemo)((()=>{var e,n;return{user:{settings:null!==(e=t.settings)&&void 0!==e?e:{},styles:null!==(n=t.styles)&&void 0!==n?n:{}},base:r,merged:_o(r,t),setUserConfig:()=>{}}}),[t,r]),c=()=>{o((()=>({settings:t.settings,styles:t.styles})))},u=(0,s.useMemo)((()=>function(e,t){return co()(e.styles,t.styles)&&co()(e.settings,t.settings)}(l,t)),[l,t]);return(0,s.createElement)(fo.Provider,{value:i},(0,s.createElement)("div",{className:f()("edit-site-global-styles-variations_item",{"is-active":u}),role:"button",onClick:c,onKeyDown:e=>{e.keyCode===qa.ENTER&&(e.preventDefault(),c())},tabIndex:"0","aria-label":null==t?void 0:t.title,"aria-current":u,onFocus:()=>a(!0),onBlur:()=>a(!1)},(0,s.createElement)("div",{className:"edit-site-global-styles-variations_item-preview"},(0,s.createElement)(hl,{label:null==t?void 0:t.title,isFocused:n,withHoverView:!0}))))}var Eo=function(){const{variations:e,mode:t}=(0,m.useSelect)((e=>({variations:e(_.store).__experimentalGetCurrentThemeGlobalStylesVariations(),mode:e(fe.store).__unstableGetEditorMode()})),[]),n=(0,s.useMemo)((()=>[{title:(0,E.__)("Default"),settings:{},styles:{}},...e.map((e=>{var t,n;return{...e,settings:null!==(t=e.settings)&&void 0!==t?t:{},styles:null!==(n=e.styles)&&void 0!==n?n:{}}}))]),[e]),{__unstableSetEditorMode:a}=(0,m.useDispatch)(fe.store),r=(0,s.useRef)(null);return(0,s.useEffect)((()=>{"zoom-out"!==t&&(r.current=!1)}),[t]),(0,s.useEffect)((()=>{if("zoom-out"!==t)return a("zoom-out"),r.current=!0,()=>{r.current&&a(t)}}),[]),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{back:"/",title:(0,E.__)("Browse styles"),description:(0,E.__)("Choose a variation to change the look of the site.")}),(0,s.createElement)(y.Card,{size:"small",isBorderless:!0},(0,s.createElement)(y.CardBody,null,(0,s.createElement)(y.__experimentalGrid,{columns:2},null==n?void 0:n.map(((e,t)=>(0,s.createElement)(yo,{key:t,variation:e})))))))};var bo=function(e){let{name:t,variation:n=""}=e;const a=dr(t),r=El(n);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Border")}),(0,s.createElement)(Zr,{name:t,variation:r}),a&&(0,s.createElement)(fr,{name:t,variation:n}))};const{ExperimentalBlockEditorProvider:wo,useGlobalStyle:So}=Qe(fe.privateApis),xo="EditSiteStyleBook",{Slot:ko,Fill:Co}=(0,y.createSlotFill)(xo);function To(){return[{name:"core/heading",title:(0,E.__)("Headings"),category:"text",blocks:[(0,c.createBlock)("core/heading",{content:(0,E.__)("Code Is Poetry"),level:1}),(0,c.createBlock)("core/heading",{content:(0,E.__)("Code Is Poetry"),level:2}),(0,c.createBlock)("core/heading",{content:(0,E.__)("Code Is Poetry"),level:3}),(0,c.createBlock)("core/heading",{content:(0,E.__)("Code Is Poetry"),level:4}),(0,c.createBlock)("core/heading",{content:(0,E.__)("Code Is Poetry"),level:5})]},...(0,c.getBlockTypes)().filter((e=>{const{name:t,example:n,supports:a}=e;return"core/heading"!==t&&!!n&&!1!==a.inserter})).map((e=>({name:e.name,title:e.title,category:e.category,blocks:(0,c.getBlockFromExample)(e.name,e.example)})))]}function No(e){let{isSelected:t,onSelect:n,onClose:a}=e;const[r,l]=(0,te.useResizeObserver)(),o=(0,te.useFocusOnMount)("firstElement"),i=(0,te.useFocusReturn)(),[u]=So("color.text"),[d]=So("color.background"),p=(0,s.useMemo)(To,[]),_=(0,s.useMemo)((()=>(0,c.getCategories)().filter((e=>p.some((t=>t.category===e.slug)))).map((e=>({name:e.slug,title:e.title,icon:e.icon})))),[p]),h=(0,m.useSelect)((e=>e(fe.store).getSettings()),[]),g=(0,s.useMemo)((()=>({...h,__unstableIsPreviewMode:!0})),[h]);return(0,s.createElement)(Co,null,(0,s.createElement)("section",{className:f()("edit-site-style-book",{"is-wide":l.width>600}),style:{color:u,background:d},"aria-label":(0,E.__)("Style Book"),onKeyDown:function(e){e.keyCode!==qa.ESCAPE||e.defaultPrevented||(e.preventDefault(),a())},ref:(0,te.useMergeRefs)([i,o])},r,(0,s.createElement)(y.Button,{className:"edit-site-style-book__close-button",icon:C,label:(0,E.__)("Close Style Book"),onClick:a,showTooltip:!1}),(0,s.createElement)(y.TabPanel,{className:"edit-site-style-book__tab-panel",tabs:_},(e=>(0,s.createElement)(fe.__unstableIframe,{className:"edit-site-style-book__iframe",head:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fe.__unstableEditorStyles,{styles:g.styles}),(0,s.createElement)("style",null,'.is-root-container { display: flow-root; }\n\t\t\t\t\t\t\t\t\t\t\tbody { position: relative; padding: 32px !important; }\n\t.edit-site-style-book__examples {\n\t\tmax-width: 900px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.edit-site-style-book__example {\n\t\tborder-radius: 2px;\n\t\tcursor: pointer;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 40px;\n\t\tmargin-bottom: 40px;\n\t\tpadding: 16px;\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t}\n\n\t.edit-site-style-book__example.is-selected {\n\t\tbox-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t}\n\n\t.edit-site-style-book__example:focus:not(:disabled) {\n\t\tbox-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t\toutline: 3px solid transparent;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example {\n\t\tflex-direction: row;\n\t}\n\n\t.edit-site-style-book__example-title {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\tfont-size: 11px;\n\t\tfont-weight: 500;\n\t\tline-height: normal;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\ttext-transform: uppercase;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example-title {\n\t\ttext-align: right;\n\t\twidth: 120px;\n\t}\n\n\t.edit-site-style-book__example-preview {\n\t\twidth: 100%;\n\t}\n\n\t.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,\n\t.edit-site-style-book__example-preview .block-list-appender {\n\t\tdisplay: none;\n\t}\n\n\t.edit-site-style-book__example-preview .is-root-container > .wp-block:first-child {\n\t\tmargin-top: 0;\n\t}\n\t.edit-site-style-book__example-preview .is-root-container > .wp-block:last-child {\n\t\tmargin-bottom: 0;\n\t}\n')),name:"style-book-canvas",tabIndex:0},g.svgFilters,(0,s.createElement)(Mo,{className:f()("edit-site-style-book__examples",{"is-wide":l.width>600}),examples:p,category:e.name,label:(0,E.sprintf)((0,E.__)("Examples of blocks in the %s category"),e.title),isSelected:t,onSelect:n}))))))}const Mo=(0,s.memo)((e=>{let{className:t,examples:n,category:a,label:r,isSelected:l,onSelect:o}=e;const i=(0,y.__unstableUseCompositeState)({orientation:"vertical"});return(0,s.createElement)(y.__unstableComposite,g({},i,{className:t,"aria-label":r}),n.filter((e=>e.category===a)).map((e=>(0,s.createElement)(Io,{key:e.name,id:`example-${e.name}`,composite:i,title:e.title,blocks:e.blocks,isSelected:l(e.name),onClick:()=>{o(e.name)}}))))})),Io=e=>{let{composite:t,id:n,title:a,blocks:r,isSelected:l,onClick:o}=e;const i=(0,m.useSelect)((e=>e(fe.store).getSettings()),[]),c=(0,s.useMemo)((()=>({...i,__unstableIsPreviewMode:!0})),[i]),u=(0,s.useMemo)((()=>Array.isArray(r)?r:[r]),[r]);return(0,s.createElement)(y.__unstableCompositeItem,g({},t,{className:f()("edit-site-style-book__example",{"is-selected":l}),id:n,"aria-label":(0,E.sprintf)((0,E.__)("Open %s styles in Styles panel"),a),onClick:o,role:"button",as:"div"}),(0,s.createElement)("span",{className:"edit-site-style-book__example-title"},a),(0,s.createElement)("div",{className:"edit-site-style-book__example-preview","aria-hidden":!0},(0,s.createElement)(y.Disabled,{className:"edit-site-style-book__example-preview__content"},(0,s.createElement)(wo,{value:u,settings:c},(0,s.createElement)(fe.BlockList,{renderAppender:!1})))))};No.Slot=ko;var Po=No;var Bo=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));const{useGlobalStyle:zo}=Qe(fe.privateApis);var Vo=function(e){let{blockName:t}=e;const n=t||null,[a,r]=zo("css",n),[l]=zo("css",n,"base"),[o,i]=(0,s.useState)(null),c="/* IgnoreThemeCustomCSS */",u=!a&&l?`/* ${(0,E.__)("Theme Custom CSS start")} */\n${l}\n/* ${(0,E.__)("Theme Custom CSS end")} */`:void 0,m=l&&a&&u!==a?l:void 0;return(0,s.createElement)(s.Fragment,null,m&&(0,s.createElement)(y.Panel,null,(0,s.createElement)(y.PanelBody,{title:(0,E.__)("Original Theme Custom CSS"),initialOpen:!1},(0,s.createElement)("pre",{className:"edit-site-global-styles__custom-css-theme-css"},m))),(0,s.createElement)(y.__experimentalVStack,{spacing:3},(0,s.createElement)(Kr,null,(0,E.__)("ADDITIONAL CSS")),(0,s.createElement)(y.TextareaControl,{__nextHasNoMarginBottom:!0,value:(null==a?void 0:a.replace(c,""))||u,onChange:e=>function(e){if(l&&""===e)r(c);else if(r(e),o){const[t]=(0,fe.transformStyles)([{css:e}],".editor-styles-wrapper");t&&i(null)}}(e),onBlur:function(e){var t;if(null==e||null===(t=e.target)||void 0===t||!t.value)return void i(null);const[n]=(0,fe.transformStyles)([{css:e.target.value}],".editor-styles-wrapper");i(null===n?(0,E.__)("There is an error with your CSS structure."):null)},className:"edit-site-global-styles__custom-css-input",spellCheck:!1}),o&&(0,s.createElement)(y.Tooltip,{text:o},(0,s.createElement)("div",{className:"edit-site-global-styles__custom-css-validation-wrapper"},(0,s.createElement)(y.Icon,{icon:Bo,className:"edit-site-global-styles__custom-css-validation-icon"})))))};var Ro=function(e){let{name:t}=e;const n=(0,c.getBlockType)(t),a=null==n?void 0:n.title,r=void 0!==a?(0,E.sprintf)((0,E.__)("Add your own CSS to customize the appearance of the %s block."),a):(0,E.__)("Add your own CSS to customize the appearance and layout of your site.");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("CSS"),description:(0,s.createElement)(s.Fragment,null,r,(0,s.createElement)(y.ExternalLink,{href:"https://wordpress.org/support/article/css/",className:"edit-site-global-styles-screen-css-help-link"},(0,E.__)("Learn more about CSS")))}),(0,s.createElement)("div",{className:"edit-site-global-styles-screen-css"},(0,s.createElement)(Vo,{blockName:t})))};var Ao=function(e){let{name:t,variation:n=""}=e;const a=El(n),r=nl(t);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Shadow")}),(0,s.createElement)(Zr,{name:t,variation:a}),r&&(0,s.createElement)(al,{name:t,variation:n}))};const{Slot:Lo,Fill:Do}=(0,y.createSlotFill)("GlobalStylesMenu");function Oo(){const{toggle:e}=(0,m.useDispatch)(T.store),{canEditCSS:t}=(0,m.useSelect)((e=>{var t,n;const{getEntityRecord:a,__experimentalGetCurrentGlobalStylesId:r}=e(_.store),l=r(),o=l?a("root","globalStyles",l):void 0;return{canEditCSS:null!==(t=!(null==o||null===(n=o._links)||void 0===n||!n["wp:action-edit-css"]))&&void 0!==t&&t}}),[]),{useGlobalStylesReset:n}=Qe(fe.privateApis),[a,r]=n(),{goTo:l}=(0,y.__experimentalUseNavigator)();return(0,s.createElement)(Do,null,(0,s.createElement)(y.DropdownMenu,{icon:re,label:(0,E.__)("Styles actions"),controls:[{title:(0,E.__)("Reset to defaults"),onClick:r,isDisabled:!a},{title:(0,E.__)("Welcome Guide"),onClick:()=>e("core/edit-site","welcomeGuideStyles")},...t?[{title:(0,E.__)("Additional CSS"),onClick:()=>l("/css")}]:[]]}))}function Fo(e){let{className:t,...n}=e;return(0,s.createElement)(y.__experimentalNavigatorScreen,g({className:["edit-site-global-styles-sidebar__navigator-screen",t].filter(Boolean).join(" ")},n))}function Go(e){let{name:t}=e;const n=(0,m.useSelect)((e=>{const{getBlockStyles:n}=e(c.store);return n(t)}),[t]);return null!=n&&n.length?n.map((e=>(0,s.createElement)($o,{key:e.name+t,name:t,parentMenu:"/blocks/"+encodeURIComponent(t)+"/variations/"+encodeURIComponent(e.name),variation:e.name}))):null}function Ho(e){let{parentMenu:t,blockStyles:n,blockName:a}=e;return n.map(((e,n)=>(0,s.createElement)(Fo,{key:n,path:t+"/variations/"+e.name},(0,s.createElement)(Jr,{blockName:a,style:e}))))}function $o(e){let{name:t,parentMenu:n="",variation:a=""}=e;const r=(0,m.useSelect)((e=>{const{getBlockStyles:n}=e(c.store);return n(t)}),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Fo,{path:n+"/typography"},(0,s.createElement)(Sl,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/typography/text"},(0,s.createElement)(Tl,{name:t,element:"text"})),(0,s.createElement)(Fo,{path:n+"/typography/link"},(0,s.createElement)(Tl,{name:t,element:"link"})),(0,s.createElement)(Fo,{path:n+"/typography/heading"},(0,s.createElement)(Tl,{name:t,element:"heading"})),(0,s.createElement)(Fo,{path:n+"/typography/button"},(0,s.createElement)(Tl,{name:t,element:"button"})),(0,s.createElement)(Fo,{path:n+"/colors"},(0,s.createElement)(Ol,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/colors/palette"},(0,s.createElement)(Wl,{name:t})),(0,s.createElement)(Fo,{path:n+"/colors/background"},(0,s.createElement)(Yl,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/colors/text"},(0,s.createElement)(Kl,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/colors/link"},(0,s.createElement)(eo,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/colors/heading"},(0,s.createElement)(ao,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/colors/button"},(0,s.createElement)(oo,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/border"},(0,s.createElement)(bo,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/effects"},(0,s.createElement)(Ao,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/layout"},(0,s.createElement)(io,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/css"},(0,s.createElement)(Ro,{name:t})),!(null==r||!r.length)&&(0,s.createElement)(Ho,{parentMenu:n,blockStyles:r,blockName:t}))}function Uo(e){let{onClose:t}=e;const n=(0,y.__experimentalUseNavigator)(),{path:a}=n.location;return(0,s.createElement)(Po,{isSelected:e=>a===`/blocks/${encodeURIComponent(e)}`||a.startsWith(`/blocks/${encodeURIComponent(e)}/`),onSelect:e=>{n.goTo("/blocks/"+encodeURIComponent(e))},onClose:t})}var Wo=function(e){let{isStyleBookOpened:t,onCloseStyleBook:n}=e;const a=(0,c.getBlockTypes)();return(0,s.createElement)(y.__experimentalNavigatorProvider,{className:"edit-site-global-styles-sidebar__navigator-provider",initialPath:"/"},(0,s.createElement)(Fo,{path:"/"},(0,s.createElement)(gl,null)),(0,s.createElement)(Fo,{path:"/variations"},(0,s.createElement)(Eo,null)),(0,s.createElement)(Fo,{path:"/blocks"},(0,s.createElement)(fl,null)),a.map((e=>(0,s.createElement)(Fo,{key:"menu-block-"+e.name,path:"/blocks/"+encodeURIComponent(e.name)},(0,s.createElement)(yl,{name:e.name})))),(0,s.createElement)($o,null),a.map((e=>(0,s.createElement)($o,{key:"screens-block-"+e.name,name:e.name,parentMenu:"/blocks/"+encodeURIComponent(e.name)}))),a.map(((e,t)=>(0,s.createElement)(Go,{key:"screens-block-styles-"+e.name+t,name:e.name}))),t&&(0,s.createElement)(Uo,{onClose:n}),(0,s.createElement)(Oo,null))};function jo(){const[e,t]=(0,s.useState)(!1),n=(0,m.useSelect)((e=>e(An).getEditorMode()),[]);return(0,s.useEffect)((()=>{"visual"!==n&&t(!1)}),[n]),(0,s.createElement)(er,{className:"edit-site-global-styles-sidebar",identifier:"edit-site/global-styles",title:(0,E.__)("Styles"),icon:tr,closeLabel:(0,E.__)("Close Styles sidebar"),panelClassName:"edit-site-global-styles-sidebar__panel",header:(0,s.createElement)(y.Flex,{className:"edit-site-global-styles-sidebar__header"},(0,s.createElement)(y.FlexBlock,{style:{minWidth:"min-content"}},(0,s.createElement)("strong",null,(0,E.__)("Styles"))),(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(y.Button,{icon:nr,label:(0,E.__)("Style Book"),isPressed:e,disabled:"visual"!==n,onClick:()=>{t(!e)}})),(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(Lo,null)))},(0,s.createElement)(Wo,{isStyleBookOpened:e,onCloseStyleBook:()=>t(!1)}))}const qo="edit-site/template",Yo="edit-site/block-inspector";var Xo=e=>{let{sidebarName:t}=e;const{enableComplementaryArea:n}=(0,m.useDispatch)(F),[a,r]=t===qo?[(0,E.__)("Template (selected)"),"is-active"]:[(0,E.__)("Template"),""],[l,o]=t===Yo?[(0,E.__)("Block (selected)"),"is-active"]:[(0,E.__)("Block"),""];return(0,s.createElement)("ul",null,(0,s.createElement)("li",null,(0,s.createElement)(y.Button,{onClick:()=>n(Dt,qo),className:`edit-site-sidebar-edit-mode__panel-tab ${r}`,"aria-label":a,"data-label":(0,E.__)("Template")},(0,E.__)("Template"))),(0,s.createElement)("li",null,(0,s.createElement)(y.Button,{onClick:()=>n(Dt,Yo),className:`edit-site-sidebar-edit-mode__panel-tab ${o}`,"aria-label":l,"data-label":(0,E.__)("Block")},(0,E.__)("Block"))))};function Zo(e){let{template:t}=e;const{revertTemplate:n}=(0,m.useDispatch)(An);return Ot(t)?(0,s.createElement)(y.DropdownMenu,{icon:re,label:(0,E.__)("Actions"),className:"edit-site-template-card__actions",toggleProps:{isSmall:!0}},(e=>{let{onClose:a}=e;return(0,s.createElement)(y.MenuGroup,null,(0,s.createElement)(y.MenuItem,{info:(0,E.__)("Use the template as supplied by the theme."),onClick:()=>{n(t),a()}},(0,E.__)("Clear customizations")))})):null}function Ko(e){let{area:t,clientId:n}=e;const{selectBlock:a,toggleBlockHighlight:r}=(0,m.useDispatch)(fe.store),l=(0,m.useSelect)((e=>e(h.store).__experimentalGetDefaultTemplatePartAreas().find((e=>e.area===t))),[t]),o=()=>r(n,!0),i=()=>r(n,!1);return(0,s.createElement)(y.Button,{className:"edit-site-template-card__template-areas-item",icon:null==l?void 0:l.icon,onMouseOver:o,onMouseLeave:i,onFocus:o,onBlur:i,onClick:()=>{a(n)}},null==l?void 0:l.label)}function Qo(){const e=(0,m.useSelect)((e=>e(An).getCurrentTemplateTemplateParts()),[]);return e.length?(0,s.createElement)("section",{className:"edit-site-template-card__template-areas"},(0,s.createElement)(y.__experimentalHeading,{level:3,className:"edit-site-template-card__template-areas-title"},(0,E.__)("Areas")),(0,s.createElement)("ul",{className:"edit-site-template-card__template-areas-list"},e.map((e=>{let{templatePart:t,block:n}=e;return(0,s.createElement)("li",{key:t.slug},(0,s.createElement)(Ko,{area:t.area,clientId:n.clientId}))})))):null}function Jo(){const{info:{title:e,description:t,icon:n},template:a}=(0,m.useSelect)((e=>{const{getEditedPostType:t,getEditedPostId:n}=e(An),{getEditedEntityRecord:a}=e(_.store),{__experimentalGetTemplateInfo:r}=e(h.store),l=a("postType",t(),n());return{info:l?r(l):{},template:l}}),[]);return e||t?(0,s.createElement)("div",{className:"edit-site-template-card"},(0,s.createElement)(y.Icon,{className:"edit-site-template-card__icon",icon:n}),(0,s.createElement)("div",{className:"edit-site-template-card__content"},(0,s.createElement)("div",{className:"edit-site-template-card__header"},(0,s.createElement)("h2",{className:"edit-site-template-card__title"},(0,Un.decodeEntities)(e)),(0,s.createElement)(Zo,{template:a})),(0,s.createElement)("div",{className:"edit-site-template-card__description"},(0,Un.decodeEntities)(t)),(0,s.createElement)(Qo,null))):null}const{Slot:ei,Fill:ti}=(0,y.createSlotFill)("EditSiteSidebarInspector"),ni=ti;function ai(){const{sidebar:e,isEditorSidebarOpened:t,hasBlockSelection:n,supportsGlobalStyles:a}=(0,m.useSelect)((e=>{const t=e(F).getActiveComplementaryArea(Dt),n=[Yo,qo].includes(t),a=e(An).getSettings();return{sidebar:t,isEditorSidebarOpened:n,hasBlockSelection:!!e(fe.store).getBlockSelectionStart(),supportsGlobalStyles:!(null!=a&&a.supportsTemplatePartsMode)}}),[]),{enableComplementaryArea:r}=(0,m.useDispatch)(F);(0,s.useEffect)((()=>{t&&r(Dt,n?Yo:qo)}),[n,t]);let l=e;return t||(l=n?Yo:qo),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(er,{identifier:l,title:(0,E.__)("Settings"),icon:(0,E.isRTL)()?Qa:Ja,closeLabel:(0,E.__)("Close settings sidebar"),header:(0,s.createElement)(Xo,{sidebarName:l}),headerClassName:"edit-site-sidebar-edit-mode__panel-tabs"},l===qo&&(0,s.createElement)(y.PanelBody,null,(0,s.createElement)(Jo,null)),l===Yo&&(0,s.createElement)(ei,{bubblesVirtually:!0})),a&&(0,s.createElement)(jo,null))}var ri=window.wp.reusableBlocks;const li=(e,t)=>`${t}`,oi=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,ii=e=>{const{title:t,foreign_landing_url:n,creator:a,creator_url:r,license:l,license_version:o,license_url:i}=e,s=((e,t)=>{let n=e.trim();return"pdm"!==e&&(n=e.toUpperCase().replace("SAMPLING","Sampling")),t&&(n+=` ${t}`),["pdm","cc0"].includes(e)||(n=`CC ${n}`),n})(l,o),c=(0,Un.decodeEntities)(a);let u;return u=c?t?(0,E.sprintf)((0,E._x)('"%1$s" by %2$s/ %3$s',"caption"),li(n,(0,Un.decodeEntities)(t)),r?li(r,c):c,i?li(`${i}?ref=openverse`,s):s):(0,E.sprintf)((0,E._x)("Work by %2$s/ %3$s","caption"),oi(n),r?li(r,c):c,i?li(`${i}?ref=openverse`,s):s):t?(0,E.sprintf)((0,E._x)('"%1$s"/ %2$s',"caption"),li(n,(0,Un.decodeEntities)(t)),i?li(`${i}?ref=openverse`,s):s):(0,E.sprintf)((0,E._x)("Work/ %3$s","caption"),oi(n),i?li(`${i}?ref=openverse`,s):s),u.replace(/\s{2}/g," ")},si=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=await(0,m.resolveSelect)(_.store).getMediaItems({...e,orderBy:null!=e&&e.search?"relevance":"date"});return t.map((e=>{var t,n,a,r;return{...e,alt:e.alt_text,url:e.source_url,previewUrl:null===(t=e.media_details)||void 0===t||null===(n=t.sizes)||void 0===n||null===(a=n.medium)||void 0===a?void 0:a.source_url,caption:null===(r=e.caption)||void 0===r?void 0:r.raw}}))},ci=[{name:"images",labels:{name:(0,E.__)("Images"),search_items:(0,E.__)("Search images")},mediaType:"image",async fetch(){return si({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},media_type:"image"})}},{name:"videos",labels:{name:(0,E.__)("Videos"),search_items:(0,E.__)("Search videos")},mediaType:"video",async fetch(){return si({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},media_type:"video"})}},{name:"audio",labels:{name:(0,E.__)("Audio"),search_items:(0,E.__)("Search audio")},mediaType:"audio",async fetch(){return si({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},media_type:"audio"})}},{name:"openverse",labels:{name:(0,E.__)("Openverse"),search_items:(0,E.__)("Search Openverse")},mediaType:"image",async fetch(){const e={...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},mature:!1,excluded_source:"flickr,inaturalist,wikimedia",license:"pdm,cc0"},t={per_page:"page_size",search:"q"},n=new URL("https://api.openverse.engineering/v1/images/");Object.entries(e).forEach((e=>{let[a,r]=e;const l=t[a]||a;n.searchParams.set(l,r)}));const a=await window.fetch(n,{headers:{"User-Agent":"WordPress/inserter-media-fetch"}});return(await a.json()).results.map((e=>{var t;return{...e,title:null!==(t=e.title)&&void 0!==t&&t.toLowerCase().startsWith("file:")?e.title.slice(5):e.title,sourceId:e.id,id:void 0,caption:ii(e),previewUrl:e.thumbnail}}))},getReportUrl:e=>{let{sourceId:t}=e;return`https://wordpress.org/openverse/image/${t}/report/`},isExternalResource:!0}];var ui=ci;function mi(e){let{clientId:t}=e;const{getBlocks:n}=(0,m.useSelect)(fe.store),{replaceBlocks:a}=(0,m.useDispatch)(fe.store);return(0,m.useSelect)((e=>e(fe.store).canRemoveBlock(t)),[t])?(0,s.createElement)(fe.BlockSettingsMenuControls,null,(e=>{let{onClose:r}=e;return(0,s.createElement)(y.MenuItem,{onClick:()=>{a(t,n(t)),r()}},(0,E.__)("Detach blocks from template part"))})):null}function di(e){let{clientIds:t,blocks:n}=e;const[a,r]=(0,s.useState)(!1),{replaceBlocks:l}=(0,m.useDispatch)(fe.store),{saveEntityRecord:o}=(0,m.useDispatch)(_.store),{createSuccessNotice:i}=(0,m.useDispatch)(ye.store),u=Ta(),{canCreate:d}=(0,m.useSelect)((e=>{const{supportsTemplatePartsMode:t}=e(An).getSettings();return{canCreate:!t}}),[]);if(!d)return null;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fe.BlockSettingsMenuControls,null,(()=>(0,s.createElement)(y.MenuItem,{icon:On,onClick:()=>{r(!0)}},(0,E.__)("Create Template part")))),a&&(0,s.createElement)(Ca,{closeModal:()=>{r(!1)},onCreate:async e=>{let{title:a,area:r}=e;const s=Na(a,u),m=Ma(s),d=await o("postType","wp_template_part",{slug:m,title:s,content:(0,c.serialize)(n),area:r});l(t,(0,c.createBlock)("core/template-part",{slug:d.slug,theme:d.theme})),i((0,E.__)("Template part created."),{type:"snackbar"})}}))}function pi(){var e;const{clientIds:t,blocks:n}=(0,m.useSelect)((e=>{const{getSelectedBlockClientIds:t,getBlocksByClientId:n}=e(fe.store),a=t();return{clientIds:a,blocks:n(a)}}),[]);return 1===n.length&&"core/template-part"===(null===(e=n[0])||void 0===e?void 0:e.name)?(0,s.createElement)(mi,{clientId:t[0]}):(0,s.createElement)(di,{clientIds:t,blocks:n})}var _i=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"}));var hi=function(){var e;const t=Ct(),n=Tt(),a="wp_template_part"===t.params.postType,r=null===(e=t.state)||void 0===e?void 0:e.fromTemplateId;return a&&r?(0,s.createElement)(y.Button,{className:"edit-site-visual-editor__back-button",icon:_i,onClick:()=>{n.back()}},(0,E.__)("Back")):null};function gi(e){let{variation:t="default",direction:n,resizeWidthBy:a}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("button",{className:`resizable-editor__drag-handle is-${n} is-variation-${t}`,"aria-label":(0,E.__)("Drag to resize"),"aria-describedby":`resizable-editor__resize-help-${n}`,onKeyDown:function(e){const{keyCode:t}=e;"left"===n&&t===qa.LEFT||"right"===n&&t===qa.RIGHT?a(20):("left"===n&&t===qa.RIGHT||"right"===n&&t===qa.LEFT)&&a(-20)}}),(0,s.createElement)(y.VisuallyHidden,{id:`resizable-editor__resize-help-${n}`},(0,E.__)("Use left and right arrow keys to resize the canvas.")))}const vi={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0};var fi=function(e){let{enableResizing:t,height:n,children:a}=e;const[r,l]=(0,s.useState)("100%"),o=(0,s.useRef)(),i=(0,s.useCallback)((e=>{o.current&&l(o.current.offsetWidth+e)}),[]);return(0,s.createElement)(y.ResizableBox,{ref:e=>{o.current=null==e?void 0:e.resizable},size:{width:t?r:"100%",height:t&&n?n:"100%"},onResizeStop:(e,t,n)=>{l(n.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{right:t,left:t},showHandle:t,resizeRatio:2,handleComponent:{left:(0,s.createElement)(gi,{direction:"left",resizeWidthBy:i}),right:(0,s.createElement)(gi,{direction:"right",resizeWidthBy:i})},handleClasses:void 0,handleStyles:{left:vi,right:vi}},a)};var yi=function(e){let{enableResizing:t,settings:n,children:a,...r}=e;const{canvasMode:l,deviceType:o,isZoomOutMode:i}=(0,m.useSelect)((e=>({deviceType:e(An).__experimentalGetPreviewDeviceType(),isZoomOutMode:"zoom-out"===e(fe.store).__unstableGetEditorMode(),canvasMode:Qe(e(An)).getCanvasMode()})),[]),{setCanvasMode:c}=Qe((0,m.useDispatch)(An)),u=(0,fe.__experimentalUseResizeCanvas)(o),d=(0,fe.__unstableUseMouseMoveTypingReset)();return(0,s.createElement)(fe.__unstableIframe,g({scale:i?.45:void 0,frameSize:i?100:void 0,style:t?{}:u,head:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fe.__unstableEditorStyles,{styles:n.styles}),(0,s.createElement)("style",null,`.is-root-container { display: flow-root; }\n\t\t\t\t\t\t\tbody { position: relative;\n\t\t\t\t\t\t\t${"view"===l?"cursor: pointer;":""}}}`),t&&(0,s.createElement)("style",null,".is-root-container { min-height: 0 !important; }")),ref:d,name:"editor-canvas",className:"edit-site-visual-editor__editor-canvas"},r,{role:"view"===l?"button":void 0,onClick:"view"===l?()=>c("edit"):void 0,readonly:"view"===l}),n.svgFilters,a)};const{ExperimentalBlockEditorProvider:Ei}=Qe(fe.privateApis),bi={type:"default",alignments:[]};function wi(){var e,t;const{setIsInserterOpened:n}=(0,m.useDispatch)(An),{storedSettings:a,templateType:r,canvasMode:l}=(0,m.useSelect)((e=>{const{getSettings:t,getEditedPostType:a,getCanvasMode:r}=Qe(e(An));return{storedSettings:t(n),templateType:a(),canvasMode:r()}}),[n]),o=null!==(e=a.__experimentalAdditionalBlockPatterns)&&void 0!==e?e:a.__experimentalBlockPatterns,i=null!==(t=a.__experimentalAdditionalBlockPatternCategories)&&void 0!==t?t:a.__experimentalBlockPatternCategories,{restBlockPatterns:c,restBlockPatternCategories:u}=(0,m.useSelect)((e=>({restBlockPatterns:e(_.store).getBlockPatterns(),restBlockPatternCategories:e(_.store).getBlockPatternCategories()})),[]),d=(0,s.useMemo)((()=>[...o||[],...c||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name)))).filter((e=>{let{postTypes:t}=e;return!t||Array.isArray(t)&&t.includes(r)}))),[o,c,r]),p=(0,s.useMemo)((()=>[...i||[],...u||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))),[i,u]),h=(0,s.useMemo)((()=>{const{__experimentalAdditionalBlockPatterns:e,__experimentalAdditionalBlockPatternCategories:t,...n}=a;return{...n,inserterMediaCategories:ui,__experimentalBlockPatterns:d,__experimentalBlockPatternCategories:p}}),[a,d,p]),[g,v,y]=(0,_.useEntityBlockEditor)("postType",r),E=(0,s.useRef)(),b=(0,te.useMergeRefs)([E,(0,fe.__unstableUseClipboardHandler)(),(0,fe.__unstableUseTypingObserver)()]),w=(0,te.useViewportMatch)("small","<"),{clearSelectedBlock:S}=(0,m.useDispatch)(fe.store),[x,k]=(0,te.useResizeObserver)(),C="wp_template_part"===r,T=0!==g.length,N=C&&"view"!==l&&!w,M="view"===l,I=!(C&&T||M)&&void 0;return(0,s.createElement)(Ei,{settings:h,value:g,onInput:v,onChange:y,useSubRegistry:!1},(0,s.createElement)(pi,null),(0,s.createElement)(ni,null,(0,s.createElement)(fe.BlockInspector,null)),(0,s.createElement)(Po.Slot,null,(e=>{var t;let[n]=e;return n?(0,s.createElement)("div",{className:"edit-site-visual-editor is-focus-mode"},(0,s.createElement)(fi,{enableResizing:!0},n)):(0,s.createElement)(fe.BlockTools,{className:f()("edit-site-visual-editor",{"is-focus-mode":C||!!n,"is-view-mode":M}),__unstableContentRef:E,onClick:e=>{e.target===e.currentTarget&&S()}},(0,s.createElement)(fe.BlockEditorKeyboardShortcuts.Register,null),(0,s.createElement)(hi,null),(0,s.createElement)(fi,{enableResizing:N,height:null!==(t=k.height)&&void 0!==t?t:"100%"},(0,s.createElement)(yi,{enableResizing:N,settings:h,contentRef:b,readonly:"view"===l},x,(0,s.createElement)(fe.BlockList,{className:"edit-site-block-editor__block-list wp-site-blocks",__experimentalLayout:bi,renderAppender:I}))))})),(0,s.createElement)(ri.ReusableBlocksMenuItems,null))}var Si=n(773);function xi(e){let{value:t,onChange:n,onInput:a}=e;const[r,l]=(0,s.useState)(t),[o,i]=(0,s.useState)(!1),c=(0,te.useInstanceId)(xi),u=(0,s.useRef)();o||r===t||l(t);return(0,s.useEffect)((()=>()=>{u.current&&n(u.current)}),[]),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.VisuallyHidden,{as:"label",htmlFor:`code-editor-text-area-${c}`},(0,E.__)("Type text or HTML")),(0,s.createElement)(Si.Z,{autoComplete:"off",dir:"auto",value:r,onChange:e=>{const t=e.target.value;a(t),l(t),i(!0),u.current=t},onBlur:()=>{o&&(n(r),i(!1))},className:"edit-site-code-editor-text-area",id:`code-editor-text-area-${c}`,placeholder:(0,E.__)("Start writing with text or HTML")}))}function ki(){const{templateType:e,shortcut:t}=(0,m.useSelect)((e=>{const{getEditedPostType:t}=e(An),{getShortcutRepresentation:n}=e(Ln.store);return{templateType:t(),shortcut:n("core/edit-site/toggle-mode")}}),[]),[n,a]=(0,_.useEntityProp)("postType",e,"content"),[r,,l]=(0,_.useEntityBlockEditor)("postType",e);let o;o=n instanceof Function?n({blocks:r}):r?(0,c.__unstableSerializeAndClean)(r):n;const{switchEditorMode:i}=(0,m.useDispatch)(An);return(0,s.createElement)("div",{className:"edit-site-code-editor"},(0,s.createElement)("div",{className:"edit-site-code-editor__toolbar"},(0,s.createElement)("h2",null,(0,E.__)("Editing code")),(0,s.createElement)(y.Button,{variant:"tertiary",onClick:()=>i("visual"),shortcut:t},(0,E.__)("Exit code editor"))),(0,s.createElement)("div",{className:"edit-site-code-editor__body"},(0,s.createElement)(xi,{value:o,onChange:e=>{l((0,c.parse)(e),{selection:void 0})},onInput:a})))}var Ci=function(){const{getEditorMode:e}=(0,m.useSelect)(An),t=(0,m.useSelect)((e=>e(An).isListViewOpened()),[]),n=(0,m.useSelect)((e=>e(F).getActiveComplementaryArea(An.name)===Yo),[]),{redo:a,undo:r}=(0,m.useDispatch)(_.store),{setIsListViewOpened:l,switchEditorMode:o}=(0,m.useDispatch)(An),{enableComplementaryArea:i,disableComplementaryArea:s}=(0,m.useDispatch)(F),{replaceBlocks:u}=(0,m.useDispatch)(fe.store),{getBlockName:d,getSelectedBlockClientId:p,getBlockAttributes:h}=(0,m.useSelect)(fe.store),g=(e,t)=>{e.preventDefault();const n=0===t?"core/paragraph":"core/heading",a=p();if(null===a)return;const r=d(a);if("core/paragraph"!==r&&"core/heading"!==r)return;const l=h(a),o="core/paragraph"===r?"align":"textAlign",i="core/paragraph"===n?"align":"textAlign";u(a,(0,c.createBlock)(n,{level:t,content:l.content,[i]:l[o]}))};return(0,Ln.useShortcut)("core/edit-site/undo",(e=>{r(),e.preventDefault()})),(0,Ln.useShortcut)("core/edit-site/redo",(e=>{a(),e.preventDefault()})),(0,Ln.useShortcut)("core/edit-site/toggle-list-view",(()=>{l(!t)})),(0,Ln.useShortcut)("core/edit-site/toggle-block-settings-sidebar",(e=>{e.preventDefault(),n?s(Dt):i(Dt,Yo)})),(0,Ln.useShortcut)("core/edit-site/toggle-mode",(()=>{o("visual"===e()?"text":"visual")})),(0,Ln.useShortcut)("core/edit-site/transform-heading-to-paragraph",(e=>g(e,0))),[1,2,3,4,5,6].forEach((e=>{(0,Ln.useShortcut)(`core/edit-site/transform-paragraph-to-heading-${e}`,(t=>g(t,e)))})),null};var Ti=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function Ni(){const{setIsInserterOpened:e}=(0,m.useDispatch)(An),t=(0,m.useSelect)((e=>e(An).__experimentalGetInsertionPoint()),[]),n=(0,te.useViewportMatch)("medium","<"),a=n?"div":y.VisuallyHidden,[r,l]=(0,te.__experimentalUseDialog)({onClose:()=>e(!1),focusOnMount:null}),o=(0,s.useRef)();return(0,s.useEffect)((()=>{o.current.focusSearch()}),[]),(0,s.createElement)("div",g({ref:r},l,{className:"edit-site-editor__inserter-panel"}),(0,s.createElement)(a,{className:"edit-site-editor__inserter-panel-header"},(0,s.createElement)(y.Button,{icon:Ti,label:(0,E.__)("Close block inserter"),onClick:()=>e(!1)})),(0,s.createElement)("div",{className:"edit-site-editor__inserter-panel-content"},(0,s.createElement)(fe.__experimentalLibrary,{showInserterHelpPanel:!0,shouldFocusBlock:n,rootClientId:t.rootClientId,__experimentalInsertionIndex:t.insertionIndex,__experimentalFilterValue:t.filterValue,ref:o})))}function Mi(){const{setIsListViewOpened:e}=(0,m.useDispatch)(An),t=(0,te.useFocusOnMount)("firstElement"),n=(0,te.useFocusReturn)(),a=(0,te.useFocusReturn)();const r=`edit-site-editor__list-view-panel-label-${(0,te.useInstanceId)(Mi)}`;return(0,s.createElement)("div",{"aria-labelledby":r,className:"edit-site-editor__list-view-panel",onKeyDown:function(t){t.keyCode!==qa.ESCAPE||t.defaultPrevented||e(!1)}},(0,s.createElement)("div",{className:"edit-site-editor__list-view-panel-header",ref:n},(0,s.createElement)("strong",{id:r},(0,E.__)("List View")),(0,s.createElement)(y.Button,{icon:C,label:(0,E.__)("Close List View Sidebar"),onClick:()=>e(!1)})),(0,s.createElement)("div",{className:"edit-site-editor__list-view-panel-content",ref:(0,te.useMergeRefs)([a,t])},(0,s.createElement)(fe.__experimentalListView,null)))}function Ii(e){let{nonAnimatedSrc:t,animatedSrc:n}=e;return(0,s.createElement)("picture",{className:"edit-site-welcome-guide__image"},(0,s.createElement)("source",{srcSet:t,media:"(prefers-reduced-motion: reduce)"}),(0,s.createElement)("img",{src:n,width:"312",height:"240",alt:""}))}function Pi(){const{toggle:e}=(0,m.useDispatch)(T.store);return(0,m.useSelect)((e=>!!e(T.store).get("core/edit-site","welcomeGuide")),[])?(0,s.createElement)(y.Guide,{className:"edit-site-welcome-guide",contentLabel:(0,E.__)("Welcome to the site editor"),finishButtonText:(0,E.__)("Get Started"),onFinish:()=>e("core/edit-site","welcomeGuide"),pages:[{image:(0,s.createElement)(Ii,{nonAnimatedSrc:"https://s.w.org/images/block-editor/edit-your-site.svg?1",animatedSrc:"https://s.w.org/images/block-editor/edit-your-site.gif?1"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,E.__)("Edit your site")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("Design everything on your site — from the header right down to the footer — using blocks.")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,s.createInterpolateElement)((0,E.__)("Click to start designing your blocks, and choose your typography, layout, and colors."),{StylesIconImage:(0,s.createElement)("img",{alt:(0,E.__)("styles"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A"})})))}]}):null}function Bi(){const{toggle:e}=(0,m.useDispatch)(T.store),{isActive:t,isStylesOpen:n}=(0,m.useSelect)((e=>{const t=e(F).getActiveComplementaryArea(An.name);return{isActive:!!e(T.store).get("core/edit-site","welcomeGuideStyles"),isStylesOpen:"edit-site/global-styles"===t}}),[]);return t&&n?(0,s.createElement)(y.Guide,{className:"edit-site-welcome-guide",contentLabel:(0,E.__)("Welcome to styles"),finishButtonText:(0,E.__)("Get Started"),onFinish:()=>e("core/edit-site","welcomeGuideStyles"),pages:[{image:(0,s.createElement)(Ii,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.svg?1",animatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.gif?1"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,E.__)("Welcome to Styles")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.")))},{image:(0,s.createElement)(Ii,{nonAnimatedSrc:"https://s.w.org/images/block-editor/set-the-design.svg?1",animatedSrc:"https://s.w.org/images/block-editor/set-the-design.gif?1"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,E.__)("Set the design")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle! ")))},{image:(0,s.createElement)(Ii,{nonAnimatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.svg?1",animatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.gif?1"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,E.__)("Personalize blocks")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.")))},{image:(0,s.createElement)(Ii,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,E.__)("Learn more")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("New to block themes and styling your site? "),(0,s.createElement)(y.ExternalLink,{href:(0,E.__)("https://wordpress.org/support/article/styles-overview/")},(0,E.__)("Here’s a detailed guide to learn how to make the most of it."))))}]}):null}function zi(){return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Pi,null),(0,s.createElement)(Bi,null))}const{useGlobalStylesOutput:Vi}=Qe(fe.privateApis);function Ri(){return function(){const[e,t,n]=Vi(),{getSettings:a}=(0,m.useSelect)(An),{updateSettings:r}=(0,m.useDispatch)(An);(0,s.useEffect)((()=>{var l;if(!e||!t)return;const o=a(),i=Object.values(null!==(l=o.styles)&&void 0!==l?l:[]).filter((e=>!e.isGlobalStyles));r({...o,styles:[...i,...e],svgFilters:n,__experimentalFeatures:t})}),[e,t])}(),null}function Ai(e){const t=Ct(),n=(0,m.useSelect)((e=>{var t;return null===(t=e(_.store).getEntityRecord("root","site"))||void 0===t?void 0:t.title}),[]),a=(0,s.useRef)(!0);(0,s.useEffect)((()=>{a.current=!1}),[t]),(0,s.useEffect)((()=>{if(!a.current&&e&&n){const t=(0,E.sprintf)((0,E.__)("%1$s ‹ %2$s — WordPress"),(0,Un.decodeEntities)(e),(0,Un.decodeEntities)(n));document.title=t,(0,Lt.speak)((0,E.sprintf)((0,E.__)("Now displaying: %s"),document.title),"assertive")}}),[e,n,t])}const Li={body:(0,E.__)("Editor content"),sidebar:(0,E.__)("Editor settings"),actions:(0,E.__)("Editor publish"),footer:(0,E.__)("Editor footer")};function Di(){const{record:e,getTitle:t,isLoaded:n}=Aa(),{id:a,type:r}=e,{context:l,editorMode:o,canvasMode:i,blockEditorMode:c,isRightSidebarOpen:u,isInserterOpen:d,isListViewOpen:p,showIconLabels:g}=(0,m.useSelect)((e=>{const{getEditedPostContext:t,getEditorMode:n,getCanvasMode:a,isInserterOpened:r,isListViewOpened:l}=Qe(e(An)),{__unstableGetEditorMode:o}=e(fe.store),{getActiveComplementaryArea:i}=e(F);return{context:t(),editorMode:n(),canvasMode:a(),blockEditorMode:o(),isInserterOpen:r(),isListViewOpen:l(),isRightSidebarOpen:i(An.name),showIconLabels:e(T.store).get("core/edit-site","showIconLabels")}}),[]),{setEditedPostContext:v}=(0,m.useDispatch)(An),f="edit"===i,b="view"===i||"visual"===o,w=f&&b&&"zoom-out"!==c,S=f&&b&&d,x=f&&b&&p,k=p?(0,E.__)("List View"):(0,E.__)("Block Library"),C=(0,s.useMemo)((()=>({...l,queryContext:[(null==l?void 0:l.queryContext)||{page:1},e=>v({...l,queryContext:{...null==l?void 0:l.queryContext,...e}})]})),[l,v]);let N;if(n){const e="wp_template"===r?(0,E.__)("Template"):(0,E.__)("Template Part");N=(0,E.sprintf)((0,E.__)("%1$s ‹ %2$s ‹ Editor"),t(),e)}return Ai(n&&N),n?(0,s.createElement)(s.Fragment,null,f&&(0,s.createElement)(zi,null),(0,s.createElement)(_.EntityProvider,{kind:"root",type:"site"},(0,s.createElement)(_.EntityProvider,{kind:"postType",type:r,id:a},(0,s.createElement)(vo,null,(0,s.createElement)(fe.BlockContextProvider,{value:C},(0,s.createElement)(ai,null),(0,s.createElement)(ae,{enableRegionNavigation:!1,className:g&&"show-icon-labels",notices:f&&(0,s.createElement)(h.EditorSnackbars,null),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ri,null),f&&(0,s.createElement)(h.EditorNotices,null),b&&e&&(0,s.createElement)(wi,null),"text"===o&&e&&f&&(0,s.createElement)(ki,null),n&&!e&&(0,s.createElement)(y.Notice,{status:"warning",isDismissible:!1},(0,E.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")),f&&(0,s.createElement)(Ci,null)),secondarySidebar:f&&(S&&(0,s.createElement)(Ni,null)||x&&(0,s.createElement)(Mi,null)),sidebar:f&&u&&(0,s.createElement)(ee.Slot,{scope:"core/edit-site"}),footer:w&&(0,s.createElement)(fe.BlockBreadcrumb,{rootLabelText:(0,E.__)("Template")}),labels:{...Li,secondarySidebar:k}})))))):(0,s.createElement)(uo,null)}function Oi(e){var t;let{templateType:n}=e;const{canCreate:a,postType:r}=(0,m.useSelect)((e=>{const{supportsTemplatePartsMode:t}=e(An).getSettings();return{postType:e(_.store).getPostType(n),canCreate:!t}}),[n]);return r?(0,s.createElement)("header",{className:"edit-site-list-header"},(0,s.createElement)(y.__experimentalHeading,{level:1,className:"edit-site-list-header__title"},null===(t=r.labels)||void 0===t?void 0:t.name),a&&(0,s.createElement)("div",{className:"edit-site-list-header__right"},(0,s.createElement)(Pa,{templateType:n,showIcon:!1,toggleProps:{variant:"primary"}}))):null}function Fi(e){let{template:t,onClose:n}=e;const[a,r]=(0,s.useState)((()=>t.title.rendered)),[l,o]=(0,s.useState)(!1),{editEntityRecord:i,saveEditedEntityRecord:c}=(0,m.useDispatch)(_.store),{createSuccessNotice:u,createErrorNotice:d}=(0,m.useDispatch)(ye.store);if("wp_template"===t.type&&!t.is_custom)return null;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.MenuItem,{onClick:()=>{o(!0),r(t.title.rendered)}},(0,E.__)("Rename")),l&&(0,s.createElement)(y.Modal,{title:(0,E.__)("Rename"),onRequestClose:()=>{o(!1)},overlayClassName:"edit-site-list__rename-modal"},(0,s.createElement)("form",{onSubmit:async function(e){e.preventDefault();try{await i("postType",t.type,t.id,{title:a}),r(""),o(!1),n(),await c("postType",t.type,t.id,{throwOnError:!0}),u((0,E.__)("Entity renamed."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while renaming the entity.");d(t,{type:"snackbar"})}}},(0,s.createElement)(y.__experimentalVStack,{spacing:"5"},(0,s.createElement)(y.TextControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Name"),value:a,onChange:r,required:!0}),(0,s.createElement)(y.__experimentalHStack,{justify:"right"},(0,s.createElement)(y.Button,{variant:"tertiary",onClick:()=>{o(!1)}},(0,E.__)("Cancel")),(0,s.createElement)(y.Button,{variant:"primary",type:"submit"},(0,E.__)("Save")))))))}function Gi(e){let{template:t}=e;const{removeTemplate:n,revertTemplate:a}=(0,m.useDispatch)(An),{saveEditedEntityRecord:r}=(0,m.useDispatch)(_.store),{createSuccessNotice:l,createErrorNotice:o}=(0,m.useDispatch)(ye.store),i=function(e){return!!e&&"custom"===e.source&&!e.has_theme_file}(t),c=Ot(t);if(!i&&!c)return null;return(0,s.createElement)(y.DropdownMenu,{icon:re,label:(0,E.__)("Actions"),className:"edit-site-list-table__actions"},(e=>{let{onClose:u}=e;return(0,s.createElement)(y.MenuGroup,null,i&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Fi,{template:t,onClose:u}),(0,s.createElement)(y.MenuItem,{isDestructive:!0,isTertiary:!0,onClick:()=>{n(t),u()}},(0,E.__)("Delete"))),c&&(0,s.createElement)(y.MenuItem,{info:(0,E.__)("Use the template as supplied by the theme."),onClick:()=>{!async function(){try{await a(t,{allowUndo:!1}),await r("postType",t.type,t.id),l((0,E.__)("Entity reverted."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while reverting the entity.");o(t,{type:"snackbar"})}}(),u()}},(0,E.__)("Clear customizations")))}))}var Hi=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"}));var $i=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"}));var Ui=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"}));const Wi=["wp_template","wp_template_part"];function ji(e){let{text:t,icon:n,imageUrl:a,isCustomized:r,templateType:l}=e;const[o,i]=(0,s.useState)(!1);return(0,s.createElement)(y.__experimentalHStack,{alignment:"left"},a?(0,s.createElement)("div",{className:f()("edit-site-list-added-by__avatar",{"is-loaded":o})},(0,s.createElement)("img",{onLoad:()=>i(!0),alt:"",src:a})):(0,s.createElement)("div",{className:"edit-site-list-added-by__icon"},(0,s.createElement)(y.Icon,{icon:n})),(0,s.createElement)("span",null,t,r&&(0,s.createElement)("span",{className:"edit-site-list-added-by__customized-info"},"wp_template"===l?(0,E._x)("Customized","template"):(0,E._x)("Customized","template part"))))}function qi(e){var t;let{slug:n,isCustomized:a,templateType:r}=e;const l=(0,m.useSelect)((e=>e(_.store).getTheme(n)),[n]);return(0,s.createElement)(ji,{icon:Dn,text:(null==l||null===(t=l.name)||void 0===t?void 0:t.rendered)||n,isCustomized:a,templateType:r})}function Yi(e){let{slug:t,isCustomized:n,templateType:a}=e;const r=(0,m.useSelect)((e=>e(_.store).getPlugin(t)),[t]);return(0,s.createElement)(ji,{icon:Hi,text:(null==r?void 0:r.name)||t,isCustomized:n,templateType:a})}function Xi(e){var t;let{id:n,templateType:a}=e;const r=(0,m.useSelect)((e=>e(_.store).getUser(n)),[n]);return(0,s.createElement)(ji,{icon:$i,imageUrl:null==r||null===(t=r.avatar_urls)||void 0===t?void 0:t[48],text:null==r?void 0:r.nickname,templateType:a})}function Zi(e){let{templateType:t}=e;const{name:n,logoURL:a}=(0,m.useSelect)((e=>{var t;const{getEntityRecord:n,getMedia:a}=e(_.store),r=n("root","__unstableBase");return{name:null==r?void 0:r.name,logoURL:null!=r&&r.site_logo?null===(t=a(r.site_logo))||void 0===t?void 0:t.source_url:void 0}}),[]);return(0,s.createElement)(ji,{icon:Ui,imageUrl:a,text:n,templateType:t})}function Ki(e){let{templateType:t,template:n}=e;if(n){if(Wi.includes(t)){if(n.has_theme_file&&("theme"===n.origin||!n.origin&&["theme","custom"].includes(n.source)))return(0,s.createElement)(qi,{slug:n.theme,isCustomized:"custom"===n.source,templateType:t});if(n.has_theme_file&&"plugin"===n.origin)return(0,s.createElement)(Yi,{slug:n.theme,isCustomized:"custom"===n.source,templateType:t});if(!n.has_theme_file&&"custom"===n.source&&!n.author)return(0,s.createElement)(Zi,{templateType:t})}return(0,s.createElement)(Xi,{id:n.author,templateType:t})}}function Qi(e){let{templateType:t}=e;const{records:n,isResolving:a}=(0,_.useEntityRecords)("postType",t,{per_page:-1}),r=(0,m.useSelect)((e=>e(_.store).getPostType(t)),[t]);if(!n||a)return null;var l,o;if(!n.length)return(0,s.createElement)("div",null,(0,E.sprintf)((0,E.__)("No %s found."),null==r||null===(l=r.labels)||void 0===l||null===(o=l.name)||void 0===o?void 0:o.toLowerCase()));const i=[...n];return i.sort(((e,t)=>e.slug.localeCompare(t.slug))),(0,s.createElement)("table",{className:"edit-site-list-table",role:"table"},(0,s.createElement)("thead",null,(0,s.createElement)("tr",{className:"edit-site-list-table-head",role:"row"},(0,s.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,E.__)("Template")),(0,s.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,E.__)("Added by")),(0,s.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,s.createElement)(y.VisuallyHidden,null,(0,E.__)("Actions"))))),(0,s.createElement)("tbody",null,i.map((e=>{var n;return(0,s.createElement)("tr",{key:e.id,className:"edit-site-list-table-row",role:"row"},(0,s.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,s.createElement)(y.__experimentalHeading,{level:4},(0,s.createElement)(Pt,{params:{postId:e.id,postType:e.type}},(0,Un.decodeEntities)((null===(n=e.title)||void 0===n?void 0:n.rendered)||e.slug))),(0,Un.decodeEntities)(e.description)),(0,s.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,s.createElement)(Ki,{templateType:t,template:e})),(0,s.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,s.createElement)(Gi,{template:e})))}))))}function Ji(){var e,t;const{params:{path:n}}=Ct(),a="/wp_template/all"===n?"wp_template":"wp_template_part";!function(){const{registerShortcut:e}=(0,m.useDispatch)(Ln.store);(0,s.useEffect)((()=>{e({name:"core/edit-site/next-region",category:"global",description:(0,E.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-site/previous-region",category:"global",description:(0,E.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})}),[])}();const{previousShortcut:r,nextShortcut:l}=(0,m.useSelect)((e=>({previousShortcut:e(Ln.store).getAllShortcutKeyCombinations("core/edit-site/previous-region"),nextShortcut:e(Ln.store).getAllShortcutKeyCombinations("core/edit-site/next-region")})),[]),o=(0,m.useSelect)((e=>e(_.store).getPostType(a)),[a]);Ai(null==o||null===(e=o.labels)||void 0===e?void 0:e.name);const i=null==o||null===(t=o.labels)||void 0===t?void 0:t.items_list,c=o?{header:(0,E.sprintf)((0,E.__)("%s - Header"),i),body:(0,E.sprintf)((0,E.__)("%s - Content"),i)}:void 0;return(0,s.createElement)(ae,{className:"edit-site-list",labels:c,header:(0,s.createElement)(Oi,{templateType:a}),notices:(0,s.createElement)(h.EditorSnackbars,null),content:(0,s.createElement)(Qi,{templateType:a}),shortcuts:{previous:r,next:l}})}function es(e){let{text:t,children:n}=e;const a=(0,te.useCopyToClipboard)(t);return(0,s.createElement)(y.Button,{variant:"secondary",ref:a},n)}function ts(e){let{message:t,error:n}=e;const a=[(0,s.createElement)(es,{key:"copy-error",text:n.stack},(0,E.__)("Copy Error"))];return(0,s.createElement)(fe.Warning,{className:"editor-error-boundary",actions:a},t)}class ns extends s.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,he.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){return this.state.error?(0,s.createElement)(ts,{message:(0,E.__)("The editor has encountered an unexpected error."),error:this.state.error}):this.props.children}}var as=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));var rs=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"m12 20-4.5-3.6-.9 1.2L12 22l5.5-4.4-.9-1.2L12 20zm0-16 4.5 3.6.9-1.2L12 2 6.5 6.4l.9 1.2L12 4z"}));var ls=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"}));const os=[{keyCombination:{modifier:"primary",character:"b"},description:(0,E.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,E.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,E.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,E.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,E.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,E.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,E.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,E.__)("Make the selected text inline code.")}];function is(e){let{keyCombination:t,forceAriaLabel:n}=e;const a=t.modifier?qa.displayShortcutList[t.modifier](t.character):t.character,r=t.modifier?qa.shortcutAriaLabel[t.modifier](t.character):t.character;return(0,s.createElement)("kbd",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":n||r},(Array.isArray(a)?a:[a]).map(((e,t)=>"+"===e?(0,s.createElement)(s.Fragment,{key:t},e):(0,s.createElement)("kbd",{key:t,className:"edit-site-keyboard-shortcut-help-modal__shortcut-key"},e))))}function ss(e){let{description:t,keyCombination:n,aliases:a=[],ariaLabel:r}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-description"},t),(0,s.createElement)("div",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-term"},(0,s.createElement)(is,{keyCombination:n,forceAriaLabel:r}),a.map(((e,t)=>(0,s.createElement)(is,{keyCombination:e,forceAriaLabel:r,key:t})))))}function cs(e){let{name:t}=e;const{keyCombination:n,description:a,aliases:r}=(0,m.useSelect)((e=>{const{getShortcutKeyCombination:n,getShortcutDescription:a,getShortcutAliases:r}=e(Ln.store);return{keyCombination:n(t),aliases:r(t),description:a(t)}}),[t]);return n?(0,s.createElement)(ss,{keyCombination:n,description:a,aliases:r}):null}const us=e=>{let{shortcuts:t}=e;return(0,s.createElement)("ul",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-list",role:"list"},t.map(((e,t)=>(0,s.createElement)("li",{className:"edit-site-keyboard-shortcut-help-modal__shortcut",key:t},"string"==typeof e?(0,s.createElement)(cs,{name:e}):(0,s.createElement)(ss,e)))))},ms=e=>{let{title:t,shortcuts:n,className:a}=e;return(0,s.createElement)("section",{className:f()("edit-site-keyboard-shortcut-help-modal__section",a)},!!t&&(0,s.createElement)("h2",{className:"edit-site-keyboard-shortcut-help-modal__section-title"},t),(0,s.createElement)(us,{shortcuts:n}))},ds=e=>{let{title:t,categoryName:n,additionalShortcuts:a=[]}=e;const r=(0,m.useSelect)((e=>e(Ln.store).getCategoryShortcuts(n)),[n]);return(0,s.createElement)(ms,{title:t,shortcuts:r.concat(a)})};function ps(e){let{isModalActive:t,toggleModal:n}=e;return t?(0,s.createElement)(y.Modal,{className:"edit-site-keyboard-shortcut-help-modal",title:(0,E.__)("Keyboard shortcuts"),onRequestClose:n},(0,s.createElement)(ms,{className:"edit-site-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-site/keyboard-shortcuts"]}),(0,s.createElement)(ds,{title:(0,E.__)("Global shortcuts"),categoryName:"global"}),(0,s.createElement)(ds,{title:(0,E.__)("Selection shortcuts"),categoryName:"selection"}),(0,s.createElement)(ds,{title:(0,E.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,E.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,E.__)("Forward-slash")}]}),(0,s.createElement)(ms,{title:(0,E.__)("Text formatting"),shortcuts:os})):null}function _s(e){const{featureName:t,...n}=e,a=(0,m.useSelect)((e=>!!e(T.store).get("core/edit-site",t)),[t]),{toggle:r}=(0,m.useDispatch)(T.store);return(0,s.createElement)(pe,g({onChange:()=>r("core/edit-site",t),isChecked:a},n))}function hs(e){let{isModalActive:t,toggleModal:n}=e;const a=(0,s.useMemo)((()=>[{name:"general",tabLabel:(0,E.__)("General"),content:(0,s.createElement)(de,{title:(0,E.__)("Appearance"),description:(0,E.__)("Customize options related to the block editor interface and editing flow.")},(0,s.createElement)(_s,{featureName:"focusMode",help:(0,E.__)("Highlights the current block and fades other content."),label:(0,E.__)("Spotlight mode")}),(0,s.createElement)(_s,{featureName:"showIconLabels",label:(0,E.__)("Show button text labels"),help:(0,E.__)("Show text instead of icons on buttons.")}),(0,s.createElement)(_s,{featureName:"showListViewByDefault",help:(0,E.__)("Opens the block list view sidebar by default."),label:(0,E.__)("Always open list view")}))},{name:"blocks",tabLabel:(0,E.__)("Blocks"),content:(0,s.createElement)(de,{title:(0,E.__)("Block interactions"),description:(0,E.__)("Customize how you interact with blocks in the block library and editing canvas.")},(0,s.createElement)(_s,{featureName:"keepCaretInsideBlock",help:(0,E.__)("Aids screen readers by stopping text caret from leaving blocks."),label:(0,E.__)("Contain text cursor inside block")}))}]));return t?(0,s.createElement)(oe,{closeModal:n},(0,s.createElement)(me,{sections:a})):null}const{Fill:gs,Slot:vs}=(0,y.createSlotFill)("EditSiteToolsMoreMenuGroup");gs.Slot=e=>{let{fillProps:t}=e;return(0,s.createElement)(vs,{fillProps:t},(e=>!(0,ve.isEmpty)(e)&&e))};var fs=gs,ys=n(8981),Es=n.n(ys);var bs=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"}));function ws(){const{createErrorNotice:e}=(0,m.useDispatch)(ye.store);return(0,s.createElement)(y.MenuItem,{role:"menuitem",icon:bs,onClick:async function(){try{const e=await At()({path:"/wp-block-editor/v1/export",parse:!1,headers:{Accept:"application/zip"}}),t=await e.blob(),n=e.headers.get("content-disposition").match(/=(.+)\.zip/),a=n[1]?n[1]:"edit-site-export";Es()(t,a+".zip","application/zip")}catch(t){let n={};try{n=await t.json()}catch(e){}const a=n.message&&"unknown_error"!==n.code?n.message:(0,E.__)("An error occurred while creating the site export.");e(a,{type:"snackbar"})}},info:(0,E.__)("Download your theme with updated templates and styles.")},(0,E._x)("Export","site exporter menu item"))}function Ss(){const{toggle:e}=(0,m.useDispatch)(T.store);return(0,s.createElement)(y.MenuItem,{onClick:()=>e("core/edit-site","welcomeGuide")},(0,E.__)("Welcome Guide"))}function xs(){const{createNotice:e}=(0,m.useDispatch)(ye.store),t=(0,m.useSelect)((e=>()=>{const{getEditedPostId:t,getEditedPostType:n}=e(An),{getEditedEntityRecord:a}=e(_.store),r=a("postType",n(),t());if(r){if("function"==typeof r.content)return r.content(r);if(r.blocks)return(0,c.__unstableSerializeAndClean)(r.blocks);if(r.content)return r.content}return""}),[]);const n=(0,te.useCopyToClipboard)(t,(function(){e("info",(0,E.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,s.createElement)(y.MenuItem,{ref:n},(0,E.__)("Copy all blocks"))}const ks=[{value:"visual",label:(0,E.__)("Visual editor")},{value:"text",label:(0,E.__)("Code editor")}];var Cs=function(){const{shortcut:e,mode:t}=(0,m.useSelect)((e=>({shortcut:e(Ln.store).getShortcutRepresentation("core/edit-site/toggle-mode"),isRichEditingEnabled:e(An).getSettings().richEditingEnabled,isCodeEditingEnabled:e(An).getSettings().codeEditingEnabled,mode:e(An).getEditorMode()})),[]),{switchEditorMode:n}=(0,m.useDispatch)(An),a=ks.map((n=>n.value!==t?{...n,shortcut:e}:n));return(0,s.createElement)(y.MenuGroup,{label:(0,E.__)("Editor")},(0,s.createElement)(y.MenuItemsChoice,{choices:a,value:t,onSelect:n}))};function Ts(e){let{showIconLabels:t}=e;const[n,a]=(0,s.useReducer)((e=>!e),!1),[r,l]=(0,s.useReducer)((e=>!e),!1);return(0,Ln.useShortcut)("core/edit-site/keyboard-shortcuts",a),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(le,{toggleProps:{showTooltip:!t,...t&&{variant:"tertiary"}}},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.MenuGroup,{label:(0,E._x)("View","noun")},(0,s.createElement)(T.PreferenceToggleMenuItem,{scope:"core/edit-site",name:"fixedToolbar",label:(0,E.__)("Top toolbar"),info:(0,E.__)("Access all block and document tools in a single place"),messageActivated:(0,E.__)("Top toolbar activated"),messageDeactivated:(0,E.__)("Top toolbar deactivated")}),(0,s.createElement)(T.PreferenceToggleMenuItem,{scope:"core/edit-site",name:"focusMode",label:(0,E.__)("Spotlight mode"),info:(0,E.__)("Focus on one block at a time"),messageActivated:(0,E.__)("Spotlight mode activated"),messageDeactivated:(0,E.__)("Spotlight mode deactivated")}),(0,s.createElement)(Cs,null),(0,s.createElement)(q.Slot,{name:"core/edit-site/plugin-more-menu",label:(0,E.__)("Plugins"),as:y.MenuGroup,fillProps:{onClick:t}})),(0,s.createElement)(y.MenuGroup,{label:(0,E.__)("Tools")},(0,s.createElement)(ws,null),(0,s.createElement)(y.MenuItem,{onClick:a,shortcut:qa.displayShortcut.access("h")},(0,E.__)("Keyboard shortcuts")),(0,s.createElement)(Ss,null),(0,s.createElement)(xs,null),(0,s.createElement)(y.MenuItem,{icon:ls,role:"menuitem",href:(0,E.__)("https://wordpress.org/support/article/site-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,E.__)("Help"),(0,s.createElement)(y.VisuallyHidden,{as:"span"},(0,E.__)("(opens in a new tab)"))),(0,s.createElement)(fs.Slot,{fillProps:{onClose:t}})),(0,s.createElement)(y.MenuGroup,null,(0,s.createElement)(y.MenuItem,{onClick:l},(0,E.__)("Preferences"))))})),(0,s.createElement)(ps,{isModalActive:n,toggleModal:a}),(0,s.createElement)(hs,{isModalActive:r,toggleModal:l}))}function Ns(){const{isDirty:e,isSaving:t,isSaveViewOpen:n}=(0,m.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,isSavingEntityRecord:n}=e(_.store),a=t(),{isSaveViewOpened:r}=e(An);return{isDirty:a.length>0,isSaving:a.some((e=>n(e.kind,e.name,e.key))),isSaveViewOpen:r()}}),[]),{setIsSaveViewOpened:a}=(0,m.useDispatch)(An),r=!e||t,l=(0,E.__)("Save");return(0,s.createElement)(y.Button,{variant:"primary",className:"edit-site-save-button__button","aria-disabled":r,"aria-expanded":n,isBusy:t,onClick:r?void 0:()=>a(!0),label:l,shortcut:r?void 0:qa.displayShortcut.primary("s"),showTooltip:!0},l)}var Ms=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"}));var Is=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"}));var Ps=(0,s.forwardRef)((function(e,t){const n=(0,m.useSelect)((e=>e(_.store).hasUndo()),[]),{undo:a}=(0,m.useDispatch)(_.store);return(0,s.createElement)(y.Button,g({},e,{ref:t,icon:(0,E.isRTL)()?Is:Ms,label:(0,E.__)("Undo"),shortcut:qa.displayShortcut.primary("z"),"aria-disabled":!n,onClick:n?a:void 0}))}));var Bs=(0,s.forwardRef)((function(e,t){const n=(0,qa.isAppleOS)()?qa.displayShortcut.primaryShift("z"):qa.displayShortcut.primary("y"),a=(0,m.useSelect)((e=>e(_.store).hasRedo()),[]),{redo:r}=(0,m.useDispatch)(_.store);return(0,s.createElement)(y.Button,g({},e,{ref:t,icon:(0,E.isRTL)()?Ms:Is,label:(0,E.__)("Redo"),shortcut:n,"aria-disabled":!a,onClick:a?r:void 0}))}));var zs=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function Vs(e){let{template:t}=e;const[n,a]=(0,s.useState)(!1),[r,l]=(0,_.useEntityProp)("postType",t.type,"title",t.id);return(0,s.createElement)(y.TextControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Title"),value:n?"":r,help:"wp_template_part"!==t.type?(0,E.__)('Give the template a title that indicates its purpose, e.g. "Full Width".'):null,onChange:e=>{e||n?(a(!1),l(e)):a(!0)},onBlur:()=>a(!1)})}function Rs(e){let{id:t}=e;const[n,a]=(0,_.useEntityProp)("postType","wp_template_part","area",t),r=(0,m.useSelect)((e=>e(h.store).__experimentalGetDefaultTemplatePartAreas()),[]).map((e=>{let{label:t,area:n}=e;return{label:t,value:n}}));return(0,s.createElement)(y.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Area"),labelPosition:"top",options:r,value:n,onChange:a})}function As(e){let{template:t,onClose:n}=e;const{title:a,description:r}=(0,m.useSelect)((e=>e(h.store).__experimentalGetTemplateInfo(t)),[]),{revertTemplate:l}=(0,m.useDispatch)(An),o=It({path:"/"+t.type+"/all"}),i="wp_template_part"===t.type,c=(i||t.is_custom)&&!t.has_theme_file;if(!t)return null;return(0,s.createElement)("div",{className:"edit-site-template-details"},(0,s.createElement)(y.__experimentalVStack,{className:"edit-site-template-details__group",spacing:3},c?(0,s.createElement)(Vs,{template:t}):(0,s.createElement)(y.__experimentalText,{size:16,weight:600,className:"edit-site-template-details__title",as:"p"},(0,Un.decodeEntities)(a)),r&&(0,s.createElement)(y.__experimentalText,{size:"body",className:"edit-site-template-details__description",as:"p"},(0,Un.decodeEntities)(r))),i&&(0,s.createElement)("div",{className:"edit-site-template-details__group"},(0,s.createElement)(Rs,{id:t.id})),Ot(t)&&(0,s.createElement)(y.MenuGroup,{className:"edit-site-template-details__group edit-site-template-details__revert"},(0,s.createElement)(y.MenuItem,{className:"edit-site-template-details__revert-button",info:(0,E.__)("Use the template as supplied by the theme."),onClick:()=>{l(t),n()}},(0,E.__)("Clear customizations"))),(0,s.createElement)(y.Button,g({className:"edit-site-template-details__show-all-button"},o),"wp_template"===(null==t?void 0:t.type)?(0,E.__)("Manage all templates"):(0,E.__)("Manage all template parts")))}function Ls(e){if(e){const t=(0,c.getBlockType)(e.name);return t?(0,c.__experimentalGetBlockLabel)(t,e.attributes):null}return null}function Ds(){const e=(0,m.useSelect)((e=>e(T.store).get("core/edit-site","showIconLabels")),[]),{isLoaded:t,record:n,getTitle:a}=Aa(),{label:r,icon:l}=function(){const{getBlock:e}=(0,m.useSelect)(fe.store),t=(0,m.useSelect)((e=>e(fe.store).__experimentalGetActiveBlockIdByBlockNames(["core/template-part"])),[]),n=(0,fe.useBlockDisplayInformation)(t);return t?{label:Ls(e(t)),isActive:!0,icon:null==n?void 0:n.icon}:{}}(),[o,i]=(0,s.useState)(null),c=(0,s.useMemo)((()=>({anchor:o,placement:"bottom"})),[o]);if(!t)return(0,s.createElement)("div",{className:"edit-site-document-actions"},(0,E.__)("Loading…"));if(!n)return(0,s.createElement)("div",{className:"edit-site-document-actions"},(0,E.__)("Template not found"));const u="wp_template_part"===n.type?(0,E.__)("template part"):(0,E.__)("template");return(0,s.createElement)("div",{className:f()("edit-site-document-actions",{"has-secondary-label":!!r})},(0,s.createElement)("div",{ref:i,className:"edit-site-document-actions__title-wrapper"},(0,s.createElement)(y.__experimentalText,{size:"body",className:"edit-site-document-actions__title",as:"h1"},(0,s.createElement)(y.VisuallyHidden,{as:"span"},(0,E.sprintf)((0,E.__)("Editing %s: "),u)),a()),(0,s.createElement)("div",{className:"edit-site-document-actions__secondary-item"},(0,s.createElement)(fe.BlockIcon,{icon:l,showColors:!0}),(0,s.createElement)(y.__experimentalText,{size:"body"},null!=r?r:"")),(0,s.createElement)(y.Dropdown,{popoverProps:c,renderToggle:t=>{let{isOpen:n,onToggle:a}=t;return(0,s.createElement)(y.Button,{className:"edit-site-document-actions__get-info",icon:zs,"aria-expanded":n,"aria-haspopup":"true",onClick:a,variant:e?"tertiary":void 0,label:(0,E.sprintf)((0,E.__)("Show %s details"),u)},e&&(0,E.__)("Details"))},contentClassName:"edit-site-document-actions__info-dropdown",renderContent:e=>{let{onClose:t}=e;return(0,s.createElement)(As,{template:n,onClose:t})}})))}const Os=e=>{e.preventDefault()};function Fs(){var e;const t=(0,s.useRef)(),{deviceType:n,templateType:a,isInserterOpen:r,isListViewOpen:l,listViewShortcut:o,isVisualMode:i,blockEditorMode:c,homeUrl:u,showIconLabels:d}=(0,m.useSelect)((e=>{var t;const{__experimentalGetPreviewDeviceType:n,getEditedPostType:a,isInserterOpened:r,isListViewOpened:l,getEditorMode:o}=e(An),{getShortcutRepresentation:i}=e(Ln.store),{__unstableGetEditorMode:s}=e(fe.store),c=a(),{getUnstableBase:u}=e(_.store);return{deviceType:n(),templateType:c,isInserterOpen:r(),isListViewOpen:l(),listViewShortcut:i("core/edit-site/toggle-list-view"),isVisualMode:"visual"===o(),blockEditorMode:s(),homeUrl:null===(t=u())||void 0===t?void 0:t.home,showIconLabels:e(T.store).get("core/edit-site","showIconLabels")}}),[]),{__experimentalSetPreviewDeviceType:p,setIsInserterOpened:h,setIsListViewOpened:g}=(0,m.useDispatch)(An),{__unstableSetEditorMode:v}=(0,m.useDispatch)(fe.store),b=(0,te.useViewportMatch)("medium"),w=(0,s.useCallback)((()=>{r?(t.current.focus(),h(!1)):h(!0)}),[r,h]),S=(0,s.useCallback)((()=>g(!l)),[g,l]),x=function(){const e=(0,y.__experimentalUseSlotFills)(xo);return!(null==e||!e.length)}(),k="wp_template_part"===a,C=(0,E._x)("Toggle block inserter","Generic label for block inserter button"),N=r?(0,E.__)("Close"):(0,E.__)("Add"),M=(null===(e=window)||void 0===e?void 0:e.__experimentalEnableZoomedOutView)&&i,I="zoom-out"===c;return(0,s.createElement)("div",{className:f()("edit-site-header-edit-mode",{"show-icon-labels":d})},!x&&(0,s.createElement)(fe.NavigableToolbar,{className:"edit-site-header-edit-mode__start","aria-label":(0,E.__)("Document tools")},(0,s.createElement)("div",{className:"edit-site-header-edit-mode__toolbar"},(0,s.createElement)(y.ToolbarItem,{ref:t,as:y.Button,className:"edit-site-header-edit-mode__inserter-toggle",variant:"primary",isPressed:r,onMouseDown:Os,onClick:w,disabled:!i,icon:ra,label:d?N:C,showTooltip:!d}),b&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.ToolbarItem,{as:fe.ToolSelector,showTooltip:!d,variant:d?"tertiary":void 0,disabled:!i}),(0,s.createElement)(y.ToolbarItem,{as:Ps,showTooltip:!d,variant:d?"tertiary":void 0}),(0,s.createElement)(y.ToolbarItem,{as:Bs,showTooltip:!d,variant:d?"tertiary":void 0}),(0,s.createElement)(y.ToolbarItem,{as:y.Button,className:"edit-site-header-edit-mode__list-view-toggle",disabled:!i||I,icon:as,isPressed:l,label:(0,E.__)("List View"),onClick:S,shortcut:o,showTooltip:!d,variant:d?"tertiary":void 0}),M&&(0,s.createElement)(y.ToolbarItem,{as:y.Button,className:"edit-site-header-edit-mode__zoom-out-view-toggle",icon:rs,isPressed:I,label:(0,E.__)("Zoom-out View"),onClick:()=>{p("desktop"),v(I?"edit":"zoom-out")}})))),(0,s.createElement)("div",{className:"edit-site-header-edit-mode__center"},x?(0,E.__)("Style Book"):(0,s.createElement)(Ds,null)),(0,s.createElement)("div",{className:"edit-site-header-edit-mode__end"},(0,s.createElement)("div",{className:"edit-site-header-edit-mode__actions"},!k&&!x&&(0,s.createElement)("div",{className:f()("edit-site-header-edit-mode__preview-options",{"is-zoomed-out":I})},(0,s.createElement)(fe.__experimentalPreviewOptions,{deviceType:n,setDeviceType:p,viewLabel:(0,E.__)("View")},(0,s.createElement)(y.MenuGroup,null,(0,s.createElement)(y.MenuItem,{href:u,target:"_blank",icon:ls},(0,E.__)("View site"),(0,s.createElement)(y.VisuallyHidden,{as:"span"},(0,E.__)("(opens in a new tab)")))))),(0,s.createElement)(Ns,null),(0,s.createElement)(K.Slot,{scope:"core/edit-site"}),(0,s.createElement)(Ts,{showIconLabels:d}))))}var Gs=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(b.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"}));var Hs=function(e){let{className:t}=e;const{isRequestingSite:n,siteIconUrl:a}=(0,m.useSelect)((e=>{const{getEntityRecord:t,isResolving:n}=e(_.store),a=t("root","__unstableBase",void 0)||{};return{isRequestingSite:n("core","getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:a.site_icon_url}}),[]);if(n&&!a)return null;const r=a?(0,s.createElement)("img",{className:"edit-site-site-icon__image",alt:(0,E.__)("Site Icon"),src:a}):(0,s.createElement)(y.Icon,{className:"edit-site-site-icon__icon",size:"32px",icon:Gs});return(0,s.createElement)("div",{className:f()(t,"edit-site-site-icon")},r)};const $s=(0,s.forwardRef)(((e,t)=>{const{canvasMode:n,dashboardLink:a}=(0,m.useSelect)((e=>{e(An).getEditedPostType();const{getCanvasMode:t,getSettings:n}=Qe(e(An));return{canvasMode:t(),dashboardLink:n().__experimentalDashboardLink}}),[]),r=(0,te.useReducedMotion)(),{setCanvasMode:l}=Qe((0,m.useDispatch)(An)),{clearSelectedBlock:o}=(0,m.useDispatch)(fe.store),i="edit"!==n,c="view"===n?{href:a||"index.php","aria-label":(0,E.__)("Go back to the dashboard")}:{label:(0,E.__)("Open Navigation Sidebar"),onClick:()=>{o(),l("view")}},u=(0,m.useSelect)((e=>{var t;return null===(t=e(_.store).getEntityRecord("root","site"))||void 0===t?void 0:t.title}),[]);return(0,s.createElement)(y.__unstableMotion.div,g({ref:t},e,{className:f()("edit-site-site-hub",e.className),layout:!0,transition:{type:"tween",duration:r?0:.3,ease:"easeOut"}}),(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start",className:"edit-site-site-hub__text-content",spacing:"0"},(0,s.createElement)(y.__unstableMotion.div,{className:"edit-site-site-hub__view-mode-toggle-container",layout:!0,transition:{type:"tween",duration:r?0:.3,ease:"easeOut"}},(0,s.createElement)(y.Button,g({},c,{className:"edit-site-layout__view-mode-toggle"}),(0,s.createElement)(Hs,{className:"edit-site-layout__view-mode-toggle-icon"}))),i&&(0,s.createElement)("div",{className:"edit-site-site-hub__site-title"},(0,Un.decodeEntities)(u))))}));var Us=$s;function Ws(){const{isSaveViewOpen:e,canvasMode:t}=(0,m.useSelect)((e=>{const{isSaveViewOpened:t,getCanvasMode:n}=Qe(e(An));return{isSaveViewOpen:t(),canvasMode:n()}}),[]),{setIsSaveViewOpened:n}=(0,m.useDispatch)(An),a=()=>n(!1);return"view"===t?e?(0,s.createElement)(y.Modal,{className:"edit-site-save-panel__modal",onRequestClose:a,__experimentalHideHeader:!0,contentLabel:(0,E.__)("Save site, content, and template changes")},(0,s.createElement)(h.EntitiesSavedStates,{close:a})):null:(0,s.createElement)(ne,{className:f()("edit-site-layout__actions",{"is-entity-save-view-open":e}),ariaLabel:(0,E.__)("Save sidebar")},e?(0,s.createElement)(h.EntitiesSavedStates,{close:a}):(0,s.createElement)("div",{className:"edit-site-editor__toggle-save-panel"},(0,s.createElement)(y.Button,{variant:"secondary",className:"edit-site-editor__toggle-save-panel-button",onClick:()=>n(!0),"aria-expanded":!1},(0,E.__)("Open save panel"))))}var js=function(){const{registerShortcut:e}=(0,m.useDispatch)(Ln.store);return(0,s.useEffect)((()=>{e({name:"core/edit-site/save",category:"global",description:(0,E.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/edit-site/undo",category:"global",description:(0,E.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/edit-site/redo",category:"global",description:(0,E.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,qa.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/edit-site/toggle-list-view",category:"global",description:(0,E.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/edit-site/toggle-block-settings-sidebar",category:"global",description:(0,E.__)("Show or hide the block settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/edit-site/keyboard-shortcuts",category:"main",description:(0,E.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/edit-site/next-region",category:"global",description:(0,E.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-site/previous-region",category:"global",description:(0,E.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]}),e({name:"core/edit-site/toggle-mode",category:"global",description:(0,E.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),e({name:"core/edit-site/transform-heading-to-paragraph",category:"block-library",description:(0,E.__)("Transform heading to paragraph."),keyCombination:{modifier:"access",character:"0"}}),[1,2,3,4,5,6].forEach((t=>{e({name:`core/edit-site/transform-paragraph-to-heading-${t}`,category:"block-library",description:(0,E.__)("Transform paragraph to heading."),keyCombination:{modifier:"access",character:`${t}`}})}))}),[e]),null};var qs=function(){const{__experimentalGetDirtyEntityRecords:e,isSavingEntityRecord:t}=(0,m.useSelect)(_.store),{setIsSaveViewOpened:n}=(0,m.useDispatch)(An);return(0,Ln.useShortcut)("core/edit-site/save",(a=>{a.preventDefault();const r=e(),l=!!r.length;!r.some((e=>t(e.kind,e.name,e.key)))&&l&&n(!0)})),null};const Ys=.5,Xs={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0};function Zs(){!function(){const{params:{postId:e,postType:t}={}}=Ct(),{isRequestingSite:n,homepageId:a,url:r}=(0,m.useSelect)((e=>{const{getSite:t,getUnstableBase:n}=e(_.store),a=t(),r=n();return{isRequestingSite:!r,homepageId:"page"===(null==a?void 0:a.show_on_front)?a.page_on_front:null,url:null==r?void 0:r.home}}),[]),{setTemplate:l,setTemplatePart:o,setPage:i}=(0,m.useDispatch)(An);(0,s.useEffect)((()=>{if(t&&e)switch(t){case"wp_template":l(e);break;case"wp_template_part":o(e);break;default:i({context:{postType:t,postId:e}})}else a?i({context:{postType:"page",postId:a}}):n||i({path:r})}),[r,e,t,a,n,i,l,o])}(),function(){const e=Tt(),{params:t}=Ct(),n=(0,m.useSelect)((e=>Qe(e(An)).getCanvasMode()),[]),{setCanvasMode:a}=Qe((0,m.useDispatch)(An)),r=(0,s.useRef)(n),{canvas:l}=t,o=(0,s.useRef)(l),i=(0,s.useRef)(t);(0,s.useEffect)((()=>{i.current=t}),[t]),(0,s.useEffect)((()=>{r.current=n,"init"!==n&&("edit"===n&&o.current!==n&&e.push({...i.current,canvas:"edit"}),"view"===n&&void 0!==o.current&&e.push({...i.current,canvas:void 0}))}),[n,e]),(0,s.useEffect)((()=>{o.current=l,void 0===l&&"view"!==r.current?a("view"):"edit"===l&&"edit"!==r.current&&a("edit")}),[l,a])}();const e=(0,s.useRef)(),{params:t}=Ct(),n=function(e){let{path:t}=e;return"/wp_template/all"===t||"/wp_template_part/all"===t}(t),a=!n,{canvasMode:r,previousShortcut:l,nextShortcut:o}=(0,m.useSelect)((e=>{const{getAllShortcutKeyCombinations:t}=e(Ln.store),{getCanvasMode:n}=Qe(e(An));return{canvasMode:n(),previousShortcut:t("core/edit-site/previous-region"),nextShortcut:t("core/edit-site/next-region")}}),[]),i=(0,y.__unstableUseNavigateRegions)({previous:l,next:o}),c=(0,te.useReducedMotion)(),u=(0,te.useViewportMatch)("medium","<"),d=u?0:24,p=u&&!n||!u&&("view"===r||!a),h=u&&a&&"edit"===r||!u||!a,v=!a&&!u||!u&&a&&"view"===r,b=u&&n||a&&"edit"===r,[w,S]=(0,te.useResizeObserver)(),[x,k]=(0,te.useResizeObserver)(),[C,T]=(0,s.useState)(null),[N,M]=(0,s.useState)(!1),I=!u&&"view"===r,P=u?"100vw":360;let B=N?"100%":k.width;return v&&!N&&(B=S.width-d),"init"===r?null:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(js,null),(0,s.createElement)(qs,null),x,(0,s.createElement)("div",g({},i,{ref:i.ref,className:f()("edit-site-layout",i.className,{"is-full-canvas":b,"is-edit-mode":"edit"===r})}),(0,s.createElement)(Us,{ref:e,className:"edit-site-layout__hub",style:{width:I&&C?C-48:void 0}}),(0,s.createElement)(y.__unstableAnimatePresence,{initial:!1},a&&"edit"===r&&(0,s.createElement)(ne,{className:"edit-site-layout__header",ariaLabel:(0,E.__)("Editor top bar"),as:y.__unstableMotion.div,animate:{y:0},initial:{y:"-100%"},exit:{y:"-100%"},transition:{type:"tween",duration:c?0:Ys,ease:"easeOut"}},"edit"===r&&(0,s.createElement)(Fs,null))),(0,s.createElement)("div",{className:"edit-site-layout__content"},(0,s.createElement)(y.__unstableAnimatePresence,{initial:!1},p&&(0,s.createElement)(y.ResizableBox,{as:y.__unstableMotion.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{type:"tween",duration:c||N?0:Ys,ease:"easeOut"},size:{height:"100%",width:I&&C?C:P},className:"edit-site-layout__sidebar",enable:{right:I},onResizeStop:(e,t,n)=>{T(n.clientWidth),M(!1)},onResizeStart:()=>{M(!0)},onResize:(t,n,a)=>{e.current.style.width=a.clientWidth-48+"px"},handleComponent:{right:(0,s.createElement)(gi,{direction:"right",variation:"separator",resizeWidthBy:e=>{T((null!=C?C:P)+e)}})},handleClasses:void 0,handleStyles:{right:Xs},minWidth:I?320:void 0,maxWidth:I&&k?k.width-360:void 0},(0,s.createElement)(ne,{ariaLabel:(0,E.__)("Navigation sidebar")},(0,s.createElement)(Ka,null)))),(0,s.createElement)(Ws,null),h&&(0,s.createElement)("div",{className:f()("edit-site-layout__canvas-container",{"is-resizing":N}),style:{paddingTop:v?d:0,paddingBottom:v?d:0}},w,!!S.width&&(0,s.createElement)(y.__unstableMotion.div,{whileHover:a&&"view"===r?{scale:1.01,transition:{duration:c||N?0:.2}}:{},initial:!1,layout:"position",className:"edit-site-layout__canvas",transition:{type:"tween",duration:c||N?0:Ys,ease:"easeOut"}},(0,s.createElement)(y.__unstableMotion.div,{style:{position:"absolute",top:0,left:0,bottom:0},initial:!1,animate:{width:B},transition:{type:"tween",duration:c||N?0:Ys,ease:"easeOut"}},(0,s.createElement)(ns,null,a&&(0,s.createElement)(Di,null),n&&(0,s.createElement)(Ji,null))))))))}function Ks(){const{createErrorNotice:e}=(0,m.useDispatch)(ye.store);return(0,s.createElement)(Ln.ShortcutProvider,{style:{height:"100%"}},(0,s.createElement)(y.SlotFillProvider,null,(0,s.createElement)(y.Popover.Slot,null),(0,s.createElement)(h.UnsavedChangesWarning,null),(0,s.createElement)(Mt,null,(0,s.createElement)(Zs,null),(0,s.createElement)(G.PluginArea,{onError:function(t){e((0,E.sprintf)((0,E.__)('The "%s" plugin has encountered an error and cannot be rendered.'),t))}}))))}function Qs(e){let{className:t,...n}=e;const a=(0,m.useSelect)((e=>e(An).getSettings().showIconLabels),[]);return(0,s.createElement)(ee,g({panelClassName:t,className:"edit-site-sidebar-edit-mode",scope:"core/edit-site",showIconLabels:a},n))}function Js(e){return(0,s.createElement)(X,g({__unstableExplicitMenuItem:!0,scope:"core/edit-site"},e))}var ec=(0,te.compose)((0,G.withPluginContext)(((e,t)=>{var n;return{as:null!==(n=t.as)&&void 0!==n?n:y.MenuItem,icon:t.icon||e.icon,name:"core/edit-site/plugin-more-menu"}})))(q);function tc(e,t){const n=document.getElementById(e),a=(0,s.createRoot)(n);t.__experimentalFetchLinkSuggestions=(e,n)=>(0,_.__experimentalFetchLinkSuggestions)(e,n,t),t.__experimentalFetchRichUrlData=_.__experimentalFetchUrlData,(0,m.dispatch)(c.store).__experimentalReapplyBlockTypeFilters();const r=(0,u.__experimentalGetCoreBlocks)().filter((e=>{let{name:t}=e;return"core/freeform"!==t}));return(0,u.registerCoreBlocks)(r),(0,m.dispatch)(c.store).setFreeformFallbackBlockName("core/html"),(0,_e.registerLegacyWidgetBlock)({inserter:!1}),(0,_e.registerWidgetGroupBlock)({inserter:!1}),(0,m.dispatch)(T.store).setDefaults("core/edit-site",{editorMode:"visual",fixedToolbar:!1,focusMode:!1,keepCaretInsideBlock:!1,welcomeGuide:!0,welcomeGuideStyles:!0,showListViewByDefault:!1}),(0,m.dispatch)(F).setDefaultComplementaryArea("core/edit-site","edit-site/template"),(0,m.dispatch)(An).updateSettings(t),(0,m.dispatch)(h.store).updateEditorSettings({defaultTemplateTypes:t.defaultTemplateTypes,defaultTemplatePartAreas:t.defaultTemplatePartAreas}),window.addEventListener("dragover",(e=>e.preventDefault()),!1),window.addEventListener("drop",(e=>e.preventDefault()),!1),a.render((0,s.createElement)(Ks,null)),a}function nc(){p()("wp.editSite.reinitializeEditor",{since:"6.2",version:"6.3"})}}(),(window.wp=window.wp||{}).editSite=a}(); \ No newline at end of file diff --git a/wp-includes/js/dist/editor.js b/wp-includes/js/dist/editor.js index 9893fd2ed2..2d7d8c857e 100644 --- a/wp-includes/js/dist/editor.js +++ b/wp-includes/js/dist/editor.js @@ -9117,6 +9117,16 @@ function usePostVisibilityLabel() { return (_visibilityOptions$vi = visibilityOptions[visibility]) === null || _visibilityOptions$vi === void 0 ? void 0 : _visibilityOptions$vi.label; } +;// CONCATENATED MODULE: ./node_modules/date-fns/node_modules/@babel/runtime/helpers/esm/typeof.js +function _typeof(obj) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }, _typeof(obj); +} ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/_lib/requiredArgs/index.js function requiredArgs(required, args) { if (args.length < required) { @@ -9124,7 +9134,6 @@ function requiredArgs(required, args) { } } ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/toDate/index.js -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } /** @@ -9157,11 +9166,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi * const result = toDate(1392098430000) * //=> Tue Feb 11 2014 11:30:30 */ - function toDate(argument) { requiredArgs(1, arguments); - var argStr = Object.prototype.toString.call(argument); // Clone the date + var argStr = Object.prototype.toString.call(argument); + // Clone the date if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') { // Prevent the date to lose the milliseconds when passed to new Date() in IE10 return new Date(argument.getTime()); @@ -9170,11 +9179,10 @@ function toDate(argument) { } else { if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') { // eslint-disable-next-line no-console - console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"); // eslint-disable-next-line no-console - + console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"); + // eslint-disable-next-line no-console console.warn(new Error().stack); } - return new Date(NaN); } } @@ -9199,7 +9207,6 @@ function toDate(argument) { * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0)) * //=> Mon Sep 01 2014 00:00:00 */ - function startOfMonth(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); @@ -9228,7 +9235,6 @@ function startOfMonth(dirtyDate) { * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 30 2014 23:59:59.999 */ - function endOfMonth(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); @@ -9247,6 +9253,7 @@ function endOfMonth(dirtyDate) { * @default */ var daysInWeek = 7; + /** * Days in 1 year * One years equals 365.2425 days according to the formula: @@ -9259,8 +9266,8 @@ var daysInWeek = 7; * @type {number} * @default */ - var daysInYear = 365.2425; + /** * Maximum allowed time. * @@ -9269,8 +9276,8 @@ var daysInYear = 365.2425; * @type {number} * @default */ - var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000; + /** * Milliseconds in 1 minute * @@ -9279,8 +9286,8 @@ var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000; * @type {number} * @default */ - var millisecondsInMinute = 60000; + /** * Milliseconds in 1 hour * @@ -9289,8 +9296,8 @@ var millisecondsInMinute = 60000; * @type {number} * @default */ - var millisecondsInHour = 3600000; + /** * Milliseconds in 1 second * @@ -9299,8 +9306,8 @@ var millisecondsInHour = 3600000; * @type {number} * @default */ - var millisecondsInSecond = 1000; + /** * Minimum allowed time. * @@ -9309,8 +9316,8 @@ var millisecondsInSecond = 1000; * @type {number} * @default */ - var minTime = -maxTime; + /** * Minutes in 1 hour * @@ -9319,8 +9326,8 @@ var minTime = -maxTime; * @type {number} * @default */ - var minutesInHour = 60; + /** * Months in 1 quarter * @@ -9329,8 +9336,8 @@ var minutesInHour = 60; * @type {number} * @default */ - var monthsInQuarter = 3; + /** * Months in 1 year * @@ -9339,8 +9346,8 @@ var monthsInQuarter = 3; * @type {number} * @default */ - var monthsInYear = 12; + /** * Quarters in 1 year * @@ -9349,8 +9356,8 @@ var monthsInYear = 12; * @type {number} * @default */ - var quartersInYear = 4; + /** * Seconds in 1 hour * @@ -9359,8 +9366,8 @@ var quartersInYear = 4; * @type {number} * @default */ - var secondsInHour = 3600; + /** * Seconds in 1 minute * @@ -9369,8 +9376,8 @@ var secondsInHour = 3600; * @type {number} * @default */ - var secondsInMinute = 60; + /** * Seconds in 1 day * @@ -9379,8 +9386,8 @@ var secondsInMinute = 60; * @type {number} * @default */ - var secondsInDay = secondsInHour * 24; + /** * Seconds in 1 week * @@ -9389,8 +9396,8 @@ var secondsInDay = secondsInHour * 24; * @type {number} * @default */ - var secondsInWeek = secondsInDay * 7; + /** * Seconds in 1 year * @@ -9399,8 +9406,8 @@ var secondsInWeek = secondsInDay * 7; * @type {number} * @default */ - var secondsInYear = secondsInDay * daysInYear; + /** * Seconds in 1 month * @@ -9409,8 +9416,8 @@ var secondsInYear = secondsInDay * daysInYear; * @type {number} * @default */ - var secondsInMonth = secondsInYear / 12; + /** * Seconds in 1 quarter * @@ -9419,20 +9426,16 @@ var secondsInMonth = secondsInYear / 12; * @type {number} * @default */ - var secondsInQuarter = secondsInMonth * 3; ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/_lib/toInteger/index.js function toInteger(dirtyNumber) { if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) { return NaN; } - var number = Number(dirtyNumber); - if (isNaN(number)) { return number; } - return number < 0 ? Math.ceil(number) : Math.floor(number); } ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/parseISO/index.js @@ -9471,64 +9474,51 @@ function toInteger(dirtyNumber) { * const result = parseISO('+02014101', { additionalDigits: 1 }) * //=> Fri Apr 11 2014 00:00:00 */ - function parseISO(argument, options) { var _options$additionalDi; - requiredArgs(1, arguments); var additionalDigits = toInteger((_options$additionalDi = options === null || options === void 0 ? void 0 : options.additionalDigits) !== null && _options$additionalDi !== void 0 ? _options$additionalDi : 2); - if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) { throw new RangeError('additionalDigits must be 0, 1 or 2'); } - if (!(typeof argument === 'string' || Object.prototype.toString.call(argument) === '[object String]')) { return new Date(NaN); } - var dateStrings = splitDateString(argument); var date; - if (dateStrings.date) { var parseYearResult = parseYear(dateStrings.date, additionalDigits); date = parseDate(parseYearResult.restDateString, parseYearResult.year); } - if (!date || isNaN(date.getTime())) { return new Date(NaN); } - var timestamp = date.getTime(); var time = 0; var offset; - if (dateStrings.time) { time = parseTime(dateStrings.time); - if (isNaN(time)) { return new Date(NaN); } } - if (dateStrings.timezone) { offset = parseTimezone(dateStrings.timezone); - if (isNaN(offset)) { return new Date(NaN); } } else { - var dirtyDate = new Date(timestamp + time); // js parsed string assuming it's in UTC timezone + var dirtyDate = new Date(timestamp + time); + // js parsed string assuming it's in UTC timezone // but we need it to be parsed in our timezone // so we use utc values to build date in our timezone. // Year values from 0 to 99 map to the years 1900 to 1999 // so set year explicitly with setFullYear. - var result = new Date(0); result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate()); result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds()); return result; } - return new Date(timestamp + time + offset); } var patterns = { @@ -9539,32 +9529,28 @@ var patterns = { var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/; var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/; var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/; - function splitDateString(dateString) { var dateStrings = {}; var array = dateString.split(patterns.dateTimeDelimiter); - var timeString; // The regex match should only return at maximum two array elements. - // [date], [time], or [date, time]. + var timeString; + // The regex match should only return at maximum two array elements. + // [date], [time], or [date, time]. if (array.length > 2) { return dateStrings; } - if (/:/.test(array[0])) { timeString = array[0]; } else { dateStrings.date = array[0]; timeString = array[1]; - if (patterns.timeZoneDelimiter.test(dateStrings.date)) { dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0]; timeString = dateString.substr(dateStrings.date.length, dateString.length); } } - if (timeString) { var token = patterns.timezone.exec(timeString); - if (token) { dateStrings.time = timeString.replace(token[1], ''); dateStrings.timezone = token[1]; @@ -9572,32 +9558,30 @@ function splitDateString(dateString) { dateStrings.time = timeString; } } - return dateStrings; } - function parseYear(dateString, additionalDigits) { var regex = new RegExp('^(?:(\\d{4}|[+-]\\d{' + (4 + additionalDigits) + '})|(\\d{2}|[+-]\\d{' + (2 + additionalDigits) + '})$)'); - var captures = dateString.match(regex); // Invalid ISO-formatted year - + var captures = dateString.match(regex); + // Invalid ISO-formatted year if (!captures) return { year: NaN, restDateString: '' }; var year = captures[1] ? parseInt(captures[1]) : null; - var century = captures[2] ? parseInt(captures[2]) : null; // either year or century is null, not both + var century = captures[2] ? parseInt(captures[2]) : null; + // either year or century is null, not both return { year: century === null ? year : century * 100, restDateString: dateString.slice((captures[1] || captures[2]).length) }; } - function parseDate(dateString, year) { // Invalid ISO-formatted year if (year === null) return new Date(NaN); - var captures = dateString.match(dateRegex); // Invalid ISO-formatted string - + var captures = dateString.match(dateRegex); + // Invalid ISO-formatted string if (!captures) return new Date(NaN); var isWeekDate = !!captures[4]; var dayOfYear = parseDateUnit(captures[1]); @@ -9605,29 +9589,23 @@ function parseDate(dateString, year) { var day = parseDateUnit(captures[3]); var week = parseDateUnit(captures[4]); var dayOfWeek = parseDateUnit(captures[5]) - 1; - if (isWeekDate) { if (!validateWeekDate(year, week, dayOfWeek)) { return new Date(NaN); } - return dayOfISOWeekYear(year, week, dayOfWeek); } else { var date = new Date(0); - if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) { return new Date(NaN); } - date.setUTCFullYear(year, month, Math.max(dayOfYear, day)); return date; } } - function parseDateUnit(value) { return value ? parseInt(value) : 1; } - function parseTime(timeString) { var captures = timeString.match(timeRegex); if (!captures) return NaN; // Invalid ISO-formatted time @@ -9635,18 +9613,14 @@ function parseTime(timeString) { var hours = parseTimeUnit(captures[1]); var minutes = parseTimeUnit(captures[2]); var seconds = parseTimeUnit(captures[3]); - if (!validateTime(hours, minutes, seconds)) { return NaN; } - return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000; } - function parseTimeUnit(value) { return value && parseFloat(value.replace(',', '.')) || 0; } - function parseTimezone(timezoneString) { if (timezoneString === 'Z') return 0; var captures = timezoneString.match(timezoneRegex); @@ -9654,14 +9628,11 @@ function parseTimezone(timezoneString) { var sign = captures[1] === '+' ? -1 : 1; var hours = parseInt(captures[2]); var minutes = captures[3] && parseInt(captures[3]) || 0; - if (!validateTimezone(hours, minutes)) { return NaN; } - return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute); } - function dayOfISOWeekYear(isoWeekYear, week, day) { var date = new Date(0); date.setUTCFullYear(isoWeekYear, 0, 4); @@ -9669,36 +9640,30 @@ function dayOfISOWeekYear(isoWeekYear, week, day) { var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay; date.setUTCDate(date.getUTCDate() + diff); return date; -} // Validation functions +} + +// Validation functions + // February is null to handle the leap year (using ||) - - var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - function isLeapYearIndex(year) { return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0; } - function validateDate(year, month, date) { return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28)); } - function validateDayOfYearDate(year, dayOfYear) { return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365); } - function validateWeekDate(_year, week, day) { return week >= 1 && week <= 53 && day >= 0 && day <= 6; } - function validateTime(hours, minutes, seconds) { if (hours === 24) { return minutes === 0 && seconds === 0; } - return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25; } - function validateTimezone(_hours, minutes) { return minutes >= 0 && minutes <= 59; } diff --git a/wp-includes/js/dist/editor.min.js b/wp-includes/js/dist/editor.min.js index 6e1f1582b9..f873653aca 100644 --- a/wp-includes/js/dist/editor.min.js +++ b/wp-includes/js/dist/editor.min.js @@ -16,4 +16,4 @@ * Copyright(c) 2015 Andreas Lubbe * Copyright(c) 2015 Tiancheng "Timothy" Gu * MIT Licensed - */var t=/["'&<>]/;e.exports=function(e){var n,o=""+e,r=t.exec(o);if(!r)return o;var i="",s=0,a=0;for(s=r.index;s0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SETUP_EDITOR_STATE"===t.type?t.post.id:e},postType:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SETUP_EDITOR_STATE"===t.type?t.post.type:e},saving:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REQUEST_POST_UPDATE_START":case"REQUEST_POST_UPDATE_FINISH":return{pending:"REQUEST_POST_UPDATE_START"===t.type,options:t.options||{}}}return e},deleting:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REQUEST_POST_DELETE_START":case"REQUEST_POST_DELETE_FINISH":return{pending:"REQUEST_POST_DELETE_START"===t.type}}return e},postLock:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isLocked:!1},t=arguments.length>1?arguments[1]:void 0;return"UPDATE_POST_LOCK"===t.type?t.lock:e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},postSavingLock:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOCK_POST_SAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_SAVING":{const{[t.lockName]:n,...o}=e;return o}}return e},isReady:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_EDITOR_STATE":return!0;case"TEAR_DOWN_EDITOR":return!1}return e},editorSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m,t=arguments.length>1?arguments[1]:void 0;return"UPDATE_EDITOR_SETTINGS"===t.type?{...e,...t.settings}:e},postAutosavingLock:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOCK_POST_AUTOSAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_AUTOSAVING":{const{[t.lockName]:n,...o}=e;return o}}return e}}),f={};function v(e){return[e]}function _(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o()=>e(c.store).hasUndo())),z=(0,l.createRegistrySelector)((e=>()=>e(c.store).hasRedo()));function H(e){return"auto-draft"===G(e).status}function V(e){return"content"in X(e)}const W=(0,l.createRegistrySelector)((e=>t=>{const n=K(t),o=Y(t);return!!e(c.store).hasEditsForEntityRecord("postType",n,o)})),j=(0,l.createRegistrySelector)((e=>t=>{const n=e(c.store).__experimentalGetDirtyEntityRecords(),{type:o,id:r}=G(t);return n.some((e=>"postType"!==e.kind||e.name!==o||e.key!==r))}));function $(e){return!W(e)&&H(e)}const G=(0,l.createRegistrySelector)((e=>t=>{const n=Y(t),o=K(t),r=e(c.store).getRawEntityRecord("postType",o,n);return r||U}));function K(e){return e.postType}function Y(e){return e.postId}function q(e){var t,n,o,r;return null!==(t=null===(n=G(e)._links)||void 0===n||null===(o=n["version-history"])||void 0===o||null===(r=o[0])||void 0===r?void 0:r.count)&&void 0!==t?t:0}function Q(e){var t,n,o,r;return null!==(t=null===(n=G(e)._links)||void 0===n||null===(o=n["predecessor-version"])||void 0===o||null===(r=o[0])||void 0===r?void 0:r.id)&&void 0!==t?t:null}const X=(0,l.createRegistrySelector)((e=>t=>{const n=K(t),o=Y(t);return e(c.store).getEntityRecordEdits("postType",n,o)||U}));function Z(e,t){switch(t){case"type":return K(e);case"id":return Y(e);default:const n=G(e);if(!n.hasOwnProperty(t))break;return h(n[t])}}function J(e,t){if("content"===t)return be(e);const n=X(e);return n.hasOwnProperty(t)?T.has(t)?((e,t)=>{const n=X(e);return n.hasOwnProperty(t)?{...Z(e,t),...n[t]}:Z(e,t)})(e,t):n[t]:Z(e,t)}const ee=(0,l.createRegistrySelector)((e=>(t,n)=>{var o;if(!I.includes(n)&&"preview_link"!==n)return;const r=K(t),i=Y(t),s=null===(o=e(c.store).getCurrentUser())||void 0===o?void 0:o.id,a=e(c.store).getAutosave(r,i,s);return a?h(a[n]):void 0}));function te(e){if("private"===J(e,"status"))return"private";return J(e,"password")?"password":"public"}function ne(e){return"pending"===G(e).status}function oe(e,t){const n=t||G(e);return-1!==["publish","private"].indexOf(n.status)||"future"===n.status&&!(0,b.isInTheFuture)(new Date(Number((0,b.getDate)(n.date))-6e4))}function re(e){return"future"===G(e).status&&!oe(e)}function ie(e){const t=G(e);return W(e)||-1===["publish","private","future"].indexOf(t.status)}function se(e){return!pe(e)&&(!!J(e,"title")||!!J(e,"excerpt")||!ae(e)||"native"===i.Platform.OS)}function ae(e){const t=Re(e);if(t.length){if(t.length>1)return!1;const e=t[0].name;if(e!==(0,a.getDefaultBlockName)()&&e!==(0,a.getFreeformContentHandlerName)())return!1}return!be(e)}const le=(0,l.createRegistrySelector)((e=>t=>{var n;if(!se(t))return!1;if(xe(t))return!1;const o=K(t),r=Y(t),i=e(c.store).hasFetchedAutosaves(o,r),s=null===(n=e(c.store).getCurrentUser())||void 0===n?void 0:n.id,a=e(c.store).getAutosave(o,r,s);return!!i&&(!a||(!!V(t)||["title","excerpt"].some((e=>h(a[e])!==J(t,e)))))}));function ce(e){const t=J(e,"date"),n=new Date(Number((0,b.getDate)(t))-6e4);return(0,b.isInTheFuture)(n)}function ue(e){const t=J(e,"date"),n=J(e,"modified"),o=G(e).status;return("draft"===o||"auto-draft"===o||"pending"===o)&&(t===n||null===t)}function de(e){return!!e.deleting.pending}const pe=(0,l.createRegistrySelector)((e=>t=>{const n=K(t),o=Y(t);return e(c.store).isSavingEntityRecord("postType",n,o)})),me=(0,l.createRegistrySelector)((e=>t=>{const n=e(c.store).__experimentalGetEntitiesBeingSaved(),{type:o,id:r}=G(t);return n.some((e=>"postType"!==e.kind||e.name!==o||e.key!==r))})),he=(0,l.createRegistrySelector)((e=>t=>{const n=K(t),o=Y(t);return!e(c.store).getLastEntitySaveError("postType",n,o)})),ge=(0,l.createRegistrySelector)((e=>t=>{const n=K(t),o=Y(t);return!!e(c.store).getLastEntitySaveError("postType",n,o)}));function fe(e){var t;return!!pe(e)&&Boolean(null===(t=e.saving.options)||void 0===t?void 0:t.isAutosave)}function ve(e){var t;return!!pe(e)&&Boolean(null===(t=e.saving.options)||void 0===t?void 0:t.isPreview)}function _e(e){if(e.saving.pending||pe(e))return;let t=ee(e,"preview_link");t&&"draft"!==G(e).status||(t=J(e,"link"),t&&(t=(0,E.addQueryArgs)(t,{preview:!0})));const n=J(e,"featured_media");return t&&n?(0,E.addQueryArgs)(t,{_thumbnail_id:n}):t}function ye(e){const t=Re(e);if(t.length>2)return null;let n;if(1===t.length&&(n=t[0].name,"core/embed"===n)){var o;const e=null===(o=t[0].attributes)||void 0===o?void 0:o.providerNameSlug;["youtube","vimeo"].includes(e)?n="core/video":["spotify","soundcloud"].includes(e)&&(n="core/audio")}switch(2===t.length&&"core/paragraph"===t[1].name&&(n=t[0].name),n){case"core/image":return"image";case"core/quote":case"core/pullquote":return"quote";case"core/gallery":return"gallery";case"core/video":return"video";case"core/audio":return"audio";default:return null}}const be=(0,l.createRegistrySelector)((e=>t=>{const n=Y(t),o=K(t),r=e(c.store).getEditedEntityRecord("postType",o,n);if(r){if("function"==typeof r.content)return r.content(r);if(r.blocks)return(0,a.__unstableSerializeAndClean)(r.blocks);if(r.content)return r.content}return""}));function Ee(e){return pe(e)&&!oe(e)&&"publish"===J(e,"status")}function we(e){const t=J(e,"permalink_template");return A.test(t)}function Se(e){const t=ke(e);if(!t)return null;const{prefix:n,postName:o,suffix:r}=t;return we(e)?n+o+r:n}function Pe(e){return J(e,"slug")||(0,E.cleanForSlug)(J(e,"title"))||Y(e)}function ke(e){const t=J(e,"permalink_template");if(!t)return null;const n=J(e,"slug")||J(e,"generated_slug"),[o,r]=t.split(A);return{prefix:o,postName:n,suffix:r}}function Ce(e){return e.postLock.isLocked}function Te(e){return Object.keys(e.postSavingLock).length>0}function xe(e){return Object.keys(e.postAutosavingLock).length>0}function Be(e){return e.postLock.isTakeover}function Ae(e){return e.postLock.user}function Ie(e){return e.postLock.activePostLock}function Ne(e){var t;return Boolean(null===(t=G(e)._links)||void 0===t?void 0:t.hasOwnProperty("wp:action-unfiltered-html"))}const De=(0,l.createRegistrySelector)((e=>()=>!!e(C.store).get("core/edit-post","isPublishSidebarEnabled")));function Re(e){return J(e,"blocks")||M}function Le(e){var t;return S()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),null===(t=J(e,"selection"))||void 0===t?void 0:t.selectionStart}function Oe(e){var t;return S()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),null===(t=J(e,"selection"))||void 0===t?void 0:t.selectionEnd}function Ue(e){return J(e,"selection")}function Me(e){return e.isReady}function Fe(e){return e.editorSettings}function ze(){return S()("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function He(){return S()("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function Ve(e){return(0,l.createRegistrySelector)((t=>function(n){S()("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`",version:"6.2"});for(var o=arguments.length,r=new Array(o>1?o-1:0),i=1;i{var t;const n=(null===(t=Fe(e))||void 0===t?void 0:t.defaultTemplatePartAreas)||[];return null==n?void 0:n.map((e=>({...e,icon:O(e.icon)})))}),(e=>{var t;return[null===(t=Fe(e))||void 0===t?void 0:t.defaultTemplatePartAreas]})),Vt=y(((e,t)=>{var n;const o=zt(e);return o&&null!==(n=Object.values(o).find((e=>e.slug===t)))&&void 0!==n?n:U}),((e,t)=>[zt(e),t]));function Wt(e,t){var n;if(!t)return U;const{description:o,slug:r,title:i,area:s}=t,{title:a,description:l}=Vt(e,r),c="string"==typeof i?i:null==i?void 0:i.rendered;return{title:c&&c!==r?c:a||r,description:("string"==typeof o?o:null==o?void 0:o.raw)||l,icon:(null===(n=Ht(e).find((e=>s===e.area)))||void 0===n?void 0:n.icon)||k}}const jt=(0,l.createRegistrySelector)((e=>t=>{var n;const o=K(t),r=e(c.store).getPostType(o);return null==r||null===(n=r.labels)||void 0===n?void 0:n.singular_name}));var $t=window.wp.apiFetch,Gt=n.n($t),Kt=window.wp.notices;function Yt(e,t){return`wp-autosave-block-editor-post-${t?"auto-draft":e}`}function qt(e,t,n,o,r){window.sessionStorage.setItem(Yt(e,t),JSON.stringify({post_title:n,content:o,excerpt:r}))}function Qt(e,t){window.sessionStorage.removeItem(Yt(e,t))}var Xt=window.wp.i18n;function Zt(e){const{previousPost:t,post:n,postType:o}=e;if((0,s.get)(e.options,["isAutosave"]))return[];if("trash"===n.status&&"trash"!==t.status)return[];const r=["publish","private","future"],i=r.includes(t.status),a=r.includes(n.status);let l,c,u=(0,s.get)(o,["viewable"],!1);i||a?i&&!a?(l=o.labels.item_reverted_to_draft,u=!1):l=!i&&a?{publish:o.labels.item_published,private:o.labels.item_published_privately,future:o.labels.item_scheduled}[n.status]:o.labels.item_updated:(l=(0,Xt.__)("Draft saved."),c=!0);const d=[];return u&&d.push({label:c?(0,Xt.__)("View Preview"):o.labels.view_item,url:n.link}),[l,{id:x,type:"snackbar",actions:d}]}function Jt(e){const{post:t,edits:n,error:o}=e;if(o&&"rest_autosave_no_changes"===o.code)return[];const r=["publish","private","future"],i=-1!==r.indexOf(t.status),s={publish:(0,Xt.__)("Publishing failed."),private:(0,Xt.__)("Publishing failed."),future:(0,Xt.__)("Scheduling failed.")};let a=i||-1===r.indexOf(n.status)?(0,Xt.__)("Updating failed."):s[n.status];return o.message&&!/<\/?[^>]*>/.test(o.message)&&(a=[a,o.message].join(" ")),[a,{id:x}]}const en=(e,t,n)=>o=>{let{dispatch:r}=o;r.setupEditorState(e);if("auto-draft"===e.status&&n){let o;o="content"in t?t.content:e.content.raw;let i=(0,a.parse)(o);i=(0,a.synchronizeBlocksWithTemplate)(i,n),r.resetEditorBlocks(i,{__unstableShouldCreateUndoLevel:!1})}t&&Object.values(t).some((t=>{var n,o;let[r,i]=t;return i!==(null!==(n=null===(o=e[r])||void 0===o?void 0:o.raw)&&void 0!==n?n:e[r])}))&&r.editPost(t)};function tn(){return{type:"TEAR_DOWN_EDITOR"}}function nn(){return S()("wp.data.dispatch( 'core/editor' ).resetPost",{since:"6.0",version:"6.3",alternative:"Initialize the editor with the setupEditorState action"}),{type:"DO_NOTHING"}}function on(){return S()("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function rn(e){return{type:"SETUP_EDITOR_STATE",post:e}}const sn=(e,t)=>n=>{let{select:o,registry:r}=n;const{id:i,type:s}=o.getCurrentPost();r.dispatch(c.store).editEntityRecord("postType",s,i,e,t)},an=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async t=>{let{select:n,dispatch:o,registry:r}=t;if(!n.isEditedPostSaveable())return;const i=n.getEditedPostContent();e.isAutosave||o.editPost({content:i},{undoIgnore:!0});const s=n.getCurrentPost(),a={id:s.id,...r.select(c.store).getEntityRecordNonTransientEdits("postType",s.type,s.id),content:i};o({type:"REQUEST_POST_UPDATE_START",options:e}),await r.dispatch(c.store).saveEntityRecord("postType",s.type,a,e),o({type:"REQUEST_POST_UPDATE_FINISH",options:e});const l=r.select(c.store).getLastEntitySaveError("postType",s.type,s.id);if(l){const e=Jt({post:s,edits:a,error:l});e.length&&r.dispatch(Kt.store).createErrorNotice(...e)}else{const t=n.getCurrentPost(),o=Zt({previousPost:s,post:t,postType:await r.resolveSelect(c.store).getPostType(t.type),options:e});o.length&&r.dispatch(Kt.store).createSuccessNotice(...o),e.isAutosave||r.dispatch(p.store).__unstableMarkLastChangeAsPersistent()}}};function ln(){return S()("wp.data.dispatch( 'core/editor' ).refreshPost",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}const cn=()=>async e=>{let{select:t,dispatch:n,registry:o}=e;const r=t.getCurrentPostType(),i=await o.resolveSelect(c.store).getPostType(r);o.dispatch(Kt.store).removeNotice(B);const{rest_base:s,rest_namespace:a="wp/v2"}=i;n({type:"REQUEST_POST_DELETE_START"});try{const e=t.getCurrentPost();await Gt()({path:`/${a}/${s}/${e.id}`,method:"DELETE"}),await n.savePost()}catch(e){o.dispatch(Kt.store).createErrorNotice(...(l={error:e},[l.error.message&&"unknown_error"!==l.error.code?l.error.message:(0,Xt.__)("Trashing failed"),{id:B}]))}var l;n({type:"REQUEST_POST_DELETE_FINISH"})},un=function(){let{local:e=!1,...t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async n=>{let{select:o,dispatch:r}=n;if(e){const e=o.getCurrentPost(),t=o.isEditedPostNew(),n=o.getEditedPostAttribute("title"),r=o.getEditedPostAttribute("content"),i=o.getEditedPostAttribute("excerpt");qt(e.id,t,n,r,i)}else await r.savePost({isAutosave:!0,...t})}},dn=()=>e=>{let{registry:t}=e;t.dispatch(c.store).redo()},pn=()=>e=>{let{registry:t}=e;t.dispatch(c.store).undo()};function mn(){return S()("wp.data.dispatch( 'core/editor' ).createUndoLevel",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function hn(e){return{type:"UPDATE_POST_LOCK",lock:e}}const gn=()=>e=>{let{registry:t}=e;t.dispatch(C.store).set("core/edit-post","isPublishSidebarEnabled",!0)},fn=()=>e=>{let{registry:t}=e;t.dispatch(C.store).set("core/edit-post","isPublishSidebarEnabled",!1)};function vn(e){return{type:"LOCK_POST_SAVING",lockName:e}}function _n(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function yn(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function bn(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}const En=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{select:o,dispatch:r,registry:i}=n;const{__unstableShouldCreateUndoLevel:s,selection:l}=t,u={blocks:e,selection:l};if(!1!==s){const{id:e,type:t}=o.getCurrentPost();if(i.select(c.store).getEditedEntityRecord("postType",t,e).blocks===u.blocks)return void i.dispatch(c.store).__unstableCreateUndoLevel("postType",t,e);u.content=e=>{let{blocks:t=[]}=e;return(0,a.__unstableSerializeAndClean)(t)}}r.editPost(u)}};function wn(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const Sn=e=>function(){for(var t=arguments.length,n=new Array(t),o=0;o{let{registry:o}=t;S()("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`",version:"6.2"}),o.dispatch(p.store)[e](...n)}},Pn=Sn("resetBlocks"),kn=Sn("receiveBlocks"),Cn=Sn("updateBlock"),Tn=Sn("updateBlockAttributes"),xn=Sn("selectBlock"),Bn=Sn("startMultiSelect"),An=Sn("stopMultiSelect"),In=Sn("multiSelect"),Nn=Sn("clearSelectedBlock"),Dn=Sn("toggleSelection"),Rn=Sn("replaceBlocks"),Ln=Sn("replaceBlock"),On=Sn("moveBlocksDown"),Un=Sn("moveBlocksUp"),Mn=Sn("moveBlockToPosition"),Fn=Sn("insertBlock"),zn=Sn("insertBlocks"),Hn=Sn("showInsertionPoint"),Vn=Sn("hideInsertionPoint"),Wn=Sn("setTemplateValidity"),jn=Sn("synchronizeTemplate"),$n=Sn("mergeBlocks"),Gn=Sn("removeBlocks"),Kn=Sn("removeBlock"),Yn=Sn("toggleBlockMode"),qn=Sn("startTyping"),Qn=Sn("stopTyping"),Xn=Sn("enterFormattedText"),Zn=Sn("exitFormattedText"),Jn=Sn("insertDefaultBlock"),eo=Sn("updateBlockListSettings"),to={reducer:g,selectors:e,actions:t},no=(0,l.createReduxStore)("core/editor",{...to});(0,l.register)(no);function oo(e){var t;const n=(0,s.mapValues)(Object.fromEntries(Object.entries(null!==(t=e.attributes)&&void 0!==t?t:{}).filter((e=>{let[,{source:t}]=e;return"meta"===t}))),"meta");return(0,s.isEmpty)(n)||(e.edit=(e=>(0,u.createHigherOrderComponent)((t=>n=>{let{attributes:o,setAttributes:a,...u}=n;const d=(0,l.useSelect)((e=>e(no).getCurrentPostType()),[]),[p,m]=(0,c.useEntityProp)("postType",d,"meta"),h=(0,i.useMemo)((()=>({...o,...(0,s.mapValues)(e,(e=>p[e]))})),[o,p]);return(0,i.createElement)(t,r({attributes:h,setAttributes:t=>{const n=Object.fromEntries(Object.entries(null!=t?t:{}).filter((t=>{let[n]=t;return n in e})).map((t=>{let[n,o]=t;return[e[n],o]})));(0,s.isEmpty)(n)||m(n),a(t)}},u))}),"withMetaAttributeSource"))(n)(e.edit)),e}function ro(e){const t=e.avatar_urls&&e.avatar_urls[24]?(0,i.createElement)("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):(0,i.createElement)("span",{className:"editor-autocompleters__no-avatar"});return(0,i.createElement)(i.Fragment,null,t,(0,i.createElement)("span",{className:"editor-autocompleters__user-name"},e.name),(0,i.createElement)("span",{className:"editor-autocompleters__user-slug"},e.slug))}(0,d.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",oo),(0,l.select)(a.store).getBlockTypes().map((e=>{let{name:t}=e;return(0,l.select)(a.store).getBlockType(t)})).forEach(oo);var io={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=(0,l.useSelect)((t=>{const{getUsers:n}=t(c.store);return n({context:"view",search:encodeURIComponent(e)})}),[e]),n=(0,i.useMemo)((()=>t?t.map((e=>({key:`user-${e.slug}`,value:e,label:ro(e)}))):[]),[t]);return[n]},getOptionCompletion(e){return`@${e.slug}`}};(0,d.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.push({...io}),e}));class so extends i.Component{constructor(e){super(e),this.needsAutosave=!(!e.isDirty||!e.isAutosaveable)}componentDidMount(){this.props.disableIntervalChecks||this.setAutosaveTimer()}componentDidUpdate(e){this.props.disableIntervalChecks?this.props.editsReference!==e.editsReference&&this.props.autosave():(this.props.interval!==e.interval&&(clearTimeout(this.timerId),this.setAutosaveTimer()),this.props.isDirty&&(!this.props.isAutosaving||e.isAutosaving)?this.props.editsReference!==e.editsReference&&(this.needsAutosave=!0):this.needsAutosave=!1)}componentWillUnmount(){clearTimeout(this.timerId)}setAutosaveTimer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3*this.props.interval;this.timerId=setTimeout((()=>{this.autosaveTimerHandler()}),e)}autosaveTimerHandler(){this.props.isAutosaveable?(this.needsAutosave&&(this.needsAutosave=!1,this.props.autosave()),this.setAutosaveTimer()):this.setAutosaveTimer(1e3)}render(){return null}}var ao=(0,u.compose)([(0,l.withSelect)(((e,t)=>{const{getReferenceByDistinctEdits:n}=e(c.store),{isEditedPostDirty:o,isEditedPostAutosaveable:r,isAutosavingPost:i,getEditorSettings:s}=e(no),{interval:a=s().autosaveInterval}=t;return{editsReference:n(),isDirty:o(),isAutosaveable:r(),isAutosaving:i(),interval:a}})),(0,l.withDispatch)(((e,t)=>({autosave(){const{autosave:n=e(no).autosave}=t;n()}})))])(so),lo=window.wp.richText,co=n(4403),uo=n.n(co);var po=e=>{let{children:t,isValid:n,level:o,href:r,onSelect:s}=e;return(0,i.createElement)("li",{className:uo()("document-outline__item",`is-${o.toLowerCase()}`,{"is-invalid":!n})},(0,i.createElement)("a",{href:r,className:"document-outline__button",onClick:s},(0,i.createElement)("span",{className:"document-outline__emdash","aria-hidden":"true"}),(0,i.createElement)("strong",{className:"document-outline__level"},o),(0,i.createElement)("span",{className:"document-outline__item-content"},t)))};const mo=(0,i.createElement)("em",null,(0,Xt.__)("(Empty heading)")),ho=[(0,i.createElement)("br",{key:"incorrect-break"}),(0,i.createElement)("em",{key:"incorrect-message"},(0,Xt.__)("(Incorrect heading level)"))],go=[(0,i.createElement)("br",{key:"incorrect-break-h1"}),(0,i.createElement)("em",{key:"incorrect-message-h1"},(0,Xt.__)("(Your theme may already use a H1 for the post title)"))],fo=[(0,i.createElement)("br",{key:"incorrect-break-multiple-h1"}),(0,i.createElement)("em",{key:"incorrect-message-multiple-h1"},(0,Xt.__)("(Multiple H1 headings are not recommended)"))],vo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.flatMap((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"core/heading"===e.name?{...e,level:e.attributes.level,isEmpty:_o(e)}:vo(e.innerBlocks)}))},_o=e=>!e.attributes.content||0===e.attributes.content.length;var yo=(0,u.compose)((0,l.withSelect)((e=>{var t,n;const{getBlocks:o}=e(p.store),{getEditedPostAttribute:r}=e(no),{getPostType:i}=e(c.store),s=i(r("type"));return{title:r("title"),blocks:o(),isTitleSupported:null!==(t=null==s||null===(n=s.supports)||void 0===n?void 0:n.title)&&void 0!==t&&t}})))((e=>{let{blocks:t=[],title:n,onSelect:o,isTitleSupported:r,hasOutlineItemsDisabled:s}=e;const a=vo(t);if(a.length<1)return null;let l=1;const c=document.querySelector(".editor-post-title__input"),u=r&&n&&c,d=a.reduce(((e,t)=>({...e,[t.level]:(e[t.level]||0)+1})),{})[1]>1;return(0,i.createElement)("div",{className:"document-outline"},(0,i.createElement)("ul",null,u&&(0,i.createElement)(po,{level:(0,Xt.__)("Title"),isValid:!0,onSelect:o,href:`#${c.id}`,isDisabled:s},n),a.map(((e,t)=>{const n=e.level>l+1,r=!(e.isEmpty||n||!e.level||1===e.level&&(d||u));return l=e.level,(0,i.createElement)(po,{key:t,level:`H${e.level}`,isValid:r,isDisabled:s,href:`#block-${e.clientId}`,onSelect:o},e.isEmpty?mo:(0,lo.getTextContent)((0,lo.create)({html:e.attributes.content})),n&&ho,1===e.level&&d&&fo,u&&1===e.level&&!d&&go)}))))}));var bo=(0,l.withSelect)((e=>({blocks:e(p.store).getBlocks()})))((function(e){let{blocks:t,children:n}=e;return t.filter((e=>"core/heading"===e.name)).length<1?null:n})),Eo=window.wp.keyboardShortcuts;var wo=function(e){let{resetBlocksOnSave:t}=e;const{resetEditorBlocks:n,savePost:o}=(0,l.useDispatch)(no),{isEditedPostDirty:r,getPostEdits:i,isPostSavingLocked:s}=(0,l.useSelect)(no);return(0,Eo.useShortcut)("core/editor/save",(e=>{if(e.preventDefault(),!s()&&r()){if(t){const e=i();if(e.content&&"string"==typeof e.content){const t=(0,a.parse)(e.content);n(t)}}o()}})),null};var So=function(){const{redo:e,undo:t}=(0,l.useDispatch)(no);return(0,Eo.useShortcut)("core/editor/undo",(e=>{t(),e.preventDefault()})),(0,Eo.useShortcut)("core/editor/redo",(t=>{e(),t.preventDefault()})),(0,i.createElement)(wo,null)};function Po(){return(0,i.createElement)(wo,{resetBlocksOnSave:!0})}var ko=window.wp.keycodes;var Co=function(){const{registerShortcut:e}=(0,l.useDispatch)(Eo.store);return(0,i.useEffect)((()=>{e({name:"core/editor/save",category:"global",description:(0,Xt.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/editor/undo",category:"global",description:(0,Xt.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/editor/redo",category:"global",description:(0,Xt.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,ko.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]})}),[e]),(0,i.createElement)(p.BlockEditorKeyboardShortcuts.Register,null)},To=window.wp.components;var xo=(0,i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(P.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"}));var Bo=(0,i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(P.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"}));var Ao=(0,i.forwardRef)((function(e,t){const n=(0,ko.isAppleOS)()?ko.displayShortcut.primaryShift("z"):ko.displayShortcut.primary("y"),o=(0,l.useSelect)((e=>e(no).hasEditorRedo()),[]),{redo:s}=(0,l.useDispatch)(no);return(0,i.createElement)(To.Button,r({},e,{ref:t,icon:(0,Xt.isRTL)()?Bo:xo,label:(0,Xt.__)("Redo"),shortcut:n,"aria-disabled":!o,onClick:o?s:void 0,className:"editor-history__redo"}))}));var Io=(0,i.forwardRef)((function(e,t){const n=(0,l.useSelect)((e=>e(no).hasEditorUndo()),[]),{undo:o}=(0,l.useDispatch)(no);return(0,i.createElement)(To.Button,r({},e,{ref:t,icon:(0,Xt.isRTL)()?xo:Bo,label:(0,Xt.__)("Undo"),shortcut:ko.displayShortcut.primary("z"),"aria-disabled":!n,onClick:n?o:void 0,className:"editor-history__undo"}))}));var No=(0,u.compose)([(0,l.withSelect)((e=>({isValid:e(p.store).isValidTemplate()}))),(0,l.withDispatch)((e=>{const{setTemplateValidity:t,synchronizeTemplate:n}=e(p.store);return{resetTemplateValidity:()=>t(!0),synchronizeTemplate:n}}))])((function(e){let{isValid:t,...n}=e;return t?null:(0,i.createElement)(To.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:(0,Xt.__)("Keep it as is"),onClick:n.resetTemplateValidity},{label:(0,Xt.__)("Reset the template"),onClick:()=>{window.confirm((0,Xt.__)("Resetting the template may result in loss of content, do you want to continue?"))&&n.synchronizeTemplate()}}]},(0,Xt.__)("The content of your post doesn’t match the template assigned to your post type."))}));var Do=(0,u.compose)([(0,l.withSelect)((e=>({notices:e(Kt.store).getNotices()}))),(0,l.withDispatch)((e=>({onRemove:e(Kt.store).removeNotice})))])((function(e){let{notices:t,onRemove:n}=e;const o=t.filter((e=>{let{isDismissible:t,type:n}=e;return t&&"default"===n})),r=t.filter((e=>{let{isDismissible:t,type:n}=e;return!t&&"default"===n}));return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.NoticeList,{notices:r,className:"components-editor-notices__pinned"}),(0,i.createElement)(To.NoticeList,{notices:o,className:"components-editor-notices__dismissible",onRemove:n},(0,i.createElement)(No,null)))}));function Ro(){const e=(0,l.useSelect)((e=>e(Kt.store).getNotices()),[]),{removeNotice:t}=(0,l.useDispatch)(Kt.store),n=e.filter((e=>{let{type:t}=e;return"snackbar"===t}));return(0,i.createElement)(To.SnackbarList,{notices:n,className:"components-editor-notices__snackbar",onRemove:t})}var Lo=window.wp.htmlEntities;function Oo(e){let{record:t,checked:n,onChange:o,closePanel:r}=e;const{name:s,kind:a,title:u,key:d}=t,m=(0,l.useSelect)((e=>{var t;const{blocks:n=[]}=e(c.store).getEditedEntityRecord(a,s,d),o=e(p.store).getBlockParents(null===(t=n[0])||void 0===t?void 0:t.clientId);return o[o.length-1]}),[]),h=(0,l.useSelect)((e=>{if("postType"!==a||"wp_template"!==s)return u;const t=e(c.store).getEditedEntityRecord(a,s,d);return e(no).__experimentalGetTemplateInfo(t).title}),[s,a,u,d]),g=(0,l.useSelect)((e=>e(p.store).getSelectedBlockClientId()===m),[m]),f=g?(0,Xt.__)("Selected"):(0,Xt.__)("Select"),{selectBlock:v}=(0,l.useDispatch)(p.store),_=(0,i.useCallback)((()=>v(m)),[m]),y=(0,i.useCallback)((()=>{v(m),r()}),[m]);return(0,i.createElement)(To.PanelRow,null,(0,i.createElement)(To.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,i.createElement)("strong",null,(0,Lo.decodeEntities)(h)||(0,Xt.__)("Untitled")),checked:n,onChange:o}),m?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.Button,{onClick:_,className:"entities-saved-states__find-entity",disabled:g},f),(0,i.createElement)(To.Button,{onClick:y,className:"entities-saved-states__find-entity-small",disabled:g},f)):null)}function Uo(e){let{list:t,unselectedEntities:n,setUnselectedEntities:o,closePanel:r}=e;const s=t.length,a=t[0],u=(0,l.useSelect)((e=>e(c.store).getEntityConfig(a.kind,a.name)),[a.kind,a.name]),{name:d}=a;let p=u.label;"wp_template_part"===d&&(p=1===s?(0,Xt.__)("Template Part"):(0,Xt.__)("Template Parts"));const m=function(e,t){switch(e){case"site":return 1===t?(0,Xt.__)("This change will affect your whole site."):(0,Xt.__)("These changes will affect your whole site.");case"wp_template":return(0,Xt.__)("This change will affect pages and posts that use this template.");case"page":case"post":return(0,Xt.__)("The following content has been modified.")}}(d,s);return(0,i.createElement)(To.PanelBody,{title:p,initialOpen:!0},m&&(0,i.createElement)(To.PanelRow,null,m),t.map((e=>(0,i.createElement)(Oo,{key:e.key||e.property,record:e,checked:!n.some((t=>t.kind===e.kind&&t.name===e.name&&t.key===e.key&&t.property===e.property)),onChange:t=>o(e,t),closePanel:r}))))}const Mo={title:(0,Xt.__)("Title"),description:(0,Xt.__)("Tagline"),site_logo:(0,Xt.__)("Logo"),site_icon:(0,Xt.__)("Icon"),show_on_front:(0,Xt.__)("Show on front"),page_on_front:(0,Xt.__)("Page on front")},Fo=[{kind:"postType",name:"wp_navigation"}];function zo(e){let{close:t}=e;const n=(0,i.useRef)(),{dirtyEntityRecords:o}=(0,l.useSelect)((e=>{const t=e(c.store).__experimentalGetDirtyEntityRecords().filter((e=>!("root"===e.kind&&"site"===e.name))),n=e(c.store).getEntityRecordEdits("root","site"),o=[];for(const e in n)o.push({kind:"root",name:"site",title:Mo[e]||e,property:e});return{dirtyEntityRecords:[...t,...o]}}),[]),{editEntityRecord:a,saveEditedEntityRecord:d,__experimentalSaveSpecifiedEntityEdits:m}=(0,l.useDispatch)(c.store),{__unstableMarkLastChangeAsPersistent:h}=(0,l.useDispatch)(p.store),{createSuccessNotice:g,createErrorNotice:f}=(0,l.useDispatch)(Kt.store),v=(0,s.groupBy)(o,"name"),{site:_,wp_template:y,wp_template_part:b,...E}=v,w=[_,y,b,...Object.values(E)].filter(Array.isArray),[S,P]=(0,i.useState)([]),k=(e,t)=>{let{kind:n,name:o,key:r,property:i}=e;P(t?S.filter((e=>e.kind!==n||e.name!==o||e.key!==r||e.property!==i)):[...S,{kind:n,name:o,key:r,property:i}])},C=(0,i.useCallback)((()=>t()),[t]),[T,x]=(0,u.__experimentalUseDialog)({onClose:()=>C()});return(0,i.createElement)("div",r({ref:T},x,{className:"entities-saved-states__panel"}),(0,i.createElement)(To.Flex,{className:"entities-saved-states__panel-header",gap:2},(0,i.createElement)(To.FlexItem,{isBlock:!0,as:To.Button,ref:n,variant:"primary",disabled:o.length-S.length==0,onClick:()=>{const e=o.filter((e=>{let{kind:t,name:n,key:o,property:r}=e;return!S.some((e=>e.kind===t&&e.name===n&&e.key===o&&e.property===r))}));t(e);const n=[],r=[];e.forEach((e=>{let{kind:t,name:o,key:i,property:s}=e;"root"===t&&"site"===o?n.push(s):(Fo.some((e=>e.kind===t&&e.name===o))&&a(t,o,i,{status:"publish"}),r.push(d(t,o,i)))})),n.length&&r.push(m("root","site",void 0,n)),h(),Promise.all(r).then((e=>{e.some((e=>void 0===e))?f((0,Xt.__)("Saving failed.")):g((0,Xt.__)("Site updated."),{type:"snackbar"})})).catch((e=>f(`${(0,Xt.__)("Saving failed.")} ${e}`)))},className:"editor-entities-saved-states__save-button"},(0,Xt.__)("Save")),(0,i.createElement)(To.FlexItem,{isBlock:!0,as:To.Button,variant:"secondary",onClick:C},(0,Xt.__)("Cancel"))),(0,i.createElement)("div",{className:"entities-saved-states__text-prompt"},(0,i.createElement)("strong",null,(0,Xt.__)("Are you ready to save?")),(0,i.createElement)("p",null,(0,Xt.__)("The following changes have been made to your site, templates, and content."))),w.map((e=>(0,i.createElement)(Uo,{key:e[0].name,list:e,closePanel:C,unselectedEntities:S,setUnselectedEntities:k}))))}function Ho(){try{return(0,l.select)(no).getEditedPostContent()}catch(e){}}function Vo(e){let{text:t,children:n}=e;const o=(0,u.useCopyToClipboard)(t);return(0,i.createElement)(To.Button,{variant:"secondary",ref:o},n)}class Wo extends i.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,d.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){const{error:e}=this.state;if(!e)return this.props.children;const t=[(0,i.createElement)(Vo,{key:"copy-post",text:Ho},(0,Xt.__)("Copy Post Text")),(0,i.createElement)(Vo,{key:"copy-error",text:e.stack},(0,Xt.__)("Copy Error"))];return(0,i.createElement)(p.Warning,{className:"editor-error-boundary",actions:t},(0,Xt.__)("The editor has encountered an unexpected error."))}}var jo=Wo;const $o=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame;let Go;function Ko(){const{postId:e,isEditedPostNew:t,hasRemoteAutosave:n}=(0,l.useSelect)((e=>({postId:e(no).getCurrentPostId(),isEditedPostNew:e(no).isEditedPostNew(),hasRemoteAutosave:!!e(no).getEditorSettings().autosave})),[]),{getEditedPostAttribute:o}=(0,l.useSelect)(no),{createWarningNotice:r,removeNotice:s}=(0,l.useDispatch)(Kt.store),{editPost:c,resetEditorBlocks:u}=(0,l.useDispatch)(no);(0,i.useEffect)((()=>{let i=function(e,t){return window.sessionStorage.getItem(Yt(e,t))}(e,t);if(!i)return;try{i=JSON.parse(i)}catch{return}const{post_title:l,content:d,excerpt:p}=i,m={title:l,content:d,excerpt:p};if(!Object.keys(m).some((e=>m[e]!==o(e))))return void Qt(e,t);if(n)return;const h="wpEditorAutosaveRestore";r((0,Xt.__)("The backup of this post in your browser is different from the version below."),{id:h,actions:[{label:(0,Xt.__)("Restore the backup"),onClick(){const{content:e,...t}=m;c(t),u((0,a.parse)(m.content)),s(h)}}]})}),[t,e])}var Yo=(0,u.ifCondition)((()=>{if(void 0!==Go)return Go;try{window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),Go=!0}catch{Go=!1}return Go}))((function(){const{autosave:e}=(0,l.useDispatch)(no),t=(0,i.useCallback)((()=>{$o((()=>e({local:!0})))}),[]);Ko(),function(){const{postId:e,isEditedPostNew:t,isDirty:n,isAutosaving:o,didError:r}=(0,l.useSelect)((e=>({postId:e(no).getCurrentPostId(),isEditedPostNew:e(no).isEditedPostNew(),isDirty:e(no).isEditedPostDirty(),isAutosaving:e(no).isAutosavingPost(),didError:e(no).didPostSaveRequestFail()})),[]),s=(0,i.useRef)(n),a=(0,i.useRef)(o);(0,i.useEffect)((()=>{!r&&(a.current&&!o||s.current&&!n)&&Qt(e,t),s.current=n,a.current=o}),[n,o,r]);const c=(0,u.usePrevious)(t),d=(0,u.usePrevious)(e);(0,i.useEffect)((()=>{d===e&&c&&!t&&Qt(e,!0)}),[t,e])}();const n=(0,l.useSelect)((e=>e(no).getEditorSettings().localAutosaveInterval),[]);return(0,i.createElement)(ao,{interval:n,autosave:t})}));var qo=function(e){let{children:t}=e;const n=(0,l.useSelect)((e=>{const{getEditedPostAttribute:t}=e(no),{getPostType:n}=e(c.store);return n(t("type"))}),[]);return(0,s.get)(n,["supports","page-attributes"],!1)?t:null};var Qo=(0,l.withSelect)((e=>{const{getEditedPostAttribute:t}=e(no),{getPostType:n}=e(c.store);return{postType:n(t("type"))}}))((function(e){let{postType:t,children:n,supportKeys:o}=e,r=!0;return t&&(r=(Array.isArray(o)?o:[o]).some((e=>!!t.supports[e]))),r?n:null}));const Xo=e=>{let{onUpdateOrder:t,order:n=0}=e;const[o,r]=(0,i.useState)(null),s=null===o?n:o;return(0,i.createElement)(To.TextControl,{className:"editor-page-attributes__order",type:"number",label:(0,Xt.__)("Order"),value:s,onChange:e=>{var n;r(e);const o=Number(e);Number.isInteger(o)&&""!==(null===(n=e.trim)||void 0===n?void 0:n.call(e))&&t(Number(e))},size:6,onBlur:()=>{r(null)}})};var Zo=(0,u.compose)([(0,l.withSelect)((e=>({order:e(no).getEditedPostAttribute("menu_order")}))),(0,l.withDispatch)((e=>({onUpdateOrder(t){e(no).editPost({menu_order:t})}})))])((function(e){return(0,i.createElement)(Qo,{supportKeys:"page-attributes"},(0,i.createElement)(Xo,e))})),Jo=n(4793),er=n.n(Jo);function tr(e){const t=e.map((e=>({children:[],parent:null,...e}))),n=(0,s.groupBy)(t,"parent");if(n.null&&n.null.length)return t;const o=e=>e.map((e=>{const t=n[e.id];return{...e,children:t&&t.length?o(t):[]}}));return o(n[0]||[])}const nr=e=>(0,Lo.decodeEntities)(e),or=e=>({...e,name:nr(e.name)});function rr(e){var t;return null!=e&&null!==(t=e.title)&&void 0!==t&&t.rendered?(0,Lo.decodeEntities)(e.title.rendered):`#${e.id} (${(0,Xt.__)("no title")})`}const ir=(e,t)=>{const n=er()(e||"").toLowerCase(),o=er()(t||"").toLowerCase();return n===o?0:n.startsWith(o)?n.length:1/0};var sr=function(){const{editPost:e}=(0,l.useDispatch)(no),[t,n]=(0,i.useState)(!1),{parentPost:o,parentPostId:r,items:a,postType:d}=(0,l.useSelect)((e=>{const{getPostType:n,getEntityRecords:o,getEntityRecord:r}=e(c.store),{getCurrentPostId:i,getEditedPostAttribute:a}=e(no),l=a("type"),u=a("parent"),d=n(l),p=i(),m=(0,s.get)(d,["hierarchical"],!1),h={per_page:100,exclude:p,parent_exclude:p,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};return t&&(h.search=t),{parentPostId:u,parentPost:u?r("postType",l,u):null,items:m?o("postType",l,h):[],postType:d}}),[t]),p=(0,s.get)(d,["hierarchical"],!1),m=(0,s.get)(d,["labels","parent_item_colon"]),h=a||[],g=(0,i.useMemo)((()=>{const e=function(n){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=n.map((t=>[{value:t.id,label:"— ".repeat(o)+(0,Lo.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],o+1)])),i=r.sort(((e,n)=>{let[o]=e,[r]=n;return ir(o.rawName,t)>=ir(r.rawName,t)?1:-1}));return i.flat()};let n=h.map((e=>({id:e.id,parent:e.parent,name:rr(e)})));t||(n=tr(n));const i=e(n),s=i.find((e=>e.value===r));return o&&!s&&i.unshift({value:r,label:rr(o)}),i}),[h,t]);return p&&m?(0,i.createElement)(To.ComboboxControl,{__nextHasNoMarginBottom:!0,className:"editor-page-attributes__parent",label:m,value:r,options:g,onFilterValueChange:(0,u.debounce)((e=>{n(e)}),300),onChange:t=>{e({parent:t})}}):null};var ar=function(){const{availableTemplates:e,selectedTemplate:t,isViewable:n}=(0,l.useSelect)((e=>{var t,n;const{getEditedPostAttribute:o,getEditorSettings:r,getCurrentPostType:i}=e(no),{getPostType:s}=e(c.store);return{selectedTemplate:o("template"),availableTemplates:r().availableTemplates,isViewable:null!==(t=null===(n=s(i()))||void 0===n?void 0:n.viewable)&&void 0!==t&&t}}),[]),{editPost:o}=(0,l.useDispatch)(no);return!n||(0,s.isEmpty)(e)?null:(0,i.createElement)(To.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Template:"),value:t,onChange:e=>{o({template:e||""})},options:Object.entries(null!=e?e:{}).map((e=>{let[t,n]=e;return{value:t,label:n}}))})};const lr={who:"authors",per_page:50,_fields:"id,name",context:"view"};var cr=function(){const[e,t]=(0,i.useState)(),{authorId:n,isLoading:o,authors:r,postAuthor:s}=(0,l.useSelect)((t=>{const{getUser:n,getUsers:o,isResolving:r}=t(c.store),{getEditedPostAttribute:i}=t(no),s=n(i("author"),{context:"view"}),a={...lr};return e&&(a.search=e),{authorId:i("author"),postAuthor:s,authors:o(a),isLoading:r("core","getUsers",[a])}}),[e]),{editPost:a}=(0,l.useDispatch)(no),d=(0,i.useMemo)((()=>{const e=(null!=r?r:[]).map((e=>({value:e.id,label:(0,Lo.decodeEntities)(e.name)})));return e.findIndex((e=>{let{value:t}=e;return(null==s?void 0:s.id)===t}))<0&&s?[{value:s.id,label:(0,Lo.decodeEntities)(s.name)},...e]:e}),[r,s]);return s?(0,i.createElement)(To.ComboboxControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Author"),options:d,value:n,onFilterValueChange:(0,u.debounce)((e=>{t(e)}),300),onChange:e=>{e&&a({author:e})},isLoading:o,allowReset:!1}):null};var ur=function(){const{editPost:e}=(0,l.useDispatch)(no),{postAuthor:t,authors:n}=(0,l.useSelect)((e=>({postAuthor:e(no).getEditedPostAttribute("author"),authors:e(c.store).getUsers(lr)})),[]),o=(0,i.useMemo)((()=>(null!=n?n:[]).map((e=>({value:e.id,label:(0,Lo.decodeEntities)(e.name)})))),[n]);return(0,i.createElement)(To.SelectControl,{__nextHasNoMarginBottom:!0,className:"post-author-selector",label:(0,Xt.__)("Author"),options:o,onChange:t=>{const n=Number(t);e({author:n})},value:t})};var dr=function(){return(0,l.useSelect)((e=>{const t=e(c.store).getUsers(lr);return(null==t?void 0:t.length)>=25}),[])?(0,i.createElement)(cr,null):(0,i.createElement)(ur,null)};function pr(e){let{children:t}=e;const{hasAssignAuthorAction:n,hasAuthors:o}=(0,l.useSelect)((e=>{const t=e(no).getCurrentPost(),n=e(c.store).getUsers(lr);return{hasAssignAuthorAction:(0,s.get)(t,["_links","wp:action-assign-author"],!1),hasAuthors:(null==n?void 0:n.length)>=1}}),[]);return n&&o?(0,i.createElement)(Qo,{supportKeys:"author"},t):null}var mr=(0,u.compose)([(0,l.withSelect)((e=>({commentStatus:e(no).getEditedPostAttribute("comment_status")}))),(0,l.withDispatch)((e=>({editPost:e(no).editPost})))])((function(e){let{commentStatus:t="open",...n}=e;return(0,i.createElement)(To.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Allow comments"),checked:"open"===t,onChange:()=>n.editPost({comment_status:"open"===t?"closed":"open"})})}));var hr=(0,u.compose)([(0,l.withSelect)((e=>({excerpt:e(no).getEditedPostAttribute("excerpt")}))),(0,l.withDispatch)((e=>({onUpdateExcerpt(t){e(no).editPost({excerpt:t})}})))])((function(e){let{excerpt:t,onUpdateExcerpt:n}=e;return(0,i.createElement)("div",{className:"editor-post-excerpt"},(0,i.createElement)(To.TextareaControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Write an excerpt (optional)"),className:"editor-post-excerpt__textarea",onChange:e=>n(e),value:t}),(0,i.createElement)(To.ExternalLink,{href:(0,Xt.__)("https://wordpress.org/support/article/settings-sidebar/#excerpt")},(0,Xt.__)("Learn more about manual excerpts")))}));var gr=function(e){return(0,i.createElement)(Qo,r({},e,{supportKeys:"excerpt"}))},fr=window.wp.blob;var vr=(0,l.withSelect)((e=>{const{getThemeSupports:t}=e(c.store),{getEditedPostAttribute:n}=e(no);return{postType:n("type"),themeSupports:t()}}))((function(e){let{themeSupports:t,children:n,postType:o,supportKeys:r}=e;return(Array.isArray(r)?r:[r]).some((e=>{const n=(0,s.get)(t,[e],!1);return"post-thumbnails"===e&&Array.isArray(n)?n.includes(o):n}))?n:null}));var _r=function(e){return(0,i.createElement)(vr,{supportKeys:"post-thumbnails"},(0,i.createElement)(Qo,r({},e,{supportKeys:"thumbnail"})))};const yr=["image"],br=(0,Xt.__)("Featured image"),Er=(0,Xt.__)("Set featured image"),wr=(0,Xt.__)("Remove image"),Sr=(0,i.createElement)("p",null,(0,Xt.__)("To edit the featured image, you need permission to upload media."));const Pr=(0,l.withSelect)((e=>{const{getMedia:t,getPostType:n}=e(c.store),{getCurrentPostId:o,getEditedPostAttribute:r}=e(no),i=r("featured_media");return{media:i?t(i,{context:"view"}):null,currentPostId:o(),postType:n(r("type")),featuredImageId:i}})),kr=(0,l.withDispatch)(((e,t,n)=>{let{noticeOperations:o}=t,{select:r}=n;const{editPost:i}=e(no);return{onUpdateImage(e){i({featured_media:e.id})},onDropImage(e){r(p.store).getSettings().mediaUpload({allowedTypes:["image"],filesList:e,onFileChange(e){let[t]=e;i({featured_media:t.id})},onError(e){o.removeAllNotices(),o.createErrorNotice(e)}})},onRemoveImage(){i({featured_media:0})}}}));var Cr=(0,u.compose)(To.withNotices,Pr,kr,(0,To.withFilters)("editor.PostFeaturedImage"))((function(e){var t,n;let{currentPostId:o,featuredImageId:r,onUpdateImage:a,onRemoveImage:c,media:u,postType:m,noticeUI:h,noticeOperations:g}=e;const[f,v]=(0,i.useState)(!1),_=(0,l.useSelect)((e=>e(p.store).getSettings().mediaUpload),[]),y=(0,s.get)(m,["labels"],{}),{mediaWidth:b,mediaHeight:E,mediaSourceUrl:w}=function(e,t){var n,o,r,i;if(!e)return{};const s=(0,d.applyFilters)("editor.PostFeaturedImage.imageSize","large",e.id,t);if(s in(null!==(n=null==e||null===(o=e.media_details)||void 0===o?void 0:o.sizes)&&void 0!==n?n:{}))return{mediaWidth:e.media_details.sizes[s].width,mediaHeight:e.media_details.sizes[s].height,mediaSourceUrl:e.media_details.sizes[s].source_url};const a=(0,d.applyFilters)("editor.PostFeaturedImage.imageSize","thumbnail",e.id,t);return a in(null!==(r=null==e||null===(i=e.media_details)||void 0===i?void 0:i.sizes)&&void 0!==r?r:{})?{mediaWidth:e.media_details.sizes[a].width,mediaHeight:e.media_details.sizes[a].height,mediaSourceUrl:e.media_details.sizes[a].source_url}:{mediaWidth:e.media_details.width,mediaHeight:e.media_details.height,mediaSourceUrl:e.source_url}}(u,o);function S(e){_({allowedTypes:["image"],filesList:e,onFileChange(e){let[t]=e;(0,fr.isBlobURL)(null==t?void 0:t.url)?v(!0):(a(t),v(!1))},onError(e){g.removeAllNotices(),g.createErrorNotice(e)}})}return(0,i.createElement)(_r,null,h,(0,i.createElement)("div",{className:"editor-post-featured-image"},u&&(0,i.createElement)("div",{id:`editor-post-featured-image-${r}-describedby`,className:"hidden"},u.alt_text&&(0,Xt.sprintf)((0,Xt.__)("Current image: %s"),u.alt_text),!u.alt_text&&(0,Xt.sprintf)((0,Xt.__)("The current image has no alternative text. The file name is: %s"),(null===(t=u.media_details.sizes)||void 0===t||null===(n=t.full)||void 0===n?void 0:n.file)||u.slug)),(0,i.createElement)(p.MediaUploadCheck,{fallback:Sr},(0,i.createElement)(p.MediaUpload,{title:y.featured_image||br,onSelect:a,unstableFeaturedImageFlow:!0,allowedTypes:yr,modalClass:"editor-post-featured-image__media-modal",render:e=>{let{open:t}=e;return(0,i.createElement)("div",{className:"editor-post-featured-image__container"},(0,i.createElement)(To.Button,{className:r?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:t,"aria-label":r?(0,Xt.__)("Edit or update the image"):null,"aria-describedby":r?`editor-post-featured-image-${r}-describedby`:null},!!r&&u&&(0,i.createElement)(To.ResponsiveWrapper,{naturalWidth:b,naturalHeight:E,isInline:!0},(0,i.createElement)("img",{src:w,alt:""})),f&&(0,i.createElement)(To.Spinner,null),!r&&!f&&(y.set_featured_image||Er)),(0,i.createElement)(To.DropZone,{onFilesDrop:S}))},value:r})),!!r&&(0,i.createElement)(p.MediaUploadCheck,null,u&&(0,i.createElement)(p.MediaUpload,{title:y.featured_image||br,onSelect:a,unstableFeaturedImageFlow:!0,allowedTypes:yr,modalClass:"editor-post-featured-image__media-modal",render:e=>{let{open:t}=e;return(0,i.createElement)(To.Button,{onClick:t,variant:"secondary"},(0,Xt.__)("Replace Image"))}}),(0,i.createElement)(To.Button,{onClick:c,variant:"link",isDestructive:!0},y.remove_featured_image||wr))))}));var Tr=(0,l.withSelect)((e=>({disablePostFormats:e(no).getEditorSettings().disablePostFormats})))((function(e){let{disablePostFormats:t,...n}=e;return!t&&(0,i.createElement)(Qo,r({},n,{supportKeys:"post-formats"}))}));const xr=[{id:"aside",caption:(0,Xt.__)("Aside")},{id:"audio",caption:(0,Xt.__)("Audio")},{id:"chat",caption:(0,Xt.__)("Chat")},{id:"gallery",caption:(0,Xt.__)("Gallery")},{id:"image",caption:(0,Xt.__)("Image")},{id:"link",caption:(0,Xt.__)("Link")},{id:"quote",caption:(0,Xt.__)("Quote")},{id:"standard",caption:(0,Xt.__)("Standard")},{id:"status",caption:(0,Xt.__)("Status")},{id:"video",caption:(0,Xt.__)("Video")}].sort(((e,t)=>{const n=e.caption.toUpperCase(),o=t.caption.toUpperCase();return no?1:0}));function Br(){const e=`post-format-selector-${(0,u.useInstanceId)(Br)}`,{postFormat:t,suggestedFormat:n,supportedFormats:o}=(0,l.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:n}=e(no),o=t("format"),r=e(c.store).getThemeSupports();return{postFormat:null!=o?o:"standard",suggestedFormat:n(),supportedFormats:r.formats}}),[]),r=xr.filter((e=>(null==o?void 0:o.includes(e.id))||t===e.id)),s=r.find((e=>e.id===n)),{editPost:a}=(0,l.useDispatch)(no),d=e=>a({format:e});return(0,i.createElement)(Tr,null,(0,i.createElement)("div",{className:"editor-post-format"},(0,i.createElement)(To.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Post Format"),value:t,onChange:e=>d(e),id:e,options:r.map((e=>({label:e.caption,value:e.id})))}),s&&s.id!==t&&(0,i.createElement)("p",{className:"editor-post-format__suggestion"},(0,i.createElement)(To.Button,{variant:"link",onClick:()=>d(s.id)},(0,Xt.sprintf)((0,Xt.__)("Apply suggested format: %s"),s.caption)))))}var Ar=(0,i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(P.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"}));var Ir=(0,l.withSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(no);return{lastRevisionId:t(),revisionsCount:n()}}))((function(e){let{lastRevisionId:t,revisionsCount:n,children:o}=e;return!t||n<2?null:(0,i.createElement)(Qo,{supportKeys:"revisions"},o)}));var Nr=(0,l.withSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(no);return{lastRevisionId:t(),revisionsCount:n()}}))((function(e){let{lastRevisionId:t,revisionsCount:n}=e;return(0,i.createElement)(Ir,null,(0,i.createElement)(To.Button,{href:(0,E.addQueryArgs)("revision.php",{revision:t,gutenberg:!0}),className:"editor-post-last-revision__title",icon:Ar},(0,Xt.sprintf)((0,Xt._n)("%d Revision","%d Revisions",n),n)))}));function Dr(){const e="core/editor/post-locked-modal-"+(0,u.useInstanceId)(Dr),{autosave:t,updatePostLock:n}=(0,l.useDispatch)(no),{isLocked:o,isTakeover:r,user:a,postId:p,postLockUtils:m,activePostLock:h,postType:g,previewLink:f}=(0,l.useSelect)((e=>{const{isPostLocked:t,isPostLockTakeover:n,getPostLockUser:o,getCurrentPostId:r,getActivePostLock:i,getEditedPostAttribute:s,getEditedPostPreviewLink:a,getEditorSettings:l}=e(no),{getPostType:u}=e(c.store);return{isLocked:t(),isTakeover:n(),user:o(),postId:r(),postLockUtils:l().postLockUtils,activePostLock:i(),postType:u(s("type")),previewLink:a()}}),[]);if((0,i.useEffect)((()=>{function r(){if(o||!h)return;const e=new window.FormData;if(e.append("action","wp-remove-post-lock"),e.append("_wpnonce",m.unlockNonce),e.append("post_ID",p),e.append("active_post_lock",h),window.navigator.sendBeacon)window.navigator.sendBeacon(m.ajaxUrl,e);else{const t=new window.XMLHttpRequest;t.open("POST",m.ajaxUrl,!1),t.send(e)}}return(0,d.addAction)("heartbeat.send",e,(function(e){o||(e["wp-refresh-post-lock"]={lock:h,post_id:p})})),(0,d.addAction)("heartbeat.tick",e,(function(e){if(!e["wp-refresh-post-lock"])return;const o=e["wp-refresh-post-lock"];o.lock_error?(t(),n({isLocked:!0,isTakeover:!0,user:{name:o.lock_error.name,avatar:o.lock_error.avatar_src_2x}})):o.new_lock&&n({isLocked:!1,activePostLock:o.new_lock})})),window.addEventListener("beforeunload",r),()=>{(0,d.removeAction)("heartbeat.send",e),(0,d.removeAction)("heartbeat.tick",e),window.removeEventListener("beforeunload",r)}}),[]),!o)return null;const v=a.name,_=a.avatar,y=(0,E.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:p,action:"edit",_wpnonce:m.nonce}),b=(0,E.addQueryArgs)("edit.php",{post_type:(0,s.get)(g,["slug"])}),w=(0,Xt.__)("Exit editor");return(0,i.createElement)(To.Modal,{title:r?(0,Xt.__)("Someone else has taken over this post"):(0,Xt.__)("This post is already being edited"),focusOnMount:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,className:"editor-post-locked-modal"},!!_&&(0,i.createElement)("img",{src:_,alt:(0,Xt.__)("Avatar"),className:"editor-post-locked-modal__avatar",width:64,height:64}),(0,i.createElement)("div",null,!!r&&(0,i.createElement)("p",null,(0,i.createInterpolateElement)(v?(0,Xt.sprintf)((0,Xt.__)("%s now has editing control of this post (). Don’t worry, your changes up to this moment have been saved."),v):(0,Xt.__)("Another user now has editing control of this post (). Don’t worry, your changes up to this moment have been saved."),{strong:(0,i.createElement)("strong",null),PreviewLink:(0,i.createElement)(To.ExternalLink,{href:f},(0,Xt.__)("preview"))})),!r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("p",null,(0,i.createInterpolateElement)(v?(0,Xt.sprintf)((0,Xt.__)("%s is currently working on this post (), which means you cannot make changes, unless you take over."),v):(0,Xt.__)("Another user is currently working on this post (), which means you cannot make changes, unless you take over."),{strong:(0,i.createElement)("strong",null),PreviewLink:(0,i.createElement)(To.ExternalLink,{href:f},(0,Xt.__)("preview"))})),(0,i.createElement)("p",null,(0,Xt.__)("If you take over, the other user will lose editing control to the post, but their changes will be saved."))),(0,i.createElement)(To.Flex,{className:"editor-post-locked-modal__buttons",justify:"flex-end",expanded:!1},!r&&(0,i.createElement)(To.FlexItem,null,(0,i.createElement)(To.Button,{variant:"tertiary",href:y},(0,Xt.__)("Take over"))),(0,i.createElement)(To.FlexItem,null,(0,i.createElement)(To.Button,{variant:"primary",href:b},w)))))}var Rr=(0,u.compose)((0,l.withSelect)((e=>{const{isCurrentPostPublished:t,getCurrentPostType:n,getCurrentPost:o}=e(no);return{hasPublishAction:(0,s.get)(o(),["_links","wp:action-publish"],!1),isPublished:t(),postType:n()}})))((function(e){let{hasPublishAction:t,isPublished:n,children:o}=e;return n||!t?null:o}));var Lr=(0,u.compose)((0,l.withSelect)((e=>({status:e(no).getEditedPostAttribute("status")}))),(0,l.withDispatch)((e=>({onUpdateStatus(t){e(no).editPost({status:t})}}))))((function(e){let{status:t,onUpdateStatus:n}=e;return(0,i.createElement)(Rr,null,(0,i.createElement)(To.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Pending review"),checked:"pending"===t,onChange:()=>{n("pending"===t?"draft":"pending")}}))}));var Or=(0,u.compose)([(0,l.withSelect)((e=>({pingStatus:e(no).getEditedPostAttribute("ping_status")}))),(0,l.withDispatch)((e=>({editPost:e(no).editPost})))])((function(e){let{pingStatus:t="open",...n}=e;return(0,i.createElement)(To.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Allow pingbacks & trackbacks"),checked:"open"===t,onChange:()=>n.editPost({ping_status:"open"===t?"closed":"open"})})}));class Ur extends i.Component{constructor(){super(...arguments),this.buttonRef=(0,i.createRef)(),this.openPreviewWindow=this.openPreviewWindow.bind(this)}componentDidUpdate(e){const{previewLink:t}=this.props;t&&!e.previewLink&&this.setPreviewWindowLink(t)}setPreviewWindowLink(e){const{previewWindow:t}=this;t&&!t.closed&&(t.location=e,this.buttonRef.current&&this.buttonRef.current.focus())}getWindowTarget(){const{postId:e}=this.props;return`wp-preview-${e}`}openPreviewWindow(e){e.preventDefault(),this.previewWindow&&!this.previewWindow.closed||(this.previewWindow=window.open("",this.getWindowTarget())),this.previewWindow.focus(),this.props.isAutosaveable&&!this.props.isPostLocked?(this.props.isDraft?this.props.savePost({isPreview:!0}):this.props.autosave({isPreview:!0}),function(e){let t=(0,i.renderToString)((0,i.createElement)("div",{className:"editor-post-preview-button__interstitial-message"},(0,i.createElement)(To.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96"},(0,i.createElement)(To.Path,{className:"outer",d:"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",fill:"none"}),(0,i.createElement)(To.Path,{className:"inner",d:"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",fill:"none"})),(0,i.createElement)("p",null,(0,Xt.__)("Generating preview…"))));t+='\n\t\t\n\t',t=(0,d.applyFilters)("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=(0,Xt.__)("Generating preview…"),e.close()}(this.previewWindow.document)):this.setPreviewWindowLink(e.target.href)}render(){const{previewLink:e,currentPostLink:t,isSaveable:n,role:o}=this.props,r=e||t,s=uo()({"editor-post-preview":!this.props.className},this.props.className);return(0,i.createElement)(To.Button,{variant:this.props.className?void 0:"tertiary",className:s,href:r,target:this.getWindowTarget(),disabled:!n,onClick:this.openPreviewWindow,ref:this.buttonRef,role:o},this.props.textContent?this.props.textContent:(0,i.createElement)(i.Fragment,null,(0,Xt._x)("Preview","imperative verb"),(0,i.createElement)(To.VisuallyHidden,{as:"span"},(0,Xt.__)("(opens in a new tab)"))))}}var Mr=(0,u.compose)([(0,l.withSelect)(((e,t)=>{let{forcePreviewLink:n,forceIsAutosaveable:o}=t;const{getCurrentPostId:r,getCurrentPostAttribute:i,getEditedPostAttribute:a,isEditedPostSaveable:l,isEditedPostAutosaveable:u,getEditedPostPreviewLink:d,isPostLocked:p}=e(no),{getPostType:m}=e(c.store),h=d(),g=m(a("type"));return{postId:r(),currentPostLink:i("link"),previewLink:void 0!==n?n:h,isSaveable:l(),isAutosaveable:o||u(),isViewable:(0,s.get)(g,["viewable"],!1),isDraft:-1!==["draft","auto-draft"].indexOf(a("status")),isPostLocked:p()}})),(0,l.withDispatch)((e=>({autosave:e(no).autosave,savePost:e(no).savePost}))),(0,u.ifCondition)((e=>{let{isViewable:t}=e;return t}))])(Ur);var Fr=(0,u.compose)([(0,l.withSelect)(((e,t)=>{let{forceIsSaving:n}=t;const{isCurrentPostPublished:o,isEditedPostBeingScheduled:r,isSavingPost:i,isPublishingPost:a,getCurrentPost:l,getCurrentPostType:c,isAutosavingPost:u}=e(no);return{isPublished:o(),isBeingScheduled:r(),isSaving:n||i(),isPublishing:a(),hasPublishAction:(0,s.get)(l(),["_links","wp:action-publish"],!1),postType:c(),isAutosaving:u()}}))])((function(e){let{isPublished:t,isBeingScheduled:n,isSaving:o,isPublishing:r,hasPublishAction:i,isAutosaving:s,hasNonPostEntityChanges:a}=e;return r?(0,Xt.__)("Publishing…"):t&&o&&!s?(0,Xt.__)("Updating…"):n&&o&&!s?(0,Xt.__)("Scheduling…"):i?t?a?(0,Xt.__)("Update…"):(0,Xt.__)("Update"):n?a?(0,Xt.__)("Schedule…"):(0,Xt.__)("Schedule"):(0,Xt.__)("Publish"):a?(0,Xt.__)("Submit for Review…"):(0,Xt.__)("Submit for Review")}));const zr=()=>{};class Hr extends i.Component{constructor(e){super(e),this.buttonNode=(0,i.createRef)(),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}componentDidMount(){this.props.focusOnMount&&(this.timeoutID=setTimeout((()=>{this.buttonNode.current.focus()}),0))}componentWillUnmount(){clearTimeout(this.timeoutID)}createOnClick(e){var t=this;return function(){for(var n=arguments.length,o=new Array(n),r=0;re(...o)}),s((()=>t.closeEntitiesSavedStates)),zr):e(...o)}}closeEntitiesSavedStates(e){const{postType:t,postId:n}=this.props,{entitiesSavedStatesCallback:o}=this.state;this.setState({entitiesSavedStatesCallback:!1},(()=>{e&&e.some((e=>"postType"===e.kind&&e.name===t&&e.key===n))&&o()}))}render(){const{forceIsDirty:e,forceIsSaving:t,hasPublishAction:n,isBeingScheduled:o,isOpen:s,isPostSavingLocked:a,isPublishable:l,isPublished:c,isSaveable:u,isSaving:d,isAutoSaving:p,isToggle:m,onSave:h,onStatusChange:g,onSubmit:f=zr,onToggle:v,visibility:_,hasNonPostEntityChanges:y,isSavingNonPostEntityChanges:b}=this.props,E=(d||t||!u||a||!l&&!e)&&(!y||b),w=(c||d||t||!u||!l&&!e)&&(!y||b);let S;S=n?"private"===_?"private":o?"future":"publish":"pending";const P={"aria-disabled":E,className:"editor-post-publish-button",isBusy:!p&&d&&c,variant:"primary",onClick:this.createOnClick((()=>{E||(f(),g(S),h())}))},k={"aria-disabled":w,"aria-expanded":s,className:"editor-post-publish-panel__toggle",isBusy:d&&c,variant:"primary",onClick:this.createOnClick((()=>{w||v()}))},C=o?(0,Xt.__)("Schedule…"):(0,Xt.__)("Publish"),T=(0,i.createElement)(Fr,{forceIsSaving:t,hasNonPostEntityChanges:y}),x=m?k:P,B=m?C:T;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.Button,r({ref:this.buttonNode},x,{className:uo()(x.className,"editor-post-publish-button__button",{"has-changes-dot":y})}),B))}}var Vr=(0,u.compose)([(0,l.withSelect)((e=>{const{isSavingPost:t,isAutosavingPost:n,isEditedPostBeingScheduled:o,getEditedPostVisibility:r,isCurrentPostPublished:i,isEditedPostSaveable:a,isEditedPostPublishable:l,isPostSavingLocked:c,getCurrentPost:u,getCurrentPostType:d,getCurrentPostId:p,hasNonPostEntityChanges:m,isSavingNonPostEntityChanges:h}=e(no),g=n();return{isSaving:t()||g,isAutoSaving:g,isBeingScheduled:o(),visibility:r(),isSaveable:a(),isPostSavingLocked:c(),isPublishable:l(),isPublished:i(),hasPublishAction:(0,s.get)(u(),["_links","wp:action-publish"],!1),postType:d(),postId:p(),hasNonPostEntityChanges:m(),isSavingNonPostEntityChanges:h()}})),(0,l.withDispatch)((e=>{const{editPost:t,savePost:n}=e(no);return{onStatusChange:e=>t({status:e},{undoIgnore:!0}),onSave:n}}))])(Hr);var Wr=(0,i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(P.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));var jr=(0,i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,i.createElement)(P.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"}));const $r={public:{label:(0,Xt.__)("Public"),info:(0,Xt.__)("Visible to everyone.")},private:{label:(0,Xt.__)("Private"),info:(0,Xt.__)("Only visible to site admins and editors.")},password:{label:(0,Xt.__)("Password protected"),info:(0,Xt.__)("Only those with the password can view this post.")}};function Gr(e){let{onClose:t}=e;const n=(0,u.useInstanceId)(Gr),{status:o,visibility:r,password:s}=(0,l.useSelect)((e=>({status:e(no).getEditedPostAttribute("status"),visibility:e(no).getEditedPostVisibility(),password:e(no).getEditedPostAttribute("password")}))),{editPost:a,savePost:c}=(0,l.useDispatch)(no),[d,m]=(0,i.useState)(!!s),[h,g]=(0,i.useState)(!1);return(0,i.createElement)("div",{className:"editor-post-visibility"},(0,i.createElement)(p.__experimentalInspectorPopoverHeader,{title:(0,Xt.__)("Visibility"),help:(0,Xt.__)("Control how this post is viewed."),onClose:t}),(0,i.createElement)("fieldset",{className:"editor-post-visibility__fieldset"},(0,i.createElement)(To.VisuallyHidden,{as:"legend"},(0,Xt.__)("Visibility")),(0,i.createElement)(Kr,{instanceId:n,value:"public",label:$r.public.label,info:$r.public.info,checked:"public"===r&&!d,onChange:()=>{a({status:"private"===r?"draft":o,password:""}),m(!1)}}),(0,i.createElement)(Kr,{instanceId:n,value:"private",label:$r.private.label,info:$r.private.info,checked:"private"===r,onChange:()=>{g(!0)}}),(0,i.createElement)(Kr,{instanceId:n,value:"password",label:$r.password.label,info:$r.password.info,checked:d,onChange:()=>{a({status:"private"===r?"draft":o,password:s||""}),m(!0)}}),d&&(0,i.createElement)("div",{className:"editor-post-visibility__password"},(0,i.createElement)(To.VisuallyHidden,{as:"label",htmlFor:`editor-post-visibility__password-input-${n}`},(0,Xt.__)("Create password")),(0,i.createElement)("input",{className:"editor-post-visibility__password-input",id:`editor-post-visibility__password-input-${n}`,type:"text",onChange:e=>{a({password:e.target.value})},value:s,placeholder:(0,Xt.__)("Use a secure password")}))),(0,i.createElement)(To.__experimentalConfirmDialog,{isOpen:h,onConfirm:()=>{a({status:"private",password:""}),m(!1),g(!1),c()},onCancel:()=>{g(!1)}},(0,Xt.__)("Would you like to privately publish this post now?")))}function Kr(e){let{instanceId:t,value:n,label:o,info:s,...a}=e;return(0,i.createElement)("div",{className:"editor-post-visibility__choice"},(0,i.createElement)("input",r({type:"radio",name:`editor-post-visibility__setting-${t}`,value:n,id:`editor-post-${n}-${t}`,"aria-describedby":`editor-post-${n}-${t}-description`,className:"editor-post-visibility__radio"},a)),(0,i.createElement)("label",{htmlFor:`editor-post-${n}-${t}`,className:"editor-post-visibility__label"},o),(0,i.createElement)("p",{id:`editor-post-${n}-${t}-description`,className:"editor-post-visibility__info"},s))}function Yr(){return qr()}function qr(){var e;const t=(0,l.useSelect)((e=>e(no).getEditedPostVisibility()));return null===(e=$r[t])||void 0===e?void 0:e.label}function Qr(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function Xr(e){return Xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xr(e)}function Zr(e){Qr(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===Xr(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function Jr(e){Qr(1,arguments);var t=Zr(e);return t.setDate(1),t.setHours(0,0,0,0),t}function ei(e){Qr(1,arguments);var t=Zr(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}Math.pow(10,8);var ti=36e5;function ni(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}var oi={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ri=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ii=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,si=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ai(e){var t,n={},o=e.split(oi.dateTimeDelimiter);if(o.length>2)return n;if(/:/.test(o[0])?t=o[0]:(n.date=o[0],t=o[1],oi.timeZoneDelimiter.test(n.date)&&(n.date=e.split(oi.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length))),t){var r=oi.timezone.exec(t);r?(n.time=t.replace(r[1],""),n.timezone=r[1]):n.time=t}return n}function li(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),o=e.match(n);if(!o)return{year:NaN,restDateString:""};var r=o[1]?parseInt(o[1]):null,i=o[2]?parseInt(o[2]):null;return{year:null===i?r:100*i,restDateString:e.slice((o[1]||o[2]).length)}}function ci(e,t){if(null===t)return new Date(NaN);var n=e.match(ri);if(!n)return new Date(NaN);var o=!!n[4],r=ui(n[1]),i=ui(n[2])-1,s=ui(n[3]),a=ui(n[4]),l=ui(n[5])-1;if(o)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,a,l)?function(e,t,n){var o=new Date(0);o.setUTCFullYear(e,0,4);var r=o.getUTCDay()||7,i=7*(t-1)+n+1-r;return o.setUTCDate(o.getUTCDate()+i),o}(t,a,l):new Date(NaN);var c=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(hi[t]||(gi(e)?29:28))}(t,i,s)&&function(e,t){return t>=1&&t<=(gi(e)?366:365)}(t,r)?(c.setUTCFullYear(t,i,Math.max(r,s)),c):new Date(NaN)}function ui(e){return e?parseInt(e):1}function di(e){var t=e.match(ii);if(!t)return NaN;var n=pi(t[1]),o=pi(t[2]),r=pi(t[3]);return function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,o,r)?n*ti+6e4*o+1e3*r:NaN}function pi(e){return e&&parseFloat(e.replace(",","."))||0}function mi(e){if("Z"===e)return 0;var t=e.match(si);if(!t)return 0;var n="+"===t[1]?-1:1,o=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,r)?n*(o*ti+6e4*r):NaN}var hi=[31,null,31,30,31,30,31,31,30,31,30,31];function gi(e){return e%400==0||e%4==0&&e%100!=0}function fi(e){let{onClose:t}=e;const{postDate:n,postType:o}=(0,l.useSelect)((e=>({postDate:e(no).getEditedPostAttribute("date"),postType:e(no).getCurrentPostType()})),[]),{editPost:r}=(0,l.useDispatch)(no),[s,a]=(0,i.useState)(Jr(new Date(n))),u=(0,l.useSelect)((e=>e(c.store).getEntityRecords("postType",o,{status:"publish,future",after:Jr(s).toISOString(),before:ei(s).toISOString(),exclude:[e(no).getCurrentPostId()],per_page:100,_fields:"id,date"})),[s,o]),d=(0,i.useMemo)((()=>(u||[]).map((e=>{let{date:t}=e;return{date:new Date(t)}}))),[u]),m=(0,b.getSettings)(),h=/a(?!\\)/i.test(m.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,i.createElement)(p.__experimentalPublishDateTimePicker,{currentDate:n,onChange:e=>r({date:e}),is12Hour:h,events:d,onMonthPreviewed:e=>a(function(e,t){var n;Qr(1,arguments);var o=ni(null!==(n=null==t?void 0:t.additionalDigits)&&void 0!==n?n:2);if(2!==o&&1!==o&&0!==o)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r,i=ai(e);if(i.date){var s=li(i.date,o);r=ci(s.restDateString,s.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var a,l=r.getTime(),c=0;if(i.time&&(c=di(i.time),isNaN(c)))return new Date(NaN);if(!i.timezone){var u=new Date(l+c),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return a=mi(i.timezone),isNaN(a)?new Date(NaN):new Date(l+c+a)}(e)),onClose:t})}function vi(e){return _i(e)}function _i(){let{full:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{date:t,isFloating:n}=(0,l.useSelect)((e=>({date:e(no).getEditedPostAttribute("date"),isFloating:e(no).isEditedPostDateFloating()})),[]);return e?yi(t):bi(t,{isFloating:n})}function yi(e){const t=(0,b.getDate)(e),n=function(){const{timezone:e}=(0,b.getSettings)();if(e.abbr&&isNaN(Number(e.abbr)))return e.abbr;return`UTC${e.offset<0?"":"+"}${e.offset}`}(),o=(0,b.dateI18n)((0,Xt._x)("F j, Y g:i a","post schedule full date format"),t);return(0,Xt.isRTL)()?`${n} ${o}`:`${o} ${n}`}function bi(e){let{isFloating:t=!1,now:n=new Date}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||t)return(0,Xt.__)("Immediately");if(!Ei(n))return yi(e);const o=(0,b.getDate)(e);if(wi(o,n))return(0,Xt.sprintf)((0,Xt.__)("Today at %s"),(0,b.dateI18n)((0,Xt._x)("g:i a","post schedule time format"),o));const r=new Date(n);return r.setDate(r.getDate()+1),wi(o,r)?(0,Xt.sprintf)((0,Xt.__)("Tomorrow at %s"),(0,b.dateI18n)((0,Xt._x)("g:i a","post schedule time format"),o)):o.getFullYear()===n.getFullYear()?(0,b.dateI18n)((0,Xt._x)("F j g:i a","post schedule date format without year"),o):(0,b.dateI18n)((0,Xt._x)("F j, Y g:i a","post schedule full date format"),o)}function Ei(e){const{timezone:t}=(0,b.getSettings)();return Number(t.offset)===e.getTimezoneOffset()/60*-1}function wi(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}var Si=n(3613),Pi=n.n(Si),ki=window.wp.a11y;const Ci={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function Ti(e){let{onSelect:t,taxonomy:n}=e;const{_terms:o,showTerms:r}=(0,l.useSelect)((e=>{const t=e(c.store).getEntityRecords("taxonomy",n.slug,Ci);return{_terms:t,showTerms:(null==t?void 0:t.length)>=3}}),[]);if(!r)return null;const a=(e=>(null!=e?e:[]).map(or))(o),u=(0,s.get)(n,["labels","most_used"]);return(0,i.createElement)("div",{className:"editor-post-taxonomies__flat-term-most-used"},(0,i.createElement)(To.BaseControl.VisualLabel,{as:"h3",className:"editor-post-taxonomies__flat-term-most-used-label"},u),(0,i.createElement)("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list"},a.map((e=>(0,i.createElement)("li",{key:e.id},(0,i.createElement)(To.Button,{variant:"link",onClick:()=>t(e)},e.name))))))}const xi=[],Bi={per_page:20,orderby:"count",order:"desc",_fields:"id,name",context:"view"},Ai=(e,t)=>nr(e).toLowerCase()===nr(t).toLowerCase(),Ii=(e,t)=>e.map((e=>t.find((t=>Ai(t.name,e))).id));function Ni(e){let{slug:t}=e;const[n,o]=(0,i.useState)([]),[r,a]=(0,i.useState)(""),d=(0,u.useDebounce)(a,500),{terms:p,termIds:m,taxonomy:h,hasAssignAction:g,hasCreateAction:f,hasResolvedTerms:v}=(0,l.useSelect)((e=>{const{getCurrentPost:n,getEditedPostAttribute:o}=e(no),{getEntityRecords:r,getTaxonomy:i,hasFinishedResolution:a}=e(c.store),l=n(),u=i(t),d=u?o(u.rest_base):xi,p={...Bi,include:d.join(","),per_page:-1};return{hasCreateAction:!!u&&(0,s.get)(l,["_links","wp:action-create-"+u.rest_base],!1),hasAssignAction:!!u&&(0,s.get)(l,["_links","wp:action-assign-"+u.rest_base],!1),taxonomy:u,termIds:d,terms:d.length?r("taxonomy",t,p):xi,hasResolvedTerms:a("getEntityRecords",["taxonomy",t,p])}}),[t]),{searchResults:_}=(0,l.useSelect)((e=>{const{getEntityRecords:n}=e(c.store);return{searchResults:r?n("taxonomy",t,{...Bi,search:r}):xi}}),[r]);(0,i.useEffect)((()=>{if(v){const e=(null!=p?p:[]).map((e=>nr(e.name)));o(e)}}),[p,v]);const y=(0,i.useMemo)((()=>(null!=_?_:[]).map((e=>nr(e.name)))),[_]),{editPost:b}=(0,l.useDispatch)(no);if(!g)return null;function E(e){b({[h.rest_base]:e})}const w=(0,s.get)(h,["labels","add_new_item"],"post_tag"===t?(0,Xt.__)("Add new tag"):(0,Xt.__)("Add new Term")),S=(0,s.get)(h,["labels","singular_name"],"post_tag"===t?(0,Xt.__)("Tag"):(0,Xt.__)("Term")),P=(0,Xt.sprintf)((0,Xt._x)("%s added","term"),S),k=(0,Xt.sprintf)((0,Xt._x)("%s removed","term"),S),C=(0,Xt.sprintf)((0,Xt._x)("Remove %s","term"),S);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.FormTokenField,{value:n,suggestions:y,onChange:function(e){var t;const n=[...null!=p?p:[],...null!=_?_:[]],r=e.reduce(((e,t)=>(e.some((e=>e.toLowerCase()===t.toLowerCase()))||e.push(t),e)),[]),i=r.filter((e=>!n.find((t=>Ai(t.name,e)))));if(o(r),0===i.length)return E(Ii(r,n));if(!f)return;const s=null!==(t=null==h?void 0:h.rest_namespace)&&void 0!==t?t:"wp/v2";Promise.all(i.map((e=>function(e,t,n){const o=Pi()(e);return Gt()({path:`/${n}/${t}`,method:"POST",data:{name:o}}).catch((t=>"term_exists"!==t.code?Promise.reject(t):Promise.resolve({id:t.data.term_id,name:e}))).then(or)}(e,h.rest_base,s)))).then((e=>{const t=n.concat(e);return E(Ii(r,t))}))},onInputChange:d,maxSuggestions:20,label:w,messages:{added:P,removed:k,remove:C}}),(0,i.createElement)(Ti,{taxonomy:h,onSelect:function(e){if(m.includes(e.id))return;const n=[...m,e.id],o=(0,Xt.sprintf)((0,Xt._x)("%s added","term"),(0,s.get)(h,["labels","singular_name"],"post_tag"===t?(0,Xt.__)("Tag"):(0,Xt.__)("Term")));(0,ki.speak)(o,"assertive"),E(n)}}))}var Di=(0,To.withFilters)("editor.PostTaxonomyType")(Ni);const Ri=()=>{const e=[(0,Xt.__)("Suggestion:"),(0,i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,Xt.__)("Add tags"))];return(0,i.createElement)(To.PanelBody,{initialOpen:!1,title:e},(0,i.createElement)("p",null,(0,Xt.__)("Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.")),(0,i.createElement)(Di,{slug:"post_tag"}))};class Li extends i.Component{constructor(e){super(e),this.state={hadTagsWhenOpeningThePanel:e.hasTags}}render(){return this.state.hadTagsWhenOpeningThePanel?null:(0,i.createElement)(Ri,null)}}var Oi=(0,u.compose)((0,l.withSelect)((e=>{const t=e(no).getCurrentPostType(),n=e(c.store).getTaxonomy("post_tag"),o=n&&e(no).getEditedPostAttribute(n.rest_base);return{areTagsFetched:void 0!==n,isPostTypeSupported:n&&n.types.some((e=>e===t)),hasTags:o&&o.length}})),(0,u.ifCondition)((e=>{let{areTagsFetched:t,isPostTypeSupported:n}=e;return n&&t})))(Li);const Ui=(e,t)=>xr.filter((t=>null==e?void 0:e.includes(t.id))).find((e=>e.id===t)),Mi=e=>{let{suggestedPostFormat:t,suggestionText:n,onUpdatePostFormat:o}=e;return(0,i.createElement)(To.Button,{variant:"link",onClick:()=>o(t)},n)};function Fi(){const{currentPostFormat:e,suggestion:t}=(0,l.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:n}=e(no),o=(0,s.get)(e(c.store).getThemeSupports(),["formats"],[]);return{currentPostFormat:t("format"),suggestion:Ui(o,n())}}),[]),{editPost:n}=(0,l.useDispatch)(no),o=[(0,Xt.__)("Suggestion:"),(0,i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,Xt.__)("Use a post format"))];return t&&t.id!==e?(0,i.createElement)(To.PanelBody,{initialOpen:!1,title:o},(0,i.createElement)("p",null,(0,Xt.__)("Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.")),(0,i.createElement)("p",null,(0,i.createElement)(Mi,{onUpdatePostFormat:e=>n({format:e}),suggestedPostFormat:t.id,suggestionText:(0,Xt.sprintf)((0,Xt.__)('Apply the "%1$s" format.'),t.caption)}))):null}const zi={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view"},Hi=[];function Vi(e){let{slug:t}=e;const[n,o]=(0,i.useState)(!1),[r,a]=(0,i.useState)(""),[d,p]=(0,i.useState)(""),[m,h]=(0,i.useState)(!1),[g,f]=(0,i.useState)(""),[v,_]=(0,i.useState)([]),y=(0,u.useDebounce)(ki.speak,500),{hasCreateAction:b,hasAssignAction:E,terms:w,loading:S,availableTerms:P,taxonomy:k}=(0,l.useSelect)((e=>{const{getCurrentPost:n,getEditedPostAttribute:o}=e(no),{getTaxonomy:r,getEntityRecords:i,isResolving:a}=e(c.store),l=r(t);return{hasCreateAction:!!l&&(0,s.get)(n(),["_links","wp:action-create-"+l.rest_base],!1),hasAssignAction:!!l&&(0,s.get)(n(),["_links","wp:action-assign-"+l.rest_base],!1),terms:l?o(l.rest_base):Hi,loading:a("getEntityRecords",["taxonomy",t,zi]),availableTerms:i("taxonomy",t,zi)||Hi,taxonomy:l}}),[t]),{editPost:C}=(0,l.useDispatch)(no),{saveEntityRecord:T}=(0,l.useDispatch)(c.store),x=(0,i.useMemo)((()=>function(e,t){const n=e=>-1!==t.indexOf(e.id)||void 0!==e.children&&e.children.map(n).filter((e=>e)).length>0,o=[...e];return o.sort(((e,t)=>{const o=n(e),r=n(t);return o===r?0:o&&!r?-1:!o&&r?1:0})),o}(tr(P),w)),[P]);if(!E)return null;const B=e=>{C({[k.rest_base]:e})},A=e=>e.map((e=>(0,i.createElement)("div",{key:e.id,className:"editor-post-taxonomies__hierarchical-terms-choice"},(0,i.createElement)(To.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:-1!==w.indexOf(e.id),onChange:()=>{(e=>{const t=w.includes(e)?w.filter((t=>t!==e)):[...w,e];B(t)})(parseInt(e.id,10))},label:(0,Lo.decodeEntities)(e.name)}),!!e.children.length&&(0,i.createElement)("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices"},A(e.children))))),I=(e,n,o)=>(0,s.get)(k,["labels",e],"category"===t?n:o),N=I("add_new_item",(0,Xt.__)("Add new category"),(0,Xt.__)("Add new term")),D=I("new_item_name",(0,Xt.__)("Add new category"),(0,Xt.__)("Add new term")),R=I("parent_item",(0,Xt.__)("Parent Category"),(0,Xt.__)("Parent Term")),L=`— ${R} —`,O=N,U=(0,s.get)(k,["labels","search_items"],(0,Xt.__)("Search Terms")),M=(0,s.get)(k,["name"],(0,Xt.__)("Terms")),F=P.length>=8;return(0,i.createElement)(i.Fragment,null,F&&(0,i.createElement)(To.TextControl,{__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-filter",label:U,value:g,onChange:e=>{const t=x.map(function(e){const t=n=>{if(""===e)return n;const o={...n};return o.children.length>0&&(o.children=o.children.map(t).filter((e=>e))),(-1!==o.name.toLowerCase().indexOf(e.toLowerCase())||o.children.length>0)&&o};return t}(e)).filter((e=>e)),n=e=>{let t=0;for(let o=0;o{h(!m)},className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":m,variant:"link"},N),m&&(0,i.createElement)("form",{onSubmit:async e=>{if(e.preventDefault(),""===r||n)return;const i=function(e,t,n){return e.find((e=>(!e.parent&&!t||parseInt(e.parent)===parseInt(t))&&e.name.toLowerCase()===n.toLowerCase()))}(P,d,r);if(i)return w.some((e=>e===i.id))||B([...w,i.id]),a(""),void p("");o(!0);const l=await(c={name:r,parent:d||void 0},T("taxonomy",t,c));var c;const u=(0,Xt.sprintf)((0,Xt._x)("%s added","term"),(0,s.get)(k,["labels","singular_name"],"category"===t?(0,Xt.__)("Category"):(0,Xt.__)("Term")));(0,ki.speak)(u,"assertive"),o(!1),a(""),p(""),B([...w,l.id])}},(0,i.createElement)(To.__experimentalVStack,null,(0,i.createElement)(To.TextControl,{__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-input",label:D,value:r,onChange:e=>{a(e)},required:!0}),!!P.length&&(0,i.createElement)(To.TreeSelect,{label:R,noOptionLabel:L,onChange:e=>{p(e)},selectedId:d,tree:x})),(0,i.createElement)(To.Button,{variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit"},O)))}var Wi=(0,To.withFilters)("editor.PostTaxonomyType")(Vi);var ji=function(){const e=(0,l.useSelect)((e=>{var t;const n=e(no).getCurrentPostType(),{canUser:o,getEntityRecord:r,getTaxonomy:i}=e(c.store),s=i("category"),a=o("read","settings")?null===(t=r("root","site"))||void 0===t?void 0:t.default_category:void 0,l=a?r("taxonomy","category",a):void 0,u=s&&s.types.some((e=>e===n)),d=s&&e(no).getEditedPostAttribute(s.rest_base);return!!s&&!!l&&u&&(0===(null==d?void 0:d.length)||1===(null==d?void 0:d.length)&&(null==l?void 0:l.id)===d[0])}),[]),[t,n]=(0,i.useState)(!1);if((0,i.useEffect)((()=>{e&&n(!0)}),[e]),!t)return null;const o=[(0,Xt.__)("Suggestion:"),(0,i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,Xt.__)("Assign a category"))];return(0,i.createElement)(To.PanelBody,{initialOpen:!1,title:o},(0,i.createElement)("p",null,(0,Xt.__)("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")),(0,i.createElement)(Wi,{slug:"category"}))};var $i=function(e){let{children:t}=e;const{isBeingScheduled:n,isRequestingSiteIcon:o,hasPublishAction:r,siteIconUrl:a,siteTitle:u,siteHome:d}=(0,l.useSelect)((e=>{const{getCurrentPost:t,isEditedPostBeingScheduled:n}=e(no),{getEntityRecord:o,isResolving:r}=e(c.store),i=o("root","__unstableBase",void 0)||{};return{hasPublishAction:(0,s.get)(t(),["_links","wp:action-publish"],!1),isBeingScheduled:n(),isRequestingSiteIcon:r("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:i.site_icon_url,siteTitle:i.name,siteHome:i.home&&(0,E.filterURLForDisplay)(i.home)}}),[]);let p,m,h=(0,i.createElement)(To.Icon,{className:"components-site-icon",size:"36px",icon:jr});return a&&(h=(0,i.createElement)("img",{alt:(0,Xt.__)("Site Icon"),className:"components-site-icon",src:a})),o&&(h=null),r?n?(p=(0,Xt.__)("Are you ready to schedule?"),m=(0,Xt.__)("Your work will be published at the specified date and time.")):(p=(0,Xt.__)("Are you ready to publish?"),m=(0,Xt.__)("Double-check your settings before publishing.")):(p=(0,Xt.__)("Are you ready to submit for review?"),m=(0,Xt.__)("When you’re ready, submit your work for review, and an Editor will be able to approve it for you.")),(0,i.createElement)("div",{className:"editor-post-publish-panel__prepublish"},(0,i.createElement)("div",null,(0,i.createElement)("strong",null,p)),(0,i.createElement)("p",null,m),(0,i.createElement)("div",{className:"components-site-card"},h,(0,i.createElement)("div",{className:"components-site-info"},(0,i.createElement)("span",{className:"components-site-name"},(0,Lo.decodeEntities)(u)||(0,Xt.__)("(Untitled)")),(0,i.createElement)("span",{className:"components-site-home"},d))),r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.PanelBody,{initialOpen:!1,title:[(0,Xt.__)("Visibility:"),(0,i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,i.createElement)(Yr,null))]},(0,i.createElement)(Gr,null)),(0,i.createElement)(To.PanelBody,{initialOpen:!1,title:[(0,Xt.__)("Publish:"),(0,i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,i.createElement)(vi,null))]},(0,i.createElement)(fi,null))),(0,i.createElement)(Fi,null),(0,i.createElement)(Oi,null),(0,i.createElement)(ji,null),t)};const Gi="%postname%";function Ki(e){let{text:t,onCopy:n,children:o}=e;const r=(0,u.useCopyToClipboard)(t,n);return(0,i.createElement)(To.Button,{variant:"secondary",ref:r},o)}class Yi extends i.Component{constructor(){super(...arguments),this.state={showCopyConfirmation:!1},this.onCopy=this.onCopy.bind(this),this.onSelectInput=this.onSelectInput.bind(this),this.postLink=(0,i.createRef)()}componentDidMount(){this.props.focusOnMount&&this.postLink.current.focus()}componentWillUnmount(){clearTimeout(this.dismissCopyConfirmation)}onCopy(){this.setState({showCopyConfirmation:!0}),clearTimeout(this.dismissCopyConfirmation),this.dismissCopyConfirmation=setTimeout((()=>{this.setState({showCopyConfirmation:!1})}),4e3)}onSelectInput(e){e.target.select()}render(){const{children:e,isScheduled:t,post:n,postType:o}=this.props,r=(0,s.get)(o,["labels","singular_name"]),a=(0,s.get)(o,["labels","view_item"]),l=(0,s.get)(o,["labels","add_new_item"]),c="future"===n.status?(e=>{const{slug:t}=e;return e.permalink_template.includes(Gi)?e.permalink_template.replace(Gi,t):e.permalink_template})(n):n.link,u=(0,E.addQueryArgs)("post-new.php",{post_type:n.type}),d=t?(0,i.createElement)(i.Fragment,null,(0,Xt.__)("is now scheduled. It will go live on")," ",(0,i.createElement)(vi,null),"."):(0,Xt.__)("is now live.");return(0,i.createElement)("div",{className:"post-publish-panel__postpublish"},(0,i.createElement)(To.PanelBody,{className:"post-publish-panel__postpublish-header"},(0,i.createElement)("a",{ref:this.postLink,href:c},(0,Lo.decodeEntities)(n.title)||(0,Xt.__)("(no title)"))," ",d),(0,i.createElement)(To.PanelBody,null,(0,i.createElement)("p",{className:"post-publish-panel__postpublish-subheader"},(0,i.createElement)("strong",null,(0,Xt.__)("What’s next?"))),(0,i.createElement)("div",{className:"post-publish-panel__postpublish-post-address-container"},(0,i.createElement)(To.TextControl,{__nextHasNoMarginBottom:!0,className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:(0,Xt.sprintf)((0,Xt.__)("%s address"),r),value:(0,E.safeDecodeURIComponent)(c),onFocus:this.onSelectInput}),(0,i.createElement)("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap"},(0,i.createElement)(Ki,{text:c,onCopy:this.onCopy},this.state.showCopyConfirmation?(0,Xt.__)("Copied!"):(0,Xt.__)("Copy")))),(0,i.createElement)("div",{className:"post-publish-panel__postpublish-buttons"},!t&&(0,i.createElement)(To.Button,{variant:"primary",href:c},a),(0,i.createElement)(To.Button,{variant:t?"primary":"secondary",href:u},l))),e)}}var qi=(0,l.withSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPost:n,isCurrentPostScheduled:o}=e(no),{getPostType:r}=e(c.store);return{post:n(),postType:r(t("type")),isScheduled:o()}}))(Yi);class Qi extends i.Component{constructor(){super(...arguments),this.onSubmit=this.onSubmit.bind(this)}componentDidUpdate(e){e.isPublished&&!this.props.isSaving&&this.props.isDirty&&this.props.onClose()}onSubmit(){const{onClose:e,hasPublishAction:t,isPostTypeViewable:n}=this.props;t&&n||e()}render(){const{forceIsDirty:e,forceIsSaving:t,isBeingScheduled:n,isPublished:o,isPublishSidebarEnabled:s,isScheduled:a,isSaving:l,isSavingNonPostEntityChanges:c,onClose:u,onTogglePublishSidebar:d,PostPublishExtension:p,PrePublishExtension:m,...h}=this.props,{hasPublishAction:g,isDirty:f,isPostTypeViewable:v,..._}=h,y=o||a&&n,b=!y&&!l,E=y&&!l;return(0,i.createElement)("div",r({className:"editor-post-publish-panel"},_),(0,i.createElement)("div",{className:"editor-post-publish-panel__header"},E?(0,i.createElement)(To.Button,{onClick:u,icon:Wr,label:(0,Xt.__)("Close panel")}):(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"editor-post-publish-panel__header-publish-button"},(0,i.createElement)(Vr,{focusOnMount:!0,onSubmit:this.onSubmit,forceIsDirty:e,forceIsSaving:t})),(0,i.createElement)("div",{className:"editor-post-publish-panel__header-cancel-button"},(0,i.createElement)(To.Button,{disabled:c,onClick:u,variant:"secondary"},(0,Xt.__)("Cancel"))))),(0,i.createElement)("div",{className:"editor-post-publish-panel__content"},b&&(0,i.createElement)($i,null,m&&(0,i.createElement)(m,null)),E&&(0,i.createElement)(qi,{focusOnMount:!0},p&&(0,i.createElement)(p,null)),l&&(0,i.createElement)(To.Spinner,null)),(0,i.createElement)("div",{className:"editor-post-publish-panel__footer"},(0,i.createElement)(To.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Always show pre-publish checks."),checked:s,onChange:d})))}}var Xi=(0,u.compose)([(0,l.withSelect)((e=>{const{getPostType:t}=e(c.store),{getCurrentPost:n,getEditedPostAttribute:o,isCurrentPostPublished:r,isCurrentPostScheduled:i,isEditedPostBeingScheduled:a,isEditedPostDirty:l,isSavingPost:u,isSavingNonPostEntityChanges:d}=e(no),{isPublishSidebarEnabled:p}=e(no),m=t(o("type"));return{hasPublishAction:(0,s.get)(n(),["_links","wp:action-publish"],!1),isPostTypeViewable:(0,s.get)(m,["viewable"],!1),isBeingScheduled:a(),isDirty:l(),isPublished:r(),isPublishSidebarEnabled:p(),isSaving:u(),isSavingNonPostEntityChanges:d(),isScheduled:i()}})),(0,l.withDispatch)(((e,t)=>{let{isPublishSidebarEnabled:n}=t;const{disablePublishSidebar:o,enablePublishSidebar:r}=e(no);return{onTogglePublishSidebar:()=>{n?o():r()}}})),To.withFocusReturn,To.withConstrainedTabbing])(Qi);var Zi=(0,i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(P.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-4v-2.4L14 14l1-1-3-3-3 3 1 1 1.2-1.2v2.4H7.7c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4H9l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8 0 1-.8 1.8-1.7 1.8z"}));var Ji=function(e){let{icon:t,size:n=24,...o}=e;return(0,i.cloneElement)(t,{width:n,height:n,...o})};var es=(0,i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(P.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));var ts=(0,i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(P.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z"}));var ns=(0,u.compose)([(0,l.withSelect)((e=>{const{isSavingPost:t,isCurrentPostPublished:n,isCurrentPostScheduled:o}=e(no);return{isSaving:t(),isPublished:n(),isScheduled:o()}})),(0,l.withDispatch)((e=>{const{editPost:t,savePost:n}=e(no);return{onClick:()=>{t({status:"draft"}),n()}}}))])((function(e){let{isSaving:t,isPublished:n,isScheduled:o,onClick:r}=e;const s=(0,u.useViewportMatch)("small","<"),[a,l]=(0,i.useState)(!1);if(!n&&!o)return null;let c;return n?c=(0,Xt.__)("Are you sure you want to unpublish this post?"):o&&(c=(0,Xt.__)("Are you sure you want to unschedule this post?")),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.Button,{className:"editor-post-switch-to-draft",onClick:()=>{l(!0)},disabled:t,variant:"tertiary"},s?(0,Xt.__)("Draft"):(0,Xt.__)("Switch to draft")),(0,i.createElement)(To.__experimentalConfirmDialog,{isOpen:a,onConfirm:()=>{l(!1),r()},onCancel:()=>l(!1)},c))}));function os(e){let{forceIsDirty:t,forceIsSaving:n,showIconLabels:o=!1}=e;const[r,s]=(0,i.useState)(!1),a=(0,u.useViewportMatch)("small"),{isAutosaving:c,isDirty:d,isNew:p,isPending:m,isPublished:h,isSaveable:g,isSaving:f,isScheduled:v,hasPublishAction:_}=(0,l.useSelect)((e=>{var o,r,i;const{isEditedPostNew:s,isCurrentPostPublished:a,isCurrentPostScheduled:l,isEditedPostDirty:c,isSavingPost:u,isEditedPostSaveable:d,getCurrentPost:p,isAutosavingPost:m,getEditedPostAttribute:h}=e(no);return{isAutosaving:m(),isDirty:t||c(),isNew:s(),isPending:"pending"===h("status"),isPublished:a(),isSaving:n||u(),isSaveable:d(),isScheduled:l(),hasPublishAction:null!==(o=null===(r=p())||void 0===r||null===(i=r._links)||void 0===i?void 0:i["wp:action-publish"])&&void 0!==o&&o}}),[t,n]),{savePost:y}=(0,l.useDispatch)(no),b=(0,u.usePrevious)(f);if((0,i.useEffect)((()=>{let e;return b&&!f&&(s(!0),e=setTimeout((()=>{s(!1)}),1e3)),()=>clearTimeout(e)}),[f]),!_&&m)return null;if(h||v)return(0,i.createElement)(ns,null);const E=m?(0,Xt.__)("Save as pending"):(0,Xt.__)("Save draft"),w=(0,Xt.__)("Save"),S=r||!p&&!d,P=f||S,k=f||S||!g;let C;return f?C=c?(0,Xt.__)("Autosaving"):(0,Xt.__)("Saving"):S?C=(0,Xt.__)("Saved"):a?C=E:o&&(C=w),(0,i.createElement)(To.Button,{className:g||f?uo()({"editor-post-save-draft":!P,"editor-post-saved-state":P,"is-saving":f,"is-autosaving":c,"is-saved":S,[(0,To.__unstableGetAnimateClassName)({type:"loading"})]:f}):void 0,onClick:k?void 0:()=>y(),shortcut:k?void 0:ko.displayShortcut.primary("s"),showTooltip:!0,variant:"tertiary",icon:a?void 0:Zi,label:C||E,"aria-disabled":k},P&&(0,i.createElement)(Ji,{icon:S?es:ts}),C)}var rs=(0,u.compose)([(0,l.withSelect)((e=>{const{getCurrentPost:t,getCurrentPostType:n}=e(no);return{hasPublishAction:(0,s.get)(t(),["_links","wp:action-publish"],!1),postType:n()}}))])((function(e){let{hasPublishAction:t,children:n}=e;return t?n:null}));function is(e){let{children:t}=e;return(0,i.createElement)(Qo,{supportKeys:"slug"},t)}class ss extends i.Component{constructor(e){let{postSlug:t,postTitle:n,postID:o}=e;super(...arguments),this.state={editedSlug:(0,E.safeDecodeURIComponent)(t)||(0,E.cleanForSlug)(n)||o},this.setSlug=this.setSlug.bind(this)}setSlug(e){const{postSlug:t,onUpdateSlug:n}=this.props,{value:o}=e.target,r=(0,E.cleanForSlug)(o);r!==t&&n(r)}render(){const{editedSlug:e}=this.state;return(0,i.createElement)(is,null,(0,i.createElement)(To.TextControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Slug"),autoComplete:"off",spellCheck:"false",value:e,onChange:e=>this.setState({editedSlug:e}),onBlur:this.setSlug,className:"editor-post-slug"}))}}var as=(0,u.compose)([(0,l.withSelect)((e=>{const{getCurrentPost:t,getEditedPostAttribute:n}=e(no),{id:o}=t();return{postSlug:n("slug"),postTitle:n("title"),postID:o}})),(0,l.withDispatch)((e=>{const{editPost:t}=e(no);return{onUpdateSlug(e){t({slug:e})}}}))])(ss);var ls=(0,u.compose)([(0,l.withSelect)((e=>{const t=e(no).getCurrentPost();return{hasStickyAction:(0,s.get)(t,["_links","wp:action-sticky"],!1),postType:e(no).getCurrentPostType()}}))])((function(e){let{hasStickyAction:t,postType:n,children:o}=e;return"post"===n&&t?o:null}));var cs=(0,u.compose)([(0,l.withSelect)((e=>({postSticky:e(no).getEditedPostAttribute("sticky")}))),(0,l.withDispatch)((e=>({onUpdateSticky(t){e(no).editPost({sticky:t})}})))])((function(e){let{onUpdateSticky:t,postSticky:n=!1}=e;return(0,i.createElement)(ls,null,(0,i.createElement)(To.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Stick to the top of the blog"),checked:n,onChange:()=>t(!n)}))}));const us=e=>e;var ds=(0,u.compose)([(0,l.withSelect)((e=>({postType:e(no).getCurrentPostType(),taxonomies:e(c.store).getTaxonomies({per_page:-1})})))])((function(e){let{postType:t,taxonomies:n,taxonomyWrapper:o=us}=e;return(null!=n?n:[]).filter((e=>e.types.includes(t))).filter((e=>{var t;return null===(t=e.visibility)||void 0===t?void 0:t.show_ui})).map((e=>{const t=e.hierarchical?Wi:Di;return(0,i.createElement)(i.Fragment,{key:`taxonomy-${e.slug}`},o((0,i.createElement)(t,{slug:e.slug}),e))}))}));var ps=(0,u.compose)([(0,l.withSelect)((e=>({postType:e(no).getCurrentPostType(),taxonomies:e(c.store).getTaxonomies({per_page:-1})})))])((function(e){let{postType:t,taxonomies:n,children:o}=e;return(null==n?void 0:n.some((e=>e.types.includes(t))))?o:null})),ms=n(773);function hs(){const e=(0,l.useSelect)((e=>e(no).getEditedPostContent()),[]),{editPost:t,resetEditorBlocks:n}=(0,l.useDispatch)(no),[o,r]=(0,i.useState)(e),[s,c]=(0,i.useState)(!1),d=(0,u.useInstanceId)(hs),p=(0,i.useRef)();s||o===e||r(e);return(0,i.useEffect)((()=>()=>{if(p.current){const e=(0,a.parse)(p.current);n(e)}}),[]),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.VisuallyHidden,{as:"label",htmlFor:`post-content-${d}`},(0,Xt.__)("Type text or HTML")),(0,i.createElement)(ms.Z,{autoComplete:"off",dir:"auto",value:o,onChange:e=>{const n=e.target.value;t({content:n}),r(n),c(!0),p.current=n},onBlur:()=>{if(s){const e=(0,a.parse)(o);n(e),c(!1)}},className:"editor-post-text-editor",id:`post-content-${d}`,placeholder:(0,Xt.__)("Start writing with text or HTML")}))}var gs=window.wp.dom;const fs=/[\r\n]+/g;var vs=(0,i.forwardRef)((function(e,t){const n=(0,i.useRef)(),[o,r]=(0,i.useState)(!1),{editPost:s}=(0,l.useDispatch)(no),{insertDefaultBlock:c,clearSelectedBlock:d,insertBlocks:m}=(0,l.useDispatch)(p.store),{isCleanNewPost:h,title:g,placeholder:f,hasFixedToolbar:v}=(0,l.useSelect)((e=>{const{getEditedPostAttribute:t,isCleanNewPost:n}=e(no),{getSettings:o}=e(p.store),{titlePlaceholder:r,hasFixedToolbar:i}=o();return{isCleanNewPost:n(),title:t("title"),placeholder:r,hasFixedToolbar:i}}),[]);function _(e){m(e,0)}function y(e){s({title:e})}(0,i.useImperativeHandle)(t,(()=>({focus:()=>{var e;null==n||null===(e=n.current)||void 0===e||e.focus()}}))),(0,i.useEffect)((()=>{if(!n.current)return;const{ownerDocument:e}=n.current,{activeElement:t,body:o}=e;!h||t&&o!==t||n.current.focus()}),[h]);const[b,E]=(0,i.useState)({});function w(){r(!1),E({})}const S=uo()("wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",{"is-selected":o,"has-fixed-toolbar":v}),P=(0,Lo.decodeEntities)(f)||(0,Xt.__)("Add title"),{ref:k}=(0,lo.__unstableUseRichText)({value:g,onChange:function(e){y(e.replace(fs," "))},placeholder:P,selectionStart:b.start,selectionEnd:b.end,onSelectionChange(e,t){E((n=>{const{start:o,end:r}=n;return o===e&&r===t?n:{start:e,end:t}}))},__unstableDisableFormats:!0,preserveWhiteSpace:!0});return(0,i.createElement)(Qo,{supportKeys:"title"},(0,i.createElement)("h1",{ref:(0,u.useMergeRefs)([k,n]),contentEditable:!0,className:S,"aria-label":P,role:"textbox","aria-multiline":"true",onFocus:function(){r(!0),d()},onBlur:w,onKeyDown:function(e){e.keyCode===ko.ENTER&&(e.preventDefault(),c(void 0,void 0,0))},onKeyPress:w,onPaste:function(e){const t=e.clipboardData;let n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}window.console.log("Received HTML:\n\n",o),window.console.log("Received plain text:\n\n",n);const r=(0,a.pasteHandler)({HTML:o,plainText:n});if(e.preventDefault(),r.length)if("string"!=typeof r){const[e]=r;g||"core/heading"!==e.name&&"core/paragraph"!==e.name?_(r):(y((0,gs.__unstableStripHTML)(e.attributes.content)),_(r.slice(1)))}else{const e={...(0,lo.create)({html:g}),...b},t=(0,lo.insert)(e,(0,lo.create)({html:(0,gs.__unstableStripHTML)(r)}));y((0,lo.toHTMLString)({value:t})),E({start:t.start,end:t.end})}}}))}));function _s(){const{isNew:e,isDeleting:t,postId:n}=(0,l.useSelect)((e=>{const t=e(no);return{isNew:t.isEditedPostNew(),isDeleting:t.isDeletingPost(),postId:t.getCurrentPostId()}}),[]),{trashPost:o}=(0,l.useDispatch)(no);return e||!n?null:(0,i.createElement)(To.Button,{className:"editor-post-trash",isDestructive:!0,variant:"secondary",isBusy:t,"aria-disabled":t,onClick:t?void 0:()=>o()},(0,Xt.__)("Move to trash"))}var ys=(0,l.withSelect)((e=>{const{isEditedPostNew:t,getCurrentPostId:n,getCurrentPostType:o}=e(no),{getPostType:r,canUser:i}=e(c.store),s=n(),a=r(o()),l=(null==a?void 0:a.rest_base)||"";return{isNew:t(),postId:s,canUserDelete:!(!s||!l)&&i("delete",l,s)}}))((function(e){let{isNew:t,postId:n,canUserDelete:o,children:r}=e;return!t&&n&&o?r:null}));function bs(e){let{onClose:t}=e;const{isEditable:n,postSlug:o,viewPostLabel:r,postLink:s,permalinkPrefix:a,permalinkSuffix:u}=(0,l.useSelect)((e=>{var t,n;const o=e(no).getCurrentPost(),r=e(no).getCurrentPostType(),i=e(c.store).getPostType(r),s=e(no).getPermalinkParts(),a=null!==(t=null==o||null===(n=o._links)||void 0===n?void 0:n["wp:action-publish"])&&void 0!==t&&t;return{isEditable:e(no).isPermalinkEditable()&&a,postSlug:(0,E.safeDecodeURIComponent)(e(no).getEditedPostSlug()),viewPostLabel:null==i?void 0:i.labels.view_item,postLink:o.link,permalinkPrefix:null==s?void 0:s.prefix,permalinkSuffix:null==s?void 0:s.suffix}}),[]),{editPost:d}=(0,l.useDispatch)(no),[m,h]=(0,i.useState)(!1);return(0,i.createElement)("div",{className:"editor-post-url"},(0,i.createElement)(p.__experimentalInspectorPopoverHeader,{title:(0,Xt.__)("URL"),onClose:t}),n&&(0,i.createElement)(To.TextControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Permalink"),value:m?"":o,autoComplete:"off",spellCheck:"false",help:(0,i.createElement)(i.Fragment,null,(0,Xt.__)("The last part of the URL.")," ",(0,i.createElement)(To.ExternalLink,{href:(0,Xt.__)("https://wordpress.org/support/article/settings-sidebar/#permalink")},(0,Xt.__)("Learn more."))),onChange:e=>{d({slug:e}),e?m&&h(!1):m||h(!0)},onBlur:e=>{d({slug:(0,E.cleanForSlug)(e.target.value)}),m&&h(!1)}}),n&&(0,i.createElement)("h3",{className:"editor-post-url__link-label"},null!=r?r:(0,Xt.__)("View post")),(0,i.createElement)("p",null,(0,i.createElement)(To.ExternalLink,{className:"editor-post-url__link",href:s,target:"_blank"},n?(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",{className:"editor-post-url__link-prefix"},a),(0,i.createElement)("span",{className:"editor-post-url__link-slug"},o),(0,i.createElement)("span",{className:"editor-post-url__link-suffix"},u)):s)))}function Es(e){let{children:t}=e;const n=(0,l.useSelect)((e=>{const t=e(no).getCurrentPostType(),n=e(c.store).getPostType(t);if(null==n||!n.viewable)return!1;if(!e(no).getCurrentPost().link)return!1;return!!e(no).getPermalinkParts()}),[]);return n?t:null}function ws(){return Ss()}function Ss(){const e=(0,l.useSelect)((e=>e(no).getPermalink()),[]);return(0,E.filterURLForDisplay)((0,E.safeDecodeURIComponent)(e))}var Ps=(0,u.compose)([(0,l.withSelect)((e=>{const{getCurrentPost:t,getCurrentPostType:n}=e(no);return{hasPublishAction:(0,s.get)(t(),["_links","wp:action-publish"],!1),postType:n()}}))])((function(e){let{hasPublishAction:t,render:n}=e;return n({canEdit:t})}));var ks=(0,i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(P.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),Cs=window.wp.wordcount;function Ts(){const e=(0,l.useSelect)((e=>e(no).getEditedPostAttribute("content")),[]),t=(0,Xt._x)("words","Word count type. Do not translate!");return(0,i.createElement)("span",{className:"word-count"},(0,Cs.count)(e,t))}function xs(){const e=(0,l.useSelect)((e=>e(no).getEditedPostAttribute("content")),[]),t=(0,Xt._x)("words","Word count type. Do not translate!"),n=Math.round((0,Cs.count)(e,t)/189),o=0===n?(0,i.createInterpolateElement)((0,Xt.__)("< 1 minute"),{span:(0,i.createElement)("span",null)}):(0,i.createInterpolateElement)((0,Xt.sprintf)((0,Xt._n)("%d minute","%d minutes",n),n),{span:(0,i.createElement)("span",null)});return(0,i.createElement)("span",{className:"time-to-read"},o)}function Bs(){const e=(0,l.useSelect)((e=>e(no).getEditedPostAttribute("content")),[]);return(0,Cs.count)(e,"characters_including_spaces")}var As=function(e){let{hasOutlineItemsDisabled:t,onRequestClose:n}=e;const{headingCount:o,paragraphCount:r,numberOfBlocks:s}=(0,l.useSelect)((e=>{const{getGlobalBlockCount:t}=e(p.store);return{headingCount:t("core/heading"),paragraphCount:t("core/paragraph"),numberOfBlocks:t()}}),[]);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":(0,Xt.__)("Document Statistics"),tabIndex:"0"},(0,i.createElement)("ul",{role:"list",className:"table-of-contents__counts"},(0,i.createElement)("li",{className:"table-of-contents__count"},(0,Xt.__)("Words"),(0,i.createElement)(Ts,null)),(0,i.createElement)("li",{className:"table-of-contents__count"},(0,Xt.__)("Characters"),(0,i.createElement)("span",{className:"table-of-contents__number"},(0,i.createElement)(Bs,null))),(0,i.createElement)("li",{className:"table-of-contents__count"},(0,Xt.__)("Time to read"),(0,i.createElement)(xs,null)),(0,i.createElement)("li",{className:"table-of-contents__count"},(0,Xt.__)("Headings"),(0,i.createElement)("span",{className:"table-of-contents__number"},o)),(0,i.createElement)("li",{className:"table-of-contents__count"},(0,Xt.__)("Paragraphs"),(0,i.createElement)("span",{className:"table-of-contents__number"},r)),(0,i.createElement)("li",{className:"table-of-contents__count"},(0,Xt.__)("Blocks"),(0,i.createElement)("span",{className:"table-of-contents__number"},s)))),o>0&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("hr",null),(0,i.createElement)("h2",{className:"table-of-contents__title"},(0,Xt.__)("Document Outline")),(0,i.createElement)(yo,{onSelect:n,hasOutlineItemsDisabled:t})))};var Is=(0,i.forwardRef)((function(e,t){let{hasOutlineItemsDisabled:n,repositionDropdown:o,...s}=e;const a=(0,l.useSelect)((e=>!!e(p.store).getBlockCount()),[]);return(0,i.createElement)(To.Dropdown,{popoverProps:{placement:o?"right":"bottom"},className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,i.createElement)(To.Button,r({},s,{ref:t,onClick:a?o:void 0,icon:ks,"aria-expanded":n,"aria-haspopup":"true",label:(0,Xt.__)("Details"),tooltipPosition:"bottom","aria-disabled":!a}))},renderContent:e=>{let{onClose:t}=e;return(0,i.createElement)(As,{onRequestClose:t,hasOutlineItemsDisabled:n})}})}));function Ns(){const e=(0,l.useSelect)((e=>()=>{const{__experimentalGetDirtyEntityRecords:t}=e(c.store);return t().length>0}),[]),t=t=>{if(e())return t.returnValue=(0,Xt.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return(0,i.useEffect)((()=>(window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)})),[]),null}var Ds=window.wp.reusableBlocks;var Rs=(0,u.createHigherOrderComponent)((e=>(0,l.withRegistry)((t=>{const{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,i.createElement)(e,r);const[s,a]=(0,i.useState)(null);return(0,i.useEffect)((()=>{const e=(0,l.createRegistry)({"core/block-editor":p.storeConfig},o);e.registerStore("core/editor",to),a(e)}),[o]),s?(0,i.createElement)(l.RegistryProvider,{value:s},(0,i.createElement)(e,r)):null}))),"withRegistryProvider");const Ls=(e,t)=>`${t}`,Os=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,Us=e=>{const{title:t,foreign_landing_url:n,creator:o,creator_url:r,license:i,license_version:s,license_url:a}=e,l=((e,t)=>{let n=e.trim();return"pdm"!==e&&(n=e.toUpperCase().replace("SAMPLING","Sampling")),t&&(n+=` ${t}`),["pdm","cc0"].includes(e)||(n=`CC ${n}`),n})(i,s),c=(0,Lo.decodeEntities)(o);let u;return u=c?t?(0,Xt.sprintf)((0,Xt._x)('"%1$s" by %2$s/ %3$s',"caption"),Ls(n,(0,Lo.decodeEntities)(t)),r?Ls(r,c):c,a?Ls(`${a}?ref=openverse`,l):l):(0,Xt.sprintf)((0,Xt._x)("Work by %2$s/ %3$s","caption"),Os(n),r?Ls(r,c):c,a?Ls(`${a}?ref=openverse`,l):l):t?(0,Xt.sprintf)((0,Xt._x)('"%1$s"/ %2$s',"caption"),Ls(n,(0,Lo.decodeEntities)(t)),a?Ls(`${a}?ref=openverse`,l):l):(0,Xt.sprintf)((0,Xt._x)("Work/ %2$s","caption"),Os(n),a?Ls(`${a}?ref=openverse`,l):l),u.replace(/\s{2}/g," ")},Ms=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=await(0,l.resolveSelect)(c.store).getMediaItems({...e,orderBy:null!=e&&e.search?"relevance":"date"});return t.map((e=>{var t,n,o,r;return{...e,alt:e.alt_text,url:e.source_url,previewUrl:null===(t=e.media_details)||void 0===t||null===(n=t.sizes)||void 0===n||null===(o=n.medium)||void 0===o?void 0:o.source_url,caption:null===(r=e.caption)||void 0===r?void 0:r.raw}}))},Fs=[{name:"images",labels:{name:(0,Xt.__)("Images"),search_items:(0,Xt.__)("Search images")},mediaType:"image",async fetch(){return Ms({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},media_type:"image"})}},{name:"videos",labels:{name:(0,Xt.__)("Videos"),search_items:(0,Xt.__)("Search videos")},mediaType:"video",async fetch(){return Ms({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},media_type:"video"})}},{name:"audio",labels:{name:(0,Xt.__)("Audio"),search_items:(0,Xt.__)("Search audio")},mediaType:"audio",async fetch(){return Ms({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},media_type:"audio"})}},{name:"openverse",labels:{name:(0,Xt.__)("Openverse"),search_items:(0,Xt.__)("Search Openverse")},mediaType:"image",async fetch(){const e={...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},mature:!1,excluded_source:"flickr,inaturalist,wikimedia",license:"pdm,cc0"},t={per_page:"page_size",search:"q"},n=new URL("https://api.openverse.engineering/v1/images/");Object.entries(e).forEach((e=>{let[o,r]=e;const i=t[o]||o;n.searchParams.set(i,r)}));const o=await window.fetch(n,{headers:{"User-Agent":"WordPress/inserter-media-fetch"}});return(await o.json()).results.map((e=>{var t;return{...e,title:null!==(t=e.title)&&void 0!==t&&t.toLowerCase().startsWith("file:")?e.title.slice(5):e.title,sourceId:e.id,id:void 0,caption:Us(e),previewUrl:e.thumbnail}}))},getReportUrl:e=>{let{sourceId:t}=e;return`https://wordpress.org/openverse/image/${t}/report/`},isExternalResource:!0}];var zs=Fs,Hs=window.wp.mediaUtils;const Vs=()=>{};function Ws(e){let{additionalData:t={},allowedTypes:n,filesList:o,maxUploadFileSize:r,onError:i=Vs,onFileChange:s}=e;const{getCurrentPostId:a,getEditorSettings:c}=(0,l.select)(no),u=c().allowedMimeTypes;r=r||c().maxUploadFileSize,(0,Hs.uploadMedia)({allowedTypes:n,filesList:o,onFileChange:s,additionalData:{post:a(),...t},maxUploadFileSize:r,onError:e=>{let{message:t}=e;return i(t)},wpAllowedMimeTypes:u})}const js=[],$s=["__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","__experimentalPreferredStyleVariations","__experimentalSetIsInserterOpened","__unstableGalleryWithImageBlocks","alignWide","allowedBlockTypes","blockInspectorTabs","allowedMimeTypes","bodyPlaceholder","canLockBlocks","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","focusMode","fontSizes","gradients","generateAnchors","hasFixedToolbar","hasInlineToolbar","isDistractionFree","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isRTL","keepCaretInsideBlock","locale","maxWidth","onUpdateDefaultBlockStyles","postsPerPage","readOnly","styles","template","templateLock","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableIsPreviewMode","__unstableResolvedAssets","__unstableIsBlockBasedTheme"];var Gs=function(e,t){var n,o;const{reusableBlocks:r,hasUploadPermissions:s,canUseUnfilteredHTML:a,userCanCreatePages:u,pageOnFront:d,postType:p}=(0,l.useSelect)((e=>{var t;const{canUserUseUnfilteredHTML:n,getCurrentPostType:o}=e(no),r="web"===i.Platform.OS,{canUser:s,getEntityRecord:a}=e(c.store),l=s("read","settings")?a("root","site"):void 0;return{canUseUnfilteredHTML:n(),reusableBlocks:r?e(c.store).getEntityRecords("postType","wp_block",{per_page:-1}):js,hasUploadPermissions:null===(t=s("create","media"))||void 0===t||t,userCanCreatePages:s("create","pages"),pageOnFront:null==l?void 0:l.page_on_front,postType:o()}}),[]),m=null!==(n=e.__experimentalAdditionalBlockPatterns)&&void 0!==n?n:e.__experimentalBlockPatterns,h=null!==(o=e.__experimentalAdditionalBlockPatternCategories)&&void 0!==o?o:e.__experimentalBlockPatternCategories,{restBlockPatterns:g,restBlockPatternCategories:f}=(0,l.useSelect)((e=>({restBlockPatterns:e(c.store).getBlockPatterns(),restBlockPatternCategories:e(c.store).getBlockPatternCategories()})),[]),v=(0,i.useMemo)((()=>[...m||[],...g||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name)))).filter((e=>{let{postTypes:t}=e;return!t||Array.isArray(t)&&t.includes(p)}))),[m,g,p]),_=(0,i.useMemo)((()=>[...h||[],...f||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))),[h,f]),{undo:y}=(0,l.useDispatch)(no),{saveEntityRecord:b}=(0,l.useDispatch)(c.store),E=e=>u?b("postType","page",e):Promise.reject({message:(0,Xt.__)("You do not have permission to create Pages.")});return(0,i.useMemo)((()=>({...Object.fromEntries(Object.entries(e).filter((e=>{let[t]=e;return $s.includes(t)}))),mediaUpload:s?Ws:void 0,__experimentalReusableBlocks:r,__experimentalBlockPatterns:v,__experimentalBlockPatternCategories:_,__experimentalFetchLinkSuggestions:(t,n)=>(0,c.__experimentalFetchLinkSuggestions)(t,n,e),inserterMediaCategories:zs,__experimentalFetchRichUrlData:c.__experimentalFetchUrlData,__experimentalCanUserUseUnfilteredHTML:a,__experimentalUndo:y,outlineMode:t,__experimentalCreatePageEntity:E,__experimentalUserCanCreatePages:u,pageOnFront:d,__experimentalPreferPatternsOnRoot:t})),[e,s,r,v,_,a,y,t,u,d])},Ks=window.wp.privateApis;const{lock:Ys,unlock:qs}=(0,Ks.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/editor"),{ExperimentalBlockEditorProvider:Qs}=qs(p.privateApis),Xs=Rs((e=>{let{__unstableTemplate:t,post:n,settings:o,recovery:r,initialEdits:s,children:a,BlockEditorProviderComponent:u=Qs}=e;const d=(0,i.useMemo)((()=>"wp_template"===n.type?{}:{postId:n.id,postType:n.type}),[n.id,n.type]),{editorSettings:m,selection:h,isReady:g}=(0,l.useSelect)((e=>{const{getEditorSettings:t,getEditorSelection:n,__unstableIsEditorReady:o}=e(no);return{editorSettings:t(),isReady:o(),selection:n()}}),[]),{id:f,type:v}=null!=t?t:n,[_,y,b]=(0,c.useEntityBlockEditor)("postType",v,{id:f}),E=Gs(m,!!t),{updatePostLock:w,setupEditor:S,updateEditorSettings:P,__experimentalTearDownEditor:k}=(0,l.useDispatch)(no),{createWarningNotice:C}=(0,l.useDispatch)(Kt.store);return(0,i.useLayoutEffect)((()=>{if(!r)return w(o.postLock),S(n,s,o.template),o.autosave&&C((0,Xt.__)("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:(0,Xt.__)("View the autosave"),url:o.autosave.editLink}]}),()=>{k()}}),[]),(0,i.useEffect)((()=>{P(o)}),[o]),g?(0,i.createElement)(c.EntityProvider,{kind:"root",type:"site"},(0,i.createElement)(c.EntityProvider,{kind:"postType",type:n.type,id:n.id},(0,i.createElement)(p.BlockContextProvider,{value:d},(0,i.createElement)(u,{value:_,onChange:b,onInput:y,selection:h,settings:E,useSubRegistry:!1},a,(0,i.createElement)(Ds.ReusableBlocksMenuItems,null))))):null}));var Zs=function(e){return(0,i.createElement)(Xs,r({},e,{BlockEditorProviderComponent:p.BlockEditorProvider}),e.children)},Js=window.wp.serverSideRender,ea=n.n(Js);function ta(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const o=(0,i.forwardRef)(((n,o)=>(S()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),(0,i.createElement)(t,r({ref:o},n)))));return n.forEach((n=>{o[n]=ta(e+"."+n,t[n])})),o}function na(e,t){return function(){return S()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),t(...arguments)}}const oa=ta("RichText",p.RichText,["Content"]);oa.isEmpty=na("RichText.isEmpty",p.RichText.isEmpty);const ra=ta("Autocomplete",p.Autocomplete),ia=ta("AlignmentToolbar",p.AlignmentToolbar),sa=ta("BlockAlignmentToolbar",p.BlockAlignmentToolbar),aa=ta("BlockControls",p.BlockControls,["Slot"]),la=ta("BlockEdit",p.BlockEdit),ca=ta("BlockEditorKeyboardShortcuts",p.BlockEditorKeyboardShortcuts),ua=ta("BlockFormatControls",p.BlockFormatControls,["Slot"]),da=ta("BlockIcon",p.BlockIcon),pa=ta("BlockInspector",p.BlockInspector),ma=ta("BlockList",p.BlockList),ha=ta("BlockMover",p.BlockMover),ga=ta("BlockNavigationDropdown",p.BlockNavigationDropdown),fa=ta("BlockSelectionClearer",p.BlockSelectionClearer),va=ta("BlockSettingsMenu",p.BlockSettingsMenu),_a=ta("BlockTitle",p.BlockTitle),ya=ta("BlockToolbar",p.BlockToolbar),ba=ta("ColorPalette",p.ColorPalette),Ea=ta("ContrastChecker",p.ContrastChecker),wa=ta("CopyHandler",p.CopyHandler),Sa=ta("DefaultBlockAppender",p.DefaultBlockAppender),Pa=ta("FontSizePicker",p.FontSizePicker),ka=ta("Inserter",p.Inserter),Ca=ta("InnerBlocks",p.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),Ta=ta("InspectorAdvancedControls",p.InspectorAdvancedControls,["Slot"]),xa=ta("InspectorControls",p.InspectorControls,["Slot"]),Ba=ta("PanelColorSettings",p.PanelColorSettings),Aa=ta("PlainText",p.PlainText),Ia=ta("RichTextShortcut",p.RichTextShortcut),Na=ta("RichTextToolbarButton",p.RichTextToolbarButton),Da=ta("__unstableRichTextInputEvent",p.__unstableRichTextInputEvent),Ra=ta("MediaPlaceholder",p.MediaPlaceholder),La=ta("MediaUpload",p.MediaUpload),Oa=ta("MediaUploadCheck",p.MediaUploadCheck),Ua=ta("MultiSelectScrollIntoView",p.MultiSelectScrollIntoView),Ma=ta("NavigableToolbar",p.NavigableToolbar),Fa=ta("ObserveTyping",p.ObserveTyping),za=ta("SkipToSelectedBlock",p.SkipToSelectedBlock),Ha=ta("URLInput",p.URLInput),Va=ta("URLInputButton",p.URLInputButton),Wa=ta("URLPopover",p.URLPopover),ja=ta("Warning",p.Warning),$a=ta("WritingFlow",p.WritingFlow),Ga=na("createCustomColorsHOC",p.createCustomColorsHOC),Ka=na("getColorClassName",p.getColorClassName),Ya=na("getColorObjectByAttributeValues",p.getColorObjectByAttributeValues),qa=na("getColorObjectByColorValue",p.getColorObjectByColorValue),Qa=na("getFontSize",p.getFontSize),Xa=na("getFontSizeClass",p.getFontSizeClass),Za=na("withColorContext",p.withColorContext),Ja=na("withColors",p.withColors),el=na("withFontSizes",p.withFontSizes);function tl(e){return S()("wp.editor.cleanForSlug",{since:"12.7",plugin:"Gutenberg",alternative:"wp.url.cleanForSlug"}),(0,E.cleanForSlug)(e)}const nl={};Ys(nl,{ExperimentalEditorProvider:Xs})}(),(window.wp=window.wp||{}).editor=o}(); \ No newline at end of file + */var t=/["'&<>]/;e.exports=function(e){var n,o=""+e,r=t.exec(o);if(!r)return o;var i="",s=0,a=0;for(s=r.index;s0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SETUP_EDITOR_STATE"===t.type?t.post.id:e},postType:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SETUP_EDITOR_STATE"===t.type?t.post.type:e},saving:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REQUEST_POST_UPDATE_START":case"REQUEST_POST_UPDATE_FINISH":return{pending:"REQUEST_POST_UPDATE_START"===t.type,options:t.options||{}}}return e},deleting:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REQUEST_POST_DELETE_START":case"REQUEST_POST_DELETE_FINISH":return{pending:"REQUEST_POST_DELETE_START"===t.type}}return e},postLock:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isLocked:!1},t=arguments.length>1?arguments[1]:void 0;return"UPDATE_POST_LOCK"===t.type?t.lock:e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},postSavingLock:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOCK_POST_SAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_SAVING":{const{[t.lockName]:n,...o}=e;return o}}return e},isReady:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_EDITOR_STATE":return!0;case"TEAR_DOWN_EDITOR":return!1}return e},editorSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m,t=arguments.length>1?arguments[1]:void 0;return"UPDATE_EDITOR_SETTINGS"===t.type?{...e,...t.settings}:e},postAutosavingLock:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOCK_POST_AUTOSAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_AUTOSAVING":{const{[t.lockName]:n,...o}=e;return o}}return e}}),f={};function v(e){return[e]}function _(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o()=>e(c.store).hasUndo())),z=(0,l.createRegistrySelector)((e=>()=>e(c.store).hasRedo()));function H(e){return"auto-draft"===G(e).status}function V(e){return"content"in X(e)}const W=(0,l.createRegistrySelector)((e=>t=>{const n=K(t),o=Y(t);return!!e(c.store).hasEditsForEntityRecord("postType",n,o)})),j=(0,l.createRegistrySelector)((e=>t=>{const n=e(c.store).__experimentalGetDirtyEntityRecords(),{type:o,id:r}=G(t);return n.some((e=>"postType"!==e.kind||e.name!==o||e.key!==r))}));function $(e){return!W(e)&&H(e)}const G=(0,l.createRegistrySelector)((e=>t=>{const n=Y(t),o=K(t),r=e(c.store).getRawEntityRecord("postType",o,n);return r||U}));function K(e){return e.postType}function Y(e){return e.postId}function q(e){var t,n,o,r;return null!==(t=null===(n=G(e)._links)||void 0===n||null===(o=n["version-history"])||void 0===o||null===(r=o[0])||void 0===r?void 0:r.count)&&void 0!==t?t:0}function Q(e){var t,n,o,r;return null!==(t=null===(n=G(e)._links)||void 0===n||null===(o=n["predecessor-version"])||void 0===o||null===(r=o[0])||void 0===r?void 0:r.id)&&void 0!==t?t:null}const X=(0,l.createRegistrySelector)((e=>t=>{const n=K(t),o=Y(t);return e(c.store).getEntityRecordEdits("postType",n,o)||U}));function Z(e,t){switch(t){case"type":return K(e);case"id":return Y(e);default:const n=G(e);if(!n.hasOwnProperty(t))break;return h(n[t])}}function J(e,t){if("content"===t)return be(e);const n=X(e);return n.hasOwnProperty(t)?T.has(t)?((e,t)=>{const n=X(e);return n.hasOwnProperty(t)?{...Z(e,t),...n[t]}:Z(e,t)})(e,t):n[t]:Z(e,t)}const ee=(0,l.createRegistrySelector)((e=>(t,n)=>{var o;if(!I.includes(n)&&"preview_link"!==n)return;const r=K(t),i=Y(t),s=null===(o=e(c.store).getCurrentUser())||void 0===o?void 0:o.id,a=e(c.store).getAutosave(r,i,s);return a?h(a[n]):void 0}));function te(e){if("private"===J(e,"status"))return"private";return J(e,"password")?"password":"public"}function ne(e){return"pending"===G(e).status}function oe(e,t){const n=t||G(e);return-1!==["publish","private"].indexOf(n.status)||"future"===n.status&&!(0,b.isInTheFuture)(new Date(Number((0,b.getDate)(n.date))-6e4))}function re(e){return"future"===G(e).status&&!oe(e)}function ie(e){const t=G(e);return W(e)||-1===["publish","private","future"].indexOf(t.status)}function se(e){return!pe(e)&&(!!J(e,"title")||!!J(e,"excerpt")||!ae(e)||"native"===i.Platform.OS)}function ae(e){const t=Re(e);if(t.length){if(t.length>1)return!1;const e=t[0].name;if(e!==(0,a.getDefaultBlockName)()&&e!==(0,a.getFreeformContentHandlerName)())return!1}return!be(e)}const le=(0,l.createRegistrySelector)((e=>t=>{var n;if(!se(t))return!1;if(xe(t))return!1;const o=K(t),r=Y(t),i=e(c.store).hasFetchedAutosaves(o,r),s=null===(n=e(c.store).getCurrentUser())||void 0===n?void 0:n.id,a=e(c.store).getAutosave(o,r,s);return!!i&&(!a||(!!V(t)||["title","excerpt"].some((e=>h(a[e])!==J(t,e)))))}));function ce(e){const t=J(e,"date"),n=new Date(Number((0,b.getDate)(t))-6e4);return(0,b.isInTheFuture)(n)}function ue(e){const t=J(e,"date"),n=J(e,"modified"),o=G(e).status;return("draft"===o||"auto-draft"===o||"pending"===o)&&(t===n||null===t)}function de(e){return!!e.deleting.pending}const pe=(0,l.createRegistrySelector)((e=>t=>{const n=K(t),o=Y(t);return e(c.store).isSavingEntityRecord("postType",n,o)})),me=(0,l.createRegistrySelector)((e=>t=>{const n=e(c.store).__experimentalGetEntitiesBeingSaved(),{type:o,id:r}=G(t);return n.some((e=>"postType"!==e.kind||e.name!==o||e.key!==r))})),he=(0,l.createRegistrySelector)((e=>t=>{const n=K(t),o=Y(t);return!e(c.store).getLastEntitySaveError("postType",n,o)})),ge=(0,l.createRegistrySelector)((e=>t=>{const n=K(t),o=Y(t);return!!e(c.store).getLastEntitySaveError("postType",n,o)}));function fe(e){var t;return!!pe(e)&&Boolean(null===(t=e.saving.options)||void 0===t?void 0:t.isAutosave)}function ve(e){var t;return!!pe(e)&&Boolean(null===(t=e.saving.options)||void 0===t?void 0:t.isPreview)}function _e(e){if(e.saving.pending||pe(e))return;let t=ee(e,"preview_link");t&&"draft"!==G(e).status||(t=J(e,"link"),t&&(t=(0,E.addQueryArgs)(t,{preview:!0})));const n=J(e,"featured_media");return t&&n?(0,E.addQueryArgs)(t,{_thumbnail_id:n}):t}function ye(e){const t=Re(e);if(t.length>2)return null;let n;if(1===t.length&&(n=t[0].name,"core/embed"===n)){var o;const e=null===(o=t[0].attributes)||void 0===o?void 0:o.providerNameSlug;["youtube","vimeo"].includes(e)?n="core/video":["spotify","soundcloud"].includes(e)&&(n="core/audio")}switch(2===t.length&&"core/paragraph"===t[1].name&&(n=t[0].name),n){case"core/image":return"image";case"core/quote":case"core/pullquote":return"quote";case"core/gallery":return"gallery";case"core/video":return"video";case"core/audio":return"audio";default:return null}}const be=(0,l.createRegistrySelector)((e=>t=>{const n=Y(t),o=K(t),r=e(c.store).getEditedEntityRecord("postType",o,n);if(r){if("function"==typeof r.content)return r.content(r);if(r.blocks)return(0,a.__unstableSerializeAndClean)(r.blocks);if(r.content)return r.content}return""}));function Ee(e){return pe(e)&&!oe(e)&&"publish"===J(e,"status")}function we(e){const t=J(e,"permalink_template");return A.test(t)}function Se(e){const t=ke(e);if(!t)return null;const{prefix:n,postName:o,suffix:r}=t;return we(e)?n+o+r:n}function Pe(e){return J(e,"slug")||(0,E.cleanForSlug)(J(e,"title"))||Y(e)}function ke(e){const t=J(e,"permalink_template");if(!t)return null;const n=J(e,"slug")||J(e,"generated_slug"),[o,r]=t.split(A);return{prefix:o,postName:n,suffix:r}}function Ce(e){return e.postLock.isLocked}function Te(e){return Object.keys(e.postSavingLock).length>0}function xe(e){return Object.keys(e.postAutosavingLock).length>0}function Be(e){return e.postLock.isTakeover}function Ae(e){return e.postLock.user}function Ie(e){return e.postLock.activePostLock}function Ne(e){var t;return Boolean(null===(t=G(e)._links)||void 0===t?void 0:t.hasOwnProperty("wp:action-unfiltered-html"))}const De=(0,l.createRegistrySelector)((e=>()=>!!e(C.store).get("core/edit-post","isPublishSidebarEnabled")));function Re(e){return J(e,"blocks")||M}function Le(e){var t;return S()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),null===(t=J(e,"selection"))||void 0===t?void 0:t.selectionStart}function Oe(e){var t;return S()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),null===(t=J(e,"selection"))||void 0===t?void 0:t.selectionEnd}function Ue(e){return J(e,"selection")}function Me(e){return e.isReady}function Fe(e){return e.editorSettings}function ze(){return S()("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function He(){return S()("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function Ve(e){return(0,l.createRegistrySelector)((t=>function(n){S()("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`",version:"6.2"});for(var o=arguments.length,r=new Array(o>1?o-1:0),i=1;i{var t;const n=(null===(t=Fe(e))||void 0===t?void 0:t.defaultTemplatePartAreas)||[];return null==n?void 0:n.map((e=>({...e,icon:O(e.icon)})))}),(e=>{var t;return[null===(t=Fe(e))||void 0===t?void 0:t.defaultTemplatePartAreas]})),Vt=y(((e,t)=>{var n;const o=zt(e);return o&&null!==(n=Object.values(o).find((e=>e.slug===t)))&&void 0!==n?n:U}),((e,t)=>[zt(e),t]));function Wt(e,t){var n;if(!t)return U;const{description:o,slug:r,title:i,area:s}=t,{title:a,description:l}=Vt(e,r),c="string"==typeof i?i:null==i?void 0:i.rendered;return{title:c&&c!==r?c:a||r,description:("string"==typeof o?o:null==o?void 0:o.raw)||l,icon:(null===(n=Ht(e).find((e=>s===e.area)))||void 0===n?void 0:n.icon)||k}}const jt=(0,l.createRegistrySelector)((e=>t=>{var n;const o=K(t),r=e(c.store).getPostType(o);return null==r||null===(n=r.labels)||void 0===n?void 0:n.singular_name}));var $t=window.wp.apiFetch,Gt=n.n($t),Kt=window.wp.notices;function Yt(e,t){return`wp-autosave-block-editor-post-${t?"auto-draft":e}`}function qt(e,t,n,o,r){window.sessionStorage.setItem(Yt(e,t),JSON.stringify({post_title:n,content:o,excerpt:r}))}function Qt(e,t){window.sessionStorage.removeItem(Yt(e,t))}var Xt=window.wp.i18n;function Zt(e){const{previousPost:t,post:n,postType:o}=e;if((0,s.get)(e.options,["isAutosave"]))return[];if("trash"===n.status&&"trash"!==t.status)return[];const r=["publish","private","future"],i=r.includes(t.status),a=r.includes(n.status);let l,c,u=(0,s.get)(o,["viewable"],!1);i||a?i&&!a?(l=o.labels.item_reverted_to_draft,u=!1):l=!i&&a?{publish:o.labels.item_published,private:o.labels.item_published_privately,future:o.labels.item_scheduled}[n.status]:o.labels.item_updated:(l=(0,Xt.__)("Draft saved."),c=!0);const d=[];return u&&d.push({label:c?(0,Xt.__)("View Preview"):o.labels.view_item,url:n.link}),[l,{id:x,type:"snackbar",actions:d}]}function Jt(e){const{post:t,edits:n,error:o}=e;if(o&&"rest_autosave_no_changes"===o.code)return[];const r=["publish","private","future"],i=-1!==r.indexOf(t.status),s={publish:(0,Xt.__)("Publishing failed."),private:(0,Xt.__)("Publishing failed."),future:(0,Xt.__)("Scheduling failed.")};let a=i||-1===r.indexOf(n.status)?(0,Xt.__)("Updating failed."):s[n.status];return o.message&&!/<\/?[^>]*>/.test(o.message)&&(a=[a,o.message].join(" ")),[a,{id:x}]}const en=(e,t,n)=>o=>{let{dispatch:r}=o;r.setupEditorState(e);if("auto-draft"===e.status&&n){let o;o="content"in t?t.content:e.content.raw;let i=(0,a.parse)(o);i=(0,a.synchronizeBlocksWithTemplate)(i,n),r.resetEditorBlocks(i,{__unstableShouldCreateUndoLevel:!1})}t&&Object.values(t).some((t=>{var n,o;let[r,i]=t;return i!==(null!==(n=null===(o=e[r])||void 0===o?void 0:o.raw)&&void 0!==n?n:e[r])}))&&r.editPost(t)};function tn(){return{type:"TEAR_DOWN_EDITOR"}}function nn(){return S()("wp.data.dispatch( 'core/editor' ).resetPost",{since:"6.0",version:"6.3",alternative:"Initialize the editor with the setupEditorState action"}),{type:"DO_NOTHING"}}function on(){return S()("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function rn(e){return{type:"SETUP_EDITOR_STATE",post:e}}const sn=(e,t)=>n=>{let{select:o,registry:r}=n;const{id:i,type:s}=o.getCurrentPost();r.dispatch(c.store).editEntityRecord("postType",s,i,e,t)},an=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async t=>{let{select:n,dispatch:o,registry:r}=t;if(!n.isEditedPostSaveable())return;const i=n.getEditedPostContent();e.isAutosave||o.editPost({content:i},{undoIgnore:!0});const s=n.getCurrentPost(),a={id:s.id,...r.select(c.store).getEntityRecordNonTransientEdits("postType",s.type,s.id),content:i};o({type:"REQUEST_POST_UPDATE_START",options:e}),await r.dispatch(c.store).saveEntityRecord("postType",s.type,a,e),o({type:"REQUEST_POST_UPDATE_FINISH",options:e});const l=r.select(c.store).getLastEntitySaveError("postType",s.type,s.id);if(l){const e=Jt({post:s,edits:a,error:l});e.length&&r.dispatch(Kt.store).createErrorNotice(...e)}else{const t=n.getCurrentPost(),o=Zt({previousPost:s,post:t,postType:await r.resolveSelect(c.store).getPostType(t.type),options:e});o.length&&r.dispatch(Kt.store).createSuccessNotice(...o),e.isAutosave||r.dispatch(p.store).__unstableMarkLastChangeAsPersistent()}}};function ln(){return S()("wp.data.dispatch( 'core/editor' ).refreshPost",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}const cn=()=>async e=>{let{select:t,dispatch:n,registry:o}=e;const r=t.getCurrentPostType(),i=await o.resolveSelect(c.store).getPostType(r);o.dispatch(Kt.store).removeNotice(B);const{rest_base:s,rest_namespace:a="wp/v2"}=i;n({type:"REQUEST_POST_DELETE_START"});try{const e=t.getCurrentPost();await Gt()({path:`/${a}/${s}/${e.id}`,method:"DELETE"}),await n.savePost()}catch(e){o.dispatch(Kt.store).createErrorNotice(...(l={error:e},[l.error.message&&"unknown_error"!==l.error.code?l.error.message:(0,Xt.__)("Trashing failed"),{id:B}]))}var l;n({type:"REQUEST_POST_DELETE_FINISH"})},un=function(){let{local:e=!1,...t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async n=>{let{select:o,dispatch:r}=n;if(e){const e=o.getCurrentPost(),t=o.isEditedPostNew(),n=o.getEditedPostAttribute("title"),r=o.getEditedPostAttribute("content"),i=o.getEditedPostAttribute("excerpt");qt(e.id,t,n,r,i)}else await r.savePost({isAutosave:!0,...t})}},dn=()=>e=>{let{registry:t}=e;t.dispatch(c.store).redo()},pn=()=>e=>{let{registry:t}=e;t.dispatch(c.store).undo()};function mn(){return S()("wp.data.dispatch( 'core/editor' ).createUndoLevel",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function hn(e){return{type:"UPDATE_POST_LOCK",lock:e}}const gn=()=>e=>{let{registry:t}=e;t.dispatch(C.store).set("core/edit-post","isPublishSidebarEnabled",!0)},fn=()=>e=>{let{registry:t}=e;t.dispatch(C.store).set("core/edit-post","isPublishSidebarEnabled",!1)};function vn(e){return{type:"LOCK_POST_SAVING",lockName:e}}function _n(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function yn(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function bn(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}const En=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{select:o,dispatch:r,registry:i}=n;const{__unstableShouldCreateUndoLevel:s,selection:l}=t,u={blocks:e,selection:l};if(!1!==s){const{id:e,type:t}=o.getCurrentPost();if(i.select(c.store).getEditedEntityRecord("postType",t,e).blocks===u.blocks)return void i.dispatch(c.store).__unstableCreateUndoLevel("postType",t,e);u.content=e=>{let{blocks:t=[]}=e;return(0,a.__unstableSerializeAndClean)(t)}}r.editPost(u)}};function wn(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const Sn=e=>function(){for(var t=arguments.length,n=new Array(t),o=0;o{let{registry:o}=t;S()("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`",version:"6.2"}),o.dispatch(p.store)[e](...n)}},Pn=Sn("resetBlocks"),kn=Sn("receiveBlocks"),Cn=Sn("updateBlock"),Tn=Sn("updateBlockAttributes"),xn=Sn("selectBlock"),Bn=Sn("startMultiSelect"),An=Sn("stopMultiSelect"),In=Sn("multiSelect"),Nn=Sn("clearSelectedBlock"),Dn=Sn("toggleSelection"),Rn=Sn("replaceBlocks"),Ln=Sn("replaceBlock"),On=Sn("moveBlocksDown"),Un=Sn("moveBlocksUp"),Mn=Sn("moveBlockToPosition"),Fn=Sn("insertBlock"),zn=Sn("insertBlocks"),Hn=Sn("showInsertionPoint"),Vn=Sn("hideInsertionPoint"),Wn=Sn("setTemplateValidity"),jn=Sn("synchronizeTemplate"),$n=Sn("mergeBlocks"),Gn=Sn("removeBlocks"),Kn=Sn("removeBlock"),Yn=Sn("toggleBlockMode"),qn=Sn("startTyping"),Qn=Sn("stopTyping"),Xn=Sn("enterFormattedText"),Zn=Sn("exitFormattedText"),Jn=Sn("insertDefaultBlock"),eo=Sn("updateBlockListSettings"),to={reducer:g,selectors:e,actions:t},no=(0,l.createReduxStore)("core/editor",{...to});(0,l.register)(no);function oo(e){var t;const n=(0,s.mapValues)(Object.fromEntries(Object.entries(null!==(t=e.attributes)&&void 0!==t?t:{}).filter((e=>{let[,{source:t}]=e;return"meta"===t}))),"meta");return(0,s.isEmpty)(n)||(e.edit=(e=>(0,u.createHigherOrderComponent)((t=>n=>{let{attributes:o,setAttributes:a,...u}=n;const d=(0,l.useSelect)((e=>e(no).getCurrentPostType()),[]),[p,m]=(0,c.useEntityProp)("postType",d,"meta"),h=(0,i.useMemo)((()=>({...o,...(0,s.mapValues)(e,(e=>p[e]))})),[o,p]);return(0,i.createElement)(t,r({attributes:h,setAttributes:t=>{const n=Object.fromEntries(Object.entries(null!=t?t:{}).filter((t=>{let[n]=t;return n in e})).map((t=>{let[n,o]=t;return[e[n],o]})));(0,s.isEmpty)(n)||m(n),a(t)}},u))}),"withMetaAttributeSource"))(n)(e.edit)),e}function ro(e){const t=e.avatar_urls&&e.avatar_urls[24]?(0,i.createElement)("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):(0,i.createElement)("span",{className:"editor-autocompleters__no-avatar"});return(0,i.createElement)(i.Fragment,null,t,(0,i.createElement)("span",{className:"editor-autocompleters__user-name"},e.name),(0,i.createElement)("span",{className:"editor-autocompleters__user-slug"},e.slug))}(0,d.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",oo),(0,l.select)(a.store).getBlockTypes().map((e=>{let{name:t}=e;return(0,l.select)(a.store).getBlockType(t)})).forEach(oo);var io={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=(0,l.useSelect)((t=>{const{getUsers:n}=t(c.store);return n({context:"view",search:encodeURIComponent(e)})}),[e]),n=(0,i.useMemo)((()=>t?t.map((e=>({key:`user-${e.slug}`,value:e,label:ro(e)}))):[]),[t]);return[n]},getOptionCompletion(e){return`@${e.slug}`}};(0,d.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.push({...io}),e}));class so extends i.Component{constructor(e){super(e),this.needsAutosave=!(!e.isDirty||!e.isAutosaveable)}componentDidMount(){this.props.disableIntervalChecks||this.setAutosaveTimer()}componentDidUpdate(e){this.props.disableIntervalChecks?this.props.editsReference!==e.editsReference&&this.props.autosave():(this.props.interval!==e.interval&&(clearTimeout(this.timerId),this.setAutosaveTimer()),this.props.isDirty&&(!this.props.isAutosaving||e.isAutosaving)?this.props.editsReference!==e.editsReference&&(this.needsAutosave=!0):this.needsAutosave=!1)}componentWillUnmount(){clearTimeout(this.timerId)}setAutosaveTimer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3*this.props.interval;this.timerId=setTimeout((()=>{this.autosaveTimerHandler()}),e)}autosaveTimerHandler(){this.props.isAutosaveable?(this.needsAutosave&&(this.needsAutosave=!1,this.props.autosave()),this.setAutosaveTimer()):this.setAutosaveTimer(1e3)}render(){return null}}var ao=(0,u.compose)([(0,l.withSelect)(((e,t)=>{const{getReferenceByDistinctEdits:n}=e(c.store),{isEditedPostDirty:o,isEditedPostAutosaveable:r,isAutosavingPost:i,getEditorSettings:s}=e(no),{interval:a=s().autosaveInterval}=t;return{editsReference:n(),isDirty:o(),isAutosaveable:r(),isAutosaving:i(),interval:a}})),(0,l.withDispatch)(((e,t)=>({autosave(){const{autosave:n=e(no).autosave}=t;n()}})))])(so),lo=window.wp.richText,co=n(4403),uo=n.n(co);var po=e=>{let{children:t,isValid:n,level:o,href:r,onSelect:s}=e;return(0,i.createElement)("li",{className:uo()("document-outline__item",`is-${o.toLowerCase()}`,{"is-invalid":!n})},(0,i.createElement)("a",{href:r,className:"document-outline__button",onClick:s},(0,i.createElement)("span",{className:"document-outline__emdash","aria-hidden":"true"}),(0,i.createElement)("strong",{className:"document-outline__level"},o),(0,i.createElement)("span",{className:"document-outline__item-content"},t)))};const mo=(0,i.createElement)("em",null,(0,Xt.__)("(Empty heading)")),ho=[(0,i.createElement)("br",{key:"incorrect-break"}),(0,i.createElement)("em",{key:"incorrect-message"},(0,Xt.__)("(Incorrect heading level)"))],go=[(0,i.createElement)("br",{key:"incorrect-break-h1"}),(0,i.createElement)("em",{key:"incorrect-message-h1"},(0,Xt.__)("(Your theme may already use a H1 for the post title)"))],fo=[(0,i.createElement)("br",{key:"incorrect-break-multiple-h1"}),(0,i.createElement)("em",{key:"incorrect-message-multiple-h1"},(0,Xt.__)("(Multiple H1 headings are not recommended)"))],vo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.flatMap((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"core/heading"===e.name?{...e,level:e.attributes.level,isEmpty:_o(e)}:vo(e.innerBlocks)}))},_o=e=>!e.attributes.content||0===e.attributes.content.length;var yo=(0,u.compose)((0,l.withSelect)((e=>{var t,n;const{getBlocks:o}=e(p.store),{getEditedPostAttribute:r}=e(no),{getPostType:i}=e(c.store),s=i(r("type"));return{title:r("title"),blocks:o(),isTitleSupported:null!==(t=null==s||null===(n=s.supports)||void 0===n?void 0:n.title)&&void 0!==t&&t}})))((e=>{let{blocks:t=[],title:n,onSelect:o,isTitleSupported:r,hasOutlineItemsDisabled:s}=e;const a=vo(t);if(a.length<1)return null;let l=1;const c=document.querySelector(".editor-post-title__input"),u=r&&n&&c,d=a.reduce(((e,t)=>({...e,[t.level]:(e[t.level]||0)+1})),{})[1]>1;return(0,i.createElement)("div",{className:"document-outline"},(0,i.createElement)("ul",null,u&&(0,i.createElement)(po,{level:(0,Xt.__)("Title"),isValid:!0,onSelect:o,href:`#${c.id}`,isDisabled:s},n),a.map(((e,t)=>{const n=e.level>l+1,r=!(e.isEmpty||n||!e.level||1===e.level&&(d||u));return l=e.level,(0,i.createElement)(po,{key:t,level:`H${e.level}`,isValid:r,isDisabled:s,href:`#block-${e.clientId}`,onSelect:o},e.isEmpty?mo:(0,lo.getTextContent)((0,lo.create)({html:e.attributes.content})),n&&ho,1===e.level&&d&&fo,u&&1===e.level&&!d&&go)}))))}));var bo=(0,l.withSelect)((e=>({blocks:e(p.store).getBlocks()})))((function(e){let{blocks:t,children:n}=e;return t.filter((e=>"core/heading"===e.name)).length<1?null:n})),Eo=window.wp.keyboardShortcuts;var wo=function(e){let{resetBlocksOnSave:t}=e;const{resetEditorBlocks:n,savePost:o}=(0,l.useDispatch)(no),{isEditedPostDirty:r,getPostEdits:i,isPostSavingLocked:s}=(0,l.useSelect)(no);return(0,Eo.useShortcut)("core/editor/save",(e=>{if(e.preventDefault(),!s()&&r()){if(t){const e=i();if(e.content&&"string"==typeof e.content){const t=(0,a.parse)(e.content);n(t)}}o()}})),null};var So=function(){const{redo:e,undo:t}=(0,l.useDispatch)(no);return(0,Eo.useShortcut)("core/editor/undo",(e=>{t(),e.preventDefault()})),(0,Eo.useShortcut)("core/editor/redo",(t=>{e(),t.preventDefault()})),(0,i.createElement)(wo,null)};function Po(){return(0,i.createElement)(wo,{resetBlocksOnSave:!0})}var ko=window.wp.keycodes;var Co=function(){const{registerShortcut:e}=(0,l.useDispatch)(Eo.store);return(0,i.useEffect)((()=>{e({name:"core/editor/save",category:"global",description:(0,Xt.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/editor/undo",category:"global",description:(0,Xt.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/editor/redo",category:"global",description:(0,Xt.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,ko.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]})}),[e]),(0,i.createElement)(p.BlockEditorKeyboardShortcuts.Register,null)},To=window.wp.components;var xo=(0,i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(P.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"}));var Bo=(0,i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(P.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"}));var Ao=(0,i.forwardRef)((function(e,t){const n=(0,ko.isAppleOS)()?ko.displayShortcut.primaryShift("z"):ko.displayShortcut.primary("y"),o=(0,l.useSelect)((e=>e(no).hasEditorRedo()),[]),{redo:s}=(0,l.useDispatch)(no);return(0,i.createElement)(To.Button,r({},e,{ref:t,icon:(0,Xt.isRTL)()?Bo:xo,label:(0,Xt.__)("Redo"),shortcut:n,"aria-disabled":!o,onClick:o?s:void 0,className:"editor-history__redo"}))}));var Io=(0,i.forwardRef)((function(e,t){const n=(0,l.useSelect)((e=>e(no).hasEditorUndo()),[]),{undo:o}=(0,l.useDispatch)(no);return(0,i.createElement)(To.Button,r({},e,{ref:t,icon:(0,Xt.isRTL)()?xo:Bo,label:(0,Xt.__)("Undo"),shortcut:ko.displayShortcut.primary("z"),"aria-disabled":!n,onClick:n?o:void 0,className:"editor-history__undo"}))}));var No=(0,u.compose)([(0,l.withSelect)((e=>({isValid:e(p.store).isValidTemplate()}))),(0,l.withDispatch)((e=>{const{setTemplateValidity:t,synchronizeTemplate:n}=e(p.store);return{resetTemplateValidity:()=>t(!0),synchronizeTemplate:n}}))])((function(e){let{isValid:t,...n}=e;return t?null:(0,i.createElement)(To.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:(0,Xt.__)("Keep it as is"),onClick:n.resetTemplateValidity},{label:(0,Xt.__)("Reset the template"),onClick:()=>{window.confirm((0,Xt.__)("Resetting the template may result in loss of content, do you want to continue?"))&&n.synchronizeTemplate()}}]},(0,Xt.__)("The content of your post doesn’t match the template assigned to your post type."))}));var Do=(0,u.compose)([(0,l.withSelect)((e=>({notices:e(Kt.store).getNotices()}))),(0,l.withDispatch)((e=>({onRemove:e(Kt.store).removeNotice})))])((function(e){let{notices:t,onRemove:n}=e;const o=t.filter((e=>{let{isDismissible:t,type:n}=e;return t&&"default"===n})),r=t.filter((e=>{let{isDismissible:t,type:n}=e;return!t&&"default"===n}));return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.NoticeList,{notices:r,className:"components-editor-notices__pinned"}),(0,i.createElement)(To.NoticeList,{notices:o,className:"components-editor-notices__dismissible",onRemove:n},(0,i.createElement)(No,null)))}));function Ro(){const e=(0,l.useSelect)((e=>e(Kt.store).getNotices()),[]),{removeNotice:t}=(0,l.useDispatch)(Kt.store),n=e.filter((e=>{let{type:t}=e;return"snackbar"===t}));return(0,i.createElement)(To.SnackbarList,{notices:n,className:"components-editor-notices__snackbar",onRemove:t})}var Lo=window.wp.htmlEntities;function Oo(e){let{record:t,checked:n,onChange:o,closePanel:r}=e;const{name:s,kind:a,title:u,key:d}=t,m=(0,l.useSelect)((e=>{var t;const{blocks:n=[]}=e(c.store).getEditedEntityRecord(a,s,d),o=e(p.store).getBlockParents(null===(t=n[0])||void 0===t?void 0:t.clientId);return o[o.length-1]}),[]),h=(0,l.useSelect)((e=>{if("postType"!==a||"wp_template"!==s)return u;const t=e(c.store).getEditedEntityRecord(a,s,d);return e(no).__experimentalGetTemplateInfo(t).title}),[s,a,u,d]),g=(0,l.useSelect)((e=>e(p.store).getSelectedBlockClientId()===m),[m]),f=g?(0,Xt.__)("Selected"):(0,Xt.__)("Select"),{selectBlock:v}=(0,l.useDispatch)(p.store),_=(0,i.useCallback)((()=>v(m)),[m]),y=(0,i.useCallback)((()=>{v(m),r()}),[m]);return(0,i.createElement)(To.PanelRow,null,(0,i.createElement)(To.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,i.createElement)("strong",null,(0,Lo.decodeEntities)(h)||(0,Xt.__)("Untitled")),checked:n,onChange:o}),m?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.Button,{onClick:_,className:"entities-saved-states__find-entity",disabled:g},f),(0,i.createElement)(To.Button,{onClick:y,className:"entities-saved-states__find-entity-small",disabled:g},f)):null)}function Uo(e){let{list:t,unselectedEntities:n,setUnselectedEntities:o,closePanel:r}=e;const s=t.length,a=t[0],u=(0,l.useSelect)((e=>e(c.store).getEntityConfig(a.kind,a.name)),[a.kind,a.name]),{name:d}=a;let p=u.label;"wp_template_part"===d&&(p=1===s?(0,Xt.__)("Template Part"):(0,Xt.__)("Template Parts"));const m=function(e,t){switch(e){case"site":return 1===t?(0,Xt.__)("This change will affect your whole site."):(0,Xt.__)("These changes will affect your whole site.");case"wp_template":return(0,Xt.__)("This change will affect pages and posts that use this template.");case"page":case"post":return(0,Xt.__)("The following content has been modified.")}}(d,s);return(0,i.createElement)(To.PanelBody,{title:p,initialOpen:!0},m&&(0,i.createElement)(To.PanelRow,null,m),t.map((e=>(0,i.createElement)(Oo,{key:e.key||e.property,record:e,checked:!n.some((t=>t.kind===e.kind&&t.name===e.name&&t.key===e.key&&t.property===e.property)),onChange:t=>o(e,t),closePanel:r}))))}const Mo={title:(0,Xt.__)("Title"),description:(0,Xt.__)("Tagline"),site_logo:(0,Xt.__)("Logo"),site_icon:(0,Xt.__)("Icon"),show_on_front:(0,Xt.__)("Show on front"),page_on_front:(0,Xt.__)("Page on front")},Fo=[{kind:"postType",name:"wp_navigation"}];function zo(e){let{close:t}=e;const n=(0,i.useRef)(),{dirtyEntityRecords:o}=(0,l.useSelect)((e=>{const t=e(c.store).__experimentalGetDirtyEntityRecords().filter((e=>!("root"===e.kind&&"site"===e.name))),n=e(c.store).getEntityRecordEdits("root","site"),o=[];for(const e in n)o.push({kind:"root",name:"site",title:Mo[e]||e,property:e});return{dirtyEntityRecords:[...t,...o]}}),[]),{editEntityRecord:a,saveEditedEntityRecord:d,__experimentalSaveSpecifiedEntityEdits:m}=(0,l.useDispatch)(c.store),{__unstableMarkLastChangeAsPersistent:h}=(0,l.useDispatch)(p.store),{createSuccessNotice:g,createErrorNotice:f}=(0,l.useDispatch)(Kt.store),v=(0,s.groupBy)(o,"name"),{site:_,wp_template:y,wp_template_part:b,...E}=v,w=[_,y,b,...Object.values(E)].filter(Array.isArray),[S,P]=(0,i.useState)([]),k=(e,t)=>{let{kind:n,name:o,key:r,property:i}=e;P(t?S.filter((e=>e.kind!==n||e.name!==o||e.key!==r||e.property!==i)):[...S,{kind:n,name:o,key:r,property:i}])},C=(0,i.useCallback)((()=>t()),[t]),[T,x]=(0,u.__experimentalUseDialog)({onClose:()=>C()});return(0,i.createElement)("div",r({ref:T},x,{className:"entities-saved-states__panel"}),(0,i.createElement)(To.Flex,{className:"entities-saved-states__panel-header",gap:2},(0,i.createElement)(To.FlexItem,{isBlock:!0,as:To.Button,ref:n,variant:"primary",disabled:o.length-S.length==0,onClick:()=>{const e=o.filter((e=>{let{kind:t,name:n,key:o,property:r}=e;return!S.some((e=>e.kind===t&&e.name===n&&e.key===o&&e.property===r))}));t(e);const n=[],r=[];e.forEach((e=>{let{kind:t,name:o,key:i,property:s}=e;"root"===t&&"site"===o?n.push(s):(Fo.some((e=>e.kind===t&&e.name===o))&&a(t,o,i,{status:"publish"}),r.push(d(t,o,i)))})),n.length&&r.push(m("root","site",void 0,n)),h(),Promise.all(r).then((e=>{e.some((e=>void 0===e))?f((0,Xt.__)("Saving failed.")):g((0,Xt.__)("Site updated."),{type:"snackbar"})})).catch((e=>f(`${(0,Xt.__)("Saving failed.")} ${e}`)))},className:"editor-entities-saved-states__save-button"},(0,Xt.__)("Save")),(0,i.createElement)(To.FlexItem,{isBlock:!0,as:To.Button,variant:"secondary",onClick:C},(0,Xt.__)("Cancel"))),(0,i.createElement)("div",{className:"entities-saved-states__text-prompt"},(0,i.createElement)("strong",null,(0,Xt.__)("Are you ready to save?")),(0,i.createElement)("p",null,(0,Xt.__)("The following changes have been made to your site, templates, and content."))),w.map((e=>(0,i.createElement)(Uo,{key:e[0].name,list:e,closePanel:C,unselectedEntities:S,setUnselectedEntities:k}))))}function Ho(){try{return(0,l.select)(no).getEditedPostContent()}catch(e){}}function Vo(e){let{text:t,children:n}=e;const o=(0,u.useCopyToClipboard)(t);return(0,i.createElement)(To.Button,{variant:"secondary",ref:o},n)}class Wo extends i.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,d.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){const{error:e}=this.state;if(!e)return this.props.children;const t=[(0,i.createElement)(Vo,{key:"copy-post",text:Ho},(0,Xt.__)("Copy Post Text")),(0,i.createElement)(Vo,{key:"copy-error",text:e.stack},(0,Xt.__)("Copy Error"))];return(0,i.createElement)(p.Warning,{className:"editor-error-boundary",actions:t},(0,Xt.__)("The editor has encountered an unexpected error."))}}var jo=Wo;const $o=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame;let Go;function Ko(){const{postId:e,isEditedPostNew:t,hasRemoteAutosave:n}=(0,l.useSelect)((e=>({postId:e(no).getCurrentPostId(),isEditedPostNew:e(no).isEditedPostNew(),hasRemoteAutosave:!!e(no).getEditorSettings().autosave})),[]),{getEditedPostAttribute:o}=(0,l.useSelect)(no),{createWarningNotice:r,removeNotice:s}=(0,l.useDispatch)(Kt.store),{editPost:c,resetEditorBlocks:u}=(0,l.useDispatch)(no);(0,i.useEffect)((()=>{let i=function(e,t){return window.sessionStorage.getItem(Yt(e,t))}(e,t);if(!i)return;try{i=JSON.parse(i)}catch{return}const{post_title:l,content:d,excerpt:p}=i,m={title:l,content:d,excerpt:p};if(!Object.keys(m).some((e=>m[e]!==o(e))))return void Qt(e,t);if(n)return;const h="wpEditorAutosaveRestore";r((0,Xt.__)("The backup of this post in your browser is different from the version below."),{id:h,actions:[{label:(0,Xt.__)("Restore the backup"),onClick(){const{content:e,...t}=m;c(t),u((0,a.parse)(m.content)),s(h)}}]})}),[t,e])}var Yo=(0,u.ifCondition)((()=>{if(void 0!==Go)return Go;try{window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),Go=!0}catch{Go=!1}return Go}))((function(){const{autosave:e}=(0,l.useDispatch)(no),t=(0,i.useCallback)((()=>{$o((()=>e({local:!0})))}),[]);Ko(),function(){const{postId:e,isEditedPostNew:t,isDirty:n,isAutosaving:o,didError:r}=(0,l.useSelect)((e=>({postId:e(no).getCurrentPostId(),isEditedPostNew:e(no).isEditedPostNew(),isDirty:e(no).isEditedPostDirty(),isAutosaving:e(no).isAutosavingPost(),didError:e(no).didPostSaveRequestFail()})),[]),s=(0,i.useRef)(n),a=(0,i.useRef)(o);(0,i.useEffect)((()=>{!r&&(a.current&&!o||s.current&&!n)&&Qt(e,t),s.current=n,a.current=o}),[n,o,r]);const c=(0,u.usePrevious)(t),d=(0,u.usePrevious)(e);(0,i.useEffect)((()=>{d===e&&c&&!t&&Qt(e,!0)}),[t,e])}();const n=(0,l.useSelect)((e=>e(no).getEditorSettings().localAutosaveInterval),[]);return(0,i.createElement)(ao,{interval:n,autosave:t})}));var qo=function(e){let{children:t}=e;const n=(0,l.useSelect)((e=>{const{getEditedPostAttribute:t}=e(no),{getPostType:n}=e(c.store);return n(t("type"))}),[]);return(0,s.get)(n,["supports","page-attributes"],!1)?t:null};var Qo=(0,l.withSelect)((e=>{const{getEditedPostAttribute:t}=e(no),{getPostType:n}=e(c.store);return{postType:n(t("type"))}}))((function(e){let{postType:t,children:n,supportKeys:o}=e,r=!0;return t&&(r=(Array.isArray(o)?o:[o]).some((e=>!!t.supports[e]))),r?n:null}));const Xo=e=>{let{onUpdateOrder:t,order:n=0}=e;const[o,r]=(0,i.useState)(null),s=null===o?n:o;return(0,i.createElement)(To.TextControl,{className:"editor-page-attributes__order",type:"number",label:(0,Xt.__)("Order"),value:s,onChange:e=>{var n;r(e);const o=Number(e);Number.isInteger(o)&&""!==(null===(n=e.trim)||void 0===n?void 0:n.call(e))&&t(Number(e))},size:6,onBlur:()=>{r(null)}})};var Zo=(0,u.compose)([(0,l.withSelect)((e=>({order:e(no).getEditedPostAttribute("menu_order")}))),(0,l.withDispatch)((e=>({onUpdateOrder(t){e(no).editPost({menu_order:t})}})))])((function(e){return(0,i.createElement)(Qo,{supportKeys:"page-attributes"},(0,i.createElement)(Xo,e))})),Jo=n(4793),er=n.n(Jo);function tr(e){const t=e.map((e=>({children:[],parent:null,...e}))),n=(0,s.groupBy)(t,"parent");if(n.null&&n.null.length)return t;const o=e=>e.map((e=>{const t=n[e.id];return{...e,children:t&&t.length?o(t):[]}}));return o(n[0]||[])}const nr=e=>(0,Lo.decodeEntities)(e),or=e=>({...e,name:nr(e.name)});function rr(e){var t;return null!=e&&null!==(t=e.title)&&void 0!==t&&t.rendered?(0,Lo.decodeEntities)(e.title.rendered):`#${e.id} (${(0,Xt.__)("no title")})`}const ir=(e,t)=>{const n=er()(e||"").toLowerCase(),o=er()(t||"").toLowerCase();return n===o?0:n.startsWith(o)?n.length:1/0};var sr=function(){const{editPost:e}=(0,l.useDispatch)(no),[t,n]=(0,i.useState)(!1),{parentPost:o,parentPostId:r,items:a,postType:d}=(0,l.useSelect)((e=>{const{getPostType:n,getEntityRecords:o,getEntityRecord:r}=e(c.store),{getCurrentPostId:i,getEditedPostAttribute:a}=e(no),l=a("type"),u=a("parent"),d=n(l),p=i(),m=(0,s.get)(d,["hierarchical"],!1),h={per_page:100,exclude:p,parent_exclude:p,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};return t&&(h.search=t),{parentPostId:u,parentPost:u?r("postType",l,u):null,items:m?o("postType",l,h):[],postType:d}}),[t]),p=(0,s.get)(d,["hierarchical"],!1),m=(0,s.get)(d,["labels","parent_item_colon"]),h=a||[],g=(0,i.useMemo)((()=>{const e=function(n){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=n.map((t=>[{value:t.id,label:"— ".repeat(o)+(0,Lo.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],o+1)])),i=r.sort(((e,n)=>{let[o]=e,[r]=n;return ir(o.rawName,t)>=ir(r.rawName,t)?1:-1}));return i.flat()};let n=h.map((e=>({id:e.id,parent:e.parent,name:rr(e)})));t||(n=tr(n));const i=e(n),s=i.find((e=>e.value===r));return o&&!s&&i.unshift({value:r,label:rr(o)}),i}),[h,t]);return p&&m?(0,i.createElement)(To.ComboboxControl,{__nextHasNoMarginBottom:!0,className:"editor-page-attributes__parent",label:m,value:r,options:g,onFilterValueChange:(0,u.debounce)((e=>{n(e)}),300),onChange:t=>{e({parent:t})}}):null};var ar=function(){const{availableTemplates:e,selectedTemplate:t,isViewable:n}=(0,l.useSelect)((e=>{var t,n;const{getEditedPostAttribute:o,getEditorSettings:r,getCurrentPostType:i}=e(no),{getPostType:s}=e(c.store);return{selectedTemplate:o("template"),availableTemplates:r().availableTemplates,isViewable:null!==(t=null===(n=s(i()))||void 0===n?void 0:n.viewable)&&void 0!==t&&t}}),[]),{editPost:o}=(0,l.useDispatch)(no);return!n||(0,s.isEmpty)(e)?null:(0,i.createElement)(To.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Template:"),value:t,onChange:e=>{o({template:e||""})},options:Object.entries(null!=e?e:{}).map((e=>{let[t,n]=e;return{value:t,label:n}}))})};const lr={who:"authors",per_page:50,_fields:"id,name",context:"view"};var cr=function(){const[e,t]=(0,i.useState)(),{authorId:n,isLoading:o,authors:r,postAuthor:s}=(0,l.useSelect)((t=>{const{getUser:n,getUsers:o,isResolving:r}=t(c.store),{getEditedPostAttribute:i}=t(no),s=n(i("author"),{context:"view"}),a={...lr};return e&&(a.search=e),{authorId:i("author"),postAuthor:s,authors:o(a),isLoading:r("core","getUsers",[a])}}),[e]),{editPost:a}=(0,l.useDispatch)(no),d=(0,i.useMemo)((()=>{const e=(null!=r?r:[]).map((e=>({value:e.id,label:(0,Lo.decodeEntities)(e.name)})));return e.findIndex((e=>{let{value:t}=e;return(null==s?void 0:s.id)===t}))<0&&s?[{value:s.id,label:(0,Lo.decodeEntities)(s.name)},...e]:e}),[r,s]);return s?(0,i.createElement)(To.ComboboxControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Author"),options:d,value:n,onFilterValueChange:(0,u.debounce)((e=>{t(e)}),300),onChange:e=>{e&&a({author:e})},isLoading:o,allowReset:!1}):null};var ur=function(){const{editPost:e}=(0,l.useDispatch)(no),{postAuthor:t,authors:n}=(0,l.useSelect)((e=>({postAuthor:e(no).getEditedPostAttribute("author"),authors:e(c.store).getUsers(lr)})),[]),o=(0,i.useMemo)((()=>(null!=n?n:[]).map((e=>({value:e.id,label:(0,Lo.decodeEntities)(e.name)})))),[n]);return(0,i.createElement)(To.SelectControl,{__nextHasNoMarginBottom:!0,className:"post-author-selector",label:(0,Xt.__)("Author"),options:o,onChange:t=>{const n=Number(t);e({author:n})},value:t})};var dr=function(){return(0,l.useSelect)((e=>{const t=e(c.store).getUsers(lr);return(null==t?void 0:t.length)>=25}),[])?(0,i.createElement)(cr,null):(0,i.createElement)(ur,null)};function pr(e){let{children:t}=e;const{hasAssignAuthorAction:n,hasAuthors:o}=(0,l.useSelect)((e=>{const t=e(no).getCurrentPost(),n=e(c.store).getUsers(lr);return{hasAssignAuthorAction:(0,s.get)(t,["_links","wp:action-assign-author"],!1),hasAuthors:(null==n?void 0:n.length)>=1}}),[]);return n&&o?(0,i.createElement)(Qo,{supportKeys:"author"},t):null}var mr=(0,u.compose)([(0,l.withSelect)((e=>({commentStatus:e(no).getEditedPostAttribute("comment_status")}))),(0,l.withDispatch)((e=>({editPost:e(no).editPost})))])((function(e){let{commentStatus:t="open",...n}=e;return(0,i.createElement)(To.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Allow comments"),checked:"open"===t,onChange:()=>n.editPost({comment_status:"open"===t?"closed":"open"})})}));var hr=(0,u.compose)([(0,l.withSelect)((e=>({excerpt:e(no).getEditedPostAttribute("excerpt")}))),(0,l.withDispatch)((e=>({onUpdateExcerpt(t){e(no).editPost({excerpt:t})}})))])((function(e){let{excerpt:t,onUpdateExcerpt:n}=e;return(0,i.createElement)("div",{className:"editor-post-excerpt"},(0,i.createElement)(To.TextareaControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Write an excerpt (optional)"),className:"editor-post-excerpt__textarea",onChange:e=>n(e),value:t}),(0,i.createElement)(To.ExternalLink,{href:(0,Xt.__)("https://wordpress.org/support/article/settings-sidebar/#excerpt")},(0,Xt.__)("Learn more about manual excerpts")))}));var gr=function(e){return(0,i.createElement)(Qo,r({},e,{supportKeys:"excerpt"}))},fr=window.wp.blob;var vr=(0,l.withSelect)((e=>{const{getThemeSupports:t}=e(c.store),{getEditedPostAttribute:n}=e(no);return{postType:n("type"),themeSupports:t()}}))((function(e){let{themeSupports:t,children:n,postType:o,supportKeys:r}=e;return(Array.isArray(r)?r:[r]).some((e=>{const n=(0,s.get)(t,[e],!1);return"post-thumbnails"===e&&Array.isArray(n)?n.includes(o):n}))?n:null}));var _r=function(e){return(0,i.createElement)(vr,{supportKeys:"post-thumbnails"},(0,i.createElement)(Qo,r({},e,{supportKeys:"thumbnail"})))};const yr=["image"],br=(0,Xt.__)("Featured image"),Er=(0,Xt.__)("Set featured image"),wr=(0,Xt.__)("Remove image"),Sr=(0,i.createElement)("p",null,(0,Xt.__)("To edit the featured image, you need permission to upload media."));const Pr=(0,l.withSelect)((e=>{const{getMedia:t,getPostType:n}=e(c.store),{getCurrentPostId:o,getEditedPostAttribute:r}=e(no),i=r("featured_media");return{media:i?t(i,{context:"view"}):null,currentPostId:o(),postType:n(r("type")),featuredImageId:i}})),kr=(0,l.withDispatch)(((e,t,n)=>{let{noticeOperations:o}=t,{select:r}=n;const{editPost:i}=e(no);return{onUpdateImage(e){i({featured_media:e.id})},onDropImage(e){r(p.store).getSettings().mediaUpload({allowedTypes:["image"],filesList:e,onFileChange(e){let[t]=e;i({featured_media:t.id})},onError(e){o.removeAllNotices(),o.createErrorNotice(e)}})},onRemoveImage(){i({featured_media:0})}}}));var Cr=(0,u.compose)(To.withNotices,Pr,kr,(0,To.withFilters)("editor.PostFeaturedImage"))((function(e){var t,n;let{currentPostId:o,featuredImageId:r,onUpdateImage:a,onRemoveImage:c,media:u,postType:m,noticeUI:h,noticeOperations:g}=e;const[f,v]=(0,i.useState)(!1),_=(0,l.useSelect)((e=>e(p.store).getSettings().mediaUpload),[]),y=(0,s.get)(m,["labels"],{}),{mediaWidth:b,mediaHeight:E,mediaSourceUrl:w}=function(e,t){var n,o,r,i;if(!e)return{};const s=(0,d.applyFilters)("editor.PostFeaturedImage.imageSize","large",e.id,t);if(s in(null!==(n=null==e||null===(o=e.media_details)||void 0===o?void 0:o.sizes)&&void 0!==n?n:{}))return{mediaWidth:e.media_details.sizes[s].width,mediaHeight:e.media_details.sizes[s].height,mediaSourceUrl:e.media_details.sizes[s].source_url};const a=(0,d.applyFilters)("editor.PostFeaturedImage.imageSize","thumbnail",e.id,t);return a in(null!==(r=null==e||null===(i=e.media_details)||void 0===i?void 0:i.sizes)&&void 0!==r?r:{})?{mediaWidth:e.media_details.sizes[a].width,mediaHeight:e.media_details.sizes[a].height,mediaSourceUrl:e.media_details.sizes[a].source_url}:{mediaWidth:e.media_details.width,mediaHeight:e.media_details.height,mediaSourceUrl:e.source_url}}(u,o);function S(e){_({allowedTypes:["image"],filesList:e,onFileChange(e){let[t]=e;(0,fr.isBlobURL)(null==t?void 0:t.url)?v(!0):(a(t),v(!1))},onError(e){g.removeAllNotices(),g.createErrorNotice(e)}})}return(0,i.createElement)(_r,null,h,(0,i.createElement)("div",{className:"editor-post-featured-image"},u&&(0,i.createElement)("div",{id:`editor-post-featured-image-${r}-describedby`,className:"hidden"},u.alt_text&&(0,Xt.sprintf)((0,Xt.__)("Current image: %s"),u.alt_text),!u.alt_text&&(0,Xt.sprintf)((0,Xt.__)("The current image has no alternative text. The file name is: %s"),(null===(t=u.media_details.sizes)||void 0===t||null===(n=t.full)||void 0===n?void 0:n.file)||u.slug)),(0,i.createElement)(p.MediaUploadCheck,{fallback:Sr},(0,i.createElement)(p.MediaUpload,{title:y.featured_image||br,onSelect:a,unstableFeaturedImageFlow:!0,allowedTypes:yr,modalClass:"editor-post-featured-image__media-modal",render:e=>{let{open:t}=e;return(0,i.createElement)("div",{className:"editor-post-featured-image__container"},(0,i.createElement)(To.Button,{className:r?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:t,"aria-label":r?(0,Xt.__)("Edit or update the image"):null,"aria-describedby":r?`editor-post-featured-image-${r}-describedby`:null},!!r&&u&&(0,i.createElement)(To.ResponsiveWrapper,{naturalWidth:b,naturalHeight:E,isInline:!0},(0,i.createElement)("img",{src:w,alt:""})),f&&(0,i.createElement)(To.Spinner,null),!r&&!f&&(y.set_featured_image||Er)),(0,i.createElement)(To.DropZone,{onFilesDrop:S}))},value:r})),!!r&&(0,i.createElement)(p.MediaUploadCheck,null,u&&(0,i.createElement)(p.MediaUpload,{title:y.featured_image||br,onSelect:a,unstableFeaturedImageFlow:!0,allowedTypes:yr,modalClass:"editor-post-featured-image__media-modal",render:e=>{let{open:t}=e;return(0,i.createElement)(To.Button,{onClick:t,variant:"secondary"},(0,Xt.__)("Replace Image"))}}),(0,i.createElement)(To.Button,{onClick:c,variant:"link",isDestructive:!0},y.remove_featured_image||wr))))}));var Tr=(0,l.withSelect)((e=>({disablePostFormats:e(no).getEditorSettings().disablePostFormats})))((function(e){let{disablePostFormats:t,...n}=e;return!t&&(0,i.createElement)(Qo,r({},n,{supportKeys:"post-formats"}))}));const xr=[{id:"aside",caption:(0,Xt.__)("Aside")},{id:"audio",caption:(0,Xt.__)("Audio")},{id:"chat",caption:(0,Xt.__)("Chat")},{id:"gallery",caption:(0,Xt.__)("Gallery")},{id:"image",caption:(0,Xt.__)("Image")},{id:"link",caption:(0,Xt.__)("Link")},{id:"quote",caption:(0,Xt.__)("Quote")},{id:"standard",caption:(0,Xt.__)("Standard")},{id:"status",caption:(0,Xt.__)("Status")},{id:"video",caption:(0,Xt.__)("Video")}].sort(((e,t)=>{const n=e.caption.toUpperCase(),o=t.caption.toUpperCase();return no?1:0}));function Br(){const e=`post-format-selector-${(0,u.useInstanceId)(Br)}`,{postFormat:t,suggestedFormat:n,supportedFormats:o}=(0,l.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:n}=e(no),o=t("format"),r=e(c.store).getThemeSupports();return{postFormat:null!=o?o:"standard",suggestedFormat:n(),supportedFormats:r.formats}}),[]),r=xr.filter((e=>(null==o?void 0:o.includes(e.id))||t===e.id)),s=r.find((e=>e.id===n)),{editPost:a}=(0,l.useDispatch)(no),d=e=>a({format:e});return(0,i.createElement)(Tr,null,(0,i.createElement)("div",{className:"editor-post-format"},(0,i.createElement)(To.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Post Format"),value:t,onChange:e=>d(e),id:e,options:r.map((e=>({label:e.caption,value:e.id})))}),s&&s.id!==t&&(0,i.createElement)("p",{className:"editor-post-format__suggestion"},(0,i.createElement)(To.Button,{variant:"link",onClick:()=>d(s.id)},(0,Xt.sprintf)((0,Xt.__)("Apply suggested format: %s"),s.caption)))))}var Ar=(0,i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(P.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"}));var Ir=(0,l.withSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(no);return{lastRevisionId:t(),revisionsCount:n()}}))((function(e){let{lastRevisionId:t,revisionsCount:n,children:o}=e;return!t||n<2?null:(0,i.createElement)(Qo,{supportKeys:"revisions"},o)}));var Nr=(0,l.withSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(no);return{lastRevisionId:t(),revisionsCount:n()}}))((function(e){let{lastRevisionId:t,revisionsCount:n}=e;return(0,i.createElement)(Ir,null,(0,i.createElement)(To.Button,{href:(0,E.addQueryArgs)("revision.php",{revision:t,gutenberg:!0}),className:"editor-post-last-revision__title",icon:Ar},(0,Xt.sprintf)((0,Xt._n)("%d Revision","%d Revisions",n),n)))}));function Dr(){const e="core/editor/post-locked-modal-"+(0,u.useInstanceId)(Dr),{autosave:t,updatePostLock:n}=(0,l.useDispatch)(no),{isLocked:o,isTakeover:r,user:a,postId:p,postLockUtils:m,activePostLock:h,postType:g,previewLink:f}=(0,l.useSelect)((e=>{const{isPostLocked:t,isPostLockTakeover:n,getPostLockUser:o,getCurrentPostId:r,getActivePostLock:i,getEditedPostAttribute:s,getEditedPostPreviewLink:a,getEditorSettings:l}=e(no),{getPostType:u}=e(c.store);return{isLocked:t(),isTakeover:n(),user:o(),postId:r(),postLockUtils:l().postLockUtils,activePostLock:i(),postType:u(s("type")),previewLink:a()}}),[]);if((0,i.useEffect)((()=>{function r(){if(o||!h)return;const e=new window.FormData;if(e.append("action","wp-remove-post-lock"),e.append("_wpnonce",m.unlockNonce),e.append("post_ID",p),e.append("active_post_lock",h),window.navigator.sendBeacon)window.navigator.sendBeacon(m.ajaxUrl,e);else{const t=new window.XMLHttpRequest;t.open("POST",m.ajaxUrl,!1),t.send(e)}}return(0,d.addAction)("heartbeat.send",e,(function(e){o||(e["wp-refresh-post-lock"]={lock:h,post_id:p})})),(0,d.addAction)("heartbeat.tick",e,(function(e){if(!e["wp-refresh-post-lock"])return;const o=e["wp-refresh-post-lock"];o.lock_error?(t(),n({isLocked:!0,isTakeover:!0,user:{name:o.lock_error.name,avatar:o.lock_error.avatar_src_2x}})):o.new_lock&&n({isLocked:!1,activePostLock:o.new_lock})})),window.addEventListener("beforeunload",r),()=>{(0,d.removeAction)("heartbeat.send",e),(0,d.removeAction)("heartbeat.tick",e),window.removeEventListener("beforeunload",r)}}),[]),!o)return null;const v=a.name,_=a.avatar,y=(0,E.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:p,action:"edit",_wpnonce:m.nonce}),b=(0,E.addQueryArgs)("edit.php",{post_type:(0,s.get)(g,["slug"])}),w=(0,Xt.__)("Exit editor");return(0,i.createElement)(To.Modal,{title:r?(0,Xt.__)("Someone else has taken over this post"):(0,Xt.__)("This post is already being edited"),focusOnMount:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,className:"editor-post-locked-modal"},!!_&&(0,i.createElement)("img",{src:_,alt:(0,Xt.__)("Avatar"),className:"editor-post-locked-modal__avatar",width:64,height:64}),(0,i.createElement)("div",null,!!r&&(0,i.createElement)("p",null,(0,i.createInterpolateElement)(v?(0,Xt.sprintf)((0,Xt.__)("%s now has editing control of this post (). Don’t worry, your changes up to this moment have been saved."),v):(0,Xt.__)("Another user now has editing control of this post (). Don’t worry, your changes up to this moment have been saved."),{strong:(0,i.createElement)("strong",null),PreviewLink:(0,i.createElement)(To.ExternalLink,{href:f},(0,Xt.__)("preview"))})),!r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("p",null,(0,i.createInterpolateElement)(v?(0,Xt.sprintf)((0,Xt.__)("%s is currently working on this post (), which means you cannot make changes, unless you take over."),v):(0,Xt.__)("Another user is currently working on this post (), which means you cannot make changes, unless you take over."),{strong:(0,i.createElement)("strong",null),PreviewLink:(0,i.createElement)(To.ExternalLink,{href:f},(0,Xt.__)("preview"))})),(0,i.createElement)("p",null,(0,Xt.__)("If you take over, the other user will lose editing control to the post, but their changes will be saved."))),(0,i.createElement)(To.Flex,{className:"editor-post-locked-modal__buttons",justify:"flex-end",expanded:!1},!r&&(0,i.createElement)(To.FlexItem,null,(0,i.createElement)(To.Button,{variant:"tertiary",href:y},(0,Xt.__)("Take over"))),(0,i.createElement)(To.FlexItem,null,(0,i.createElement)(To.Button,{variant:"primary",href:b},w)))))}var Rr=(0,u.compose)((0,l.withSelect)((e=>{const{isCurrentPostPublished:t,getCurrentPostType:n,getCurrentPost:o}=e(no);return{hasPublishAction:(0,s.get)(o(),["_links","wp:action-publish"],!1),isPublished:t(),postType:n()}})))((function(e){let{hasPublishAction:t,isPublished:n,children:o}=e;return n||!t?null:o}));var Lr=(0,u.compose)((0,l.withSelect)((e=>({status:e(no).getEditedPostAttribute("status")}))),(0,l.withDispatch)((e=>({onUpdateStatus(t){e(no).editPost({status:t})}}))))((function(e){let{status:t,onUpdateStatus:n}=e;return(0,i.createElement)(Rr,null,(0,i.createElement)(To.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Pending review"),checked:"pending"===t,onChange:()=>{n("pending"===t?"draft":"pending")}}))}));var Or=(0,u.compose)([(0,l.withSelect)((e=>({pingStatus:e(no).getEditedPostAttribute("ping_status")}))),(0,l.withDispatch)((e=>({editPost:e(no).editPost})))])((function(e){let{pingStatus:t="open",...n}=e;return(0,i.createElement)(To.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Allow pingbacks & trackbacks"),checked:"open"===t,onChange:()=>n.editPost({ping_status:"open"===t?"closed":"open"})})}));class Ur extends i.Component{constructor(){super(...arguments),this.buttonRef=(0,i.createRef)(),this.openPreviewWindow=this.openPreviewWindow.bind(this)}componentDidUpdate(e){const{previewLink:t}=this.props;t&&!e.previewLink&&this.setPreviewWindowLink(t)}setPreviewWindowLink(e){const{previewWindow:t}=this;t&&!t.closed&&(t.location=e,this.buttonRef.current&&this.buttonRef.current.focus())}getWindowTarget(){const{postId:e}=this.props;return`wp-preview-${e}`}openPreviewWindow(e){e.preventDefault(),this.previewWindow&&!this.previewWindow.closed||(this.previewWindow=window.open("",this.getWindowTarget())),this.previewWindow.focus(),this.props.isAutosaveable&&!this.props.isPostLocked?(this.props.isDraft?this.props.savePost({isPreview:!0}):this.props.autosave({isPreview:!0}),function(e){let t=(0,i.renderToString)((0,i.createElement)("div",{className:"editor-post-preview-button__interstitial-message"},(0,i.createElement)(To.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96"},(0,i.createElement)(To.Path,{className:"outer",d:"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",fill:"none"}),(0,i.createElement)(To.Path,{className:"inner",d:"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",fill:"none"})),(0,i.createElement)("p",null,(0,Xt.__)("Generating preview…"))));t+='\n\t\t\n\t',t=(0,d.applyFilters)("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=(0,Xt.__)("Generating preview…"),e.close()}(this.previewWindow.document)):this.setPreviewWindowLink(e.target.href)}render(){const{previewLink:e,currentPostLink:t,isSaveable:n,role:o}=this.props,r=e||t,s=uo()({"editor-post-preview":!this.props.className},this.props.className);return(0,i.createElement)(To.Button,{variant:this.props.className?void 0:"tertiary",className:s,href:r,target:this.getWindowTarget(),disabled:!n,onClick:this.openPreviewWindow,ref:this.buttonRef,role:o},this.props.textContent?this.props.textContent:(0,i.createElement)(i.Fragment,null,(0,Xt._x)("Preview","imperative verb"),(0,i.createElement)(To.VisuallyHidden,{as:"span"},(0,Xt.__)("(opens in a new tab)"))))}}var Mr=(0,u.compose)([(0,l.withSelect)(((e,t)=>{let{forcePreviewLink:n,forceIsAutosaveable:o}=t;const{getCurrentPostId:r,getCurrentPostAttribute:i,getEditedPostAttribute:a,isEditedPostSaveable:l,isEditedPostAutosaveable:u,getEditedPostPreviewLink:d,isPostLocked:p}=e(no),{getPostType:m}=e(c.store),h=d(),g=m(a("type"));return{postId:r(),currentPostLink:i("link"),previewLink:void 0!==n?n:h,isSaveable:l(),isAutosaveable:o||u(),isViewable:(0,s.get)(g,["viewable"],!1),isDraft:-1!==["draft","auto-draft"].indexOf(a("status")),isPostLocked:p()}})),(0,l.withDispatch)((e=>({autosave:e(no).autosave,savePost:e(no).savePost}))),(0,u.ifCondition)((e=>{let{isViewable:t}=e;return t}))])(Ur);var Fr=(0,u.compose)([(0,l.withSelect)(((e,t)=>{let{forceIsSaving:n}=t;const{isCurrentPostPublished:o,isEditedPostBeingScheduled:r,isSavingPost:i,isPublishingPost:a,getCurrentPost:l,getCurrentPostType:c,isAutosavingPost:u}=e(no);return{isPublished:o(),isBeingScheduled:r(),isSaving:n||i(),isPublishing:a(),hasPublishAction:(0,s.get)(l(),["_links","wp:action-publish"],!1),postType:c(),isAutosaving:u()}}))])((function(e){let{isPublished:t,isBeingScheduled:n,isSaving:o,isPublishing:r,hasPublishAction:i,isAutosaving:s,hasNonPostEntityChanges:a}=e;return r?(0,Xt.__)("Publishing…"):t&&o&&!s?(0,Xt.__)("Updating…"):n&&o&&!s?(0,Xt.__)("Scheduling…"):i?t?a?(0,Xt.__)("Update…"):(0,Xt.__)("Update"):n?a?(0,Xt.__)("Schedule…"):(0,Xt.__)("Schedule"):(0,Xt.__)("Publish"):a?(0,Xt.__)("Submit for Review…"):(0,Xt.__)("Submit for Review")}));const zr=()=>{};class Hr extends i.Component{constructor(e){super(e),this.buttonNode=(0,i.createRef)(),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}componentDidMount(){this.props.focusOnMount&&(this.timeoutID=setTimeout((()=>{this.buttonNode.current.focus()}),0))}componentWillUnmount(){clearTimeout(this.timeoutID)}createOnClick(e){var t=this;return function(){for(var n=arguments.length,o=new Array(n),r=0;re(...o)}),s((()=>t.closeEntitiesSavedStates)),zr):e(...o)}}closeEntitiesSavedStates(e){const{postType:t,postId:n}=this.props,{entitiesSavedStatesCallback:o}=this.state;this.setState({entitiesSavedStatesCallback:!1},(()=>{e&&e.some((e=>"postType"===e.kind&&e.name===t&&e.key===n))&&o()}))}render(){const{forceIsDirty:e,forceIsSaving:t,hasPublishAction:n,isBeingScheduled:o,isOpen:s,isPostSavingLocked:a,isPublishable:l,isPublished:c,isSaveable:u,isSaving:d,isAutoSaving:p,isToggle:m,onSave:h,onStatusChange:g,onSubmit:f=zr,onToggle:v,visibility:_,hasNonPostEntityChanges:y,isSavingNonPostEntityChanges:b}=this.props,E=(d||t||!u||a||!l&&!e)&&(!y||b),w=(c||d||t||!u||!l&&!e)&&(!y||b);let S;S=n?"private"===_?"private":o?"future":"publish":"pending";const P={"aria-disabled":E,className:"editor-post-publish-button",isBusy:!p&&d&&c,variant:"primary",onClick:this.createOnClick((()=>{E||(f(),g(S),h())}))},k={"aria-disabled":w,"aria-expanded":s,className:"editor-post-publish-panel__toggle",isBusy:d&&c,variant:"primary",onClick:this.createOnClick((()=>{w||v()}))},C=o?(0,Xt.__)("Schedule…"):(0,Xt.__)("Publish"),T=(0,i.createElement)(Fr,{forceIsSaving:t,hasNonPostEntityChanges:y}),x=m?k:P,B=m?C:T;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.Button,r({ref:this.buttonNode},x,{className:uo()(x.className,"editor-post-publish-button__button",{"has-changes-dot":y})}),B))}}var Vr=(0,u.compose)([(0,l.withSelect)((e=>{const{isSavingPost:t,isAutosavingPost:n,isEditedPostBeingScheduled:o,getEditedPostVisibility:r,isCurrentPostPublished:i,isEditedPostSaveable:a,isEditedPostPublishable:l,isPostSavingLocked:c,getCurrentPost:u,getCurrentPostType:d,getCurrentPostId:p,hasNonPostEntityChanges:m,isSavingNonPostEntityChanges:h}=e(no),g=n();return{isSaving:t()||g,isAutoSaving:g,isBeingScheduled:o(),visibility:r(),isSaveable:a(),isPostSavingLocked:c(),isPublishable:l(),isPublished:i(),hasPublishAction:(0,s.get)(u(),["_links","wp:action-publish"],!1),postType:d(),postId:p(),hasNonPostEntityChanges:m(),isSavingNonPostEntityChanges:h()}})),(0,l.withDispatch)((e=>{const{editPost:t,savePost:n}=e(no);return{onStatusChange:e=>t({status:e},{undoIgnore:!0}),onSave:n}}))])(Hr);var Wr=(0,i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(P.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));var jr=(0,i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,i.createElement)(P.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"}));const $r={public:{label:(0,Xt.__)("Public"),info:(0,Xt.__)("Visible to everyone.")},private:{label:(0,Xt.__)("Private"),info:(0,Xt.__)("Only visible to site admins and editors.")},password:{label:(0,Xt.__)("Password protected"),info:(0,Xt.__)("Only those with the password can view this post.")}};function Gr(e){let{onClose:t}=e;const n=(0,u.useInstanceId)(Gr),{status:o,visibility:r,password:s}=(0,l.useSelect)((e=>({status:e(no).getEditedPostAttribute("status"),visibility:e(no).getEditedPostVisibility(),password:e(no).getEditedPostAttribute("password")}))),{editPost:a,savePost:c}=(0,l.useDispatch)(no),[d,m]=(0,i.useState)(!!s),[h,g]=(0,i.useState)(!1);return(0,i.createElement)("div",{className:"editor-post-visibility"},(0,i.createElement)(p.__experimentalInspectorPopoverHeader,{title:(0,Xt.__)("Visibility"),help:(0,Xt.__)("Control how this post is viewed."),onClose:t}),(0,i.createElement)("fieldset",{className:"editor-post-visibility__fieldset"},(0,i.createElement)(To.VisuallyHidden,{as:"legend"},(0,Xt.__)("Visibility")),(0,i.createElement)(Kr,{instanceId:n,value:"public",label:$r.public.label,info:$r.public.info,checked:"public"===r&&!d,onChange:()=>{a({status:"private"===r?"draft":o,password:""}),m(!1)}}),(0,i.createElement)(Kr,{instanceId:n,value:"private",label:$r.private.label,info:$r.private.info,checked:"private"===r,onChange:()=>{g(!0)}}),(0,i.createElement)(Kr,{instanceId:n,value:"password",label:$r.password.label,info:$r.password.info,checked:d,onChange:()=>{a({status:"private"===r?"draft":o,password:s||""}),m(!0)}}),d&&(0,i.createElement)("div",{className:"editor-post-visibility__password"},(0,i.createElement)(To.VisuallyHidden,{as:"label",htmlFor:`editor-post-visibility__password-input-${n}`},(0,Xt.__)("Create password")),(0,i.createElement)("input",{className:"editor-post-visibility__password-input",id:`editor-post-visibility__password-input-${n}`,type:"text",onChange:e=>{a({password:e.target.value})},value:s,placeholder:(0,Xt.__)("Use a secure password")}))),(0,i.createElement)(To.__experimentalConfirmDialog,{isOpen:h,onConfirm:()=>{a({status:"private",password:""}),m(!1),g(!1),c()},onCancel:()=>{g(!1)}},(0,Xt.__)("Would you like to privately publish this post now?")))}function Kr(e){let{instanceId:t,value:n,label:o,info:s,...a}=e;return(0,i.createElement)("div",{className:"editor-post-visibility__choice"},(0,i.createElement)("input",r({type:"radio",name:`editor-post-visibility__setting-${t}`,value:n,id:`editor-post-${n}-${t}`,"aria-describedby":`editor-post-${n}-${t}-description`,className:"editor-post-visibility__radio"},a)),(0,i.createElement)("label",{htmlFor:`editor-post-${n}-${t}`,className:"editor-post-visibility__label"},o),(0,i.createElement)("p",{id:`editor-post-${n}-${t}-description`,className:"editor-post-visibility__info"},s))}function Yr(){return qr()}function qr(){var e;const t=(0,l.useSelect)((e=>e(no).getEditedPostVisibility()));return null===(e=$r[t])||void 0===e?void 0:e.label}function Qr(e){return Qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qr(e)}function Xr(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function Zr(e){Xr(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===Qr(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function Jr(e){Xr(1,arguments);var t=Zr(e);return t.setDate(1),t.setHours(0,0,0,0),t}function ei(e){Xr(1,arguments);var t=Zr(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}Math.pow(10,8);var ti=36e5;function ni(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}var oi={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ri=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ii=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,si=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ai(e){var t,n={},o=e.split(oi.dateTimeDelimiter);if(o.length>2)return n;if(/:/.test(o[0])?t=o[0]:(n.date=o[0],t=o[1],oi.timeZoneDelimiter.test(n.date)&&(n.date=e.split(oi.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length))),t){var r=oi.timezone.exec(t);r?(n.time=t.replace(r[1],""),n.timezone=r[1]):n.time=t}return n}function li(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),o=e.match(n);if(!o)return{year:NaN,restDateString:""};var r=o[1]?parseInt(o[1]):null,i=o[2]?parseInt(o[2]):null;return{year:null===i?r:100*i,restDateString:e.slice((o[1]||o[2]).length)}}function ci(e,t){if(null===t)return new Date(NaN);var n=e.match(ri);if(!n)return new Date(NaN);var o=!!n[4],r=ui(n[1]),i=ui(n[2])-1,s=ui(n[3]),a=ui(n[4]),l=ui(n[5])-1;if(o)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,a,l)?function(e,t,n){var o=new Date(0);o.setUTCFullYear(e,0,4);var r=o.getUTCDay()||7,i=7*(t-1)+n+1-r;return o.setUTCDate(o.getUTCDate()+i),o}(t,a,l):new Date(NaN);var c=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(hi[t]||(gi(e)?29:28))}(t,i,s)&&function(e,t){return t>=1&&t<=(gi(e)?366:365)}(t,r)?(c.setUTCFullYear(t,i,Math.max(r,s)),c):new Date(NaN)}function ui(e){return e?parseInt(e):1}function di(e){var t=e.match(ii);if(!t)return NaN;var n=pi(t[1]),o=pi(t[2]),r=pi(t[3]);return function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,o,r)?n*ti+6e4*o+1e3*r:NaN}function pi(e){return e&&parseFloat(e.replace(",","."))||0}function mi(e){if("Z"===e)return 0;var t=e.match(si);if(!t)return 0;var n="+"===t[1]?-1:1,o=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,r)?n*(o*ti+6e4*r):NaN}var hi=[31,null,31,30,31,30,31,31,30,31,30,31];function gi(e){return e%400==0||e%4==0&&e%100!=0}function fi(e){let{onClose:t}=e;const{postDate:n,postType:o}=(0,l.useSelect)((e=>({postDate:e(no).getEditedPostAttribute("date"),postType:e(no).getCurrentPostType()})),[]),{editPost:r}=(0,l.useDispatch)(no),[s,a]=(0,i.useState)(Jr(new Date(n))),u=(0,l.useSelect)((e=>e(c.store).getEntityRecords("postType",o,{status:"publish,future",after:Jr(s).toISOString(),before:ei(s).toISOString(),exclude:[e(no).getCurrentPostId()],per_page:100,_fields:"id,date"})),[s,o]),d=(0,i.useMemo)((()=>(u||[]).map((e=>{let{date:t}=e;return{date:new Date(t)}}))),[u]),m=(0,b.getSettings)(),h=/a(?!\\)/i.test(m.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,i.createElement)(p.__experimentalPublishDateTimePicker,{currentDate:n,onChange:e=>r({date:e}),is12Hour:h,events:d,onMonthPreviewed:e=>a(function(e,t){var n;Xr(1,arguments);var o=ni(null!==(n=null==t?void 0:t.additionalDigits)&&void 0!==n?n:2);if(2!==o&&1!==o&&0!==o)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r,i=ai(e);if(i.date){var s=li(i.date,o);r=ci(s.restDateString,s.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var a,l=r.getTime(),c=0;if(i.time&&(c=di(i.time),isNaN(c)))return new Date(NaN);if(!i.timezone){var u=new Date(l+c),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return a=mi(i.timezone),isNaN(a)?new Date(NaN):new Date(l+c+a)}(e)),onClose:t})}function vi(e){return _i(e)}function _i(){let{full:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{date:t,isFloating:n}=(0,l.useSelect)((e=>({date:e(no).getEditedPostAttribute("date"),isFloating:e(no).isEditedPostDateFloating()})),[]);return e?yi(t):bi(t,{isFloating:n})}function yi(e){const t=(0,b.getDate)(e),n=function(){const{timezone:e}=(0,b.getSettings)();if(e.abbr&&isNaN(Number(e.abbr)))return e.abbr;return`UTC${e.offset<0?"":"+"}${e.offset}`}(),o=(0,b.dateI18n)((0,Xt._x)("F j, Y g:i a","post schedule full date format"),t);return(0,Xt.isRTL)()?`${n} ${o}`:`${o} ${n}`}function bi(e){let{isFloating:t=!1,now:n=new Date}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||t)return(0,Xt.__)("Immediately");if(!Ei(n))return yi(e);const o=(0,b.getDate)(e);if(wi(o,n))return(0,Xt.sprintf)((0,Xt.__)("Today at %s"),(0,b.dateI18n)((0,Xt._x)("g:i a","post schedule time format"),o));const r=new Date(n);return r.setDate(r.getDate()+1),wi(o,r)?(0,Xt.sprintf)((0,Xt.__)("Tomorrow at %s"),(0,b.dateI18n)((0,Xt._x)("g:i a","post schedule time format"),o)):o.getFullYear()===n.getFullYear()?(0,b.dateI18n)((0,Xt._x)("F j g:i a","post schedule date format without year"),o):(0,b.dateI18n)((0,Xt._x)("F j, Y g:i a","post schedule full date format"),o)}function Ei(e){const{timezone:t}=(0,b.getSettings)();return Number(t.offset)===e.getTimezoneOffset()/60*-1}function wi(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}var Si=n(3613),Pi=n.n(Si),ki=window.wp.a11y;const Ci={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function Ti(e){let{onSelect:t,taxonomy:n}=e;const{_terms:o,showTerms:r}=(0,l.useSelect)((e=>{const t=e(c.store).getEntityRecords("taxonomy",n.slug,Ci);return{_terms:t,showTerms:(null==t?void 0:t.length)>=3}}),[]);if(!r)return null;const a=(e=>(null!=e?e:[]).map(or))(o),u=(0,s.get)(n,["labels","most_used"]);return(0,i.createElement)("div",{className:"editor-post-taxonomies__flat-term-most-used"},(0,i.createElement)(To.BaseControl.VisualLabel,{as:"h3",className:"editor-post-taxonomies__flat-term-most-used-label"},u),(0,i.createElement)("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list"},a.map((e=>(0,i.createElement)("li",{key:e.id},(0,i.createElement)(To.Button,{variant:"link",onClick:()=>t(e)},e.name))))))}const xi=[],Bi={per_page:20,orderby:"count",order:"desc",_fields:"id,name",context:"view"},Ai=(e,t)=>nr(e).toLowerCase()===nr(t).toLowerCase(),Ii=(e,t)=>e.map((e=>t.find((t=>Ai(t.name,e))).id));function Ni(e){let{slug:t}=e;const[n,o]=(0,i.useState)([]),[r,a]=(0,i.useState)(""),d=(0,u.useDebounce)(a,500),{terms:p,termIds:m,taxonomy:h,hasAssignAction:g,hasCreateAction:f,hasResolvedTerms:v}=(0,l.useSelect)((e=>{const{getCurrentPost:n,getEditedPostAttribute:o}=e(no),{getEntityRecords:r,getTaxonomy:i,hasFinishedResolution:a}=e(c.store),l=n(),u=i(t),d=u?o(u.rest_base):xi,p={...Bi,include:d.join(","),per_page:-1};return{hasCreateAction:!!u&&(0,s.get)(l,["_links","wp:action-create-"+u.rest_base],!1),hasAssignAction:!!u&&(0,s.get)(l,["_links","wp:action-assign-"+u.rest_base],!1),taxonomy:u,termIds:d,terms:d.length?r("taxonomy",t,p):xi,hasResolvedTerms:a("getEntityRecords",["taxonomy",t,p])}}),[t]),{searchResults:_}=(0,l.useSelect)((e=>{const{getEntityRecords:n}=e(c.store);return{searchResults:r?n("taxonomy",t,{...Bi,search:r}):xi}}),[r]);(0,i.useEffect)((()=>{if(v){const e=(null!=p?p:[]).map((e=>nr(e.name)));o(e)}}),[p,v]);const y=(0,i.useMemo)((()=>(null!=_?_:[]).map((e=>nr(e.name)))),[_]),{editPost:b}=(0,l.useDispatch)(no);if(!g)return null;function E(e){b({[h.rest_base]:e})}const w=(0,s.get)(h,["labels","add_new_item"],"post_tag"===t?(0,Xt.__)("Add new tag"):(0,Xt.__)("Add new Term")),S=(0,s.get)(h,["labels","singular_name"],"post_tag"===t?(0,Xt.__)("Tag"):(0,Xt.__)("Term")),P=(0,Xt.sprintf)((0,Xt._x)("%s added","term"),S),k=(0,Xt.sprintf)((0,Xt._x)("%s removed","term"),S),C=(0,Xt.sprintf)((0,Xt._x)("Remove %s","term"),S);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.FormTokenField,{value:n,suggestions:y,onChange:function(e){var t;const n=[...null!=p?p:[],...null!=_?_:[]],r=e.reduce(((e,t)=>(e.some((e=>e.toLowerCase()===t.toLowerCase()))||e.push(t),e)),[]),i=r.filter((e=>!n.find((t=>Ai(t.name,e)))));if(o(r),0===i.length)return E(Ii(r,n));if(!f)return;const s=null!==(t=null==h?void 0:h.rest_namespace)&&void 0!==t?t:"wp/v2";Promise.all(i.map((e=>function(e,t,n){const o=Pi()(e);return Gt()({path:`/${n}/${t}`,method:"POST",data:{name:o}}).catch((t=>"term_exists"!==t.code?Promise.reject(t):Promise.resolve({id:t.data.term_id,name:e}))).then(or)}(e,h.rest_base,s)))).then((e=>{const t=n.concat(e);return E(Ii(r,t))}))},onInputChange:d,maxSuggestions:20,label:w,messages:{added:P,removed:k,remove:C}}),(0,i.createElement)(Ti,{taxonomy:h,onSelect:function(e){if(m.includes(e.id))return;const n=[...m,e.id],o=(0,Xt.sprintf)((0,Xt._x)("%s added","term"),(0,s.get)(h,["labels","singular_name"],"post_tag"===t?(0,Xt.__)("Tag"):(0,Xt.__)("Term")));(0,ki.speak)(o,"assertive"),E(n)}}))}var Di=(0,To.withFilters)("editor.PostTaxonomyType")(Ni);const Ri=()=>{const e=[(0,Xt.__)("Suggestion:"),(0,i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,Xt.__)("Add tags"))];return(0,i.createElement)(To.PanelBody,{initialOpen:!1,title:e},(0,i.createElement)("p",null,(0,Xt.__)("Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.")),(0,i.createElement)(Di,{slug:"post_tag"}))};class Li extends i.Component{constructor(e){super(e),this.state={hadTagsWhenOpeningThePanel:e.hasTags}}render(){return this.state.hadTagsWhenOpeningThePanel?null:(0,i.createElement)(Ri,null)}}var Oi=(0,u.compose)((0,l.withSelect)((e=>{const t=e(no).getCurrentPostType(),n=e(c.store).getTaxonomy("post_tag"),o=n&&e(no).getEditedPostAttribute(n.rest_base);return{areTagsFetched:void 0!==n,isPostTypeSupported:n&&n.types.some((e=>e===t)),hasTags:o&&o.length}})),(0,u.ifCondition)((e=>{let{areTagsFetched:t,isPostTypeSupported:n}=e;return n&&t})))(Li);const Ui=(e,t)=>xr.filter((t=>null==e?void 0:e.includes(t.id))).find((e=>e.id===t)),Mi=e=>{let{suggestedPostFormat:t,suggestionText:n,onUpdatePostFormat:o}=e;return(0,i.createElement)(To.Button,{variant:"link",onClick:()=>o(t)},n)};function Fi(){const{currentPostFormat:e,suggestion:t}=(0,l.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:n}=e(no),o=(0,s.get)(e(c.store).getThemeSupports(),["formats"],[]);return{currentPostFormat:t("format"),suggestion:Ui(o,n())}}),[]),{editPost:n}=(0,l.useDispatch)(no),o=[(0,Xt.__)("Suggestion:"),(0,i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,Xt.__)("Use a post format"))];return t&&t.id!==e?(0,i.createElement)(To.PanelBody,{initialOpen:!1,title:o},(0,i.createElement)("p",null,(0,Xt.__)("Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.")),(0,i.createElement)("p",null,(0,i.createElement)(Mi,{onUpdatePostFormat:e=>n({format:e}),suggestedPostFormat:t.id,suggestionText:(0,Xt.sprintf)((0,Xt.__)('Apply the "%1$s" format.'),t.caption)}))):null}const zi={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view"},Hi=[];function Vi(e){let{slug:t}=e;const[n,o]=(0,i.useState)(!1),[r,a]=(0,i.useState)(""),[d,p]=(0,i.useState)(""),[m,h]=(0,i.useState)(!1),[g,f]=(0,i.useState)(""),[v,_]=(0,i.useState)([]),y=(0,u.useDebounce)(ki.speak,500),{hasCreateAction:b,hasAssignAction:E,terms:w,loading:S,availableTerms:P,taxonomy:k}=(0,l.useSelect)((e=>{const{getCurrentPost:n,getEditedPostAttribute:o}=e(no),{getTaxonomy:r,getEntityRecords:i,isResolving:a}=e(c.store),l=r(t);return{hasCreateAction:!!l&&(0,s.get)(n(),["_links","wp:action-create-"+l.rest_base],!1),hasAssignAction:!!l&&(0,s.get)(n(),["_links","wp:action-assign-"+l.rest_base],!1),terms:l?o(l.rest_base):Hi,loading:a("getEntityRecords",["taxonomy",t,zi]),availableTerms:i("taxonomy",t,zi)||Hi,taxonomy:l}}),[t]),{editPost:C}=(0,l.useDispatch)(no),{saveEntityRecord:T}=(0,l.useDispatch)(c.store),x=(0,i.useMemo)((()=>function(e,t){const n=e=>-1!==t.indexOf(e.id)||void 0!==e.children&&e.children.map(n).filter((e=>e)).length>0,o=[...e];return o.sort(((e,t)=>{const o=n(e),r=n(t);return o===r?0:o&&!r?-1:!o&&r?1:0})),o}(tr(P),w)),[P]);if(!E)return null;const B=e=>{C({[k.rest_base]:e})},A=e=>e.map((e=>(0,i.createElement)("div",{key:e.id,className:"editor-post-taxonomies__hierarchical-terms-choice"},(0,i.createElement)(To.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:-1!==w.indexOf(e.id),onChange:()=>{(e=>{const t=w.includes(e)?w.filter((t=>t!==e)):[...w,e];B(t)})(parseInt(e.id,10))},label:(0,Lo.decodeEntities)(e.name)}),!!e.children.length&&(0,i.createElement)("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices"},A(e.children))))),I=(e,n,o)=>(0,s.get)(k,["labels",e],"category"===t?n:o),N=I("add_new_item",(0,Xt.__)("Add new category"),(0,Xt.__)("Add new term")),D=I("new_item_name",(0,Xt.__)("Add new category"),(0,Xt.__)("Add new term")),R=I("parent_item",(0,Xt.__)("Parent Category"),(0,Xt.__)("Parent Term")),L=`— ${R} —`,O=N,U=(0,s.get)(k,["labels","search_items"],(0,Xt.__)("Search Terms")),M=(0,s.get)(k,["name"],(0,Xt.__)("Terms")),F=P.length>=8;return(0,i.createElement)(i.Fragment,null,F&&(0,i.createElement)(To.TextControl,{__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-filter",label:U,value:g,onChange:e=>{const t=x.map(function(e){const t=n=>{if(""===e)return n;const o={...n};return o.children.length>0&&(o.children=o.children.map(t).filter((e=>e))),(-1!==o.name.toLowerCase().indexOf(e.toLowerCase())||o.children.length>0)&&o};return t}(e)).filter((e=>e)),n=e=>{let t=0;for(let o=0;o{h(!m)},className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":m,variant:"link"},N),m&&(0,i.createElement)("form",{onSubmit:async e=>{if(e.preventDefault(),""===r||n)return;const i=function(e,t,n){return e.find((e=>(!e.parent&&!t||parseInt(e.parent)===parseInt(t))&&e.name.toLowerCase()===n.toLowerCase()))}(P,d,r);if(i)return w.some((e=>e===i.id))||B([...w,i.id]),a(""),void p("");o(!0);const l=await(c={name:r,parent:d||void 0},T("taxonomy",t,c));var c;const u=(0,Xt.sprintf)((0,Xt._x)("%s added","term"),(0,s.get)(k,["labels","singular_name"],"category"===t?(0,Xt.__)("Category"):(0,Xt.__)("Term")));(0,ki.speak)(u,"assertive"),o(!1),a(""),p(""),B([...w,l.id])}},(0,i.createElement)(To.__experimentalVStack,null,(0,i.createElement)(To.TextControl,{__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-input",label:D,value:r,onChange:e=>{a(e)},required:!0}),!!P.length&&(0,i.createElement)(To.TreeSelect,{label:R,noOptionLabel:L,onChange:e=>{p(e)},selectedId:d,tree:x})),(0,i.createElement)(To.Button,{variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit"},O)))}var Wi=(0,To.withFilters)("editor.PostTaxonomyType")(Vi);var ji=function(){const e=(0,l.useSelect)((e=>{var t;const n=e(no).getCurrentPostType(),{canUser:o,getEntityRecord:r,getTaxonomy:i}=e(c.store),s=i("category"),a=o("read","settings")?null===(t=r("root","site"))||void 0===t?void 0:t.default_category:void 0,l=a?r("taxonomy","category",a):void 0,u=s&&s.types.some((e=>e===n)),d=s&&e(no).getEditedPostAttribute(s.rest_base);return!!s&&!!l&&u&&(0===(null==d?void 0:d.length)||1===(null==d?void 0:d.length)&&(null==l?void 0:l.id)===d[0])}),[]),[t,n]=(0,i.useState)(!1);if((0,i.useEffect)((()=>{e&&n(!0)}),[e]),!t)return null;const o=[(0,Xt.__)("Suggestion:"),(0,i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,Xt.__)("Assign a category"))];return(0,i.createElement)(To.PanelBody,{initialOpen:!1,title:o},(0,i.createElement)("p",null,(0,Xt.__)("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")),(0,i.createElement)(Wi,{slug:"category"}))};var $i=function(e){let{children:t}=e;const{isBeingScheduled:n,isRequestingSiteIcon:o,hasPublishAction:r,siteIconUrl:a,siteTitle:u,siteHome:d}=(0,l.useSelect)((e=>{const{getCurrentPost:t,isEditedPostBeingScheduled:n}=e(no),{getEntityRecord:o,isResolving:r}=e(c.store),i=o("root","__unstableBase",void 0)||{};return{hasPublishAction:(0,s.get)(t(),["_links","wp:action-publish"],!1),isBeingScheduled:n(),isRequestingSiteIcon:r("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:i.site_icon_url,siteTitle:i.name,siteHome:i.home&&(0,E.filterURLForDisplay)(i.home)}}),[]);let p,m,h=(0,i.createElement)(To.Icon,{className:"components-site-icon",size:"36px",icon:jr});return a&&(h=(0,i.createElement)("img",{alt:(0,Xt.__)("Site Icon"),className:"components-site-icon",src:a})),o&&(h=null),r?n?(p=(0,Xt.__)("Are you ready to schedule?"),m=(0,Xt.__)("Your work will be published at the specified date and time.")):(p=(0,Xt.__)("Are you ready to publish?"),m=(0,Xt.__)("Double-check your settings before publishing.")):(p=(0,Xt.__)("Are you ready to submit for review?"),m=(0,Xt.__)("When you’re ready, submit your work for review, and an Editor will be able to approve it for you.")),(0,i.createElement)("div",{className:"editor-post-publish-panel__prepublish"},(0,i.createElement)("div",null,(0,i.createElement)("strong",null,p)),(0,i.createElement)("p",null,m),(0,i.createElement)("div",{className:"components-site-card"},h,(0,i.createElement)("div",{className:"components-site-info"},(0,i.createElement)("span",{className:"components-site-name"},(0,Lo.decodeEntities)(u)||(0,Xt.__)("(Untitled)")),(0,i.createElement)("span",{className:"components-site-home"},d))),r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.PanelBody,{initialOpen:!1,title:[(0,Xt.__)("Visibility:"),(0,i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,i.createElement)(Yr,null))]},(0,i.createElement)(Gr,null)),(0,i.createElement)(To.PanelBody,{initialOpen:!1,title:[(0,Xt.__)("Publish:"),(0,i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,i.createElement)(vi,null))]},(0,i.createElement)(fi,null))),(0,i.createElement)(Fi,null),(0,i.createElement)(Oi,null),(0,i.createElement)(ji,null),t)};const Gi="%postname%";function Ki(e){let{text:t,onCopy:n,children:o}=e;const r=(0,u.useCopyToClipboard)(t,n);return(0,i.createElement)(To.Button,{variant:"secondary",ref:r},o)}class Yi extends i.Component{constructor(){super(...arguments),this.state={showCopyConfirmation:!1},this.onCopy=this.onCopy.bind(this),this.onSelectInput=this.onSelectInput.bind(this),this.postLink=(0,i.createRef)()}componentDidMount(){this.props.focusOnMount&&this.postLink.current.focus()}componentWillUnmount(){clearTimeout(this.dismissCopyConfirmation)}onCopy(){this.setState({showCopyConfirmation:!0}),clearTimeout(this.dismissCopyConfirmation),this.dismissCopyConfirmation=setTimeout((()=>{this.setState({showCopyConfirmation:!1})}),4e3)}onSelectInput(e){e.target.select()}render(){const{children:e,isScheduled:t,post:n,postType:o}=this.props,r=(0,s.get)(o,["labels","singular_name"]),a=(0,s.get)(o,["labels","view_item"]),l=(0,s.get)(o,["labels","add_new_item"]),c="future"===n.status?(e=>{const{slug:t}=e;return e.permalink_template.includes(Gi)?e.permalink_template.replace(Gi,t):e.permalink_template})(n):n.link,u=(0,E.addQueryArgs)("post-new.php",{post_type:n.type}),d=t?(0,i.createElement)(i.Fragment,null,(0,Xt.__)("is now scheduled. It will go live on")," ",(0,i.createElement)(vi,null),"."):(0,Xt.__)("is now live.");return(0,i.createElement)("div",{className:"post-publish-panel__postpublish"},(0,i.createElement)(To.PanelBody,{className:"post-publish-panel__postpublish-header"},(0,i.createElement)("a",{ref:this.postLink,href:c},(0,Lo.decodeEntities)(n.title)||(0,Xt.__)("(no title)"))," ",d),(0,i.createElement)(To.PanelBody,null,(0,i.createElement)("p",{className:"post-publish-panel__postpublish-subheader"},(0,i.createElement)("strong",null,(0,Xt.__)("What’s next?"))),(0,i.createElement)("div",{className:"post-publish-panel__postpublish-post-address-container"},(0,i.createElement)(To.TextControl,{__nextHasNoMarginBottom:!0,className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:(0,Xt.sprintf)((0,Xt.__)("%s address"),r),value:(0,E.safeDecodeURIComponent)(c),onFocus:this.onSelectInput}),(0,i.createElement)("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap"},(0,i.createElement)(Ki,{text:c,onCopy:this.onCopy},this.state.showCopyConfirmation?(0,Xt.__)("Copied!"):(0,Xt.__)("Copy")))),(0,i.createElement)("div",{className:"post-publish-panel__postpublish-buttons"},!t&&(0,i.createElement)(To.Button,{variant:"primary",href:c},a),(0,i.createElement)(To.Button,{variant:t?"primary":"secondary",href:u},l))),e)}}var qi=(0,l.withSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPost:n,isCurrentPostScheduled:o}=e(no),{getPostType:r}=e(c.store);return{post:n(),postType:r(t("type")),isScheduled:o()}}))(Yi);class Qi extends i.Component{constructor(){super(...arguments),this.onSubmit=this.onSubmit.bind(this)}componentDidUpdate(e){e.isPublished&&!this.props.isSaving&&this.props.isDirty&&this.props.onClose()}onSubmit(){const{onClose:e,hasPublishAction:t,isPostTypeViewable:n}=this.props;t&&n||e()}render(){const{forceIsDirty:e,forceIsSaving:t,isBeingScheduled:n,isPublished:o,isPublishSidebarEnabled:s,isScheduled:a,isSaving:l,isSavingNonPostEntityChanges:c,onClose:u,onTogglePublishSidebar:d,PostPublishExtension:p,PrePublishExtension:m,...h}=this.props,{hasPublishAction:g,isDirty:f,isPostTypeViewable:v,..._}=h,y=o||a&&n,b=!y&&!l,E=y&&!l;return(0,i.createElement)("div",r({className:"editor-post-publish-panel"},_),(0,i.createElement)("div",{className:"editor-post-publish-panel__header"},E?(0,i.createElement)(To.Button,{onClick:u,icon:Wr,label:(0,Xt.__)("Close panel")}):(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"editor-post-publish-panel__header-publish-button"},(0,i.createElement)(Vr,{focusOnMount:!0,onSubmit:this.onSubmit,forceIsDirty:e,forceIsSaving:t})),(0,i.createElement)("div",{className:"editor-post-publish-panel__header-cancel-button"},(0,i.createElement)(To.Button,{disabled:c,onClick:u,variant:"secondary"},(0,Xt.__)("Cancel"))))),(0,i.createElement)("div",{className:"editor-post-publish-panel__content"},b&&(0,i.createElement)($i,null,m&&(0,i.createElement)(m,null)),E&&(0,i.createElement)(qi,{focusOnMount:!0},p&&(0,i.createElement)(p,null)),l&&(0,i.createElement)(To.Spinner,null)),(0,i.createElement)("div",{className:"editor-post-publish-panel__footer"},(0,i.createElement)(To.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Always show pre-publish checks."),checked:s,onChange:d})))}}var Xi=(0,u.compose)([(0,l.withSelect)((e=>{const{getPostType:t}=e(c.store),{getCurrentPost:n,getEditedPostAttribute:o,isCurrentPostPublished:r,isCurrentPostScheduled:i,isEditedPostBeingScheduled:a,isEditedPostDirty:l,isSavingPost:u,isSavingNonPostEntityChanges:d}=e(no),{isPublishSidebarEnabled:p}=e(no),m=t(o("type"));return{hasPublishAction:(0,s.get)(n(),["_links","wp:action-publish"],!1),isPostTypeViewable:(0,s.get)(m,["viewable"],!1),isBeingScheduled:a(),isDirty:l(),isPublished:r(),isPublishSidebarEnabled:p(),isSaving:u(),isSavingNonPostEntityChanges:d(),isScheduled:i()}})),(0,l.withDispatch)(((e,t)=>{let{isPublishSidebarEnabled:n}=t;const{disablePublishSidebar:o,enablePublishSidebar:r}=e(no);return{onTogglePublishSidebar:()=>{n?o():r()}}})),To.withFocusReturn,To.withConstrainedTabbing])(Qi);var Zi=(0,i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(P.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-4v-2.4L14 14l1-1-3-3-3 3 1 1 1.2-1.2v2.4H7.7c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4H9l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8 0 1-.8 1.8-1.7 1.8z"}));var Ji=function(e){let{icon:t,size:n=24,...o}=e;return(0,i.cloneElement)(t,{width:n,height:n,...o})};var es=(0,i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(P.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));var ts=(0,i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(P.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z"}));var ns=(0,u.compose)([(0,l.withSelect)((e=>{const{isSavingPost:t,isCurrentPostPublished:n,isCurrentPostScheduled:o}=e(no);return{isSaving:t(),isPublished:n(),isScheduled:o()}})),(0,l.withDispatch)((e=>{const{editPost:t,savePost:n}=e(no);return{onClick:()=>{t({status:"draft"}),n()}}}))])((function(e){let{isSaving:t,isPublished:n,isScheduled:o,onClick:r}=e;const s=(0,u.useViewportMatch)("small","<"),[a,l]=(0,i.useState)(!1);if(!n&&!o)return null;let c;return n?c=(0,Xt.__)("Are you sure you want to unpublish this post?"):o&&(c=(0,Xt.__)("Are you sure you want to unschedule this post?")),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.Button,{className:"editor-post-switch-to-draft",onClick:()=>{l(!0)},disabled:t,variant:"tertiary"},s?(0,Xt.__)("Draft"):(0,Xt.__)("Switch to draft")),(0,i.createElement)(To.__experimentalConfirmDialog,{isOpen:a,onConfirm:()=>{l(!1),r()},onCancel:()=>l(!1)},c))}));function os(e){let{forceIsDirty:t,forceIsSaving:n,showIconLabels:o=!1}=e;const[r,s]=(0,i.useState)(!1),a=(0,u.useViewportMatch)("small"),{isAutosaving:c,isDirty:d,isNew:p,isPending:m,isPublished:h,isSaveable:g,isSaving:f,isScheduled:v,hasPublishAction:_}=(0,l.useSelect)((e=>{var o,r,i;const{isEditedPostNew:s,isCurrentPostPublished:a,isCurrentPostScheduled:l,isEditedPostDirty:c,isSavingPost:u,isEditedPostSaveable:d,getCurrentPost:p,isAutosavingPost:m,getEditedPostAttribute:h}=e(no);return{isAutosaving:m(),isDirty:t||c(),isNew:s(),isPending:"pending"===h("status"),isPublished:a(),isSaving:n||u(),isSaveable:d(),isScheduled:l(),hasPublishAction:null!==(o=null===(r=p())||void 0===r||null===(i=r._links)||void 0===i?void 0:i["wp:action-publish"])&&void 0!==o&&o}}),[t,n]),{savePost:y}=(0,l.useDispatch)(no),b=(0,u.usePrevious)(f);if((0,i.useEffect)((()=>{let e;return b&&!f&&(s(!0),e=setTimeout((()=>{s(!1)}),1e3)),()=>clearTimeout(e)}),[f]),!_&&m)return null;if(h||v)return(0,i.createElement)(ns,null);const E=m?(0,Xt.__)("Save as pending"):(0,Xt.__)("Save draft"),w=(0,Xt.__)("Save"),S=r||!p&&!d,P=f||S,k=f||S||!g;let C;return f?C=c?(0,Xt.__)("Autosaving"):(0,Xt.__)("Saving"):S?C=(0,Xt.__)("Saved"):a?C=E:o&&(C=w),(0,i.createElement)(To.Button,{className:g||f?uo()({"editor-post-save-draft":!P,"editor-post-saved-state":P,"is-saving":f,"is-autosaving":c,"is-saved":S,[(0,To.__unstableGetAnimateClassName)({type:"loading"})]:f}):void 0,onClick:k?void 0:()=>y(),shortcut:k?void 0:ko.displayShortcut.primary("s"),showTooltip:!0,variant:"tertiary",icon:a?void 0:Zi,label:C||E,"aria-disabled":k},P&&(0,i.createElement)(Ji,{icon:S?es:ts}),C)}var rs=(0,u.compose)([(0,l.withSelect)((e=>{const{getCurrentPost:t,getCurrentPostType:n}=e(no);return{hasPublishAction:(0,s.get)(t(),["_links","wp:action-publish"],!1),postType:n()}}))])((function(e){let{hasPublishAction:t,children:n}=e;return t?n:null}));function is(e){let{children:t}=e;return(0,i.createElement)(Qo,{supportKeys:"slug"},t)}class ss extends i.Component{constructor(e){let{postSlug:t,postTitle:n,postID:o}=e;super(...arguments),this.state={editedSlug:(0,E.safeDecodeURIComponent)(t)||(0,E.cleanForSlug)(n)||o},this.setSlug=this.setSlug.bind(this)}setSlug(e){const{postSlug:t,onUpdateSlug:n}=this.props,{value:o}=e.target,r=(0,E.cleanForSlug)(o);r!==t&&n(r)}render(){const{editedSlug:e}=this.state;return(0,i.createElement)(is,null,(0,i.createElement)(To.TextControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Slug"),autoComplete:"off",spellCheck:"false",value:e,onChange:e=>this.setState({editedSlug:e}),onBlur:this.setSlug,className:"editor-post-slug"}))}}var as=(0,u.compose)([(0,l.withSelect)((e=>{const{getCurrentPost:t,getEditedPostAttribute:n}=e(no),{id:o}=t();return{postSlug:n("slug"),postTitle:n("title"),postID:o}})),(0,l.withDispatch)((e=>{const{editPost:t}=e(no);return{onUpdateSlug(e){t({slug:e})}}}))])(ss);var ls=(0,u.compose)([(0,l.withSelect)((e=>{const t=e(no).getCurrentPost();return{hasStickyAction:(0,s.get)(t,["_links","wp:action-sticky"],!1),postType:e(no).getCurrentPostType()}}))])((function(e){let{hasStickyAction:t,postType:n,children:o}=e;return"post"===n&&t?o:null}));var cs=(0,u.compose)([(0,l.withSelect)((e=>({postSticky:e(no).getEditedPostAttribute("sticky")}))),(0,l.withDispatch)((e=>({onUpdateSticky(t){e(no).editPost({sticky:t})}})))])((function(e){let{onUpdateSticky:t,postSticky:n=!1}=e;return(0,i.createElement)(ls,null,(0,i.createElement)(To.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Stick to the top of the blog"),checked:n,onChange:()=>t(!n)}))}));const us=e=>e;var ds=(0,u.compose)([(0,l.withSelect)((e=>({postType:e(no).getCurrentPostType(),taxonomies:e(c.store).getTaxonomies({per_page:-1})})))])((function(e){let{postType:t,taxonomies:n,taxonomyWrapper:o=us}=e;return(null!=n?n:[]).filter((e=>e.types.includes(t))).filter((e=>{var t;return null===(t=e.visibility)||void 0===t?void 0:t.show_ui})).map((e=>{const t=e.hierarchical?Wi:Di;return(0,i.createElement)(i.Fragment,{key:`taxonomy-${e.slug}`},o((0,i.createElement)(t,{slug:e.slug}),e))}))}));var ps=(0,u.compose)([(0,l.withSelect)((e=>({postType:e(no).getCurrentPostType(),taxonomies:e(c.store).getTaxonomies({per_page:-1})})))])((function(e){let{postType:t,taxonomies:n,children:o}=e;return(null==n?void 0:n.some((e=>e.types.includes(t))))?o:null})),ms=n(773);function hs(){const e=(0,l.useSelect)((e=>e(no).getEditedPostContent()),[]),{editPost:t,resetEditorBlocks:n}=(0,l.useDispatch)(no),[o,r]=(0,i.useState)(e),[s,c]=(0,i.useState)(!1),d=(0,u.useInstanceId)(hs),p=(0,i.useRef)();s||o===e||r(e);return(0,i.useEffect)((()=>()=>{if(p.current){const e=(0,a.parse)(p.current);n(e)}}),[]),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(To.VisuallyHidden,{as:"label",htmlFor:`post-content-${d}`},(0,Xt.__)("Type text or HTML")),(0,i.createElement)(ms.Z,{autoComplete:"off",dir:"auto",value:o,onChange:e=>{const n=e.target.value;t({content:n}),r(n),c(!0),p.current=n},onBlur:()=>{if(s){const e=(0,a.parse)(o);n(e),c(!1)}},className:"editor-post-text-editor",id:`post-content-${d}`,placeholder:(0,Xt.__)("Start writing with text or HTML")}))}var gs=window.wp.dom;const fs=/[\r\n]+/g;var vs=(0,i.forwardRef)((function(e,t){const n=(0,i.useRef)(),[o,r]=(0,i.useState)(!1),{editPost:s}=(0,l.useDispatch)(no),{insertDefaultBlock:c,clearSelectedBlock:d,insertBlocks:m}=(0,l.useDispatch)(p.store),{isCleanNewPost:h,title:g,placeholder:f,hasFixedToolbar:v}=(0,l.useSelect)((e=>{const{getEditedPostAttribute:t,isCleanNewPost:n}=e(no),{getSettings:o}=e(p.store),{titlePlaceholder:r,hasFixedToolbar:i}=o();return{isCleanNewPost:n(),title:t("title"),placeholder:r,hasFixedToolbar:i}}),[]);function _(e){m(e,0)}function y(e){s({title:e})}(0,i.useImperativeHandle)(t,(()=>({focus:()=>{var e;null==n||null===(e=n.current)||void 0===e||e.focus()}}))),(0,i.useEffect)((()=>{if(!n.current)return;const{ownerDocument:e}=n.current,{activeElement:t,body:o}=e;!h||t&&o!==t||n.current.focus()}),[h]);const[b,E]=(0,i.useState)({});function w(){r(!1),E({})}const S=uo()("wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",{"is-selected":o,"has-fixed-toolbar":v}),P=(0,Lo.decodeEntities)(f)||(0,Xt.__)("Add title"),{ref:k}=(0,lo.__unstableUseRichText)({value:g,onChange:function(e){y(e.replace(fs," "))},placeholder:P,selectionStart:b.start,selectionEnd:b.end,onSelectionChange(e,t){E((n=>{const{start:o,end:r}=n;return o===e&&r===t?n:{start:e,end:t}}))},__unstableDisableFormats:!0,preserveWhiteSpace:!0});return(0,i.createElement)(Qo,{supportKeys:"title"},(0,i.createElement)("h1",{ref:(0,u.useMergeRefs)([k,n]),contentEditable:!0,className:S,"aria-label":P,role:"textbox","aria-multiline":"true",onFocus:function(){r(!0),d()},onBlur:w,onKeyDown:function(e){e.keyCode===ko.ENTER&&(e.preventDefault(),c(void 0,void 0,0))},onKeyPress:w,onPaste:function(e){const t=e.clipboardData;let n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}window.console.log("Received HTML:\n\n",o),window.console.log("Received plain text:\n\n",n);const r=(0,a.pasteHandler)({HTML:o,plainText:n});if(e.preventDefault(),r.length)if("string"!=typeof r){const[e]=r;g||"core/heading"!==e.name&&"core/paragraph"!==e.name?_(r):(y((0,gs.__unstableStripHTML)(e.attributes.content)),_(r.slice(1)))}else{const e={...(0,lo.create)({html:g}),...b},t=(0,lo.insert)(e,(0,lo.create)({html:(0,gs.__unstableStripHTML)(r)}));y((0,lo.toHTMLString)({value:t})),E({start:t.start,end:t.end})}}}))}));function _s(){const{isNew:e,isDeleting:t,postId:n}=(0,l.useSelect)((e=>{const t=e(no);return{isNew:t.isEditedPostNew(),isDeleting:t.isDeletingPost(),postId:t.getCurrentPostId()}}),[]),{trashPost:o}=(0,l.useDispatch)(no);return e||!n?null:(0,i.createElement)(To.Button,{className:"editor-post-trash",isDestructive:!0,variant:"secondary",isBusy:t,"aria-disabled":t,onClick:t?void 0:()=>o()},(0,Xt.__)("Move to trash"))}var ys=(0,l.withSelect)((e=>{const{isEditedPostNew:t,getCurrentPostId:n,getCurrentPostType:o}=e(no),{getPostType:r,canUser:i}=e(c.store),s=n(),a=r(o()),l=(null==a?void 0:a.rest_base)||"";return{isNew:t(),postId:s,canUserDelete:!(!s||!l)&&i("delete",l,s)}}))((function(e){let{isNew:t,postId:n,canUserDelete:o,children:r}=e;return!t&&n&&o?r:null}));function bs(e){let{onClose:t}=e;const{isEditable:n,postSlug:o,viewPostLabel:r,postLink:s,permalinkPrefix:a,permalinkSuffix:u}=(0,l.useSelect)((e=>{var t,n;const o=e(no).getCurrentPost(),r=e(no).getCurrentPostType(),i=e(c.store).getPostType(r),s=e(no).getPermalinkParts(),a=null!==(t=null==o||null===(n=o._links)||void 0===n?void 0:n["wp:action-publish"])&&void 0!==t&&t;return{isEditable:e(no).isPermalinkEditable()&&a,postSlug:(0,E.safeDecodeURIComponent)(e(no).getEditedPostSlug()),viewPostLabel:null==i?void 0:i.labels.view_item,postLink:o.link,permalinkPrefix:null==s?void 0:s.prefix,permalinkSuffix:null==s?void 0:s.suffix}}),[]),{editPost:d}=(0,l.useDispatch)(no),[m,h]=(0,i.useState)(!1);return(0,i.createElement)("div",{className:"editor-post-url"},(0,i.createElement)(p.__experimentalInspectorPopoverHeader,{title:(0,Xt.__)("URL"),onClose:t}),n&&(0,i.createElement)(To.TextControl,{__nextHasNoMarginBottom:!0,label:(0,Xt.__)("Permalink"),value:m?"":o,autoComplete:"off",spellCheck:"false",help:(0,i.createElement)(i.Fragment,null,(0,Xt.__)("The last part of the URL.")," ",(0,i.createElement)(To.ExternalLink,{href:(0,Xt.__)("https://wordpress.org/support/article/settings-sidebar/#permalink")},(0,Xt.__)("Learn more."))),onChange:e=>{d({slug:e}),e?m&&h(!1):m||h(!0)},onBlur:e=>{d({slug:(0,E.cleanForSlug)(e.target.value)}),m&&h(!1)}}),n&&(0,i.createElement)("h3",{className:"editor-post-url__link-label"},null!=r?r:(0,Xt.__)("View post")),(0,i.createElement)("p",null,(0,i.createElement)(To.ExternalLink,{className:"editor-post-url__link",href:s,target:"_blank"},n?(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",{className:"editor-post-url__link-prefix"},a),(0,i.createElement)("span",{className:"editor-post-url__link-slug"},o),(0,i.createElement)("span",{className:"editor-post-url__link-suffix"},u)):s)))}function Es(e){let{children:t}=e;const n=(0,l.useSelect)((e=>{const t=e(no).getCurrentPostType(),n=e(c.store).getPostType(t);if(null==n||!n.viewable)return!1;if(!e(no).getCurrentPost().link)return!1;return!!e(no).getPermalinkParts()}),[]);return n?t:null}function ws(){return Ss()}function Ss(){const e=(0,l.useSelect)((e=>e(no).getPermalink()),[]);return(0,E.filterURLForDisplay)((0,E.safeDecodeURIComponent)(e))}var Ps=(0,u.compose)([(0,l.withSelect)((e=>{const{getCurrentPost:t,getCurrentPostType:n}=e(no);return{hasPublishAction:(0,s.get)(t(),["_links","wp:action-publish"],!1),postType:n()}}))])((function(e){let{hasPublishAction:t,render:n}=e;return n({canEdit:t})}));var ks=(0,i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(P.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),Cs=window.wp.wordcount;function Ts(){const e=(0,l.useSelect)((e=>e(no).getEditedPostAttribute("content")),[]),t=(0,Xt._x)("words","Word count type. Do not translate!");return(0,i.createElement)("span",{className:"word-count"},(0,Cs.count)(e,t))}function xs(){const e=(0,l.useSelect)((e=>e(no).getEditedPostAttribute("content")),[]),t=(0,Xt._x)("words","Word count type. Do not translate!"),n=Math.round((0,Cs.count)(e,t)/189),o=0===n?(0,i.createInterpolateElement)((0,Xt.__)("< 1 minute"),{span:(0,i.createElement)("span",null)}):(0,i.createInterpolateElement)((0,Xt.sprintf)((0,Xt._n)("%d minute","%d minutes",n),n),{span:(0,i.createElement)("span",null)});return(0,i.createElement)("span",{className:"time-to-read"},o)}function Bs(){const e=(0,l.useSelect)((e=>e(no).getEditedPostAttribute("content")),[]);return(0,Cs.count)(e,"characters_including_spaces")}var As=function(e){let{hasOutlineItemsDisabled:t,onRequestClose:n}=e;const{headingCount:o,paragraphCount:r,numberOfBlocks:s}=(0,l.useSelect)((e=>{const{getGlobalBlockCount:t}=e(p.store);return{headingCount:t("core/heading"),paragraphCount:t("core/paragraph"),numberOfBlocks:t()}}),[]);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":(0,Xt.__)("Document Statistics"),tabIndex:"0"},(0,i.createElement)("ul",{role:"list",className:"table-of-contents__counts"},(0,i.createElement)("li",{className:"table-of-contents__count"},(0,Xt.__)("Words"),(0,i.createElement)(Ts,null)),(0,i.createElement)("li",{className:"table-of-contents__count"},(0,Xt.__)("Characters"),(0,i.createElement)("span",{className:"table-of-contents__number"},(0,i.createElement)(Bs,null))),(0,i.createElement)("li",{className:"table-of-contents__count"},(0,Xt.__)("Time to read"),(0,i.createElement)(xs,null)),(0,i.createElement)("li",{className:"table-of-contents__count"},(0,Xt.__)("Headings"),(0,i.createElement)("span",{className:"table-of-contents__number"},o)),(0,i.createElement)("li",{className:"table-of-contents__count"},(0,Xt.__)("Paragraphs"),(0,i.createElement)("span",{className:"table-of-contents__number"},r)),(0,i.createElement)("li",{className:"table-of-contents__count"},(0,Xt.__)("Blocks"),(0,i.createElement)("span",{className:"table-of-contents__number"},s)))),o>0&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("hr",null),(0,i.createElement)("h2",{className:"table-of-contents__title"},(0,Xt.__)("Document Outline")),(0,i.createElement)(yo,{onSelect:n,hasOutlineItemsDisabled:t})))};var Is=(0,i.forwardRef)((function(e,t){let{hasOutlineItemsDisabled:n,repositionDropdown:o,...s}=e;const a=(0,l.useSelect)((e=>!!e(p.store).getBlockCount()),[]);return(0,i.createElement)(To.Dropdown,{popoverProps:{placement:o?"right":"bottom"},className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,i.createElement)(To.Button,r({},s,{ref:t,onClick:a?o:void 0,icon:ks,"aria-expanded":n,"aria-haspopup":"true",label:(0,Xt.__)("Details"),tooltipPosition:"bottom","aria-disabled":!a}))},renderContent:e=>{let{onClose:t}=e;return(0,i.createElement)(As,{onRequestClose:t,hasOutlineItemsDisabled:n})}})}));function Ns(){const e=(0,l.useSelect)((e=>()=>{const{__experimentalGetDirtyEntityRecords:t}=e(c.store);return t().length>0}),[]),t=t=>{if(e())return t.returnValue=(0,Xt.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return(0,i.useEffect)((()=>(window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)})),[]),null}var Ds=window.wp.reusableBlocks;var Rs=(0,u.createHigherOrderComponent)((e=>(0,l.withRegistry)((t=>{const{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,i.createElement)(e,r);const[s,a]=(0,i.useState)(null);return(0,i.useEffect)((()=>{const e=(0,l.createRegistry)({"core/block-editor":p.storeConfig},o);e.registerStore("core/editor",to),a(e)}),[o]),s?(0,i.createElement)(l.RegistryProvider,{value:s},(0,i.createElement)(e,r)):null}))),"withRegistryProvider");const Ls=(e,t)=>`${t}`,Os=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,Us=e=>{const{title:t,foreign_landing_url:n,creator:o,creator_url:r,license:i,license_version:s,license_url:a}=e,l=((e,t)=>{let n=e.trim();return"pdm"!==e&&(n=e.toUpperCase().replace("SAMPLING","Sampling")),t&&(n+=` ${t}`),["pdm","cc0"].includes(e)||(n=`CC ${n}`),n})(i,s),c=(0,Lo.decodeEntities)(o);let u;return u=c?t?(0,Xt.sprintf)((0,Xt._x)('"%1$s" by %2$s/ %3$s',"caption"),Ls(n,(0,Lo.decodeEntities)(t)),r?Ls(r,c):c,a?Ls(`${a}?ref=openverse`,l):l):(0,Xt.sprintf)((0,Xt._x)("Work by %2$s/ %3$s","caption"),Os(n),r?Ls(r,c):c,a?Ls(`${a}?ref=openverse`,l):l):t?(0,Xt.sprintf)((0,Xt._x)('"%1$s"/ %2$s',"caption"),Ls(n,(0,Lo.decodeEntities)(t)),a?Ls(`${a}?ref=openverse`,l):l):(0,Xt.sprintf)((0,Xt._x)("Work/ %2$s","caption"),Os(n),a?Ls(`${a}?ref=openverse`,l):l),u.replace(/\s{2}/g," ")},Ms=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=await(0,l.resolveSelect)(c.store).getMediaItems({...e,orderBy:null!=e&&e.search?"relevance":"date"});return t.map((e=>{var t,n,o,r;return{...e,alt:e.alt_text,url:e.source_url,previewUrl:null===(t=e.media_details)||void 0===t||null===(n=t.sizes)||void 0===n||null===(o=n.medium)||void 0===o?void 0:o.source_url,caption:null===(r=e.caption)||void 0===r?void 0:r.raw}}))},Fs=[{name:"images",labels:{name:(0,Xt.__)("Images"),search_items:(0,Xt.__)("Search images")},mediaType:"image",async fetch(){return Ms({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},media_type:"image"})}},{name:"videos",labels:{name:(0,Xt.__)("Videos"),search_items:(0,Xt.__)("Search videos")},mediaType:"video",async fetch(){return Ms({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},media_type:"video"})}},{name:"audio",labels:{name:(0,Xt.__)("Audio"),search_items:(0,Xt.__)("Search audio")},mediaType:"audio",async fetch(){return Ms({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},media_type:"audio"})}},{name:"openverse",labels:{name:(0,Xt.__)("Openverse"),search_items:(0,Xt.__)("Search Openverse")},mediaType:"image",async fetch(){const e={...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},mature:!1,excluded_source:"flickr,inaturalist,wikimedia",license:"pdm,cc0"},t={per_page:"page_size",search:"q"},n=new URL("https://api.openverse.engineering/v1/images/");Object.entries(e).forEach((e=>{let[o,r]=e;const i=t[o]||o;n.searchParams.set(i,r)}));const o=await window.fetch(n,{headers:{"User-Agent":"WordPress/inserter-media-fetch"}});return(await o.json()).results.map((e=>{var t;return{...e,title:null!==(t=e.title)&&void 0!==t&&t.toLowerCase().startsWith("file:")?e.title.slice(5):e.title,sourceId:e.id,id:void 0,caption:Us(e),previewUrl:e.thumbnail}}))},getReportUrl:e=>{let{sourceId:t}=e;return`https://wordpress.org/openverse/image/${t}/report/`},isExternalResource:!0}];var zs=Fs,Hs=window.wp.mediaUtils;const Vs=()=>{};function Ws(e){let{additionalData:t={},allowedTypes:n,filesList:o,maxUploadFileSize:r,onError:i=Vs,onFileChange:s}=e;const{getCurrentPostId:a,getEditorSettings:c}=(0,l.select)(no),u=c().allowedMimeTypes;r=r||c().maxUploadFileSize,(0,Hs.uploadMedia)({allowedTypes:n,filesList:o,onFileChange:s,additionalData:{post:a(),...t},maxUploadFileSize:r,onError:e=>{let{message:t}=e;return i(t)},wpAllowedMimeTypes:u})}const js=[],$s=["__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","__experimentalPreferredStyleVariations","__experimentalSetIsInserterOpened","__unstableGalleryWithImageBlocks","alignWide","allowedBlockTypes","blockInspectorTabs","allowedMimeTypes","bodyPlaceholder","canLockBlocks","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","focusMode","fontSizes","gradients","generateAnchors","hasFixedToolbar","hasInlineToolbar","isDistractionFree","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isRTL","keepCaretInsideBlock","locale","maxWidth","onUpdateDefaultBlockStyles","postsPerPage","readOnly","styles","template","templateLock","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableIsPreviewMode","__unstableResolvedAssets","__unstableIsBlockBasedTheme"];var Gs=function(e,t){var n,o;const{reusableBlocks:r,hasUploadPermissions:s,canUseUnfilteredHTML:a,userCanCreatePages:u,pageOnFront:d,postType:p}=(0,l.useSelect)((e=>{var t;const{canUserUseUnfilteredHTML:n,getCurrentPostType:o}=e(no),r="web"===i.Platform.OS,{canUser:s,getEntityRecord:a}=e(c.store),l=s("read","settings")?a("root","site"):void 0;return{canUseUnfilteredHTML:n(),reusableBlocks:r?e(c.store).getEntityRecords("postType","wp_block",{per_page:-1}):js,hasUploadPermissions:null===(t=s("create","media"))||void 0===t||t,userCanCreatePages:s("create","pages"),pageOnFront:null==l?void 0:l.page_on_front,postType:o()}}),[]),m=null!==(n=e.__experimentalAdditionalBlockPatterns)&&void 0!==n?n:e.__experimentalBlockPatterns,h=null!==(o=e.__experimentalAdditionalBlockPatternCategories)&&void 0!==o?o:e.__experimentalBlockPatternCategories,{restBlockPatterns:g,restBlockPatternCategories:f}=(0,l.useSelect)((e=>({restBlockPatterns:e(c.store).getBlockPatterns(),restBlockPatternCategories:e(c.store).getBlockPatternCategories()})),[]),v=(0,i.useMemo)((()=>[...m||[],...g||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name)))).filter((e=>{let{postTypes:t}=e;return!t||Array.isArray(t)&&t.includes(p)}))),[m,g,p]),_=(0,i.useMemo)((()=>[...h||[],...f||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))),[h,f]),{undo:y}=(0,l.useDispatch)(no),{saveEntityRecord:b}=(0,l.useDispatch)(c.store),E=e=>u?b("postType","page",e):Promise.reject({message:(0,Xt.__)("You do not have permission to create Pages.")});return(0,i.useMemo)((()=>({...Object.fromEntries(Object.entries(e).filter((e=>{let[t]=e;return $s.includes(t)}))),mediaUpload:s?Ws:void 0,__experimentalReusableBlocks:r,__experimentalBlockPatterns:v,__experimentalBlockPatternCategories:_,__experimentalFetchLinkSuggestions:(t,n)=>(0,c.__experimentalFetchLinkSuggestions)(t,n,e),inserterMediaCategories:zs,__experimentalFetchRichUrlData:c.__experimentalFetchUrlData,__experimentalCanUserUseUnfilteredHTML:a,__experimentalUndo:y,outlineMode:t,__experimentalCreatePageEntity:E,__experimentalUserCanCreatePages:u,pageOnFront:d,__experimentalPreferPatternsOnRoot:t})),[e,s,r,v,_,a,y,t,u,d])},Ks=window.wp.privateApis;const{lock:Ys,unlock:qs}=(0,Ks.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/editor"),{ExperimentalBlockEditorProvider:Qs}=qs(p.privateApis),Xs=Rs((e=>{let{__unstableTemplate:t,post:n,settings:o,recovery:r,initialEdits:s,children:a,BlockEditorProviderComponent:u=Qs}=e;const d=(0,i.useMemo)((()=>"wp_template"===n.type?{}:{postId:n.id,postType:n.type}),[n.id,n.type]),{editorSettings:m,selection:h,isReady:g}=(0,l.useSelect)((e=>{const{getEditorSettings:t,getEditorSelection:n,__unstableIsEditorReady:o}=e(no);return{editorSettings:t(),isReady:o(),selection:n()}}),[]),{id:f,type:v}=null!=t?t:n,[_,y,b]=(0,c.useEntityBlockEditor)("postType",v,{id:f}),E=Gs(m,!!t),{updatePostLock:w,setupEditor:S,updateEditorSettings:P,__experimentalTearDownEditor:k}=(0,l.useDispatch)(no),{createWarningNotice:C}=(0,l.useDispatch)(Kt.store);return(0,i.useLayoutEffect)((()=>{if(!r)return w(o.postLock),S(n,s,o.template),o.autosave&&C((0,Xt.__)("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:(0,Xt.__)("View the autosave"),url:o.autosave.editLink}]}),()=>{k()}}),[]),(0,i.useEffect)((()=>{P(o)}),[o]),g?(0,i.createElement)(c.EntityProvider,{kind:"root",type:"site"},(0,i.createElement)(c.EntityProvider,{kind:"postType",type:n.type,id:n.id},(0,i.createElement)(p.BlockContextProvider,{value:d},(0,i.createElement)(u,{value:_,onChange:b,onInput:y,selection:h,settings:E,useSubRegistry:!1},a,(0,i.createElement)(Ds.ReusableBlocksMenuItems,null))))):null}));var Zs=function(e){return(0,i.createElement)(Xs,r({},e,{BlockEditorProviderComponent:p.BlockEditorProvider}),e.children)},Js=window.wp.serverSideRender,ea=n.n(Js);function ta(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const o=(0,i.forwardRef)(((n,o)=>(S()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),(0,i.createElement)(t,r({ref:o},n)))));return n.forEach((n=>{o[n]=ta(e+"."+n,t[n])})),o}function na(e,t){return function(){return S()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),t(...arguments)}}const oa=ta("RichText",p.RichText,["Content"]);oa.isEmpty=na("RichText.isEmpty",p.RichText.isEmpty);const ra=ta("Autocomplete",p.Autocomplete),ia=ta("AlignmentToolbar",p.AlignmentToolbar),sa=ta("BlockAlignmentToolbar",p.BlockAlignmentToolbar),aa=ta("BlockControls",p.BlockControls,["Slot"]),la=ta("BlockEdit",p.BlockEdit),ca=ta("BlockEditorKeyboardShortcuts",p.BlockEditorKeyboardShortcuts),ua=ta("BlockFormatControls",p.BlockFormatControls,["Slot"]),da=ta("BlockIcon",p.BlockIcon),pa=ta("BlockInspector",p.BlockInspector),ma=ta("BlockList",p.BlockList),ha=ta("BlockMover",p.BlockMover),ga=ta("BlockNavigationDropdown",p.BlockNavigationDropdown),fa=ta("BlockSelectionClearer",p.BlockSelectionClearer),va=ta("BlockSettingsMenu",p.BlockSettingsMenu),_a=ta("BlockTitle",p.BlockTitle),ya=ta("BlockToolbar",p.BlockToolbar),ba=ta("ColorPalette",p.ColorPalette),Ea=ta("ContrastChecker",p.ContrastChecker),wa=ta("CopyHandler",p.CopyHandler),Sa=ta("DefaultBlockAppender",p.DefaultBlockAppender),Pa=ta("FontSizePicker",p.FontSizePicker),ka=ta("Inserter",p.Inserter),Ca=ta("InnerBlocks",p.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),Ta=ta("InspectorAdvancedControls",p.InspectorAdvancedControls,["Slot"]),xa=ta("InspectorControls",p.InspectorControls,["Slot"]),Ba=ta("PanelColorSettings",p.PanelColorSettings),Aa=ta("PlainText",p.PlainText),Ia=ta("RichTextShortcut",p.RichTextShortcut),Na=ta("RichTextToolbarButton",p.RichTextToolbarButton),Da=ta("__unstableRichTextInputEvent",p.__unstableRichTextInputEvent),Ra=ta("MediaPlaceholder",p.MediaPlaceholder),La=ta("MediaUpload",p.MediaUpload),Oa=ta("MediaUploadCheck",p.MediaUploadCheck),Ua=ta("MultiSelectScrollIntoView",p.MultiSelectScrollIntoView),Ma=ta("NavigableToolbar",p.NavigableToolbar),Fa=ta("ObserveTyping",p.ObserveTyping),za=ta("SkipToSelectedBlock",p.SkipToSelectedBlock),Ha=ta("URLInput",p.URLInput),Va=ta("URLInputButton",p.URLInputButton),Wa=ta("URLPopover",p.URLPopover),ja=ta("Warning",p.Warning),$a=ta("WritingFlow",p.WritingFlow),Ga=na("createCustomColorsHOC",p.createCustomColorsHOC),Ka=na("getColorClassName",p.getColorClassName),Ya=na("getColorObjectByAttributeValues",p.getColorObjectByAttributeValues),qa=na("getColorObjectByColorValue",p.getColorObjectByColorValue),Qa=na("getFontSize",p.getFontSize),Xa=na("getFontSizeClass",p.getFontSizeClass),Za=na("withColorContext",p.withColorContext),Ja=na("withColors",p.withColors),el=na("withFontSizes",p.withFontSizes);function tl(e){return S()("wp.editor.cleanForSlug",{since:"12.7",plugin:"Gutenberg",alternative:"wp.url.cleanForSlug"}),(0,E.cleanForSlug)(e)}const nl={};Ys(nl,{ExperimentalEditorProvider:Xs})}(),(window.wp=window.wp||{}).editor=o}(); \ No newline at end of file diff --git a/wp-includes/js/dist/rich-text.js b/wp-includes/js/dist/rich-text.js index 93648139d4..7758b9da4e 100644 --- a/wp-includes/js/dist/rich-text.js +++ b/wp-includes/js/dist/rich-text.js @@ -4436,6 +4436,12 @@ function useRichText(_ref) { }, [placeholder, ...__unstableDependencies])]); return { value: record.current, + // A function to get the most recent value so event handlers in + // useRichText implementations have access to it. For example when + // listening to input events, we internally update the state, but this + // state is not yet available to the input event handler because React + // may re-render asynchronously. + getValue: () => record.current, onChange: handleChange, ref: mergedRefs }; diff --git a/wp-includes/js/dist/rich-text.min.js b/wp-includes/js/dist/rich-text.min.js index 16380c8f89..2cbcac2c81 100644 --- a/wp-includes/js/dist/rich-text.min.js +++ b/wp-includes/js/dist/rich-text.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(){"use strict";var e={n:function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{__UNSTABLE_LINE_SEPARATOR:function(){return E},__experimentalRichText:function(){return Ge},__unstableCreateElement:function(){return T},__unstableFormatEdit:function(){return Ze},__unstableInsertLineSeparator:function(){return Y},__unstableIsEmptyLine:function(){return I},__unstableToDom:function(){return me},__unstableUseRichText:function(){return Ye},applyFormat:function(){return b},concat:function(){return O},create:function(){return _},getActiveFormat:function(){return k},getActiveFormats:function(){return W},getActiveObject:function(){return M},getTextContent:function(){return j},insert:function(){return q},insertObject:function(){return G},isCollapsed:function(){return P},isEmpty:function(){return V},join:function(){return B},registerFormatType:function(){return H},remove:function(){return K},removeFormat:function(){return z},replace:function(){return X},slice:function(){return Z},split:function(){return J},store:function(){return g},toHTMLString:function(){return ve},toggleFormat:function(){return Se},unregisterFormatType:function(){return Le},useAnchor:function(){return Me},useAnchorRef:function(){return ke}});var n={};e.r(n),e.d(n,{getFormatType:function(){return u},getFormatTypeForBareElement:function(){return f},getFormatTypeForClassName:function(){return d},getFormatTypes:function(){return l}});var r={};e.r(r),e.d(r,{addFormatTypes:function(){return m},removeFormatTypes:function(){return p}});var a=window.wp.data;var o=(0,a.combineReducers)({formatTypes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_FORMAT_TYPES":return{...e,...t.formatTypes.reduce(((e,t)=>({...e,[t.name]:t})),{})};case"REMOVE_FORMAT_TYPES":return Object.fromEntries(Object.entries(e).filter((e=>{let[n]=e;return!t.names.includes(n)})))}return e}}),i={};function s(e){return[e]}function c(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;rObject.values(e.formatTypes)),(e=>[e.formatTypes]));function u(e,t){return e.formatTypes[t]}function f(e,t){const n=l(e);return n.find((e=>{let{className:n,tagName:r}=e;return null===n&&t===r}))||n.find((e=>{let{className:t,tagName:n}=e;return null===t&&"*"===n}))}function d(e,t){return l(e).find((e=>{let{className:n}=e;return null!==n&&` ${t} `.indexOf(` ${n} `)>=0}))}function m(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function p(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}const g=(0,a.createReduxStore)("core/rich-text",{reducer:o,selectors:n,actions:r});function h(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.type!==t.type)return!1;const n=e.attributes,r=t.attributes;if(n===r)return!0;if(!n||!r)return!1;const a=Object.keys(n),o=Object.keys(r);if(a.length!==o.length)return!1;const i=a.length;for(let e=0;e{const r=t[n-1];if(r){const a=e.slice();a.forEach(((e,t)=>{const n=r[t];h(e,n)&&(a[t]=n)})),t[n]=a}})),{...e,formats:t}}function y(e,t,n){return(e=e.slice())[t]=n,e}function b(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.start,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.end;const{formats:a,activeFormats:o}=e,i=a.slice();if(n===r){var s;const e=null===(s=i[n])||void 0===s?void 0:s.find((e=>{let{type:n}=e;return n===t.type}));if(e){const a=i[n].indexOf(e);for(;i[n]&&i[n][a]===e;)i[n]=y(i[n],a,t),n--;for(r++;i[r]&&i[r][a]===e;)i[r]=y(i[r],a,t),r++}}else{let e=1/0;for(let a=n;a{let{type:n}=e;return n!==t.type}));const n=i[a].length;n{let{type:n}=e;return n!==t.type})))||[],t]})}function T(e,t){let{implementation:n}=e;return T.body||(T.body=n.createHTMLDocument("").body),T.body.innerHTML=t,T.body}(0,a.register)(g);const E="\u2028",x="";function w(e){let t,{tagName:n,attributes:r}=e;if(r&&r.class&&(t=(0,a.select)(g).getFormatTypeForClassName(r.class),t&&(r.class=` ${r.class} `.replace(` ${t.className} `," ").trim(),r.class||delete r.class)),t||(t=(0,a.select)(g).getFormatTypeForBareElement(n)),!t)return r?{type:n,attributes:r}:{type:n};if(t.__experimentalCreatePrepareEditableTree&&!t.__experimentalCreateOnChangeEditableValue)return null;if(!r)return{type:t.name,tagName:n};const o={},i={},s={...r};for(const e in t.attributes){const n=t.attributes[e];o[e]=s[n],t.__unstableFilterAttributeValue&&(o[e]=t.__unstableFilterAttributeValue(e,o[e])),delete s[n],void 0===o[e]&&delete o[e]}for(const e in s)i[e]=r[e];return{type:t.name,tagName:n,attributes:o,unregisteredAttributes:i}}function _(){let{element:e,text:t,html:n,range:r,multilineTag:a,multilineWrapperTags:o,__unstableIsEditableTree:i,preserveWhiteSpace:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"string"==typeof t&&t.length>0?{formats:Array(t.length),replacements:Array(t.length),text:t}:("string"==typeof n&&n.length>0&&(e=T(document,n)),"object"!=typeof e?{formats:[],replacements:[],text:""}:a?S({element:e,range:r,multilineTag:a,multilineWrapperTags:o,isEditableTree:i,preserveWhiteSpace:s}):R({element:e,range:r,isEditableTree:i,preserveWhiteSpace:s}))}function N(e,t,n,r){if(!n)return;const{parentNode:a}=t,{startContainer:o,startOffset:i,endContainer:s,endOffset:c}=n,l=e.text.length;void 0!==r.start?e.start=l+r.start:t===o&&t.nodeType===t.TEXT_NODE?e.start=l+i:a===o&&t===o.childNodes[i]?e.start=l:a===o&&t===o.childNodes[i-1]?e.start=l+r.text.length:t===o&&(e.start=l),void 0!==r.end?e.end=l+r.end:t===s&&t.nodeType===t.TEXT_NODE?e.end=l+c:a===s&&t===s.childNodes[c-1]?e.end=l+r.text.length:a===s&&t===s.childNodes[c]?e.end=l:t===s&&(e.end=l+c)}function F(e,t,n){if(!t)return;const{startContainer:r,endContainer:a}=t;let{startOffset:o,endOffset:i}=t;return e===r&&(o=n(e.nodeValue.slice(0,o)).length),e===a&&(i=n(e.nodeValue.slice(0,i)).length),{startContainer:r,startOffset:o,endContainer:a,endOffset:i}}function C(e){return e.replace(/[\n\r\t]+/g," ")}function A(e){return e.replace(new RegExp("[\ufeff]","gu"),"")}function R(e){let{element:t,range:n,multilineTag:r,multilineWrapperTags:a,currentWrapperTags:o=[],isEditableTree:i,preserveWhiteSpace:s}=e;const c={formats:[],replacements:[],text:""};if(!t)return c;if(!t.hasChildNodes())return N(c,t,n,{formats:[],replacements:[],text:""}),c;const l=t.childNodes.length;for(let u=0;uA(C(e)));const h=g(f.nodeValue);n=F(f,n,g),N(c,f,n,{text:h}),c.formats.length+=h.length,c.replacements.length+=h.length,c.text+=h;continue}if(f.nodeType!==f.ELEMENT_NODE)continue;if(i&&(f.getAttribute("data-rich-text-placeholder")||"br"===d&&!f.getAttribute("data-rich-text-line-break"))){N(c,f,n,{formats:[],replacements:[],text:""});continue}if("script"===d){const v={formats:[,],replacements:[{type:d,attributes:{"data-rich-text-script":f.getAttribute("data-rich-text-script")||encodeURIComponent(f.innerHTML)}}],text:x};N(c,f,n,v),D(c,v);continue}if("br"===d){N(c,f,n,{formats:[],replacements:[],text:""}),D(c,_({text:"\n"}));continue}const m=w({tagName:d,attributes:L({element:f})});if(a&&-1!==a.indexOf(d)){const y=S({element:f,range:n,multilineTag:r,multilineWrapperTags:a,currentWrapperTags:[...o,m],isEditableTree:i,preserveWhiteSpace:s});N(c,f,n,y),D(c,y);continue}const p=R({element:f,range:n,multilineTag:r,multilineWrapperTags:a,isEditableTree:i,preserveWhiteSpace:s});if(N(c,f,n,p),m)if(0===p.text.length)m.attributes&&D(c,{formats:[,],replacements:[m],text:x});else{function b(e){if(b.formats===e)return b.newFormats;const t=e?[m,...e]:[m];return b.formats=e,b.newFormats=t,t}b.newFormats=[m],D(c,{...p,formats:Array.from(p.formats,b)})}else D(c,p)}return c}function S(e){let{element:t,range:n,multilineTag:r,multilineWrapperTags:a,currentWrapperTags:o=[],isEditableTree:i,preserveWhiteSpace:s}=e;const c={formats:[],replacements:[],text:""};if(!t||!t.hasChildNodes())return c;const l=t.children.length;for(let e=0;e0)&&D(c,{formats:[,],replacements:o.length>0?[o]:[,],text:E}),N(c,l,n,u),D(c,u)}return c}function L(e){let{element:t}=e;if(!t.hasAttributes())return;const n=t.attributes.length;let r;for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:[];if(void 0===n)return o;if(n===r){if(a)return a;const e=t[n-1]||o,r=t[n]||o;return e.length{let{type:n}=e;return n===t}))}function M(e){let{start:t,end:n,replacements:r,text:a}=e;if(t+1===n&&a[t]===x)return r[t]}const $=new RegExp(`[${E}]`,"g");function j(e){let{text:t}=e;return t.replace($,(e=>e===x?"":"\n"))}function P(e){let{start:t,end:n}=e;if(void 0!==t&&void 0!==n)return t===n}function V(e){let{text:t}=e;return 0===t.length}function I(e){let{text:t,start:n,end:r}=e;return n===r&&(0===t.length||(0===n&&t.slice(0,1)===E||(n===t.length&&t.slice(-1)===E||t.slice(n-1,r+1)===`${E}${E}`)))}function B(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"string"==typeof t&&(t=_({text:t})),v(e.reduce(((e,n)=>{let{formats:r,replacements:a,text:o}=n;return{formats:e.formats.concat(t.formats,r),replacements:e.replacements.concat(t.replacements,a),text:e.text+t.text+o}})))}function H(e,t){if("string"==typeof(t={name:e,...t}).name)if(/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name))if((0,a.select)(g).getFormatType(t.name))window.console.error('Format "'+t.name+'" is already registered.');else if("string"==typeof t.tagName&&""!==t.tagName)if("string"==typeof t.className&&""!==t.className||null===t.className)if(/^[_a-zA-Z]+[a-zA-Z0-9-]*$/.test(t.className)){if(null===t.className){const e=(0,a.select)(g).getFormatTypeForBareElement(t.tagName);if(e&&"core/unknown"!==e.name)return void window.console.error(`Format "${e.name}" is already registered to handle bare tag name "${t.tagName}".`)}else{const e=(0,a.select)(g).getFormatTypeForClassName(t.className);if(e)return void window.console.error(`Format "${e.name}" is already registered to handle class name "${t.className}".`)}if("title"in t&&""!==t.title)if("keywords"in t&&t.keywords.length>3)window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');else{if("string"==typeof t.title)return(0,a.dispatch)(g).addFormatTypes(t),t;window.console.error("Format titles must be strings.")}else window.console.error('The format "'+t.name+'" must have a title.')}else window.console.error("A class name must begin with a letter, followed by any number of hyphens, letters, or numbers.");else window.console.error("Format class names must be a string, or null to handle bare elements.");else window.console.error("Format tag names must be a string.");else window.console.error("Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format");else window.console.error("Format names must be strings.")}function z(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.start,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.end;const{formats:a,activeFormats:o}=e,i=a.slice();if(n===r){var s;const e=null===(s=i[n])||void 0===s?void 0:s.find((e=>{let{type:n}=e;return n===t}));if(e){for(;null!==(c=i[n])&&void 0!==c&&c.find((t=>t===e));){var c;U(i,n,t),n--}for(r++;null!==(l=i[r])&&void 0!==l&&l.find((t=>t===e));){var l;U(i,r,t),r++}}}else for(let e=n;e{let{type:n}=e;return n!==t})))||[]})}function U(e,t,n){const r=e[t].filter((e=>{let{type:t}=e;return t!==n}));r.length?e[t]=r:delete e[t]}function q(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.start,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.end;const{formats:a,replacements:o,text:i}=e;"string"==typeof t&&(t=_({text:t}));const s=n+t.text.length;return v({formats:a.slice(0,n).concat(t.formats,a.slice(r)),replacements:o.slice(0,n).concat(t.replacements,o.slice(r)),text:i.slice(0,n)+t.text+i.slice(r),start:s,end:s})}function K(e,t,n){return q(e,_(),t,n)}function X(e,t,n){let{formats:r,replacements:a,text:o,start:i,end:s}=e;return o=o.replace(t,(function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),c=1;c1&&void 0!==arguments[1]?arguments[1]:e.start,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.end;const r=e.text.slice(0,t),a=r.lastIndexOf(E),o=e.replacements[a];let i=[,];o&&(i=[o]);const s={formats:[,],replacements:i,text:E};return q(e,s,t,n)}function G(e,t,n,r){return q(e,{formats:[,],replacements:[t],text:x},n,r)}function Z(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.start,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.end;const{formats:r,replacements:a,text:o}=e;return void 0===t||void 0===n?{...e}:{formats:r.slice(t,n),replacements:a.slice(t,n),text:o.slice(t,n)}}function J(e,t){let{formats:n,replacements:r,text:a,start:o,end:i}=e;if("string"!=typeof t)return Q(...arguments);let s=0;return a.split(t).map((e=>{const a=s,c={formats:n.slice(a,a+e.length),replacements:r.slice(a,a+e.length),text:e};return s+=t.length+e.length,void 0!==o&&void 0!==i&&(o>=a&&oa&&(c.start=0),i>=a&&is&&(c.end=e.length)),c}))}function Q(e){let{formats:t,replacements:n,text:r,start:a,end:o}=e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o;if(void 0===a||void 0===o)return;const c={formats:t.slice(0,i),replacements:n.slice(0,i),text:r.slice(0,i)},l={formats:t.slice(s),replacements:n.slice(s),text:r.slice(s),start:0,end:0};return[X(c,/\u2028+$/,""),X(l,/^\u2028+/,"")]}function ee(e,t){if(t)return e;const n={};for(const t in e){let r=t;t.startsWith("data-disable-rich-text-")&&(r=t.slice("data-disable-rich-text-".length)),n[r]=e[t]}return n}function te(e){let{type:t,tagName:n,attributes:r,unregisteredAttributes:o,object:i,boundaryClass:s,isEditableTree:c}=e;const l=(u=t,(0,a.select)(g).getFormatType(u));var u;let f={};if(s&&(f["data-rich-text-format-boundary"]="true"),!l)return r&&(f={...r,...f}),{type:t,attributes:ee(f,c),object:i};f={...o,...f};for(const e in r){const t=!!l.attributes&&l.attributes[e];t?f[t]=r[e]:f[e]=r[e]}return l.className&&(f.class?f.class=`${l.className} ${f.class}`:f.class=l.className),{type:"*"===l.tagName?n:l.tagName,object:l.object,attributes:ee(f,c)}}function ne(e,t,n){do{if(e[n]!==t[n])return!1}while(n--);return!0}function re(e){let{value:t,multilineTag:n,preserveWhiteSpace:r,createEmpty:a,append:o,getLastChild:i,getParent:s,isText:c,getText:l,remove:u,appendText:f,onStartIndex:d,onEndIndex:m,isEditableTree:p,placeholder:g}=e;const{formats:h,replacements:v,text:y,start:b,end:T}=t,w=h.length+1,_=a(),N={type:n},F=W(t),C=F[F.length-1];let A,R,S;n?(o(o(_,{type:n}),""),R=A=[N]):o(_,"");for(let e=0;e(e.push(t,N),e)),[N]):[...A,...w||[]]);let F=i(_);if(a&&t===E){let e=F;for(;!c(e);)e=i(e);o(s(e),"\ufeff")}if(S===E){let t=F;for(;!c(t);)t=i(t);d&&b===e&&d(_,t),m&&T===e&&m(_,t)}if(w&&w.forEach(((e,n)=>{if(F&&R&&ne(w,R,n)&&(t!==E||w.length-1!==n))return void(F=i(F));const{type:r,tagName:a,attributes:f,unregisteredAttributes:d}=e,m=p&&t!==E&&e===C,g=s(F),h=o(g,te({type:r,tagName:a,attributes:f,unregisteredAttributes:d,boundaryClass:m,isEditableTree:p}));c(F)&&0===l(F).length&&u(F),F=o(h,"")})),t!==E){var L;if(0===e&&(d&&0===b&&d(_,F),m&&0===T&&m(_,F)),t===x)p||"script"!==(null===(L=v[e])||void 0===L?void 0:L.type)?F=o(s(F),te({...v[e],object:!0,isEditableTree:p})):(F=o(s(F),te({type:"script",isEditableTree:p})),o(F,{html:decodeURIComponent(v[e].attributes["data-rich-text-script"])})),F=o(s(F),"");else r||"\n"!==t?c(F)?f(F,t):F=o(s(F),t):(F=o(s(F),{type:"br",attributes:p?{"data-rich-text-line-break":"true"}:void 0,object:!0}),F=o(s(F),""));d&&b===e+1&&d(_,F),m&&T===e+1&&m(_,F),a&&e===y.length&&(o(s(F),"\ufeff"),g&&0===y.length&&o(s(F),{type:"span",attributes:{"data-rich-text-placeholder":g,contenteditable:"false",style:"pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;"}})),R=w,S=t}else R=w,S=t}return _}function ae(e,t,n){const r=e.parentNode;let a=0;for(;e=e.previousSibling;)a++;return n=[a,...n],r!==t&&(n=ae(r,t,n)),n}function oe(e,t){for(t=[...t];e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}function ie(e,t){"string"==typeof t&&(t=e.ownerDocument.createTextNode(t));const{type:n,attributes:r}=t;if(n){t=e.ownerDocument.createElement(n);for(const e in r)t.setAttribute(e,r[e])}return e.appendChild(t)}function se(e,t){e.appendData(t)}function ce(e){let{lastChild:t}=e;return t}function le(e){let{parentNode:t}=e;return t}function ue(e){return e.nodeType===e.TEXT_NODE}function fe(e){let{nodeValue:t}=e;return t}function de(e){return e.parentNode.removeChild(e)}function me(e){let{value:t,multilineTag:n,prepareEditableTree:r,isEditableTree:a=!0,placeholder:o,doc:i=document}=e,s=[],c=[];r&&(t={...t,formats:r(t)});return{body:re({value:t,multilineTag:n,createEmpty:()=>T(i,""),append:ie,getLastChild:ce,getParent:le,isText:ue,getText:fe,remove:de,appendText:se,onStartIndex(e,t){s=ae(t,e,[t.nodeValue.length])},onEndIndex(e,t){c=ae(t,e,[t.nodeValue.length])},isEditableTree:a,placeholder:o}),selection:{startPath:s,endPath:c}}}function pe(e){let{value:t,current:n,multilineTag:r,prepareEditableTree:a,__unstableDomOnly:o,placeholder:i}=e;const{body:s,selection:c}=me({value:t,multilineTag:r,prepareEditableTree:a,placeholder:i,doc:n.ownerDocument});ge(s,n),void 0===t.start||o||function(e,t){let{startPath:n,endPath:r}=e;const{node:a,offset:o}=oe(t,n),{node:i,offset:s}=oe(t,r),{ownerDocument:c}=t,{defaultView:l}=c,u=l.getSelection(),f=c.createRange();f.setStart(a,o),f.setEnd(i,s);const{activeElement:d}=c;if(u.rangeCount>0){if(m=f,p=u.getRangeAt(0),m.startContainer===p.startContainer&&m.startOffset===p.startOffset&&m.endContainer===p.endContainer&&m.endOffset===p.endOffset)return;u.removeAllRanges()}var m,p;u.addRange(f),d!==c.activeElement&&d instanceof l.HTMLElement&&d.focus()}(c,n)}function ge(e,t){let n,r=0;for(;n=e.firstChild;){const a=t.childNodes[r];if(a)if(a.isEqualNode(n))e.removeChild(n);else if(a.nodeName!==n.nodeName||a.nodeType===a.TEXT_NODE&&a.data!==n.data)t.replaceChild(n,a);else{const t=a.attributes,r=n.attributes;if(t){let e=t.length;for(;e--;){const{name:r}=t[e];n.getAttribute(r)||a.removeAttribute(r)}}if(r)for(let e=0;e`:`<${t}${o}>${Ce(a)}`}function Ce(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>void 0!==e.html?e.html:void 0===e.text?Fe(e):(0,he.escapeEditableHTML)(e.text))).join("")}var Ae=window.wp.a11y,Re=window.wp.i18n;function Se(e,t){return k(e,t.type)?(t.title&&(0,Ae.speak)((0,Re.sprintf)((0,Re.__)("%s removed."),t.title),"assertive"),z(e,t.type)):(t.title&&(0,Ae.speak)((0,Re.sprintf)((0,Re.__)("%s applied."),t.title),"assertive"),b(e,t))}function Le(e){const t=(0,a.select)(g).getFormatType(e);if(t)return(0,a.dispatch)(g).removeFormatTypes(e),t;window.console.error(`Format ${e} is not registered.`)}var De=window.wp.element,Oe=window.wp.deprecated,We=e.n(Oe);function ke(e){let{ref:t,value:n,settings:r={}}=e;We()("`useAnchorRef` hook",{since:"6.1",alternative:"`useAnchor` hook"});const{tagName:a,className:o,name:i}=r,s=i?k(n,i):void 0;return(0,De.useMemo)((()=>{if(!t.current)return;const{ownerDocument:{defaultView:e}}=t.current,n=e.getSelection();if(!n.rangeCount)return;const r=n.getRangeAt(0);if(!s)return r;let i=r.startContainer;for(i=i.nextElementSibling||i;i.nodeType!==i.ELEMENT_NODE;)i=i.parentNode;return i.closest(a+(o?"."+o:""))}),[s,n.start,n.end,a,o])}function Me(e){let{editableContentElement:t,value:n,settings:r={}}=e;const{tagName:a,className:o,name:i}=r,s=i?k(n,i):void 0;return(0,De.useMemo)((()=>{if(!t)return;const{ownerDocument:{defaultView:e}}=t,n=e.getSelection();if(!n.rangeCount)return;const r=null==t?void 0:t.contains(null==n?void 0:n.anchorNode),i=n.getRangeAt(0);if(!s)return{ownerDocument:i.startContainer.ownerDocument,getBoundingClientRect(){return r?i.getBoundingClientRect():t.getBoundingClientRect()}};let c=i.startContainer;for(c=c.nextElementSibling||c;c.nodeType!==c.ELEMENT_NODE;)c=c.parentNode;return c.closest(a+(o?"."+o:""))}),[t,s,n.start,n.end,a,o])}var $e=window.wp.compose;function je(e){let{record:t}=e;const n=(0,De.useRef)(),{activeFormats:r=[]}=t.current;return(0,De.useEffect)((()=>{if(!r||!r.length)return;const e="*[data-rich-text-format-boundary]",t=n.current.querySelector(e);if(!t)return;const{ownerDocument:a}=t,{defaultView:o}=a,i=`${`.rich-text:focus ${e}`} {${`background-color: ${o.getComputedStyle(t).color.replace(")",", 0.2)").replace("rgb","rgba")}`}}`,s="rich-text-boundary-style";let c=a.getElementById(s);c||(c=a.createElement("style"),c.id=s,a.head.appendChild(c)),c.innerHTML!==i&&(c.innerHTML=i)}),[r]),n}function Pe(e){const t=(0,De.useRef)(e);return t.current=e,(0,$e.useRefEffect)((e=>{function n(n){const{record:r,multilineTag:a,preserveWhiteSpace:o}=t.current;if(P(r.current)||!e.contains(e.ownerDocument.activeElement))return;const i=Z(r.current),s=j(i),c=ve({value:i,multilineTag:a,preserveWhiteSpace:o});n.clipboardData.setData("text/plain",s),n.clipboardData.setData("text/html",c),n.clipboardData.setData("rich-text","true"),n.clipboardData.setData("rich-text-multi-line-tag",a||""),n.preventDefault()}return e.addEventListener("copy",n),()=>{e.removeEventListener("copy",n)}}),[])}var Ve=window.wp.keycodes;const Ie=[];function Be(e){const[,t]=(0,De.useReducer)((()=>({}))),n=(0,De.useRef)(e);return n.current=e,(0,$e.useRefEffect)((e=>{function r(r){const{keyCode:a,shiftKey:o,altKey:i,metaKey:s,ctrlKey:c}=r;if(o||i||s||c||a!==Ve.LEFT&&a!==Ve.RIGHT)return;const{record:l,applyRecord:u}=n.current,{text:f,formats:d,start:m,end:p,activeFormats:g=[]}=l.current,h=P(l.current),{ownerDocument:v}=e,{defaultView:y}=v,{direction:b}=y.getComputedStyle(e),T="rtl"===b?Ve.RIGHT:Ve.LEFT,E=r.keyCode===T;if(h&&0===g.length){if(0===m&&E)return;if(p===f.length&&!E)return}if(!h)return;const x=d[m-1]||Ie,w=d[m]||Ie,_=E?x:w,N=g.every(((e,t)=>e===_[t]));let F=g.length;if(N?F<_.length&&F++:F--,F===g.length)return void(l.current._newActiveFormats=_);r.preventDefault();const C=(N?_:E?w:x).slice(0,F),A={...l.current,activeFormats:C};l.current=A,u(A),t()}return e.addEventListener("keydown",r),()=>{e.removeEventListener("keydown",r)}}),[])}const He=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),ze=[],Ue="data-rich-text-placeholder";function qe(e){const t=(0,De.useRef)(e);return t.current=e,(0,$e.useRefEffect)((e=>{const{ownerDocument:n}=e,{defaultView:r}=n;let a,o=!1;function i(e){if(o)return;let n;e&&(n=e.inputType);const{record:r,applyRecord:a,createRecord:i,handleChange:s}=t.current;if(n&&(0===n.indexOf("format")||He.has(n)))return void a(r.current);const c=i(),{start:l,activeFormats:u=[]}=r.current,f=function(e){let{value:t,start:n,end:r,formats:a}=e;const o=Math.min(n,r),i=Math.max(n,r),s=t.formats[o-1]||[],c=t.formats[i]||[];for(t.activeFormats=a.map(((e,t)=>{if(s[t]){if(h(e,s[t]))return s[t]}else if(c[t]&&h(e,c[t]))return c[t];return e}));--r>=n;)t.activeFormats.length>0?t.formats[r]=t.activeFormats:delete t.formats[r];return t}({value:c,start:l,end:c.start,formats:u});s(f)}function s(a){const{record:s,applyRecord:c,createRecord:l,isSelected:u,onSelectionChange:f}=t.current;if("true"!==e.contentEditable)return;if(n.activeElement!==e){if("true"!==n.activeElement.contentEditable)return;if(!n.activeElement.contains(e))return;const t=r.getSelection(),{anchorNode:a,focusNode:o}=t;if(e.contains(a)&&e!==a&&e.contains(o)&&e!==o){const{start:e,end:t}=l();s.current.activeFormats=ze,f(e,t)}else if(e.contains(a)&&e!==a){const{start:e,end:t=e}=l();s.current.activeFormats=ze,f(t)}else if(e.contains(o)){const{start:e,end:t=e}=l();s.current.activeFormats=ze,f(void 0,t)}return}if("selectionchange"!==a.type&&!u)return;if(o)return;const{start:d,end:m,text:p}=l(),g=s.current;if(p!==g.text)return void i();if(d===g.start&&m===g.end)return void(0===g.text.length&&0===d&&function(e){const t=e.getSelection(),{anchorNode:n,anchorOffset:r}=t;if(n.nodeType!==n.ELEMENT_NODE)return;const a=n.childNodes[r];a&&a.nodeType===a.ELEMENT_NODE&&a.hasAttribute(Ue)&&t.collapseToStart()}(r));const h={...g,start:d,end:m,activeFormats:g._newActiveFormats,_newActiveFormats:void 0},v=W(h,ze);h.activeFormats=v,s.current=h,c(h,{domOnly:!0}),f(d,m)}function c(){var t;o=!0,n.removeEventListener("selectionchange",s),null===(t=e.querySelector(`[${Ue}]`))||void 0===t||t.remove()}function l(){o=!1,i({inputType:"insertText"}),n.addEventListener("selectionchange",s)}function u(){const{record:n,isSelected:o,onSelectionChange:i,applyRecord:c}=t.current;if(!e.parentElement.closest('[contenteditable="true"]')){if(o)c(n.current),i(n.current.start,n.current.end);else{const e=void 0;n.current={...n.current,start:e,end:e,activeFormats:ze},i(e,e)}a=r.requestAnimationFrame(s)}}return e.addEventListener("input",i),e.addEventListener("compositionstart",c),e.addEventListener("compositionend",l),e.addEventListener("focus",u),e.addEventListener("keyup",s),e.addEventListener("mouseup",s),e.addEventListener("touchend",s),n.addEventListener("selectionchange",s),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionstart",c),e.removeEventListener("compositionend",l),e.removeEventListener("focus",u),e.removeEventListener("keyup",s),e.removeEventListener("mouseup",s),e.removeEventListener("touchend",s),n.removeEventListener("selectionchange",s),r.cancelAnimationFrame(a)}}),[])}function Ke(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{replacements:n,text:r,start:a,end:o}=e,i=P(e);let s,c=a-1,l=i?a-1:a,u=o;if(t||(c=o,l=a,u=i?o+1:o),r[c]===E){if(i&&n[c]&&n[c].length){const t=n.slice();t[c]=n[c].slice(0,-1),s={...e,replacements:t}}else s=K(e,l,u);return s}}function Xe(e){const t=(0,De.useRef)(e);return t.current=e,(0,$e.useRefEffect)((e=>{function n(e){const{keyCode:n}=e,{createRecord:r,handleChange:a,multilineTag:o}=t.current;if(e.defaultPrevented)return;if(n!==Ve.DELETE&&n!==Ve.BACKSPACE)return;const i=r(),{start:s,end:c,text:l}=i,u=n===Ve.BACKSPACE;if(0===s&&0!==c&&c===l.length)return a(K(i)),void e.preventDefault();if(o){let t;t=u&&0===i.start&&0===i.end&&I(i)?Ke(i,!u):Ke(i,u),t&&(a(t),e.preventDefault())}}return e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n)}}),[])}function Ye(e){let{value:t="",selectionStart:n,selectionEnd:r,placeholder:o,preserveWhiteSpace:i,onSelectionChange:s,onChange:c,__unstableMultilineTag:l,__unstableDisableFormats:u,__unstableIsSelected:f,__unstableDependencies:d=[],__unstableAfterParse:m,__unstableBeforeSerialize:p,__unstableAddInvisibleFormats:g}=e;const h=(0,a.useRegistry)(),[,v]=(0,De.useReducer)((()=>({}))),y=(0,De.useRef)();function b(){const{ownerDocument:{defaultView:e}}=y.current,t=e.getSelection(),n=t.rangeCount>0?t.getRangeAt(0):null;return _({element:y.current,range:n,multilineTag:l,multilineWrapperTags:"li"===l?["ul","ol"]:void 0,__unstableIsEditableTree:!0,preserveWhiteSpace:i})}function T(e){let{domOnly:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};pe({value:e,current:y.current,multilineTag:l,multilineWrapperTags:"li"===l?["ul","ol"]:void 0,prepareEditableTree:g,__unstableDomOnly:t,placeholder:o})}const E=(0,De.useRef)(t),x=(0,De.useRef)();function w(){E.current=t,x.current=_({html:t,multilineTag:l,multilineWrapperTags:"li"===l?["ul","ol"]:void 0,preserveWhiteSpace:i}),u&&(x.current.formats=Array(t.length),x.current.replacements=Array(t.length)),m&&(x.current.formats=m(x.current)),x.current.start=n,x.current.end=r}const N=(0,De.useRef)(!1);if(x.current)n===x.current.start&&r===x.current.end||(N.current=f,x.current={...x.current,start:n,end:r});else{var F,C,A;w();"core/text-color"===(null===(F=x.current)||void 0===F||null===(C=F.formats[0])||void 0===C||null===(A=C[0])||void 0===A?void 0:A.type)&&function(e){x.current=e,E.current=ve({value:p?{...e,formats:p(e)}:e,multilineTag:l,preserveWhiteSpace:i});const{formats:t,text:n}=e;h.batch((()=>{c(E.current,{__unstableFormats:t,__unstableText:n})})),v()}(x.current)}function R(e){x.current=e,T(e),E.current=u?e.text:ve({value:p?{...e,formats:p(e)}:e,multilineTag:l,preserveWhiteSpace:i});const{start:t,end:n,formats:r,text:a}=e;h.batch((()=>{s(t,n),c(E.current,{__unstableFormats:r,__unstableText:a})})),v()}function S(){w(),T(x.current)}const L=(0,De.useRef)(!1);(0,De.useLayoutEffect)((()=>{L.current&&t!==E.current&&(S(),v())}),[t]),(0,De.useLayoutEffect)((()=>{N.current&&(y.current.ownerDocument.activeElement!==y.current&&y.current.focus(),S(),N.current=!1)}),[N.current]);const D=(0,$e.useMergeRefs)([y,(0,De.useCallback)((e=>{e&&(e.style.whiteSpace="pre-wrap",e.style.minWidth="1px")}),[]),je({record:x}),Pe({record:x,multilineTag:l,preserveWhiteSpace:i}),(0,$e.useRefEffect)((e=>{function t(t){const{target:n}=t;if(n===e||n.textContent)return;const{ownerDocument:r}=n,{defaultView:a}=r,o=r.createRange(),i=a.getSelection();o.selectNode(n),i.removeAllRanges(),i.addRange(o)}return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}),[]),Be({record:x,applyRecord:T}),Xe({createRecord:b,handleChange:R,multilineTag:l}),qe({record:x,applyRecord:T,createRecord:b,handleChange:R,isSelected:f,onSelectionChange:s}),(0,$e.useRefEffect)((()=>{S(),L.current=!0}),[o,...d])]);return{value:x.current,onChange:R,ref:D}}function Ge(){}function Ze(e){let{formatTypes:t,onChange:n,onFocus:r,value:a,forwardedRef:o}=e;return t.map((e=>{const{name:t,edit:i}=e;if(!i)return null;const s=k(a,t),c=void 0!==s,l=M(a),u=void 0!==l&&l.type===t;return(0,De.createElement)(i,{key:t,isActive:c,activeAttributes:c&&s.attributes||{},isObjectActive:u,activeObjectAttributes:u&&l.attributes||{},value:a,onChange:n,onFocus:r,contentRef:o})}))}(window.wp=window.wp||{}).richText=t}(); \ No newline at end of file +!function(){"use strict";var e={n:function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{__UNSTABLE_LINE_SEPARATOR:function(){return E},__experimentalRichText:function(){return Ge},__unstableCreateElement:function(){return T},__unstableFormatEdit:function(){return Ze},__unstableInsertLineSeparator:function(){return Y},__unstableIsEmptyLine:function(){return I},__unstableToDom:function(){return me},__unstableUseRichText:function(){return Ye},applyFormat:function(){return b},concat:function(){return O},create:function(){return _},getActiveFormat:function(){return k},getActiveFormats:function(){return W},getActiveObject:function(){return M},getTextContent:function(){return j},insert:function(){return q},insertObject:function(){return G},isCollapsed:function(){return P},isEmpty:function(){return V},join:function(){return B},registerFormatType:function(){return H},remove:function(){return K},removeFormat:function(){return z},replace:function(){return X},slice:function(){return Z},split:function(){return J},store:function(){return g},toHTMLString:function(){return ve},toggleFormat:function(){return Se},unregisterFormatType:function(){return Le},useAnchor:function(){return Me},useAnchorRef:function(){return ke}});var n={};e.r(n),e.d(n,{getFormatType:function(){return u},getFormatTypeForBareElement:function(){return f},getFormatTypeForClassName:function(){return d},getFormatTypes:function(){return l}});var r={};e.r(r),e.d(r,{addFormatTypes:function(){return m},removeFormatTypes:function(){return p}});var a=window.wp.data;var o=(0,a.combineReducers)({formatTypes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_FORMAT_TYPES":return{...e,...t.formatTypes.reduce(((e,t)=>({...e,[t.name]:t})),{})};case"REMOVE_FORMAT_TYPES":return Object.fromEntries(Object.entries(e).filter((e=>{let[n]=e;return!t.names.includes(n)})))}return e}}),i={};function s(e){return[e]}function c(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;rObject.values(e.formatTypes)),(e=>[e.formatTypes]));function u(e,t){return e.formatTypes[t]}function f(e,t){const n=l(e);return n.find((e=>{let{className:n,tagName:r}=e;return null===n&&t===r}))||n.find((e=>{let{className:t,tagName:n}=e;return null===t&&"*"===n}))}function d(e,t){return l(e).find((e=>{let{className:n}=e;return null!==n&&` ${t} `.indexOf(` ${n} `)>=0}))}function m(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function p(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}const g=(0,a.createReduxStore)("core/rich-text",{reducer:o,selectors:n,actions:r});function h(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.type!==t.type)return!1;const n=e.attributes,r=t.attributes;if(n===r)return!0;if(!n||!r)return!1;const a=Object.keys(n),o=Object.keys(r);if(a.length!==o.length)return!1;const i=a.length;for(let e=0;e{const r=t[n-1];if(r){const a=e.slice();a.forEach(((e,t)=>{const n=r[t];h(e,n)&&(a[t]=n)})),t[n]=a}})),{...e,formats:t}}function y(e,t,n){return(e=e.slice())[t]=n,e}function b(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.start,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.end;const{formats:a,activeFormats:o}=e,i=a.slice();if(n===r){var s;const e=null===(s=i[n])||void 0===s?void 0:s.find((e=>{let{type:n}=e;return n===t.type}));if(e){const a=i[n].indexOf(e);for(;i[n]&&i[n][a]===e;)i[n]=y(i[n],a,t),n--;for(r++;i[r]&&i[r][a]===e;)i[r]=y(i[r],a,t),r++}}else{let e=1/0;for(let a=n;a{let{type:n}=e;return n!==t.type}));const n=i[a].length;n{let{type:n}=e;return n!==t.type})))||[],t]})}function T(e,t){let{implementation:n}=e;return T.body||(T.body=n.createHTMLDocument("").body),T.body.innerHTML=t,T.body}(0,a.register)(g);const E="\u2028",x="";function w(e){let t,{tagName:n,attributes:r}=e;if(r&&r.class&&(t=(0,a.select)(g).getFormatTypeForClassName(r.class),t&&(r.class=` ${r.class} `.replace(` ${t.className} `," ").trim(),r.class||delete r.class)),t||(t=(0,a.select)(g).getFormatTypeForBareElement(n)),!t)return r?{type:n,attributes:r}:{type:n};if(t.__experimentalCreatePrepareEditableTree&&!t.__experimentalCreateOnChangeEditableValue)return null;if(!r)return{type:t.name,tagName:n};const o={},i={},s={...r};for(const e in t.attributes){const n=t.attributes[e];o[e]=s[n],t.__unstableFilterAttributeValue&&(o[e]=t.__unstableFilterAttributeValue(e,o[e])),delete s[n],void 0===o[e]&&delete o[e]}for(const e in s)i[e]=r[e];return{type:t.name,tagName:n,attributes:o,unregisteredAttributes:i}}function _(){let{element:e,text:t,html:n,range:r,multilineTag:a,multilineWrapperTags:o,__unstableIsEditableTree:i,preserveWhiteSpace:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"string"==typeof t&&t.length>0?{formats:Array(t.length),replacements:Array(t.length),text:t}:("string"==typeof n&&n.length>0&&(e=T(document,n)),"object"!=typeof e?{formats:[],replacements:[],text:""}:a?S({element:e,range:r,multilineTag:a,multilineWrapperTags:o,isEditableTree:i,preserveWhiteSpace:s}):R({element:e,range:r,isEditableTree:i,preserveWhiteSpace:s}))}function N(e,t,n,r){if(!n)return;const{parentNode:a}=t,{startContainer:o,startOffset:i,endContainer:s,endOffset:c}=n,l=e.text.length;void 0!==r.start?e.start=l+r.start:t===o&&t.nodeType===t.TEXT_NODE?e.start=l+i:a===o&&t===o.childNodes[i]?e.start=l:a===o&&t===o.childNodes[i-1]?e.start=l+r.text.length:t===o&&(e.start=l),void 0!==r.end?e.end=l+r.end:t===s&&t.nodeType===t.TEXT_NODE?e.end=l+c:a===s&&t===s.childNodes[c-1]?e.end=l+r.text.length:a===s&&t===s.childNodes[c]?e.end=l:t===s&&(e.end=l+c)}function F(e,t,n){if(!t)return;const{startContainer:r,endContainer:a}=t;let{startOffset:o,endOffset:i}=t;return e===r&&(o=n(e.nodeValue.slice(0,o)).length),e===a&&(i=n(e.nodeValue.slice(0,i)).length),{startContainer:r,startOffset:o,endContainer:a,endOffset:i}}function C(e){return e.replace(/[\n\r\t]+/g," ")}function A(e){return e.replace(new RegExp("[\ufeff]","gu"),"")}function R(e){let{element:t,range:n,multilineTag:r,multilineWrapperTags:a,currentWrapperTags:o=[],isEditableTree:i,preserveWhiteSpace:s}=e;const c={formats:[],replacements:[],text:""};if(!t)return c;if(!t.hasChildNodes())return N(c,t,n,{formats:[],replacements:[],text:""}),c;const l=t.childNodes.length;for(let u=0;uA(C(e)));const h=g(f.nodeValue);n=F(f,n,g),N(c,f,n,{text:h}),c.formats.length+=h.length,c.replacements.length+=h.length,c.text+=h;continue}if(f.nodeType!==f.ELEMENT_NODE)continue;if(i&&(f.getAttribute("data-rich-text-placeholder")||"br"===d&&!f.getAttribute("data-rich-text-line-break"))){N(c,f,n,{formats:[],replacements:[],text:""});continue}if("script"===d){const v={formats:[,],replacements:[{type:d,attributes:{"data-rich-text-script":f.getAttribute("data-rich-text-script")||encodeURIComponent(f.innerHTML)}}],text:x};N(c,f,n,v),D(c,v);continue}if("br"===d){N(c,f,n,{formats:[],replacements:[],text:""}),D(c,_({text:"\n"}));continue}const m=w({tagName:d,attributes:L({element:f})});if(a&&-1!==a.indexOf(d)){const y=S({element:f,range:n,multilineTag:r,multilineWrapperTags:a,currentWrapperTags:[...o,m],isEditableTree:i,preserveWhiteSpace:s});N(c,f,n,y),D(c,y);continue}const p=R({element:f,range:n,multilineTag:r,multilineWrapperTags:a,isEditableTree:i,preserveWhiteSpace:s});if(N(c,f,n,p),m)if(0===p.text.length)m.attributes&&D(c,{formats:[,],replacements:[m],text:x});else{function b(e){if(b.formats===e)return b.newFormats;const t=e?[m,...e]:[m];return b.formats=e,b.newFormats=t,t}b.newFormats=[m],D(c,{...p,formats:Array.from(p.formats,b)})}else D(c,p)}return c}function S(e){let{element:t,range:n,multilineTag:r,multilineWrapperTags:a,currentWrapperTags:o=[],isEditableTree:i,preserveWhiteSpace:s}=e;const c={formats:[],replacements:[],text:""};if(!t||!t.hasChildNodes())return c;const l=t.children.length;for(let e=0;e0)&&D(c,{formats:[,],replacements:o.length>0?[o]:[,],text:E}),N(c,l,n,u),D(c,u)}return c}function L(e){let{element:t}=e;if(!t.hasAttributes())return;const n=t.attributes.length;let r;for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:[];if(void 0===n)return o;if(n===r){if(a)return a;const e=t[n-1]||o,r=t[n]||o;return e.length{let{type:n}=e;return n===t}))}function M(e){let{start:t,end:n,replacements:r,text:a}=e;if(t+1===n&&a[t]===x)return r[t]}const $=new RegExp(`[${E}]`,"g");function j(e){let{text:t}=e;return t.replace($,(e=>e===x?"":"\n"))}function P(e){let{start:t,end:n}=e;if(void 0!==t&&void 0!==n)return t===n}function V(e){let{text:t}=e;return 0===t.length}function I(e){let{text:t,start:n,end:r}=e;return n===r&&(0===t.length||(0===n&&t.slice(0,1)===E||(n===t.length&&t.slice(-1)===E||t.slice(n-1,r+1)===`${E}${E}`)))}function B(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"string"==typeof t&&(t=_({text:t})),v(e.reduce(((e,n)=>{let{formats:r,replacements:a,text:o}=n;return{formats:e.formats.concat(t.formats,r),replacements:e.replacements.concat(t.replacements,a),text:e.text+t.text+o}})))}function H(e,t){if("string"==typeof(t={name:e,...t}).name)if(/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name))if((0,a.select)(g).getFormatType(t.name))window.console.error('Format "'+t.name+'" is already registered.');else if("string"==typeof t.tagName&&""!==t.tagName)if("string"==typeof t.className&&""!==t.className||null===t.className)if(/^[_a-zA-Z]+[a-zA-Z0-9-]*$/.test(t.className)){if(null===t.className){const e=(0,a.select)(g).getFormatTypeForBareElement(t.tagName);if(e&&"core/unknown"!==e.name)return void window.console.error(`Format "${e.name}" is already registered to handle bare tag name "${t.tagName}".`)}else{const e=(0,a.select)(g).getFormatTypeForClassName(t.className);if(e)return void window.console.error(`Format "${e.name}" is already registered to handle class name "${t.className}".`)}if("title"in t&&""!==t.title)if("keywords"in t&&t.keywords.length>3)window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');else{if("string"==typeof t.title)return(0,a.dispatch)(g).addFormatTypes(t),t;window.console.error("Format titles must be strings.")}else window.console.error('The format "'+t.name+'" must have a title.')}else window.console.error("A class name must begin with a letter, followed by any number of hyphens, letters, or numbers.");else window.console.error("Format class names must be a string, or null to handle bare elements.");else window.console.error("Format tag names must be a string.");else window.console.error("Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format");else window.console.error("Format names must be strings.")}function z(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.start,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.end;const{formats:a,activeFormats:o}=e,i=a.slice();if(n===r){var s;const e=null===(s=i[n])||void 0===s?void 0:s.find((e=>{let{type:n}=e;return n===t}));if(e){for(;null!==(c=i[n])&&void 0!==c&&c.find((t=>t===e));){var c;U(i,n,t),n--}for(r++;null!==(l=i[r])&&void 0!==l&&l.find((t=>t===e));){var l;U(i,r,t),r++}}}else for(let e=n;e{let{type:n}=e;return n!==t})))||[]})}function U(e,t,n){const r=e[t].filter((e=>{let{type:t}=e;return t!==n}));r.length?e[t]=r:delete e[t]}function q(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.start,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.end;const{formats:a,replacements:o,text:i}=e;"string"==typeof t&&(t=_({text:t}));const s=n+t.text.length;return v({formats:a.slice(0,n).concat(t.formats,a.slice(r)),replacements:o.slice(0,n).concat(t.replacements,o.slice(r)),text:i.slice(0,n)+t.text+i.slice(r),start:s,end:s})}function K(e,t,n){return q(e,_(),t,n)}function X(e,t,n){let{formats:r,replacements:a,text:o,start:i,end:s}=e;return o=o.replace(t,(function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),c=1;c1&&void 0!==arguments[1]?arguments[1]:e.start,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.end;const r=e.text.slice(0,t),a=r.lastIndexOf(E),o=e.replacements[a];let i=[,];o&&(i=[o]);const s={formats:[,],replacements:i,text:E};return q(e,s,t,n)}function G(e,t,n,r){return q(e,{formats:[,],replacements:[t],text:x},n,r)}function Z(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.start,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.end;const{formats:r,replacements:a,text:o}=e;return void 0===t||void 0===n?{...e}:{formats:r.slice(t,n),replacements:a.slice(t,n),text:o.slice(t,n)}}function J(e,t){let{formats:n,replacements:r,text:a,start:o,end:i}=e;if("string"!=typeof t)return Q(...arguments);let s=0;return a.split(t).map((e=>{const a=s,c={formats:n.slice(a,a+e.length),replacements:r.slice(a,a+e.length),text:e};return s+=t.length+e.length,void 0!==o&&void 0!==i&&(o>=a&&oa&&(c.start=0),i>=a&&is&&(c.end=e.length)),c}))}function Q(e){let{formats:t,replacements:n,text:r,start:a,end:o}=e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o;if(void 0===a||void 0===o)return;const c={formats:t.slice(0,i),replacements:n.slice(0,i),text:r.slice(0,i)},l={formats:t.slice(s),replacements:n.slice(s),text:r.slice(s),start:0,end:0};return[X(c,/\u2028+$/,""),X(l,/^\u2028+/,"")]}function ee(e,t){if(t)return e;const n={};for(const t in e){let r=t;t.startsWith("data-disable-rich-text-")&&(r=t.slice("data-disable-rich-text-".length)),n[r]=e[t]}return n}function te(e){let{type:t,tagName:n,attributes:r,unregisteredAttributes:o,object:i,boundaryClass:s,isEditableTree:c}=e;const l=(u=t,(0,a.select)(g).getFormatType(u));var u;let f={};if(s&&(f["data-rich-text-format-boundary"]="true"),!l)return r&&(f={...r,...f}),{type:t,attributes:ee(f,c),object:i};f={...o,...f};for(const e in r){const t=!!l.attributes&&l.attributes[e];t?f[t]=r[e]:f[e]=r[e]}return l.className&&(f.class?f.class=`${l.className} ${f.class}`:f.class=l.className),{type:"*"===l.tagName?n:l.tagName,object:l.object,attributes:ee(f,c)}}function ne(e,t,n){do{if(e[n]!==t[n])return!1}while(n--);return!0}function re(e){let{value:t,multilineTag:n,preserveWhiteSpace:r,createEmpty:a,append:o,getLastChild:i,getParent:s,isText:c,getText:l,remove:u,appendText:f,onStartIndex:d,onEndIndex:m,isEditableTree:p,placeholder:g}=e;const{formats:h,replacements:v,text:y,start:b,end:T}=t,w=h.length+1,_=a(),N={type:n},F=W(t),C=F[F.length-1];let A,R,S;n?(o(o(_,{type:n}),""),R=A=[N]):o(_,"");for(let e=0;e(e.push(t,N),e)),[N]):[...A,...w||[]]);let F=i(_);if(a&&t===E){let e=F;for(;!c(e);)e=i(e);o(s(e),"\ufeff")}if(S===E){let t=F;for(;!c(t);)t=i(t);d&&b===e&&d(_,t),m&&T===e&&m(_,t)}if(w&&w.forEach(((e,n)=>{if(F&&R&&ne(w,R,n)&&(t!==E||w.length-1!==n))return void(F=i(F));const{type:r,tagName:a,attributes:f,unregisteredAttributes:d}=e,m=p&&t!==E&&e===C,g=s(F),h=o(g,te({type:r,tagName:a,attributes:f,unregisteredAttributes:d,boundaryClass:m,isEditableTree:p}));c(F)&&0===l(F).length&&u(F),F=o(h,"")})),t!==E){var L;if(0===e&&(d&&0===b&&d(_,F),m&&0===T&&m(_,F)),t===x)p||"script"!==(null===(L=v[e])||void 0===L?void 0:L.type)?F=o(s(F),te({...v[e],object:!0,isEditableTree:p})):(F=o(s(F),te({type:"script",isEditableTree:p})),o(F,{html:decodeURIComponent(v[e].attributes["data-rich-text-script"])})),F=o(s(F),"");else r||"\n"!==t?c(F)?f(F,t):F=o(s(F),t):(F=o(s(F),{type:"br",attributes:p?{"data-rich-text-line-break":"true"}:void 0,object:!0}),F=o(s(F),""));d&&b===e+1&&d(_,F),m&&T===e+1&&m(_,F),a&&e===y.length&&(o(s(F),"\ufeff"),g&&0===y.length&&o(s(F),{type:"span",attributes:{"data-rich-text-placeholder":g,contenteditable:"false",style:"pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;"}})),R=w,S=t}else R=w,S=t}return _}function ae(e,t,n){const r=e.parentNode;let a=0;for(;e=e.previousSibling;)a++;return n=[a,...n],r!==t&&(n=ae(r,t,n)),n}function oe(e,t){for(t=[...t];e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}function ie(e,t){"string"==typeof t&&(t=e.ownerDocument.createTextNode(t));const{type:n,attributes:r}=t;if(n){t=e.ownerDocument.createElement(n);for(const e in r)t.setAttribute(e,r[e])}return e.appendChild(t)}function se(e,t){e.appendData(t)}function ce(e){let{lastChild:t}=e;return t}function le(e){let{parentNode:t}=e;return t}function ue(e){return e.nodeType===e.TEXT_NODE}function fe(e){let{nodeValue:t}=e;return t}function de(e){return e.parentNode.removeChild(e)}function me(e){let{value:t,multilineTag:n,prepareEditableTree:r,isEditableTree:a=!0,placeholder:o,doc:i=document}=e,s=[],c=[];r&&(t={...t,formats:r(t)});return{body:re({value:t,multilineTag:n,createEmpty:()=>T(i,""),append:ie,getLastChild:ce,getParent:le,isText:ue,getText:fe,remove:de,appendText:se,onStartIndex(e,t){s=ae(t,e,[t.nodeValue.length])},onEndIndex(e,t){c=ae(t,e,[t.nodeValue.length])},isEditableTree:a,placeholder:o}),selection:{startPath:s,endPath:c}}}function pe(e){let{value:t,current:n,multilineTag:r,prepareEditableTree:a,__unstableDomOnly:o,placeholder:i}=e;const{body:s,selection:c}=me({value:t,multilineTag:r,prepareEditableTree:a,placeholder:i,doc:n.ownerDocument});ge(s,n),void 0===t.start||o||function(e,t){let{startPath:n,endPath:r}=e;const{node:a,offset:o}=oe(t,n),{node:i,offset:s}=oe(t,r),{ownerDocument:c}=t,{defaultView:l}=c,u=l.getSelection(),f=c.createRange();f.setStart(a,o),f.setEnd(i,s);const{activeElement:d}=c;if(u.rangeCount>0){if(m=f,p=u.getRangeAt(0),m.startContainer===p.startContainer&&m.startOffset===p.startOffset&&m.endContainer===p.endContainer&&m.endOffset===p.endOffset)return;u.removeAllRanges()}var m,p;u.addRange(f),d!==c.activeElement&&d instanceof l.HTMLElement&&d.focus()}(c,n)}function ge(e,t){let n,r=0;for(;n=e.firstChild;){const a=t.childNodes[r];if(a)if(a.isEqualNode(n))e.removeChild(n);else if(a.nodeName!==n.nodeName||a.nodeType===a.TEXT_NODE&&a.data!==n.data)t.replaceChild(n,a);else{const t=a.attributes,r=n.attributes;if(t){let e=t.length;for(;e--;){const{name:r}=t[e];n.getAttribute(r)||a.removeAttribute(r)}}if(r)for(let e=0;e`:`<${t}${o}>${Ce(a)}`}function Ce(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>void 0!==e.html?e.html:void 0===e.text?Fe(e):(0,he.escapeEditableHTML)(e.text))).join("")}var Ae=window.wp.a11y,Re=window.wp.i18n;function Se(e,t){return k(e,t.type)?(t.title&&(0,Ae.speak)((0,Re.sprintf)((0,Re.__)("%s removed."),t.title),"assertive"),z(e,t.type)):(t.title&&(0,Ae.speak)((0,Re.sprintf)((0,Re.__)("%s applied."),t.title),"assertive"),b(e,t))}function Le(e){const t=(0,a.select)(g).getFormatType(e);if(t)return(0,a.dispatch)(g).removeFormatTypes(e),t;window.console.error(`Format ${e} is not registered.`)}var De=window.wp.element,Oe=window.wp.deprecated,We=e.n(Oe);function ke(e){let{ref:t,value:n,settings:r={}}=e;We()("`useAnchorRef` hook",{since:"6.1",alternative:"`useAnchor` hook"});const{tagName:a,className:o,name:i}=r,s=i?k(n,i):void 0;return(0,De.useMemo)((()=>{if(!t.current)return;const{ownerDocument:{defaultView:e}}=t.current,n=e.getSelection();if(!n.rangeCount)return;const r=n.getRangeAt(0);if(!s)return r;let i=r.startContainer;for(i=i.nextElementSibling||i;i.nodeType!==i.ELEMENT_NODE;)i=i.parentNode;return i.closest(a+(o?"."+o:""))}),[s,n.start,n.end,a,o])}function Me(e){let{editableContentElement:t,value:n,settings:r={}}=e;const{tagName:a,className:o,name:i}=r,s=i?k(n,i):void 0;return(0,De.useMemo)((()=>{if(!t)return;const{ownerDocument:{defaultView:e}}=t,n=e.getSelection();if(!n.rangeCount)return;const r=null==t?void 0:t.contains(null==n?void 0:n.anchorNode),i=n.getRangeAt(0);if(!s)return{ownerDocument:i.startContainer.ownerDocument,getBoundingClientRect(){return r?i.getBoundingClientRect():t.getBoundingClientRect()}};let c=i.startContainer;for(c=c.nextElementSibling||c;c.nodeType!==c.ELEMENT_NODE;)c=c.parentNode;return c.closest(a+(o?"."+o:""))}),[t,s,n.start,n.end,a,o])}var $e=window.wp.compose;function je(e){let{record:t}=e;const n=(0,De.useRef)(),{activeFormats:r=[]}=t.current;return(0,De.useEffect)((()=>{if(!r||!r.length)return;const e="*[data-rich-text-format-boundary]",t=n.current.querySelector(e);if(!t)return;const{ownerDocument:a}=t,{defaultView:o}=a,i=`${`.rich-text:focus ${e}`} {${`background-color: ${o.getComputedStyle(t).color.replace(")",", 0.2)").replace("rgb","rgba")}`}}`,s="rich-text-boundary-style";let c=a.getElementById(s);c||(c=a.createElement("style"),c.id=s,a.head.appendChild(c)),c.innerHTML!==i&&(c.innerHTML=i)}),[r]),n}function Pe(e){const t=(0,De.useRef)(e);return t.current=e,(0,$e.useRefEffect)((e=>{function n(n){const{record:r,multilineTag:a,preserveWhiteSpace:o}=t.current;if(P(r.current)||!e.contains(e.ownerDocument.activeElement))return;const i=Z(r.current),s=j(i),c=ve({value:i,multilineTag:a,preserveWhiteSpace:o});n.clipboardData.setData("text/plain",s),n.clipboardData.setData("text/html",c),n.clipboardData.setData("rich-text","true"),n.clipboardData.setData("rich-text-multi-line-tag",a||""),n.preventDefault()}return e.addEventListener("copy",n),()=>{e.removeEventListener("copy",n)}}),[])}var Ve=window.wp.keycodes;const Ie=[];function Be(e){const[,t]=(0,De.useReducer)((()=>({}))),n=(0,De.useRef)(e);return n.current=e,(0,$e.useRefEffect)((e=>{function r(r){const{keyCode:a,shiftKey:o,altKey:i,metaKey:s,ctrlKey:c}=r;if(o||i||s||c||a!==Ve.LEFT&&a!==Ve.RIGHT)return;const{record:l,applyRecord:u}=n.current,{text:f,formats:d,start:m,end:p,activeFormats:g=[]}=l.current,h=P(l.current),{ownerDocument:v}=e,{defaultView:y}=v,{direction:b}=y.getComputedStyle(e),T="rtl"===b?Ve.RIGHT:Ve.LEFT,E=r.keyCode===T;if(h&&0===g.length){if(0===m&&E)return;if(p===f.length&&!E)return}if(!h)return;const x=d[m-1]||Ie,w=d[m]||Ie,_=E?x:w,N=g.every(((e,t)=>e===_[t]));let F=g.length;if(N?F<_.length&&F++:F--,F===g.length)return void(l.current._newActiveFormats=_);r.preventDefault();const C=(N?_:E?w:x).slice(0,F),A={...l.current,activeFormats:C};l.current=A,u(A),t()}return e.addEventListener("keydown",r),()=>{e.removeEventListener("keydown",r)}}),[])}const He=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),ze=[],Ue="data-rich-text-placeholder";function qe(e){const t=(0,De.useRef)(e);return t.current=e,(0,$e.useRefEffect)((e=>{const{ownerDocument:n}=e,{defaultView:r}=n;let a,o=!1;function i(e){if(o)return;let n;e&&(n=e.inputType);const{record:r,applyRecord:a,createRecord:i,handleChange:s}=t.current;if(n&&(0===n.indexOf("format")||He.has(n)))return void a(r.current);const c=i(),{start:l,activeFormats:u=[]}=r.current,f=function(e){let{value:t,start:n,end:r,formats:a}=e;const o=Math.min(n,r),i=Math.max(n,r),s=t.formats[o-1]||[],c=t.formats[i]||[];for(t.activeFormats=a.map(((e,t)=>{if(s[t]){if(h(e,s[t]))return s[t]}else if(c[t]&&h(e,c[t]))return c[t];return e}));--r>=n;)t.activeFormats.length>0?t.formats[r]=t.activeFormats:delete t.formats[r];return t}({value:c,start:l,end:c.start,formats:u});s(f)}function s(a){const{record:s,applyRecord:c,createRecord:l,isSelected:u,onSelectionChange:f}=t.current;if("true"!==e.contentEditable)return;if(n.activeElement!==e){if("true"!==n.activeElement.contentEditable)return;if(!n.activeElement.contains(e))return;const t=r.getSelection(),{anchorNode:a,focusNode:o}=t;if(e.contains(a)&&e!==a&&e.contains(o)&&e!==o){const{start:e,end:t}=l();s.current.activeFormats=ze,f(e,t)}else if(e.contains(a)&&e!==a){const{start:e,end:t=e}=l();s.current.activeFormats=ze,f(t)}else if(e.contains(o)){const{start:e,end:t=e}=l();s.current.activeFormats=ze,f(void 0,t)}return}if("selectionchange"!==a.type&&!u)return;if(o)return;const{start:d,end:m,text:p}=l(),g=s.current;if(p!==g.text)return void i();if(d===g.start&&m===g.end)return void(0===g.text.length&&0===d&&function(e){const t=e.getSelection(),{anchorNode:n,anchorOffset:r}=t;if(n.nodeType!==n.ELEMENT_NODE)return;const a=n.childNodes[r];a&&a.nodeType===a.ELEMENT_NODE&&a.hasAttribute(Ue)&&t.collapseToStart()}(r));const h={...g,start:d,end:m,activeFormats:g._newActiveFormats,_newActiveFormats:void 0},v=W(h,ze);h.activeFormats=v,s.current=h,c(h,{domOnly:!0}),f(d,m)}function c(){var t;o=!0,n.removeEventListener("selectionchange",s),null===(t=e.querySelector(`[${Ue}]`))||void 0===t||t.remove()}function l(){o=!1,i({inputType:"insertText"}),n.addEventListener("selectionchange",s)}function u(){const{record:n,isSelected:o,onSelectionChange:i,applyRecord:c}=t.current;if(!e.parentElement.closest('[contenteditable="true"]')){if(o)c(n.current),i(n.current.start,n.current.end);else{const e=void 0;n.current={...n.current,start:e,end:e,activeFormats:ze},i(e,e)}a=r.requestAnimationFrame(s)}}return e.addEventListener("input",i),e.addEventListener("compositionstart",c),e.addEventListener("compositionend",l),e.addEventListener("focus",u),e.addEventListener("keyup",s),e.addEventListener("mouseup",s),e.addEventListener("touchend",s),n.addEventListener("selectionchange",s),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionstart",c),e.removeEventListener("compositionend",l),e.removeEventListener("focus",u),e.removeEventListener("keyup",s),e.removeEventListener("mouseup",s),e.removeEventListener("touchend",s),n.removeEventListener("selectionchange",s),r.cancelAnimationFrame(a)}}),[])}function Ke(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{replacements:n,text:r,start:a,end:o}=e,i=P(e);let s,c=a-1,l=i?a-1:a,u=o;if(t||(c=o,l=a,u=i?o+1:o),r[c]===E){if(i&&n[c]&&n[c].length){const t=n.slice();t[c]=n[c].slice(0,-1),s={...e,replacements:t}}else s=K(e,l,u);return s}}function Xe(e){const t=(0,De.useRef)(e);return t.current=e,(0,$e.useRefEffect)((e=>{function n(e){const{keyCode:n}=e,{createRecord:r,handleChange:a,multilineTag:o}=t.current;if(e.defaultPrevented)return;if(n!==Ve.DELETE&&n!==Ve.BACKSPACE)return;const i=r(),{start:s,end:c,text:l}=i,u=n===Ve.BACKSPACE;if(0===s&&0!==c&&c===l.length)return a(K(i)),void e.preventDefault();if(o){let t;t=u&&0===i.start&&0===i.end&&I(i)?Ke(i,!u):Ke(i,u),t&&(a(t),e.preventDefault())}}return e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n)}}),[])}function Ye(e){let{value:t="",selectionStart:n,selectionEnd:r,placeholder:o,preserveWhiteSpace:i,onSelectionChange:s,onChange:c,__unstableMultilineTag:l,__unstableDisableFormats:u,__unstableIsSelected:f,__unstableDependencies:d=[],__unstableAfterParse:m,__unstableBeforeSerialize:p,__unstableAddInvisibleFormats:g}=e;const h=(0,a.useRegistry)(),[,v]=(0,De.useReducer)((()=>({}))),y=(0,De.useRef)();function b(){const{ownerDocument:{defaultView:e}}=y.current,t=e.getSelection(),n=t.rangeCount>0?t.getRangeAt(0):null;return _({element:y.current,range:n,multilineTag:l,multilineWrapperTags:"li"===l?["ul","ol"]:void 0,__unstableIsEditableTree:!0,preserveWhiteSpace:i})}function T(e){let{domOnly:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};pe({value:e,current:y.current,multilineTag:l,multilineWrapperTags:"li"===l?["ul","ol"]:void 0,prepareEditableTree:g,__unstableDomOnly:t,placeholder:o})}const E=(0,De.useRef)(t),x=(0,De.useRef)();function w(){E.current=t,x.current=_({html:t,multilineTag:l,multilineWrapperTags:"li"===l?["ul","ol"]:void 0,preserveWhiteSpace:i}),u&&(x.current.formats=Array(t.length),x.current.replacements=Array(t.length)),m&&(x.current.formats=m(x.current)),x.current.start=n,x.current.end=r}const N=(0,De.useRef)(!1);if(x.current)n===x.current.start&&r===x.current.end||(N.current=f,x.current={...x.current,start:n,end:r});else{var F,C,A;w();"core/text-color"===(null===(F=x.current)||void 0===F||null===(C=F.formats[0])||void 0===C||null===(A=C[0])||void 0===A?void 0:A.type)&&function(e){x.current=e,E.current=ve({value:p?{...e,formats:p(e)}:e,multilineTag:l,preserveWhiteSpace:i});const{formats:t,text:n}=e;h.batch((()=>{c(E.current,{__unstableFormats:t,__unstableText:n})})),v()}(x.current)}function R(e){x.current=e,T(e),E.current=u?e.text:ve({value:p?{...e,formats:p(e)}:e,multilineTag:l,preserveWhiteSpace:i});const{start:t,end:n,formats:r,text:a}=e;h.batch((()=>{s(t,n),c(E.current,{__unstableFormats:r,__unstableText:a})})),v()}function S(){w(),T(x.current)}const L=(0,De.useRef)(!1);(0,De.useLayoutEffect)((()=>{L.current&&t!==E.current&&(S(),v())}),[t]),(0,De.useLayoutEffect)((()=>{N.current&&(y.current.ownerDocument.activeElement!==y.current&&y.current.focus(),S(),N.current=!1)}),[N.current]);const D=(0,$e.useMergeRefs)([y,(0,De.useCallback)((e=>{e&&(e.style.whiteSpace="pre-wrap",e.style.minWidth="1px")}),[]),je({record:x}),Pe({record:x,multilineTag:l,preserveWhiteSpace:i}),(0,$e.useRefEffect)((e=>{function t(t){const{target:n}=t;if(n===e||n.textContent)return;const{ownerDocument:r}=n,{defaultView:a}=r,o=r.createRange(),i=a.getSelection();o.selectNode(n),i.removeAllRanges(),i.addRange(o)}return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}),[]),Be({record:x,applyRecord:T}),Xe({createRecord:b,handleChange:R,multilineTag:l}),qe({record:x,applyRecord:T,createRecord:b,handleChange:R,isSelected:f,onSelectionChange:s}),(0,$e.useRefEffect)((()=>{S(),L.current=!0}),[o,...d])]);return{value:x.current,getValue:()=>x.current,onChange:R,ref:D}}function Ge(){}function Ze(e){let{formatTypes:t,onChange:n,onFocus:r,value:a,forwardedRef:o}=e;return t.map((e=>{const{name:t,edit:i}=e;if(!i)return null;const s=k(a,t),c=void 0!==s,l=M(a),u=void 0!==l&&l.type===t;return(0,De.createElement)(i,{key:t,isActive:c,activeAttributes:c&&s.attributes||{},isObjectActive:u,activeObjectAttributes:u&&l.attributes||{},value:a,onChange:n,onFocus:r,contentRef:o})}))}(window.wp=window.wp||{}).richText=t}(); \ No newline at end of file diff --git a/wp-includes/version.php b/wp-includes/version.php index 2c12d06bf5..5a7f2d7886 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-55734'; +$wp_version = '6.3-alpha-55737'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.