From 95b456c5cd74913de490ed0d9a2d90126b767a07 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 30 Apr 2025 11:52:30 -0400 Subject: [PATCH 01/48] build: Add node-fetch dependency Utilized for script requests. --- package-lock.json | 98 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 99 insertions(+) diff --git a/package-lock.json b/package-lock.json index e6ec0a33..f7ce11ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,6 +40,7 @@ "eslint": "^8.57", "eslint-plugin-react-refresh": "^0.4.19", "magic-string": "^0.30.17", + "node-fetch": "^3.3.2", "patch-package": "^8.0.0", "prettier": "npm:wp-prettier@^3.0.3", "sass-embedded": "^1.86.3", @@ -7455,6 +7456,16 @@ "dev": true, "license": "BSD-2-Clause" }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, "node_modules/data-view-buffer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", @@ -8809,6 +8820,30 @@ "reusify": "^1.0.4" } }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -8898,6 +8933,19 @@ "is-callable": "^1.1.3" } }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, "node_modules/framer-motion": { "version": "11.11.9", "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.11.9.tgz", @@ -10615,6 +10663,46 @@ "optional": true, "peer": true }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "deprecated": "Use your platform's native DOMException instead", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, "node_modules/node-releases": { "version": "2.0.19", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", @@ -13734,6 +13822,16 @@ "node": ">=10.13.0" } }, + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, "node_modules/webpack": { "version": "5.95.0", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.95.0.tgz", diff --git a/package.json b/package.json index ac72854c..67d6354a 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "eslint": "^8.57", "eslint-plugin-react-refresh": "^0.4.19", "magic-string": "^0.30.17", + "node-fetch": "^3.3.2", "patch-package": "^8.0.0", "prettier": "npm:wp-prettier@^3.0.3", "sass-embedded": "^1.86.3", From e4c7b9a90bf4e551908f04d27dd8e56afa03a15e Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 1 May 2025 12:38:45 -0400 Subject: [PATCH 02/48] feat: Add locale configuration --- .../org/wordpress/gutenberg/EditorConfiguration.kt | 10 ++++++++-- .../main/java/org/wordpress/gutenberg/GutenbergView.kt | 1 + .../GutenbergKit/Sources/EditorConfiguration.swift | 2 ++ .../GutenbergKit/Sources/EditorViewController.swift | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/android/Gutenberg/src/main/java/org/wordpress/gutenberg/EditorConfiguration.kt b/android/Gutenberg/src/main/java/org/wordpress/gutenberg/EditorConfiguration.kt index cdf7f4e8..307d99e7 100644 --- a/android/Gutenberg/src/main/java/org/wordpress/gutenberg/EditorConfiguration.kt +++ b/android/Gutenberg/src/main/java/org/wordpress/gutenberg/EditorConfiguration.kt @@ -60,7 +60,8 @@ open class EditorConfiguration constructor( val namespaceExcludedPaths: Array, val authHeader: String, val webViewGlobals: List, - val editorSettings: String? + val editorSettings: String?, + val locale: String? ) : Parcelable { companion object { @JvmStatic @@ -82,6 +83,7 @@ open class EditorConfiguration constructor( private var authHeader: String = "" private var webViewGlobals: List = emptyList() private var editorSettings: String? = null + private var locale: String? = "en" fun setTitle(title: String) = apply { this.title = title } fun setContent(content: String) = apply { this.content = content } @@ -97,6 +99,7 @@ open class EditorConfiguration constructor( fun setAuthHeader(authHeader: String) = apply { this.authHeader = authHeader } fun setWebViewGlobals(webViewGlobals: List) = apply { this.webViewGlobals = webViewGlobals } fun setEditorSettings(editorSettings: String?) = apply { this.editorSettings = editorSettings } + fun setLocale(locale: String?) = apply { this.locale = locale } fun build(): EditorConfiguration = EditorConfiguration( title = title, @@ -112,7 +115,8 @@ open class EditorConfiguration constructor( namespaceExcludedPaths = namespaceExcludedPaths, authHeader = authHeader, webViewGlobals = webViewGlobals, - editorSettings = editorSettings + editorSettings = editorSettings, + locale = locale ) } @@ -136,6 +140,7 @@ open class EditorConfiguration constructor( if (authHeader != other.authHeader) return false if (webViewGlobals != other.webViewGlobals) return false if (editorSettings != other.editorSettings) return false + if (locale != other.locale) return false return true } @@ -155,6 +160,7 @@ open class EditorConfiguration constructor( result = 31 * result + authHeader.hashCode() result = 31 * result + webViewGlobals.hashCode() result = 31 * result + (editorSettings?.hashCode() ?: 0) + result = 31 * result + (locale?.hashCode() ?: 0) return result } } diff --git a/android/Gutenberg/src/main/java/org/wordpress/gutenberg/GutenbergView.kt b/android/Gutenberg/src/main/java/org/wordpress/gutenberg/GutenbergView.kt index 83314006..9f157113 100644 --- a/android/Gutenberg/src/main/java/org/wordpress/gutenberg/GutenbergView.kt +++ b/android/Gutenberg/src/main/java/org/wordpress/gutenberg/GutenbergView.kt @@ -271,6 +271,7 @@ class GutenbergView : WebView { "themeStyles": ${configuration.themeStyles}, "hideTitle": ${configuration.hideTitle}, "editorSettings": $editorSettings, + "locale": "${configuration.locale}", ${if (configuration.postId != null) """ "post": { "id": ${configuration.postId}, diff --git a/ios/Sources/GutenbergKit/Sources/EditorConfiguration.swift b/ios/Sources/GutenbergKit/Sources/EditorConfiguration.swift index f8edbf46..6f671ab9 100644 --- a/ios/Sources/GutenbergKit/Sources/EditorConfiguration.swift +++ b/ios/Sources/GutenbergKit/Sources/EditorConfiguration.swift @@ -19,6 +19,8 @@ public struct EditorConfiguration { public var webViewGlobals: [WebViewGlobal] = [] /// Raw block editor settings from the WordPress REST API public var editorSettings: [String: Any]? + /// The locale to use for translations + public var locale = "en" public init(title: String = "", content: String = "") { self.title = title diff --git a/ios/Sources/GutenbergKit/Sources/EditorViewController.swift b/ios/Sources/GutenbergKit/Sources/EditorViewController.swift index e6280cd7..571b401c 100644 --- a/ios/Sources/GutenbergKit/Sources/EditorViewController.swift +++ b/ios/Sources/GutenbergKit/Sources/EditorViewController.swift @@ -168,6 +168,7 @@ public final class EditorViewController: UIViewController, GutenbergEditorContro themeStyles: \(configuration.themeStyles), hideTitle: \(configuration.hideTitle), editorSettings: \(editorSettingsJS), + locale: '\(configuration.locale)', post: { id: \(configuration.postID ?? -1), title: '\(escapedTitle)', From cbddc691191f6814b5641fab5af91ef9f1bcabe4 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 1 May 2025 12:49:31 -0400 Subject: [PATCH 03/48] feat: Configure locale --- src/index.jsx | 2 ++ src/remote.jsx | 2 ++ src/utils/localization.js | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 src/utils/localization.js diff --git a/src/index.jsx b/src/index.jsx index 2eff500a..2711f43c 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -13,6 +13,7 @@ import { registerCoreBlocks } from '@wordpress/block-library'; */ import { initializeApiFetch } from './utils/api-fetch-setup'; import { getGBKit, getPost, waitForGBKit, editorLoaded } from './utils/bridge'; +import { configureLocale } from './utils/localization'; import Layout from './components/layout'; import './index.scss'; import EditorLoadError from './components/editor-load-error'; @@ -20,6 +21,7 @@ import EditorLoadError from './components/editor-load-error'; try { await waitForGBKit(); initializeApiFetch(); + await configureLocale(); initializeEditor(); } catch ( error ) { const root = document.getElementById( 'root' ); diff --git a/src/remote.jsx b/src/remote.jsx index a8c6e9ad..a550498d 100644 --- a/src/remote.jsx +++ b/src/remote.jsx @@ -7,6 +7,7 @@ import apiFetch from '@wordpress/api-fetch'; * Internal dependencies */ import { getGBKit, getPost, waitForGBKit } from './utils/bridge'; +import { configureLocale } from './utils/localization'; import { initializeApiFetch } from './utils/api-fetch-setup'; import './index.scss'; import defaultEditorStyles from '@wordpress/block-editor/build-style/default-editor-styles.css?inline'; @@ -17,6 +18,7 @@ window.wp.apiFetch = apiFetch; try { await waitForGBKit(); initializeApiFetch(); + await configureLocale(); await initalizeRemoteEditor(); } catch ( error ) { // Fallback to the local editor and display a notice. Because the remote diff --git a/src/utils/localization.js b/src/utils/localization.js new file mode 100644 index 00000000..b7b20819 --- /dev/null +++ b/src/utils/localization.js @@ -0,0 +1,33 @@ +/** + * WordPress dependencies + */ +import { setLocaleData } from '@wordpress/i18n'; +/** + * Internal dependencies + */ +import { getGBKit } from './bridge'; + +/** + * Initializes i18n support for the editor. + * + * @return {Promise} A promise that resolves when i18n is initialized. + */ +export async function configureLocale() { + const { locale = 'en' } = getGBKit(); + await loadTranslations( locale ); +} + +/** + * Loads translations for the specified locale from the downloaded files. + * + * @param {string} locale The locale to load translations for. + * @return {Promise} A promise that resolves when translations are loaded. + */ +export async function loadTranslations( locale ) { + try { + const translations = await import( `../translations/${ locale }.json` ); + setLocaleData( translations ); + } catch ( error ) { + // Continue with default locale + } +} From 38b30f1bf70183a6a418834b144a47089c6aaeac Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 1 May 2025 12:54:53 -0400 Subject: [PATCH 04/48] build: Add download translations script --- .gitignore | 3 + bin/download-translations.js | 113 +++++++++++++++++++++++++++++++++++ package.json | 4 +- 3 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 bin/download-translations.js diff --git a/.gitignore b/.gitignore index 47c4c257..6aa89974 100644 --- a/.gitignore +++ b/.gitignore @@ -193,3 +193,6 @@ local.properties # /ios/Sources/GutenbergKit/Gutenberg/assets # /ios/Sources/GutenbergKit/Gutenberg/index.html # /ios/Sources/GutenbergKit/Gutenberg/remote.html + +# Translation files +src/translations/data/ diff --git a/bin/download-translations.js b/bin/download-translations.js new file mode 100644 index 00000000..63c28248 --- /dev/null +++ b/bin/download-translations.js @@ -0,0 +1,113 @@ +/** + * External dependencies + */ +import fs from 'fs'; +import path from 'path'; +import fetch from 'node-fetch'; + +const TRANSLATIONS_DIR = path.join( process.cwd(), 'src/translations/data' ); +const SUPPORTED_LOCALES = [ + 'en', + 'es', + 'fr', + 'de', + 'it', + 'pt', + 'ru', + 'ja', + 'zh', + 'ko', + 'nl', + 'sv', + 'da', + 'fi', + 'no', + 'pl', + 'cs', + 'hu', + 'ro', + 'tr', + 'bg', + 'el', + 'sk', + 'sl', + 'hr', + 'sr', + 'uk', + 'ar', + 'he', + 'fa', + 'hi', + 'bn', + 'id', + 'ms', + 'th', + 'vi', + 'tl', + 'af', + 'sw', + 'zu', +]; + +/** + * Downloads translations for a specific locale from translate.wordpress.org. + * + * @param {string} locale The locale to download translations for. + * @return {Promise} A promise that resolves when translations are downloaded. + */ +async function downloadTranslations( locale ) { + const url = `https://translate.wordpress.org/projects/wp-plugins/gutenberg/dev/${ locale }/default/export-translations/?format=json`; + const response = await fetch( url ); + + if ( ! response.ok ) { + throw new Error( `Failed to download translations for ${ locale }` ); + } + + const translations = await response.json(); + const outputPath = path.join( TRANSLATIONS_DIR, `${ locale }.json` ); + + // Ensure the translations directory exists + if ( ! fs.existsSync( TRANSLATIONS_DIR ) ) { + fs.mkdirSync( TRANSLATIONS_DIR, { recursive: true } ); + } + + // Write translations to file + fs.writeFileSync( outputPath, JSON.stringify( translations, null, 2 ) ); +} + +/** + * Downloads translations for all supported locales. + */ +async function downloadAllTranslations() { + logInfo( 'Downloading translations...' ); + + for ( const locale of SUPPORTED_LOCALES ) { + try { + logInfo( `Downloading translations for ${ locale }...` ); + await downloadTranslations( locale ); + logInfo( `✓ Downloaded translations for ${ locale }` ); + } catch ( error ) { + logError( + `✗ Failed to download translations for ${ locale }:`, + error + ); + } + } + + logInfo( 'Translation download complete!' ); +} + +downloadAllTranslations().catch( ( error ) => { + logError( 'Failed to download translations:', error ); + process.exit( 1 ); +} ); + +function logInfo( message ) { + // eslint-disable-next-line no-console + console.log( message ); +} + +function logError( message ) { + // eslint-disable-next-line no-console + console.error( message ); +} diff --git a/package.json b/package.json index 67d6354a..38bb1811 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,9 @@ "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", "format": "prettier --write .", "postinstall": "patch-package", - "preview": "vite preview --host" + "preview": "vite preview --host", + "download-translations": "node bin/download-translations.js", + "prebuild": "npm run download-translations" }, "dependencies": { "@wordpress/api-fetch": "^7.10", From a42af38df2a43187c579a1d2a80834b863f5af27 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 1 May 2025 13:21:34 -0400 Subject: [PATCH 05/48] task: Add logger utility Standardized logging within the code. --- src/utils/logger.js | 98 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 src/utils/logger.js diff --git a/src/utils/logger.js b/src/utils/logger.js new file mode 100644 index 00000000..06339f0c --- /dev/null +++ b/src/utils/logger.js @@ -0,0 +1,98 @@ +// Log levels in order of verbosity +const LOG_LEVELS = { + ERROR: 0, + WARN: 1, + INFO: 2, + DEBUG: 3, + VERBOSE: 4, +}; + +// Default log level +let currentLogLevel = LOG_LEVELS.INFO; + +/** + * Set the current log level + * @param {string} level - The log level to set (ERROR, WARN, INFO, DEBUG, VERBOSE) + */ +const setLogLevel = ( level ) => { + if ( LOG_LEVELS[ level ] !== undefined ) { + currentLogLevel = LOG_LEVELS[ level ]; + } else { + // eslint-disable-next-line no-console + console.warn( + `Invalid log level: ${ level }. Using default level INFO.` + ); + } +}; + +/** + * Check if a message should be logged based on the current log level + * @param {number} level - The level of the message to check + * + * @return {boolean} - Whether the message should be logged + */ +const shouldLog = ( level ) => { + return level <= currentLogLevel; +}; + +/** + * Log an error message + * @param {string} message - The message to log + * @param {*} [data] - Optional data to log + */ +const error = ( message, data ) => { + if ( shouldLog( LOG_LEVELS.ERROR ) ) { + // eslint-disable-next-line no-console + console.error( `[ERROR] ${ message }`, data || '' ); + } +}; + +/** + * Log a warning message + * @param {string} message - The message to log + * @param {*} [data] - Optional data to log + */ +const warn = ( message, data ) => { + if ( shouldLog( LOG_LEVELS.WARN ) ) { + // eslint-disable-next-line no-console + console.warn( `[WARN] ${ message }`, data || '' ); + } +}; + +/** + * Log an info message + * @param {string} message - The message to log + * @param {*} [data] - Optional data to log + */ +const info = ( message, data ) => { + if ( shouldLog( LOG_LEVELS.INFO ) ) { + // eslint-disable-next-line no-console + console.info( `[INFO] ${ message }`, data || '' ); + } +}; + +/** + * Log a debug message + * @param {string} message - The message to log + * @param {*} [data] - Optional data to log + */ +const debug = ( message, data ) => { + if ( shouldLog( LOG_LEVELS.DEBUG ) ) { + // eslint-disable-next-line no-console + console.debug( `[DEBUG] ${ message }`, data || '' ); + } +}; + +/** + * Log a verbose message + * @param {string} message - The message to log + * @param {*} [data] - Optional data to log + */ +const verbose = ( message, data ) => { + if ( shouldLog( LOG_LEVELS.VERBOSE ) ) { + // eslint-disable-next-line no-console + console.log( `[VERBOSE] ${ message }`, data || '' ); + } +}; + +export { setLogLevel, error, warn, info, debug, verbose, LOG_LEVELS }; From fd4c65424a3cdd7053ba3d82da52bfe9aaab3cc0 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 1 May 2025 13:26:04 -0400 Subject: [PATCH 06/48] refactor: Utilize logger utility --- bin/download-translations.js | 34 +++++++++++++--------------------- src/utils/localization.js | 5 +++-- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/bin/download-translations.js b/bin/download-translations.js index 63c28248..9bd6eb5b 100644 --- a/bin/download-translations.js +++ b/bin/download-translations.js @@ -5,6 +5,11 @@ import fs from 'fs'; import path from 'path'; import fetch from 'node-fetch'; +/** + * Internal dependencies + */ +import { info, error } from '../src/utils/logger'; + const TRANSLATIONS_DIR = path.join( process.cwd(), 'src/translations/data' ); const SUPPORTED_LOCALES = [ 'en', @@ -79,35 +84,22 @@ async function downloadTranslations( locale ) { * Downloads translations for all supported locales. */ async function downloadAllTranslations() { - logInfo( 'Downloading translations...' ); + info( 'Downloading translations...' ); for ( const locale of SUPPORTED_LOCALES ) { try { - logInfo( `Downloading translations for ${ locale }...` ); + info( `Downloading translations for ${ locale }...` ); await downloadTranslations( locale ); - logInfo( `✓ Downloaded translations for ${ locale }` ); - } catch ( error ) { - logError( - `✗ Failed to download translations for ${ locale }:`, - error - ); + info( `✓ Downloaded translations for ${ locale }` ); + } catch ( err ) { + error( `✗ Failed to download translations for ${ locale }:`, err ); } } - logInfo( 'Translation download complete!' ); + info( 'Translation download complete!' ); } -downloadAllTranslations().catch( ( error ) => { - logError( 'Failed to download translations:', error ); +downloadAllTranslations().catch( ( err ) => { + error( 'Failed to download translations:', err ); process.exit( 1 ); } ); - -function logInfo( message ) { - // eslint-disable-next-line no-console - console.log( message ); -} - -function logError( message ) { - // eslint-disable-next-line no-console - console.error( message ); -} diff --git a/src/utils/localization.js b/src/utils/localization.js index b7b20819..e94c2ed7 100644 --- a/src/utils/localization.js +++ b/src/utils/localization.js @@ -6,7 +6,7 @@ import { setLocaleData } from '@wordpress/i18n'; * Internal dependencies */ import { getGBKit } from './bridge'; - +import { error } from './logger'; /** * Initializes i18n support for the editor. * @@ -27,7 +27,8 @@ export async function loadTranslations( locale ) { try { const translations = await import( `../translations/${ locale }.json` ); setLocaleData( translations ); - } catch ( error ) { + } catch ( err ) { // Continue with default locale + error( 'Error loading translations', err ); } } From e128481063527e9fd579f9f3700b701f974c4871 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 1 May 2025 13:26:28 -0400 Subject: [PATCH 07/48] feat: Match translations supported by Gutenberg Mobile --- bin/download-translations.js | 89 ++++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 40 deletions(-) diff --git a/bin/download-translations.js b/bin/download-translations.js index 9bd6eb5b..45d75c68 100644 --- a/bin/download-translations.js +++ b/bin/download-translations.js @@ -12,46 +12,55 @@ import { info, error } from '../src/utils/logger'; const TRANSLATIONS_DIR = path.join( process.cwd(), 'src/translations/data' ); const SUPPORTED_LOCALES = [ - 'en', - 'es', - 'fr', - 'de', - 'it', - 'pt', - 'ru', - 'ja', - 'zh', - 'ko', - 'nl', - 'sv', - 'da', - 'fi', - 'no', - 'pl', - 'cs', - 'hu', - 'ro', - 'tr', - 'bg', - 'el', - 'sk', - 'sl', - 'hr', - 'sr', - 'uk', - 'ar', - 'he', - 'fa', - 'hi', - 'bn', - 'id', - 'ms', - 'th', - 'vi', - 'tl', - 'af', - 'sw', - 'zu', + 'ar', // Arabic + 'bg', // Bulgarian + 'bo', // Tibetan + 'ca', // Catalan + 'cs', // Czech + 'cy', // Welsh + 'da', // Danish + 'de', // German + 'en-au', // English (Australia) + 'en-ca', // English (Canada) + 'en-gb', // English (UK) + 'en-nz', // English (New Zealand) + 'en-za', // English (South Africa) + 'el', // Greek + 'es', // Spanish + 'es-ar', // Spanish (Argentina) + 'es-cl', // Spanish (Chile) + 'es-cr', // Spanish (Costa Rica) + 'fa', // Persian + 'fr', // French + 'gl', // Galician + 'he', // Hebrew + 'hr', // Croatian + 'hu', // Hungarian + 'id', // Indonesian + 'is', // Icelandic + 'it', // Italian + 'ja', // Japanese + 'ka', // Georgian + 'ko', // Korean + 'nb', // Norwegian (Bokmål) + 'nl', // Dutch + 'nl-be', // Dutch (Belgium) + 'pl', // Polish + 'pt', // Portuguese + 'pt-br', // Portuguese (Brazil) + 'ro', // Romainian + 'ru', // Russian + 'sk', // Slovak + 'sq', // Albanian + 'sr', // Serbian + 'sv', // Swedish + 'th', // Thai + 'tr', // Turkish + 'uk', // Ukrainian + 'ur', // Urdu + 'vi', // Vietnamese + 'zh-cn', // Chinese (China) + 'zh-tw', // Chinese (Taiwan) ]; /** From da26c1b9d3d0c9e321155fde1703649e466ee4e2 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 1 May 2025 13:27:09 -0400 Subject: [PATCH 08/48] fix: Repair translations data path --- src/utils/localization.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/localization.js b/src/utils/localization.js index e94c2ed7..741b2236 100644 --- a/src/utils/localization.js +++ b/src/utils/localization.js @@ -25,7 +25,9 @@ export async function configureLocale() { */ export async function loadTranslations( locale ) { try { - const translations = await import( `../translations/${ locale }.json` ); + const translations = await import( + `../translations/data/${ locale }.json` + ); setLocaleData( translations ); } catch ( err ) { // Continue with default locale From 6ab424e468aec8cf5cadc21a689b8987bea54838 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 1 May 2025 13:27:24 -0400 Subject: [PATCH 09/48] fix: Start demo editor The editor no longer implicitly starts. --- ios/Demo-iOS/Sources/EditorView.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/ios/Demo-iOS/Sources/EditorView.swift b/ios/Demo-iOS/Sources/EditorView.swift index 3fc9a8c9..f1f3394b 100644 --- a/ios/Demo-iOS/Sources/EditorView.swift +++ b/ios/Demo-iOS/Sources/EditorView.swift @@ -77,6 +77,7 @@ private struct _EditorView: UIViewControllerRepresentable { if #available(iOS 16.4, *) { viewController.webView.isInspectable = true } + viewController.startEditorSetup() return viewController } From c47453dfcd05e53724ead6b90d987b53341fe4a3 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 1 May 2025 13:30:19 -0400 Subject: [PATCH 10/48] build: Add GUTERNBERG_EDITOR_REMOTE_URL environment value Simplify configuration with examples. --- .../xcshareddata/xcschemes/Gutenberg.xcscheme | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ios/Demo-iOS/Gutenberg.xcodeproj/xcshareddata/xcschemes/Gutenberg.xcscheme b/ios/Demo-iOS/Gutenberg.xcodeproj/xcshareddata/xcschemes/Gutenberg.xcscheme index 374546b0..1a352dfa 100644 --- a/ios/Demo-iOS/Gutenberg.xcodeproj/xcshareddata/xcschemes/Gutenberg.xcscheme +++ b/ios/Demo-iOS/Gutenberg.xcodeproj/xcshareddata/xcschemes/Gutenberg.xcscheme @@ -56,6 +56,11 @@ value = "http://localhost:5173/" isEnabled = "NO"> + + Date: Thu, 1 May 2025 14:11:55 -0400 Subject: [PATCH 11/48] fix: Repair script logger import path --- bin/download-translations.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/download-translations.js b/bin/download-translations.js index 45d75c68..03de2f9c 100644 --- a/bin/download-translations.js +++ b/bin/download-translations.js @@ -8,7 +8,7 @@ import fetch from 'node-fetch'; /** * Internal dependencies */ -import { info, error } from '../src/utils/logger'; +import { info, error } from '../src/utils/logger.js'; const TRANSLATIONS_DIR = path.join( process.cwd(), 'src/translations/data' ); const SUPPORTED_LOCALES = [ From 6b78bf843210ecc201fc3be7ccffd67c3c462d13 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 1 May 2025 14:12:27 -0400 Subject: [PATCH 12/48] task: Reduce translation download script noise --- bin/download-translations.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/download-translations.js b/bin/download-translations.js index 03de2f9c..ab1055a4 100644 --- a/bin/download-translations.js +++ b/bin/download-translations.js @@ -8,7 +8,7 @@ import fetch from 'node-fetch'; /** * Internal dependencies */ -import { info, error } from '../src/utils/logger.js'; +import { info, error, verbose } from '../src/utils/logger.js'; const TRANSLATIONS_DIR = path.join( process.cwd(), 'src/translations/data' ); const SUPPORTED_LOCALES = [ @@ -97,9 +97,9 @@ async function downloadAllTranslations() { for ( const locale of SUPPORTED_LOCALES ) { try { - info( `Downloading translations for ${ locale }...` ); + verbose( `Downloading translations for ${ locale }...` ); await downloadTranslations( locale ); - info( `✓ Downloaded translations for ${ locale }` ); + verbose( `✓ Downloaded translations for ${ locale }` ); } catch ( err ) { error( `✗ Failed to download translations for ${ locale }:`, err ); } From 971e831a59c09fbad156bec0fadf2eb390707bcc Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 1 May 2025 14:13:00 -0400 Subject: [PATCH 13/48] feat: Control log levels for scripts --- src/utils/logger.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/logger.js b/src/utils/logger.js index 06339f0c..8ade73ec 100644 --- a/src/utils/logger.js +++ b/src/utils/logger.js @@ -8,7 +8,7 @@ const LOG_LEVELS = { }; // Default log level -let currentLogLevel = LOG_LEVELS.INFO; +let currentLogLevel = process.env.LOG_LEVEL || LOG_LEVELS.INFO; /** * Set the current log level From bf9614acf1f5a73d779be324bac1b8c13d7035fa Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 1 May 2025 14:51:02 -0400 Subject: [PATCH 14/48] fix: Use default value from dynamic import --- src/utils/localization.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/localization.js b/src/utils/localization.js index 741b2236..0029e65d 100644 --- a/src/utils/localization.js +++ b/src/utils/localization.js @@ -2,6 +2,7 @@ * WordPress dependencies */ import { setLocaleData } from '@wordpress/i18n'; + /** * Internal dependencies */ @@ -25,7 +26,7 @@ export async function configureLocale() { */ export async function loadTranslations( locale ) { try { - const translations = await import( + const { default: translations } = await import( `../translations/data/${ locale }.json` ); setLocaleData( translations ); From 9f22787de875a452651930c3e2bcff702191d2bc Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 1 May 2025 15:12:29 -0400 Subject: [PATCH 15/48] refactor: Rename API fetch utility Consistently name utility files as objects. --- src/index.jsx | 2 +- src/remote.jsx | 2 +- src/utils/{api-fetch-setup.js => api-fetch.js} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename src/utils/{api-fetch-setup.js => api-fetch.js} (100%) diff --git a/src/index.jsx b/src/index.jsx index 2711f43c..fa570531 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -11,7 +11,7 @@ import { registerCoreBlocks } from '@wordpress/block-library'; /** * Internal dependencies */ -import { initializeApiFetch } from './utils/api-fetch-setup'; +import { initializeApiFetch } from './utils/api-fetch'; import { getGBKit, getPost, waitForGBKit, editorLoaded } from './utils/bridge'; import { configureLocale } from './utils/localization'; import Layout from './components/layout'; diff --git a/src/remote.jsx b/src/remote.jsx index a550498d..4e35697a 100644 --- a/src/remote.jsx +++ b/src/remote.jsx @@ -8,7 +8,7 @@ import apiFetch from '@wordpress/api-fetch'; */ import { getGBKit, getPost, waitForGBKit } from './utils/bridge'; import { configureLocale } from './utils/localization'; -import { initializeApiFetch } from './utils/api-fetch-setup'; +import { initializeApiFetch } from './utils/api-fetch'; import './index.scss'; import defaultEditorStyles from '@wordpress/block-editor/build-style/default-editor-styles.css?inline'; diff --git a/src/utils/api-fetch-setup.js b/src/utils/api-fetch.js similarity index 100% rename from src/utils/api-fetch-setup.js rename to src/utils/api-fetch.js From e3d5a253f6adf8efed2dbc1a6435b16dcc859445 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 1 May 2025 15:13:33 -0400 Subject: [PATCH 16/48] refactor: Rename exception parser utility Consistently name utility files as objects. --- src/utils/bridge.js | 2 +- src/utils/{parse-exception.js => exception-parser.js} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/utils/{parse-exception.js => exception-parser.js} (100%) diff --git a/src/utils/bridge.js b/src/utils/bridge.js index 72e7bf63..5d1e300e 100644 --- a/src/utils/bridge.js +++ b/src/utils/bridge.js @@ -1,7 +1,7 @@ /** * Internal dependencies */ -import parseException from './parse-exception'; +import parseException from './exception-parser'; /** * Notifies the native host that the editor has loaded. diff --git a/src/utils/parse-exception.js b/src/utils/exception-parser.js similarity index 100% rename from src/utils/parse-exception.js rename to src/utils/exception-parser.js From 5a482302d6d744a6ad7e3df79a261541947526f4 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 1 May 2025 15:17:27 -0400 Subject: [PATCH 17/48] fix: Postpone importing `@wordpress` packages until after setting locale Required to ensure imported files have the correct locale set. --- src/index.jsx | 40 +--- src/index.scss | 440 ++++++++++++++++++++++--------------------- src/utils/editor.jsx | 44 +++++ 3 files changed, 269 insertions(+), 255 deletions(-) create mode 100644 src/utils/editor.jsx diff --git a/src/index.jsx b/src/index.jsx index fa570531..e60c9914 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -2,19 +2,13 @@ * WordPress dependencies */ import { createRoot, StrictMode } from '@wordpress/element'; -import { dispatch } from '@wordpress/data'; -import { store as editorStore } from '@wordpress/editor'; -import { store as preferencesStore } from '@wordpress/preferences'; -import defaultEditorStyles from '@wordpress/block-editor/build-style/default-editor-styles.css?inline'; -import { registerCoreBlocks } from '@wordpress/block-library'; /** * Internal dependencies */ import { initializeApiFetch } from './utils/api-fetch'; -import { getGBKit, getPost, waitForGBKit, editorLoaded } from './utils/bridge'; +import { waitForGBKit, editorLoaded } from './utils/bridge'; import { configureLocale } from './utils/localization'; -import Layout from './components/layout'; import './index.scss'; import EditorLoadError from './components/editor-load-error'; @@ -22,6 +16,9 @@ try { await waitForGBKit(); initializeApiFetch(); await configureLocale(); + + // Postpone importing `@wordpress` packages until after setting the locale + const { initializeEditor } = await import( './utils/editor' ); initializeEditor(); } catch ( error ) { const root = document.getElementById( 'root' ); @@ -32,32 +29,3 @@ try { ); editorLoaded(); } - -/** - * Configure editor settings and styles, and render the editor. - */ -function initializeEditor() { - const { themeStyles, hideTitle, editorSettings } = getGBKit(); - - const settings = editorSettings || { - defaultEditorStyles: [ { css: defaultEditorStyles } ], - }; - dispatch( editorStore ).updateEditorSettings( settings ); - - const preferenceDispatch = dispatch( preferencesStore ); - preferenceDispatch.setDefaults( 'core', { - fixedToolbar: true, - } ); - preferenceDispatch.setDefaults( 'core/edit-post', { - themeStyles, - } ); - - registerCoreBlocks(); - const post = getPost(); - - createRoot( document.getElementById( 'root' ) ).render( - - - - ); -} diff --git a/src/index.scss b/src/index.scss index 2cb954e8..46df2f3a 100644 --- a/src/index.scss +++ b/src/index.scss @@ -5,232 +5,234 @@ --wp--style--global--content-size: 645px; } -.gutenberg-kit-root { - display: flex; - flex-direction: column; - height: 100vh; -} - -:where(body) { +:where(body.gutenberg-kit) { font-family: wordpress.$default-font; margin: 0; } -.block-editor-inserter__menu .block-editor-tabbed-sidebar__close-button { - display: none; -} - -/* Popover */ - -.components-popover__header-title { - padding-left: 20px; -} - -.components-popover.is-expanded .components-popover__content { - border-radius: 0 !important; - padding: 0 8px; -} - -/* Misc */ - -.block-settings-menu { - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - background-color: #ffffff; - transform: none !important; - position: fixed !important; - overflow: scroll; -} - -.block-settings-menu__header { +.gutenberg-kit-root { display: flex; flex-direction: column; - align-items: end; -} - -.block-settings-menu__close { - margin: 8px 8px 0px 0px; -} - -.block-settings-menu .components-popover__content { - width: 100%; - min-height: 100vh; -} - -.block-inspector-siderbar { - background: #f6f6fbff; - border-left: 0.5px solid #c8c7cc; - width: 320px; -} - -// Hide the inline insterter shown inside the block list -.block-editor-block-list__block-side-inserter-popover { - display: none; -} - -/* Inserter (Mobile Design) */ - -// Inserter tab buttons -.block-editor-tabbed-sidebar__tablist button { - font-size: 16px; -} - -.block-editor-inserter__menu { - /* Fixes vertical scrolling */ - overflow-y: auto !important; -} - -.block-editor-inserter__popover .block-editor-inserter__menu { - /* Fixes margins; the editor uses negative ones here */ - margin-bottom: auto !important; - margin-top: auto !important; -} - -// Block inserter Patterns and Media list buttons -.block-editor-inserter__menu .block-editor-tabbed-sidebar__tabpanel button { - font-size: 16px; -} - -// Block inserter Patterns sub-section title -.block-editor-inserter__menu - .block-editor-tabbed-sidebar__tabpanel - .block-editor-inserter__patterns-category-panel-title { - font-size: 18px; -} - -// Block inserter Patterns item title -.block-editor-inserter__menu - .block-editor-tabbed-sidebar__tabpanel - .block-editor-block-patterns-list__item-title { - font-size: 16px; -} - -.block-editor-inserter__popover - .components-dropdown__content - .components-popover__content { - padding: 0px !important; - padding-left: 8px !important; - padding-right: 8px !important; -} - -// Inserter title -.components-popover__header-title { - font-size: 17px; - font-weight: 600; - text-align: center; -} - -// Inserter section title -.block-editor-inserter__panel-title { - font-size: 15px; - font-weight: 600; - margin-left: 12px; -} - -.components-draggable-drag-component-root { - display: none !important; -} - -.components-button.block-editor-block-types-list__item { - -webkit-tap-highlight-color: transparent; - pointer-events: auto; -} - -.components-button.block-editor-block-types-list__item:not( - :disabled - ):hover::after { - background: transparent; + height: 100vh; } -.components-button.block-editor-block-types-list__item:not(:disabled):hover +.gutenberg-kit { + .block-editor-inserter__menu .block-editor-tabbed-sidebar__close-button { + display: none; + } + + /* Popover */ + + .components-popover__header-title { + padding-left: 20px; + } + + .components-popover.is-expanded .components-popover__content { + border-radius: 0 !important; + padding: 0 8px; + } + + /* Misc */ + + .block-settings-menu { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: #ffffff; + transform: none !important; + position: fixed !important; + overflow: scroll; + } + + .block-settings-menu__header { + display: flex; + flex-direction: column; + align-items: end; + } + + .block-settings-menu__close { + margin: 8px 8px 0px 0px; + } + + .block-settings-menu .components-popover__content { + width: 100%; + min-height: 100vh; + } + + .block-inspector-siderbar { + background: #f6f6fbff; + border-left: 0.5px solid #c8c7cc; + width: 320px; + } + + // Hide the inline insterter shown inside the block list + .block-editor-block-list__block-side-inserter-popover { + display: none; + } + + /* Inserter (Mobile Design) */ + + // Inserter tab buttons + .block-editor-tabbed-sidebar__tablist button { + font-size: 16px; + } + + .block-editor-inserter__menu { + /* Fixes vertical scrolling */ + overflow-y: auto !important; + } + + .block-editor-inserter__popover .block-editor-inserter__menu { + /* Fixes margins; the editor uses negative ones here */ + margin-bottom: auto !important; + margin-top: auto !important; + } + + // Block inserter Patterns and Media list buttons + .block-editor-inserter__menu .block-editor-tabbed-sidebar__tabpanel button { + font-size: 16px; + } + + // Block inserter Patterns sub-section title + .block-editor-inserter__menu + .block-editor-tabbed-sidebar__tabpanel + .block-editor-inserter__patterns-category-panel-title { + font-size: 18px; + } + + // Block inserter Patterns item title + .block-editor-inserter__menu + .block-editor-tabbed-sidebar__tabpanel + .block-editor-block-patterns-list__item-title { + font-size: 16px; + } + + .block-editor-inserter__popover + .components-dropdown__content + .components-popover__content { + padding: 0px !important; + padding-left: 8px !important; + padding-right: 8px !important; + } + + // Inserter title + .components-popover__header-title { + font-size: 17px; + font-weight: 600; + text-align: center; + } + + // Inserter section title + .block-editor-inserter__panel-title { + font-size: 15px; + font-weight: 600; + margin-left: 12px; + } + + .components-draggable-drag-component-root { + display: none !important; + } + + .components-button.block-editor-block-types-list__item { + -webkit-tap-highlight-color: transparent; + pointer-events: auto; + } + + .components-button.block-editor-block-types-list__item:not( + :disabled + ):hover::after { + background: transparent; + } + + .components-button.block-editor-block-types-list__item:not(:disabled):hover + .block-editor-block-types-list__item-title { + color: inherit !important; + } + + .components-button.block-editor-block-types-list__item:not(:disabled):hover + svg { + color: inherit !important; + } + + .block-editor-block-types-list__list-item { + pointer-events: auto; + } + + .block-editor-block-types-list__item { + pointer-events: none; + } + + // Inserter block type icon + .block-editor-block-types-list__item-icon { + scale: 1.3; + } + + // Inserter block type title .block-editor-block-types-list__item-title { - color: inherit !important; -} - -.components-button.block-editor-block-types-list__item:not(:disabled):hover - svg { - color: inherit !important; -} - -.block-editor-block-types-list__list-item { - pointer-events: auto; -} - -.block-editor-block-types-list__item { - pointer-events: none; -} - -// Inserter block type icon -.block-editor-block-types-list__item-icon { - scale: 1.3; -} - -// Inserter block type title -.block-editor-block-types-list__item-title { - font-size: 17px; -} - -/* Settings and more */ - -// Block settings description -.block-editor-block-card__description { - font-size: 15px !important; - margin-top: -4px !important; -} - -// Block settings heading -.block-editor-block-inspector h2 { - font-size: 17px !important; - font-weight: 600 !important; -} - -// Block settings help line -.components-base-control__help { - font-size: 13px !important; -} - -// Block settings dropdown menu section label -.components-menu-group__label { - font-size: 13px; -} - -/* More */ - -// Block settings title -.block-editor-block-card__title { - font-size: 15px !important; -} - -// Toggle control label -.components-toggle-control__label { - font-size: 17px; -} - -// Dropdown menu tab item -.components-menu-item__item span { - font-size: 17px !important; -} - -// Control label -.components-base-control__label { - font-size: 13px !important; - color: gray; -} - -// Block placeholder title -.components-placeholder__label { - font-size: 17px !important; -} - -.blocks-table__placeholder-form { - gap: 16px !important; -} - -/* FIXME: workaround for popover layout – should be fixed differentyl */ -.components-popover.block-editor-block-switcher__popover - .components-popover__content { - min-width: 274px !important; + font-size: 17px; + } + + /* Settings and more */ + + // Block settings description + .block-editor-block-card__description { + font-size: 15px !important; + margin-top: -4px !important; + } + + // Block settings heading + .block-editor-block-inspector h2 { + font-size: 17px !important; + font-weight: 600 !important; + } + + // Block settings help line + .components-base-control__help { + font-size: 13px !important; + } + + // Block settings dropdown menu section label + .components-menu-group__label { + font-size: 13px; + } + + /* More */ + + // Block settings title + .block-editor-block-card__title { + font-size: 15px !important; + } + + // Toggle control label + .components-toggle-control__label { + font-size: 17px; + } + + // Dropdown menu tab item + .components-menu-item__item span { + font-size: 17px !important; + } + + // Control label + .components-base-control__label { + font-size: 13px !important; + color: gray; + } + + // Block placeholder title + .components-placeholder__label { + font-size: 17px !important; + } + + .blocks-table__placeholder-form { + gap: 16px !important; + } + + /* FIXME: workaround for popover layout – should be fixed differentyl */ + .components-popover.block-editor-block-switcher__popover + .components-popover__content { + min-width: 274px !important; + } } diff --git a/src/utils/editor.jsx b/src/utils/editor.jsx new file mode 100644 index 00000000..4831be11 --- /dev/null +++ b/src/utils/editor.jsx @@ -0,0 +1,44 @@ +/** + * WordPress dependencies + */ +import { createRoot, StrictMode } from '@wordpress/element'; +import { dispatch } from '@wordpress/data'; +import { store as editorStore } from '@wordpress/editor'; +import { store as preferencesStore } from '@wordpress/preferences'; +import defaultEditorStyles from '@wordpress/block-editor/build-style/default-editor-styles.css?inline'; +import { registerCoreBlocks } from '@wordpress/block-library'; + +/** + * Internal dependencies + */ +import Layout from '../components/layout'; +import { getGBKit, getPost } from './bridge'; + +/** + * Configure editor settings and styles, and render the editor. + */ +export function initializeEditor() { + const { themeStyles, hideTitle, editorSettings } = getGBKit(); + + const settings = editorSettings || { + defaultEditorStyles: [ { css: defaultEditorStyles } ], + }; + dispatch( editorStore ).updateEditorSettings( settings ); + + const preferenceDispatch = dispatch( preferencesStore ); + preferenceDispatch.setDefaults( 'core', { + fixedToolbar: true, + } ); + preferenceDispatch.setDefaults( 'core/edit-post', { + themeStyles, + } ); + + registerCoreBlocks(); + const post = getPost(); + + createRoot( document.getElementById( 'root' ) ).render( + + + + ); +} From 3ee0c86c17b8cb0b2ee6ff6329d1256500ad0463 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 1 May 2025 15:30:47 -0400 Subject: [PATCH 18/48] refactor: Translate strings within `gutenberg-kit` domain Ensure all project-specific strings are translated. --- src/components/default-block-appender/index.jsx | 2 +- src/components/editor-load-notice.jsx | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/default-block-appender/index.jsx b/src/components/default-block-appender/index.jsx index 6d53937a..31ff419d 100644 --- a/src/components/default-block-appender/index.jsx +++ b/src/components/default-block-appender/index.jsx @@ -33,7 +33,7 @@ export default function DefaultBlockAppender() { return ( diff --git a/src/components/editor-load-notice.jsx b/src/components/editor-load-notice.jsx index a33eabce..5175e193 100644 --- a/src/components/editor-load-notice.jsx +++ b/src/components/editor-load-notice.jsx @@ -18,12 +18,12 @@ export default function EditorLoadNotice( { className } ) { const actions = [ { - label: 'Retry', + label: __( 'Retry', 'gutenberg-kit' ), onClick: () => ( window.location.href = 'remote.html' ), variant: 'primary', }, { - label: 'Dismiss', + label: __( 'Dismiss', 'gutenberg-kit' ), onClick: clearNotice, variant: 'secondary', }, @@ -62,12 +62,14 @@ function useEditorLoadNotice() { switch ( error ) { case REMOTE_EDITOR_LOAD_ERROR: message = __( - "Oops! We couldn't load your site's editor and plugins. Don't worry, you can use the default editor for now." + "Oops! We couldn't load your site's editor and plugins. Don't worry, you can use the default editor for now.", + 'gutenberg-kit' ); break; case GBKIT_GLOBAL_UNAVAILABLE: message = __( - "Oops! Configuration for your site editor was unavailable. Don't worry, you can use the default editor for now." + "Oops! Configuration for your site editor was unavailable. Don't worry, you can use the default editor for now.", + 'gutenberg-kit' ); break; default: From aa9bbf3dea0396c9ff1e1578708358b0e9dcfa28 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 1 May 2025 15:31:33 -0400 Subject: [PATCH 19/48] fix: Use existing Gutenberg "Block Settings" string Two benefits: 1. Align with Gutenberg 2. Use the existing translation --- src/components/editor-toolbar/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/editor-toolbar/index.jsx b/src/components/editor-toolbar/index.jsx index 68523fd1..434cc346 100644 --- a/src/components/editor-toolbar/index.jsx +++ b/src/components/editor-toolbar/index.jsx @@ -76,7 +76,7 @@ const EditorToolbar = ( { className } ) => { { isSelected && ( From 25dd3a0c6fa9d20ba45d2f7cc14ecf1afd27a784 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 1 May 2025 20:23:21 -0400 Subject: [PATCH 20/48] fix: Apply `@wordpress` package import postponement to remote editor Required to ensure imported files have the correct locale set. --- src/index.jsx | 19 ++++- src/remote.jsx | 163 +++---------------------------------- src/utils/editor.jsx | 26 ++++-- src/utils/remote-editor.js | 142 ++++++++++++++++++++++++++++++++ 4 files changed, 188 insertions(+), 162 deletions(-) create mode 100644 src/utils/remote-editor.js diff --git a/src/index.jsx b/src/index.jsx index e60c9914..18786a30 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -2,6 +2,10 @@ * WordPress dependencies */ import { createRoot, StrictMode } from '@wordpress/element'; +import { dispatch } from '@wordpress/data'; +import { store as editorStore } from '@wordpress/editor'; +import { store as preferencesStore } from '@wordpress/preferences'; +import { registerCoreBlocks } from '@wordpress/block-library'; /** * Internal dependencies @@ -11,6 +15,7 @@ import { waitForGBKit, editorLoaded } from './utils/bridge'; import { configureLocale } from './utils/localization'; import './index.scss'; import EditorLoadError from './components/editor-load-error'; +import { error } from './utils/logger'; try { await waitForGBKit(); @@ -19,12 +24,20 @@ try { // Postpone importing `@wordpress` packages until after setting the locale const { initializeEditor } = await import( './utils/editor' ); - initializeEditor(); -} catch ( error ) { + initializeEditor( { + StrictMode, + createRoot, + dispatch, + editorStore, + preferencesStore, + registerCoreBlocks, + } ); +} catch ( err ) { + error( err ); const root = document.getElementById( 'root' ); createRoot( root ).render( - + ); editorLoaded(); diff --git a/src/remote.jsx b/src/remote.jsx index 4e35697a..1fb5690d 100644 --- a/src/remote.jsx +++ b/src/remote.jsx @@ -6,11 +6,12 @@ import apiFetch from '@wordpress/api-fetch'; /** * Internal dependencies */ -import { getGBKit, getPost, waitForGBKit } from './utils/bridge'; +import { waitForGBKit } from './utils/bridge'; import { configureLocale } from './utils/localization'; import { initializeApiFetch } from './utils/api-fetch'; +import { fetchEditorAssets } from './utils/remote-editor'; +import { error } from './utils/logger'; import './index.scss'; -import defaultEditorStyles from '@wordpress/block-editor/build-style/default-editor-styles.css?inline'; window.wp = window.wp || {}; window.wp.apiFetch = apiFetch; @@ -19,159 +20,15 @@ try { await waitForGBKit(); initializeApiFetch(); await configureLocale(); - await initalizeRemoteEditor(); -} catch ( error ) { + const wpDependencies = await fetchEditorAssets(); + + // Postpone importing `@wordpress` packages until after setting the locale + const { initializeEditor } = await import( './utils/editor' ); + initializeEditor( wpDependencies ); +} catch ( err ) { + error( err ); // Fallback to the local editor and display a notice. Because the remote // editor loading failed, it is more practical to rely upon the local // editor's scripts and styles for displaying the notice. window.location.href = 'index.html?error=gbkit_global_unavailable'; } - -/** - * Configure editor settings and styles, and render the editor. - */ -async function initalizeRemoteEditor() { - try { - const { - themeStyles, - hideTitle, - siteApiRoot, - siteApiNamespace, - editorSettings, - } = getGBKit(); - // TODO: Load editor assets within the host app - const { - styles, - scripts, - allowed_block_types: allowedBlockTypes, - } = await apiFetch( { - url: `${ siteApiRoot }wpcom/v2/${ siteApiNamespace[ 0 ] }/editor-assets`, - } ); - await loadAssets( [ ...styles, ...scripts ].join( '' ) ); - - // Utilize remote-loaded globals rather than importing local modules - const { dispatch } = window.wp.data; - const { store: editorStore } = window.wp.editor; - const { store: preferencesStore } = window.wp.preferences; - - const settings = editorSettings || { - defaultEditorStyles: [ { css: defaultEditorStyles } ], - }; - dispatch( editorStore ).updateEditorSettings( settings ); - - const preferenceDispatch = dispatch( preferencesStore ); - preferenceDispatch.setDefaults( 'core', { - fixedToolbar: true, - } ); - preferenceDispatch.setDefaults( 'core/edit-post', { - themeStyles, - } ); - - const post = getPost(); - const { default: Layout } = await import( './components/layout' ); - const { createRoot, createElement, StrictMode } = window.wp.element; - const { registerCoreBlocks } = window.wp.blockLibrary; - - registerCoreBlocks(); - if ( allowedBlockTypes ) { - window.wp.blocks.getBlockTypes().forEach( ( block ) => { - if ( ! allowedBlockTypes.includes( block.name ) ) { - window.wp.blocks.unregisterBlockType( block.name ); - } - } ); - } - - createRoot( document.getElementById( 'root' ) ).render( - createElement( - StrictMode, - null, - createElement( Layout, { post, hideTitle } ) - ) - ); - } catch ( error ) { - // Fallback to the local editor and display a notice. Because the remote - // editor loading failed, it is more practical to rely upon the local - // editor's scripts and styles for displaying the notice. - window.location.href = 'index.html?error=remote_editor_load_error'; - } -} - -/** - * Load the asset files for a block - * - * @param {string} html The HTML content to parse for assets. - */ -async function loadAssets( html ) { - /** - * Locally-sourced Gutenberg packages excluded from remote loading to avoid - * conflicts. - */ - const localGutenbergPackages = [ 'api-fetch' ]; - - const excludedScriptIDs = new RegExp( - localGutenbergPackages - .map( ( script ) => `wp-${ script }-js` ) - .join( '|' ) - ); - - const doc = new window.DOMParser().parseFromString( html, 'text/html' ); - - const newAssets = Array.from( - doc.querySelectorAll( 'link[rel="stylesheet"],script' ) - ).filter( ( asset ) => asset.id && ! excludedScriptIDs.test( asset.id ) ); - - /* - * Load each asset in order, as they may depend upon an earlier loaded script. - * Stylesheets and Inline Scripts will resolve immediately upon insertion. - */ - for ( const newAsset of newAssets ) { - await loadAsset( newAsset ); - } -} - -/** - * Load an asset for a block. - * - * This function returns a Promise that will resolve once the asset is loaded, - * or in the case of Stylesheets and Inline JavaScript, will resolve immediately. - * - * @param {HTMLElement} el A HTML Element asset to inject. - * - * @return {Promise} Promise which will resolve when the asset is loaded. - */ -function loadAsset( el ) { - return new Promise( ( resolve ) => { - /* - * Reconstruct the passed element, this is required as inserting the Node directly - * won't always fire the required onload events, even if the asset wasn't already loaded. - */ - const newNode = document.createElement( el.nodeName ); - - [ 'id', 'rel', 'src', 'href', 'type' ].forEach( ( attr ) => { - if ( el[ attr ] ) { - newNode[ attr ] = el[ attr ]; - } - } ); - - // Append inline - - + + +
diff --git a/ios/Sources/GutenbergKit/Gutenberg/remote.html b/ios/Sources/GutenbergKit/Gutenberg/remote.html index 6e66915f..2afcc9cd 100644 --- a/ios/Sources/GutenbergKit/Gutenberg/remote.html +++ b/ios/Sources/GutenbergKit/Gutenberg/remote.html @@ -7,9 +7,9 @@ content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> Gutenberg - - - + + +
From df1ea42b06e31c4db805758d8cad70d7cada6559 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Fri, 2 May 2025 17:09:41 -0400 Subject: [PATCH 28/48] build: Manually chunk editor utility It's unclear why this manual chunk configuration is required, but the editor fails to load without it. The dynamic import of the module never resolves. --- vite.config.js | 2 ++ vite.config.remote.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/vite.config.js b/vite.config.js index b6b912ed..1ae41d8e 100644 --- a/vite.config.js +++ b/vite.config.js @@ -15,6 +15,8 @@ export default defineConfig( { manualChunks: { // Chunk to avoid circular dependency bridge: [ 'src/utils/bridge.js' ], + // The dynamic import of this module fails without this + editor: [ 'src/utils/editor.jsx' ], }, }, }, diff --git a/vite.config.remote.js b/vite.config.remote.js index 8e56371b..ca01c0d2 100644 --- a/vite.config.remote.js +++ b/vite.config.remote.js @@ -23,6 +23,8 @@ export default defineConfig( { manualChunks: { // Chunk to avoid circular dependency bridge: [ 'src/utils/bridge.js' ], + // The dynamic import of this module fails without this + editor: [ 'src/utils/editor.jsx' ], }, }, }, From 30097d59bdceafbf9633e8c510656916eb7f8d1c Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Fri, 2 May 2025 17:10:35 -0400 Subject: [PATCH 29/48] fix: Avoid errors loading non-existent, default locale translations There is no reason to attempt loading the default locale. There will never be a translation file. --- src/utils/localization.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/localization.js b/src/utils/localization.js index 1d0ad589..888864af 100644 --- a/src/utils/localization.js +++ b/src/utils/localization.js @@ -25,6 +25,10 @@ export async function configureLocale() { * @return {Promise} A promise that resolves when translations are loaded. */ export async function loadTranslations( locale ) { + if ( locale === DEFAULT_LOCALE ) { + return; + } + try { debug( 'Loading translations for', locale ); const { default: translations } = await import( @@ -36,3 +40,5 @@ export async function loadTranslations( locale ) { error( 'Error loading translations', err ); } } + +const DEFAULT_LOCALE = 'en'; From 9c0bdc3c64db767c5a550afd8418348761e1cf78 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Fri, 2 May 2025 17:12:09 -0400 Subject: [PATCH 30/48] task: Capture build output --- ...{bridge-COXq4kB3.js => bridge-CeTaRbKr.js} | 2 +- .../Gutenberg/assets/editor-B8iXS1oh.js | 4 - .../Gutenberg/assets/editor-Beg1s0b0.js | 4 + .../Gutenberg/assets/editor-DkjwLpR_.js | 67 -- .../Gutenberg/assets/editor-tP9apWFw.js | 836 ++++++++++++++++++ .../Gutenberg/assets/index-0vESit7d.js | 771 ---------------- .../Gutenberg/assets/index-DO4E_UAn.js | 2 + .../Gutenberg/assets/localization-CoMeFJ8X.js | 1 - .../Gutenberg/assets/localization-KXdhtQ45.js | 1 + .../Gutenberg/assets/remote-pA0qzyqb.js | 2 - .../Gutenberg/assets/remote-pYQAibFN.js | 2 + ios/Sources/GutenbergKit/Gutenberg/index.html | 6 +- .../GutenbergKit/Gutenberg/remote.html | 6 +- 13 files changed, 854 insertions(+), 850 deletions(-) rename ios/Sources/GutenbergKit/Gutenberg/assets/{bridge-COXq4kB3.js => bridge-CeTaRbKr.js} (98%) delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/editor-B8iXS1oh.js create mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/editor-Beg1s0b0.js delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/editor-DkjwLpR_.js create mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/editor-tP9apWFw.js delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/index-0vESit7d.js create mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/index-DO4E_UAn.js delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/localization-CoMeFJ8X.js create mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/localization-KXdhtQ45.js delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/remote-pA0qzyqb.js create mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/remote-pYQAibFN.js diff --git a/ios/Sources/GutenbergKit/Gutenberg/assets/bridge-COXq4kB3.js b/ios/Sources/GutenbergKit/Gutenberg/assets/bridge-CeTaRbKr.js similarity index 98% rename from ios/Sources/GutenbergKit/Gutenberg/assets/bridge-COXq4kB3.js rename to ios/Sources/GutenbergKit/Gutenberg/assets/bridge-CeTaRbKr.js index 3b9faab4..64ebf738 100644 --- a/ios/Sources/GutenbergKit/Gutenberg/assets/bridge-COXq4kB3.js +++ b/ios/Sources/GutenbergKit/Gutenberg/assets/bridge-CeTaRbKr.js @@ -1,2 +1,2 @@ const f="0.2.0",r="?";function d(t,e,n,i){const o={filename:t,function:e===""?r:e,in_app:!0};return n!==void 0&&(o.lineno=n),i!==void 0&&(o.colno=i),o}const l=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,u=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,m=/\((\S*)(?::(\d+))(?::(\d+))\)/,p=t=>{const e=l.exec(t);if(e){const[,i,o,s]=e;return d(i,r,+o,+s)}const n=u.exec(t);if(n){if(n[2]&&n[2].indexOf("eval")===0){const a=m.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}const o=n[1]||r,s=n[2];return d(s,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},b=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,k=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,y=t=>{const e=b.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const s=k.exec(e[3]);s&&(e[1]=e[1]||"eval",e[3]=s[1],e[4]=s[2],e[5]="")}const i=e[3],o=e[1]||r;return d(i,o,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},g=50,E=[p,y],h=t=>{const e=t.stacktrace||t.stack||"",n=[],i=e.split(` -`);for(let s=0;s1024)&&!a.match(/\S*Error: /)){for(const w of E){const c=w(a);if(c){n.push(c);break}}if(n.length>=g)break}}const o=Array.from(n).reverse();return o.slice(0,g).map(s=>({...s,filename:s.filename||o[o.length-1].filename}))},x=t=>{const e=t?.message;return e?typeof e.error?.message=="string"?e.error.message:e:"No error message"},v=t=>{const e={type:t?.name,message:x(t)},n=h(t);return n.length&&(e.stacktrace=n),e.type===void 0&&e.message===""&&(e.message="Unknown error"),e},D=(t,{context:e,tags:n}={})=>({...v(t),context:{...e},tags:{...n,gutenberg_kit_version:f}});function S(){window.editorDelegate&&window.editorDelegate.onEditorLoaded(),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorLoaded",body:{}})}function M(){window.editorDelegate&&window.editorDelegate.onEditorContentChanged(),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorContentChanged"})}function K(t,e){window.editorDelegate&&window.editorDelegate.onEditorHistoryChanged(t,e),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorHistoryChanged",body:{hasUndo:t,hasRedo:e}})}function N(t){window.editorDelegate&&window.editorDelegate.openMediaLibrary(JSON.stringify(t)),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"openMediaLibrary",body:t})}function C(){if(window.GBKit)return window.GBKit;try{return JSON.parse(localStorage.getItem("GBKit"))||{}}catch{return{}}}function B(){const{post:t}=C();return t?{id:t.id,type:t.type||"post",status:t.status,title:{raw:decodeURIComponent(t.title)},content:{raw:decodeURIComponent(t.content)}}:{id:-1,type:"post",status:"auto-draft",title:{raw:""},content:{raw:""}}}function G(t,{context:e,tags:n,isHandled:i,handledBy:o}={context:{},tags:{},isHandled:!1,handledBy:"Unknown"}){const s={...D(t,{context:e,tags:n}),isHandled:i,handledBy:o};window.editorDelegate&&window.editorDelegate.onEditorExceptionLogged(JSON.stringify(s)),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorExceptionLogged",body:s})}function H(t=3e3){return new Promise((e,n)=>{const i=Date.now(),o=()=>{if(window.GBKit){e(window.GBKit);return}if(Date.now()-i>=t){n(new Error("GBKit global not available after timeout"));return}setTimeout(o,100)};o()})}export{H as a,N as b,M as c,B as d,S as e,C as g,G as l,K as o}; +`);for(let s=0;s1024)&&!a.match(/\S*Error: /)){for(const w of E){const c=w(a);if(c){n.push(c);break}}if(n.length>=g)break}}const o=Array.from(n).reverse();return o.slice(0,g).map(s=>({...s,filename:s.filename||o[o.length-1].filename}))},x=t=>{const e=t?.message;return e?typeof e.error?.message=="string"?e.error.message:e:"No error message"},v=t=>{const e={type:t?.name,message:x(t)},n=h(t);return n.length&&(e.stacktrace=n),e.type===void 0&&e.message===""&&(e.message="Unknown error"),e},D=(t,{context:e,tags:n}={})=>({...v(t),context:{...e},tags:{...n,gutenberg_kit_version:f}});function S(){window.editorDelegate&&window.editorDelegate.onEditorLoaded(),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorLoaded",body:{}})}function M(){window.editorDelegate&&window.editorDelegate.onEditorContentChanged(),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorContentChanged"})}function K(t,e){window.editorDelegate&&window.editorDelegate.onEditorHistoryChanged(t,e),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorHistoryChanged",body:{hasUndo:t,hasRedo:e}})}function N(t){window.editorDelegate&&window.editorDelegate.openMediaLibrary(JSON.stringify(t)),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"openMediaLibrary",body:t})}function C(){if(window.GBKit)return window.GBKit;try{return JSON.parse(localStorage.getItem("GBKit"))||{}}catch{return{}}}function B(){const{post:t}=C();return t?{id:t.id,type:t.type||"post",status:t.status,title:{raw:decodeURIComponent(t.title)},content:{raw:decodeURIComponent(t.content)}}:{id:-1,type:"post",status:"auto-draft",title:{raw:""},content:{raw:""}}}function G(t,{context:e,tags:n,isHandled:i,handledBy:o}={context:{},tags:{},isHandled:!1,handledBy:"Unknown"}){const s={...D(t,{context:e,tags:n}),isHandled:i,handledBy:o};window.editorDelegate&&window.editorDelegate.onEditorExceptionLogged(JSON.stringify(s)),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorExceptionLogged",body:s})}function H(t=3e3){return new Promise((e,n)=>{const i=Date.now(),o=()=>{if(window.GBKit){e(window.GBKit);return}if(Date.now()-i>=t){n(new Error("GBKit global not available after timeout"));return}setTimeout(o,100)};o()})}export{N as a,M as b,B as c,H as d,S as e,C as g,G as l,K as o}; diff --git a/ios/Sources/GutenbergKit/Gutenberg/assets/editor-B8iXS1oh.js b/ios/Sources/GutenbergKit/Gutenberg/assets/editor-B8iXS1oh.js deleted file mode 100644 index 3e6e6a5e..00000000 --- a/ios/Sources/GutenbergKit/Gutenberg/assets/editor-B8iXS1oh.js +++ /dev/null @@ -1,4 +0,0 @@ -import{e as Z,o as q,l as Q,b as Y,c as ee,g as te,d as oe}from"./bridge-COXq4kB3.js";import{d as ne}from"./remote-pA0qzyqb.js";const ie=":root{--wp-admin-theme-color: #007cba;--wp-admin-theme-color--rgb: 0, 124, 186;--wp-admin-theme-color-darker-10: #006ba1;--wp-admin-theme-color-darker-10--rgb: 0, 107, 161;--wp-admin-theme-color-darker-20: #005a87;--wp-admin-theme-color-darker-20--rgb: 0, 90, 135;--wp-admin-border-width-focus: 2px;--wp-block-synced-color: #7a00df;--wp-block-synced-color--rgb: 122, 0, 223;--wp-bound-block-color: var(--wp-block-synced-color)}@media (min-resolution: 192dpi){:root{--wp-admin-border-width-focus: 1.5px}}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:18px;line-height:1.5;--wp--style--block-gap: 2em}p{line-height:1.8}.editor-post-title__block{margin-top:2em;margin-bottom:1em;font-size:2.5em;font-weight:800}";function J(e){var t,o,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const[t,o]=ue(!1),{isSelected:n}=A(c=>{const{getSelectedBlockClientId:l}=c(me);return{isSelected:l()!==null}}),{isInserterOpened:i}=A(c=>({isInserterOpened:c(P).isInserterOpened()}),[]),{setIsInserterOpened:u}=fe(P);function r(){o(!0)}function a(){o(!1)}const d=y("gutenberg-kit-editor-toolbar",e);return v(B,{children:[v(ye,{className:d,label:"Editor toolbar",variant:"unstyled",children:[m(T,{children:m(ge,{open:i,onToggle:u})}),n&&m(T,{children:m(ke,{title:Se("Block Settings"),icon:ce,onClick:r})}),m(pe,{hideDragHandle:!0})]}),t&&m(be,{className:"block-settings-menu",variant:"unstyled",placement:"overlay",children:v(B,{children:[m("div",{className:"block-settings-menu__header",children:m(he,{className:"block-settings-menu__close",icon:ae,onClick:a})}),m(we,{})]})})]})},{__dangerousOptInToUnstableAPIsOnlyForCoreModules:ve}=window.wp.privateApis,{lock:oo,unlock:x}=ve("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/editor"),Re=".gutenberg-kit-visual-editor__post-title-wrapper .wp-block-post-title{font-size:20px}.block-editor-default-block-appender__content{opacity:.62}",_e=".editor-visual-editor__post-title-wrapper>:where(:not(.alignleft):not(.alignright):not(.alignfull)){max-width:var(--wp--style--global--content-size);margin-left:auto!important;margin-right:auto!important}.editor-visual-editor__post-title-wrapper>.alignwide{max-width:1340px}.editor-visual-editor__post-title-wrapper>.alignfull{max-width:none}:root :where(.is-layout-flow)>:first-child{margin-block-start:0}:root :where(.is-layout-flow)>:last-child{margin-block-end:0}:root :where(.is-layout-flow)>*{margin-block-start:1.2rem;margin-block-end:0}:root :where(.is-layout-constrained)>:first-child{margin-block-start:0}:root :where(.is-layout-constrained)>:last-child{margin-block-end:0}:root :where(.is-layout-constrained)>*{margin-block-start:1.2rem;margin-block-end:0}",{store:xe}=window.wp.editor,{useSelect:$e}=window.wp.data,{privateApis:Ce}=window.wp.blockEditor,{store:Le}=window.wp.editPost,{useMemo:Be}=window.wp.element,{getLayoutStyles:Ae}=x(Ce);function Te(){const{hasThemeStyleSupport:e,editorSettings:t}=$e(o=>({hasThemeStyleSupport:o(Le).isFeatureActive("themeStyles"),editorSettings:o(xe).getEditorSettings()}),[]);return Be(()=>{const o=[...t?.defaultEditorStyles??[]];!t.disableLayoutStyles&&!e&&o.push({css:Ae({style:{},selector:"body",hasBlockGapSupport:!1,hasFallbackGapSupport:!0,fallbackGapValue:"0.5em"})}),e||o.push({css:Re});const n=e?t.styles??[]:o;return[{css:_e},...n]},[t.defaultEditorStyles,t.disableLayoutStyles,t.styles,e])}const{jsx:Pe}=window.ReactJSXRuntime,{createBlock:je}=window.wp.blocks,{useDispatch:Ie,useSelect:De}=window.wp.data,{__:Me}=window.wp.i18n,{store:j}=window.wp.blockEditor;function Ne(){const{insertBlock:e}=Ie(j),{blockCount:t}=De(n=>{const{getBlockCount:i}=n(j);return{blockCount:i()}}),o=()=>{const n=je("core/paragraph");e(n,t)};return Pe("button",{"aria-label":Me("Add paragraph block","gutenberg-kit"),onClick:o,className:"gutenberg-kit-default-block-appender"})}const{useEffect:Ue,useRef:Oe}=window.wp.element,Ge=()=>{const e=Oe(null);return Ue(()=>{const t=new IntersectionObserver(o=>{o.forEach(n=>{n.isIntersecting&&Z()})});return t.observe(e.current),()=>t.disconnect()},[e]),e},{Fragment:Fe,jsx:p,jsxs:R}=window.ReactJSXRuntime,{useRef:ze}=window.wp.element,{BlockList:Je,privateApis:Xe,store:He}=window.wp.blockEditor,{Popover:Ve}=window.wp.components,{store:Ke,PostTitle:We}=window.wp.editor,{useSelect:Ze}=window.wp.data,{store:qe}=window.wp.editPost,{ExperimentalBlockCanvas:Qe,LayoutStyle:h,useLayoutClasses:Ye,useLayoutStyles:et}=x(Xe),tt=`.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;} - .is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);} - .is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;} - .is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;function ot({hideTitle:e}){const t=ze(),o=Ge(),{renderingMode:n,hasThemeStyleSupport:i,themeHasDisabledLayoutStyles:u,themeSupportsLayout:r,hasRootPaddingAwareAlignments:a}=Ze(S=>{const{getRenderingMode:V}=S(Ke),K=V(),{getSettings:W}=x(S(He)),E=W();return{renderingMode:K,hasThemeStyleSupport:S(qe).isFeatureActive("themeStyles"),themeSupportsLayout:E.supportsLayout,themeHasDisabledLayoutStyles:E.disableLayoutStyles,hasRootPaddingAwareAlignments:E.__experimentalFeatures?.useRootPaddingAwareAlignments}},[]),d=Te(),c=y("gutenberg-kit-visual-editor",{"has-root-padding":!i||!a}),l=y("gutenberg-kit-visual-editor__post-title-wrapper","editor-visual-editor__post-title-wrapper",{"has-global-padding":i&&a}),s={align:"full",layout:{type:"constrained"}},{layout:w={},align:g=""}=s,f=Ye(s,"core/post-content"),$=et(s,"core/post-content",".block-editor-block-list__layout.is-root-container"),H=y(r&&f,g&&`align${g}`,{"is-layout-flow":!r,"has-global-padding":i&&a});return R("div",{className:c,ref:o,children:[R(Qe,{shouldIframe:!1,height:"100%",styles:d,children:[r&&!u&&n==="post-only"&&R(Fe,{children:[p(h,{selector:".editor-visual-editor__post-title-wrapper",layout:w}),p(h,{selector:".block-editor-block-list__layout.is-root-container",layout:w}),g&&p(h,{css:tt}),$&&p(h,{layout:w,css:$})]}),!e&&p("div",{className:l,children:p(We,{ref:t})}),p(Je,{className:H,layout:w}),p(Ne,{})]}),p(Ee,{className:"gutenberg-kit-visual-editor__toolbar"}),p(Ve.Slot,{})]})}const{useEffect:nt}=window.wp.element,{useSelect:it}=window.wp.data,{store:st}=window.wp.editor;function rt(){const{hasUndo:e,hasRedo:t}=it(o=>{const n=o(st);return{hasUndo:n.hasEditorUndo(),hasRedo:n.hasEditorRedo()}},[]);nt(()=>{q(e,t)},[e,t])}const{useEffect:at,useCallback:lt,useRef:I}=window.wp.element,{useDispatch:D,useSelect:dt}=window.wp.data,{store:ct}=window.wp.coreData,{store:M}=window.wp.editor,{parse:ut,serialize:wt}=window.wp.blocks;window.editor=window.editor||{};function pt(e,t){const{editEntityRecord:o}=D(ct),{undo:n,redo:i,switchEditorMode:u}=D(M),{getEditedPostAttribute:r,getEditedPostContent:a}=dt(M),d=lt(s=>{o("postType",e.type,e.id,s)},[o,e.id,e.type]),c=I(e.title.raw),l=I(null);l.current===null&&(l.current=wt(ut(e.content.raw||""))),at(()=>(window.editor.setContent=s=>{d({content:decodeURIComponent(s)})},window.editor.setTitle=s=>{d({title:decodeURIComponent(s)})},window.editor.getContent=(s=!1)=>(s&&N(t.current),a()),window.editor.getTitleAndContent=(s=!1)=>{s&&N(t.current);const w=r("title"),g=a(),f=w!==c.current||g!==l.current;return f&&(c.current=w,l.current=g),{title:w,content:g,changed:f}},window.editor.undo=()=>{n()},window.editor.redo=()=>{i()},window.editor.switchEditorMode=s=>{u(s)},()=>{delete window.editor.setContent,delete window.editor.setTitle,delete window.editor.getContent,delete window.editor.getTitleAndContent,delete window.editor.undo,delete window.editor.redo,delete window.editor.switchEditorMode}),[t,d,r,a,i,u,n])}function N(e){const t=e?.ownerDocument.activeElement;if(t&&t.contentEditable==="true"){const o=new Event("compositionend");t.dispatchEvent(o)}}const{useEffect:gt}=window.wp.element,{addAction:mt,removeAction:ft}=window.wp.hooks;function ht(){gt(()=>(mt("editor.ErrorBoundary.errorLogged","GutenbergKit",e=>{Q(e,{isHandled:!0,handledBy:"editor.ErrorBoundary.errorLogged"})}),()=>{ft("editor.ErrorBoundary.errorLogged","GutenbergKit")}),[])}const bt=[{name:"post",baseURL:"/wp/v2/posts"},{name:"page",baseURL:"/wp/v2/pages"},{name:"attachment",baseURL:"/wp/v2/media"},{name:"wp_block",baseURL:"/wp/v2/blocks"}].map(e=>({kind:"postType",...e,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:["title","excerpt","content"]})),{useEffect:yt}=window.wp.element,{useDispatch:U}=window.wp.data,{store:kt}=window.wp.coreData,{store:St}=window.wp.editor;function Et(e){const{addEntities:t,receiveEntityRecords:o}=U(kt),{setEditedPost:n,setupEditor:i}=U(St);yt(()=>{t(bt),o("postType",e.type,e),i(e,{}),n(e.type,e.id)},[])}const{addFilter:vt,removeFilter:Rt}=window.wp.hooks,{useCallback:_t,useEffect:X}=window.wp.element;function xt(){X(()=>(vt("editor.MediaUpload","GutenbergKit",()=>$t),()=>{Rt("editor.MediaUpload","GutenbergKit")}),[])}function $t({render:e,...t}){const{open:o}=Ct(t);return e({open:o})}function Ct({onSelect:e,...t}){return X(()=>(window.editor.setMediaUploadAttachment=n=>{e(t.multiple?n:n[0])},()=>{window.editor.setMediaUploadAttachment=()=>{}}),[e,t.multiple]),{open:_t(()=>Y(t),[t])}}const{jsx:O,jsxs:Lt}=window.ReactJSXRuntime,{PostTitleRaw:Bt,PostTextEditor:At}=window.wp.editor;function Tt({hideTitle:e}){return Lt("div",{className:"gutenberg-kit-text-editor",children:[!e&&O(Bt,{}),O(At,{})]})}const{jsx:_,jsxs:Pt}=window.ReactJSXRuntime,{store:jt}=window.wp.coreData,{useSelect:It}=window.wp.data,{store:Dt,EditorProvider:Mt}=window.wp.editor,{useRef:Nt}=window.wp.element;function Ut({post:e,children:t,hideTitle:o}){const n=Nt(null);pt(e,n),rt(),ht(),Et(e),xt();const{isReady:i,mode:u,isRichEditingEnabled:r,currentPost:a}=It(d=>{const{__unstableIsEditorReady:c,getEditorSettings:l,getEditorMode:s}=d(Dt),w=l(),{getEntityRecord:g}=d(jt),f=g("postType",e.type,e.id);return{isReady:c(),mode:s(),isRichEditingEnabled:w.richEditingEnabled,currentPost:f}},[e.id,e.type]);return i?_("div",{className:"gutenberg-kit-editor",ref:n,children:Pt(Mt,{post:a,settings:Ot,useSubRegistry:!1,children:[u==="visual"&&r&&_(ot,{hideTitle:o}),(u==="text"||!r)&&_(Tt,{autoFocus:!0,hideTitle:o}),t]})}):null}const Ot={},{jsx:G}=window.ReactJSXRuntime,{Notice:Gt}=window.wp.components,{__:k}=window.wp.i18n,{useState:Ft,useEffect:F}=window.wp.element;function zt({className:e}){const{notice:t,clearNotice:o}=Jt(),n=[{label:k("Retry","gutenberg-kit"),onClick:()=>window.location.href="remote.html",variant:"primary"},{label:k("Dismiss","gutenberg-kit"),onClick:o,variant:"secondary"}];return t?G("div",{className:e,children:G(Gt,{actions:n,status:"warning",isDismissible:!1,children:t})}):null}function Jt(){const[e,t]=Ft(null);return F(()=>{const n=new URL(window.location.href).searchParams.get("error");let i=null;switch(n){case Xt:i=k("Oops! We couldn't load your site's editor and plugins. Don't worry, you can use the default editor for now.","gutenberg-kit");break;case Ht:i=k("Oops! Configuration for your site editor was unavailable. Don't worry, you can use the default editor for now.","gutenberg-kit");break;default:i=null}t(i)},[]),F(()=>{if(e){const o=setTimeout(()=>{t(null)},2e4);return()=>clearTimeout(o)}},[e]),{notice:e,clearNotice:()=>t(null)}}const Xt="remote_editor_load_error",Ht="gbkit_global_unavailable",{jsx:b,jsxs:Vt}=window.ReactJSXRuntime,{EditorSnackbars:Kt,ErrorBoundary:Wt,AutosaveMonitor:Zt}=window.wp.editor;function qt(e){return Vt(Wt,{canCopyContent:!0,children:[b(Zt,{autosave:ee}),b(Ut,{...e,children:b(Kt,{})}),b(zt,{className:"gutenberg-kit-layout__load-notice"})]})}const{jsx:z}=window.ReactJSXRuntime,{getBlockTypes:Qt,unregisterBlockType:Yt}=window.wp.blocks;function no({createRoot:e,StrictMode:t,dispatch:o,editorStore:n,preferencesStore:i,registerCoreBlocks:u}){const{themeStyles:r,hideTitle:a,editorSettings:d}=te(),c=d||{defaultEditorStyles:[{css:ie}]};o(n).updateEditorSettings(c);const l=o(i);l.setDefaults("core",{fixedToolbar:!0}),l.setDefaults("core/edit-post",{themeStyles:r}),u();const s=oe();e(document.getElementById("root")).render(z(t,{children:z(qt,{post:s,hideTitle:a})}))}function io(e){if(!e)return;const t=[];Qt().forEach(o=>{e.includes(o.name)||(Yt(o.name),t.push(o.name))}),ne("Blocks unregistered:",t)}export{no as initializeEditor,io as unregisterDisallowedBlocks}; diff --git a/ios/Sources/GutenbergKit/Gutenberg/assets/editor-Beg1s0b0.js b/ios/Sources/GutenbergKit/Gutenberg/assets/editor-Beg1s0b0.js new file mode 100644 index 00000000..30c245a3 --- /dev/null +++ b/ios/Sources/GutenbergKit/Gutenberg/assets/editor-Beg1s0b0.js @@ -0,0 +1,4 @@ +import{e as Q,o as Y,l as ee,a as te,b as oe,g as ne,c as se}from"./bridge-CeTaRbKr.js";var ie={};const x={ERROR:0,INFO:2,DEBUG:3};let re=ie.LOG_LEVEL||x.INFO;const V=e=>e<=re,ao=(e,t)=>{V(x.ERROR)&&console.error(`[GBK] ${e}`,t||"")},ae=(e,t)=>{V(x.DEBUG)&&console.debug(`[GBK] ${e}`,t||"")},le=":root{--wp-admin-theme-color: #007cba;--wp-admin-theme-color--rgb: 0, 124, 186;--wp-admin-theme-color-darker-10: #006ba1;--wp-admin-theme-color-darker-10--rgb: 0, 107, 161;--wp-admin-theme-color-darker-20: #005a87;--wp-admin-theme-color-darker-20--rgb: 0, 90, 135;--wp-admin-border-width-focus: 2px;--wp-block-synced-color: #7a00df;--wp-block-synced-color--rgb: 122, 0, 223;--wp-bound-block-color: var(--wp-block-synced-color)}@media (min-resolution: 192dpi){:root{--wp-admin-border-width-focus: 1.5px}}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:18px;line-height:1.5;--wp--style--block-gap: 2em}p{line-height:1.8}.editor-post-title__block{margin-top:2em;margin-bottom:1em;font-size:2.5em;font-weight:800}";function X(e){var t,o,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t{const[t,o]=me(!1),{isSelected:n}=T(c=>{const{getSelectedBlockClientId:l}=c(ye);return{isSelected:l()!==null}}),{isInserterOpened:s}=T(c=>({isInserterOpened:c(j).isInserterOpened()}),[]),{setIsInserterOpened:u}=Se(j);function r(){o(!0)}function a(){o(!1)}const d=y("gutenberg-kit-editor-toolbar",e);return v(A,{children:[v(ve,{className:d,label:"Editor toolbar",variant:"unstyled",children:[m(P,{children:m(be,{open:s,onToggle:u})}),n&&m(P,{children:m(_e,{title:Re("Block Settings"),icon:ge,onClick:r})}),m(he,{hideDragHandle:!0})]}),t&&m(Ee,{className:"block-settings-menu",variant:"unstyled",placement:"overlay",children:v(A,{children:[m("div",{className:"block-settings-menu__header",children:m(ke,{className:"block-settings-menu__close",icon:ue,onClick:a})}),m(fe,{})]})})]})},{__dangerousOptInToUnstableAPIsOnlyForCoreModules:$e}=window.wp.privateApis,{lock:lo,unlock:$}=$e("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/editor"),Le=".gutenberg-kit-visual-editor__post-title-wrapper .wp-block-post-title{font-size:20px}.block-editor-default-block-appender__content{opacity:.62}",Ce=".editor-visual-editor__post-title-wrapper>:where(:not(.alignleft):not(.alignright):not(.alignfull)){max-width:var(--wp--style--global--content-size);margin-left:auto!important;margin-right:auto!important}.editor-visual-editor__post-title-wrapper>.alignwide{max-width:1340px}.editor-visual-editor__post-title-wrapper>.alignfull{max-width:none}:root :where(.is-layout-flow)>:first-child{margin-block-start:0}:root :where(.is-layout-flow)>:last-child{margin-block-end:0}:root :where(.is-layout-flow)>*{margin-block-start:1.2rem;margin-block-end:0}:root :where(.is-layout-constrained)>:first-child{margin-block-start:0}:root :where(.is-layout-constrained)>:last-child{margin-block-end:0}:root :where(.is-layout-constrained)>*{margin-block-start:1.2rem;margin-block-end:0}",{store:Be}=window.wp.editor,{useSelect:Ae}=window.wp.data,{privateApis:Te}=window.wp.blockEditor,{store:Pe}=window.wp.editPost,{useMemo:je}=window.wp.element,{getLayoutStyles:Ie}=$(Te);function De(){const{hasThemeStyleSupport:e,editorSettings:t}=Ae(o=>({hasThemeStyleSupport:o(Pe).isFeatureActive("themeStyles"),editorSettings:o(Be).getEditorSettings()}),[]);return je(()=>{const o=[...t?.defaultEditorStyles??[]];!t.disableLayoutStyles&&!e&&o.push({css:Ie({style:{},selector:"body",hasBlockGapSupport:!1,hasFallbackGapSupport:!0,fallbackGapValue:"0.5em"})}),e||o.push({css:Le});const n=e?t.styles??[]:o;return[{css:Ce},...n]},[t.defaultEditorStyles,t.disableLayoutStyles,t.styles,e])}const{jsx:Me}=window.ReactJSXRuntime,{createBlock:Ne}=window.wp.blocks,{useDispatch:Oe,useSelect:Ue}=window.wp.data,{__:Ge}=window.wp.i18n,{store:I}=window.wp.blockEditor;function Fe(){const{insertBlock:e}=Oe(I),{blockCount:t}=Ue(n=>{const{getBlockCount:s}=n(I);return{blockCount:s()}}),o=()=>{const n=Ne("core/paragraph");e(n,t)};return Me("button",{"aria-label":Ge("Add paragraph block","gutenberg-kit"),onClick:o,className:"gutenberg-kit-default-block-appender"})}const{useEffect:ze,useRef:Je}=window.wp.element,Ve=()=>{const e=Je(null);return ze(()=>{const t=new IntersectionObserver(o=>{o.forEach(n=>{n.isIntersecting&&Q()})});return t.observe(e.current),()=>t.disconnect()},[e]),e},{Fragment:Xe,jsx:p,jsxs:_}=window.ReactJSXRuntime,{useRef:He}=window.wp.element,{BlockList:Ke,privateApis:We,store:Ze}=window.wp.blockEditor,{Popover:qe}=window.wp.components,{store:Qe,PostTitle:Ye}=window.wp.editor,{useSelect:et}=window.wp.data,{store:tt}=window.wp.editPost,{ExperimentalBlockCanvas:ot,LayoutStyle:h,useLayoutClasses:nt,useLayoutStyles:st}=$(We),it=`.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;} + .is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);} + .is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;} + .is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;function rt({hideTitle:e}){const t=He(),o=Ve(),{renderingMode:n,hasThemeStyleSupport:s,themeHasDisabledLayoutStyles:u,themeSupportsLayout:r,hasRootPaddingAwareAlignments:a}=et(k=>{const{getRenderingMode:W}=k(Qe),Z=W(),{getSettings:q}=$(k(Ze)),E=q();return{renderingMode:Z,hasThemeStyleSupport:k(tt).isFeatureActive("themeStyles"),themeSupportsLayout:E.supportsLayout,themeHasDisabledLayoutStyles:E.disableLayoutStyles,hasRootPaddingAwareAlignments:E.__experimentalFeatures?.useRootPaddingAwareAlignments}},[]),d=De(),c=y("gutenberg-kit-visual-editor",{"has-root-padding":!s||!a}),l=y("gutenberg-kit-visual-editor__post-title-wrapper","editor-visual-editor__post-title-wrapper",{"has-global-padding":s&&a}),i={align:"full",layout:{type:"constrained"}},{layout:w={},align:g=""}=i,f=nt(i,"core/post-content"),L=st(i,"core/post-content",".block-editor-block-list__layout.is-root-container"),K=y(r&&f,g&&`align${g}`,{"is-layout-flow":!r,"has-global-padding":s&&a});return _("div",{className:c,ref:o,children:[_(ot,{shouldIframe:!1,height:"100%",styles:d,children:[r&&!u&&n==="post-only"&&_(Xe,{children:[p(h,{selector:".editor-visual-editor__post-title-wrapper",layout:w}),p(h,{selector:".block-editor-block-list__layout.is-root-container",layout:w}),g&&p(h,{css:it}),L&&p(h,{layout:w,css:L})]}),!e&&p("div",{className:l,children:p(Ye,{ref:t})}),p(Ke,{className:K,layout:w}),p(Fe,{})]}),p(xe,{className:"gutenberg-kit-visual-editor__toolbar"}),p(qe.Slot,{})]})}const{useEffect:at}=window.wp.element,{useSelect:lt}=window.wp.data,{store:dt}=window.wp.editor;function ct(){const{hasUndo:e,hasRedo:t}=lt(o=>{const n=o(dt);return{hasUndo:n.hasEditorUndo(),hasRedo:n.hasEditorRedo()}},[]);at(()=>{Y(e,t)},[e,t])}const{useEffect:ut,useCallback:wt,useRef:D}=window.wp.element,{useDispatch:M,useSelect:pt}=window.wp.data,{store:gt}=window.wp.coreData,{store:N}=window.wp.editor,{parse:mt,serialize:ft}=window.wp.blocks;window.editor=window.editor||{};function ht(e,t){const{editEntityRecord:o}=M(gt),{undo:n,redo:s,switchEditorMode:u}=M(N),{getEditedPostAttribute:r,getEditedPostContent:a}=pt(N),d=wt(i=>{o("postType",e.type,e.id,i)},[o,e.id,e.type]),c=D(e.title.raw),l=D(null);l.current===null&&(l.current=ft(mt(e.content.raw||""))),ut(()=>(window.editor.setContent=i=>{d({content:decodeURIComponent(i)})},window.editor.setTitle=i=>{d({title:decodeURIComponent(i)})},window.editor.getContent=(i=!1)=>(i&&O(t.current),a()),window.editor.getTitleAndContent=(i=!1)=>{i&&O(t.current);const w=r("title"),g=a(),f=w!==c.current||g!==l.current;return f&&(c.current=w,l.current=g),{title:w,content:g,changed:f}},window.editor.undo=()=>{n()},window.editor.redo=()=>{s()},window.editor.switchEditorMode=i=>{u(i)},()=>{delete window.editor.setContent,delete window.editor.setTitle,delete window.editor.getContent,delete window.editor.getTitleAndContent,delete window.editor.undo,delete window.editor.redo,delete window.editor.switchEditorMode}),[t,d,r,a,s,u,n])}function O(e){const t=e?.ownerDocument.activeElement;if(t&&t.contentEditable==="true"){const o=new Event("compositionend");t.dispatchEvent(o)}}const{useEffect:bt}=window.wp.element,{addAction:yt,removeAction:St}=window.wp.hooks;function kt(){bt(()=>(yt("editor.ErrorBoundary.errorLogged","GutenbergKit",e=>{ee(e,{isHandled:!0,handledBy:"editor.ErrorBoundary.errorLogged"})}),()=>{St("editor.ErrorBoundary.errorLogged","GutenbergKit")}),[])}const Et=[{name:"post",baseURL:"/wp/v2/posts"},{name:"page",baseURL:"/wp/v2/pages"},{name:"attachment",baseURL:"/wp/v2/media"},{name:"wp_block",baseURL:"/wp/v2/blocks"}].map(e=>({kind:"postType",...e,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:["title","excerpt","content"]})),{useEffect:vt}=window.wp.element,{useDispatch:U}=window.wp.data,{store:_t}=window.wp.coreData,{store:Rt}=window.wp.editor;function xt(e){const{addEntities:t,receiveEntityRecords:o}=U(_t),{setEditedPost:n,setupEditor:s}=U(Rt);vt(()=>{t(Et),o("postType",e.type,e),s(e,{}),n(e.type,e.id)},[])}const{addFilter:$t,removeFilter:Lt}=window.wp.hooks,{useCallback:Ct,useEffect:H}=window.wp.element;function Bt(){H(()=>($t("editor.MediaUpload","GutenbergKit",()=>At),()=>{Lt("editor.MediaUpload","GutenbergKit")}),[])}function At({render:e,...t}){const{open:o}=Tt(t);return e({open:o})}function Tt({onSelect:e,...t}){return H(()=>(window.editor.setMediaUploadAttachment=n=>{e(t.multiple?n:n[0])},()=>{window.editor.setMediaUploadAttachment=()=>{}}),[e,t.multiple]),{open:Ct(()=>te(t),[t])}}const{jsx:G,jsxs:Pt}=window.ReactJSXRuntime,{PostTitleRaw:jt,PostTextEditor:It}=window.wp.editor;function Dt({hideTitle:e}){return Pt("div",{className:"gutenberg-kit-text-editor",children:[!e&&G(jt,{}),G(It,{})]})}const{jsx:R,jsxs:Mt}=window.ReactJSXRuntime,{store:Nt}=window.wp.coreData,{useSelect:Ot}=window.wp.data,{store:Ut,EditorProvider:Gt}=window.wp.editor,{useRef:Ft}=window.wp.element;function zt({post:e,children:t,hideTitle:o}){const n=Ft(null);ht(e,n),ct(),kt(),xt(e),Bt();const{isReady:s,mode:u,isRichEditingEnabled:r,currentPost:a}=Ot(d=>{const{__unstableIsEditorReady:c,getEditorSettings:l,getEditorMode:i}=d(Ut),w=l(),{getEntityRecord:g}=d(Nt),f=g("postType",e.type,e.id);return{isReady:c(),mode:i(),isRichEditingEnabled:w.richEditingEnabled,currentPost:f}},[e.id,e.type]);return s?R("div",{className:"gutenberg-kit-editor",ref:n,children:Mt(Gt,{post:a,settings:Jt,useSubRegistry:!1,children:[u==="visual"&&r&&R(rt,{hideTitle:o}),(u==="text"||!r)&&R(Dt,{autoFocus:!0,hideTitle:o}),t]})}):null}const Jt={},{jsx:F}=window.ReactJSXRuntime,{Notice:Vt}=window.wp.components,{__:S}=window.wp.i18n,{useState:Xt,useEffect:z}=window.wp.element;function Ht({className:e}){const{notice:t,clearNotice:o}=Kt(),n=[{label:S("Retry","gutenberg-kit"),onClick:()=>window.location.href="remote.html",variant:"primary"},{label:S("Dismiss","gutenberg-kit"),onClick:o,variant:"secondary"}];return t?F("div",{className:e,children:F(Vt,{actions:n,status:"warning",isDismissible:!1,children:t})}):null}function Kt(){const[e,t]=Xt(null);return z(()=>{const n=new URL(window.location.href).searchParams.get("error");let s=null;switch(n){case Wt:s=S("Oops! We couldn't load your site's editor and plugins. Don't worry, you can use the default editor for now.","gutenberg-kit");break;case Zt:s=S("Oops! Configuration for your site editor was unavailable. Don't worry, you can use the default editor for now.","gutenberg-kit");break;default:s=null}t(s)},[]),z(()=>{if(e){const o=setTimeout(()=>{t(null)},2e4);return()=>clearTimeout(o)}},[e]),{notice:e,clearNotice:()=>t(null)}}const Wt="remote_editor_load_error",Zt="gbkit_global_unavailable",{jsx:b,jsxs:qt}=window.ReactJSXRuntime,{EditorSnackbars:Qt,ErrorBoundary:Yt,AutosaveMonitor:eo}=window.wp.editor;function to(e){return qt(Yt,{canCopyContent:!0,children:[b(eo,{autosave:oe}),b(zt,{...e,children:b(Qt,{})}),b(Ht,{className:"gutenberg-kit-layout__load-notice"})]})}const{jsx:J}=window.ReactJSXRuntime,{getBlockTypes:oo,unregisterBlockType:no}=window.wp.blocks;function so({createRoot:e,StrictMode:t,dispatch:o,editorStore:n,preferencesStore:s,registerCoreBlocks:u}){const{themeStyles:r,hideTitle:a,editorSettings:d}=ne(),c=d||{defaultEditorStyles:[{css:le}]};o(n).updateEditorSettings(c);const l=o(s);l.setDefaults("core",{fixedToolbar:!0}),l.setDefaults("core/edit-post",{themeStyles:r}),u();const i=se();e(document.getElementById("root")).render(J(t,{children:J(to,{post:i,hideTitle:a})}))}function io(e){if(!e)return;const t=[];oo().forEach(o=>{e.includes(o.name)||(no(o.name),t.push(o.name))}),ae("Blocks unregistered:",t)}const co=Object.freeze(Object.defineProperty({__proto__:null,initializeEditor:so,unregisterDisallowedBlocks:io},Symbol.toStringTag,{value:"Module"}));export{co as a,ae as d,ao as e}; diff --git a/ios/Sources/GutenbergKit/Gutenberg/assets/editor-DkjwLpR_.js b/ios/Sources/GutenbergKit/Gutenberg/assets/editor-DkjwLpR_.js deleted file mode 100644 index 0bcca5d3..00000000 --- a/ios/Sources/GutenbergKit/Gutenberg/assets/editor-DkjwLpR_.js +++ /dev/null @@ -1,67 +0,0 @@ -import{g as We,a as qr,n as Zr,b as Kr,s as ke,c as V,_ as c,r as ut,j as s,S as X,P as W,u as Tt,d as pt,e as f,C as ee,f as te,i as st,h as Yt,V as $t,k as Qr,l as Y,m as Nl,F as Vt,o as Xr,p as Jr,q as z,N as Et,w as ei,B,t as ti,v as As,A as wt,x as ve,y as On,z as Al,D as Bl,E as jn,G as _,H as U,I as T,M as _e,J as mt,T as Il,K as Bs,L as Nt,O as ue,Q as Lt,R as Rl,U as Ml,W as le,X as St,Y as si,Z as rt,$ as Ao,a0 as Bo,a1 as it,a2 as me,a3 as ht,a4 as M,a5 as Is,a6 as ni,a7 as Tn,a8 as Io,a9 as oi,aa as ri,ab as Ll,ac as Dl,ad as Fl,ae as qt,af as et,ag as Ht,ah as At,ai as zt,aj as Ol,ak as $l,al as Zt,am as Vl,an as Ae,ao as Rs,ap as Hl,aq as zl,ar as Ul,as as je,at as Wl,au as Ro,av as Gl,aw as Ct,ax as ii,ay as ge,az as ai,aA as oe,aB as Z,aC as li,aD as Yl,aE as ql,aF as Zl,aG as Kl,aH as $n,aI as Vn,aJ as Ms,aK as Ql,aL as Xl,aM as Jl,aN as ec,aO as Hn,aP as Mo,aQ as tc,aR as sc,aS as nc,aT as gs,aU as fs,aV as ci,aW as di,aX as oc,aY as rc,aZ as ce,a_ as ui,a$ as zn,b0 as Un,b1 as En,b2 as pi,b3 as H,b4 as Ls,b5 as Bt,b6 as Ds,b7 as C,b8 as x,b9 as Fs,ba as ic,bb as Wn,bc as xs,bd as se,be as at,bf as ac,bg as mi,bh as Os,bi as Dt,bj as as,bk as hi,bl as Ut,bm as fe,bn as $,bo as It,bp as Se,bq as lc,br as lt,bs as ct,bt as cc,bu as $s,bv as dc,bw as Ie,bx as gi,by as Xe,bz as fi,bA as Lo,bB as G,bC as Rt,bD as Gn,bE as Ne,bF as uc,bG as Yn,bH as Le,bI as Wt,bJ as bi,bK as pc,bL as Kt,bM as Vs,bN as mc,bO as qn,bP as xi,bQ as yi,bR as Zn,bS as hc,bT as ys,bU as vi,bV as ye,bW as Do,bX as gc,bY as Hs,bZ as _i,b_ as ot,b$ as fc,c0 as Kn,c1 as bc,c2 as xc,c3 as yc,c4 as vc,c5 as vs,c6 as we,c7 as De,c8 as Pt,c9 as dt,ca as wi,cb as _c,cc as wc,cd as Sc,ce as Fo,cf as Cc,cg as Si,ch as Pc,ci as kc,cj as Qn,ck as jc,cl as zs,cm as Tc,cn as Ec,co as Ci,cp as Pi,cq as Nc,cr as Ac,cs as Bc,ct as Ic,cu as Us,cv as Rc,cw as Xn,cx as Mc,cy as Jn,cz as _s,cA as Lc,cB as Dc,cC as Fc,cD as Oc,cE as ki,cF as eo,cG as $c,cH as Vc,cI as Mt,cJ as Hc,cK as to,cL as on,cM as ws,cN as Ue,cO as zc,cP as ji,cQ as Uc,cR as Wc,cS as Oo,cT as Gc,cU as Ti,cV as Yc,cW as qc,cX as Ei,cY as Ni,cZ as Zc,c_ as Ai,c$ as Kc,d0 as Qc,d1 as Xc,d2 as Jc,d3 as ed,d4 as td,d5 as $o,d6 as sd,d7 as nd,d8 as od,d9 as rd,da as id,db as ad,dc as ld,dd as Vo,de as cd,df as Bi,dg as Ii,dh as ft,di as Ri,dj as Mi,dk as dd,dl as ud,dm as pd,dn as Li,dp as md,dq as Di,dr as re,ds as Fi,dt as hd,du as Re,dv as gd,dw as Ho,dx as fd,dy as Ws,dz as bd,dA as xd,dB as yd,dC as vd,dD as zo,dE as Oi,dF as so,dG as _d,dH as Gs,dI as wd,dJ as Sd,dK as $i,dL as Cd,dM as Pd,dN as kd,dO as jd,dP as Td,dQ as Ed,dR as Nd,dS as Ad,dT as Bd,dU as Id,dV as Uo,dW as Rd,dX as Md,dY as Ld,dZ as Dd,d_ as Fd}from"./index-0vESit7d.js";import{e as Od,o as $d,l as Vd,b as Hd,c as zd,g as Ud,d as Wd}from"./bridge-COXq4kB3.js";const Gd=/^(tel:)?(\+)?\d{6,15}$/;function Yd(e){return e=e.replace(/[-.() ]/g,""),Gd.test(e)}function qd(e){return e?/^[^\s#?]+$/.test(e):!1}function Zd(e){return e?/^[^\s#?]+$/.test(e):!1}function Kd(e){return e?/^[^\s#?\/]+$/.test(e):!1}function Qd(e){const t=We(e),n=qr(e);let o="/";return t&&(o+=t),n&&(o+=`?${n}`),o}function Wo(e,t,n){return e=e.slice(),e[t]=n,e}function Be(e,t,n=e.start,o=e.end){const{formats:r,activeFormats:i}=e,a=r.slice();if(n===o){const l=a[n]?.find(({type:d})=>d===t.type);if(l){const d=a[n].indexOf(l);for(;a[n]&&a[n][d]===l;)a[n]=Wo(a[n],d,t),n--;for(o++;a[o]&&a[o][d]===l;)a[o]=Wo(a[o],d,t),o++}}else{let l=1/0;for(let d=n;dp!==t.type);const u=a[d].length;ul!==t.type)||[],t]})}function Xd({formats:e,replacements:t,text:n,start:o,end:r},i,a){return n=n.replace(i,(l,...d)=>{const u=d[d.length-2];let p=a,m,h;return typeof p=="function"&&(p=a(l,...d)),typeof p=="object"?(m=p.formats,h=p.replacements,p=p.text):(m=Array(p.length),h=Array(p.length),e[u]&&(m=m.fill(e[u]))),e=e.slice(0,u).concat(m,e.slice(u+l.length)),t=t.slice(0,u).concat(h,t.slice(u+l.length)),o&&(o=r=u+p.length),p}),Zr({formats:e,replacements:t,text:n,start:o,end:r})}function Oe(e,t){return Kr(e,t.type)?(t.title&&ke(V(c("%s removed."),t.title),"assertive"),ut(e,t.type)):(t.title&&ke(V(c("%s applied."),t.title),"assertive"),Be(e,t))}const Jd=s.jsx(X,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:s.jsx(W,{fillRule:"evenodd",clipRule:"evenodd",d:"M18.5 5.5V8H20V5.5H22.5V4H20V1.5H18.5V4H16V5.5H18.5ZM13.9624 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V10.0391H18.5V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 10.4917L16.4589 10.5139L16.4641 9.01389L5.5 8.97618V6C5.5 5.72386 5.72386 5.5 6 5.5H13.9624V4ZM5.5 10.4762V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 10.4865L5.5 10.4762Z"})}),eu=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{d:"M17.3 10.1C17.3 7.60001 15.2 5.70001 12.5 5.70001C10.3 5.70001 8.4 7.10001 7.9 9.00001H7.7C5.7 9.00001 4 10.7 4 12.8C4 14.9 5.7 16.6 7.7 16.6H9.5V15.2H7.7C6.5 15.2 5.5 14.1 5.5 12.9C5.5 11.7 6.5 10.5 7.7 10.5H9L9.3 9.40001C9.7 8.10001 11 7.20001 12.5 7.20001C14.3 7.20001 15.8 8.50001 15.8 10.1V11.4L17.1 11.6C17.9 11.7 18.5 12.5 18.5 13.4C18.5 14.4 17.7 15.2 16.8 15.2H14.5V16.6H16.7C18.5 16.6 19.9 15.1 19.9 13.3C20 11.7 18.8 10.4 17.3 10.1Z M14.1245 14.2426L15.1852 13.182L12.0032 10L8.82007 13.1831L9.88072 14.2438L11.25 12.8745V18H12.75V12.8681L14.1245 14.2426Z"})}),tu=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{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"})}),Vi=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{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"})}),su=s.jsx(X,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:s.jsx(W,{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"})}),Go=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"})}),nu=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{d:"M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z"})}),ou=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{d:"M12.5 5L10 19h1.9l2.5-14z"})}),ru=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{d:"M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"})}),iu=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{d:"M17.5 10h-1.7l-3.7 10.5h1.7l.9-2.6h3.9l.9 2.6h1.7L17.5 10zm-2.2 6.3 1.4-4 1.4 4h-2.8zm-4.8-3.8c1.6-1.8 2.9-3.6 3.7-5.7H16V5.2h-5.8V3H8.8v2.2H3v1.5h9.6c-.7 1.6-1.8 3.1-3.1 4.6C8.6 10.2 7.8 9 7.2 8H5.6c.6 1.4 1.7 2.9 2.9 4.4l-2.4 2.4c-.3.4-.7.8-1.1 1.2l1 1 1.2-1.2c.8-.8 1.6-1.5 2.3-2.3.8.9 1.7 1.7 2.5 2.5l.6-1.5c-.7-.6-1.4-1.3-2.1-2z"})}),Yo=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"})}),Hi=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{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"})}),au=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})}),lu=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"})}),zi=s.jsx(X,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:s.jsx(W,{fillRule:"evenodd",clipRule:"evenodd",d:"M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z"})}),cu=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{fill:"none",d:"M5.75 12.75V18.25H11.25M12.75 5.75H18.25V11.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"square"})}),du=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{d:"M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"})}),uu=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{d:"M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"})}),pu=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{d:"M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z"})}),qo=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{d:"M17 4H7c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12zm-7.5-.5h4V16h-4v1.5z"})}),Ui=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{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"})}),mu=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:s.jsx(W,{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"})}),hu={name:"12ip69d",styles:"background:transparent;display:block;margin:0!important;pointer-events:none;position:absolute;will-change:box-shadow"};function ls(e){const t=`rgba(0, 0, 0, ${e/20})`;return`0 ${e}px ${e*2}px 0 - ${t}`}function gu(e){const{active:t,borderRadius:n="inherit",className:o,focus:r,hover:i,isInteractive:a=!1,offset:l=0,value:d=0,...u}=Tt(e,"Elevation"),p=pt(),m=f.useMemo(()=>{let h=st(i)?i:d*2,g=st(t)?t:d/2;a||(h=st(i)?i:void 0,g=st(t)?t:void 0);const b=`box-shadow ${ee.transitionDuration} ${ee.transitionTimingFunction}`,y={};return y.Base=te({borderRadius:n,bottom:l,boxShadow:ls(d),opacity:ee.elevationIntensity,left:l,right:l,top:l},te("@media not ( prefers-reduced-motion ){transition:",b,";}",""),"",""),st(h)&&(y.hover=te("*:hover>&{box-shadow:",ls(h),";}","")),st(g)&&(y.active=te("*:active>&{box-shadow:",ls(g),";}","")),st(r)&&(y.focus=te("*:focus>&{box-shadow:",ls(r),";}","")),p(hu,y.Base,y.hover,y.focus,y.active,o)},[t,n,o,p,r,i,a,l,d]);return{...u,className:m,"aria-hidden":!0}}function fu(e,t){const n=gu(e);return s.jsx($t,{...n,ref:t})}const Zo=Yt(fu,"Elevation"),Ot=`calc(${ee.radiusLarge} - 1px)`,bu=te("box-shadow:0 0 0 1px ",ee.surfaceBorderColor,";outline:none;",""),xu={name:"1showjb",styles:"border-bottom:1px solid;box-sizing:border-box;&:last-child{border-bottom:none;}"},yu={name:"13udsys",styles:"height:100%"},vu={name:"6ywzd",styles:"box-sizing:border-box;height:auto;max-height:100%"},Wi=te("&:first-of-type{border-top-left-radius:",Ot,";border-top-right-radius:",Ot,";}&:last-of-type{border-bottom-left-radius:",Ot,";border-bottom-right-radius:",Ot,";}",""),_u=te("border-color:",ee.colorDivider,";",""),wu={name:"1t90u8d",styles:"box-shadow:none"},Su={name:"1e1ncky",styles:"border:none"},Cu=te("border-radius:",Ot,";",""),Ko=te("padding:",ee.cardPaddingXSmall,";",""),Gi={large:te("padding:",ee.cardPaddingLarge,";",""),medium:te("padding:",ee.cardPaddingMedium,";",""),small:te("padding:",ee.cardPaddingSmall,";",""),xSmall:Ko,extraSmall:Ko},Yi=te("background-color:",Qr.ui.backgroundDisabled,";",""),Pu=te("background-color:",ee.surfaceColor,";color:",Qr.gray[900],";position:relative;","");ee.surfaceBackgroundColor;function ku({borderBottom:e,borderLeft:t,borderRight:n,borderTop:o}){const r=`1px solid ${ee.surfaceBorderColor}`;return te({borderBottom:e?r:void 0,borderLeft:t?r:void 0,borderRight:n?r:void 0,borderTop:o?r:void 0},"","")}const ju=te("",""),Tu=te("background:",ee.surfaceBackgroundTintColor,";",""),Eu=te("background:",ee.surfaceBackgroundTertiaryColor,";",""),qi=e=>[e,e].join(" "),Nu=e=>["90deg",[ee.surfaceBackgroundColor,e].join(" "),"transparent 1%"].join(","),Au=e=>[[ee.surfaceBackgroundColor,e].join(" "),"transparent 1%"].join(","),Bu=e=>[`linear-gradient( ${Nu(e)} ) center`,`linear-gradient( ${Au(e)} ) center`,ee.surfaceBorderBoldColor].join(","),Iu=(e,t)=>te("background:",Bu(t),";background-size:",qi(e),";",""),Ru=[`${ee.surfaceBorderSubtleColor} 1px`,"transparent 1px"].join(","),Mu=["90deg",`${ee.surfaceBorderSubtleColor} 1px`,"transparent 1px"].join(","),Lu=[`linear-gradient( ${Ru} )`,`linear-gradient( ${Mu} )`].join(","),Du=e=>te("background:",ee.surfaceBackgroundColor,";background-image:",Lu,";background-size:",qi(e),";",""),Fu=(e,t,n)=>{switch(e){case"dotted":return Iu(t,n);case"grid":return Du(t);case"primary":return ju;case"secondary":return Tu;case"tertiary":return Eu}};function Ou(e){const{backgroundSize:t=12,borderBottom:n=!1,borderLeft:o=!1,borderRight:r=!1,borderTop:i=!1,className:a,variant:l="primary",...d}=Tt(e,"Surface"),u=pt(),p=f.useMemo(()=>{const m={borders:ku({borderBottom:n,borderLeft:o,borderRight:r,borderTop:i})};return u(Pu,m.borders,Fu(l,`${t}px`,`${t-1}px`),a)},[t,n,o,r,i,a,u,l]);return{...d,className:p}}function $u({elevation:e,isElevated:t,...n}){const o={...n};let r=e;if(t){var i;Y("Card isElevated prop",{since:"5.9",alternative:"elevation"}),(i=r)!==null&&i!==void 0||(r=2)}return typeof r<"u"&&(o.elevation=r),o}function Vu(e){const{className:t,elevation:n=0,isBorderless:o=!1,isRounded:r=!0,size:i="medium",...a}=Tt($u(e),"Card"),l=pt(),d=f.useMemo(()=>l(bu,o&&wu,r&&Cu,t),[t,l,o,r]);return{...Ou({...a,className:d}),elevation:n,isBorderless:o,isRounded:r,size:i}}function Hu(e,t){const{children:n,elevation:o,isBorderless:r,isRounded:i,size:a,...l}=Vu(e),d=i?ee.radiusLarge:0,u=pt(),p=f.useMemo(()=>u(te({borderRadius:d},"","")),[u,d]),m=f.useMemo(()=>{const h={size:a,isBorderless:r};return{CardBody:h,CardHeader:h,CardFooter:h}},[r,a]);return s.jsx(Nl,{value:m,children:s.jsxs($t,{...l,ref:t,children:[s.jsx($t,{className:u(yu),children:n}),s.jsx(Zo,{className:p,isInteractive:!1,value:o?1:0}),s.jsx(Zo,{className:p,isInteractive:!1,value:o})]})})}const Qo=Yt(Hu,"Card"),zu=te("@media only screen and ( min-device-width: 40em ){&::-webkit-scrollbar{height:12px;width:12px;}&::-webkit-scrollbar-track{background-color:transparent;}&::-webkit-scrollbar-track{background:",ee.colorScrollbarTrack,";border-radius:8px;}&::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:",ee.colorScrollbarThumb,";border:2px solid rgba( 0, 0, 0, 0 );border-radius:7px;}&:hover::-webkit-scrollbar-thumb{background-color:",ee.colorScrollbarThumbHover,";}}",""),Uu={name:"13udsys",styles:"height:100%"},Wu={name:"7zq9w",styles:"scroll-behavior:smooth"},Gu={name:"q33xhg",styles:"overflow-x:auto;overflow-y:hidden"},Yu={name:"103x71s",styles:"overflow-x:hidden;overflow-y:auto"},qu={name:"umwchj",styles:"overflow-y:auto"};function Zu(e){const{className:t,scrollDirection:n="y",smoothScroll:o=!1,...r}=Tt(e,"Scrollable"),i=pt(),a=f.useMemo(()=>i(Uu,zu,o&&Wu,n==="x"&&Gu,n==="y"&&Yu,n==="auto"&&qu,t),[t,i,n,o]);return{...r,className:a}}function Ku(e,t){const n=Zu(e);return s.jsx($t,{...n,ref:t})}const Qu=Yt(Ku,"Scrollable");function Xu(e){const{className:t,isScrollable:n=!1,isShady:o=!1,size:r="medium",...i}=Tt(e,"CardBody"),a=pt(),l=f.useMemo(()=>a(vu,Wi,Gi[r],o&&Yi,"components-card__body",t),[t,a,o,r]);return{...i,className:l,isScrollable:n}}function Ju(e,t){const{isScrollable:n,...o}=Xu(e);return n?s.jsx(Qu,{...o,ref:t}):s.jsx($t,{...o,ref:t})}const Xo=Yt(Ju,"CardBody");function ep(e){const{className:t,isBorderless:n=!1,isShady:o=!1,size:r="medium",...i}=Tt(e,"CardHeader"),a=pt(),l=f.useMemo(()=>a(xu,Wi,_u,Gi[r],n&&Su,o&&Yi,"components-card__header",t),[t,a,n,o,r]);return{...i,className:l}}function tp(e,t){const n=ep(e);return s.jsx(Vt,{...n,ref:t})}const sp=Yt(tp,"CardHeader");function np(e,t){const o=ap(e);let r;if(o.date){const d=lp(o.date,2);r=cp(d.restDateString,d.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);const i=r.getTime();let a=0,l;if(o.time&&(a=dp(o.time),isNaN(a)))return new Date(NaN);if(o.timezone){if(l=up(o.timezone),isNaN(l))return new Date(NaN)}else{const d=new Date(i+a),u=new Date(0);return u.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),u.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),u}return new Date(i+a+l)}const cs={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},op=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,rp=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ip=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ap(e){const t={},n=e.split(cs.dateTimeDelimiter);let o;if(n.length>2)return t;if(/:/.test(n[0])?o=n[0]:(t.date=n[0],o=n[1],cs.timeZoneDelimiter.test(t.date)&&(t.date=e.split(cs.timeZoneDelimiter)[0],o=e.substr(t.date.length,e.length))),o){const r=cs.timezone.exec(o);r?(t.time=o.replace(r[1],""),t.timezone=r[1]):t.time=o}return t}function lp(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),o=e.match(n);if(!o)return{year:NaN,restDateString:""};const r=o[1]?parseInt(o[1]):null,i=o[2]?parseInt(o[2]):null;return{year:i===null?r:i*100,restDateString:e.slice((o[1]||o[2]).length)}}function cp(e,t){if(t===null)return new Date(NaN);const n=e.match(op);if(!n)return new Date(NaN);const o=!!n[4],r=Ft(n[1]),i=Ft(n[2])-1,a=Ft(n[3]),l=Ft(n[4]),d=Ft(n[5])-1;if(o)return fp(t,l,d)?pp(t,l,d):new Date(NaN);{const u=new Date(0);return!hp(t,i,a)||!gp(t,r)?new Date(NaN):(u.setUTCFullYear(t,i,Math.max(r,a)),u)}}function Ft(e){return e?parseInt(e):1}function dp(e){const t=e.match(rp);if(!t)return NaN;const n=rn(t[1]),o=rn(t[2]),r=rn(t[3]);return bp(n,o,r)?n*Xr+o*Jr+r*1e3:NaN}function rn(e){return e&&parseFloat(e.replace(",","."))||0}function up(e){if(e==="Z")return 0;const t=e.match(ip);if(!t)return 0;const n=t[1]==="+"?-1:1,o=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return xp(o,r)?n*(o*Xr+r*Jr):NaN}function pp(e,t,n){const o=new Date(0);o.setUTCFullYear(e,0,4);const r=o.getUTCDay()||7,i=(t-1)*7+n+1-r;return o.setUTCDate(o.getUTCDate()+i),o}const mp=[31,null,31,30,31,30,31,31,30,31,30,31];function Zi(e){return e%400===0||e%4===0&&e%100!==0}function hp(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(mp[t]||(Zi(e)?29:28))}function gp(e,t){return t>=1&&t<=(Zi(e)?366:365)}function fp(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function bp(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function xp(e,t){return t>=0&&t<=59}const yp=()=>{};function Nn({notices:e,onRemove:t=yp,className:n,children:o}){const r=i=>()=>t(i);return n=z("components-notice-list",n),s.jsxs("div",{className:n,children:[o,[...e].reverse().map(i=>{const{content:a,...l}=i;return f.createElement(Et,{...l,key:i.id,onRemove:r(i.id)},i.content)})]})}function vp({label:e,children:t}){return s.jsxs("div",{className:"components-panel__header",children:[e&&s.jsx("h2",{children:e}),t]})}function _p({header:e,className:t,children:n},o){const r=z(t,"components-panel");return s.jsxs("div",{className:r,ref:o,children:[e&&s.jsx(vp,{label:e}),n]})}const wp=f.forwardRef(_p);function Sp({className:e,children:t},n){return s.jsx("div",{className:z("components-panel__row",e),ref:n,children:t})}const Ys=f.forwardRef(Sp),Cp=1e4;function Pp(e,t){const n=typeof e=="string"?e:ti(e);f.useEffect(()=>{n&&ke(n,t)},[n,t])}function kp({className:e,children:t,spokenMessage:n=t,politeness:o="polite",actions:r=[],onRemove:i,icon:a=null,explicitDismiss:l=!1,onDismiss:d,listRef:u},p){function m(v){v&&v.preventDefault&&v.preventDefault(),u?.current?.focus(),d?.(),i?.()}function h(v,w){v.stopPropagation(),i?.(),w&&w(v)}Pp(n,o);const g=f.useRef({onDismiss:d,onRemove:i});f.useLayoutEffect(()=>{g.current={onDismiss:d,onRemove:i}}),f.useEffect(()=>{const v=setTimeout(()=>{l||(g.current.onDismiss?.(),g.current.onRemove?.())},Cp);return()=>clearTimeout(v)},[l]);const b=z(e,"components-snackbar",{"components-snackbar-explicit-dismiss":!!l});r&&r.length>1&&(globalThis.SCRIPT_DEBUG===!0&&ei("Snackbar can only have one action. Use Notice if your message requires many actions."),r=[r[0]]);const y=z("components-snackbar__content",{"components-snackbar__content-with-icon":!!a});return s.jsx("div",{ref:p,className:b,onClick:l?void 0:m,tabIndex:0,role:l?void 0:"button",onKeyPress:l?void 0:m,"aria-label":l?void 0:c("Dismiss this notice"),"data-testid":"snackbar",children:s.jsxs("div",{className:y,children:[a&&s.jsx("div",{className:"components-snackbar__icon",children:a}),t,r.map(({label:v,onClick:w,url:S},P)=>s.jsx(B,{__next40pxDefaultSize:!0,href:S,variant:"link",onClick:k=>h(k,w),className:"components-snackbar__action",children:v},P)),l&&s.jsx("span",{role:"button","aria-label":c("Dismiss this notice"),tabIndex:0,className:"components-snackbar__dismiss-button",onClick:m,onKeyPress:m,children:"✕"})]})})}const jp=f.forwardRef(kp),Tp={init:{height:0,opacity:0},open:{height:"auto",opacity:1,transition:{height:{type:"tween",duration:.3,ease:[0,0,.2,1]},opacity:{type:"tween",duration:.25,delay:.05,ease:[0,0,.2,1]}}},exit:{opacity:0,transition:{type:"tween",duration:.1,ease:[0,0,.2,1]}}};function Ep({notices:e,className:t,children:n,onRemove:o}){const r=f.useRef(null),i=As();t=z("components-snackbar-list",t);const a=l=>()=>o?.(l.id);return s.jsxs("div",{className:t,tabIndex:-1,ref:r,"data-testid":"snackbar-list",children:[n,s.jsx(wt,{children:e.map(l=>{const{content:d,...u}=l;return s.jsx(ve.div,{layout:!i,initial:"init",animate:"open",exit:"exit",variants:i?void 0:Tp,children:s.jsx("div",{className:"components-snackbar-list__notice-container",children:s.jsx(jp,{...u,onRemove:a(l),listRef:r,children:l.content})})},l.id)})})]})}const Np=On(e=>function(n){const o=Al();return s.jsx("div",{ref:o,tabIndex:-1,children:s.jsx(e,{...n})})},"withConstrainedTabbing");function Ap(e){return e instanceof f.Component||typeof e=="function"}const Bp=On(e=>{const t=({onFocusReturn:n}={})=>o=>i=>{const a=Bl(n);return s.jsx("div",{ref:a,children:s.jsx(o,{...i})})};if(Ap(e)){const n=e;return t()(n)}return t(e)},"withFocusReturn"),Ip=On(e=>{function t(r,i){const[a,l]=f.useState([]),d=f.useMemo(()=>{const p=m=>{const h=m.id?m:{...m,id:jn()};l(g=>[...g,h])};return{createNotice:p,createErrorNotice:m=>{p({status:"error",content:m})},removeNotice:m=>{l(h=>h.filter(g=>g.id!==m))},removeAllNotices:()=>{l([])}}},[]),u={...r,noticeList:a,noticeOperations:d,noticeUI:a.length>0&&s.jsx(Nn,{className:"components-with-notices-ui",notices:a,onRemove:d.removeNotice})};return n?s.jsx(e,{...u,ref:i}):s.jsx(e,{...u})}let n;const{render:o}=e;return typeof o=="function"?(n=!0,f.forwardRef(t)):t},"withNotices");function an({scope:e,name:t,label:n,info:o,messageActivated:r,messageDeactivated:i,shortcut:a,handleToggling:l=!0,onToggle:d=()=>null,disabled:u=!1}){const p=_(g=>!!g(U).get(e,t),[e,t]),{toggle:m}=T(U),h=()=>{if(p){const g=i||V(c("Preference deactivated - %s"),n);ke(g)}else{const g=r||V(c("Preference activated - %s"),n);ke(g)}};return s.jsx(_e,{icon:p&&mt,isSelected:p,onClick:()=>{d(),l&&m(e,t),h()},role:"menuitemcheckbox",info:o,shortcut:a,disabled:u,children:n})}function Ki({help:e,label:t,isChecked:n,onChange:o,children:r}){return s.jsxs("div",{className:"preference-base-option",children:[s.jsx(Il,{__nextHasNoMarginBottom:!0,help:e,label:t,checked:n,onChange:o}),r]})}function Rp(e){const{scope:t,featureName:n,onToggle:o=()=>{},...r}=e,i=_(d=>!!d(U).get(t,n),[t,n]),{toggle:a}=T(U),l=()=>{o(),a(t,n)};return s.jsx(Ki,{onChange:l,isChecked:i,...r})}function Mp({closeModal:e,children:t}){return s.jsx(Bs,{className:"preferences-modal",title:c("Preferences"),onRequestClose:e,children:t})}const Lp=({description:e,title:t,children:n})=>s.jsxs("fieldset",{className:"preferences-modal__section",children:[s.jsxs("legend",{className:"preferences-modal__section-legend",children:[s.jsx("h2",{className:"preferences-modal__section-title",children:t}),e&&s.jsx("p",{className:"preferences-modal__section-description",children:e})]}),s.jsx("div",{className:"preferences-modal__section-content",children:n})]}),{lock:Dp,unlock:Fp}=Nt("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/preferences"),{Tabs:ds}=Fp(ht),Jo="preferences-menu";function Op({sections:e}){const t=ue("medium"),[n,o]=f.useState(Jo),{tabs:r,sectionsContentMap:i}=f.useMemo(()=>{let l={tabs:[],sectionsContentMap:{}};return e.length&&(l=e.reduce((d,{name:u,tabLabel:p,content:m})=>(d.tabs.push({name:u,title:p}),d.sectionsContentMap[u]=m,d),{tabs:[],sectionsContentMap:{}})),l},[e]);let a;return t?a=s.jsx("div",{className:"preferences__tabs",children:s.jsxs(ds,{defaultTabId:n!==Jo?n:void 0,onSelect:o,orientation:"vertical",children:[s.jsx(ds.TabList,{className:"preferences__tabs-tablist",children:r.map(l=>s.jsx(ds.Tab,{tabId:l.name,className:"preferences__tabs-tab",children:l.title},l.name))}),r.map(l=>s.jsx(ds.TabPanel,{tabId:l.name,className:"preferences__tabs-tabpanel",focusable:!1,children:i[l.name]||null},l.name))]})}):a=s.jsxs(Lt,{initialPath:"/",className:"preferences__provider",children:[s.jsx(Lt.Screen,{path:"/",children:s.jsx(Qo,{isBorderless:!0,size:"small",children:s.jsx(Xo,{children:s.jsx(Rl,{children:r.map(l=>s.jsx(Lt.Button,{path:`/${l.name}`,as:Ml,isAction:!0,children:s.jsxs(le,{justify:"space-between",children:[s.jsx(St,{children:s.jsx(si,{children:l.title})}),s.jsx(St,{children:s.jsx(rt,{icon:it()?Ao:Bo})})]})},l.name))})})})}),e.length&&e.map(l=>s.jsx(Lt.Screen,{path:`/${l.name}`,children:s.jsxs(Qo,{isBorderless:!0,size:"large",children:[s.jsxs(sp,{isBorderless:!1,justify:"left",size:"small",gap:"6",children:[s.jsx(Lt.BackButton,{icon:it()?Bo:Ao,label:c("Back")}),s.jsx(me,{size:"16",children:l.tabLabel})]}),s.jsx(Xo,{children:l.content})]})},`${l.name}-menu`))]}),a}const tt={};Dp(tt,{PreferenceBaseOption:Ki,PreferenceToggleControl:Rp,PreferencesModal:Mp,PreferencesModalSection:Lp,PreferencesModalTabs:Op});function $p(e){var t,n;if(!e)return null;const o=(t=Array.from(document.querySelectorAll('iframe[name="editor-canvas"]').values()).find(r=>(r.contentDocument||r.contentWindow.document)===e.ownerDocument))!==null&&t!==void 0?t:e;return(n=o?.closest('[role="region"]'))!==null&&n!==void 0?n:o}function Vp({rootLabelText:e}){const{selectBlock:t,clearSelectedBlock:n}=T(M),{clientId:o,parents:r,hasSelection:i}=_(d=>{const{getSelectionStart:u,getSelectedBlockClientId:p,getEnabledBlockParents:m}=Is(d(M)),h=p();return{parents:m(h),clientId:h,hasSelection:!!u().clientId}},[]),a=e||c("Document"),l=f.useRef();return ni(o,l),s.jsxs("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":c("Block breadcrumb"),children:[s.jsxs("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true",children:[i&&s.jsx(B,{size:"small",className:"block-editor-block-breadcrumb__button",onClick:()=>{const d=l.current?.closest(".editor-styles-wrapper");n(),$p(d)?.focus()},children:a}),!i&&s.jsx("span",{children:a}),!!o&&s.jsx(rt,{icon:Tn,className:"block-editor-block-breadcrumb__separator"})]}),r.map(d=>s.jsxs("li",{children:[s.jsx(B,{size:"small",className:"block-editor-block-breadcrumb__button",onClick:()=>t(d),children:s.jsx(Io,{clientId:d,maximumLength:35})}),s.jsx(rt,{icon:Tn,className:"block-editor-block-breadcrumb__separator"})]},d)),!!o&&s.jsx("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true",children:s.jsx(Io,{clientId:o,maximumLength:35})})]})}function Hp(e){const{registerCommand:t,unregisterCommand:n}=T(oi),o=f.useRef(e.callback);f.useEffect(()=>{o.current=e.callback},[e.callback]),f.useEffect(()=>{if(!e.disabled)return t({name:e.name,context:e.context,label:e.label,searchLabel:e.searchLabel,icon:e.icon,callback:(...r)=>o.current(...r)}),()=>{n(e.name)}},[e.name,e.label,e.searchLabel,e.icon,e.context,e.disabled,t,n])}function zp({genericPreviewBlock:e,style:t,className:n,activeStyle:o}){const r=ri(e.name)?.example,i=Ll(n,o,t),a=f.useMemo(()=>({...e,title:t.label||t.name,description:t.description,initialAttributes:{...e.attributes,className:i+" block-editor-block-styles__block-preview-container"},example:r}),[e,i]);return s.jsx(Dl,{item:a})}const er=()=>{};function Qi({clientId:e,onSwitch:t=er,onHoverClassName:n=er}){const{onSelect:o,stylesToRender:r,activeStyle:i,genericPreviewBlock:a,className:l}=Fl({clientId:e,onSwitch:t}),[d,u]=f.useState(null),p=ue("medium","<");if(!r||r.length===0)return null;const m=qt(u,250),h=b=>{o(b),n(null),u(null),m.cancel()},g=b=>{var y;if(d===b){m.cancel();return}m(b),n((y=b?.name)!==null&&y!==void 0?y:null)};return s.jsxs("div",{className:"block-editor-block-styles",children:[s.jsx("div",{className:"block-editor-block-styles__variants",children:r.map(b=>{const y=b.label||b.name;return s.jsx(B,{__next40pxDefaultSize:!0,className:z("block-editor-block-styles__item",{"is-active":i.name===b.name}),variant:"secondary",label:y,onMouseEnter:()=>g(b),onFocus:()=>g(b),onMouseLeave:()=>g(null),onBlur:()=>g(null),onClick:()=>h(b),"aria-current":i.name===b.name,children:s.jsx(si,{numberOfLines:1,className:"block-editor-block-styles__item-text",children:y})},b.name)})}),d&&!p&&s.jsx(et,{placement:"left-start",offset:34,focusOnMount:!1,children:s.jsx("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>g(null),children:s.jsx(zp,{activeStyle:i,className:l,genericPreviewBlock:a,style:d})})})]})}function Up({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return s.jsxs("fieldset",{className:e,children:[s.jsx(At,{as:"legend",children:c("Transform to variation")}),o.map(r=>s.jsx(B,{__next40pxDefaultSize:!0,size:"compact",icon:s.jsx(zt,{icon:r.icon,showColors:!0}),isPressed:n===r.name,label:n===r.name?r.title:V(c("Transform to %s"),r.title),onClick:()=>t(r.name),"aria-label":r.title,showTooltip:!0},r.name))]})}function Wp({className:e,onSelectVariation:t,selectedValue:n,variations:o}){const r=o.map(({name:i,title:a,description:l})=>({value:i,label:a,info:l}));return s.jsx(Zt,{className:e,label:c("Transform to variation"),text:c("Transform to variation"),popoverProps:{position:"bottom center",className:`${e}__popover`},icon:Vl,toggleProps:{iconPosition:"right"},children:()=>s.jsx(Ae,{children:s.jsx(Rs,{choices:r,value:n,onSelect:t})})})}function Gp({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return s.jsx("div",{className:e,children:s.jsx(Ol,{label:c("Transform to variation"),value:n,hideLabelFromVision:!0,onChange:t,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:o.map(r=>s.jsx($l,{icon:s.jsx(zt,{icon:r.icon,showColors:!0}),value:r.name,label:n===r.name?r.title:V(c("Transform to %s"),r.title)},r.name))})})}function Yp({blockClientId:e}){const{updateBlockAttributes:t}=T(M),{activeBlockVariation:n,variations:o,isContentOnly:r}=_(h=>{const{getActiveBlockVariation:g,getBlockVariations:b}=h(Ht),{getBlockName:y,getBlockAttributes:v,getBlockEditingMode:w}=h(M),S=e&&y(e),{hasContentRoleAttribute:P}=Is(h(Ht)),k=P(S);return{activeBlockVariation:g(S,v(e)),variations:S&&b(S,"transform"),isContentOnly:w(e)==="contentOnly"&&!k}},[e]),i=n?.name,a=f.useMemo(()=>{const h=new Set;return o?(o.forEach(g=>{g.icon&&h.add(g.icon?.src||g.icon)}),h.size===o.length):!1},[o]),l=h=>{t(e,{...o.find(({name:g})=>g===h).attributes})};if(!o?.length||r)return null;const d="block-editor-block-variation-transforms",p=o.length>5?Up:Gp,m=a?p:Wp;return s.jsx(m,{className:d,onSelectVariation:l,selectedValue:i,variations:o})}function Je({character:e,type:t,onUse:n}){const o=f.useContext(Hl),r=f.useRef();return r.current=n,f.useEffect(()=>{function i(a){zl[t](a,e)&&(r.current(),a.preventDefault())}return o.current.add(i),()=>{o.current.delete(i)}},[e,t]),null}function no({inputType:e,onInput:t}){const n=f.useContext(Ul),o=f.useRef();return o.current=t,f.useEffect(()=>{function r(i){i.inputType===e&&(o.current(),i.preventDefault())}return n.current.add(r),()=>{n.current.delete(r)}},[e]),null}const tr=s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:s.jsx(W,{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"})});function qp(e,t){const n=_(r=>r(M).__unstableGetEditorMode(),[]),{__unstableSetEditorMode:o}=T(M);return s.jsx(je,{renderToggle:({isOpen:r,onToggle:i})=>s.jsx(B,{size:"compact",...e,ref:t,icon:n==="navigation"?Ro:tr,"aria-expanded":r,"aria-haspopup":"true",onClick:i,label:c("Tools")}),popoverProps:{placement:"bottom-start"},renderContent:()=>s.jsxs(s.Fragment,{children:[s.jsx(Wl,{className:"block-editor-tool-selector__menu",role:"menu","aria-label":c("Tools"),children:s.jsx(Rs,{value:n==="navigation"?"navigation":"edit",onSelect:r=>{o(r)},choices:[{value:"navigation",label:s.jsxs(s.Fragment,{children:[s.jsx(rt,{icon:Ro}),c("Write")]}),info:c("Focus on content."),"aria-label":c("Write")},{value:"edit",label:s.jsxs(s.Fragment,{children:[tr,c("Design")]}),info:c("Edit layout and styles."),"aria-label":c("Design")}]})}),s.jsx("div",{className:"block-editor-tool-selector__help",children:c("Tools provide different sets of interactions for blocks. Choose between simplified content tools (Write) and advanced visual editing tools (Design).")})]})})}const Zp=f.forwardRef(qp);function Kp(e){const[t,n]=f.useState(window.innerWidth);f.useEffect(()=>{if(e==="Desktop")return;const i=()=>n(window.innerWidth);return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[e]);const o=i=>{let a;switch(i){case"Tablet":a=780;break;case"Mobile":a=360;break;default:return null}return a{const a=i==="Mobile"?"768px":"1024px",l="40px",d="auto";switch(i){case"Tablet":case"Mobile":return{width:o(i),marginTop:l,marginBottom:l,marginLeft:d,marginRight:d,height:a,maxWidth:"100%"};default:return{marginLeft:d,marginRight:d}}})(e)}function Qp(){const e=_(o=>o(M).getBlockSelectionStart(),[]),t=f.useRef();ni(e,t);const n=()=>{t.current?.focus()};return e?s.jsx(B,{__next40pxDefaultSize:!0,variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:n,children:c("Skip to the selected block")}):null}function Xp(){const e=_(t=>t(M).getSelectedBlockCount(),[]);return s.jsxs(le,{justify:"flex-start",spacing:2,className:"block-editor-multi-selection-inspector__card",children:[s.jsx(zt,{icon:Gl,showColors:!0}),s.jsx("div",{className:"block-editor-multi-selection-inspector__card-title",children:V(Ct("%d Block","%d Blocks",e),e)})]})}const Xi={name:"settings",title:c("Settings"),value:"settings",icon:Vi},Ji={name:"styles",title:c("Styles"),value:"styles",icon:zi},An={name:"list",title:c("List View"),value:"list-view",icon:ii},ea=()=>{const e=ge(ai.slotName);return!(e&&e.length)?null:s.jsx(oe,{className:"block-editor-block-inspector__advanced",title:c("Advanced"),initialOpen:!1,children:s.jsx(Z.Slot,{group:"advanced"})})},Jp=()=>{const{selectedClientIds:e,selectedBlocks:t,hasPositionAttribute:n}=_(a=>{const{getBlocksByClientId:l,getSelectedBlockClientIds:d}=a(M),u=d(),p=l(u);return{selectedClientIds:u,selectedBlocks:p,hasPositionAttribute:p?.some(({attributes:m})=>!!m?.style?.position?.type)}},[]),{updateBlockAttributes:o}=T(M),r=Yl();function i(){if(!e?.length||!t?.length)return;const a=Object.fromEntries(t?.map(({clientId:l,attributes:d})=>[l,{style:Kl({...d?.style,position:{...d?.style?.position,type:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0}})}]));o(e,a,!0)}return s.jsx(ql,{className:"block-editor-block-inspector__position",label:c("Position"),resetAll:i,dropdownMenuProps:r,children:s.jsx(Zl,{isShownByDefault:n,label:c("Position"),hasValue:()=>n,onDeselect:i,children:s.jsx(Z.Slot,{group:"position"})})})},ta=()=>{const e=ge(li.position.name);return!(e&&e.length)?null:s.jsx(Jp,{})},em=({showAdvancedControls:e=!1})=>s.jsxs(s.Fragment,{children:[s.jsx(Z.Slot,{}),s.jsx(ta,{}),s.jsx(Z.Slot,{group:"bindings"}),e&&s.jsx("div",{children:s.jsx(ea,{})})]}),tm=({blockName:e,clientId:t,hasBlockStyles:n})=>{const o=$n({blockName:e});return s.jsxs(s.Fragment,{children:[n&&s.jsx("div",{children:s.jsx(oe,{title:c("Styles"),children:s.jsx(Qi,{clientId:t})})}),s.jsx(Z.Slot,{group:"color",label:c("Color"),className:"color-block-support-panel__inner-wrapper"}),s.jsx(Z.Slot,{group:"background",label:c("Background image")}),s.jsx(Z.Slot,{group:"filter"}),s.jsx(Z.Slot,{group:"typography",label:c("Typography")}),s.jsx(Z.Slot,{group:"dimensions",label:c("Dimensions")}),s.jsx(Z.Slot,{group:"border",label:o}),s.jsx(Z.Slot,{group:"styles"})]})},sm=["core/navigation"],sa=e=>!sm.includes(e),{Tabs:nt}=Is(ht);function na({blockName:e,clientId:t,hasBlockStyles:n,tabs:o}){const r=_(a=>a(U).get("core","showIconLabels"),[]),i=sa(e)?void 0:An.name;return s.jsx("div",{className:"block-editor-block-inspector__tabs",children:s.jsxs(nt,{defaultTabId:i,children:[s.jsx(nt.TabList,{children:o.map(a=>r?s.jsx(nt.Tab,{tabId:a.name,children:a.title},a.name):s.jsx(Vn,{text:a.title,children:s.jsx(nt.Tab,{tabId:a.name,"aria-label":a.title,children:s.jsx(Ms,{icon:a.icon})})},a.name))}),s.jsx(nt.TabPanel,{tabId:Xi.name,focusable:!1,children:s.jsx(em,{showAdvancedControls:!!e})}),s.jsx(nt.TabPanel,{tabId:Ji.name,focusable:!1,children:s.jsx(tm,{blockName:e,clientId:t,hasBlockStyles:n})}),s.jsx(nt.TabPanel,{tabId:An.name,focusable:!1,children:s.jsx(Z.Slot,{group:"list"})})]},t)})}const nm=[];function om(e,t={}){return t[e]!==void 0?t[e]:t.default!==void 0?t.default:!0}function oa(e){const t=[],{bindings:n,border:o,color:r,default:i,dimensions:a,list:l,position:d,styles:u,typography:p,effects:m}=li,h=sa(e),g=ge(l.name),b=!h&&!!g&&g.length,v=[...ge(o.name)||[],...ge(r.name)||[],...ge(a.name)||[],...ge(u.name)||[],...ge(p.name)||[],...ge(m.name)||[]].length,w=[...ge(ai.slotName)||[],...ge(n.name)||[]],S=[...ge(i.name)||[],...ge(d.name)||[],...b&&v>1?w:[]];b&&t.push(An),S.length&&t.push(Xi),v&&t.push(Ji);const P=_(E=>E(M).getSettings().blockInspectorTabs,[]);return om(e,P)?t:nm}function rm(e){return _(t=>{if(e){const n=t(M).getSettings().blockInspectorAnimation,o=n?.animationParent,{getSelectedBlockClientId:r,getBlockParentsByBlockName:i}=t(M),a=r();return!i(a,o,!0)[0]&&e.name!==o?null:n?.[e.name]}return null},[e])}function im({clientId:e}){return s.jsx(oe,{title:c("Styles"),children:s.jsx(Qi,{clientId:e})})}function ra(){const{count:e,selectedBlockName:t,selectedBlockClientId:n,blockType:o,isSectionBlock:r}=_(p=>{const{getSelectedBlockClientId:m,getSelectedBlockCount:h,getBlockName:g,getParentSectionBlock:b,isSectionBlock:y}=Is(p(M)),v=m(),w=b(v)||m(),S=w&&g(w),P=S&&ri(S);return{count:h(),selectedBlockClientId:w,selectedBlockName:S,blockType:P,isSectionBlock:y(w)}},[]),i=oa(o?.name),a=i?.length>1,l=rm(o),d=$n({blockName:t});if(e>1&&!r)return s.jsxs("div",{className:"block-editor-block-inspector",children:[s.jsx(Xp,{}),a?s.jsx(na,{tabs:i}):s.jsxs(s.Fragment,{children:[s.jsx(Z.Slot,{}),s.jsx(Z.Slot,{group:"color",label:c("Color"),className:"color-block-support-panel__inner-wrapper"}),s.jsx(Z.Slot,{group:"background",label:c("Background image")}),s.jsx(Z.Slot,{group:"typography",label:c("Typography")}),s.jsx(Z.Slot,{group:"dimensions",label:c("Dimensions")}),s.jsx(Z.Slot,{group:"border",label:d}),s.jsx(Z.Slot,{group:"styles"})]})]});const u=t===Ql();return!o||!n||u?s.jsx("span",{className:"block-editor-block-inspector__no-blocks",children:c("No block selected.")}):s.jsx(am,{animate:l,wrapper:p=>s.jsx(lm,{blockInspectorAnimationSettings:l,selectedBlockClientId:n,children:p}),children:s.jsx(cm,{clientId:n,blockName:o.name,isSectionBlock:r})})}const am=({animate:e,wrapper:t,children:n})=>e?t(n):n,lm=({blockInspectorAnimationSettings:e,selectedBlockClientId:t,children:n})=>{const o=e&&e.enterDirection==="leftToRight"?-50:50;return s.jsx(ve.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:o,opacity:0},children:n},t)},cm=({clientId:e,blockName:t,isSectionBlock:n})=>{const o=oa(t),r=!n&&o?.length>1,i=_(u=>{const{getBlockStyles:p}=u(Ht),m=p(t);return m&&m.length>0},[t]),a=Xl(e),l=$n({blockName:t}),d=_(u=>{if(!n)return;const{getClientIdsOfDescendants:p,getBlockName:m,getBlockEditingMode:h}=u(M);return p(e).filter(g=>m(g)!=="core/list-item"&&h(g)==="contentOnly")},[n,e]);return s.jsxs("div",{className:"block-editor-block-inspector",children:[s.jsx(Jl,{...a,className:a.isSynced&&"is-synced"}),s.jsx(Yp,{blockClientId:e}),r&&s.jsx(na,{hasBlockStyles:i,clientId:e,blockName:t,tabs:o}),!r&&s.jsxs(s.Fragment,{children:[i&&s.jsx(im,{clientId:e}),d&&d?.length>0&&s.jsx(oe,{title:c("Content"),children:s.jsx(ec,{clientIds:d})}),!n&&s.jsxs(s.Fragment,{children:[s.jsx(Z.Slot,{}),s.jsx(Z.Slot,{group:"list"}),s.jsx(Z.Slot,{group:"color",label:c("Color"),className:"color-block-support-panel__inner-wrapper"}),s.jsx(Z.Slot,{group:"background",label:c("Background image")}),s.jsx(Z.Slot,{group:"typography",label:c("Typography")}),s.jsx(Z.Slot,{group:"dimensions",label:c("Dimensions")}),s.jsx(Z.Slot,{group:"border",label:l}),s.jsx(Z.Slot,{group:"styles"}),s.jsx(ta,{}),s.jsx(Z.Slot,{group:"bindings"}),s.jsx("div",{children:s.jsx(ea,{})})]})]}),s.jsx(Qp,{},"back")]})};window.navigator.userAgent.indexOf("Trident");const dm=new Set([sc,nc,gs,fs]),um=.75;function pm(){const e=_(t=>t(M).hasSelectedBlock(),[]);return Hn(t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,i,a;function l(){r||(r=o.requestAnimationFrame(()=>{h(),r=null}))}function d(y){i&&o.cancelAnimationFrame(i),i=o.requestAnimationFrame(()=>{u(y),i=null})}function u({keyCode:y}){if(!g())return;const v=Mo(o);if(!v)return;if(!a){a=v;return}if(dm.has(y)){a=v;return}const w=v.top-a.top;if(w===0)return;const S=tc(t);if(!S)return;const P=S===n.body||S===n.documentElement,k=P?o.scrollY:S.scrollTop,E=P?0:S.getBoundingClientRect().top,R=P?a.top/o.innerHeight:(a.top-E)/(o.innerHeight-E);if(k===0&&RE+j||a.top{o.removeEventListener("scroll",l,!0),o.removeEventListener("resize",l,!0),t.removeEventListener("keydown",d),t.removeEventListener("keyup",u),t.removeEventListener("mousedown",p),t.removeEventListener("touchstart",p),n.removeEventListener("selectionchange",m),o.cancelAnimationFrame(r),o.cancelAnimationFrame(i)}},[e])}function mm(e={},t){switch(t.type){case"SET_IS_MATCHING":return t.values}return e}function hm(e){return{type:"SET_IS_MATCHING",values:e}}const gm=Object.freeze(Object.defineProperty({__proto__:null,setIsMatching:hm},Symbol.toStringTag,{value:"Module"}));function fm(e,t){return t.indexOf(" ")===-1&&(t=">= "+t),!!e[t]}const bm=Object.freeze(Object.defineProperty({__proto__:null,isViewportMatch:fm},Symbol.toStringTag,{value:"Module"})),xm="core/viewport",Ss=ci(xm,{reducer:mm,actions:gm,selectors:bm});di(Ss);const ym=(e,t)=>{const n=qt(()=>{const i=Object.fromEntries(r.map(([a,l])=>[a,l.matches]));oc(Ss).setIsMatching(i)},0,{leading:!0}),o=Object.entries(t),r=Object.entries(e).flatMap(([i,a])=>o.map(([l,d])=>{const u=window.matchMedia(`(${d}: ${a}px)`);return u.addEventListener("change",n),[`${l} ${i}`,u]}));window.addEventListener("orientationchange",n),n(),n.flush()},vm={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},_m={"<":"max-width",">=":"min-width"};ym(vm,_m);const ia=f.createContext({name:null,icon:null});ia.Provider;function Qt(){return f.useContext(ia)}rc((e,t)=>({icon:e,name:t}));function wm(e){return["checkbox","option","radio","switch","menuitemcheckbox","menuitemradio","treeitem"].includes(e)}function oo({as:e=B,scope:t,identifier:n,icon:o,selectedIcon:r,name:i,shortcut:a,...l}){const d=e,u=Qt(),p=o||u.icon,m=n||`${u.name}/${i}`,h=_(y=>y(ce).getActiveComplementaryArea(t)===m,[m,t]),{enableComplementaryArea:g,disableComplementaryArea:b}=T(ce);return s.jsx(d,{icon:r&&h?r:p,"aria-controls":m.replace("/",":"),"aria-checked":wm(l.role)?h:void 0,onClick:()=>{h?b(t):g(t,m)},shortcut:a,...l})}const Sm=({children:e,className:t,toggleButtonProps:n})=>{const o=s.jsx(oo,{icon:ui,...n});return s.jsxs("div",{className:z("components-panel__header","interface-complementary-area-header",t),tabIndex:-1,children:[e,o]})},sr=()=>{};function Cm({name:e,as:t=Ae,fillProps:n={},bubblesVirtually:o,...r}){return s.jsx(Un,{name:e,bubblesVirtually:o,fillProps:n,children:i=>{if(!f.Children.toArray(i).length)return null;const a=[];f.Children.forEach(i,({props:{__unstableExplicitMenuItem:d,__unstableTarget:u}})=>{u&&d&&a.push(u)});const l=f.Children.map(i,d=>!d.props.__unstableExplicitMenuItem&&a.includes(d.props.__unstableTarget)?null:d);return s.jsx(t,{...r,children:l})}})}function Xt({name:e,as:t=B,onClick:n,...o}){return s.jsx(zn,{name:e,children:({onClick:r})=>s.jsx(t,{onClick:n||r?(...i)=>{(n||sr)(...i),(r||sr)(...i)}:void 0,...o})})}Xt.Slot=Cm;const Pm=({__unstableExplicitMenuItem:e,__unstableTarget:t,...n})=>s.jsx(_e,{...n});function aa({scope:e,target:t,__unstableExplicitMenuItem:n,...o}){return s.jsx(oo,{as:r=>s.jsx(Xt,{__unstableExplicitMenuItem:n,__unstableTarget:`${e}/${t}`,as:Pm,name:`${e}/plugin-more-menu`,...r}),role:"menuitemcheckbox",selectedIcon:mt,name:t,scope:e,...o})}function qs({scope:e,...t}){return s.jsx(zn,{name:`PinnedItems/${e}`,...t})}function km({scope:e,className:t,...n}){return s.jsx(Un,{name:`PinnedItems/${e}`,...n,children:o=>o?.length>0&&s.jsx("div",{className:z(t,"interface-pinned-items"),children:o})})}qs.Slot=km;const jm=.3;function Tm({scope:e,...t}){return s.jsx(Un,{name:`ComplementaryArea/${e}`,...t})}const la=280,Em={open:{width:la},closed:{width:0},mobileOpen:{width:"100vw"}};function Nm({activeArea:e,isActive:t,scope:n,children:o,className:r,id:i}){const a=As(),l=ue("medium","<"),d=En(e),u=En(t),[,p]=f.useState({});f.useEffect(()=>{p({})},[t]);const m={type:"tween",duration:a||l||d&&e&&e!==d?0:jm,ease:[.6,0,.4,1]};return s.jsx(zn,{name:`ComplementaryArea/${n}`,children:s.jsx(wt,{initial:!1,children:(u||t)&&s.jsx(ve.div,{variants:Em,initial:"closed",animate:l?"mobileOpen":"open",exit:"closed",transition:m,className:"interface-complementary-area__fill",children:s.jsx("div",{id:i,className:r,style:{width:l?"100vw":la},children:o})})})})}function Am(e,t,n,o,r){const i=f.useRef(!1),a=f.useRef(!1),{enableComplementaryArea:l,disableComplementaryArea:d}=T(ce);f.useEffect(()=>{o&&r&&!i.current?(d(e),a.current=!0):a.current&&!r&&i.current?(a.current=!1,l(e,t)):a.current&&n&&n!==t&&(a.current=!1),r!==i.current&&(i.current=r)},[o,r,e,t,n,d,l])}function Zs({children:e,className:t,closeLabel:n=c("Close plugin"),identifier:o,header:r,headerClassName:i,icon:a,isPinnable:l=!0,panelClassName:d,scope:u,name:p,title:m,toggleShortcut:h,isActiveByDefault:g}){const b=Qt(),y=a||b.icon,v=o||`${b.name}/${p}`,[w,S]=f.useState(!1),{isLoading:P,isActive:k,isPinned:E,activeArea:R,isSmall:j,isLarge:N,showIconLabels:A}=_(K=>{const{getActiveComplementaryArea:pe,isComplementaryAreaLoading:J,isItemPinned:ae}=K(ce),{get:xe}=K(U),Pe=pe(u);return{isLoading:J(u),isActive:Pe===v,isPinned:ae(u,v),activeArea:Pe,isSmall:K(Ss).isViewportMatch("< medium"),isLarge:K(Ss).isViewportMatch("large"),showIconLabels:xe("core","showIconLabels")}},[v,u]),I=ue("medium","<");Am(u,v,R,k,j);const{enableComplementaryArea:D,disableComplementaryArea:O,pinItem:F,unpinItem:L}=T(ce);if(f.useEffect(()=>{g&&R===void 0&&!j?D(u,v):R===void 0&&j&&O(u,v),S(!0)},[R,g,u,v,j,D,O]),!!w)return s.jsxs(s.Fragment,{children:[l&&s.jsx(qs,{scope:u,children:E&&s.jsx(oo,{scope:u,identifier:v,isPressed:k&&(!A||N),"aria-expanded":k,"aria-disabled":P,label:m,icon:A?mt:y,showTooltip:!A,variant:A?"tertiary":void 0,size:"compact",shortcut:h})}),p&&l&&s.jsx(aa,{target:p,scope:u,icon:y,children:m}),s.jsxs(Nm,{activeArea:R,isActive:k,className:z("interface-complementary-area",t),scope:u,id:v.replace("/",":"),children:[s.jsx(Sm,{className:i,closeLabel:n,onClose:()=>O(u),toggleButtonProps:{label:n,size:"compact",shortcut:h,scope:u,identifier:v},children:r||s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"interface-complementary-area-header__title",children:m}),l&&!I&&s.jsx(B,{className:"interface-complementary-area__pin-unpin-item",icon:E?lu:au,label:E?c("Unpin from toolbar"):c("Pin to toolbar"),onClick:()=>(E?L:F)(u,v),isPressed:E,"aria-expanded":E,size:"compact"})]})}),s.jsx(wp,{className:d,children:e})]})]})}Zs.Slot=Tm;const Bm=({isActive:e})=>(f.useEffect(()=>{let t=!1;return document.body.classList.contains("sticky-menu")&&(t=!0,document.body.classList.remove("sticky-menu")),()=>{t&&document.body.classList.add("sticky-menu")}},[]),f.useEffect(()=>(e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{e&&document.body.classList.remove("is-fullscreen-mode")}),[e]),null),Qe=f.forwardRef(({children:e,className:t,ariaLabel:n,as:o="div",...r},i)=>s.jsx(o,{ref:i,className:z("interface-navigable-region",t),"aria-label":n,role:"region",tabIndex:"-1",...r,children:e}));Qe.displayName="NavigableRegion";const ca=.25,nr={type:"tween",duration:ca,ease:[.6,0,.4,1]};function Im(e){f.useEffect(()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}},[e])}const Rm={hidden:{opacity:1,marginTop:-60},visible:{opacity:1,marginTop:0},distractionFreeHover:{opacity:1,marginTop:0,transition:{...nr,delay:.2,delayChildren:.2}},distractionFreeHidden:{opacity:0,marginTop:-60},distractionFreeDisabled:{opacity:0,marginTop:0,transition:{...nr,delay:.8,delayChildren:.8}}};function Mm({isDistractionFree:e,footer:t,header:n,editorNotices:o,sidebar:r,secondarySidebar:i,content:a,actions:l,labels:d,className:u},p){const[m,h]=pi(),g=ue("medium","<"),y={type:"tween",duration:As()?0:ca,ease:[.6,0,.4,1]};Im("interface-interface-skeleton__html-container");const w={...{header:H("Header","header landmark area"),body:c("Content"),secondarySidebar:c("Block Library"),sidebar:H("Settings","settings landmark area"),actions:c("Publish"),footer:c("Footer")},...d};return s.jsxs("div",{ref:p,className:z(u,"interface-interface-skeleton",!!t&&"has-footer"),children:[s.jsxs("div",{className:"interface-interface-skeleton__editor",children:[s.jsx(wt,{initial:!1,children:!!n&&s.jsx(Qe,{as:ve.div,className:"interface-interface-skeleton__header","aria-label":w.header,initial:e&&!g?"distractionFreeHidden":"hidden",whileHover:e&&!g?"distractionFreeHover":"visible",animate:e&&!g?"distractionFreeDisabled":"visible",exit:e&&!g?"distractionFreeHidden":"hidden",variants:Rm,transition:y,children:n})}),e&&s.jsx("div",{className:"interface-interface-skeleton__header",children:o}),s.jsxs("div",{className:"interface-interface-skeleton__body",children:[s.jsx(wt,{initial:!1,children:!!i&&s.jsx(Qe,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:w.secondarySidebar,as:ve.div,initial:"closed",animate:"open",exit:"closed",variants:{open:{width:h.width},closed:{width:0}},transition:y,children:s.jsxs(ve.div,{style:{position:"absolute",width:g?"100vw":"fit-content",height:"100%",left:0},variants:{open:{x:0},closed:{x:"-100%"}},transition:y,children:[m,i]})})}),s.jsx(Qe,{className:"interface-interface-skeleton__content",ariaLabel:w.body,children:a}),!!r&&s.jsx(Qe,{className:"interface-interface-skeleton__sidebar",ariaLabel:w.sidebar,children:r}),!!l&&s.jsx(Qe,{className:"interface-interface-skeleton__actions",ariaLabel:w.actions,children:l})]})]}),!!t&&s.jsx(Qe,{className:"interface-interface-skeleton__footer",ariaLabel:w.footer,children:t})]})}const da=f.forwardRef(Mm),Lm=Object.freeze(Object.defineProperty({__proto__:null,ActionItem:Xt,ComplementaryArea:Zs,ComplementaryAreaMoreMenuItem:aa,FullscreenMode:Bm,InterfaceSkeleton:da,NavigableRegion:Qe,PinnedItems:qs,store:ce},Symbol.toStringTag,{value:"Module"}));class Dm extends f.Component{constructor(t){super(t),this.needsAutosave=!!(t.isDirty&&t.isAutosaveable)}componentDidMount(){this.props.disableIntervalChecks||this.setAutosaveTimer()}componentDidUpdate(t){if(this.props.disableIntervalChecks){this.props.editsReference!==t.editsReference&&this.props.autosave();return}if(this.props.interval!==t.interval&&(clearTimeout(this.timerId),this.setAutosaveTimer()),!this.props.isDirty){this.needsAutosave=!1;return}if(this.props.isAutosaving&&!t.isAutosaving){this.needsAutosave=!1;return}this.props.editsReference!==t.editsReference&&(this.needsAutosave=!0)}componentWillUnmount(){clearTimeout(this.timerId)}setAutosaveTimer(t=this.props.interval*1e3){this.timerId=setTimeout(()=>{this.autosaveTimerHandler()},t)}autosaveTimerHandler(){if(!this.props.isAutosaveable){this.setAutosaveTimer(1e3);return}this.needsAutosave&&(this.needsAutosave=!1,this.props.autosave()),this.setAutosaveTimer()}render(){return null}}const Fm=Ls([Bt((e,t)=>{const{getReferenceByDistinctEdits:n}=e(C),{isEditedPostDirty:o,isEditedPostAutosaveable:r,isAutosavingPost:i,getEditorSettings:a}=e(x),{interval:l=a().autosaveInterval}=t;return{editsReference:n(),isDirty:o(),isAutosaveable:r(),isAutosaving:i(),interval:l}}),Ds((e,t)=>({autosave(){const{autosave:n=e(x).autosave}=t;n()}}))])(Dm);function ua(e){const{isFrontPage:t,isPostsPage:n}=_(o=>{const{canUser:r,getEditedEntityRecord:i}=o(C),a=r("read",{kind:"root",name:"site"})?i("root","site"):void 0,l=parseInt(e,10);return{isFrontPage:a?.page_on_front===l,isPostsPage:a?.page_for_posts===l}});return t?c("Homepage"):n?c("Posts Page"):!1}const Om=ve(B);function $m(e){const{postId:t,postType:n,postTypeLabel:o,documentTitle:r,isNotFound:i,templateTitle:a,onNavigateToPreviousEntityRecord:l,isTemplatePreview:d}=_(S=>{var P;const{getCurrentPostType:k,getCurrentPostId:E,getEditorSettings:R,getRenderingMode:j}=S(x),{getEditedEntityRecord:N,getPostType:A,getCurrentTheme:I,isResolving:D}=S(C),O=k(),F=E(),L=N("postType",O,F),{default_template_types:K=[]}=(P=I())!==null&&P!==void 0?P:{},pe=Fs({templateTypes:K,template:L}),J=A(O)?.labels?.singular_name;return{postId:F,postType:O,postTypeLabel:J,documentTitle:L.title,isNotFound:!L&&!D("getEditedEntityRecord","postType",O,F),templateTitle:pe.title,onNavigateToPreviousEntityRecord:R().onNavigateToPreviousEntityRecord,isTemplatePreview:j()==="template-locked"}},[]),{open:u}=T(oi),p=As(),m=ac.includes(n),h=!!l,g=m?a:r,b=e.title||g,y=e.icon,v=ua(t),w=f.useRef(!1);return f.useEffect(()=>{w.current=!0},[]),s.jsxs("div",{className:z("editor-document-bar",{"has-back-button":h}),children:[s.jsx(wt,{children:h&&s.jsx(Om,{className:"editor-document-bar__back",icon:it()?Tn:ic,onClick:S=>{S.stopPropagation(),l()},size:"compact",initial:w.current?{opacity:0,transform:"translateX(15%)"}:!1,animate:{opacity:1,transform:"translateX(0%)"},exit:{opacity:0,transform:"translateX(15%)"},transition:p?{duration:0}:void 0,children:c("Back")})}),!m&&d&&s.jsx(zt,{icon:Wn,className:"editor-document-bar__icon-layout"}),i?s.jsx(me,{children:c("Document not found")}):s.jsxs(B,{className:"editor-document-bar__command",onClick:()=>u(),size:"compact",children:[s.jsxs(ve.div,{className:"editor-document-bar__title",initial:w.current?{opacity:0,transform:h?"translateX(15%)":"translateX(-15%)"}:!1,animate:{opacity:1,transform:"translateX(0%)"},transition:p?{duration:0}:void 0,children:[y&&s.jsx(zt,{icon:y}),s.jsxs(me,{size:"body",as:"h1",children:[s.jsx("span",{className:"editor-document-bar__post-title",children:b?xs(b):c("No title")}),v&&s.jsx("span",{className:"editor-document-bar__post-type-label",children:`· ${v}`}),o&&!e.title&&!v&&s.jsx("span",{className:"editor-document-bar__post-type-label",children:`· ${se(o)}`})]})]},h),s.jsx("span",{className:"editor-document-bar__shortcut",children:at.primary("k")})]})]})}const or=({children:e,isValid:t,isDisabled:n,level:o,href:r,onSelect:i})=>{function a(l){if(n){l.preventDefault();return}i()}return s.jsx("li",{className:z("document-outline__item",`is-${o.toLowerCase()}`,{"is-invalid":!t,"is-disabled":n}),children:s.jsxs("a",{href:r,className:"document-outline__button","aria-disabled":n,onClick:a,children:[s.jsx("span",{className:"document-outline__emdash","aria-hidden":"true"}),s.jsx("strong",{className:"document-outline__level",children:o}),s.jsx("span",{className:"document-outline__item-content",children:e})]})})},Vm=s.jsx("em",{children:c("(Empty heading)")}),Hm=[s.jsx("br",{},"incorrect-break"),s.jsx("em",{children:c("(Incorrect heading level)")},"incorrect-message")],zm=[s.jsx("br",{},"incorrect-break-h1"),s.jsx("em",{children:c("(Your theme may already use a H1 for the post title)")},"incorrect-message-h1")],Um=[s.jsx("br",{},"incorrect-break-multiple-h1"),s.jsx("em",{children:c("(Multiple H1 headings are not recommended)")},"incorrect-message-multiple-h1")];function Wm(){return s.jsxs(X,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx(Dt,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),s.jsx(as,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),s.jsx(Dt,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),s.jsx(W,{d:"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z",fill:"black"}),s.jsx(as,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),s.jsx(Dt,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),s.jsx(W,{d:"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z",fill:"black"}),s.jsx(as,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),s.jsx(Dt,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),s.jsx(W,{d:"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z",fill:"black"}),s.jsx(as,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),s.jsx(Dt,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),s.jsx(W,{d:"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z",fill:"black"})]})}const Gm=(e=[])=>e.filter(t=>t.name==="core/heading").map(t=>({...t,level:t.attributes.level,isEmpty:Ym(t)})),Ym=e=>!e.attributes.content||e.attributes.content.trim().length===0;function qm({onSelect:e,hasOutlineItemsDisabled:t}){const{selectBlock:n}=T(M),{title:o,isTitleSupported:r}=_(b=>{var y;const{getEditedPostAttribute:v}=b(x),{getPostType:w}=b(C),S=w(v("type"));return{title:v("title"),isTitleSupported:(y=S?.supports?.title)!==null&&y!==void 0?y:!1}}),i=_(b=>{const{getClientIdsWithDescendants:y,getBlock:v}=b(M);return y().map(S=>v(S))}),a=_(b=>{if(b(x).getRenderingMode()==="post-only")return;const{getBlocksByName:y,getClientIdsOfDescendants:v}=b(M),[w]=y("core/post-content");if(w)return v(w)},[]),l=f.useRef(1),d=f.useMemo(()=>Gm(i),[i]);if(d.length<1)return s.jsxs("div",{className:"editor-document-outline has-no-headings",children:[s.jsx(Wm,{}),s.jsx("p",{children:c("Navigate the structure of your document and address issues like empty or incorrect heading levels.")})]});const u=document.querySelector(".editor-post-title__input"),p=r&&o&&u,h=d.reduce((b,y)=>({...b,[y.level]:(b[y.level]||0)+1}),{})[1]>1;function g(b){return Array.isArray(a)?a.includes(b):!0}return s.jsx("div",{className:"document-outline",children:s.jsxs("ul",{children:[p&&s.jsx(or,{level:c("Title"),isValid:!0,onSelect:e,href:`#${u.id}`,isDisabled:t,children:o}),d.map(b=>{const y=b.level>l.current+1,v=!b.isEmpty&&!y&&!!b.level&&(b.level!==1||!h&&!p);return l.current=b.level,s.jsxs(or,{level:`H${b.level}`,isValid:v,isDisabled:t||!g(b.clientId),href:`#block-${b.clientId}`,onSelect:()=>{n(b.clientId),e?.()},children:[b.isEmpty?Vm:mi(Os({html:b.attributes.content})),y&&Hm,b.level===1&&h&&Um,p&&b.level===1&&!h&&zm]},b.clientId)})]})})}function Zm(e,t){const n=hi()?at.primaryShift("z"):at.primary("y"),o=_(i=>i(x).hasEditorRedo(),[]),{redo:r}=T(x);return s.jsx(B,{__next40pxDefaultSize:!0,...e,ref:t,icon:it()?Ui:Hi,label:c("Redo"),shortcut:n,"aria-disabled":!o,onClick:o?r:void 0,className:"editor-history__redo"})}const Km=f.forwardRef(Zm);function Qm(e,t){const n=_(r=>r(x).hasEditorUndo(),[]),{undo:o}=T(x);return s.jsx(B,{__next40pxDefaultSize:!0,...e,ref:t,icon:it()?Hi:Ui,label:c("Undo"),shortcut:at.primary("z"),"aria-disabled":!n,onClick:n?o:void 0,className:"editor-history__undo"})}const Xm=f.forwardRef(Qm);function Jm(){const[e,t]=f.useState(!1),n=_(i=>i(M).isValidTemplate(),[]),{setTemplateValidity:o,synchronizeTemplate:r}=T(M);return n?null:s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:c("Keep it as is"),onClick:()=>o(!0)},{label:c("Reset the template"),onClick:()=>t(!0)}],children:c("The content of your post doesn’t match the template assigned to your post type.")}),s.jsx(Ut,{isOpen:e,confirmButtonText:c("Reset"),onConfirm:()=>{t(!1),r()},onCancel:()=>t(!1),size:"medium",children:c("Resetting the template may result in loss of content, do you want to continue?")})]})}function rr(){const{notices:e}=_(r=>({notices:r(fe).getNotices()}),[]),{removeNotice:t}=T(fe),n=e.filter(({isDismissible:r,type:i})=>r&&i==="default"),o=e.filter(({isDismissible:r,type:i})=>!r&&i==="default");return s.jsxs(s.Fragment,{children:[s.jsx(Nn,{notices:o,className:"components-editor-notices__pinned"}),s.jsx(Nn,{notices:n,className:"components-editor-notices__dismissible",onRemove:t,children:s.jsx(Jm,{})})]})}const eh=-3;function th(){const e=_(o=>o(fe).getNotices(),[]),{removeNotice:t}=T(fe),n=e.filter(({type:o})=>o==="snackbar").slice(eh);return s.jsx(Ep,{notices:n,className:"components-editor-notices__snackbar",onRemove:t})}function sh({record:e,checked:t,onChange:n}){const{name:o,kind:r,title:i,key:a}=e,{entityRecordTitle:l,hasPostMetaChanges:d}=_(u=>{var p;if(r!=="postType"||o!=="wp_template")return{entityRecordTitle:i,hasPostMetaChanges:$(u(x)).hasPostMetaChanges(o,a)};const m=u(C).getEditedEntityRecord(r,o,a),{default_template_types:h=[]}=(p=u(C).getCurrentTheme())!==null&&p!==void 0?p:{};return{entityRecordTitle:Fs({template:m,templateTypes:h}).title,hasPostMetaChanges:$(u(x)).hasPostMetaChanges(o,a)}},[o,r,i,a]);return s.jsxs(s.Fragment,{children:[s.jsx(Ys,{children:s.jsx(It,{__nextHasNoMarginBottom:!0,label:se(l)||c("Untitled"),checked:t,onChange:n,className:"entities-saved-states__change-control"})}),d&&s.jsx("ul",{className:"entities-saved-states__changes",children:s.jsx("li",{children:c("Post Meta.")})})]})}const{getGlobalStylesChanges:nh,GlobalStylesContext:oh}=$(Se);function rh(e,t){switch(e){case"site":return t===1?c("This change will affect your whole site."):c("These changes will affect your whole site.");case"wp_template":return c("This change will affect other parts of your site that use this template.");case"page":case"post":return c("The following has been modified.")}}function ih({record:e}){const{user:t}=f.useContext(oh),n=_(r=>r(C).getEntityRecord(e.kind,e.name,e.key),[e.kind,e.name,e.key]),o=nh(t,n,{maxResults:10});return o.length?s.jsx("ul",{className:"entities-saved-states__changes",children:o.map(r=>s.jsx("li",{children:r},r))}):null}function ah({record:e,count:t}){if(e?.name==="globalStyles")return null;const n=rh(e?.name,t);return n?s.jsx(Ys,{children:n}):null}function lh({list:e,unselectedEntities:t,setUnselectedEntities:n}){const o=e.length,r=e[0];let a=_(l=>l(C).getEntityConfig(r.kind,r.name),[r.kind,r.name]).label;return r?.name==="wp_template_part"&&(a=o===1?c("Template Part"):c("Template Parts")),s.jsxs(oe,{title:a,initialOpen:!0,className:"entities-saved-states__panel-body",children:[s.jsx(ah,{record:r,count:o}),e.map(l=>s.jsx(sh,{record:l,checked:!t.some(d=>d.kind===l.kind&&d.name===l.name&&d.key===l.key&&d.property===l.property),onChange:d=>n(l,d)},l.key||l.property)),r?.name==="globalStyles"&&s.jsx(ih,{record:r})]})}const ch=()=>{const{editedEntities:e,siteEdits:t,siteEntityConfig:n}=_(d=>{const{__experimentalGetDirtyEntityRecords:u,getEntityRecordEdits:p,getEntityConfig:m}=d(C);return{editedEntities:u(),siteEdits:p("root","site"),siteEntityConfig:m("root","site")}},[]),o=f.useMemo(()=>{var d;const u=e.filter(h=>!(h.kind==="root"&&h.name==="site")),p=(d=n?.meta?.labels)!==null&&d!==void 0?d:{},m=[];for(const h in t)m.push({kind:"root",name:"site",title:p[h]||h,property:h});return[...u,...m]},[e,t,n]),[r,i]=f.useState([]),a=({kind:d,name:u,key:p,property:m},h)=>{i(h?r.filter(g=>g.kind!==d||g.name!==u||g.key!==p||g.property!==m):[...r,{kind:d,name:u,key:p,property:m}])},l=o.length-r.length>0;return{dirtyEntityRecords:o,isDirty:l,setUnselectedEntities:a,unselectedEntities:r}};function dh(e){return e}function uh({close:e,renderDialog:t,variant:n}){const o=ch();return s.jsx(Cs,{close:e,renderDialog:t,variant:n,...o})}function Cs({additionalPrompt:e=void 0,close:t,onSave:n=dh,saveEnabled:o=void 0,saveLabel:r=c("Save"),renderDialog:i,dirtyEntityRecords:a,isDirty:l,setUnselectedEntities:d,unselectedEntities:u,variant:p="default"}){const m=f.useRef(),{saveDirtyEntities:h}=$(T(x)),g=a.reduce((O,F)=>{const{name:L}=F;return O[L]||(O[L]=[]),O[L].push(F),O},{}),{site:b,wp_template:y,wp_template_part:v,...w}=g,S=[b,y,v,...Object.values(w)].filter(Array.isArray),P=o??l,k=f.useCallback(()=>t(),[t]),[E,R]=lc({onClose:()=>k()}),j=lt(Cs,"entities-saved-states__panel-label"),N=lt(Cs,"entities-saved-states__panel-description"),A=a.length?c("Select the items you want to save."):void 0,I=p==="inline",D=s.jsxs(s.Fragment,{children:[s.jsx(St,{isBlock:!I,as:B,variant:I?"tertiary":"secondary",size:I?void 0:"compact",onClick:k,children:c("Cancel")}),s.jsx(St,{isBlock:!I,as:B,ref:m,variant:"primary",size:I?void 0:"compact",disabled:!P,accessibleWhenDisabled:!0,onClick:()=>h({onSave:n,dirtyEntityRecords:a,entitiesToSkip:u,close:t}),className:"editor-entities-saved-states__save-button",children:r})]});return s.jsxs("div",{ref:i?E:void 0,...i&&R,className:z("entities-saved-states__panel",{"is-inline":I}),role:i?"dialog":void 0,"aria-labelledby":i?j:void 0,"aria-describedby":i?N:void 0,children:[!I&&s.jsx(Vt,{className:"entities-saved-states__panel-header",gap:2,children:D}),s.jsxs("div",{className:"entities-saved-states__text-prompt",children:[s.jsx("div",{className:"entities-saved-states__text-prompt--header-wrapper",children:s.jsx("strong",{id:i?j:void 0,className:"entities-saved-states__text-prompt--header",children:c("Are you ready to save?")})}),s.jsxs("div",{id:i?N:void 0,children:[e,s.jsx("p",{className:"entities-saved-states__text-prompt--changes-count",children:l?ct(V(Ct("There is %d site change waiting to be saved.","There are %d site changes waiting to be saved.",a.length),a.length),{strong:s.jsx("strong",{})}):A})]})]}),S.map(O=>s.jsx(lh,{list:O,unselectedEntities:u,setUnselectedEntities:d},O[0].name)),I&&s.jsx(Vt,{direction:"row",justify:"flex-end",className:"entities-saved-states__panel-footer",children:D})]})}function ph(){try{return dc(x).getEditedPostContent()}catch{}}function ir({text:e,children:t,variant:n="secondary"}){const o=$s(e);return s.jsx(B,{__next40pxDefaultSize:!0,variant:n,ref:o,children:t})}class mh extends f.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(t){cc("editor.ErrorBoundary.errorLogged",t)}static getDerivedStateFromError(t){return{error:t}}render(){const{error:t}=this.state,{canCopyContent:n=!1}=this.props;return t?s.jsxs(le,{className:"editor-error-boundary",alignment:"baseline",spacing:4,justify:"space-between",expanded:!1,wrap:!0,children:[s.jsx(me,{as:"p",children:c("The editor has encountered an unexpected error.")}),s.jsxs(le,{expanded:!1,children:[n&&s.jsx(ir,{text:ph,children:c("Copy contents")}),s.jsx(ir,{variant:"primary",text:t?.stack,children:c("Copy error")})]})]}):this.props.children}}function pa({children:e}){return _(n=>{const{getEditedPostAttribute:o}=n(x),{getPostType:r}=n(C);return!!r(o("type"))?.supports?.["page-attributes"]},[])?e:null}function $e({children:e,supportKeys:t}){const n=_(r=>{const{getEditedPostAttribute:i}=r(x),{getPostType:a}=r(C);return a(i("type"))},[]);let o=!!n;return n&&(o=(Array.isArray(t)?t:[t]).some(r=>!!n.supports[r])),o?e:null}const Ce=f.forwardRef(({className:e,label:t,children:n},o)=>s.jsxs(le,{className:z("editor-post-panel__row",e),ref:o,children:[t&&s.jsx("div",{className:"editor-post-panel__row-label",children:t}),s.jsx("div",{className:"editor-post-panel__row-control",children:n})]}));function ma(e){const t=e.map(r=>({children:[],parent:void 0,...r}));if(t.some(({parent:r})=>r===void 0))return t;const n=t.reduce((r,i)=>{const{parent:a}=i;return r[a]||(r[a]=[]),r[a].push(i),r},{}),o=r=>r.map(i=>{const a=n[i.id];return{...i,children:a&&a.length?o(a):[]}});return o(n[0]||[])}const Gt=e=>se(e),ha=e=>({...e,name:Gt(e.name)}),hh=e=>(e??[]).map(ha);function Bn(e){return e?.title?.rendered?se(e.title.rendered):`#${e.id} (${c("no title")})`}const ar=(e,t)=>{const n=Lo(e||"").toLowerCase(),o=Lo(t||"").toLowerCase();return n===o?0:n.startsWith(o)?n.length:1/0};function gh(){const{editPost:e}=T(x),[t,n]=f.useState(!1),{isHierarchical:o,parentPostId:r,parentPostTitle:i,pageItems:a,isLoading:l}=_(m=>{var h;const{getPostType:g,getEntityRecords:b,getEntityRecord:y,isResolving:v}=m(C),{getCurrentPostId:w,getEditedPostAttribute:S}=m(x),P=S("type"),k=S("parent"),E=g(P),R=w(),j=(h=E?.hierarchical)!==null&&h!==void 0?h:!1,N={per_page:100,exclude:R,parent_exclude:R,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};t&&(N.search=t);const A=k?y("postType",P,k):null;return{isHierarchical:j,parentPostId:k,parentPostTitle:A?Bn(A):"",pageItems:j?b("postType",P,N):null,isLoading:j?v("getEntityRecords",["postType",P,N]):!1}},[t]),d=f.useMemo(()=>{const m=(y,v=0)=>y.map(P=>[{value:P.id,label:"— ".repeat(v)+se(P.name),rawName:P.name},...m(P.children||[],v+1)]).sort(([P],[k])=>{const E=ar(P.rawName,t),R=ar(k.rawName,t);return E>=R?1:-1}).flat();if(!a)return[];let h=a.map(y=>({id:y.id,parent:y.parent,name:Bn(y)}));t||(h=ma(h));const g=m(h),b=g.find(y=>y.value===r);return i&&!b&&g.unshift({value:r,label:i}),g},[a,t,i,r]);if(!o)return null;const u=m=>{n(m)},p=m=>{e({parent:m})};return s.jsx(fi,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:c("Parent"),help:c("Choose a parent page."),value:r,options:d,onFilterValueChange:qt(u,300),onChange:p,hideLabelFromVision:!0,isLoading:l})}function fh({isOpen:e,onClick:t}){const n=_(r=>{const{getEditedPostAttribute:i}=r(x),a=i("parent");if(!a)return null;const{getEntityRecord:l}=r(C),d=i("type");return l("postType",d,a)},[]),o=f.useMemo(()=>n?Bn(n):c("None"),[n]);return s.jsx(B,{size:"compact",className:"editor-post-parent__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":V(c("Change parent: %s"),o),onClick:t,children:o})}function bh(){const e=_(r=>r(C).getEntityRecord("root","__unstableBase")?.home,[]),[t,n]=f.useState(null),o=f.useMemo(()=>({anchor:t,placement:"left-start",offset:36,shift:!0}),[t]);return s.jsx(Ce,{label:c("Parent"),ref:n,children:s.jsx(je,{popoverProps:o,className:"editor-post-parent__panel-dropdown",contentClassName:"editor-post-parent__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:r,onToggle:i})=>s.jsx(fh,{isOpen:r,onClick:i}),renderContent:({onClose:r})=>s.jsxs("div",{className:"editor-post-parent",children:[s.jsx(Ie,{title:c("Parent"),onClose:r}),s.jsxs("div",{children:[ct(V(c('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %s/services/pricing.'),gi(e).replace(/([/.])/g,"$1")),{wbr:s.jsx("wbr",{})}),s.jsx("p",{children:ct(c("They also show up as sub-items in the default navigation menu. Learn more."),{a:s.jsx(Xe,{href:c("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes")})})})]}),s.jsx(gh,{})]})})})}const xh="page-attributes";function yh(){const{isEnabled:e,postType:t}=_(n=>{const{getEditedPostAttribute:o,isEditorPanelEnabled:r}=n(x),{getPostType:i}=n(C);return{isEnabled:r(xh),postType:i(o("type"))}},[]);return!e||!t?null:s.jsx(bh,{})}function vh(){return s.jsx(pa,{children:s.jsx(yh,{})})}const ln=c("Custom Template");function ga({onClose:e}){const{defaultBlockTemplate:t,onNavigateToEntityRecord:n}=_(p=>{const{getEditorSettings:m,getCurrentTemplateId:h}=p(x);return{defaultBlockTemplate:m().defaultBlockTemplate,onNavigateToEntityRecord:m().onNavigateToEntityRecord,getTemplateId:h}}),{createTemplate:o}=$(T(x)),[r,i]=f.useState(""),[a,l]=f.useState(!1),d=()=>{i(""),e()},u=async p=>{if(p.preventDefault(),a)return;l(!0);const m=t??Gn([Ne("core/group",{tagName:"header",layout:{inherit:!0}},[Ne("core/site-title"),Ne("core/site-tagline")]),Ne("core/separator"),Ne("core/group",{tagName:"main"},[Ne("core/group",{layout:{inherit:!0}},[Ne("core/post-title")]),Ne("core/post-content",{layout:{inherit:!0}})])]),h=await o({slug:uc(r||ln)||"wp-custom-template",content:m,title:r||ln});l(!1),n({postId:h.id,postType:"wp_template"}),d()};return s.jsx(Bs,{title:c("Create custom template"),onRequestClose:d,focusOnMount:"firstContentElement",size:"small",overlayClassName:"editor-post-template__create-template-modal",children:s.jsx("form",{className:"editor-post-template__create-form",onSubmit:u,children:s.jsxs(G,{spacing:"3",children:[s.jsx(Rt,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:c("Name"),value:r,onChange:i,placeholder:ln,disabled:a,help:c('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),s.jsxs(le,{justify:"right",children:[s.jsx(B,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:d,children:c("Cancel")}),s.jsx(B,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",isBusy:a,"aria-disabled":a,children:c("Create")})]})]})})})}function Ks(){return _(e=>{const{getCurrentPostId:t,getCurrentPostType:n}=e(x);return{postId:t(),postType:n()}},[])}function Qs(){const{postType:e,postId:t}=Ks();return _(n=>{const{canUser:o,getEntityRecord:r,getEntityRecords:i}=n(C),a=o("read",{kind:"root",name:"site"})?r("root","site"):void 0,l=+t===a?.page_for_posts,d=e==="page"&&+t===a?.page_on_front,u=d?i("postType","wp_template",{per_page:-1}):[],p=d&&!!u?.some(({slug:m})=>m==="front-page");return!l&&!p},[t,e])}function fa(e){return _(t=>t(C).getEntityRecords("postType","wp_template",{per_page:-1,post_type:e}),[e])}function ba(e){const t=xa(),n=Qs(),o=fa(e);return f.useMemo(()=>n&&o?.filter(r=>r.is_custom&&r.slug!==t&&!!r.content.raw),[o,t,n])}function xa(){const{postType:e,postId:t}=Ks(),n=fa(e),o=_(r=>r(C).getEditedEntityRecord("postType",e,t)?.template,[e,t]);if(o)return n?.find(r=>r.slug===o)?.slug}function _h({isOpen:e,onClick:t}){const n=_(o=>{const r=o(x).getEditedPostAttribute("template"),{supportsTemplateMode:i,availableTemplates:a}=o(x).getEditorSettings();if(!i&&a[r])return a[r];const l=o(C).canUser("create",{kind:"postType",name:"wp_template"})&&o(x).getCurrentTemplateId();return l?.title||l?.slug||a?.[r]},[]);return s.jsx(B,{__next40pxDefaultSize:!0,variant:"tertiary","aria-expanded":e,"aria-label":c("Template options"),onClick:t,children:n??c("Default template")})}function wh({onClose:e}){var t,n;const o=Qs(),{availableTemplates:r,fetchedTemplates:i,selectedTemplateSlug:a,canCreate:l,canEdit:d,currentTemplateId:u,onNavigateToEntityRecord:p,getEditorSettings:m}=_(S=>{const{canUser:P,getEntityRecords:k}=S(C),E=S(x).getEditorSettings(),R=P("create",{kind:"postType",name:"wp_template"}),j=S(x).getCurrentTemplateId();return{availableTemplates:E.availableTemplates,fetchedTemplates:R?k("postType","wp_template",{post_type:S(x).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:S(x).getEditedPostAttribute("template"),canCreate:o&&R&&E.supportsTemplateMode,canEdit:o&&R&&E.supportsTemplateMode&&!!j,currentTemplateId:j,onNavigateToEntityRecord:E.onNavigateToEntityRecord,getEditorSettings:S(x).getEditorSettings}},[o]),h=f.useMemo(()=>Object.entries({...r,...Object.fromEntries((i??[]).map(({slug:S,title:P})=>[S,P.rendered]))}).map(([S,P])=>({value:S,label:P})),[r,i]),g=(t=h.find(S=>S.value===a))!==null&&t!==void 0?t:h.find(S=>!S.value),{editPost:b}=T(x),{createSuccessNotice:y}=T(fe),[v,w]=f.useState(!1);return s.jsxs("div",{className:"editor-post-template__classic-theme-dropdown",children:[s.jsx(Ie,{title:c("Template"),help:c("Templates define the way content is displayed when viewing your site."),actions:l?[{icon:Jd,label:c("Add template"),onClick:()=>w(!0)}]:[],onClose:e}),o?s.jsx(Yn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:c("Template"),value:(n=g?.value)!==null&&n!==void 0?n:"",options:h,onChange:S=>b({template:S||""})}):s.jsx(Et,{status:"warning",isDismissible:!1,children:c("The posts page template cannot be changed.")}),d&&p&&s.jsx("p",{children:s.jsx(B,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>{p({postId:u,postType:"wp_template"}),e(),y(c("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:[{label:c("Go back"),onClick:()=>m().onNavigateToPreviousEntityRecord()}]})},children:c("Edit template")})}),v&&s.jsx(ga,{onClose:()=>w(!1)})]})}function Sh(){const[e,t]=f.useState(null),n=f.useMemo(()=>({anchor:e,className:"editor-post-template__dropdown",placement:"left-start",offset:36,shift:!0}),[e]);return s.jsx(Ce,{label:c("Template"),ref:t,children:s.jsx(je,{popoverProps:n,focusOnMount:!0,renderToggle:({isOpen:o,onToggle:r})=>s.jsx(_h,{isOpen:o,onClick:r}),renderContent:({onClose:o})=>s.jsx(wh,{onClose:o})})})}const{PreferenceBaseOption:Ch}=$(tt);function bt(e){const{toggleEditorPanelEnabled:t}=T(x),{isChecked:n,isRemoved:o}=_(r=>{const{isEditorPanelEnabled:i,isEditorPanelRemoved:a}=r(x);return{isChecked:i(e.panelName),isRemoved:a(e.panelName)}},[e.panelName]);return o?null:s.jsx(Ch,{isChecked:n,onChange:()=>t(e.panelName),...e})}const{Fill:Ph,Slot:kh}=Le("EnablePluginDocumentSettingPanelOption"),ro=({label:e,panelName:t})=>s.jsx(Ph,{children:s.jsx(bt,{label:e,panelName:t})});ro.Slot=kh;const{Fill:jh,Slot:Th}=Le("PluginDocumentSettingPanel"),ya=({name:e,className:t,title:n,icon:o,children:r})=>{const{name:i}=Qt(),a=`${i}/${e}`,{opened:l,isEnabled:d}=_(p=>{const{isEditorPanelOpened:m,isEditorPanelEnabled:h}=p(x);return{opened:m(a),isEnabled:h(a)}},[a]),{toggleEditorPanelOpened:u}=T(x);return e===void 0&&globalThis.SCRIPT_DEBUG===!0&&ei("PluginDocumentSettingPanel requires a name property."),s.jsxs(s.Fragment,{children:[s.jsx(ro,{label:n,panelName:a}),s.jsx(jh,{children:d&&s.jsx(oe,{className:t,title:n,icon:o,opened:l,onToggle:()=>u(a),children:r})})]})};ya.Slot=Th;const{Fill:Eh,Slot:Nh}=Le("PluginPostPublishPanel"),va=({children:e,className:t,title:n,initialOpen:o=!1,icon:r})=>{const{icon:i}=Qt();return s.jsx(Eh,{children:s.jsx(oe,{className:t,initialOpen:o||!n,title:n,icon:r??i,children:e})})};va.Slot=Nh;const{Fill:Ah,Slot:Bh}=Le("PluginPostStatusInfo"),_a=({children:e,className:t})=>s.jsx(Ah,{children:s.jsx(Ys,{className:t,children:e})});_a.Slot=Bh;const{Fill:Ih,Slot:Rh}=Le("PluginPrePublishPanel"),wa=({children:e,className:t,title:n,initialOpen:o=!1,icon:r})=>{const{icon:i}=Qt();return s.jsx(Ih,{children:s.jsx(oe,{className:t,initialOpen:o||!n,title:n,icon:r??i,children:e})})};wa.Slot=Rh;function In({className:e,...t}){return s.jsx(Zs,{panelClassName:e,className:"editor-sidebar",scope:"core",...t})}function Mh({onClick:e}){const[t,n]=f.useState(!1),{postType:o,postId:r}=Ks(),i=ba(o),{editEntityRecord:a}=T(C),l=async d=>{a("postType",o,r,{template:d.name},{undoIgnore:!0}),n(!1),e()};return s.jsxs(s.Fragment,{children:[s.jsx(_e,{disabled:!i?.length,accessibleWhenDisabled:!0,onClick:()=>n(!0),children:c("Change template")}),t&&s.jsx(Bs,{title:c("Choose a template"),onRequestClose:()=>n(!1),overlayClassName:"editor-post-template__swap-template-modal",isFullScreen:!0,children:s.jsx("div",{className:"editor-post-template__swap-template-modal-content",children:s.jsx(Lh,{postType:o,onSelect:l})})})]})}function Lh({postType:e,onSelect:t}){const n=ba(e),o=f.useMemo(()=>n.map(r=>({name:r.slug,blocks:Wt(r.content.raw),title:se(r.title.rendered),id:r.id})),[n]);return s.jsx(bi,{label:c("Templates"),blockPatterns:o,onClickPattern:t})}function Dh({onClick:e}){const t=xa(),n=Qs(),{postType:o,postId:r}=Ks(),{editEntityRecord:i}=T(C);return!t||!n?null:s.jsx(_e,{onClick:()=>{i("postType",o,r,{template:""},{undoIgnore:!0}),e()},children:c("Use default template")})}function Fh(){const{canCreateTemplates:e}=_(r=>{const{canUser:i}=r(C);return{canCreateTemplates:i("create",{kind:"postType",name:"wp_template"})}},[]),[t,n]=f.useState(!1),o=Qs();return!e||!o?null:s.jsxs(s.Fragment,{children:[s.jsx(_e,{onClick:()=>{n(!0)},children:c("Create new template")}),t&&s.jsx(ga,{onClose:()=>{n(!1)}})]})}function Oh({id:e}){const{isTemplateHidden:t,onNavigateToEntityRecord:n,getEditorSettings:o,hasGoBack:r}=_(w=>{const{getRenderingMode:S,getEditorSettings:P}=$(w(x)),k=P();return{isTemplateHidden:S()==="post-only",onNavigateToEntityRecord:k.onNavigateToEntityRecord,getEditorSettings:P,hasGoBack:k.hasOwnProperty("onNavigateToPreviousEntityRecord")}},[]),{get:i}=_(U),{editedRecord:a,hasResolved:l}=pc("postType","wp_template",e),{createSuccessNotice:d}=T(fe),{setRenderingMode:u,setDefaultRenderingMode:p}=$(T(x)),m=_(w=>!!w(C).canUser("create",{kind:"postType",name:"wp_template"}),[]),[h,g]=f.useState(null),b=f.useMemo(()=>({anchor:h,className:"editor-post-template__dropdown",placement:"left-start",offset:36,shift:!0}),[h]);if(!l)return null;const y=r?[{label:c("Go back"),onClick:()=>o().onNavigateToPreviousEntityRecord()}]:void 0,v=()=>{i("core/edit-site","welcomeGuideTemplate")||d(c("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:y})};return s.jsx(Ce,{label:c("Template"),ref:g,children:s.jsx(Zt,{popoverProps:b,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},label:c("Template options"),text:se(a.title),icon:null,children:({onClose:w})=>s.jsxs(s.Fragment,{children:[s.jsxs(Ae,{children:[m&&s.jsx(_e,{onClick:()=>{n({postId:a.id,postType:"wp_template"}),w(),v()},children:c("Edit template")}),s.jsx(Mh,{onClick:w}),s.jsx(Dh,{onClick:w}),m&&s.jsx(Fh,{})]}),s.jsx(Ae,{children:s.jsx(_e,{icon:t?void 0:mt,isSelected:!t,role:"menuitemcheckbox",onClick:()=>{const S=t?"template-locked":"post-only";u(S),p(S)},children:c("Show template")})})]})})})}function $h(){const{templateId:e,isBlockTheme:t}=_(r=>{const{getCurrentTemplateId:i,getEditorSettings:a}=r(x);return{templateId:i(),isBlockTheme:a().__unstableIsBlockBasedTheme}},[]),n=_(r=>{var i;const a=r(x).getCurrentPostType();if(!r(C).getPostType(a)?.viewable)return!1;const d=r(x).getEditorSettings();return!!d.availableTemplates&&Object.keys(d.availableTemplates).length>0?!0:d.supportsTemplateMode&&(i=r(C).canUser("create",{kind:"postType",name:"wp_template"}))!==null&&i!==void 0?i:!1},[]),o=_(r=>{var i;return(i=r(C).canUser("read",{kind:"postType",name:"wp_template"}))!==null&&i!==void 0?i:!1},[]);return(!t||!o)&&n?s.jsx(Sh,{}):t&&e?s.jsx(Oh,{id:e}):null}const Sa={_fields:"id,name",context:"view"},io={who:"authors",per_page:100,...Sa};function ao(e){const{authorId:t,authors:n,postAuthor:o,isLoading:r}=_(a=>{const{getUser:l,getUsers:d,isResolving:u}=a(C),{getEditedPostAttribute:p}=a(x),m=p("author"),h={...io};return e&&(h.search=e,h.search_columns=["name"]),{authorId:m,authors:d(h),postAuthor:l(m,Sa),isLoading:u("getUsers",[h])}},[e]),i=f.useMemo(()=>{const a=(n??[]).map(u=>({value:u.id,label:se(u.name)})),l=a.findIndex(({value:u})=>o?.id===u);let d=[];return l<0&&o?d=[{value:o.id,label:se(o.name)}]:l<0&&!o&&(d=[{value:0,label:c("(No author)")}]),[...d,...a]},[n,o]);return{authorId:t,authorOptions:i,postAuthor:o,isLoading:r}}function Vh(){const[e,t]=f.useState(),{editPost:n}=T(x),{authorId:o,authorOptions:r,isLoading:i}=ao(e),a=d=>{d&&n({author:d})},l=d=>{t(d)};return s.jsx(fi,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:c("Author"),options:r,value:o,onFilterValueChange:qt(l,300),onChange:a,allowReset:!1,hideLabelFromVision:!0,isLoading:i})}function Hh(){const{editPost:e}=T(x),{authorId:t,authorOptions:n}=ao(),o=r=>{const i=Number(r);e({author:i})};return s.jsx(Yn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-author-selector",label:c("Author"),options:n,onChange:o,value:t,hideLabelFromVision:!0})}const zh=25;function Uh(){return _(t=>t(C).getUsers(io)?.length>=zh,[])?s.jsx(Vh,{}):s.jsx(Hh,{})}function Wh({children:e}){const{hasAssignAuthorAction:t,hasAuthors:n}=_(o=>{const i=!!o(x).getCurrentPost()?._links?.["wp:action-assign-author"];return{hasAssignAuthorAction:i,hasAuthors:i?o(C).getUsers(io)?.length>=1:!1}},[]);return!t||!n?null:s.jsx($e,{supportKeys:"author",children:e})}function Gh({isOpen:e,onClick:t}){const{postAuthor:n}=ao(),o=se(n?.name)||c("(No author)");return s.jsx(B,{size:"compact",className:"editor-post-author__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":V(c("Change author: %s"),o),onClick:t,children:o})}function Yh(){const[e,t]=f.useState(null),n=f.useMemo(()=>({anchor:e,placement:"left-start",offset:36,shift:!0}),[e]);return s.jsx(Wh,{children:s.jsx(Ce,{label:c("Author"),ref:t,children:s.jsx(je,{popoverProps:n,contentClassName:"editor-post-author__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:o,onToggle:r})=>s.jsx(Gh,{isOpen:o,onClick:r}),renderContent:({onClose:o})=>s.jsxs("div",{className:"editor-post-author",children:[s.jsx(Ie,{title:c("Author"),onClose:o}),s.jsx(Uh,{onClose:o})]})})})})}const qh=[{label:H("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:c("Visitors can add new comments and replies.")},{label:c("Closed"),value:"closed",description:[c("Visitors cannot add new comments or replies."),c("Existing comments remain visible.")].join(" ")}];function Zh(){const e=_(o=>{var r;return(r=o(x).getEditedPostAttribute("comment_status"))!==null&&r!==void 0?r:"open"},[]),{editPost:t}=T(x),n=o=>t({comment_status:o});return s.jsx("form",{children:s.jsx(G,{spacing:4,children:s.jsx(Kt,{className:"editor-change-status__options",hideLabelFromVision:!0,label:c("Comment status"),options:qh,onChange:n,selected:e})})})}function Kh(){const e=_(o=>{var r;return(r=o(x).getEditedPostAttribute("ping_status"))!==null&&r!==void 0?r:"open"},[]),{editPost:t}=T(x),n=()=>t({ping_status:e==="open"?"closed":"open"});return s.jsx(It,{__nextHasNoMarginBottom:!0,label:c("Enable pingbacks & trackbacks"),checked:e==="open",onChange:n,help:s.jsx(Xe,{href:c("https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"),children:c("Learn more about pingbacks & trackbacks")})})}const Qh="discussion-panel";function Xh({onClose:e}){return s.jsxs("div",{className:"editor-post-discussion",children:[s.jsx(Ie,{title:c("Discussion"),onClose:e}),s.jsxs(G,{spacing:4,children:[s.jsx($e,{supportKeys:"comments",children:s.jsx(Zh,{})}),s.jsx($e,{supportKeys:"trackbacks",children:s.jsx(Kh,{})})]})]})}function Jh({isOpen:e,onClick:t}){const{commentStatus:n,pingStatus:o,commentsSupported:r,trackbacksSupported:i}=_(l=>{var d,u;const{getEditedPostAttribute:p}=l(x),{getPostType:m}=l(C),h=m(p("type"));return{commentStatus:(d=p("comment_status"))!==null&&d!==void 0?d:"open",pingStatus:(u=p("ping_status"))!==null&&u!==void 0?u:"open",commentsSupported:!!h.supports.comments,trackbacksSupported:!!h.supports.trackbacks}},[]);let a;return n==="open"?o==="open"?a=H("Open",'Adjective: e.g. "Comments are open"'):a=i?c("Comments only"):H("Open",'Adjective: e.g. "Comments are open"'):o==="open"?a=r?c("Pings only"):c("Pings enabled"):a=c("Closed"),s.jsx(B,{size:"compact",className:"editor-post-discussion__panel-toggle",variant:"tertiary","aria-label":c("Change discussion options"),"aria-expanded":e,onClick:t,children:a})}function eg(){const{isEnabled:e}=_(r=>{const{isEditorPanelEnabled:i}=r(x);return{isEnabled:i(Qh)}},[]),[t,n]=f.useState(null),o=f.useMemo(()=>({anchor:t,placement:"left-start",offset:36,shift:!0}),[t]);return e?s.jsx($e,{supportKeys:["comments","trackbacks"],children:s.jsx(Ce,{label:c("Discussion"),ref:n,children:s.jsx(je,{popoverProps:o,className:"editor-post-discussion__panel-dropdown",contentClassName:"editor-post-discussion__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:r,onToggle:i})=>s.jsx(Jh,{isOpen:r,onClick:i}),renderContent:({onClose:r})=>s.jsx(Xh,{onClose:r})})})}):null}function tg({hideLabelFromVision:e=!1,updateOnBlur:t=!1}){const{excerpt:n,shouldUseDescriptionLabel:o,usedAttribute:r}=_(p=>{const{getCurrentPostType:m,getEditedPostAttribute:h}=p(x),g=m(),b=["wp_template","wp_template_part"].includes(g)?"description":"excerpt";return{excerpt:h(b),shouldUseDescriptionLabel:["wp_template","wp_template_part","wp_block"].includes(g),usedAttribute:b}},[]),{editPost:i}=T(x),[a,l]=f.useState(se(n)),d=p=>{i({[r]:p})},u=o?c("Write a description (optional)"):c("Write an excerpt (optional)");return s.jsx("div",{className:"editor-post-excerpt",children:s.jsx(Vs,{__nextHasNoMarginBottom:!0,label:u,hideLabelFromVision:e,className:"editor-post-excerpt__textarea",onChange:t?l:d,onBlur:t?()=>d(a):void 0,value:t?a:n,help:o?c("Write a description"):s.jsx(Xe,{href:c("https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt"),children:c("Learn more about manual excerpts")})})})}function Ca({children:e}){return s.jsx($e,{supportKeys:"excerpt",children:e})}const{Fill:sg,Slot:ng}=Le("PluginPostExcerpt"),lo=({children:e,className:t})=>s.jsx(sg,{children:s.jsx(Ys,{className:t,children:e})});lo.Slot=ng;const og="post-excerpt";function rg(){return s.jsx(Ca,{children:s.jsx(ig,{})})}function ig(){const{shouldRender:e,excerpt:t,shouldBeUsedAsDescription:n,allowEditing:o}=_(m=>{const{getCurrentPostType:h,getCurrentPostId:g,getEditedPostAttribute:b,isEditorPanelEnabled:y}=m(x),v=h(),w=["wp_template","wp_template_part"].includes(v),S=v==="wp_block",P=w||S,k=w?"description":"excerpt",E=w&&m(C).getEntityRecord("postType",v,g()),R=y(og)||P;return{excerpt:b(k),shouldRender:R,shouldBeUsedAsDescription:P,allowEditing:R&&(!P||S||E&&E.source===mc.custom&&!E.has_theme_file&&E.is_custom)}},[]),[r,i]=f.useState(null),a=n?c("Description"):c("Excerpt"),l=f.useMemo(()=>({anchor:r,"aria-label":a,headerTitle:a,placement:"left-start",offset:36,shift:!0}),[r,a]);if(!e)return!1;const d=!!t&&s.jsx(me,{align:"left",numberOfLines:4,truncate:o,children:se(t)});if(!o)return d;const u=n?c("Add a description…"):c("Add an excerpt…"),p=n?c("Edit description"):c("Edit excerpt");return s.jsxs(G,{children:[d,s.jsx(je,{className:"editor-post-excerpt__dropdown",contentClassName:"editor-post-excerpt__dropdown__content",popoverProps:l,focusOnMount:!0,ref:i,renderToggle:({onToggle:m})=>s.jsx(B,{__next40pxDefaultSize:!0,onClick:m,variant:"link",children:d?p:u}),renderContent:({onClose:m})=>s.jsxs(s.Fragment,{children:[s.jsx(Ie,{title:a,onClose:m}),s.jsx(G,{spacing:4,children:s.jsx(lo.Slot,{children:h=>s.jsxs(s.Fragment,{children:[s.jsx(tg,{hideLabelFromVision:!0,updateOnBlur:!0}),h]})})})]})})]})}function ag({children:e,supportKeys:t}){const{postType:n,themeSupports:o}=_(i=>({postType:i(x).getEditedPostAttribute("type"),themeSupports:i(C).getThemeSupports()}),[]);return(Array.isArray(t)?t:[t]).some(i=>{var a;const l=(a=o?.[i])!==null&&a!==void 0?a:!1;return i==="post-thumbnails"&&Array.isArray(l)?l.includes(n):l})?e:null}function Ps({children:e}){return s.jsx(ag,{supportKeys:"post-thumbnails",children:s.jsx($e,{supportKeys:"thumbnail",children:e})})}const lr=["image"],lg=c("Featured image"),cg=c("Add a featured image"),dg=s.jsx("p",{children:c("To edit the featured image, you need permission to upload media.")});function ug(e,t){var n,o;if(!e)return{};const r=ys("editor.PostFeaturedImage.imageSize","large",e.id,t);if(r in((n=e?.media_details?.sizes)!==null&&n!==void 0?n:{}))return{mediaWidth:e.media_details.sizes[r].width,mediaHeight:e.media_details.sizes[r].height,mediaSourceUrl:e.media_details.sizes[r].source_url};const i=ys("editor.PostFeaturedImage.imageSize","thumbnail",e.id,t);return i in((o=e?.media_details?.sizes)!==null&&o!==void 0?o:{})?{mediaWidth:e.media_details.sizes[i].width,mediaHeight:e.media_details.sizes[i].height,mediaSourceUrl:e.media_details.sizes[i].source_url}:{mediaWidth:e.media_details.width,mediaHeight:e.media_details.height,mediaSourceUrl:e.source_url}}function pg({currentPostId:e,featuredImageId:t,onUpdateImage:n,onRemoveImage:o,media:r,postType:i,noticeUI:a,noticeOperations:l,isRequestingFeaturedImageMedia:d}){const u=f.useRef(!1),[p,m]=f.useState(!1),{getSettings:h}=_(M),{mediaSourceUrl:g}=ug(r,e);function b(S){h().mediaUpload({allowedTypes:lr,filesList:S,onFileChange([P]){if(vi(P?.url)){m(!0);return}P&&n(P),m(!1)},onError(P){l.removeAllNotices(),l.createErrorNotice(P)},multiple:!1})}function y(S){return S.alt_text?V(c("Current image: %s"),S.alt_text):V(c("The current image has no alternative text. The file name is: %s"),S.media_details.sizes?.full?.file||S.slug)}function v(S){u.current&&S&&(S.focus(),u.current=!1)}const w=!d&&!!t&&!r;return s.jsxs(Ps,{children:[a,s.jsxs("div",{className:"editor-post-featured-image",children:[r&&s.jsx("div",{id:`editor-post-featured-image-${t}-describedby`,className:"hidden",children:y(r)}),s.jsx(xi,{fallback:dg,children:s.jsx(yi,{title:i?.labels?.featured_image||lg,onSelect:n,unstableFeaturedImageFlow:!0,allowedTypes:lr,modalClass:"editor-post-featured-image__media-modal",render:({open:S})=>s.jsxs("div",{className:"editor-post-featured-image__container",children:[w?s.jsx(Et,{status:"warning",isDismissible:!1,children:c("Could not retrieve the featured image data.")}):s.jsxs(B,{__next40pxDefaultSize:!0,ref:v,className:t?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:S,"aria-label":t?c("Edit or replace the featured image"):null,"aria-describedby":t?`editor-post-featured-image-${t}-describedby`:null,"aria-haspopup":"dialog",disabled:p,accessibleWhenDisabled:!0,children:[!!t&&r&&s.jsx("img",{className:"editor-post-featured-image__preview-image",src:g,alt:y(r)}),(p||d)&&s.jsx(Zn,{}),!t&&!p&&(i?.labels?.set_featured_image||cg)]}),!!t&&s.jsxs(le,{className:z("editor-post-featured-image__actions",{"editor-post-featured-image__actions-missing-image":w,"editor-post-featured-image__actions-is-requesting-image":d}),children:[s.jsx(B,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:S,"aria-haspopup":"dialog",variant:w?"secondary":void 0,children:c("Replace")}),s.jsx(B,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:()=>{o(),u.current=!0},variant:w?"secondary":void 0,isDestructive:w,children:c("Remove")})]}),s.jsx(hc,{onFilesDrop:b})]}),value:t})})]})]})}const mg=Bt(e=>{const{getMedia:t,getPostType:n,hasFinishedResolution:o}=e(C),{getCurrentPostId:r,getEditedPostAttribute:i}=e(x),a=i("featured_media");return{media:a?t(a,{context:"view"}):null,currentPostId:r(),postType:n(i("type")),featuredImageId:a,isRequestingFeaturedImageMedia:!!a&&!o("getMedia",[a,{context:"view"}])}}),hg=Ds((e,{noticeOperations:t},{select:n})=>{const{editPost:o}=e(x);return{onUpdateImage(r){o({featured_media:r.id})},onDropImage(r){n(M).getSettings().mediaUpload({allowedTypes:["image"],filesList:r,onFileChange([i]){o({featured_media:i.id})},onError(i){t.removeAllNotices(),t.createErrorNotice(i)},multiple:!1})},onRemoveImage(){o({featured_media:0})}}}),cr=Ls(Ip,mg,hg,qn("editor.PostFeaturedImage"))(pg),cn="featured-image";function gg({withPanelBody:e=!0}){var t;const{postType:n,isEnabled:o,isOpened:r}=_(a=>{const{getEditedPostAttribute:l,isEditorPanelEnabled:d,isEditorPanelOpened:u}=a(x),{getPostType:p}=a(C);return{postType:p(l("type")),isEnabled:d(cn),isOpened:u(cn)}},[]),{toggleEditorPanelOpened:i}=T(x);return o?e?s.jsx(Ps,{children:s.jsx(oe,{title:(t=n?.labels?.featured_image)!==null&&t!==void 0?t:c("Featured image"),opened:r,onToggle:()=>i(cn),children:s.jsx(cr,{})})}):s.jsx(Ps,{children:s.jsx(cr,{})}):null}function Pa({children:e}){return _(n=>n(x).getEditorSettings().disablePostFormats,[])?null:s.jsx($e,{supportKeys:"post-formats",children:e})}const co=[{id:"aside",caption:c("Aside")},{id:"audio",caption:c("Audio")},{id:"chat",caption:c("Chat")},{id:"gallery",caption:c("Gallery")},{id:"image",caption:c("Image")},{id:"link",caption:c("Link")},{id:"quote",caption:c("Quote")},{id:"standard",caption:c("Standard")},{id:"status",caption:c("Status")},{id:"video",caption:c("Video")}].sort((e,t)=>{const n=e.caption.toUpperCase(),o=t.caption.toUpperCase();return no?1:0});function ka(){const t=`post-format-selector-${lt(ka)}`,{postFormat:n,suggestedFormat:o,supportedFormats:r}=_(u=>{const{getEditedPostAttribute:p,getSuggestedPostFormat:m}=u(x),h=p("format"),g=u(C).getThemeSupports();return{postFormat:h??"standard",suggestedFormat:m(),supportedFormats:g.formats}},[]),i=co.filter(u=>r?.includes(u.id)||n===u.id),a=i.find(u=>u.id===o),{editPost:l}=T(x),d=u=>l({format:u});return s.jsx(Pa,{children:s.jsxs("div",{className:"editor-post-format",children:[s.jsx(Kt,{className:"editor-post-format__options",label:c("Post Format"),selected:n,onChange:u=>d(u),id:t,options:i.map(u=>({label:u.caption,value:u.id})),hideLabelFromVision:!0}),a&&a.id!==n&&s.jsx("p",{className:"editor-post-format__suggestion",children:s.jsx(B,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>d(a.id),children:V(c("Apply suggested format: %s"),a.caption)})})]})})}function fg({children:e}){const{lastRevisionId:t,revisionsCount:n}=_(o=>{const{getCurrentPostLastRevisionId:r,getCurrentPostRevisionsCount:i}=o(x);return{lastRevisionId:r(),revisionsCount:i()}},[]);return!t||n<2?null:s.jsx($e,{supportKeys:"revisions",children:e})}function bg(){return _(e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(x);return{lastRevisionId:t(),revisionsCount:n()}},[])}function xg(){const{lastRevisionId:e,revisionsCount:t}=bg();return s.jsx(fg,{children:s.jsx(Ce,{label:c("Revisions"),children:s.jsx(B,{href:ye("revision.php",{revision:e}),className:"editor-private-post-last-revision__button",text:t,variant:"tertiary",size:"compact"})})})}function yg(e){let t=ti(s.jsxs("div",{className:"editor-post-preview-button__interstitial-message",children:[s.jsxs(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96",children:[s.jsx(W,{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"}),s.jsx(W,{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"})]}),s.jsx("p",{children:c("Generating preview…")})]}));t+=` - - `,t=ys("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=c("Generating preview…"),e.close()}function ja({className:e,textContent:t,forceIsAutosaveable:n,role:o,onPreview:r}){const{postId:i,currentPostLink:a,previewLink:l,isSaveable:d,isViewable:u}=_(b=>{var y;const v=b(x),P=(y=b(C).getPostType(v.getCurrentPostType("type"))?.viewable)!==null&&y!==void 0?y:!1;return P?{postId:v.getCurrentPostId(),currentPostLink:v.getCurrentPostAttribute("link"),previewLink:v.getEditedPostPreviewLink(),isSaveable:v.isEditedPostSaveable(),isViewable:P}:{isViewable:P}},[]),{__unstableSaveForPreview:p}=T(x);if(!u)return null;const m=`wp-preview-${i}`,h=async b=>{b.preventDefault();const y=window.open("",m);y.focus(),yg(y.document);const v=await p({forceIsAutosaveable:n});y.location=v,r?.()},g=l||a;return s.jsx(B,{variant:e?void 0:"tertiary",className:e||"editor-post-preview",href:g,target:m,accessibleWhenDisabled:!0,disabled:!d,onClick:h,role:o,size:"compact",children:t||s.jsxs(s.Fragment,{children:[H("Preview","imperative verb"),s.jsx(At,{as:"span",children:c("(opens in a new tab)")})]})})}function vg(){const e=ue("medium","<"),{isPublished:t,isBeingScheduled:n,isSaving:o,isPublishing:r,hasPublishAction:i,isAutosaving:a,hasNonPostEntityChanges:l,postStatusHasChanged:d,postStatus:u}=_(p=>{var m;const{isCurrentPostPublished:h,isEditedPostBeingScheduled:g,isSavingPost:b,isPublishingPost:y,getCurrentPost:v,getCurrentPostType:w,isAutosavingPost:S,getPostEdits:P,getEditedPostAttribute:k}=p(x);return{isPublished:h(),isBeingScheduled:g(),isSaving:b(),isPublishing:y(),hasPublishAction:(m=v()._links?.["wp:action-publish"])!==null&&m!==void 0?m:!1,postType:w(),isAutosaving:S(),hasNonPostEntityChanges:p(x).hasNonPostEntityChanges(),postStatusHasChanged:!!P()?.status,postStatus:k("status")}},[]);return r?c("Publishing…"):(t||n)&&o&&!a?c("Saving…"):i?l||t||d&&!["future","publish"].includes(u)||!d&&u==="future"?c("Save"):n?c("Schedule"):c("Publish"):e?c("Publish"):c("Submit for Review")}const dr=()=>{};class _g extends f.Component{constructor(t){super(t),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}createOnClick(t){return(...n)=>{const{hasNonPostEntityChanges:o,setEntitiesSavedStatesCallback:r}=this.props;return o&&r?(this.setState({entitiesSavedStatesCallback:()=>t(...n)}),r(()=>this.closeEntitiesSavedStates),dr):t(...n)}}closeEntitiesSavedStates(t){const{postType:n,postId:o}=this.props,{entitiesSavedStatesCallback:r}=this.state;this.setState({entitiesSavedStatesCallback:!1},()=>{t&&t.some(i=>i.kind==="postType"&&i.name===n&&i.key===o)&&r()})}render(){const{forceIsDirty:t,hasPublishAction:n,isBeingScheduled:o,isOpen:r,isPostSavingLocked:i,isPublishable:a,isPublished:l,isSaveable:d,isSaving:u,isAutoSaving:p,isToggle:m,savePostStatus:h,onSubmit:g=dr,onToggle:b,visibility:y,hasNonPostEntityChanges:v,isSavingNonPostEntityChanges:w,postStatus:S,postStatusHasChanged:P}=this.props,k=(u||!d||i||!a&&!t)&&(!v||w),E=(l||u||!d||!a&&!t)&&(!v||w);let R="publish";P?R=S:n?y==="private"?R="private":o&&(R="future"):R="pending";const j=()=>{k||(g(),h(R))},N=()=>{E||b()},A={"aria-disabled":k,className:"editor-post-publish-button",isBusy:!p&&u,variant:"primary",onClick:this.createOnClick(j),"aria-haspopup":v?"dialog":void 0},I={"aria-disabled":E,"aria-expanded":r,className:"editor-post-publish-panel__toggle",isBusy:u&&l,variant:"primary",size:"compact",onClick:this.createOnClick(N),"aria-haspopup":v?"dialog":void 0},D=m?I:A;return s.jsx(s.Fragment,{children:s.jsx(B,{...D,className:`${D.className} editor-post-publish-button__button`,size:"compact",children:s.jsx(vg,{})})})}}const Ta=Ls([Bt(e=>{var t;const{isSavingPost:n,isAutosavingPost:o,isEditedPostBeingScheduled:r,getEditedPostVisibility:i,isCurrentPostPublished:a,isEditedPostSaveable:l,isEditedPostPublishable:d,isPostSavingLocked:u,getCurrentPost:p,getCurrentPostType:m,getCurrentPostId:h,hasNonPostEntityChanges:g,isSavingNonPostEntityChanges:b,getEditedPostAttribute:y,getPostEdits:v}=e(x);return{isSaving:n(),isAutoSaving:o(),isBeingScheduled:r(),visibility:i(),isSaveable:l(),isPostSavingLocked:u(),isPublishable:d(),isPublished:a(),hasPublishAction:(t=p()._links?.["wp:action-publish"])!==null&&t!==void 0?t:!1,postType:m(),postId:h(),postStatus:y("status"),postStatusHasChanged:v()?.status,hasNonPostEntityChanges:g(),isSavingNonPostEntityChanges:b()}}),Ds(e=>{const{editPost:t,savePost:n}=e(x);return{savePostStatus:o=>{t({status:o},{undoIgnore:!0}),n()}}})])(_g),Ea=[{label:c("Public"),value:"public",description:c("Visible to everyone.")},{label:c("Private"),value:"private",description:c("Only visible to site admins and editors.")},{label:c("Password protected"),value:"password",description:c("Only visible to those who know the password.")}];function Na({onClose:e}){const t=lt(Na),{status:n,visibility:o,password:r}=_(p=>({status:p(x).getEditedPostAttribute("status"),visibility:p(x).getEditedPostVisibility(),password:p(x).getEditedPostAttribute("password")})),{editPost:i}=T(x),[a,l]=f.useState(!!r);function d(p){i({public:{status:o==="private"?"draft":n,password:""},private:{status:"private",password:""},password:{status:o==="private"?"draft":n,password:r||""}}[p]),l(p==="password")}const u=p=>{i({password:p})};return s.jsxs("div",{className:"editor-post-visibility",children:[s.jsx(Ie,{title:c("Visibility"),help:c("Control how this post is viewed."),onClose:e}),s.jsxs(G,{spacing:4,children:[s.jsx(Kt,{label:c("Visibility"),hideLabelFromVision:!0,options:Ea,selected:a?"password":o,onChange:d}),a&&s.jsx(Rt,{label:c("Password"),onChange:u,value:r,placeholder:c("Use a secure password"),type:"text",id:`editor-post-visibility__password-input-${t}`,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})]})]})}function wg(){return Sg()}function Sg(){const e=_(t=>t(x).getEditedPostVisibility(),[]);return Ea.find(t=>t.value===e)?.label}const{PrivatePublishDateTimePicker:Cg}=$(Se);function Aa(e){return s.jsx(Ba,{...e,showPopoverHeaderActions:!0,isCompact:!1})}function Ba({onClose:e,showPopoverHeaderActions:t,isCompact:n}){const{postDate:o,postType:r}=_(g=>({postDate:g(x).getEditedPostAttribute("date"),postType:g(x).getCurrentPostType()}),[]),{editPost:i}=T(x),a=g=>i({date:g}),[l,d]=f.useState(Do(new Date(o))),u=_(g=>g(C).getEntityRecords("postType",r,{status:"publish,future",after:Do(l).toISOString(),before:gc(l).toISOString(),exclude:[g(x).getCurrentPostId()],per_page:100,_fields:"id,date"}),[l,r]),p=f.useMemo(()=>(u||[]).map(({date:g})=>({date:new Date(g)})),[u]),m=Hs(),h=/a(?!\\)/i.test(m.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return s.jsx(Cg,{currentDate:o,onChange:a,is12Hour:h,dateOrder:H("dmy","date order"),events:p,onMonthPreviewed:g=>d(np(g)),onClose:e,isCompact:n,showPopoverHeaderActions:t})}function Ia(e){return Rn(e)}function Rn({full:e=!1}={}){const{date:t,isFloating:n}=_(o=>({date:o(x).getEditedPostAttribute("date"),isFloating:o(x).isEditedPostDateFloating()}),[]);return e?Ra(t):Pg(t,{isFloating:n})}function Ra(e){const t=_i(e),n=kg(),o=ot(H("F j, Y g:i a","post schedule full date format"),t);return it()?`${n} ${o}`:`${o} ${n}`}function Pg(e,{isFloating:t=!1,now:n=new Date}={}){if(!e||t)return c("Immediately");if(!jg(n))return Ra(e);const o=_i(e);if(ur(o,n))return V(c("Today at %s"),ot(H("g:i a","post schedule time format"),o));const r=new Date(n);return r.setDate(r.getDate()+1),ur(o,r)?V(c("Tomorrow at %s"),ot(H("g:i a","post schedule time format"),o)):o.getFullYear()===n.getFullYear()?ot(H("F j g:i a","post schedule date format without year"),o):ot(H("F j, Y g:i a","post schedule full date format"),o)}function kg(){const{timezone:e}=Hs();return`UTC+${e.offsetFormatted}`}function jg(e){const{timezone:t}=Hs(),n=Number(t.offset),o=-1*(e.getTimezoneOffset()/60);return n===o}function ur(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}const Tg=3,Eg={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function Ng({onSelect:e,taxonomy:t}){const{_terms:n,showTerms:o}=_(i=>{const a=i(C).getEntityRecords("taxonomy",t.slug,Eg);return{_terms:a,showTerms:a?.length>=Tg}},[t.slug]);if(!o)return null;const r=hh(n);return s.jsxs("div",{className:"editor-post-taxonomies__flat-term-most-used",children:[s.jsx(fc.VisualLabel,{as:"h3",className:"editor-post-taxonomies__flat-term-most-used-label",children:t.labels.most_used}),s.jsx("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list",children:r.map(i=>s.jsx("li",{children:s.jsx(B,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>e(i),children:i.name})},i.id))})]})}const dn=[],Ma=100,pr={per_page:Ma,_fields:"id,name",context:"view"},La=(e,t)=>Gt(e).toLowerCase()===Gt(t).toLowerCase(),un=(e,t)=>e.map(n=>t.find(o=>La(o.name,n))?.id).filter(n=>n!==void 0),Ag=({children:e,__nextHasNoMarginBottom:t})=>t?s.jsx(G,{spacing:4,children:e}):s.jsx(f.Fragment,{children:e});function Bg({slug:e,__nextHasNoMarginBottom:t}){var n,o;const[r,i]=f.useState([]),[a,l]=f.useState(""),d=Kn(l,500);t||Y("Bottom margin styles for wp.editor.PostTaxonomiesFlatTermSelector",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const{terms:u,termIds:p,taxonomy:m,hasAssignAction:h,hasCreateAction:g,hasResolvedTerms:b}=_(F=>{var L,K;const{getCurrentPost:pe,getEditedPostAttribute:J}=F(x),{getEntityRecords:ae,getEntityRecord:xe,hasFinishedResolution:Pe}=F(C),Ye=pe(),Te=xe("root","taxonomy",e),qe=Te?J(Te.rest_base):dn,gt={...pr,include:qe?.join(","),per_page:-1};return{hasCreateAction:Te&&(L=Ye._links?.["wp:action-create-"+Te.rest_base])!==null&&L!==void 0?L:!1,hasAssignAction:Te&&(K=Ye._links?.["wp:action-assign-"+Te.rest_base])!==null&&K!==void 0?K:!1,taxonomy:Te,termIds:qe,terms:qe?.length?ae("taxonomy",e,gt):dn,hasResolvedTerms:Pe("getEntityRecords",["taxonomy",e,gt])}},[e]),{searchResults:y}=_(F=>{const{getEntityRecords:L}=F(C);return{searchResults:a?L("taxonomy",e,{...pr,search:a}):dn}},[a,e]);f.useEffect(()=>{if(b){const F=(u??[]).map(L=>Gt(L.name));i(F)}},[u,b]);const v=f.useMemo(()=>(y??[]).map(F=>Gt(F.name)),[y]),{editPost:w}=T(x),{saveEntityRecord:S}=T(C),{createErrorNotice:P}=T(fe);if(!h)return null;async function k(F){try{const L=await S("taxonomy",e,F,{throwOnError:!0});return ha(L)}catch(L){if(L.code!=="term_exists")throw L;return{id:L.data.term_id,name:F.name}}}function E(F){w({[m.rest_base]:F})}function R(F){const L=[...u??[],...y??[]],K=F.reduce((J,ae)=>(J.some(xe=>xe.toLowerCase()===ae.toLowerCase())||J.push(ae),J),[]),pe=K.filter(J=>!L.find(ae=>La(ae.name,J)));if(i(K),pe.length===0){E(un(K,L));return}g&&Promise.all(pe.map(J=>k({name:J}))).then(J=>{const ae=L.concat(J);E(un(K,ae))}).catch(J=>{P(J.message,{type:"snackbar"}),E(un(K,L))})}function j(F){var L;if(p.includes(F.id))return;const K=[...p,F.id],pe=e==="post_tag"?c("Tag"):c("Term"),J=V(H("%s added","term"),(L=m?.labels?.singular_name)!==null&&L!==void 0?L:pe);ke(J,"assertive"),E(K)}const N=(n=m?.labels?.add_new_item)!==null&&n!==void 0?n:e==="post_tag"?c("Add new tag"):c("Add new Term"),A=(o=m?.labels?.singular_name)!==null&&o!==void 0?o:e==="post_tag"?c("Tag"):c("Term"),I=V(H("%s added","term"),A),D=V(H("%s removed","term"),A),O=V(H("Remove %s","term"),A);return s.jsxs(Ag,{__nextHasNoMarginBottom:t,children:[s.jsx(bc,{__next40pxDefaultSize:!0,value:r,suggestions:v,onChange:R,onInputChange:d,maxSuggestions:Ma,label:N,messages:{added:I,removed:D,remove:O},__nextHasNoMarginBottom:t}),s.jsx(Ng,{taxonomy:m,onSelect:j})]})}const Da=qn("editor.PostTaxonomyType")(Bg),Ig=()=>{const e=[c("Suggestion:"),s.jsx("span",{className:"editor-post-publish-panel__link",children:c("Add tags")},"label")];return s.jsxs(oe,{initialOpen:!1,title:e,children:[s.jsx("p",{children:c("Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.")}),s.jsx(Da,{slug:"post_tag",__nextHasNoMarginBottom:!0})]})},Rg=()=>{const{postHasTags:e,siteHasTags:t,isPostTypeSupported:n}=_(r=>{const i=r(x).getCurrentPostType(),a=r(C).getEntityRecord("root","taxonomy","post_tag"),l=a?.types?.includes(i),d=a!==void 0,u=a&&r(x).getEditedPostAttribute(a.rest_base),p=l?!!r(C).getEntityRecords("taxonomy","post_tag",{per_page:1})?.length:!1;return{postHasTags:!!u?.length,siteHasTags:p,isPostTypeSupported:d&&l}},[]),[o]=f.useState(e);return!n||!t||o?null:s.jsx(Ig,{})},Mg=(e,t)=>co.filter(o=>e?.includes(o.id)).find(o=>o.id===t),Lg=({suggestedPostFormat:e,suggestionText:t,onUpdatePostFormat:n})=>s.jsx(B,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>n(e),children:t});function Dg(){const{currentPostFormat:e,suggestion:t}=_(i=>{var a;const{getEditedPostAttribute:l,getSuggestedPostFormat:d}=i(x),u=(a=i(C).getThemeSupports().formats)!==null&&a!==void 0?a:[];return{currentPostFormat:l("format"),suggestion:Mg(u,d())}},[]),{editPost:n}=T(x),o=i=>n({format:i}),r=[c("Suggestion:"),s.jsx("span",{className:"editor-post-publish-panel__link",children:c("Use a post format")},"label")];return!t||t.id===e?null:s.jsxs(oe,{initialOpen:!1,title:r,children:[s.jsx("p",{children:c("Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.")}),s.jsx("p",{children:s.jsx(Lg,{onUpdatePostFormat:o,suggestedPostFormat:t.id,suggestionText:V(c('Apply the "%1$s" format.'),t.caption)})})]})}const mr={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view"},Fg=8,hr=[];function Og(e,t){const n=i=>t.indexOf(i.id)!==-1?!0:i.children===void 0?!1:i.children.map(n).filter(a=>a).length>0,o=(i,a)=>{const l=n(i),d=n(a);return l===d?0:l&&!d?-1:!l&&d?1:0},r=[...e];return r.sort(o),r}function $g(e,t,n){return e.find(o=>(!o.parent&&!t||parseInt(o.parent)===parseInt(t))&&o.name.toLowerCase()===n.toLowerCase())}function Vg(e){const t=n=>{if(e==="")return n;const o={...n};return o.children.length>0&&(o.children=o.children.map(t).filter(r=>r)),o.name.toLowerCase().indexOf(e.toLowerCase())!==-1||o.children.length>0?o:!1};return t}function Hg({slug:e}){var t,n;const[o,r]=f.useState(!1),[i,a]=f.useState(""),[l,d]=f.useState(""),[u,p]=f.useState(!1),[m,h]=f.useState(""),[g,b]=f.useState([]),y=Kn(ke,500),{hasCreateAction:v,hasAssignAction:w,terms:S,loading:P,availableTerms:k,taxonomy:E}=_(q=>{var ne,Q;const{getCurrentPost:de,getEditedPostAttribute:Ve}=q(x),{getEntityRecord:he,getEntityRecords:Me,isResolving:Ke}=q(C),He=he("root","taxonomy",e),os=de();return{hasCreateAction:He&&(ne=os._links?.["wp:action-create-"+He.rest_base])!==null&&ne!==void 0?ne:!1,hasAssignAction:He&&(Q=os._links?.["wp:action-assign-"+He.rest_base])!==null&&Q!==void 0?Q:!1,terms:He?Ve(He.rest_base):hr,loading:Ke("getEntityRecords",["taxonomy",e,mr]),availableTerms:Me("taxonomy",e,mr)||hr,taxonomy:He}},[e]),{editPost:R}=T(x),{saveEntityRecord:j}=T(C),N=f.useMemo(()=>Og(ma(k),S),[k]),{createErrorNotice:A}=T(fe);if(!w)return null;const I=q=>j("taxonomy",e,q,{throwOnError:!0}),D=q=>{R({[E.rest_base]:q})},O=q=>{const Q=S.includes(q)?S.filter(de=>de!==q):[...S,q];D(Q)},F=q=>{a(q)},L=q=>{d(q)},K=()=>{p(!u)},pe=async q=>{var ne;if(q.preventDefault(),i===""||o)return;const Q=$g(k,l,i);if(Q){S.some(Me=>Me===Q.id)||D([...S,Q.id]),a(""),d("");return}r(!0);let de;try{de=await I({name:i,parent:l||void 0})}catch(Me){A(Me.message,{type:"snackbar"});return}const Ve=e==="category"?c("Category"):c("Term"),he=V(H("%s added","term"),(ne=E?.labels?.singular_name)!==null&&ne!==void 0?ne:Ve);ke(he,"assertive"),r(!1),a(""),d(""),D([...S,de.id])},J=q=>{const ne=N.map(Vg(q)).filter(he=>he),Q=he=>{let Me=0;for(let Ke=0;Keq.map(ne=>s.jsxs("div",{className:"editor-post-taxonomies__hierarchical-terms-choice",children:[s.jsx(It,{__nextHasNoMarginBottom:!0,checked:S.indexOf(ne.id)!==-1,onChange:()=>{const Q=parseInt(ne.id,10);O(Q)},label:se(ne.name)}),!!ne.children.length&&s.jsx("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices",children:ae(ne.children)})]},ne.id)),xe=(q,ne,Q)=>{var de;return(de=E?.labels?.[q])!==null&&de!==void 0?de:e==="category"?ne:Q},Pe=xe("add_new_item",c("Add new category"),c("Add new term")),Ye=xe("new_item_name",c("Add new category"),c("Add new term")),Te=xe("parent_item",c("Parent Category"),c("Parent Term")),qe=`— ${Te} —`,gt=Pe,ns=(t=E?.labels?.search_items)!==null&&t!==void 0?t:c("Search Terms"),Ze=(n=E?.name)!==null&&n!==void 0?n:c("Terms"),sn=k.length>=Fg;return s.jsxs(Vt,{direction:"column",gap:"4",children:[sn&&s.jsx(xc,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:ns,placeholder:ns,value:m,onChange:J}),s.jsx("div",{className:"editor-post-taxonomies__hierarchical-terms-list",tabIndex:"0",role:"group","aria-label":Ze,children:ae(m!==""?g:N)}),!P&&v&&s.jsx(St,{children:s.jsx(B,{__next40pxDefaultSize:!0,onClick:K,className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":u,variant:"link",children:Pe})}),u&&s.jsx("form",{onSubmit:pe,children:s.jsxs(Vt,{direction:"column",gap:"4",children:[s.jsx(Rt,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-input",label:Ye,value:i,onChange:F,required:!0}),!!k.length&&s.jsx(yc,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:Te,noOptionLabel:qe,onChange:L,selectedId:l,tree:N}),s.jsx(St,{children:s.jsx(B,{__next40pxDefaultSize:!0,variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit",children:gt})})]})})]})}const Fa=qn("editor.PostTaxonomyType")(Hg);function zg(){const{hasNoCategory:e,hasSiteCategories:t}=_(i=>{const a=i(x).getCurrentPostType(),{canUser:l,getEntityRecord:d}=i(C),u=d("root","taxonomy","category"),p=l("read",{kind:"root",name:"site"})?d("root","site")?.default_category:void 0,m=p?d("taxonomy","category",p):void 0,h=u&&u.types.some(v=>v===a),g=u&&i(x).getEditedPostAttribute(u.rest_base),b=h?!!i(C).getEntityRecords("taxonomy","category",{exclude:[p],per_page:1})?.length:!1;return{hasNoCategory:!!u&&!!m&&h&&(g?.length===0||g?.length===1&&m?.id===g[0]),hasSiteCategories:b}},[]),[n,o]=f.useState(!1);if(f.useEffect(()=>{e&&o(!0)},[e]),!n||!t)return null;const r=[c("Suggestion:"),s.jsx("span",{className:"editor-post-publish-panel__link",children:c("Assign a category")},"label")];return s.jsxs(oe,{initialOpen:!1,title:r,children:[s.jsx("p",{children:c("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")}),s.jsx(Fa,{slug:"category"})]})}function Ug(e){const t=new Set;return Object.fromEntries(e.map(n=>{const o=vc(n);let r="";if(o){const i=o.split(".");i.length>1&&i.pop(),r=i.join(".")}return r||(r=jn()),t.has(r)&&(r=`${r}-${jn()}`),t.add(r),[n,r]}))}function Wg(e){return Object.fromEntries(Object.entries(Ug(e)).map(([t,n])=>{const o=window.fetch(t.includes("?")?t:t+"?").then(r=>r.blob()).then(r=>new File([r],`${n}.png`,{type:r.type}));return[t,o]}))}function Oa(e){const t=[];return e.forEach(n=>{t.push(n),t.push(...Oa(n.innerBlocks))}),t}function Gg(e){if(e.name==="core/image"||e.name==="core/cover")return e.attributes.url&&!e.attributes.id;if(e.name==="core/media-text")return e.attributes.mediaUrl&&!e.attributes.mediaId}function pn(e){if(e.name==="core/image"||e.name==="core/cover"){const{url:t,alt:n,id:o}=e.attributes;return{url:t,alt:n,id:o}}if(e.name==="core/media-text"){const{mediaUrl:t,mediaAlt:n,mediaId:o}=e.attributes;return{url:t,alt:n,id:o}}return{}}function Yg({clientId:e,alt:t,url:n}){const{selectBlock:o}=T(M);return s.jsx(ve.img,{tabIndex:0,role:"button","aria-label":c("Select image block."),onClick:()=>{o(e)},onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(o(e),r.preventDefault())},alt:t,src:n,animate:{opacity:1},exit:{opacity:0,scale:0},style:{width:"32px",height:"32px",objectFit:"cover",borderRadius:"2px",cursor:"pointer"},whileHover:{scale:1.08}},e)}function qg(){const[e,t]=f.useState(!1),[n,o]=f.useState(!1),[r,i]=f.useState(!1),{editorBlocks:a,mediaUpload:l}=_(g=>({editorBlocks:g(M).getBlocks(),mediaUpload:g(M).getSettings().mediaUpload}),[]),d=Oa(a).filter(g=>Gg(g)),{updateBlockAttributes:u}=T(M);if(!l||!d.length)return null;const p=[c("Suggestion:"),s.jsx("span",{className:"editor-post-publish-panel__link",children:c("External media")},"label")];function m(g,b){(g.name==="core/image"||g.name==="core/cover")&&u(g.clientId,{id:b.id,url:b.url}),g.name==="core/media-text"&&u(g.clientId,{mediaId:b.id,mediaUrl:b.url})}function h(){t(!0),i(!1);const g=new Set(d.map(y=>{const{url:v}=pn(y);return v})),b=Object.fromEntries(Object.entries(Wg([...g])).map(([y,v])=>{const w=v.then(S=>new Promise((P,k)=>{l({filesList:[S],onFileChange:([E])=>{vi(E.url)||P(E)},onError(){k()}})}));return[y,w]}));Promise.allSettled(d.map(y=>{const{url:v}=pn(y);return b[v].then(w=>m(y,w)).then(()=>o(!0)).catch(()=>i(!0))})).finally(()=>{t(!1)})}return s.jsxs(oe,{initialOpen:!0,title:p,children:[s.jsx("p",{children:c("Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.")}),s.jsxs("div",{style:{display:"inline-flex",flexWrap:"wrap",gap:"8px"},children:[s.jsx(wt,{onExitComplete:()=>o(!1),children:d.map(g=>{const{url:b,alt:y}=pn(g);return s.jsx(Yg,{clientId:g.clientId,url:b,alt:y},g.clientId)})}),e||n?s.jsx(Zn,{}):s.jsx(B,{size:"compact",variant:"primary",onClick:h,children:H("Upload","verb")})]}),r&&s.jsx("p",{children:c("Upload failed, try again.")})]})}function Zg({children:e}){const{isBeingScheduled:t,isRequestingSiteIcon:n,hasPublishAction:o,siteIconUrl:r,siteTitle:i,siteHome:a}=_(p=>{var m;const{getCurrentPost:h,isEditedPostBeingScheduled:g}=p(x),{getEntityRecord:b,isResolving:y}=p(C),v=b("root","__unstableBase",void 0)||{};return{hasPublishAction:(m=h()._links?.["wp:action-publish"])!==null&&m!==void 0?m:!1,isBeingScheduled:g(),isRequestingSiteIcon:y("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:v.site_icon_url,siteTitle:v.name,siteHome:v.home&&gi(v.home)}},[]);let l=s.jsx(Ms,{className:"components-site-icon",size:"36px",icon:mu});r&&(l=s.jsx("img",{alt:c("Site Icon"),className:"components-site-icon",src:r})),n&&(l=null);let d,u;return o?t?(d=c("Are you ready to schedule?"),u=c("Your work will be published at the specified date and time.")):(d=c("Are you ready to publish?"),u=c("Double-check your settings before publishing.")):(d=c("Are you ready to submit for review?"),u=c("Your work will be reviewed and then approved.")),s.jsxs("div",{className:"editor-post-publish-panel__prepublish",children:[s.jsx("div",{children:s.jsx("strong",{children:d})}),s.jsx("p",{children:u}),s.jsxs("div",{className:"components-site-card",children:[l,s.jsxs("div",{className:"components-site-info",children:[s.jsx("span",{className:"components-site-name",children:se(i)||c("(Untitled)")}),s.jsx("span",{className:"components-site-home",children:a})]})]}),s.jsx(qg,{}),o&&s.jsxs(s.Fragment,{children:[s.jsx(oe,{initialOpen:!1,title:[c("Visibility:"),s.jsx("span",{className:"editor-post-publish-panel__link",children:s.jsx(wg,{})},"label")],children:s.jsx(Na,{})}),s.jsx(oe,{initialOpen:!1,title:[c("Publish:"),s.jsx("span",{className:"editor-post-publish-panel__link",children:s.jsx(Ia,{})},"label")],children:s.jsx(Aa,{})})]}),s.jsx(Dg,{}),s.jsx(Rg,{}),s.jsx(zg,{}),e]})}const gr="%postname%",fr="%pagename%",Kg=e=>{const{slug:t}=e;return e.permalink_template.includes(gr)?e.permalink_template.replace(gr,t):e.permalink_template.includes(fr)?e.permalink_template.replace(fr,t):e.permalink_template};function Qg({text:e}){const[t,n]=f.useState(!1),o=f.useRef(),r=$s(e,()=>{n(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{n(!1)},4e3)});return f.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),s.jsx(B,{__next40pxDefaultSize:!0,variant:"secondary",ref:r,children:t?c("Copied!"):c("Copy")})}function Xg({focusOnMount:e,children:t}){const{post:n,postType:o,isScheduled:r}=_(h=>{const{getEditedPostAttribute:g,getCurrentPost:b,isCurrentPostScheduled:y}=h(x),{getPostType:v}=h(C);return{post:b(),postType:v(g("type")),isScheduled:y()}},[]),i=o?.labels?.singular_name,a=o?.labels?.view_item,l=o?.labels?.add_new_item,d=n.status==="future"?Kg(n):n.link,u=ye("post-new.php",{post_type:n.type}),p=f.useCallback(h=>{e&&h&&h.focus()},[e]),m=r?s.jsxs(s.Fragment,{children:[c("is now scheduled. It will go live on")," ",s.jsx(Ia,{}),"."]}):c("is now live.");return s.jsxs("div",{className:"post-publish-panel__postpublish",children:[s.jsxs(oe,{className:"post-publish-panel__postpublish-header",children:[s.jsx("a",{ref:p,href:d,children:se(n.title)||c("(no title)")})," ",m]}),s.jsxs(oe,{children:[s.jsx("p",{className:"post-publish-panel__postpublish-subheader",children:s.jsx("strong",{children:c("What’s next?")})}),s.jsxs("div",{className:"post-publish-panel__postpublish-post-address-container",children:[s.jsx(Rt,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:V(c("%s address"),i),value:vs(d),onFocus:h=>h.target.select()}),s.jsx("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap",children:s.jsx(Qg,{text:d})})]}),s.jsxs("div",{className:"post-publish-panel__postpublish-buttons",children:[!r&&s.jsx(B,{variant:"primary",href:d,__next40pxDefaultSize:!0,children:a}),s.jsx(B,{variant:r?"primary":"secondary",__next40pxDefaultSize:!0,href:u,children:l})]})]}),t]})}class Jg extends f.Component{constructor(){super(...arguments),this.onSubmit=this.onSubmit.bind(this),this.cancelButtonNode=f.createRef()}componentDidMount(){this.timeoutID=setTimeout(()=>{this.cancelButtonNode.current.focus()},0)}componentWillUnmount(){clearTimeout(this.timeoutID)}componentDidUpdate(t){(t.isPublished&&!this.props.isSaving&&this.props.isDirty||this.props.currentPostId!==t.currentPostId)&&this.props.onClose()}onSubmit(){const{onClose:t,hasPublishAction:n,isPostTypeViewable:o}=this.props;(!n||!o)&&t()}render(){const{forceIsDirty:t,isBeingScheduled:n,isPublished:o,isPublishSidebarEnabled:r,isScheduled:i,isSaving:a,isSavingNonPostEntityChanges:l,onClose:d,onTogglePublishSidebar:u,PostPublishExtension:p,PrePublishExtension:m,currentPostId:h,...g}=this.props,{hasPublishAction:b,isDirty:y,isPostTypeViewable:v,...w}=g,S=o||i&&n,P=!S&&!a,k=S&&!a;return s.jsxs("div",{className:"editor-post-publish-panel",...w,children:[s.jsx("div",{className:"editor-post-publish-panel__header",children:k?s.jsx(B,{size:"compact",onClick:d,icon:ui,label:c("Close panel")}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"editor-post-publish-panel__header-cancel-button",children:s.jsx(B,{ref:this.cancelButtonNode,accessibleWhenDisabled:!0,disabled:l,onClick:d,variant:"secondary",size:"compact",children:c("Cancel")})}),s.jsx("div",{className:"editor-post-publish-panel__header-publish-button",children:s.jsx(Ta,{onSubmit:this.onSubmit,forceIsDirty:t})})]})}),s.jsxs("div",{className:"editor-post-publish-panel__content",children:[P&&s.jsx(Zg,{children:m&&s.jsx(m,{})}),k&&s.jsx(Xg,{focusOnMount:!0,children:p&&s.jsx(p,{})}),a&&s.jsx(Zn,{})]}),s.jsx("div",{className:"editor-post-publish-panel__footer",children:s.jsx(It,{__nextHasNoMarginBottom:!0,label:c("Always show pre-publish checks."),checked:r,onChange:u})})]})}}const ef=Ls([Bt(e=>{var t;const{getPostType:n}=e(C),{getCurrentPost:o,getCurrentPostId:r,getEditedPostAttribute:i,isCurrentPostPublished:a,isCurrentPostScheduled:l,isEditedPostBeingScheduled:d,isEditedPostDirty:u,isAutosavingPost:p,isSavingPost:m,isSavingNonPostEntityChanges:h}=e(x),{isPublishSidebarEnabled:g}=e(x),b=n(i("type"));return{hasPublishAction:(t=o()._links?.["wp:action-publish"])!==null&&t!==void 0?t:!1,isPostTypeViewable:b?.viewable,isBeingScheduled:d(),isDirty:u(),isPublished:a(),isPublishSidebarEnabled:g(),isSaving:m()&&!p(),isSavingNonPostEntityChanges:h(),isScheduled:l(),currentPostId:r()}}),Ds((e,{isPublishSidebarEnabled:t})=>{const{disablePublishSidebar:n,enablePublishSidebar:o}=e(x);return{onTogglePublishSidebar:()=>{t?n():o()}}}),Bp,Np])(Jg);function tf({children:e}){const{hasStickyAction:t,postType:n}=_(o=>{var r;return{hasStickyAction:(r=o(x).getCurrentPost()._links?.["wp:action-sticky"])!==null&&r!==void 0?r:!1,postType:o(x).getCurrentPostType()}},[]);return n!=="post"||!t?null:e}function sf(){const e=_(n=>{var o;return(o=n(x).getEditedPostAttribute("sticky"))!==null&&o!==void 0?o:!1},[]),{editPost:t}=T(x);return s.jsx(tf,{children:s.jsx(It,{className:"editor-post-sticky__checkbox-control",label:c("Sticky"),help:c("Pin this post to the top of the blog."),checked:e,onChange:()=>t({sticky:!e}),__nextHasNoMarginBottom:!0})})}const us={"auto-draft":{label:c("Draft"),icon:Fo},draft:{label:c("Draft"),icon:Fo},pending:{label:c("Pending"),icon:Sc},private:{label:c("Private"),icon:wc},future:{label:c("Scheduled"),icon:_c},publish:{label:c("Published"),icon:wi}},$a=[{label:c("Draft"),value:"draft",description:c("Not ready to publish.")},{label:c("Pending"),value:"pending",description:c("Waiting for review before publishing.")},{label:c("Private"),value:"private",description:c("Only visible to site admins and editors.")},{label:c("Scheduled"),value:"future",description:c("Publish automatically on a chosen date.")},{label:c("Published"),value:"publish",description:c("Visible to everyone.")}],nf=[we,De,Pt,dt];function Va(){const{status:e,date:t,password:n,postId:o,postType:r,canEdit:i}=_(v=>{var w;const{getEditedPostAttribute:S,getCurrentPostId:P,getCurrentPostType:k,getCurrentPost:E}=v(x);return{status:S("status"),date:S("date"),password:S("password"),postId:P(),postType:k(),canEdit:(w=E()._links?.["wp:action-publish"])!==null&&w!==void 0?w:!1}},[]),[a,l]=f.useState(!!n),d=lt(Va,"editor-change-status__password-input"),{editEntityRecord:u}=T(C),[p,m]=f.useState(null),h=f.useMemo(()=>({anchor:p,"aria-label":c("Status & visibility"),headerTitle:c("Status & visibility"),placement:"left-start",offset:36,shift:!0}),[p]);if(nf.includes(r))return null;const g=({status:v=e,password:w=n,date:S=t})=>{u("postType",r,o,{status:v,date:S,password:w})},b=v=>{l(v),v||g({password:""})},y=v=>{let w=t,S=n;e==="future"&&new Date(t)>new Date&&(w=null),v==="private"&&n&&(S=""),g({status:v,date:w,password:S})};return s.jsx(Ce,{label:c("Status"),ref:m,children:i?s.jsx(je,{className:"editor-post-status",contentClassName:"editor-change-status__content",popoverProps:h,focusOnMount:!0,renderToggle:({onToggle:v,isOpen:w})=>s.jsx(B,{className:"editor-post-status__toggle",variant:"tertiary",size:"compact",onClick:v,icon:us[e]?.icon,"aria-label":V(c("Change status: %s"),us[e]?.label),"aria-expanded":w,children:us[e]?.label}),renderContent:({onClose:v})=>s.jsxs(s.Fragment,{children:[s.jsx(Ie,{title:c("Status & visibility"),onClose:v}),s.jsx("form",{onSubmit:w=>{w.preventDefault(),v()},children:s.jsxs(G,{spacing:4,children:[s.jsx(Kt,{className:"editor-change-status__options",hideLabelFromVision:!0,label:c("Status"),options:$a,onChange:y,selected:e==="auto-draft"?"draft":e}),e==="future"&&s.jsx("div",{className:"editor-change-status__publish-date-wrapper",children:s.jsx(Ba,{showPopoverHeaderActions:!1,isCompact:!0})}),e!=="private"&&s.jsxs(G,{as:"fieldset",spacing:4,className:"editor-change-status__password-fieldset",children:[s.jsx(It,{__nextHasNoMarginBottom:!0,label:c("Password protected"),help:c("Only visible to those who know the password."),checked:a,onChange:b}),a&&s.jsx("div",{className:"editor-change-status__password-input",children:s.jsx(Rt,{label:c("Password"),onChange:w=>g({password:w}),value:n,placeholder:c("Use a secure password"),type:"text",id:d,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})})]}),s.jsx(sf,{})]})})]})}):s.jsx("div",{className:"editor-post-status is-read-only",children:us[e]?.label})})}function of({forceIsDirty:e}){const[t,n]=f.useState(!1),o=ue("small"),{isAutosaving:r,isDirty:i,isNew:a,isPublished:l,isSaveable:d,isSaving:u,isScheduled:p,hasPublishAction:m,showIconLabels:h,postStatus:g,postStatusHasChanged:b}=_(A=>{var I;const{isEditedPostNew:D,isCurrentPostPublished:O,isCurrentPostScheduled:F,isEditedPostDirty:L,isSavingPost:K,isEditedPostSaveable:pe,getCurrentPost:J,isAutosavingPost:ae,getEditedPostAttribute:xe,getPostEdits:Pe}=A(x),{get:Ye}=A(U);return{isAutosaving:ae(),isDirty:e||L(),isNew:D(),isPublished:O(),isSaving:K(),isSaveable:pe(),isScheduled:F(),hasPublishAction:(I=J()?._links?.["wp:action-publish"])!==null&&I!==void 0?I:!1,showIconLabels:Ye("core","showIconLabels"),postStatus:xe("status"),postStatusHasChanged:!!Pe()?.status}},[e]),y=g==="pending",{savePost:v}=T(x),w=En(u);if(f.useEffect(()=>{let A;return w&&!u&&(n(!0),A=setTimeout(()=>{n(!1)},1e3)),()=>clearTimeout(A)},[u]),!m&&y)return null;const S=!["pending","draft","auto-draft"].includes(g)&&$a.map(({value:A})=>A).includes(g);if(l||p||S||b&&["pending","draft"].includes(g))return null;const P=y?c("Save as pending"):c("Save draft"),k=c("Save"),E=t||!a&&!i,R=u||E,j=u||E||!d;let N;return u?N=r?c("Autosaving"):c("Saving"):E?N=c("Saved"):o?N=P:h&&(N=k),s.jsxs(B,{className:d||u?z({"editor-post-save-draft":!R,"editor-post-saved-state":R,"is-saving":u,"is-autosaving":r,"is-saved":E,[Cc({type:"loading"})]:u}):void 0,onClick:j?void 0:()=>v(),shortcut:j?void 0:at.primary("s"),variant:"tertiary",size:"compact",icon:o?void 0:eu,label:N||P,"aria-disabled":j,children:[R&&s.jsx(rt,{icon:E?mt:tu}),N]})}function rf({children:e}){return _(n=>{var o;return(o=n(x).getCurrentPost()._links?.["wp:action-publish"])!==null&&o!==void 0?o:!1},[])?e:null}const af=[we,De,Pt,dt];function lf(){const[e,t]=f.useState(null),n=_(a=>a(x).getCurrentPostType(),[]),o=f.useMemo(()=>({anchor:e,"aria-label":c("Change publish date"),placement:"left-start",offset:36,shift:!0}),[e]),r=Rn(),i=Rn({full:!0});return af.includes(n)?null:s.jsx(rf,{children:s.jsx(Ce,{label:c("Publish"),ref:t,children:s.jsx(je,{popoverProps:o,focusOnMount:!0,className:"editor-post-schedule__panel-dropdown",contentClassName:"editor-post-schedule__dialog",renderToggle:({onToggle:a,isOpen:l})=>s.jsx(B,{size:"compact",className:"editor-post-schedule__dialog-toggle",variant:"tertiary",tooltipPosition:"middle left",onClick:a,"aria-label":V(c("Change date: %s"),r),label:i,showTooltip:r!==i,"aria-expanded":l,children:r}),renderContent:({onClose:a})=>s.jsx(Aa,{onClose:a})})})})}function cf(){const{syncStatus:e,postType:t}=_(n=>{const{getEditedPostAttribute:o}=n(x);return{syncStatus:o("meta")?.wp_pattern_sync_status==="unsynced"?"unsynced":o("wp_pattern_sync_status"),postType:o("type")}});return t!=="wp_block"?null:s.jsx(Ce,{label:c("Sync status"),children:s.jsx("div",{className:"editor-post-sync-status__value",children:e==="unsynced"?H("Not synced","pattern (singular)"):H("Synced","pattern (singular)")})})}const df=e=>e;function Ha({taxonomyWrapper:e=df}){const{postType:t,taxonomies:n}=_(r=>({postType:r(x).getCurrentPostType(),taxonomies:r(C).getEntityRecords("root","taxonomy",{per_page:-1})}),[]);return(n??[]).filter(r=>r.types.includes(t)&&r.visibility?.show_ui).map(r=>{const i=r.hierarchical?Fa:Da,a={slug:r.slug,...r.hierarchical?{}:{__nextHasNoMarginBottom:!0}};return s.jsx(f.Fragment,{children:e(s.jsx(i,{...a}),r)},`taxonomy-${r.slug}`)})}function uf({children:e}){return _(n=>{const o=n(x).getCurrentPostType();return n(C).getEntityRecords("root","taxonomy",{per_page:-1})?.some(i=>i.types.includes(o))},[])?e:null}function pf({taxonomy:e,children:t}){const n=e?.slug,o=n?`taxonomy-panel-${n}`:"",{isEnabled:r,isOpened:i}=_(d=>{const{isEditorPanelEnabled:u,isEditorPanelOpened:p}=d(x);return{isEnabled:n?u(o):!1,isOpened:n?p(o):!1}},[o,n]),{toggleEditorPanelOpened:a}=T(x);if(!r)return null;const l=e?.labels?.menu_name;return l?s.jsx(oe,{title:l,opened:i,onToggle:()=>a(o),children:t}):null}function mf(){return s.jsx(uf,{children:s.jsx(Ha,{taxonomyWrapper:(e,t)=>s.jsx(pf,{taxonomy:t,children:e})})})}function uo(){const e=lt(uo),{content:t,blocks:n,type:o,id:r}=_(l=>{const{getEditedEntityRecord:d}=l(C),{getCurrentPostType:u,getCurrentPostId:p}=l(x),m=u(),h=p(),g=d("postType",m,h);return{content:g?.content,blocks:g?.blocks,type:m,id:h}},[]),{editEntityRecord:i}=T(C),a=f.useMemo(()=>t instanceof Function?t({blocks:n}):n?Si(n):t,[t,n]);return s.jsxs(s.Fragment,{children:[s.jsx(At,{as:"label",htmlFor:`post-content-${e}`,children:c("Type text or HTML")}),s.jsx(Pc,{autoComplete:"off",dir:"auto",value:a,onChange:l=>{i("postType",o,r,{content:l.target.value,blocks:void 0,selection:void 0})},className:"editor-post-text-editor",id:`post-content-${e}`,placeholder:c("Start writing with text or HTML")})]})}const za="wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",Ua=/[\r\n]+/g;function Wa(e){const t=f.useRef(),{isCleanNewPost:n}=_(o=>{const{isCleanNewPost:r}=o(x);return{isCleanNewPost:r()}},[]);return f.useImperativeHandle(e,()=>({focus:()=>{t?.current?.focus()}})),f.useEffect(()=>{if(!t.current)return;const{defaultView:o}=t.current.ownerDocument,{name:r,parent:i}=o,a=r==="editor-canvas"?i.document:o.document,{activeElement:l,body:d}=a;n&&(!l||d===l)&&t.current.focus()},[n]),{ref:t}}function Ga(){const{editPost:e}=T(x),{title:t}=_(o=>{const{getEditedPostAttribute:r}=o(x);return{title:r("title")}},[]);function n(o){e({title:o})}return{title:t,setTitle:n}}const hf=f.forwardRef((e,t)=>{const{placeholder:n}=_(N=>{const{getSettings:A}=N(M),{titlePlaceholder:I}=A();return{placeholder:I}},[]),[o,r]=f.useState(!1),{ref:i}=Wa(t),{title:a,setTitle:l}=Ga(),[d,u]=f.useState({}),{clearSelectedBlock:p,insertBlocks:m,insertDefaultBlock:h}=T(M),g=se(n)||c("Add title"),{value:b,onChange:y,ref:v}=kc({value:a,onChange(N){l(N.replace(Ua," "))},placeholder:g,selectionStart:d.start,selectionEnd:d.end,onSelectionChange(N,A){u(I=>{const{start:D,end:O}=I;return D===N&&O===A?I:{start:N,end:A}})},__unstableDisableFormats:!1});function w(N){m(N,0)}function S(){r(!0),p()}function P(){r(!1),u({})}function k(){h(void 0,void 0,0)}function E(N){N.keyCode===Tc&&(N.preventDefault(),k())}function R(N){const A=N.clipboardData;let I="",D="";try{I=A.getData("text/plain"),D=A.getData("text/html")}catch{return}window.console.log(`Received HTML: - -`,D),window.console.log(`Received plain text: - -`,I);const O=jc({HTML:D,plainText:I});if(N.preventDefault(),!!O.length)if(typeof O!="string"){const[F]=O;if(!a&&(F.name==="core/heading"||F.name==="core/paragraph")){const L=xs(F.attributes.content);l(L),w(O.slice(1))}else w(O)}else{const F=xs(O);y(zs(b,Os({html:F})))}}const j=z(za,{"is-selected":o});return s.jsx("h1",{ref:Qn([v,i]),contentEditable:!0,className:j,"aria-label":g,role:"textbox","aria-multiline":"true",onFocus:S,onBlur:P,onKeyDown:E,onPaste:R})}),Ya=f.forwardRef((e,t)=>s.jsx($e,{supportKeys:"title",children:s.jsx(hf,{ref:t})}));function gf(e,t){const{placeholder:n}=_(g=>{const{getSettings:b}=g(M),{titlePlaceholder:y}=b();return{placeholder:y}},[]),[o,r]=f.useState(!1),{title:i,setTitle:a}=Ga(),{ref:l}=Wa(t);function d(g){a(g.replace(Ua," "))}function u(){r(!0)}function p(){r(!1)}const m=z(za,{"is-selected":o,"is-raw-text":!0}),h=se(n)||c("Add title");return s.jsx(Vs,{ref:l,value:i,onChange:d,onFocus:u,onBlur:p,label:n,className:m,placeholder:h,hideLabelFromVision:!0,autoComplete:"off",dir:"auto",rows:1,__nextHasNoMarginBottom:!0})}const qa=f.forwardRef(gf);function ff({children:e}){const{canTrashPost:t}=_(n=>{const{isEditedPostNew:o,getCurrentPostId:r,getCurrentPostType:i}=n(x),{canUser:a}=n(C),l=i(),d=r(),u=o(),p=d?a("delete",{kind:"postType",name:l,id:d}):!1;return{canTrashPost:(!u||d)&&p&&!Ec.includes(l)}},[]);return t?e:null}function bf({onActionPerformed:e}){const t=Ci(),{isNew:n,isDeleting:o,postId:r,title:i}=_(p=>{const m=p(x);return{isNew:m.isEditedPostNew(),isDeleting:m.isDeletingPost(),postId:m.getCurrentPostId(),title:m.getCurrentPostAttribute("title")}},[]),{trashPost:a}=T(x),[l,d]=f.useState(!1);if(n||!r)return null;const u=async()=>{d(!1),await a();const p=await t.resolveSelect(x).getCurrentPost();e?.("move-to-trash",[p])};return s.jsxs(ff,{children:[s.jsx(B,{__next40pxDefaultSize:!0,className:"editor-post-trash",isDestructive:!0,variant:"secondary",isBusy:o,"aria-disabled":o,onClick:o?void 0:()=>d(!0),children:c("Move to trash")}),s.jsx(Ut,{isOpen:l,onConfirm:u,onCancel:()=>d(!1),confirmButtonText:c("Move to trash"),size:"small",children:V(c('Are you sure you want to move "%s" to the trash?'),i)})]})}function Za({onClose:e}){const{isEditable:t,postSlug:n,postLink:o,permalinkPrefix:r,permalinkSuffix:i,permalink:a}=_(g=>{var b;const y=g(x).getCurrentPost(),v=g(x).getCurrentPostType(),w=g(C).getPostType(v),S=g(x).getPermalinkParts(),P=(b=y?._links?.["wp:action-publish"])!==null&&b!==void 0?b:!1;return{isEditable:g(x).isPermalinkEditable()&&P,postSlug:vs(g(x).getEditedPostSlug()),viewPostLabel:w?.labels.view_item,postLink:y.link,permalinkPrefix:S?.prefix,permalinkSuffix:S?.suffix,permalink:vs(g(x).getPermalink())}},[]),{editPost:l}=T(x),{createNotice:d}=T(fe),[u,p]=f.useState(!1),m=$s(a,()=>{d("info",c("Copied Permalink to clipboard."),{isDismissible:!0,type:"snackbar"})}),h="editor-post-url__slug-description-"+lt(Za);return s.jsxs("div",{className:"editor-post-url",children:[s.jsx(Ie,{title:c("Slug"),onClose:e}),s.jsxs(G,{spacing:3,children:[t&&s.jsx("p",{className:"editor-post-url__intro",children:ct(c("Customize the last part of the Permalink. Learn more."),{span:s.jsx("span",{id:h}),a:s.jsx(Xe,{href:c("https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink")})})}),s.jsxs("div",{children:[t&&s.jsxs(s.Fragment,{children:[s.jsx(Pi,{__next40pxDefaultSize:!0,prefix:s.jsx(Ic,{children:"/"}),suffix:s.jsx(Ac,{variant:"control",children:s.jsx(B,{icon:Bc,ref:m,size:"small",label:"Copy"})}),label:c("Slug"),hideLabelFromVision:!0,value:u?"":n,autoComplete:"off",spellCheck:"false",type:"text",className:"editor-post-url__input",onChange:g=>{if(l({slug:g}),!g){u||p(!0);return}u&&p(!1)},onBlur:g=>{l({slug:Nc(g.target.value)}),u&&p(!1)},"aria-describedby":h}),s.jsxs("p",{className:"editor-post-url__permalink",children:[s.jsx("span",{className:"editor-post-url__permalink-visual-label",children:c("Permalink:")}),s.jsxs(Xe,{className:"editor-post-url__link",href:o,target:"_blank",children:[s.jsx("span",{className:"editor-post-url__link-prefix",children:r}),s.jsx("span",{className:"editor-post-url__link-slug",children:n}),s.jsx("span",{className:"editor-post-url__link-suffix",children:i})]})]})]}),!t&&s.jsx(Xe,{className:"editor-post-url__link",href:o,target:"_blank",children:o})]})]})]})}function xf({children:e}){return _(n=>{const o=n(x).getCurrentPostType();return!(!n(C).getPostType(o)?.viewable||!n(x).getCurrentPost().link||!n(x).getPermalinkParts())},[])?e:null}function yf(){const{isFrontPage:e}=_(i=>{const{getCurrentPostId:a}=i(x),{getEditedEntityRecord:l,canUser:d}=i(C),u=d("read",{kind:"root",name:"site"})?l("root","site"):void 0,p=a();return{isFrontPage:u?.page_on_front===p}},[]),[t,n]=f.useState(null),o=f.useMemo(()=>({anchor:t,placement:"left-start",offset:36,shift:!0}),[t]),r=e?c("Link"):c("Slug");return s.jsx(xf,{children:s.jsxs(Ce,{label:r,ref:n,children:[!e&&s.jsx(je,{popoverProps:o,className:"editor-post-url__panel-dropdown",contentClassName:"editor-post-url__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:i,onToggle:a})=>s.jsx(vf,{isOpen:i,onClick:a}),renderContent:({onClose:i})=>s.jsx(Za,{onClose:i})}),e&&s.jsx(_f,{})]})})}function vf({isOpen:e,onClick:t}){const{slug:n}=_(r=>({slug:r(x).getEditedPostSlug()}),[]),o=vs(n);return s.jsx(B,{size:"compact",className:"editor-post-url__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":V(c("Change link: %s"),o),onClick:t,children:s.jsx(s.Fragment,{children:o})})}function _f(){const{postLink:e}=_(t=>{const{getCurrentPost:n}=t(x);return{postLink:n()?.link}},[]);return s.jsx(Xe,{className:"editor-post-url__front-page-link",href:e,target:"_blank",children:e})}function wf(){const e=_(n=>n(x).getEditedPostAttribute("content"),[]),t=H("words","Word count type. Do not translate!");return s.jsx("span",{className:"word-count",children:Us(e,t)})}const Sf=189;function Cf(){const e=_(r=>r(x).getEditedPostAttribute("content"),[]),t=H("words","Word count type. Do not translate!"),n=Math.round(Us(e,t)/Sf),o=n===0?ct(c("< 1 minute"),{span:s.jsx("span",{})}):ct(V(Ct("%s minute","%s minutes",n),n),{span:s.jsx("span",{})});return s.jsx("span",{className:"time-to-read",children:o})}function Pf(){const e=_(t=>t(x).getEditedPostAttribute("content"),[]);return Us(e,"characters_including_spaces")}const Ka=Le(Symbol("EditCanvasContainerSlot")),po="__experimentalMainDashboardButton",kf=()=>{const e=ge(po);return!!(e&&e.length)},{Fill:jf,Slot:Tf}=Le(po),mo=jf,Ef=()=>{const e=ge(po);return s.jsx(Tf,{bubblesVirtually:!0,fillProps:{length:e?e.length:0}})};mo.Slot=Ef;const Nf="edit-post/collab-history-sidebar",br="edit-post/collab-sidebar";function ho({avatar:e,name:t,date:n}){const o=Hs(),[r=o.formats.time]=Rc("root","site","time_format"),{currentUserAvatar:i,currentUserName:a}=_(d=>{var u;const p=d(C).getCurrentUser(),{getSettings:m}=d(M),{__experimentalDiscussionSettings:h}=m(),g=h?.avatarURL;return{currentUserAvatar:(u=p?.avatar_urls[48])!==null&&u!==void 0?u:g,currentUserName:p?.name}},[]),l=new Date;return s.jsxs(s.Fragment,{children:[s.jsx("img",{src:e??i,className:"editor-collab-sidebar-panel__user-avatar",alt:c("User avatar"),width:32,height:32}),s.jsxs(G,{spacing:"0",children:[s.jsx("span",{className:"editor-collab-sidebar-panel__user-name",children:t??a}),s.jsx("time",{dateTime:ot("c",n??l),className:"editor-collab-sidebar-panel__user-time",children:ot(r,n??l)})]})]})}function Af(e){return e.trim()}function Bf(e){const t=n=>n.reduce((o,r)=>{if(r.attributes&&r.attributes.blockCommentId&&!o.includes(r.attributes.blockCommentId)&&o.push(r.attributes.blockCommentId),r.innerBlocks&&r.innerBlocks.length>0){const i=t(r.innerBlocks);o.push(...i)}return o},[]);return t(e)}function go({onSubmit:e,onCancel:t,thread:n,submitButtonText:o}){var r;const[i,a]=f.useState((r=n?.content?.raw)!==null&&r!==void 0?r:"");return s.jsxs(s.Fragment,{children:[s.jsx(Vs,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:i??"",onChange:a}),s.jsxs(le,{alignment:"left",spacing:"3",justify:"flex-start",children:[s.jsx(B,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,variant:"primary",onClick:()=>{e(i),a("")},disabled:Af(i).length===0,text:o}),s.jsx(B,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,text:H("Cancel","Cancel comment button")})]})]})}function If({threads:e,onEditComment:t,onAddReply:n,onCommentDelete:o,onCommentResolve:r,showCommentBoard:i,setShowCommentBoard:a}){const{blockCommentId:l}=_(m=>{const{getBlockAttributes:h,getSelectedBlockClientId:g}=m(M),b=g();return{blockCommentId:b?h(b)?.blockCommentId:null}},[]),[d,u]=f.useState(i&&l?l:null),p=()=>{u(null),a(!1)};return s.jsxs(s.Fragment,{children:[(!Array.isArray(e)||e.length===0)&&s.jsx(G,{alignment:"left",className:"editor-collab-sidebar-panel__thread",justify:"flex-start",spacing:"3",children:c("No comments available")}),Array.isArray(e)&&e.length>0&&e.map(m=>s.jsx(G,{className:z("editor-collab-sidebar-panel__thread",{"editor-collab-sidebar-panel__active-thread":l&&l===m.id,"editor-collab-sidebar-panel__focus-thread":d&&d===m.id}),id:m.id,spacing:"3",onClick:()=>u(m.id),children:s.jsx(Rf,{thread:m,onAddReply:n,onCommentDelete:o,onCommentResolve:r,onEditComment:t,isFocused:d===m.id,clearThreadFocus:p})},m.id))]})}function Rf({thread:e,onEditComment:t,onAddReply:n,onCommentDelete:o,onCommentResolve:r,isFocused:i,clearThreadFocus:a}){return s.jsxs(s.Fragment,{children:[s.jsx(mn,{thread:e,onResolve:r,onEdit:t,onDelete:o,status:e.status}),0s.jsxs(G,{className:"editor-collab-sidebar-panel__child-thread",id:l.id,spacing:"2",children:[e.status!=="approved"&&s.jsx(mn,{thread:l,onEdit:t,onDelete:o}),e.status==="approved"&&s.jsx(mn,{thread:l})]},l.id))]}),e.status!=="approved"&&i&&s.jsxs(G,{className:"editor-collab-sidebar-panel__child-thread",spacing:"2",children:[s.jsx(le,{alignment:"left",spacing:"3",justify:"flex-start",children:s.jsx(ho,{})}),s.jsx(G,{spacing:"3",className:"editor-collab-sidebar-panel__comment-field",children:s.jsx(go,{onSubmit:l=>{n(l,e.id)},onCancel:l=>{l.stopPropagation(),a()},submitButtonText:H("Reply","Add reply comment")})})]})]})}const mn=({thread:e,onResolve:t,onEdit:n,onDelete:o,status:r})=>{const[i,a]=f.useState(!1),[l,d]=f.useState(!1),u=()=>{o(e.id),a(!1),d(!1)},p=()=>{t(e.id),a(!1),d(!1)},m=()=>{a(!1),d(!1)},g=[n&&{title:H("Edit","Edit comment"),onClick:()=>{a("edit")}},o&&{title:H("Delete","Delete comment"),onClick:()=>{a("delete"),d(!0)}}].filter(b=>b?.onClick);return s.jsxs(s.Fragment,{children:[s.jsxs(le,{alignment:"left",spacing:"3",justify:"flex-start",children:[s.jsx(ho,{avatar:e?.author_avatar_urls?.[48],name:e?.author_name,date:e?.date}),s.jsxs("span",{className:"editor-collab-sidebar-panel__comment-status",children:[r!=="approved"&&s.jsxs(le,{alignment:"right",justify:"flex-end",spacing:"0",children:[e?.parent===0&&t&&s.jsx(B,{label:H("Resolve","Mark comment as resolved"),__next40pxDefaultSize:!0,icon:wi,onClick:()=>{a("resolve"),d(!0)},showTooltip:!0}),0{n(e.id,b),a(!1)},onCancel:()=>m(),thread:e,submitButtonText:H("Update","verb")}),i!=="edit"&&s.jsx(Mc,{children:e?.content?.raw})]})}),i==="resolve"&&s.jsx(Ut,{isOpen:l,onConfirm:p,onCancel:m,confirmButtonText:"Yes",cancelButtonText:"No",children:c("Are you sure you want to mark this comment as resolved?")}),i==="delete"&&s.jsx(Ut,{isOpen:l,onConfirm:u,onCancel:m,confirmButtonText:"Yes",cancelButtonText:"No",children:c("Are you sure you want to delete this comment?")})]})};function Mf({onSubmit:e,showCommentBoard:t,setShowCommentBoard:n}){const{clientId:o,blockCommentId:r}=_(i=>{const{getSelectedBlock:a}=i(M),l=a();return{clientId:l?.clientId,blockCommentId:l?.attributes?.blockCommentId}});return!t||!o||r!==void 0?null:s.jsxs(G,{spacing:"3",className:"editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread editor-collab-sidebar-panel__focus-thread",children:[s.jsx(le,{alignment:"left",spacing:"3",children:s.jsx(ho,{})}),s.jsx(go,{onSubmit:i=>{e(i)},onCancel:()=>{n(!1)},submitButtonText:H("Comment","Add comment button")})]})}const{CommentIconSlotFill:Lf}=$(Se),Df=({onClick:e})=>s.jsx(Lf.Fill,{children:({onClose:t})=>s.jsx(_e,{icon:Jn,onClick:()=>{e(),t()},"aria-haspopup":"dialog",children:H("Comment","Add comment button")})}),{CommentIconToolbarSlotFill:Ff}=$(Se),Of=({onClick:e})=>s.jsx(Ff.Fill,{children:s.jsx(_s,{accessibleWhenDisabled:!0,icon:Jn,label:H("Comment","View comment"),onClick:e})}),$f=e=>(e.attributes.blockCommentId||(e.attributes={...e.attributes,blockCommentId:{type:"number"}}),e);ki("blocks.registerBlockType","block-comment/modify-core-block-attributes",$f);function xr({showCommentBoard:e,setShowCommentBoard:t,styles:n,comments:o}){const{createNotice:r}=T(fe),{saveEntityRecord:i,deleteEntityRecord:a}=T(C),{getEntityRecord:l}=Oc(C),{postId:d}=_(v=>{const{getCurrentPostId:w}=v(x);return{postId:w()}},[]),{getSelectedBlockClientId:u}=_(M),{updateBlockAttributes:p}=T(M),m=async(v,w)=>{const P={...{post:d,content:v,comment_type:"block_comment",comment_approved:0},...w?{parent:w}:{}},k=await i("root","comment",P);k?(w||p(u(),{blockCommentId:k?.id}),r("snackbar",w?c("Reply added successfully."):c("Comment added successfully."),{type:"snackbar",isDismissible:!0})):b()},h=async v=>{await i("root","comment",{id:v,status:"approved"})?r("snackbar",c("Comment marked as resolved."),{type:"snackbar",isDismissible:!0}):b()},g=async(v,w)=>{await i("root","comment",{id:v,content:w})?r("snackbar",c("Comment edited successfully."),{type:"snackbar",isDismissible:!0}):b()},b=()=>{r("error",c("Something went wrong. Please try publishing the post, or you may have already submitted your comment earlier."),{isDismissible:!0})},y=async v=>{const w=await l("root","comment",v);await a("root","comment",v),w&&!w.parent&&p(u(),{blockCommentId:void 0}),r("snackbar",c("Comment deleted successfully."),{type:"snackbar",isDismissible:!0})};return s.jsxs("div",{className:"editor-collab-sidebar-panel",style:n,children:[s.jsx(Mf,{onSubmit:m,showCommentBoard:e,setShowCommentBoard:t}),s.jsx(If,{threads:o,onEditComment:g,onAddReply:m,onCommentDelete:y,onCommentResolve:h,showCommentBoard:e,setShowCommentBoard:t},u())]})}function Vf(){const[e,t]=f.useState(!1),{enableComplementaryArea:n}=T(ce),{getActiveComplementaryArea:o}=_(ce),{postId:r,postType:i,postStatus:a,threads:l}=_(v=>{const{getCurrentPostId:w,getCurrentPostType:S}=v(x),P=w(),k=P&&typeof P=="number"?v(C).getEntityRecords("root","comment",{post:P,type:"block_comment",status:"any",per_page:100}):null;return{postId:P,postType:S(),postStatus:v(x).getEditedPostAttribute("status"),threads:k}},[]),{blockCommentId:d}=_(v=>{const{getBlockAttributes:w,getSelectedBlockClientId:S}=v(M),P=S();return{blockCommentId:P?w(P)?.blockCommentId:null}},[]),u=()=>{t(!0),n("core","edit-post/collab-sidebar")},[p]=Lc("postType",i,{id:r}),{resultComments:m,sortedThreads:h}=f.useMemo(()=>{const v={},w=[],S=(l??[]).filter(j=>j.status!=="trash");if(S.forEach(j=>{v[j.id]={...j,reply:[]}}),S.forEach(j=>{j.parent===0?w.push(v[j.id]):v[j.parent]&&v[j.parent].reply.push(v[j.id])}),w?.length===0)return{resultComments:[],sortedThreads:[]};const P=w.map(j=>({...j,reply:[...j.reply].reverse()})),k=Bf(p),E=new Map(P.map(j=>[j.id,j])),R=k.map(j=>E.get(j)).filter(j=>j!==void 0);return{resultComments:P,sortedThreads:R}},[l,p]),{merged:g}=Dc(),b=g?.styles?.color?.background;if(0{o("core")||(n("core",br),v())})}if(a==="publish")return null;const y=d?Of:Df;return s.jsxs(s.Fragment,{children:[s.jsx(y,{onClick:u}),s.jsx(In,{identifier:Nf,title:c("Comments"),icon:Jn,children:s.jsx(xr,{comments:m,showCommentBoard:e,setShowCommentBoard:t})}),s.jsx(In,{isPinnable:!1,header:!1,identifier:br,className:"editor-collab-sidebar",headerClassName:"editor-collab-sidebar__header",children:s.jsx(xr,{comments:h,showCommentBoard:e,setShowCommentBoard:t,styles:{backgroundColor:b}})})]})}const{useHasBlockToolbar:Hf}=$(Se);function zf({isCollapsed:e,onToggle:t}){const{blockSelectionStart:n}=_(i=>({blockSelectionStart:i(M).getBlockSelectionStart()}),[]),o=Hf(),r=!!n;return f.useEffect(()=>{n&&t(!1)},[n,t]),o?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:z("editor-collapsible-block-toolbar",{"is-collapsed":e||!r}),children:s.jsx(eo,{hideDragHandle:!0})}),s.jsx(et.Slot,{name:"block-toolbar"}),s.jsx(B,{className:"editor-collapsible-block-toolbar__toggle",icon:e?$c:Vc,onClick:()=>{t(!e)},label:e?c("Show block tools"):c("Hide block tools"),size:"compact"})]}):null}function Uf({className:e,disableBlockTools:t=!1}){const{setIsInserterOpened:n,setIsListViewOpened:o}=T(x),{isDistractionFree:r,isInserterOpened:i,isListViewOpen:a,listViewShortcut:l,inserterSidebarToggleRef:d,listViewToggleRef:u,showIconLabels:p,showTools:m}=_(k=>{const{get:E}=k(U),{isListViewOpened:R,getEditorMode:j,getInserterSidebarToggleRef:N,getListViewToggleRef:A,getRenderingMode:I,getCurrentPostType:D}=$(k(x)),{getShortcutRepresentation:O}=k(Mt);return{isInserterOpened:k(x).isInserterOpened(),isListViewOpen:R(),listViewShortcut:O("core/editor/toggle-list-view"),inserterSidebarToggleRef:N(),listViewToggleRef:A(),showIconLabels:E("core","showIconLabels"),isDistractionFree:E("core","distractionFree"),isVisualMode:j()==="visual",showTools:!!window?.__experimentalEditorWriteMode&&(I()!=="post-only"||D()==="wp_template")}},[]),h=k=>{i&&k.preventDefault()},g=ue("medium"),b=ue("wide"),y=c("Document tools"),v=f.useCallback(()=>o(!a),[o,a]),w=f.useCallback(()=>n(!i),[i,n]),S=H("Block Inserter","Generic label for block inserter button"),P=i?c("Close"):c("Add");return s.jsx(Hc,{className:z("editor-document-tools","edit-post-header-toolbar",e),"aria-label":y,variant:"unstyled",children:s.jsxs("div",{className:"editor-document-tools__left",children:[!r&&s.jsx(_s,{ref:d,className:"editor-document-tools__inserter-toggle",variant:"primary",isPressed:i,onMouseDown:h,onClick:w,disabled:t,icon:to,label:p?P:S,showTooltip:!p,"aria-expanded":i}),(b||!p)&&s.jsxs(s.Fragment,{children:[m&&g&&s.jsx(on,{as:Zp,showTooltip:!p,variant:p?"tertiary":void 0,disabled:t,size:"compact"}),s.jsx(on,{as:Xm,showTooltip:!p,variant:p?"tertiary":void 0,size:"compact"}),s.jsx(on,{as:Km,showTooltip:!p,variant:p?"tertiary":void 0,size:"compact"}),!r&&s.jsx(_s,{className:"editor-document-tools__document-overview-toggle",icon:ii,disabled:t,isPressed:a,label:c("Document Overview"),onClick:v,shortcut:l,showTooltip:!p,variant:p?"tertiary":void 0,"aria-expanded":a,ref:u})]})]})})}function Wf(){const{createNotice:e}=T(fe),{getCurrentPostId:t,getCurrentPostType:n}=_(x),{getEditedEntityRecord:o}=_(C);function r(){const l=o("postType",n(),t());if(!l)return"";if(typeof l.content=="function")return l.content(l);if(l.blocks)return Si(l.blocks);if(l.content)return l.content}function i(){e("info",c("All content copied."),{isDismissible:!0,type:"snackbar"})}const a=$s(r,i);return s.jsx(_e,{ref:a,children:c("Copy all blocks")})}const Gf=[{value:"visual",label:c("Visual editor")},{value:"text",label:c("Code editor")}];function Yf(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:n,mode:o}=_(l=>({shortcut:l(Mt).getShortcutRepresentation("core/editor/toggle-mode"),isRichEditingEnabled:l(x).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:l(x).getEditorSettings().codeEditingEnabled,mode:l(x).getEditorMode()}),[]),{switchEditorMode:r}=T(x);let i=o;!t&&o==="visual"&&(i="text"),!n&&o==="text"&&(i="visual");const a=Gf.map(l=>(!n&&l.value==="text"&&(l={...l,disabled:!0}),!t&&l.value==="visual"&&(l={...l,disabled:!0,info:c("You can enable the visual editor in your profile settings.")}),l.value!==i&&!l.disabled?{...l,shortcut:e}:l));return s.jsx(Ae,{label:c("Editor"),children:s.jsx(Rs,{choices:a,value:i,onSelect:r})})}const{Fill:fo,Slot:qf}=Le("ToolsMoreMenuGroup");fo.Slot=({fillProps:e})=>s.jsx(qf,{fillProps:e});const{Fill:bo,Slot:Zf}=Le(Symbol("ViewMoreMenuGroup"));bo.Slot=({fillProps:e})=>s.jsx(Zf,{fillProps:e});function Kf(){const{openModal:e}=T(ce),{set:t}=T(U),{toggleDistractionFree:n}=T(x),o=_(i=>i(U).get("core","showIconLabels"),[]),r=()=>{t("core","distractionFree",!1)};return s.jsx(s.Fragment,{children:s.jsx(Zt,{icon:Xn,label:c("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{showTooltip:!o,...o&&{variant:"tertiary"},tooltipPosition:"bottom",size:"compact"},children:({onClose:i})=>s.jsxs(s.Fragment,{children:[s.jsxs(Ae,{label:H("View","noun"),children:[s.jsx(an,{scope:"core",name:"fixedToolbar",onToggle:r,label:c("Top toolbar"),info:c("Access all block and document tools in a single place"),messageActivated:c("Top toolbar activated."),messageDeactivated:c("Top toolbar deactivated.")}),s.jsx(an,{scope:"core",name:"distractionFree",label:c("Distraction free"),info:c("Write with calmness"),handleToggling:!1,onToggle:()=>n({createNotice:!1}),messageActivated:c("Distraction free mode activated."),messageDeactivated:c("Distraction free mode deactivated."),shortcut:at.primaryShift("\\")}),s.jsx(an,{scope:"core",name:"focusMode",label:c("Spotlight mode"),info:c("Focus on one block at a time"),messageActivated:c("Spotlight mode activated."),messageDeactivated:c("Spotlight mode deactivated.")}),s.jsx(bo.Slot,{fillProps:{onClose:i}})]}),s.jsx(Yf,{}),s.jsx(Xt.Slot,{name:"core/plugin-more-menu",label:c("Plugins"),fillProps:{onClick:i}}),s.jsxs(Ae,{label:c("Tools"),children:[s.jsx(_e,{onClick:()=>e("editor/keyboard-shortcut-help"),shortcut:at.access("h"),children:c("Keyboard shortcuts")}),s.jsx(Wf,{}),s.jsxs(_e,{icon:ws,href:c("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer",children:[c("Help"),s.jsx(At,{as:"span",children:c("(opens in a new tab)")})]}),s.jsx(fo.Slot,{fillProps:{onClose:i}})]}),s.jsx(Ae,{children:s.jsx(_e,{onClick:()=>e("editor/preferences"),children:c("Preferences")})})]})})})}const yr="toggle",vr="button";function Qf({forceIsDirty:e,setEntitiesSavedStatesCallback:t}){let n;const o=ue("medium","<"),{togglePublishSidebar:r}=T(x),{hasPublishAction:i,isBeingScheduled:a,isPending:l,isPublished:d,isPublishSidebarEnabled:u,isPublishSidebarOpened:p,isScheduled:m,postStatus:h,postStatusHasChanged:g}=_(b=>{var y;return{hasPublishAction:(y=!!b(x).getCurrentPost()?._links?.["wp:action-publish"])!==null&&y!==void 0?y:!1,isBeingScheduled:b(x).isEditedPostBeingScheduled(),isPending:b(x).isCurrentPostPending(),isPublished:b(x).isCurrentPostPublished(),isPublishSidebarEnabled:b(x).isPublishSidebarEnabled(),isPublishSidebarOpened:b(x).isPublishSidebarOpened(),isScheduled:b(x).isCurrentPostScheduled(),postStatus:b(x).getEditedPostAttribute("status"),postStatusHasChanged:b(x).getPostEdits()?.status}},[]);return d||g&&!["future","publish"].includes(h)||m&&a||l&&!i&&!o?n=vr:o||u?n=yr:n=vr,s.jsx(Ta,{forceIsDirty:e,isOpen:p,isToggle:n===yr,onToggle:r,setEntitiesSavedStatesCallback:t})}function Xf(){const{hasLoaded:e,permalink:t,isPublished:n,label:o,showIconLabels:r}=_(i=>{const a=i(x).getCurrentPostType(),l=i(C).getPostType(a),{get:d}=i(U);return{permalink:i(x).getPermalink(),isPublished:i(x).isCurrentPostPublished(),label:l?.labels.view_item,hasLoaded:!!l,showIconLabels:d("core","showIconLabels")}},[]);return!n||!t||!e?null:s.jsx(B,{icon:ws,label:o||c("View post"),href:t,target:"_blank",showTooltip:!r,size:"compact"})}function Jf({forceIsAutosaveable:e,disabled:t}){const{deviceType:n,homeUrl:o,isTemplate:r,isViewable:i,showIconLabels:a,isTemplateHidden:l,templateId:d}=_(k=>{var E;const{getDeviceType:R,getCurrentPostType:j,getCurrentTemplateId:N,getRenderingMode:A}=k(x),{getEntityRecord:I,getPostType:D}=k(C),{get:O}=k(U),F=j();return{deviceType:R(),homeUrl:I("root","__unstableBase")?.home,isTemplate:F==="wp_template",isViewable:(E=D(F)?.viewable)!==null&&E!==void 0?E:!1,showIconLabels:O("core","showIconLabels"),isTemplateHidden:A()==="post-only",templateId:N()}},[]),{setDeviceType:u,setRenderingMode:p,setDefaultRenderingMode:m}=$(T(x)),{resetZoomLevel:h}=$(T(M)),g=k=>{u(k),h()};if(ue("medium","<"))return null;const y={placement:"bottom-end"},v={className:"editor-preview-dropdown__toggle",iconPosition:"right",size:"compact",showTooltip:!a,disabled:t,accessibleWhenDisabled:t},w={"aria-label":c("View options")},S={desktop:Go,mobile:Yo,tablet:qo},P=[{value:"Desktop",label:c("Desktop"),icon:Go},{value:"Tablet",label:c("Tablet"),icon:qo},{value:"Mobile",label:c("Mobile"),icon:Yo}];return s.jsx(Zt,{className:z("editor-preview-dropdown",`editor-preview-dropdown--${n.toLowerCase()}`),popoverProps:y,toggleProps:v,menuProps:w,icon:S[n.toLowerCase()],label:c("View"),disableOpenOnArrowDown:t,children:({onClose:k})=>s.jsxs(s.Fragment,{children:[s.jsx(Ae,{children:s.jsx(Rs,{choices:P,value:n,onSelect:g})}),r&&s.jsx(Ae,{children:s.jsxs(_e,{href:o,target:"_blank",icon:ws,onClick:k,children:[c("View site"),s.jsx(At,{as:"span",children:c("(opens in a new tab)")})]})}),!r&&!!d&&s.jsx(Ae,{children:s.jsx(_e,{icon:l?void 0:mt,isSelected:!l,role:"menuitemcheckbox",onClick:()=>{const E=l?"template-locked":"post-only";p(E),m(E)},children:c("Show template")})}),i&&s.jsx(Ae,{children:s.jsx(ja,{className:"editor-preview-dropdown__button-external",role:"menuitem",forceIsAutosaveable:e,"aria-label":c("Preview in new tab"),textContent:s.jsxs(s.Fragment,{children:[c("Preview in new tab"),s.jsx(Ms,{icon:ws})]}),onPreview:k})}),s.jsx(Xt.Slot,{name:"core/plugin-preview-menu",fillProps:{onClick:k}})]})})}const eb=({disabled:e})=>{const{isZoomOut:t,showIconLabels:n,isDistractionFree:o}=_(u=>({isZoomOut:$(u(M)).isZoomOut(),showIconLabels:u(U).get("core","showIconLabels"),isDistractionFree:u(U).get("core","distractionFree")})),{resetZoomLevel:r,setZoomLevel:i}=$(T(M)),{registerShortcut:a,unregisterShortcut:l}=T(Mt);f.useEffect(()=>(a({name:"core/editor/zoom",category:"global",description:c("Enter or exit zoom out."),keyCombination:{modifier:hi()?"primaryShift":"secondary",character:"0"}}),()=>{l("core/editor/zoom")}),[a,l]),Ue("core/editor/zoom",()=>{t?r():i("auto-scaled")},{isDisabled:o});const d=()=>{t?r():i("auto-scaled")};return s.jsx(B,{accessibleWhenDisabled:!0,disabled:e,onClick:d,icon:cu,label:c("Zoom Out"),isPressed:t,size:"compact",showTooltip:!n,className:"editor-zoom-out-toggle"})},tb=window?.__experimentalEnableBlockComment,hn={distractionFreeDisabled:{y:"-50px"},distractionFreeHover:{y:0},distractionFreeHidden:{y:"-50px"},visible:{y:0},hidden:{y:0}},sb={distractionFreeDisabled:{x:"-100%"},distractionFreeHover:{x:0},distractionFreeHidden:{x:"-100%"},visible:{x:0},hidden:{x:0}};function nb({customSaveButton:e,forceIsDirty:t,forceDisableBlockTools:n,setEntitiesSavedStatesCallback:o,title:r}){const i=ue("large"),a=ue("medium"),l=zc("(max-width: 403px)"),{postType:d,isTextEditor:u,isPublishSidebarOpened:p,showIconLabels:m,hasFixedToolbar:h,hasBlockSelection:g,hasSectionRootClientId:b}=_(E=>{const{get:R}=E(U),{getEditorMode:j,getCurrentPostType:N,isPublishSidebarOpened:A}=E(x),{getBlockSelectionStart:I,getSectionRootClientId:D}=$(E(M));return{postType:N(),isTextEditor:j()==="text",isPublishSidebarOpened:A(),showIconLabels:R("core","showIconLabels"),hasFixedToolbar:R("core","fixedToolbar"),hasBlockSelection:!!I(),hasSectionRootClientId:!!D()}},[]),y=["post","page","wp_template"].includes(d)&&b,v=[dt,De,Pt].includes(d)||n,[w,S]=f.useState(!0),P=!l&&(!h||h&&(!g||w)),k=kf();return s.jsxs("div",{className:"editor-header edit-post-header",children:[k&&s.jsx(ve.div,{className:"editor-header__back-button",variants:sb,transition:{type:"tween"},children:s.jsx(mo.Slot,{})}),s.jsxs(ve.div,{variants:hn,className:"editor-header__toolbar",transition:{type:"tween"},children:[s.jsx(Uf,{disableBlockTools:n||u}),h&&a&&s.jsx(zf,{isCollapsed:w,onToggle:S})]}),P&&s.jsx(ve.div,{className:"editor-header__center",variants:hn,transition:{type:"tween"},children:s.jsx($m,{title:r})}),s.jsxs(ve.div,{variants:hn,transition:{type:"tween"},className:"editor-header__settings",children:[!e&&!p&&s.jsx(of,{forceIsDirty:t}),s.jsx(Xf,{}),s.jsx(Jf,{forceIsAutosaveable:t,disabled:v}),s.jsx(ja,{className:"editor-header__post-preview-button",forceIsAutosaveable:t}),i&&y&&s.jsx(eb,{disabled:n}),(i||!m)&&s.jsx(qs.Slot,{scope:"core"}),!e&&s.jsx(Qf,{forceIsDirty:t,setEntitiesSavedStatesCallback:o}),tb?s.jsx(Vf,{}):void 0,e,s.jsx(Kf,{})]})]})}const{PrivateInserterLibrary:ob}=$(Se);function rb(){const{blockSectionRootClientId:e,inserterSidebarToggleRef:t,inserter:n,showMostUsedBlocks:o,sidebarIsOpened:r}=_(h=>{const{getInserterSidebarToggleRef:g,getInserter:b,isPublishSidebarOpened:y}=$(h(x)),{getBlockRootClientId:v,isZoomOut:w,getSectionRootClientId:S}=$(h(M)),{get:P}=h(U),{getActiveComplementaryArea:k}=h(ce),E=()=>{if(w()){const R=S();if(R)return R}return v()};return{inserterSidebarToggleRef:g(),inserter:b(),showMostUsedBlocks:P("core","mostUsedBlocks"),blockSectionRootClientId:E(),sidebarIsOpened:!!(k("core")||y())}},[]),{setIsInserterOpened:i}=T(x),{disableComplementaryArea:a}=T(ce),l=ue("medium","<"),d=f.useRef(),u=f.useCallback(()=>{i(!1),t.current?.focus()},[t,i]),p=f.useCallback(h=>{h.keyCode===ji&&!h.defaultPrevented&&(h.preventDefault(),u())},[u]),m=s.jsx("div",{className:"editor-inserter-sidebar__content",children:s.jsx(ob,{showMostUsedBlocks:o,showInserterHelpPanel:!0,shouldFocusBlock:l,rootClientId:e,onSelect:n.onSelect,__experimentalInitialTab:n.tab,__experimentalInitialCategory:n.category,__experimentalFilterValue:n.filterValue,onPatternCategorySelection:r?()=>a("core"):void 0,ref:d,onClose:u})});return s.jsx("div",{onKeyDown:p,className:"editor-inserter-sidebar",children:m})}function ib(){return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"editor-list-view-sidebar__outline",children:[s.jsxs("div",{children:[s.jsx(me,{children:c("Characters:")}),s.jsx(me,{children:s.jsx(Pf,{})})]}),s.jsxs("div",{children:[s.jsx(me,{children:c("Words:")}),s.jsx(wf,{})]}),s.jsxs("div",{children:[s.jsx(me,{children:c("Time to read:")}),s.jsx(Cf,{})]})]}),s.jsx(qm,{})]})}const{TabbedSidebar:ab}=$(Se);function lb(){const{setIsListViewOpened:e}=T(x),{getListViewToggleRef:t}=$(_(x)),n=Uc("firstElement"),o=f.useCallback(()=>{e(!1),t().current?.focus()},[t,e]),r=f.useCallback(y=>{y.keyCode===ji&&!y.defaultPrevented&&(y.preventDefault(),o())},[o]),[i,a]=f.useState(null),[l,d]=f.useState("list-view"),u=f.useRef(),p=f.useRef(),m=f.useRef(),h=Qn([n,m,a]);function g(y){const v=Oo.tabbable.find(p.current)[0];if(y==="list-view"){const w=Oo.tabbable.find(m.current)[0];(u.current.contains(w)?w:v).focus()}else v.focus()}const b=f.useCallback(()=>{u.current.contains(u.current.ownerDocument.activeElement)?o():g(l)},[o,l]);return Ue("core/editor/toggle-list-view",b),s.jsx("div",{className:"editor-list-view-sidebar",onKeyDown:r,ref:u,children:s.jsx(ab,{tabs:[{name:"list-view",title:H("List View","Post overview"),panel:s.jsx("div",{className:"editor-list-view-sidebar__list-view-container",children:s.jsx("div",{className:"editor-list-view-sidebar__list-view-panel-content",children:s.jsx(Wc,{dropZoneElement:i})})}),panelRef:h},{name:"outline",title:H("Outline","Post overview"),panel:s.jsx("div",{className:"editor-list-view-sidebar__list-view-container",children:s.jsx(ib,{})})}],onClose:o,onSelect:y=>d(y),defaultTabId:"list-view",ref:p,closeButtonLabel:c("Close")})})}const{Fill:z1,Slot:cb}=Le("ActionsPanel");function db({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n,forceIsDirtyPublishPanel:o}){const{closePublishSidebar:r,togglePublishSidebar:i}=T(x),{publishSidebarOpened:a,isPublishable:l,isDirty:d,hasOtherEntitiesChanges:u}=_(h=>{const{isPublishSidebarOpened:g,isEditedPostPublishable:b,isCurrentPostPublished:y,isEditedPostDirty:v,hasNonPostEntityChanges:w}=h(x),S=w();return{publishSidebarOpened:g(),isPublishable:!y()&&b(),isDirty:S||v(),hasOtherEntitiesChanges:S}},[]),p=f.useCallback(()=>e(!0),[]);let m;return a?m=s.jsx(ef,{onClose:r,forceIsDirty:o,PrePublishExtension:wa.Slot,PostPublishExtension:va.Slot}):l&&!u?m=s.jsx("div",{className:"editor-layout__toggle-publish-panel",children:s.jsx(B,{__next40pxDefaultSize:!0,variant:"secondary",onClick:i,"aria-expanded":!1,children:c("Open publish panel")})}):m=s.jsx("div",{className:"editor-layout__toggle-entities-saved-states-panel",children:s.jsx(B,{__next40pxDefaultSize:!0,variant:"secondary",onClick:p,"aria-expanded":!1,"aria-haspopup":"dialog",disabled:!d,accessibleWhenDisabled:!0,children:c("Open save panel")})}),s.jsxs(s.Fragment,{children:[n&&s.jsx(uh,{close:t,renderDialog:!0}),s.jsx(cb,{bubblesVirtually:!0}),!n&&m]})}function ub({autoFocus:e=!1}){const{switchEditorMode:t}=T(x),{shortcut:n,isRichEditingEnabled:o}=_(i=>{const{getEditorSettings:a}=i(x),{getShortcutRepresentation:l}=i(Mt);return{shortcut:l("core/editor/toggle-mode"),isRichEditingEnabled:a().richEditingEnabled}},[]),r=f.useRef();return f.useEffect(()=>{e||r?.current?.focus()},[e]),s.jsxs("div",{className:"editor-text-editor",children:[o&&s.jsxs("div",{className:"editor-text-editor__toolbar",children:[s.jsx("h2",{children:c("Editing code")}),s.jsx(B,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t("visual"),shortcut:n,children:c("Exit code editor")})]}),s.jsxs("div",{className:"editor-text-editor__body",children:[s.jsx(qa,{ref:r}),s.jsx(uo,{})]})]})}function pb({contentRef:e}){const{onNavigateToEntityRecord:t,templateId:n}=_(a=>{const{getEditorSettings:l,getCurrentTemplateId:d}=a(x);return{onNavigateToEntityRecord:l().onNavigateToEntityRecord,templateId:d()}},[]),o=_(a=>!!a(C).canUser("create",{kind:"postType",name:"wp_template"}),[]),[r,i]=f.useState(!1);return f.useEffect(()=>{const a=d=>{o&&(!d.target.classList.contains("is-root-container")||d.target.dataset?.type==="core/template-part"||d.defaultPrevented||(d.preventDefault(),i(!0)))},l=e.current;return l?.addEventListener("dblclick",a),()=>{l?.removeEventListener("dblclick",a)}},[e,o]),o?s.jsx(Ut,{isOpen:r,confirmButtonText:c("Edit template"),onConfirm:()=>{i(!1),t({postId:n,postType:"wp_template"})},onCancel:()=>i(!1),size:"medium",children:c("You’ve tried to select a block that is part of a template that may be used elsewhere on your site. Would you like to edit the template?")}):null}const mb=20;function _r({direction:e,resizeWidthBy:t}){function n(i){const{keyCode:a}=i;a!==gs&&a!==fs||(i.preventDefault(),e==="left"&&a===gs||e==="right"&&a===fs?t(mb):(e==="left"&&a===fs||e==="right"&&a===gs)&&t(-20))}const o={active:{opacity:1,scaleY:1.3}},r=`resizable-editor__resize-help-${e}`;return s.jsxs(s.Fragment,{children:[s.jsx(Vn,{text:c("Drag to resize"),children:s.jsx(ve.button,{className:`editor-resizable-editor__resize-handle is-${e}`,"aria-label":c("Drag to resize"),"aria-describedby":r,onKeyDown:n,variants:o,whileFocus:"active",whileHover:"active",whileTap:"active",role:"separator","aria-orientation":"vertical"},"handle")}),s.jsx(At,{id:r,children:c("Use left and right arrow keys to resize the canvas.")})]})}const wr={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 Qa({className:e,enableResizing:t,height:n,children:o}){const[r,i]=f.useState("100%"),a=f.useRef(),l=f.useCallback(d=>{a.current&&i(a.current.offsetWidth+d)},[]);return s.jsx(Gc,{className:z("editor-resizable-editor",e,{"is-resizable":t}),ref:d=>{a.current=d?.resizable},size:{width:t?r:"100%",height:t&&n?n:"100%"},onResizeStop:(d,u,p)=>{i(p.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{left:t,right:t},showHandle:t,resizeRatio:2,handleComponent:{left:s.jsx(_r,{direction:"left",resizeWidthBy:l}),right:s.jsx(_r,{direction:"right",resizeWidthBy:l})},handleClasses:void 0,handleStyles:{left:wr,right:wr},children:o})}const hb=500;function Sr(e,t,n){return Math.min(Math.max(e,t),n)}function gb(e,t,n){const o=e-Sr(e,n.left,n.right),r=t-Sr(t,n.top,n.bottom);return Math.sqrt(o*o+r*r)}function fb({isEnabled:e=!0}={}){const{getEnabledClientIdsTree:t,getBlockName:n,getBlockOrder:o}=$(_(M)),{selectBlock:r}=T(M);return Hn(i=>{if(!e)return;const a=(d,u)=>{const p=t().flatMap(({clientId:g})=>{const b=n(g);if(b==="core/template-part")return[];if(b==="core/post-content"){const y=o(g);if(y.length)return y}return[g]});let m=1/0,h=null;for(const g of p){const b=i.querySelector(`[data-block="${g}"]`);if(!b)continue;const y=b.getBoundingClientRect(),v=gb(d,u,y);v{(d.target===i||d.target.classList.contains("is-root-container"))&&a(d.clientX,d.clientY)};return i.addEventListener("click",l),()=>i.removeEventListener("click",l)},[e])}function bb(){const{getSettings:e,isZoomOut:t}=$(_(M)),{resetZoomLevel:n}=$(T(M));return Hn(o=>{function r(i){if(t()&&!i.defaultPrevented){i.preventDefault();const{__experimentalSetIsInserterOpened:a}=e();typeof a=="function"&&a(!1),n()}}return o.addEventListener("dblclick",r),()=>{o.removeEventListener("dblclick",r)}},[e,t,n])}const{LayoutStyle:ps,useLayoutClasses:xb,useLayoutStyles:yb,ExperimentalBlockCanvas:vb,useFlashEditableBlocks:_b}=$(Se),wb=[Pt,we,dt,De];function Mn(e){for(let t=0;t{l(Q.borderBoxSize[0].blockSize)}),u=ue("small","<"),{renderingMode:p,postContentAttributes:m,editedPostTemplate:h={},wrapperBlockName:g,wrapperUniqueId:b,deviceType:y,isFocusedEntity:v,isDesignPostType:w,postType:S,isPreview:P}=_(Q=>{const{getCurrentPostId:de,getCurrentPostType:Ve,getCurrentTemplateId:he,getEditorSettings:Me,getRenderingMode:Ke,getDeviceType:He}=Q(x),{getPostType:os,getEditedEntityRecord:kl}=Q(C),rs=Ve(),Eo=Ke();let nn;rs===Pt?nn="core/block":Eo==="post-only"&&(nn="core/post-content");const is=Me(),jl=is.supportsTemplateMode,Tl=os(rs),No=he(),El=No?kl("postType",we,No):void 0;return{renderingMode:Eo,postContentAttributes:is.postContentAttributes,isDesignPostType:wb.includes(rs),editedPostTemplate:Tl?.viewable&&jl?El:void 0,wrapperBlockName:nn,wrapperUniqueId:de(),deviceType:He(),isFocusedEntity:!!is.onNavigateToPreviousEntityRecord,postType:rs,isPreview:is.isPreviewMode}},[]),{isCleanNewPost:k}=_(x),{hasRootPaddingAwareAlignments:E,themeHasDisabledLayoutStyles:R,themeSupportsLayout:j,isZoomedOut:N}=_(Q=>{const{getSettings:de,isZoomOut:Ve}=$(Q(M)),he=de();return{themeHasDisabledLayoutStyles:he.disableLayoutStyles,themeSupportsLayout:he.supportsLayout,hasRootPaddingAwareAlignments:he.__experimentalFeatures?.useRootPaddingAwareAlignments,isZoomedOut:Ve()}},[]),A=Kp(y),[I]=Ti("layout"),D=f.useMemo(()=>p!=="post-only"||w?{type:"default"}:j?{...I,type:"constrained"}:{type:"default"},[p,j,I,w]),O=f.useMemo(()=>{if(!h?.content&&!h?.blocks&&m)return m;if(h?.blocks)return Mn(h?.blocks);const Q=typeof h?.content=="string"?h?.content:"";return Mn(Wt(Q))||{}},[h?.content,h?.blocks,m]),F=f.useMemo(()=>{if(!h?.content&&!h?.blocks)return!1;if(h?.blocks)return Cr(h?.blocks);const Q=typeof h?.content=="string"?h?.content:"";return Cr(Wt(Q))||!1},[h?.content,h?.blocks]),{layout:L={},align:K=""}=O||{},pe=xb(O,"core/post-content"),J=z({"is-layout-flow":!j},j&&pe,K&&`align${K}`),ae=yb(O,"core/post-content",".block-editor-block-list__layout.is-root-container"),xe=f.useMemo(()=>L&&(L?.type==="constrained"||L?.inherit||L?.contentSize||L?.wideSize)?{...I,...L,type:"constrained"}:{...I,...L,type:"default"},[L?.type,L?.inherit,L?.contentSize,L?.wideSize,I]),Pe=m?xe:D,Ye=Pe?.type==="default"&&!F?D:Pe,Te=Yc(),qe=f.useRef();f.useEffect(()=>{!e||!k()||qe?.current?.focus()},[e,k]);const gt=`.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;} - .is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);} - .is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;} - .is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`,ns=S===dt,Ze=[dt,De,Pt].includes(S)&&!P&&!u&&!N,sn=f.useMemo(()=>[...t??[],{css:`:where(.block-editor-iframe__body){display:flow-root;}.is-root-container{display:flow-root;${Ze?"min-height:0!important;":""}}`}],[t,Ze]),q=f.useRef(),ne=pm();return r=Qn([q,r,p==="post-only"?ne:null,_b({isEnabled:p==="template-locked"}),fb({isEnabled:p==="template-locked"}),bb(),Ze?d:null]),s.jsx("div",{className:z("editor-visual-editor","edit-post-visual-editor",i,{"has-padding":v||Ze,"is-resizable":Ze,"is-iframed":!n,"is-scrollable":n||y!=="Desktop"}),children:s.jsx(Qa,{enableResizing:Ze,height:a&&!ns?a:"100%",children:s.jsxs(vb,{shouldIframe:!n,contentRef:r,styles:sn,height:"100%",iframeProps:{...o,style:{...o?.style,...A}},children:[j&&!R&&p==="post-only"&&!w&&s.jsxs(s.Fragment,{children:[s.jsx(ps,{selector:".editor-visual-editor__post-title-wrapper",layout:D}),s.jsx(ps,{selector:".block-editor-block-list__layout.is-root-container",layout:Ye}),K&&s.jsx(ps,{css:gt}),ae&&s.jsx(ps,{layout:xe,css:ae})]}),p==="post-only"&&!w&&s.jsx("div",{className:z("editor-visual-editor__post-title-wrapper","edit-post-visual-editor__post-title-wrapper",{"has-global-padding":E}),contentEditable:!1,ref:Te,style:{marginTop:"4rem"},children:s.jsx(Ya,{ref:qe})}),s.jsxs(qc,{blockName:g,uniqueId:b,children:[s.jsx(Ei,{className:z("is-"+y.toLowerCase()+"-preview",p!=="post-only"||w?"wp-site-blocks":`${J} wp-block-post-content`,{"has-global-padding":p==="post-only"&&!w&&E}),layout:Pe,dropZoneElement:n?q.current:q.current?.parentNode,__unstableDisableDropZone:p==="template-locked"}),p==="template-locked"&&s.jsx(pb,{contentRef:q})]})]})})})}const Cb={header:c("Editor top bar"),body:c("Editor content"),sidebar:c("Editor settings"),actions:c("Editor publish"),footer:c("Editor footer")};function Pb({className:e,styles:t,children:n,forceIsDirty:o,contentRef:r,disableIframe:i,autoFocus:a,customSaveButton:l,customSavePanel:d,forceDisableBlockTools:u,title:p,iframeProps:m}){const{mode:h,isRichEditingEnabled:g,isInserterOpened:b,isListViewOpened:y,isDistractionFree:v,isPreviewMode:w,showBlockBreadcrumbs:S,documentLabel:P}=_(A=>{const{get:I}=A(U),{getEditorSettings:D,getPostTypeLabel:O}=A(x),F=D(),L=O();return{mode:A(x).getEditorMode(),isRichEditingEnabled:F.richEditingEnabled,isInserterOpened:A(x).isInserterOpened(),isListViewOpened:A(x).isListViewOpened(),isDistractionFree:I("core","distractionFree"),isPreviewMode:F.isPreviewMode,showBlockBreadcrumbs:I("core","showBlockBreadcrumbs"),documentLabel:L||H("Document","noun, breadcrumb")}},[]),k=ue("medium"),E=y?c("Document Overview"):c("Block Library"),[R,j]=f.useState(!1),N=f.useCallback(A=>{typeof R=="function"&&R(A),j(!1)},[R]);return s.jsx(da,{isDistractionFree:v,className:z("editor-editor-interface",e,{"is-entity-save-view-open":!!R,"is-distraction-free":v&&!w}),labels:{...Cb,secondarySidebar:E},header:!w&&s.jsx(nb,{forceIsDirty:o,setEntitiesSavedStatesCallback:j,customSaveButton:l,forceDisableBlockTools:u,title:p}),editorNotices:s.jsx(rr,{}),secondarySidebar:!w&&h==="visual"&&(b&&s.jsx(rb,{})||y&&s.jsx(lb,{})),sidebar:!w&&!v&&s.jsx(Zs.Slot,{scope:"core"}),content:s.jsxs(s.Fragment,{children:[!v&&!w&&s.jsx(rr,{}),s.jsx(Ka.Slot,{children:([A])=>A||s.jsxs(s.Fragment,{children:[!w&&(h==="text"||!g)&&s.jsx(ub,{autoFocus:a}),!w&&!k&&h==="visual"&&s.jsx(eo,{hideDragHandle:!0}),(w||g&&h==="visual")&&s.jsx(Sb,{styles:t,contentRef:r,disableIframe:i,autoFocus:a,iframeProps:m}),n]})})]}),footer:!w&&!v&&k&&S&&g&&h==="visual"&&s.jsx(Vp,{rootLabelText:P}),actions:w?void 0:d||s.jsx(db,{closeEntitiesSavedStates:N,isEntitiesSavedStatesOpen:R,setEntitiesSavedStatesCallback:j,forceIsDirtyPublishPanel:o})})}const{OverridesPanel:kb}=$(Ni);function jb(){return _(t=>t(x).getCurrentPostType()==="wp_block",[])?s.jsx(kb,{}):null}function ks(e){return typeof e.title=="string"?se(e.title):e.title&&"rendered"in e.title?se(e.title.rendered):e.title&&"raw"in e.title?se(e.title.raw):""}const Tb=({items:e,closeModal:t})=>{const[n]=e,o=ks(n),{showOnFront:r,currentHomePage:i,isSaving:a}=_(b=>{const{getEntityRecord:y,isSavingEntityRecord:v}=b(C),w=y("root","site"),S=y("postType","page",w?.page_on_front);return{showOnFront:w?.show_on_front,currentHomePage:S,isSaving:v("root","site")}}),{saveEntityRecord:l}=T(C),{createSuccessNotice:d,createErrorNotice:u}=T(fe);async function p(b){b.preventDefault();try{await l("root","site",{page_on_front:n.id,show_on_front:"page"}),d(c("Homepage updated."),{type:"snackbar"})}catch(y){const v=y.message&&y.code!=="unknown_error"?y.message:c("An error occurred while setting the homepage.");u(v,{type:"snackbar"})}finally{t?.()}}let m="";r==="posts"?m=c("This will replace the current homepage which is set to display latest posts."):i&&(m=V(c('This will replace the current homepage: "%s"'),ks(i)));const h=V(c('Set "%1$s" as the site homepage? %2$s'),o,m).trim(),g=c("Set homepage");return s.jsx("form",{onSubmit:p,children:s.jsxs(G,{spacing:"5",children:[s.jsx(me,{children:h}),s.jsxs(le,{justify:"right",children:[s.jsx(B,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:a,accessibleWhenDisabled:!0,children:c("Cancel")}),s.jsx(B,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:a,accessibleWhenDisabled:!0,children:g})]})]})})},Eb=()=>{const{pageOnFront:e,pageForPosts:t}=_(n=>{const{getEntityRecord:o,canUser:r}=n(C),i=r("read",{kind:"root",name:"site"})?o("root","site"):void 0;return{pageOnFront:i?.page_on_front,pageForPosts:i?.page_for_posts}});return f.useMemo(()=>({id:"set-as-homepage",label:c("Set as homepage"),isEligible(n){return!(n.status!=="publish"||n.type!=="page"||e===n.id||t===n.id)},modalFocusOnMount:"firstContentElement",RenderModal:Tb}),[t,e])},Nb=({items:e,closeModal:t})=>{const[n]=e,o=ks(n),{currentPostsPage:r,isPageForPostsSet:i,isSaving:a}=_(b=>{const{getEntityRecord:y,isSavingEntityRecord:v}=b(C),w=y("root","site");return{currentPostsPage:y("postType","page",w?.page_for_posts),isPageForPostsSet:w?.page_for_posts!==0,isSaving:v("root","site")}}),{saveEntityRecord:l}=T(C),{createSuccessNotice:d,createErrorNotice:u}=T(fe);async function p(b){b.preventDefault();try{await l("root","site",{page_for_posts:n.id,show_on_front:"page"}),d(c("Posts page updated."),{type:"snackbar"})}catch(y){const v=y.message&&y.code!=="unknown_error"?y.message:c("An error occurred while setting the posts page.");u(v,{type:"snackbar"})}finally{t?.()}}const m=i&&r?V(c('This will replace the current posts page: "%s"'),ks(r)):c("This page will show the latest posts."),h=V(c('Set "%1$s" as the posts page? %2$s'),o,m),g=c("Set posts page");return s.jsx("form",{onSubmit:p,children:s.jsxs(G,{spacing:"5",children:[s.jsx(me,{children:h}),s.jsxs(le,{justify:"right",children:[s.jsx(B,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:a,accessibleWhenDisabled:!0,children:c("Cancel")}),s.jsx(B,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:a,accessibleWhenDisabled:!0,children:g})]})]})})},Ab=()=>{const{pageOnFront:e,pageForPosts:t}=_(n=>{const{getEntityRecord:o,canUser:r}=n(C),i=r("read",{kind:"root",name:"site"})?o("root","site"):void 0;return{pageOnFront:i?.page_on_front,pageForPosts:i?.page_for_posts}});return f.useMemo(()=>({id:"set-as-posts-page",label:c("Set as posts page"),isEligible(n){return!(n.status!=="publish"||n.type!=="page"||e===n.id||t===n.id)},modalFocusOnMount:"firstContentElement",RenderModal:Nb}),[t,e])};function Xa({postType:e,onActionPerformed:t,context:n}){const{defaultActions:o}=_(p=>{const{getEntityActions:m}=$(p(x));return{defaultActions:m("postType",e)}},[e]),{canManageOptions:r,hasFrontPageTemplate:i}=_(p=>{const{getEntityRecords:m,canUser:h}=p(C),g=h("update",{kind:"root",name:"site"}),b=e==="page"&&g?m("postType","wp_template",{per_page:-1}):[];return{canManageOptions:g,hasFrontPageTemplate:!!b?.find(y=>y?.slug==="front-page")}},[e]),a=Eb(),l=Ab(),d=r&&!i,{registerPostTypeSchema:u}=$(T(x));return f.useEffect(()=>{u(e)},[u,e]),f.useMemo(()=>{let p=[...o];if(d&&p.push(a,l),p=p.sort((m,h)=>h.id==="move-to-trash"?-1:0),p=p.filter(m=>m.context?m.context===n:!0),t)for(let m=0;m{h(g,{...b,onActionPerformed:y=>{b?.onActionPerformed&&b.onActionPerformed(y),t(p[m].id,y)}})}}}if(p[m].RenderModal){const h=p[m].RenderModal;p[m]={...p[m],RenderModal:g=>s.jsx(h,{...g,onActionPerformed:b=>{g.onActionPerformed&&g.onActionPerformed(b),t(p[m].id,b)}})}}}return p},[n,o,t,a,l,d])}const{Menu:_t,kebabCase:Bb}=$(ht);function Ib({postType:e,postId:t,onActionPerformed:n}){const[o,r]=f.useState(null),{item:i,permissions:a}=_(p=>{const{getEditedEntityRecord:m,getEntityRecordPermissions:h}=$(p(C));return{item:m("postType",e,t),permissions:h("postType",e,t)}},[t,e]),l=f.useMemo(()=>({...i,permissions:a}),[i,a]),d=Xa({postType:e,onActionPerformed:n}),u=f.useMemo(()=>d.filter(p=>!p.isEligible||p.isEligible(l)),[d,l]);return s.jsxs(s.Fragment,{children:[s.jsxs(_t,{placement:"bottom-end",children:[s.jsx(_t.TriggerButton,{render:s.jsx(B,{size:"small",icon:Xn,label:c("Actions"),disabled:!u.length,accessibleWhenDisabled:!0,className:"editor-all-actions-button"})}),s.jsx(_t.Popover,{children:s.jsx(Lb,{actions:u,items:[l],setActiveModalAction:r})})]}),!!o&&s.jsx(Mb,{action:o,items:[l],closeModal:()=>r(null)})]})}function Rb({action:e,onClick:t,items:n}){const o=typeof e.label=="string"?e.label:e.label(n);return s.jsx(_t.Item,{onClick:t,children:s.jsx(_t.ItemLabel,{children:o})})}function Mb({action:e,items:t,closeModal:n}){const o=typeof e.label=="string"?e.label:e.label(t);return s.jsx(Bs,{title:e.modalHeader||o,__experimentalHideHeader:!!e.hideModalHeader,onRequestClose:n??(()=>{}),focusOnMount:"firstContentElement",size:"medium",overlayClassName:`editor-action-modal editor-action-modal__${Bb(e.id)}`,children:s.jsx(e.RenderModal,{items:t,closeModal:n})})}function Lb({actions:e,items:t,setActiveModalAction:n}){const o=Ci();return s.jsx(_t.Group,{children:e.map(r=>s.jsx(Rb,{action:r,onClick:()=>{if("RenderModal"in r){n(r);return}r.callback(t,{registry:o})},items:t},r.id))})}const{Badge:Db}=$(ht);function Ja({postType:e,postId:t,onActionPerformed:n}){const o=f.useMemo(()=>Array.isArray(t)?t:[t],[t]),{postTitle:r,icon:i,labels:a}=_(u=>{const{getEditedEntityRecord:p,getCurrentTheme:m,getPostType:h}=u(C),{getPostIcon:g}=$(u(x));let b="";const y=p("postType",e,o[0]);if(o.length===1){var v;const{default_template_types:w=[]}=(v=m())!==null&&v!==void 0?v:{};b=([we,De].includes(e)?Fs({template:y,templateTypes:w}):{})?.title||y?.title}return{postTitle:b,icon:g(e,{area:y?.area}),labels:h(e)?.labels}},[o,e]),l=ua(t);let d=c("No title");return a?.name&&o.length>1?d=V(c("%i %s"),t.length,a?.name):r&&(d=xs(r)),s.jsxs(G,{spacing:1,className:"editor-post-card-panel",children:[s.jsxs(le,{spacing:2,className:"editor-post-card-panel__header",align:"flex-start",children:[s.jsx(Ms,{className:"editor-post-card-panel__icon",icon:i}),s.jsxs(me,{numberOfLines:2,truncate:!0,className:"editor-post-card-panel__title",as:"h2",children:[s.jsx("span",{className:"editor-post-card-panel__title-name",children:d}),l&&o.length===1&&s.jsx(Db,{children:l})]}),o.length===1&&s.jsx(Ib,{postType:e,postId:o[0],onActionPerformed:n})]}),o.length>1&&s.jsx(me,{className:"editor-post-card-panel__description",children:V(c("Changes will be applied to all selected %s."),a?.name.toLowerCase())})]})}const Fb=189;function Ob(){const{postContent:e}=_(a=>{const{getEditedPostAttribute:l,getCurrentPostType:d,getCurrentPostId:u}=a(x),{canUser:p}=a(C),{getEntityRecord:m}=a(C),h=p("read",{kind:"root",name:"site"})?m("root","site"):void 0,g=d();return{postContent:!(+u()===h?.page_for_posts)&&![we,De].includes(g)&&l("content")}},[]),t=H("words","Word count type. Do not translate!"),n=f.useMemo(()=>e?Us(e,t):0,[e,t]);if(!n)return null;const o=Math.round(n/Fb),r=V(Ct("%s word","%s words",n),n.toLocaleString()),i=o<=1?c("1 minute"):V(Ct("%s minute","%s minutes",o),o.toLocaleString());return s.jsx("div",{className:"editor-post-content-information",children:s.jsx(me,{children:V(c("%1$s, %2$s read time."),r,i)})})}function $b(){const{postFormat:e}=_(i=>{const{getEditedPostAttribute:a}=i(x),l=a("format");return{postFormat:l??"standard"}},[]),t=co.find(i=>i.id===e),[n,o]=f.useState(null),r=f.useMemo(()=>({anchor:n,placement:"left-start",offset:36,shift:!0}),[n]);return s.jsx(Pa,{children:s.jsx(Ce,{label:c("Format"),ref:o,children:s.jsx(je,{popoverProps:r,contentClassName:"editor-post-format__dialog",focusOnMount:!0,renderToggle:({isOpen:i,onToggle:a})=>s.jsx(B,{size:"compact",variant:"tertiary","aria-expanded":i,"aria-label":V(c("Change format: %s"),t?.caption),onClick:a,children:t?.caption}),renderContent:({onClose:i})=>s.jsxs("div",{className:"editor-post-format__dialog-content",children:[s.jsx(Ie,{title:c("Format"),onClose:i}),s.jsx(ka,{})]})})})})}function Vb(){const e=_(n=>n(x).getEditedPostAttribute("modified"),[]),t=e&&V(c("Last edited %s."),Zc(e));return t?s.jsx("div",{className:"editor-post-last-edited-panel",children:s.jsx(me,{children:t})}):null}function Hb({className:e,children:t}){return s.jsx(G,{className:z("editor-post-panel__section",e),children:t})}const zb={};function Ub(){const{editEntityRecord:e}=T(C),{postsPageTitle:t,postsPageId:n,isTemplate:o,postSlug:r}=_(p=>{const{getEntityRecord:m,getEditedEntityRecord:h,canUser:g}=p(C),b=g("read",{kind:"root",name:"site"})?m("root","site"):void 0,y=b?.page_for_posts?h("postType","page",b?.page_for_posts):zb,{getEditedPostAttribute:v,getCurrentPostType:w}=p(x);return{postsPageId:y?.id,postsPageTitle:y?.title,isTemplate:w()===we,postSlug:v("slug")}},[]),[i,a]=f.useState(null),l=f.useMemo(()=>({anchor:i,placement:"left-start",offset:36,shift:!0}),[i]);if(!o||!["home","index"].includes(r)||!n)return null;const d=p=>{e("postType","page",n,{title:p})},u=se(t);return s.jsx(Ce,{label:c("Blog title"),ref:a,children:s.jsx(je,{popoverProps:l,contentClassName:"editor-blog-title-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:p,onToggle:m})=>s.jsx(B,{size:"compact",variant:"tertiary","aria-expanded":p,"aria-label":V(c("Change blog title: %s"),u),onClick:m,children:u}),renderContent:({onClose:p})=>s.jsxs(s.Fragment,{children:[s.jsx(Ie,{title:c("Blog title"),onClose:p}),s.jsx(Pi,{placeholder:c("No title"),size:"__unstable-large",value:t,onChange:qt(d,300),label:c("Blog title"),help:c("Set the Posts Page title. Appears in search results, and when the page is shared on social media."),hideLabelFromVision:!0})]})})})}function Wb(){const{editEntityRecord:e}=T(C),{postsPerPage:t,isTemplate:n,postSlug:o}=_(d=>{const{getEditedPostAttribute:u,getCurrentPostType:p}=d(x),{getEditedEntityRecord:m,canUser:h}=d(C),g=h("read",{kind:"root",name:"site"})?m("root","site"):void 0;return{isTemplate:p()===we,postSlug:u("slug"),postsPerPage:g?.posts_per_page||1}},[]),[r,i]=f.useState(null),a=f.useMemo(()=>({anchor:r,placement:"left-start",offset:36,shift:!0}),[r]);if(!n||!["home","index"].includes(o))return null;const l=d=>{e("root","site",void 0,{posts_per_page:d})};return s.jsx(Ce,{label:c("Posts per page"),ref:i,children:s.jsx(je,{popoverProps:a,contentClassName:"editor-posts-per-page-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:d,onToggle:u})=>s.jsx(B,{size:"compact",variant:"tertiary","aria-expanded":d,"aria-label":c("Change posts per page"),onClick:u,children:t}),renderContent:({onClose:d})=>s.jsxs(s.Fragment,{children:[s.jsx(Ie,{title:c("Posts per page"),onClose:d}),s.jsx(Ai,{placeholder:0,value:t,size:"__unstable-large",spinControls:"custom",step:"1",min:"1",onChange:l,label:c("Posts per page"),help:c("Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting."),hideLabelFromVision:!0})]})})})}const Gb=[{label:H("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:c("Visitors can add new comments and replies.")},{label:c("Closed"),value:"",description:[c("Visitors cannot add new comments or replies."),c("Existing comments remain visible.")].join(" ")}];function Yb(){const{editEntityRecord:e}=T(C),{allowCommentsOnNewPosts:t,isTemplate:n,postSlug:o}=_(d=>{const{getEditedPostAttribute:u,getCurrentPostType:p}=d(x),{getEditedEntityRecord:m,canUser:h}=d(C),g=h("read",{kind:"root",name:"site"})?m("root","site"):void 0;return{isTemplate:p()===we,postSlug:u("slug"),allowCommentsOnNewPosts:g?.default_comment_status||""}},[]),[r,i]=f.useState(null),a=f.useMemo(()=>({anchor:r,placement:"left-start",offset:36,shift:!0}),[r]);if(!n||!["home","index"].includes(o))return null;const l=d=>{e("root","site",void 0,{default_comment_status:d?"open":null})};return s.jsx(Ce,{label:c("Discussion"),ref:i,children:s.jsx(je,{popoverProps:a,contentClassName:"editor-site-discussion-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:d,onToggle:u})=>s.jsx(B,{size:"compact",variant:"tertiary","aria-expanded":d,"aria-label":c("Change discussion settings"),onClick:u,children:t?c("Comments open"):c("Comments closed")}),renderContent:({onClose:d})=>s.jsxs(s.Fragment,{children:[s.jsx(Ie,{title:c("Discussion"),onClose:d}),s.jsxs(G,{spacing:3,children:[s.jsx(me,{children:c("Changes will apply to new posts only. Individual posts may override these settings.")}),s.jsx(Kt,{className:"editor-site-discussion__options",hideLabelFromVision:!0,label:c("Comment status"),options:Gb,onChange:l,selected:t})]})]})})})}const qb="post-status";function Zb({onActionPerformed:e}){const{isRemovedPostStatusPanel:t,postType:n,postId:o}=_(r=>{const{isEditorPanelRemoved:i,getCurrentPostType:a,getCurrentPostId:l}=r(x);return{isRemovedPostStatusPanel:i(qb),postType:a(),postId:l()}},[]);return s.jsx(Hb,{className:"editor-post-summary",children:s.jsx(_a.Slot,{children:r=>s.jsx(s.Fragment,{children:s.jsxs(G,{spacing:4,children:[s.jsx(Ja,{postType:n,postId:o,onActionPerformed:e}),s.jsx(gg,{withPanelBody:!1}),s.jsx(rg,{}),s.jsxs(G,{spacing:1,children:[s.jsx(Ob,{}),s.jsx(Vb,{})]}),!t&&s.jsxs(G,{spacing:4,children:[s.jsxs(G,{spacing:1,children:[s.jsx(Va,{}),s.jsx(lf,{}),s.jsx(yf,{}),s.jsx(Yh,{}),s.jsx($h,{}),s.jsx(eg,{}),s.jsx(xg,{}),s.jsx(vh,{}),s.jsx(cf,{}),s.jsx(Ub,{}),s.jsx(Wb,{}),s.jsx(Yb,{}),s.jsx($b,{}),r]}),s.jsx(bf,{onActionPerformed:e})]})]})})})})}const{EXCLUDED_PATTERN_SOURCES:Kb,PATTERN_TYPES:Qb}=$(Ni);function el(e,t){return e.innerBlocks=e.innerBlocks.map(n=>el(n,t)),e.name==="core/template-part"&&e.attributes.theme===void 0&&(e.attributes.theme=t),e}function Xb(e,t){const n=(i,a,l)=>a===l.findIndex(d=>i.name===d.name),o=i=>!Kb.includes(i.source),r=i=>i.templateTypes?.includes(t.slug)||i.blockTypes?.includes("core/template-part/"+t.area);return e.filter((i,a,l)=>n(i,a,l)&&o(i)&&r(i))}function Jb(e,t){return e.map(n=>({...n,keywords:n.keywords||[],type:Qb.theme,blocks:Wt(n.content,{__unstableSkipMigrationLogs:!0}).map(o=>el(o,t))}))}function ex(e){const{blockPatterns:t,restBlockPatterns:n,currentThemeStylesheet:o}=_(r=>{var i;const{getEditorSettings:a}=r(x),l=a();return{blockPatterns:(i=l.__experimentalAdditionalBlockPatterns)!==null&&i!==void 0?i:l.__experimentalBlockPatterns,restBlockPatterns:r(C).getBlockPatterns(),currentThemeStylesheet:r(C).getCurrentTheme().stylesheet}},[]);return f.useMemo(()=>{const r=[...t||[],...n||[]],i=Xb(r,e);return Jb(i,e)},[t,n,e,o])}function tx({availableTemplates:e,onSelect:t}){return!e||e?.length===0?null:s.jsx(bi,{label:c("Templates"),blockPatterns:e,onClickPattern:t,showTitlesAsTooltip:!0})}function sx(){const{record:e,postType:t,postId:n}=_(a=>{const{getCurrentPostType:l,getCurrentPostId:d}=a(x),{getEditedEntityRecord:u}=a(C),p=l(),m=d();return{postType:p,postId:m,record:u("postType",p,m)}},[]),{editEntityRecord:o}=T(C),r=ex(e),i=async a=>{await o("postType",t,n,{blocks:a.blocks,content:Gn(a.blocks)})};return r?.length?s.jsx(oe,{title:c("Design"),initialOpen:e.type===De,children:s.jsx(tx,{availableTemplates:r,onSelect:i})}):null}function nx(){const{postType:e}=_(t=>{const{getCurrentPostType:n}=t(x);return{postType:n()}},[]);return[De,we].includes(e)?s.jsx(sx,{}):null}const Fe={document:"edit-post/document",block:"edit-post/block"},{Tabs:gn}=$(ht),ox=(e,t)=>{const{documentLabel:n}=_(o=>{const{getPostTypeLabel:r}=o(x);return{documentLabel:r()||H("Document","noun, panel")}},[]);return s.jsxs(gn.TabList,{ref:t,children:[s.jsx(gn.Tab,{tabId:Fe.document,"data-tab-id":Fe.document,children:n}),s.jsx(gn.Tab,{tabId:Fe.block,"data-tab-id":Fe.block,children:c("Block")})]})},rx=f.forwardRef(ox),{BlockQuickNavigation:ix}=$(Se),ax=["core/post-title","core/post-featured-image","core/post-content"],lx="core/template-part";function cx(){const e=f.useMemo(()=>ys("editor.postContentBlockTypes",ax),[]),{clientIds:t,postType:n,renderingMode:o}=_(i=>{const{getCurrentPostType:a,getPostBlocksByName:l,getRenderingMode:d}=$(i(x)),u=a();return{postType:u,clientIds:l(we===u?lx:e),renderingMode:d()}},[e]),{enableComplementaryArea:r}=T(ce);return o==="post-only"&&n!==we||t.length===0?null:s.jsx(oe,{title:c("Content"),children:s.jsx(ix,{clientIds:t,onSelect:()=>{r("core","edit-post/document")}})})}const{BlockQuickNavigation:dx}=$(Se);function ux(){const e=_(o=>{const{getBlockTypes:r}=o(Ht);return r()},[]),t=f.useMemo(()=>e.filter(o=>o.category==="theme").map(({name:o})=>o),[e]),n=_(o=>{const{getBlocksByName:r}=o(M);return r(t)},[t]);return n.length===0?null:s.jsx(oe,{title:c("Content"),children:s.jsx(dx,{clientIds:n})})}function px(){return _(t=>{const{getCurrentPostType:n}=t(x);return n()},[])!==De?null:s.jsx(ux,{})}function mx(){const{hasBlockSelection:e}=_(r=>({hasBlockSelection:!!r(M).getBlockSelectionStart()}),[]),{getActiveComplementaryArea:t}=_(ce),{enableComplementaryArea:n}=T(ce),{get:o}=_(U);f.useEffect(()=>{const r=t("core"),i=["edit-post/document","edit-post/block"].includes(r),a=o("core","distractionFree");!i||a||(e?n("core","edit-post/block"):n("core","edit-post/document"))},[e,t,n,o])}const{Tabs:xt}=$(ht),hx=Kc.select({web:!0,native:!1}),gx=({tabName:e,keyboardShortcut:t,onActionPerformed:n,extraPanels:o})=>{const r=f.useRef(null),i=f.useContext(xt.Context);return f.useEffect(()=>{const a=Array.from(r.current?.querySelectorAll('[role="tab"]')||[]),l=a.find(p=>p.getAttribute("data-tab-id")===e),d=l?.ownerDocument.activeElement;a.some(p=>d&&d.id===p.id)&&l&&l.id!==d?.id&&l?.focus()},[e]),s.jsx(In,{identifier:e,header:s.jsx(xt.Context.Provider,{value:i,children:s.jsx(rx,{ref:r})}),closeLabel:c("Close Settings"),className:"editor-sidebar__panel",headerClassName:"editor-sidebar__panel-tabs",title:H("Settings","panel button label"),toggleShortcut:t,icon:it()?Qc:Xc,isActiveByDefault:hx,children:s.jsxs(xt.Context.Provider,{value:i,children:[s.jsxs(xt.TabPanel,{tabId:Fe.document,focusable:!1,children:[s.jsx(Zb,{onActionPerformed:n}),s.jsx(ya.Slot,{}),s.jsx(cx,{}),s.jsx(px,{}),s.jsx(nx,{}),s.jsx(mf,{}),s.jsx(jb,{}),o]}),s.jsx(xt.TabPanel,{tabId:Fe.block,focusable:!1,children:s.jsx(ra,{})})]})})},fx=({extraPanels:e,onActionPerformed:t})=>{mx();const{tabName:n,keyboardShortcut:o,showSummary:r}=_(l=>{const d=l(Mt).getShortcutRepresentation("core/editor/toggle-sidebar"),u=l(ce).getActiveComplementaryArea("core"),p=[Fe.block,Fe.document].includes(u);let m=u;return p||(m=l(M).getBlockSelectionStart()?Fe.block:Fe.document),{tabName:m,keyboardShortcut:d,showSummary:![we,De,dt].includes(l(x).getCurrentPostType())}},[]),{enableComplementaryArea:i}=T(ce),a=f.useCallback(l=>{l&&i("core",l)},[i]);return s.jsx(xt,{selectedTabId:n,onSelect:a,selectOnMove:!1,children:s.jsx(gx,{tabName:n,keyboardShortcut:o,showSummary:r,onActionPerformed:t,extraPanels:e})})};function bx({postType:e,postId:t,templateId:n,settings:o,children:r,initialEdits:i,onActionPerformed:a,extraContent:l,extraSidebarPanels:d,...u}){const{post:p,template:m,hasLoadedPost:h,error:g}=_(b=>{const{getEntityRecord:y,getResolutionError:v,hasFinishedResolution:w}=b(C),S=["postType",e,t];return{post:y(...S),template:n?y("postType",we,n):void 0,hasLoadedPost:w("getEntityRecord",S),error:v("getEntityRecord",S)?.message}},[e,t,n]);return s.jsxs(s.Fragment,{children:[h&&!p&&s.jsx(Et,{status:g?"error":"warning",isDismissible:!1,children:g||c("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")}),!!p&&s.jsxs(Jc,{post:p,__unstableTemplate:m,settings:o,initialEdits:i,useSubRegistry:!1,children:[s.jsx(Pb,{...u,children:l}),r,s.jsx(fx,{onActionPerformed:a,extraPanels:d})]})]})}const{PreferenceBaseOption:xx}=$(tt);function yx(e){const t=_(r=>r(x).isPublishSidebarEnabled(),[]),{enablePublishSidebar:n,disablePublishSidebar:o}=T(x);return s.jsx(xx,{isChecked:t,onChange:r=>r?n():o(),...e})}const{BlockManager:vx}=$(Se),_x=[];function wx(){const{showBlockTypes:e,hideBlockTypes:t}=$(T(x)),{blockTypes:n,allowedBlockTypes:o,hiddenBlockTypes:r}=_(p=>{var m;return{blockTypes:p(Ht).getBlockTypes(),allowedBlockTypes:p(x).getEditorSettings().allowedBlockTypes,hiddenBlockTypes:(m=p(U).get("core","hiddenBlockTypes"))!==null&&m!==void 0?m:_x}},[]),a=f.useMemo(()=>o===!0?n:n.filter(({name:p})=>o?.includes(p)),[o,n]).filter(p=>ed(p,"inserter",!0)&&(!p.parent||p.parent.includes("core/post-content"))),l=r.filter(p=>a.some(m=>m.name===p)),d=a.filter(p=>!l.includes(p.name)),u=p=>{if(d.length>p.length){const m=d.filter(h=>!p.find(({name:g})=>g===h.name));t(m.map(({name:h})=>h))}else if(d.length!d.find(({name:g})=>g===h.name));e(m.map(({name:h})=>h))}};return s.jsx(vx,{blockTypes:a,selectedBlockTypes:d,onChange:u})}const{PreferencesModal:Sx,PreferencesModalTabs:Cx,PreferencesModalSection:ze,PreferenceToggleControl:Ee}=$(tt);function Px({extraSections:e={}}){const t=_(o=>o(ce).isModalActive("editor/preferences"),[]),{closeModal:n}=T(ce);return t?s.jsx(Sx,{closeModal:n,children:s.jsx(kx,{extraSections:e})}):null}function kx({extraSections:e={}}){const t=ue("medium"),n=_(l=>{const{getEditorSettings:d}=l(x),{get:u}=l(U),p=d().richEditingEnabled;return!u("core","distractionFree")&&t&&p},[t]),{setIsListViewOpened:o,setIsInserterOpened:r}=T(x),{set:i}=T(U),a=f.useMemo(()=>[{name:"general",tabLabel:c("General"),content:s.jsxs(s.Fragment,{children:[s.jsxs(ze,{title:c("Interface"),children:[s.jsx(Ee,{scope:"core",featureName:"showListViewByDefault",help:c("Opens the List View panel by default."),label:c("Always open List View")}),n&&s.jsx(Ee,{scope:"core",featureName:"showBlockBreadcrumbs",help:c("Display the block hierarchy trail at the bottom of the editor."),label:c("Show block breadcrumbs")}),s.jsx(Ee,{scope:"core",featureName:"allowRightClickOverrides",help:c("Allows contextual List View menus via right-click, overriding browser defaults."),label:c("Allow right-click contextual menus")}),s.jsx(Ee,{scope:"core",featureName:"enableChoosePatternModal",help:c("Shows starter patterns when creating a new page."),label:c("Show starter patterns")})]}),s.jsxs(ze,{title:c("Document settings"),description:c("Select what settings are shown in the document panel."),children:[s.jsx(ro.Slot,{}),s.jsx(Ha,{taxonomyWrapper:(l,d)=>s.jsx(bt,{label:d.labels.menu_name,panelName:`taxonomy-panel-${d.slug}`})}),s.jsx(Ps,{children:s.jsx(bt,{label:c("Featured image"),panelName:"featured-image"})}),s.jsx(Ca,{children:s.jsx(bt,{label:c("Excerpt"),panelName:"post-excerpt"})}),s.jsx($e,{supportKeys:["comments","trackbacks"],children:s.jsx(bt,{label:c("Discussion"),panelName:"discussion-panel"})}),s.jsx(pa,{children:s.jsx(bt,{label:c("Page attributes"),panelName:"page-attributes"})})]}),t&&s.jsx(ze,{title:c("Publishing"),children:s.jsx(yx,{help:c("Review settings, such as visibility and tags."),label:c("Enable pre-publish checks")})}),e?.general]})},{name:"appearance",tabLabel:c("Appearance"),content:s.jsxs(ze,{title:c("Appearance"),description:c("Customize the editor interface to suit your needs."),children:[s.jsx(Ee,{scope:"core",featureName:"fixedToolbar",onToggle:()=>i("core","distractionFree",!1),help:c("Access all block and document tools in a single place."),label:c("Top toolbar")}),s.jsx(Ee,{scope:"core",featureName:"distractionFree",onToggle:()=>{i("core","fixedToolbar",!0),r(!1),o(!1)},help:c("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:c("Distraction free")}),s.jsx(Ee,{scope:"core",featureName:"focusMode",help:c("Highlights the current block and fades other content."),label:c("Spotlight mode")}),e?.appearance]})},{name:"accessibility",tabLabel:c("Accessibility"),content:s.jsxs(s.Fragment,{children:[s.jsx(ze,{title:c("Navigation"),description:c("Optimize the editing experience for enhanced control."),children:s.jsx(Ee,{scope:"core",featureName:"keepCaretInsideBlock",help:c("Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users."),label:c("Contain text cursor inside block")})}),s.jsx(ze,{title:c("Interface"),children:s.jsx(Ee,{scope:"core",featureName:"showIconLabels",label:c("Show button text labels"),help:c("Show text instead of icons on buttons across the interface.")})})]})},{name:"blocks",tabLabel:c("Blocks"),content:s.jsxs(s.Fragment,{children:[s.jsx(ze,{title:c("Inserter"),children:s.jsx(Ee,{scope:"core",featureName:"mostUsedBlocks",help:c("Adds a category with the most frequently used blocks in the inserter."),label:c("Show most used blocks")})}),s.jsx(ze,{title:c("Manage block visibility"),description:c("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."),children:s.jsx(wx,{})})]})},window.__experimentalMediaProcessing&&{name:"media",tabLabel:c("Media"),content:s.jsx(s.Fragment,{children:s.jsxs(ze,{title:c("General"),description:c("Customize options related to the media upload flow."),children:[s.jsx(Ee,{scope:"core/media",featureName:"optimizeOnUpload",help:c("Compress media items before uploading to the server."),label:c("Pre-upload compression")}),s.jsx(Ee,{scope:"core/media",featureName:"requireApproval",help:c("Require approval step when optimizing existing media."),label:c("Approval step")})]})})}].filter(Boolean),[n,e,r,o,i,t]);return s.jsx(Cx,{sections:a})}function jx({postType:e}){const{registerPostTypeSchema:t}=$(T(x));f.useEffect(()=>{t(e)},[t,e]);const{defaultFields:n}=_(a=>{const{getEntityFields:l}=$(a(x));return{defaultFields:l("postType",e)}},[e]),{records:o,isResolving:r}=td("root","user",{per_page:-1}),i=f.useMemo(()=>n.map(a=>a.id==="author"?{...a,elements:o?.map(({id:l,name:d})=>({value:l,label:d}))}:a),[o,n]);return{isLoading:r,fields:i}}const Pr="content",Tx={name:"core/pattern-overrides",getValues({select:e,clientId:t,context:n,bindings:o}){const r=n["pattern/overrides"],{getBlockAttributes:i}=e(M),a=i(t),l={};for(const d of Object.keys(o)){const u=r?.[a?.metadata?.name]?.[d];if(u===void 0){l[d]=a[d];continue}else l[d]=u===""?void 0:u}return l},setValues({select:e,dispatch:t,clientId:n,bindings:o}){const{getBlockAttributes:r,getBlockParentsByBlockName:i,getBlocks:a}=e(M),d=r(n)?.metadata?.name;if(!d)return;const[u]=i(n,"core/block",!0),p=Object.entries(o).reduce((h,[g,{newValue:b}])=>(h[g]=b,h),{});if(!u){const h=g=>{for(const b of g)b.attributes?.metadata?.name===d&&t(M).updateBlockAttributes(b.clientId,p),h(b.innerBlocks)};h(a());return}const m=r(u)?.[Pr];t(M).updateBlockAttributes(u,{[Pr]:{...m,[d]:{...m?.[d],...Object.entries(p).reduce((h,[g,b])=>(h[g]=b===void 0?"":b,h),{})}}})},canUserEditValue:()=>!0};function fn(e,t){const{getEditedEntityRecord:n}=e(C),{getRegisteredPostMeta:o}=$(e(C));let r;t?.postType&&t?.postId&&(r=n("postType",t?.postType,t?.postId).meta);const i=o(t?.postType),a={};return Object.entries(i||{}).forEach(([l,d])=>{if(l!=="footnotes"&&l.charAt(0)!=="_"){var u;a[l]={label:d.title||l,value:(u=r?.[l])!==null&&u!==void 0?u:d.default||void 0,type:d.type}}}),Object.keys(a||{}).length?a:null}const Ex={name:"core/post-meta",getValues({select:e,context:t,bindings:n}){const o=fn(e,t),r={};for(const[a,l]of Object.entries(n)){var i;const d=l.args.key,{value:u,label:p}=o?.[d]||{};r[a]=(i=u??p)!==null&&i!==void 0?i:d}return r},setValues({dispatch:e,context:t,bindings:n}){const o={};Object.values(n).forEach(({args:r,newValue:i})=>{o[r.key]=i}),e(C).editEntityRecord("postType",t?.postType,t?.postId,{meta:o})},canUserEditValue({select:e,context:t,args:n}){return!(t?.query||t?.queryId||!t?.postType||fn(e,t)?.[n.key]?.value===void 0||e(x).getEditorSettings().enableCustomFields||!e(C).canUser("update",{kind:"postType",name:t?.postType,id:t?.postId}))},getFieldsList({select:e,context:t}){return fn(e,t)}};function Nx(){$o(Tx),$o(Ex)}const{store:Ax,...Bx}=Lm,Ge={};sd(Ge,{CreateTemplatePartModal:ad,patternTitleField:id,templateTitleField:rd,BackButton:mo,EntitiesSavedStatesExtensible:Cs,Editor:bx,EditorContentSlotFill:Ka,GlobalStylesProvider:od,mergeBaseAndUserConfigs:nd,PluginPostExcerpt:lo,PostCardPanel:Ja,PreferencesModal:Px,usePostActions:Xa,usePostFields:jx,ToolsMoreMenuGroup:fo,ViewMoreMenuGroup:bo,ResizableEditor:Qa,registerCoreBlockBindingsSources:Nx,getTemplateInfo:Fs,interfaceStore:Ax,...Bx});function Ix(){const{registerShortcut:e}=T(Mt),{replaceBlocks:t}=T(M),{getBlockName:n,getSelectedBlockClientId:o,getBlockAttributes:r}=_(M),i=(a,l)=>{a.preventDefault();const d=o();if(d===null)return;const u=n(d),p=u==="core/paragraph",m=u==="core/heading";if(!p&&!m)return;const h=l===0?"core/paragraph":"core/heading",g=r(d);if(p&&l===0||m&&g.level===l)return;const b=u==="core/paragraph"?"align":"textAlign",y=h==="core/paragraph"?"align":"textAlign";t(d,Ne(h,{level:l,content:g.content,[y]:g[b]}))};return f.useEffect(()=>{e({name:"core/block-editor/transform-heading-to-paragraph",category:"block-library",description:c("Transform heading to paragraph."),keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}]}),[1,2,3,4,5,6].forEach(a=>{e({name:`core/block-editor/transform-paragraph-to-heading-${a}`,category:"block-library",description:c("Transform paragraph to heading."),keyCombination:{modifier:"access",character:`${a}`}})})},[e]),Ue("core/block-editor/transform-heading-to-paragraph",a=>i(a,0)),Ue("core/block-editor/transform-paragraph-to-heading-1",a=>i(a,1)),Ue("core/block-editor/transform-paragraph-to-heading-2",a=>i(a,2)),Ue("core/block-editor/transform-paragraph-to-heading-3",a=>i(a,3)),Ue("core/block-editor/transform-paragraph-to-heading-4",a=>i(a,4)),Ue("core/block-editor/transform-paragraph-to-heading-5",a=>i(a,5)),Ue("core/block-editor/transform-paragraph-to-heading-6",a=>i(a,6)),null}const tl={};ld(tl,{BlockKeyboardShortcuts:Ix});const Rx=":root{--wp-admin-theme-color: #007cba;--wp-admin-theme-color--rgb: 0, 124, 186;--wp-admin-theme-color-darker-10: #006ba1;--wp-admin-theme-color-darker-10--rgb: 0, 107, 161;--wp-admin-theme-color-darker-20: #005a87;--wp-admin-theme-color-darker-20--rgb: 0, 90, 135;--wp-admin-border-width-focus: 2px;--wp-block-synced-color: #7a00df;--wp-block-synced-color--rgb: 122, 0, 223;--wp-bound-block-color: var(--wp-block-synced-color)}@media (min-resolution: 192dpi){:root{--wp-admin-border-width-focus: 1.5px}}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:18px;line-height:1.5;--wp--style--block-gap: 2em}p{line-height:1.8}.editor-post-title__block{margin-top:2em;margin-bottom:1em;font-size:2.5em;font-weight:800}";[{block:"core/calendar",widget:"calendar"},{block:"core/search",widget:"search"},{block:"core/html",widget:"custom_html",transform:({content:e})=>({content:e})},{block:"core/archives",widget:"archives",transform:({count:e,dropdown:t})=>({displayAsDropdown:!!t,showPostCounts:!!e})},{block:"core/latest-posts",widget:"recent-posts",transform:({show_date:e,number:t})=>({displayPostDate:!!e,postsToShow:t})},{block:"core/latest-comments",widget:"recent-comments",transform:({number:e})=>({commentsToShow:e})},{block:"core/tag-cloud",widget:"tag_cloud",transform:({taxonomy:e,count:t})=>({showTagCounts:!!t,taxonomy:e})},{block:"core/categories",widget:"categories",transform:({count:e,dropdown:t,hierarchical:n})=>({displayAsDropdown:!!t,showPostCounts:!!e,showHierarchy:!!n})},{block:"core/audio",widget:"media_audio",transform:({url:e,preload:t,loop:n,attachment_id:o})=>({src:e,id:o,preload:t,loop:n})},{block:"core/video",widget:"media_video",transform:({url:e,preload:t,loop:n,attachment_id:o})=>({src:e,id:o,preload:t,loop:n})},{block:"core/image",widget:"media_image",transform:({alt:e,attachment_id:t,caption:n,height:o,link_classes:r,link_rel:i,link_target_blank:a,link_type:l,link_url:d,size:u,url:p,width:m})=>({alt:e,caption:n,height:o,id:t,link:d,linkClass:r,linkDestination:l,linkTarget:a?"_blank":void 0,rel:i,sizeSlug:u,url:p,width:m})},{block:"core/gallery",widget:"media_gallery",transform:({ids:e,link_type:t,size:n,number:o})=>({ids:e,columns:o,linkTo:t,sizeSlug:n,images:e.map(r=>({id:r}))})},{block:"core/rss",widget:"rss",transform:({url:e,show_author:t,show_date:n,show_summary:o,items:r})=>({feedURL:e,displayAuthor:!!t,displayDate:!!n,displayExcerpt:!!o,itemsToShow:r})}].map(({block:e,widget:t,transform:n})=>({type:"block",blocks:[e],isMatch:({idBase:o,instance:r})=>o===t&&!!r?.raw,transform:({instance:o})=>{const r=Ne(e,n?n(o.raw):void 0);return o.raw?.title?[Ne("core/heading",{content:o.raw.title}),r]:r}}));c("Widget Group"),c("Create a classic widget layout with a title that’s styled by your theme for your widget areas.");var Mx=Object.create;function Ln(){var e=Mx(null);return e.__=void 0,delete e.__,e}var sl=function(t,n,o){this.path=t,this.matcher=n,this.delegate=o};sl.prototype.to=function(t,n){var o=this.delegate;if(o&&o.willAddRoute&&(t=o.willAddRoute(this.matcher.target,t)),this.matcher.add(this.path,t),n){if(n.length===0)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,t,n,this.delegate)}};var js=function(t){this.routes=Ln(),this.children=Ln(),this.target=t};js.prototype.add=function(t,n){this.routes[t]=n};js.prototype.addChild=function(t,n,o,r){var i=new js(n);this.children[t]=i;var a=xo(t,i,r);r&&r.contextEntered&&r.contextEntered(n,a),o(a)};function xo(e,t,n){function o(r,i){var a=e+r;if(i)i(xo(a,t,n));else return new sl(a,t,n)}return o}function Lx(e,t,n){for(var o=0,r=0;r0&&t.charCodeAt(0)===47&&(t=t.substr(1));for(var o=t.split("/"),r=void 0,i=void 0,a=0;a2&&a.slice(l-2)==="[]"&&(d=!0,a=a.slice(0,l-2),o[a]||(o[a]=[])),u=i[1]?Er(i[1]):""),d?o[a].push(u):o[a]=u}return o};be.prototype.recognize=function(t){var n,o=[this.rootState],r={},i=!1,a=t.indexOf("#");a!==-1&&(t=t.substr(0,a));var l=t.indexOf("?");if(l!==-1){var d=t.substr(l+1,t.length);t=t.substr(0,l),r=this.parseQueryString(d)}t.charAt(0)!=="/"&&(t="/"+t);var u=t;be.ENCODE_AND_DECODE_PATH_SEGMENTS?t=ol(t):(t=decodeURI(t),u=decodeURI(u));var p=t.length;p>1&&t.charAt(p-1)==="/"&&(t=t.substr(0,p-1),u=u.substr(0,u.length-1),i=!0);for(var m=0;m=0&&(t.hash=e.substr(n),e=e.substr(0,n));var o=e.indexOf("?");o>=0&&(t.search=e.substr(o),e=e.substr(0,o)),e&&(t.pathname=e)}return t}const Es=Yx(),al=f.createContext(null),vo=f.createContext({pathArg:"p"}),Rr=new WeakMap;function Mr(){const e=Es.location;let t=Rr.get(e);return t||(t={...e,query:Object.fromEntries(new URLSearchParams(e.search))},Rr.set(e,t)),t}function Qx(){const e=f.useContext(al);if(!e)throw new Error("useLocation must be used within a RouterProvider");return e}function ll(){const{pathArg:e,beforeNavigate:t}=f.useContext(vo),n=cd(async(o,r={})=>{var i;const a=Bi(o),l=(i=We("http://domain.com/"+o))!==null&&i!==void 0?i:"",d=()=>{const p=t?t({path:l,query:a}):{path:l,query:a};return Es.push({search:Ii({[e]:p.path,...p.query})},r.state)};if(!window.matchMedia("(min-width: 782px)").matches||!document.startViewTransition||!r.transition){d();return}await new Promise(p=>{var m;const h=(m=r.transition)!==null&&m!==void 0?m:"";document.documentElement.classList.add(h),document.startViewTransition(()=>d()).finished.finally(()=>{document.documentElement.classList.remove(h),p()})})});return f.useMemo(()=>({navigate:n,back:Es.back}),[n])}function Xx(e,t,n,o){const{query:r={}}=e;return f.useMemo(()=>{const{[n]:i="/",...a}=r,l=t.recognize(i)?.[0];if(!l)return{name:"404",path:ye(i,a),areas:{},widths:{},query:a,params:{}};const d=l.handler,u=(p={})=>Object.fromEntries(Object.entries(p).map(([m,h])=>typeof h=="function"?[m,h({query:a,params:l.params,...o})]:[m,h]));return{name:d.name,areas:u(d.areas),widths:u(d.widths),params:l.params,query:a,path:ye(i,a)}},[t,r,n,o])}function Jx({routes:e,pathArg:t,beforeNavigate:n,children:o,matchResolverArgs:r}){const i=f.useSyncExternalStore(Es.listen,Mr,Mr),a=f.useMemo(()=>{const u=new be;return e.forEach(p=>{u.add([{path:p.path,handler:p}],{as:p.name})}),u},[e]),l=Xx(i,a,t,r),d=f.useMemo(()=>({beforeNavigate:n,pathArg:t}),[n,t]);return s.jsx(vo.Provider,{value:d,children:s.jsx(al.Provider,{value:l,children:o})})}function cl(e,t={}){var n;const o=ll(),{pathArg:r,beforeNavigate:i}=f.useContext(vo);function a(m){m?.preventDefault(),o.navigate(e,t)}const l=Bi(e),d=(n=We("http://domain.com/"+e))!==null&&n!==void 0?n:"",u=f.useMemo(()=>i?i({path:d,query:l}):{path:d,query:l},[d,l,i]),[p]=window.location.href.split("?");return{href:`${p}?${Ii({[r]:u.path,...u.query})}`,onClick:a}}function ey({to:e,options:t,children:n,...o}){const{href:r,onClick:i}=cl(e,t);return s.jsx("a",{href:r,onClick:i,...o,children:n})}const{lock:ty}=Nt("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/router"),_o={};ty(_o,{useHistory:ll,useLocation:Qx,RouterProvider:Jx,useLink:cl,Link:ey});const{lock:sy,unlock:dl}=Nt("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/core-commands"),{useHistory:ny}=dl(_o),oy=()=>function(){const t=We(window.location.href)?.includes("site-editor.php"),n=ny(),o=_(d=>d(C).getCurrentTheme()?.is_block_theme,[]),{saveEntityRecord:r}=T(C),{createErrorNotice:i}=T(fe),a=f.useCallback(async({close:d})=>{try{const u=await r("postType","page",{status:"draft"},{throwOnError:!0});u?.id&&n.navigate(`/page/${u.id}?canvas=edit`)}catch(u){const p=u.message&&u.code!=="unknown_error"?u.message:c("An error occurred while creating the item.");i(p,{type:"snackbar"})}finally{d()}},[i,n,r]);return{isLoading:!1,commands:f.useMemo(()=>{const d=t&&o?a:()=>document.location.href="post-new.php?post_type=page";return[{name:"core/add-new-page",label:c("Add new page"),icon:to,callback:d}]},[a,t,o])}};function ry(){Hp({name:"core/add-new-post",label:c("Add new post"),icon:to,callback:()=>{document.location.assign("post-new.php")}}),ft({name:"core/add-new-page",hook:oy()})}function iy(e=[],t=""){if(!Array.isArray(e)||!e.length)return[];if(!t)return e;const n=[],o=[];for(let r=0;r(o(e),()=>o.cancel()),[o,e]),t}const Lr=e=>function({search:n}){const o=wo(),{isBlockBasedTheme:r,canCreateTemplate:i}=_(p=>({isBlockBasedTheme:p(C).getCurrentTheme()?.is_block_theme,canCreateTemplate:p(C).canUser("create",{kind:"postType",name:"wp_template"})}),[]),a=ay(n),{records:l,isLoading:d}=_(p=>{if(!a)return{isLoading:!1};const m={search:a,per_page:10,orderby:"relevance",status:["publish","future","draft","pending","private"]};return{records:p(C).getEntityRecords("postType",e,m),isLoading:!p(C).hasFinishedResolution("getEntityRecords",["postType",e,m])}},[a]);return{commands:f.useMemo(()=>(l??[]).map(p=>{const m={name:e+"-"+p.id,searchLabel:p.title?.rendered+" "+p.id,label:p.title?.rendered?se(p.title?.rendered):c("(no title)"),icon:ul[e]};if(!i||e==="post"||e==="page"&&!r)return{...m,callback:({close:g})=>{const b={post:p.id,action:"edit"},y=ye("post.php",b);document.location=y,g()}};const h=We(window.location.href)?.includes("site-editor.php");return{...m,callback:({close:g})=>{h?o.navigate(`/${e}/${p.id}?canvas=edit`):document.location=ye("site-editor.php",{p:`/${e}/${p.id}`,canvas:"edit"}),g()}}}),[i,l,r,o]),isLoading:d}},Dr=e=>function({search:n}){const o=wo(),{isBlockBasedTheme:r,canCreateTemplate:i}=_(p=>({isBlockBasedTheme:p(C).getCurrentTheme()?.is_block_theme,canCreateTemplate:p(C).canUser("create",{kind:"postType",name:e})}),[]),{records:a,isLoading:l}=_(p=>{const{getEntityRecords:m}=p(C),h={per_page:-1};return{records:m("postType",e,h),isLoading:!p(C).hasFinishedResolution("getEntityRecords",["postType",e,h])}},[]),d=f.useMemo(()=>iy(a,n).slice(0,10),[a,n]);return{commands:f.useMemo(()=>{if(!i||!r&&!e==="wp_template_part")return[];const p=We(window.location.href)?.includes("site-editor.php"),m=[];return m.push(...d.map(h=>({name:e+"-"+h.id,searchLabel:h.title?.rendered+" "+h.id,label:h.title?.rendered?h.title?.rendered:c("(no title)"),icon:ul[e],callback:({close:g})=>{p?o.navigate(`/${e}/${h.id}?canvas=edit`):document.location=ye("site-editor.php",{p:`/${e}/${h.id}`,canvas:"edit"}),g()}}))),d?.length>0&&e==="wp_template_part"&&m.push({name:"core/edit-site/open-template-parts",label:c("Template parts"),icon:Ri,callback:({close:h})=>{p?o.navigate("/pattern?postType=wp_template_part&categoryId=all-parts"):document.location=ye("site-editor.php",{p:"/pattern",postType:"wp_template_part",categoryId:"all-parts"}),h()}}),m},[i,r,d,o]),isLoading:l}},ly=()=>function(){const t=wo(),n=We(window.location.href)?.includes("site-editor.php"),{isBlockBasedTheme:o,canCreateTemplate:r}=_(a=>({isBlockBasedTheme:a(C).getCurrentTheme()?.is_block_theme,canCreateTemplate:a(C).canUser("create",{kind:"postType",name:"wp_template"})}),[]);return{commands:f.useMemo(()=>{const a=[];return r&&o&&(a.push({name:"core/edit-site/open-navigation",label:c("Navigation"),icon:ud,callback:({close:l})=>{n?t.navigate("/navigation"):document.location=ye("site-editor.php",{p:"/navigation"}),l()}}),a.push({name:"core/edit-site/open-styles",label:c("Styles"),icon:zi,callback:({close:l})=>{n?t.navigate("/styles"):document.location=ye("site-editor.php",{p:"/styles"}),l()}}),a.push({name:"core/edit-site/open-pages",label:c("Pages"),icon:Mi,callback:({close:l})=>{n?t.navigate("/page"):document.location=ye("site-editor.php",{p:"/page"}),l()}}),a.push({name:"core/edit-site/open-templates",label:c("Templates"),icon:Wn,callback:({close:l})=>{n?t.navigate("/template"):document.location=ye("site-editor.php",{p:"/template"}),l()}})),a.push({name:"core/edit-site/open-patterns",label:c("Patterns"),icon:pd,callback:({close:l})=>{r?(n?t.navigate("/pattern"):document.location=ye("site-editor.php",{p:"/pattern"}),l()):document.location.href="edit.php?post_type=wp_block"}}),a},[t,n,r,o]),isLoading:!1}};function cy(){ft({name:"core/edit-site/navigate-pages",hook:Lr("page")}),ft({name:"core/edit-site/navigate-posts",hook:Lr("post")}),ft({name:"core/edit-site/navigate-templates",hook:Dr("wp_template")}),ft({name:"core/edit-site/navigate-template-parts",hook:Dr("wp_template_part")}),ft({name:"core/edit-site/basic-navigation",hook:ly(),context:"site-editor"})}function dy(){ry(),cy()}const pl={};sy(pl,{useCommands:dy});const{unlock:ie}=Nt("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/edit-post"),{BackButton:U1}=ie(Ge),uy="core/edit-post";function py(e=!1,t){switch(t.type){case"REQUEST_META_BOX_UPDATES":return!0;case"META_BOX_UPDATES_SUCCESS":case"META_BOX_UPDATES_FAILURE":return!1;default:return e}}function my(e=[],t){const n=[...e];for(const o of t){const r=n.findIndex(i=>i.id===o.id);r!==-1?n[r]=o:n.push(o)}return n}function hy(e={},t){switch(t.type){case"SET_META_BOXES_PER_LOCATIONS":{const n={...e};for(const[o,r]of Object.entries(t.metaBoxesPerLocation))n[o]=my(n[o],r);return n}}return e}function gy(e=!1,t){switch(t.type){case"META_BOXES_INITIALIZED":return!0}return e}const fy=Li({isSaving:py,locations:hy,initialized:gy}),by=Li({metaBoxes:fy}),xy=e=>{const t=document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`);return t||document.querySelector("#metaboxes .metabox-location-"+e)},{interfaceStore:jt}=ie(Ge),yy=e=>({registry:t})=>{t.dispatch(jt).enableComplementaryArea("core",e)},vy=()=>({registry:e})=>e.dispatch(jt).disableComplementaryArea("core"),_y=e=>({registry:t})=>(Y("select( 'core/edit-post' ).openModal( name )",{since:"6.3",alternative:"select( 'core/interface').openModal( name )"}),t.dispatch(jt).openModal(e)),wy=()=>({registry:e})=>(Y("select( 'core/edit-post' ).closeModal()",{since:"6.3",alternative:"select( 'core/interface').closeModal()"}),e.dispatch(jt).closeModal()),Sy=()=>({registry:e})=>{Y("dispatch( 'core/edit-post' ).openPublishSidebar",{since:"6.6",alternative:"dispatch( 'core/editor').openPublishSidebar"}),e.dispatch(x).openPublishSidebar()},Cy=()=>({registry:e})=>{Y("dispatch( 'core/edit-post' ).closePublishSidebar",{since:"6.6",alternative:"dispatch( 'core/editor').closePublishSidebar"}),e.dispatch(x).closePublishSidebar()},Py=()=>({registry:e})=>{Y("dispatch( 'core/edit-post' ).togglePublishSidebar",{since:"6.6",alternative:"dispatch( 'core/editor').togglePublishSidebar"}),e.dispatch(x).togglePublishSidebar()},ky=e=>({registry:t})=>{Y("dispatch( 'core/edit-post' ).toggleEditorPanelEnabled",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelEnabled"}),t.dispatch(x).toggleEditorPanelEnabled(e)},jy=e=>({registry:t})=>{Y("dispatch( 'core/edit-post' ).toggleEditorPanelOpened",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelOpened"}),t.dispatch(x).toggleEditorPanelOpened(e)},Ty=e=>({registry:t})=>{Y("dispatch( 'core/edit-post' ).removeEditorPanel",{since:"6.5",alternative:"dispatch( 'core/editor').removeEditorPanel"}),t.dispatch(x).removeEditorPanel(e)},Ey=e=>({registry:t})=>t.dispatch(U).toggle("core/edit-post",e),Ny=e=>({registry:t})=>{Y("dispatch( 'core/edit-post' ).switchEditorMode",{since:"6.6",alternative:"dispatch( 'core/editor').switchEditorMode"}),t.dispatch(x).switchEditorMode(e)},Ay=e=>({registry:t})=>{const n=t.select(jt).isItemPinned("core",e);t.dispatch(jt)[n?"unpinItem":"pinItem"]("core",e)};function By(){return Y("dispatch( 'core/edit-post' ).updatePreferredStyleVariations",{since:"6.6",hint:"Preferred Style Variations are not supported anymore."}),{type:"NOTHING"}}const Iy=e=>({registry:t})=>{ie(t.dispatch(x)).showBlockTypes(e)},Ry=e=>({registry:t})=>{ie(t.dispatch(x)).hideBlockTypes(e)};function My(e){return{type:"SET_META_BOXES_PER_LOCATIONS",metaBoxesPerLocation:e}}const Ly=()=>async({registry:e,select:t,dispatch:n})=>{n({type:"REQUEST_META_BOX_UPDATES"}),window.tinyMCE&&window.tinyMCE.triggerSave();const o=new window.FormData(document.querySelector(".metabox-base-form")),r=o.get("post_ID"),i=o.get("post_type"),a=e.select(C).getEditedEntityRecord("postType",i,r),l=[a.comment_status?["comment_status",a.comment_status]:!1,a.ping_status?["ping_status",a.ping_status]:!1,a.sticky?["sticky",a.sticky]:!1,a.author?["post_author",a.author]:!1].filter(Boolean),d=t.getActiveMetaBoxLocations(),p=[o,...d.map(m=>new window.FormData(xy(m)))].reduce((m,h)=>{for(const[g,b]of h)m.append(g,b);return m},new window.FormData);l.forEach(([m,h])=>p.append(m,h));try{await md({url:window._wpMetaBoxUrl,method:"POST",body:p,parse:!1}),n.metaBoxUpdatesSuccess()}catch{n.metaBoxUpdatesFailure()}};function Dy(){return{type:"META_BOX_UPDATES_SUCCESS"}}function Fy(){return{type:"META_BOX_UPDATES_FAILURE"}}const Oy=e=>({registry:t})=>{Y("dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType",{since:"6.5",version:"6.7",hint:"registry.dispatch( editorStore ).setDeviceType"}),t.dispatch(x).setDeviceType(e)},$y=e=>({registry:t})=>{Y("dispatch( 'core/edit-post' ).setIsInserterOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsInserterOpened"}),t.dispatch(x).setIsInserterOpened(e)},Vy=e=>({registry:t})=>{Y("dispatch( 'core/edit-post' ).setIsListViewOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsListViewOpened"}),t.dispatch(x).setIsListViewOpened(e)};function Hy(){return Y("dispatch( 'core/edit-post' ).setIsEditingTemplate",{since:"6.5",alternative:"dispatch( 'core/editor').setRenderingMode"}),{type:"NOTHING"}}function zy(){return Y("dispatch( 'core/edit-post' ).__unstableCreateTemplate",{since:"6.5"}),{type:"NOTHING"}}let Fr=!1;const Uy=()=>({registry:e,select:t,dispatch:n})=>{if(!e.select(x).__unstableIsEditorReady()||Fr)return;const r=e.select(x).getCurrentPostType();window.postboxes.page!==r&&window.postboxes.add_postbox_toggles(r),Fr=!0,Di("editor.savePost","core/edit-post/save-metaboxes",async(i,a)=>{!a.isAutosave&&t.hasMetaBoxes()&&await n.requestMetaBoxUpdates()}),n({type:"META_BOXES_INITIALIZED"})},Wy=()=>({registry:e})=>{Y("dispatch( 'core/edit-post' ).toggleDistractionFree",{since:"6.6",alternative:"dispatch( 'core/editor').toggleDistractionFree"}),e.dispatch(x).toggleDistractionFree()},Gy=()=>({registry:e})=>{const t=e.select(U).get("core/edit-post","fullscreenMode");e.dispatch(U).toggle("core/edit-post","fullscreenMode"),e.dispatch(fe).createInfoNotice(t?c("Fullscreen mode deactivated."):c("Fullscreen mode activated."),{id:"core/edit-post/toggle-fullscreen-mode/notice",type:"snackbar",actions:[{label:c("Undo"),onClick:()=>{e.dispatch(U).toggle("core/edit-post","fullscreenMode")}}]})},Yy=Object.freeze(Object.defineProperty({__proto__:null,__experimentalSetPreviewDeviceType:Oy,__unstableCreateTemplate:zy,closeGeneralSidebar:vy,closeModal:wy,closePublishSidebar:Cy,hideBlockTypes:Ry,initializeMetaBoxes:Uy,metaBoxUpdatesFailure:Fy,metaBoxUpdatesSuccess:Dy,openGeneralSidebar:yy,openModal:_y,openPublishSidebar:Sy,removeEditorPanel:Ty,requestMetaBoxUpdates:Ly,setAvailableMetaBoxesPerLocation:My,setIsEditingTemplate:Hy,setIsInserterOpened:$y,setIsListViewOpened:Vy,showBlockTypes:Iy,switchEditorMode:Ny,toggleDistractionFree:Wy,toggleEditorPanelEnabled:ky,toggleEditorPanelOpened:jy,toggleFeature:Ey,toggleFullscreenMode:Gy,togglePinnedPluginItem:Ay,togglePublishSidebar:Py,updatePreferredStyleVariations:By},Symbol.toStringTag,{value:"Module"})),{interfaceStore:ss}=ie(Ge),qy=[],Zy={},Ky=re(e=>()=>{var t;return(t=e(U).get("core","editorMode"))!==null&&t!==void 0?t:"visual"}),Qy=re(e=>()=>{const t=e(ss).getActiveComplementaryArea("core");return["edit-post/document","edit-post/block"].includes(t)}),Xy=re(e=>()=>{const t=e(ss).getActiveComplementaryArea("core");return!!t&&!["edit-post/document","edit-post/block"].includes(t)}),Jy=re(e=>()=>e(ss).getActiveComplementaryArea("core"));function ev(e,t){var n;const o=e?.reduce((i,a)=>({...i,[a]:{enabled:!1}}),{}),r=t?.reduce((i,a)=>{const l=i?.[a];return{...i,[a]:{...l,opened:!0}}},o??{});return(n=r??o)!==null&&n!==void 0?n:Zy}const ml=re(e=>()=>{Y("select( 'core/edit-post' ).getPreferences",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const t=["editorMode","hiddenBlockTypes"].reduce((i,a)=>{const l=e(U).get("core",a);return{...i,[a]:l}},{}),n=e(U).get("core","inactivePanels"),o=e(U).get("core","openPanels"),r=ev(n,o);return{...t,panels:r}});function tv(e,t,n){Y("select( 'core/edit-post' ).getPreference",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const r=ml(e)[t];return r===void 0?n:r}const sv=re(e=>()=>{var t;return(t=e(U).get("core","hiddenBlockTypes"))!==null&&t!==void 0?t:qy}),nv=re(e=>()=>(Y("select( 'core/edit-post' ).isPublishSidebarOpened",{since:"6.6",alternative:"select( 'core/editor' ).isPublishSidebarOpened"}),e(x).isPublishSidebarOpened())),ov=re(e=>(t,n)=>(Y("select( 'core/edit-post' ).isEditorPanelRemoved",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelRemoved"}),e(x).isEditorPanelRemoved(n))),rv=re(e=>(t,n)=>(Y("select( 'core/edit-post' ).isEditorPanelEnabled",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelEnabled"}),e(x).isEditorPanelEnabled(n))),iv=re(e=>(t,n)=>(Y("select( 'core/edit-post' ).isEditorPanelOpened",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelOpened"}),e(x).isEditorPanelOpened(n))),av=re(e=>(t,n)=>(Y("select( 'core/edit-post' ).isModalActive",{since:"6.3",alternative:"select( 'core/interface' ).isModalActive"}),!!e(ss).isModalActive(n))),lv=re(e=>(t,n)=>!!e(U).get("core/edit-post",n)),cv=re(e=>(t,n)=>e(ss).isItemPinned("core",n)),hl=Fi(e=>Object.keys(e.metaBoxes.locations).filter(t=>So(e,t)),e=>[e.metaBoxes.locations]),dv=re(e=>(t,n)=>So(t,n)&&Co(t,n)?.some(({id:o})=>e(x).isEditorPanelEnabled(`meta-box-${o}`)));function So(e,t){const n=Co(e,t);return!!n&&n.length!==0}function Co(e,t){return e.metaBoxes.locations[t]}const uv=Fi(e=>Object.values(e.metaBoxes.locations).flat(),e=>[e.metaBoxes.locations]);function pv(e){return hl(e).length>0}function mv(e){return e.metaBoxes.isSaving}const hv=re(e=>()=>(Y("select( 'core/edit-site' ).__experimentalGetPreviewDeviceType",{since:"6.5",version:"6.7",alternative:"select( 'core/editor' ).getDeviceType"}),e(x).getDeviceType())),gv=re(e=>()=>(Y("select( 'core/edit-post' ).isInserterOpened",{since:"6.5",alternative:"select( 'core/editor' ).isInserterOpened"}),e(x).isInserterOpened())),fv=re(e=>()=>(Y("select( 'core/edit-post' ).__experimentalGetInsertionPoint",{since:"6.5",version:"6.7"}),ie(e(x)).getInserter())),bv=re(e=>()=>(Y("select( 'core/edit-post' ).isListViewOpened",{since:"6.5",alternative:"select( 'core/editor' ).isListViewOpened"}),e(x).isListViewOpened())),xv=re(e=>()=>(Y("select( 'core/edit-post' ).isEditingTemplate",{since:"6.5",alternative:"select( 'core/editor' ).getRenderingMode"}),e(x).getCurrentPostType()==="wp_template"));function yv(e){return e.metaBoxes.initialized}const vv=re(e=>()=>{const{id:t,type:n}=e(x).getCurrentPost(),o=ie(e(C)).getTemplateId(n,t);if(o)return e(C).getEditedEntityRecord("postType","wp_template",o)}),_v=Object.freeze(Object.defineProperty({__proto__:null,__experimentalGetInsertionPoint:fv,__experimentalGetPreviewDeviceType:hv,areMetaBoxesInitialized:yv,getActiveGeneralSidebarName:Jy,getActiveMetaBoxLocations:hl,getAllMetaBoxes:uv,getEditedPostTemplate:vv,getEditorMode:Ky,getHiddenBlockTypes:sv,getMetaBoxesPerLocation:Co,getPreference:tv,getPreferences:ml,hasMetaBoxes:pv,isEditingTemplate:xv,isEditorPanelEnabled:rv,isEditorPanelOpened:iv,isEditorPanelRemoved:ov,isEditorSidebarOpened:Qy,isFeatureActive:lv,isInserterOpened:gv,isListViewOpened:bv,isMetaBoxLocationActive:So,isMetaBoxLocationVisible:dv,isModalActive:av,isPluginItemPinned:cv,isPluginSidebarOpened:Xy,isPublishSidebarOpened:nv,isSavingMetaBoxes:mv},Symbol.toStringTag,{value:"Module"})),en=ci(uy,{reducer:by,actions:Yy,selectors:_v});di(en);function wv(e){return ye("post.php",{post:e,action:"edit"})}class Sv extends f.Component{constructor(){super(...arguments),this.state={historyId:null}}componentDidUpdate(t){const{postId:n,postStatus:o}=this.props,{historyId:r}=this.state;(n!==t.postId||n!==r)&&o!=="auto-draft"&&n&&this.setBrowserURL(n)}setBrowserURL(t){window.history.replaceState({id:t},"Post "+t,wv(t)),this.setState(()=>({historyId:t}))}render(){return null}}Bt(e=>{const{getCurrentPost:t}=e(x),n=t();let{id:o,status:r,type:i}=n;return["wp_template","wp_template_part"].includes(i)&&(o=n.wp_id),{postId:o,postStatus:r}})(Sv);const{PreferenceBaseOption:Cv}=ie(tt);function Pv(){const e=document.getElementById("toggle-custom-fields-form");e.querySelector('[name="_wp_http_referer"]').setAttribute("value",Qd(window.location.href)),e.submit()}function kv({willEnable:e}){const[t,n]=f.useState(!1);return s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"edit-post-preferences-modal__custom-fields-confirmation-message",children:c("A page reload is required for this change. Make sure your content is saved before reloading.")}),s.jsx(B,{__next40pxDefaultSize:!0,variant:"secondary",isBusy:t,accessibleWhenDisabled:!0,disabled:t,onClick:()=>{n(!0),Pv()},children:e?c("Show & Reload Page"):c("Hide & Reload Page")})]})}function jv({label:e}){const t=_(r=>!!r(x).getEditorSettings().enableCustomFields,[]),[n,o]=f.useState(t);return s.jsx(Cv,{label:e,isChecked:n,onChange:o,children:n!==t&&s.jsx(kv,{willEnable:n})})}const{PreferenceBaseOption:Tv}=ie(tt);function Ev(e){const{toggleEditorPanelEnabled:t}=T(x),{isChecked:n,isRemoved:o}=_(r=>{const{isEditorPanelEnabled:i,isEditorPanelRemoved:a}=r(x);return{isChecked:i(e.panelName),isRemoved:a(e.panelName)}},[e.panelName]);return o?null:s.jsx(Tv,{isChecked:n,onChange:()=>t(e.panelName),...e})}const{PreferencesModalSection:Nv}=ie(tt);function Av({areCustomFieldsRegistered:e,metaBoxes:t,...n}){const o=t.filter(({id:r})=>r!=="postcustom");return!e&&o.length===0?null:s.jsxs(Nv,{...n,children:[e&&s.jsx(jv,{label:c("Custom fields")}),o.map(({id:r,title:i})=>s.jsx(Ev,{label:i,panelName:`meta-box-${r}`},r))]})}Bt(e=>{const{getEditorSettings:t}=e(x),{getAllMetaBoxes:n}=e(en);return{areCustomFieldsRegistered:t().enableCustomFields!==void 0,metaBoxes:n()}})(Av);const{PreferenceToggleControl:W1}=ie(tt),{PreferencesModal:G1}=ie(Ge),{ToolsMoreMenuGroup:Y1,ViewMoreMenuGroup:q1}=ie(Ge),{getLayoutStyles:Z1}=ie(Se),{useCommands:K1}=ie(pl),{useCommandContext:Q1}=ie(hd),{Editor:X1,FullscreenMode:J1,NavigableRegion:e_}=ie(Ge),{BlockKeyboardShortcuts:t_}=ie(tl),{PluginPostExcerpt:s_}=ie(Ge);We(window.location.href)?.includes("site-editor.php");const{BackButton:n_,registerCoreBlockBindingsSources:o_}=ie(Ge),bn="core/bold",xn=c("Bold"),Bv={name:bn,title:xn,tagName:"strong",className:null,edit({isActive:e,value:t,onChange:n,onFocus:o}){function r(){n(Oe(t,{type:bn,title:xn}))}function i(){n(Oe(t,{type:bn})),o()}return s.jsxs(s.Fragment,{children:[s.jsx(Je,{type:"primary",character:"b",onUse:r}),s.jsx(Re,{name:"bold",icon:nu,title:xn,onClick:i,isActive:e,shortcutType:"primary",shortcutCharacter:"b"}),s.jsx(no,{inputType:"formatBold",onInput:r})]})}},yn="core/code",vn=c("Inline code"),Iv={name:yn,title:vn,tagName:"code",className:null,__unstableInputRule(e){const t="`",{start:n,text:o}=e;if(o[n-1]!==t||n-2<0)return e;const i=o.lastIndexOf(t,n-2);if(i===-1)return e;const a=i,l=n-2;return a===l||(e=Ho(e,a,a+1),e=Ho(e,l,l+1),e=Be(e,{type:yn},a,l)),e},edit({value:e,onChange:t,onFocus:n,isActive:o}){function r(){t(Oe(e,{type:yn,title:vn})),n()}return s.jsxs(s.Fragment,{children:[s.jsx(Je,{type:"access",character:"x",onUse:r}),s.jsx(Re,{icon:gd,title:vn,onClick:r,isActive:o,role:"menuitemcheckbox"})]})}},Rv=["image"],Po="core/image",gl=c("Inline image"),fl={name:Po,title:gl,keywords:[c("photo"),c("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:Lv};function Mv({value:e,onChange:t,activeObjectAttributes:n,contentRef:o}){const{style:r,alt:i}=n,a=r?.replace(/\D/g,""),[l,d]=f.useState(a),[u,p]=f.useState(i),m=l!==a||u!==i,h=Ws({editableContentElement:o.current,settings:fl});return s.jsx(et,{placement:"bottom",focusOnMount:!1,anchor:h,className:"block-editor-format-toolbar__image-popover",children:s.jsx("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:g=>{const b=e.replacements.slice();b[e.start]={type:Po,attributes:{...n,style:l?`width: ${l}px;`:"",alt:u}},t({...e,replacements:b}),g.preventDefault()},children:s.jsxs(G,{spacing:4,children:[s.jsx(Ai,{__next40pxDefaultSize:!0,label:c("Width"),value:l,min:1,onChange:g=>{d(g)}}),s.jsx(Vs,{label:c("Alternative text"),__nextHasNoMarginBottom:!0,value:u,onChange:g=>{p(g)},help:s.jsxs(s.Fragment,{children:[s.jsx(Xe,{href:c("https://www.w3.org/WAI/tutorials/images/decision-tree/"),children:c("Describe the purpose of the image.")}),s.jsx("br",{}),c("Leave empty if decorative.")]})}),s.jsx(le,{justify:"right",children:s.jsx(B,{disabled:!m,accessibleWhenDisabled:!0,variant:"primary",type:"submit",size:"compact",children:c("Apply")})})]})})})}function Lv({value:e,onChange:t,onFocus:n,isObjectActive:o,activeObjectAttributes:r,contentRef:i}){return s.jsxs(xi,{children:[s.jsx(yi,{allowedTypes:Rv,onSelect:({id:a,url:l,alt:d,width:u})=>{t(fd(e,{type:Po,attributes:{className:`wp-image-${a}`,style:`width: ${Math.min(u,150)}px;`,url:l,alt:d}})),n()},render:({open:a})=>s.jsx(Re,{icon:s.jsx(X,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:s.jsx(W,{d:"M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z"})}),title:gl,onClick:a,isActive:o})}),o&&s.jsx(Mv,{value:e,onChange:t,activeObjectAttributes:r,contentRef:i})]})}const _n="core/italic",wn=c("Italic"),Dv={name:_n,title:wn,tagName:"em",className:null,edit({isActive:e,value:t,onChange:n,onFocus:o}){function r(){n(Oe(t,{type:_n,title:wn}))}function i(){n(Oe(t,{type:_n})),o()}return s.jsxs(s.Fragment,{children:[s.jsx(Je,{type:"primary",character:"i",onUse:r}),s.jsx(Re,{name:"italic",icon:ou,title:wn,onClick:i,isActive:e,shortcutType:"primary",shortcutCharacter:"i"}),s.jsx(no,{inputType:"formatItalic",onInput:r})]})}};function bl(e){if(!e)return!1;const t=e.trim();if(!t)return!1;if(/^\S+:/.test(t)){const n=bd(t);if(!xd(n)||n.startsWith("http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;const o=yd(t);if(!qd(o))return!1;const r=We(t);if(r&&!Zd(r))return!1;const i=qr(t);if(i&&!Kd(i))return!1;const a=vd(t);if(a&&!zo(a))return!1}return!(t.startsWith("#")&&!zo(t))}function Fv({url:e,type:t,id:n,opensInNewWindow:o,nofollow:r}){const i={type:"core/link",attributes:{url:e}};return t&&(i.attributes.type=t),n&&(i.attributes.id=n),o&&(i.attributes.target="_blank",i.attributes.rel=i.attributes.rel?i.attributes.rel+" noreferrer noopener":"noreferrer noopener"),r&&(i.attributes.rel=i.attributes.rel?i.attributes.rel+" nofollow":"nofollow"),i}function xl(e,t,n=e.start,o=e.end){const r={start:null,end:null},{formats:i}=e;let a,l;if(!i?.length)return r;const d=i.slice(),u=d[n]?.find(({type:b})=>b===t.type),p=d[o]?.find(({type:b})=>b===t.type),m=d[o-1]?.find(({type:b})=>b===t.type);if(u)a=u,l=n;else if(p)a=p,l=o;else if(m)a=m,l=o-1;else return r;const h=d[l].indexOf(a),g=[d,l,a,h];return n=Ov(...g),o=$v(...g),n=n<0?0:n,{start:n,end:o}}function yl(e,t,n,o,r){let i=t;const l={forwards:1,backwards:-1}[r]||1,d=l*-1;for(;e[i]&&e[i][o]===n;)i=i+l;return i=i+d,i}const vl=(e,...t)=>(...n)=>e(...n,...t),Ov=vl(yl,"backwards"),$v=vl(yl,"forwards"),Vv=[...Oi.DEFAULT_LINK_SETTINGS,{id:"nofollow",title:c("Mark as nofollow")}];function Hv({isActive:e,activeAttributes:t,value:n,onChange:o,onFocusOutside:r,stopAddingLink:i,contentRef:a,focusOnMount:l}){const u=zv(n,e).text,{selectionChange:p}=T(M),{createPageEntity:m,userCanCreatePages:h,selectionStart:g}=_(k=>{const{getSettings:E,getSelectionStart:R}=k(M),j=E();return{createPageEntity:j.__experimentalCreatePageEntity,userCanCreatePages:j.__experimentalUserCanCreatePages,selectionStart:R()}},[]),b=f.useMemo(()=>({url:t.url,type:t.type,id:t.id,opensInNewTab:t.target==="_blank",nofollow:t.rel?.includes("nofollow"),title:u}),[t.id,t.rel,t.target,t.type,t.url,u]);function y(){const k=ut(n,"core/link");o(k),i(),ke(c("Link removed."),"assertive")}function v(k){const R=!b?.url;k={...b,...k};const j=_d(k.url),N=Fv({url:j,type:k.type,id:k.id!==void 0&&k.id!==null?String(k.id):void 0,opensInNewWindow:k.opensInNewTab,nofollow:k.nofollow}),A=k.title||j;let I;if(Gs(n)&&!e){const D=zs(n,A);I=Be(D,N,n.start,n.start+A.length),o(I),i(),p({clientId:g.clientId,identifier:g.attributeKey,start:n.start+A.length+1});return}else if(A===u)I=Be(n,N);else{I=Os({text:A}),I=Be(I,N,0,A.length);const D=xl(n,{type:"core/link"}),[O,F]=wd(n,D.start,D.start),L=Xd(F,u,I);I=Sd(O,L)}o(I),R||i(),bl(j)?e?ke(c("Link edited."),"assertive"):ke(c("Link inserted."),"assertive"):ke(c("Warning: the link has been inserted but may have errors. Please test it."),"assertive")}const w=Ws({editableContentElement:a.current,settings:{...wl,isActive:e}});async function S(k){const E=await m({title:k,status:"draft"});return{id:E.id,type:E.type,title:E.title.rendered,url:E.link,kind:"post-type"}}function P(k){return ct(V(c("Create page: %s"),k),{mark:s.jsx("mark",{})})}return s.jsx(et,{anchor:w,animate:!1,onClose:i,onFocusOutside:r,placement:"bottom",offset:8,shift:!0,focusOnMount:l,constrainTabbing:!0,children:s.jsx(Oi,{value:b,onChange:v,onRemove:y,hasRichPreviews:!0,createSuggestion:m&&S,withCreateSuggestion:h,createSuggestionButtonText:P,hasTextControl:!0,settings:Vv,showInitialSuggestions:!0,suggestionsQuery:{initialSuggestionsSearchOptions:{type:"post",subtype:"page",perPage:20}}})})}function zv(e,t){let n=e.start,o=e.end;if(t){const r=xl(e,{type:"core/link"});n=r.start,o=r.end+1}return so(e,n,o)}const vt="core/link",_l=c("Link");function Uv({isActive:e,activeAttributes:t,value:n,onChange:o,onFocus:r,contentRef:i}){const[a,l]=f.useState(!1),[d,u]=f.useState(null);f.useEffect(()=>{e||l(!1)},[e]),f.useLayoutEffect(()=>{const v=i.current;if(!v)return;function w(S){const P=S.target.closest("[contenteditable] a");!P||!e||(l(!0),u({el:P,action:"click"}))}return v.addEventListener("click",w),()=>{v.removeEventListener("click",w)}},[i,e]);function p(v){const w=mi(so(n));!e&&w&&$i(w)&&bl(w)?o(Be(n,{type:vt,attributes:{url:w}})):!e&&w&&Pd(w)?o(Be(n,{type:vt,attributes:{url:`mailto:${w}`}})):!e&&w&&Yd(w)?o(Be(n,{type:vt,attributes:{url:`tel:${w.replace(/\D/g,"")}`}})):(v&&u({el:v,action:null}),l(!0))}function m(){l(!1),d?.el?.tagName==="BUTTON"?d.el.focus():r(),u(null)}function h(){l(!1),u(null)}function g(){o(ut(n,vt)),ke(c("Link removed."),"assertive")}const b=!(d?.el?.tagName==="A"&&d?.action==="click"),y=!Gs(n);return s.jsxs(s.Fragment,{children:[y&&s.jsx(Je,{type:"primary",character:"k",onUse:p}),s.jsx(Je,{type:"primaryShift",character:"k",onUse:g}),s.jsx(Re,{name:"link",icon:Cd,title:e?c("Link"):_l,onClick:v=>{p(v.currentTarget)},isActive:e||a,shortcutType:"primary",shortcutCharacter:"k","aria-haspopup":"true","aria-expanded":a}),a&&s.jsx(Hv,{stopAddingLink:m,onFocusOutside:h,isActive:e,activeAttributes:t,value:n,onChange:o,contentRef:i,focusOnMount:b?"firstElement":!1})]})}const wl={name:vt,title:_l,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",_id:"id",target:"target",rel:"rel"},__unstablePasteRule(e,{html:t,plainText:n}){const o=(t||n).replace(/<[^>]+>/g,"").trim();if(!$i(o)||!/^https?:/.test(o))return e;window.console.log(`Created link: - -`,o);const r={type:vt,attributes:{url:se(o)}};return Gs(e)?zs(e,Be(Os({text:n}),r,0,n.length)):Be(e,r)},edit:Uv},Or="core/strikethrough",Sn=c("Strikethrough"),Wv={name:Or,title:Sn,tagName:"s",className:null,edit({isActive:e,value:t,onChange:n,onFocus:o}){function r(){n(Oe(t,{type:Or,title:Sn})),o()}return s.jsxs(s.Fragment,{children:[s.jsx(Je,{type:"access",character:"d",onUse:r}),s.jsx(Re,{icon:kd,title:Sn,onClick:r,isActive:e,role:"menuitemcheckbox"})]})}},$r="core/underline",Vr=c("Underline"),Gv={name:$r,title:Vr,tagName:"span",className:null,attributes:{style:"style"},edit({value:e,onChange:t}){const n=()=>{t(Oe(e,{type:$r,attributes:{style:"text-decoration: underline;"},title:Vr}))};return s.jsxs(s.Fragment,{children:[s.jsx(Je,{type:"primary",character:"u",onUse:n}),s.jsx(no,{inputType:"formatUnderline",onInput:n})]})}},{unlock:Yv}=Nt("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/format-library"),{Tabs:ms}=Yv(ht),Hr=[{name:"color",title:c("Text")},{name:"backgroundColor",title:c("Background")}];function qv(e=""){return e.split(";").reduce((t,n)=>{if(n){const[o,r]=n.split(":");o==="color"&&(t.color=r),o==="background-color"&&r!==tn&&(t.backgroundColor=r)}return t},{})}function Zv(e="",t){return e.split(" ").reduce((n,o)=>{if(o.startsWith("has-")&&o.endsWith("-color")){const r=o.replace(/^has-/,"").replace(/-color$/,""),i=Td(t,r);n.color=i.color}return n},{})}function ko(e,t,n){const o=Kr(e,t);return o?{...qv(o.attributes.style),...Zv(o.attributes.class,n)}:{}}function Kv(e,t,n,o){const{color:r,backgroundColor:i}={...ko(e,t,n),...o};if(!r&&!i)return ut(e,t);const a=[],l=[],d={};if(i?a.push(["background-color",i].join(":")):a.push(["background-color",tn].join(":")),r){const u=Ed(n,r);u?l.push(Nd("color",u.slug)):a.push(["color",r].join(":"))}return a.length&&(d.style=a.join(";")),l.length&&(d.class=l.join(" ")),Be(e,{type:t,attributes:d})}function Qv({name:e,property:t,value:n,onChange:o}){const r=_(a=>{var l;const{getSettings:d}=a(M);return(l=d().colors)!==null&&l!==void 0?l:[]},[]),i=f.useMemo(()=>ko(n,e,r),[e,n,r]);return s.jsx(jd,{value:i[t],onChange:a=>{o(Kv(n,e,r,{[t]:a}))},enableAlpha:!0,__experimentalIsRenderedInSidebar:!0})}function Xv({name:e,value:t,onChange:n,onClose:o,contentRef:r,isActive:i}){const a=Ws({editableContentElement:r.current,settings:{...Cl,isActive:i}});return s.jsx(et,{onClose:o,className:"format-library__inline-color-popover",anchor:a,children:s.jsxs(ms,{children:[s.jsx(ms.TabList,{children:Hr.map(l=>s.jsx(ms.Tab,{tabId:l.name,children:l.title},l.name))}),Hr.map(l=>s.jsx(ms.TabPanel,{tabId:l.name,focusable:!1,children:s.jsx(Qv,{name:e,property:l.name,value:t,onChange:n})},l.name))]})})}const tn="rgba(0, 0, 0, 0)",bs="core/text-color",Sl=c("Highlight"),Jv=[];function Dn(e,t){const{ownerDocument:n}=e,{defaultView:o}=n,i=o.getComputedStyle(e).getPropertyValue(t);return t==="background-color"&&i===tn&&e.parentElement?Dn(e.parentElement,t):i}function e1(e,{color:t,backgroundColor:n}){if(!(!t&&!n))return{color:t||Dn(e,"color"),backgroundColor:n===tn?Dn(e,"background-color"):n}}function t1({value:e,onChange:t,isActive:n,activeAttributes:o,contentRef:r}){const[i,a=Jv]=Ti("color.custom","color.palette"),[l,d]=f.useState(!1),u=f.useMemo(()=>e1(r.current,ko(e,bs,a)),[r,e,a]),p=!!a.length||i;return!p&&!n?null:s.jsxs(s.Fragment,{children:[s.jsx(Re,{className:"format-library-text-color-button",isActive:n,icon:s.jsx(rt,{icon:Object.keys(o).length?pu:su,style:u}),title:Sl,onClick:p?()=>d(!0):()=>t(ut(e,bs)),role:"menuitemcheckbox"}),l&&s.jsx(Xv,{name:bs,onClose:()=>d(!1),activeAttributes:o,value:e,onChange:t,contentRef:r,isActive:n})]})}const Cl={name:bs,title:Sl,tagName:"mark",className:"has-inline-color",attributes:{style:"style",class:"class"},edit:t1},zr="core/subscript",Cn=c("Subscript"),s1={name:zr,title:Cn,tagName:"sub",className:null,edit({isActive:e,value:t,onChange:n,onFocus:o}){function r(){n(Oe(t,{type:zr,title:Cn}))}function i(){r(),o()}return s.jsx(Re,{icon:du,title:Cn,onClick:i,isActive:e,role:"menuitemcheckbox"})}},Ur="core/superscript",Pn=c("Superscript"),n1={name:Ur,title:Pn,tagName:"sup",className:null,edit({isActive:e,value:t,onChange:n,onFocus:o}){function r(){n(Oe(t,{type:Ur,title:Pn}))}function i(){r(),o()}return s.jsx(Re,{icon:uu,title:Pn,onClick:i,isActive:e,role:"menuitemcheckbox"})}},Wr="core/keyboard",kn=c("Keyboard input"),o1={name:Wr,title:kn,tagName:"kbd",className:null,edit({isActive:e,value:t,onChange:n,onFocus:o}){function r(){n(Oe(t,{type:Wr,title:kn}))}function i(){r(),o()}return s.jsx(Re,{icon:Ad,title:kn,onClick:i,isActive:e,role:"menuitemcheckbox"})}},Fn="core/unknown",Gr=c("Clear Unknown Formatting");function r1(e){return Gs(e)?!1:so(e).formats.some(n=>n.some(o=>o.type===Fn))}const i1={name:Fn,title:Gr,tagName:"*",className:null,edit({isActive:e,value:t,onChange:n,onFocus:o}){if(!e&&!r1(t))return null;function r(){n(ut(t,Fn)),o()}return s.jsx(Re,{name:"unknown",icon:ru,title:Gr,onClick:r,isActive:!0})}},jo="core/language",Ns=c("Language"),Pl={name:jo,tagName:"bdo",className:null,edit:a1,title:Ns};function a1({isActive:e,value:t,onChange:n,contentRef:o}){const[r,i]=f.useState(!1),a=()=>{i(l=>!l)};return s.jsxs(s.Fragment,{children:[s.jsx(Re,{icon:iu,label:Ns,title:Ns,onClick:()=>{e?n(ut(t,jo)):a()},isActive:e,role:"menuitemcheckbox"}),r&&s.jsx(l1,{value:t,onChange:n,onClose:a,contentRef:o})]})}function l1({value:e,contentRef:t,onChange:n,onClose:o}){const r=Ws({editableContentElement:t.current,settings:Pl}),[i,a]=f.useState(""),[l,d]=f.useState("ltr");return s.jsx(et,{className:"block-editor-format-toolbar__language-popover",anchor:r,onClose:o,children:s.jsxs(G,{as:"form",spacing:4,className:"block-editor-format-toolbar__language-container-content",onSubmit:u=>{u.preventDefault(),n(Be(e,{type:jo,attributes:{lang:i,dir:l}})),o()},children:[s.jsx(Rt,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:Ns,value:i,onChange:u=>a(u),help:c('A valid language attribute, like "en" or "fr".')}),s.jsx(Yn,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:c("Text direction"),value:l,options:[{label:c("Left to right"),value:"ltr"},{label:c("Right to left"),value:"rtl"}],onChange:u=>d(u)}),s.jsx(le,{alignment:"right",children:s.jsx(B,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",text:c("Apply")})})]})})}const c1="core/non-breaking-space",d1=c("Non breaking space"),u1={name:c1,title:d1,tagName:"nbsp",className:null,edit({value:e,onChange:t}){function n(){t(zs(e," "))}return s.jsx(Je,{type:"primaryShift",character:" ",onUse:n})}},p1=[Bv,Iv,fl,Dv,wl,Wv,Gv,Cl,s1,n1,o1,i1,Pl,u1];p1.forEach(({name:e,...t})=>Bd(e,t));const m1=({className:e})=>{const[t,n]=f.useState(!1),{isSelected:o}=_(u=>{const{getSelectedBlockClientId:p}=u(M);return{isSelected:p()!==null}}),{isInserterOpened:r}=_(u=>({isInserterOpened:u(x).isInserterOpened()}),[]),{setIsInserterOpened:i}=T(x);function a(){n(!0)}function l(){n(!1)}const d=z("gutenberg-kit-editor-toolbar",e);return s.jsxs(s.Fragment,{children:[s.jsxs(Id,{className:d,label:"Editor toolbar",variant:"unstyled",children:[s.jsx(Uo,{children:s.jsx(Rd,{open:r,onToggle:i})}),o&&s.jsx(Uo,{children:s.jsx(_s,{title:c("Block Settings"),icon:Vi,onClick:a})}),s.jsx(eo,{hideDragHandle:!0})]}),t&&s.jsx(et,{className:"block-settings-menu",variant:"unstyled",placement:"overlay",children:s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"block-settings-menu__header",children:s.jsx(B,{className:"block-settings-menu__close",icon:Md,onClick:l})}),s.jsx(ra,{})]})})]})},{unlock:To}=Nt("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/editor"),h1=".gutenberg-kit-visual-editor__post-title-wrapper .wp-block-post-title{font-size:20px}.block-editor-default-block-appender__content{opacity:.62}",g1=".editor-visual-editor__post-title-wrapper>:where(:not(.alignleft):not(.alignright):not(.alignfull)){max-width:var(--wp--style--global--content-size);margin-left:auto!important;margin-right:auto!important}.editor-visual-editor__post-title-wrapper>.alignwide{max-width:1340px}.editor-visual-editor__post-title-wrapper>.alignfull{max-width:none}:root :where(.is-layout-flow)>:first-child{margin-block-start:0}:root :where(.is-layout-flow)>:last-child{margin-block-end:0}:root :where(.is-layout-flow)>*{margin-block-start:1.2rem;margin-block-end:0}:root :where(.is-layout-constrained)>:first-child{margin-block-start:0}:root :where(.is-layout-constrained)>:last-child{margin-block-end:0}:root :where(.is-layout-constrained)>*{margin-block-start:1.2rem;margin-block-end:0}",{getLayoutStyles:f1}=To(Se);function b1(){const{hasThemeStyleSupport:e,editorSettings:t}=_(n=>({hasThemeStyleSupport:n(en).isFeatureActive("themeStyles"),editorSettings:n(x).getEditorSettings()}),[]);return f.useMemo(()=>{const n=[...t?.defaultEditorStyles??[]];!t.disableLayoutStyles&&!e&&n.push({css:f1({style:{},selector:"body",hasBlockGapSupport:!1,hasFallbackGapSupport:!0,fallbackGapValue:"0.5em"})}),e||n.push({css:h1});const o=e?t.styles??[]:n;return[{css:g1},...o]},[t.defaultEditorStyles,t.disableLayoutStyles,t.styles,e])}function x1(){const{insertBlock:e}=T(M),{blockCount:t}=_(o=>{const{getBlockCount:r}=o(M);return{blockCount:r()}}),n=()=>{const o=Ne("core/paragraph");e(o,t)};return s.jsx("button",{"aria-label":c("Add paragraph block","gutenberg-kit"),onClick:n,className:"gutenberg-kit-default-block-appender"})}const y1=()=>{const e=f.useRef(null);return f.useEffect(()=>{const t=new IntersectionObserver(n=>{n.forEach(o=>{o.isIntersecting&&Od()})});return t.observe(e.current),()=>t.disconnect()},[e]),e},{ExperimentalBlockCanvas:v1,LayoutStyle:hs,useLayoutClasses:_1,useLayoutStyles:w1}=To(Se),S1=`.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;} - .is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);} - .is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;} - .is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;function C1({hideTitle:e}){const t=f.useRef(),n=y1(),{renderingMode:o,hasThemeStyleSupport:r,themeHasDisabledLayoutStyles:i,themeSupportsLayout:a,hasRootPaddingAwareAlignments:l}=_(w=>{const{getRenderingMode:S}=w(x),P=S(),{getSettings:k}=To(w(M)),E=k();return{renderingMode:P,hasThemeStyleSupport:w(en).isFeatureActive("themeStyles"),themeSupportsLayout:E.supportsLayout,themeHasDisabledLayoutStyles:E.disableLayoutStyles,hasRootPaddingAwareAlignments:E.__experimentalFeatures?.useRootPaddingAwareAlignments}},[]),d=b1(),u=z("gutenberg-kit-visual-editor",{"has-root-padding":!r||!l}),p=z("gutenberg-kit-visual-editor__post-title-wrapper","editor-visual-editor__post-title-wrapper",{"has-global-padding":r&&l}),m={align:"full",layout:{type:"constrained"}},{layout:h={},align:g=""}=m,b=_1(m,"core/post-content"),y=w1(m,"core/post-content",".block-editor-block-list__layout.is-root-container"),v=z(a&&b,g&&`align${g}`,{"is-layout-flow":!a,"has-global-padding":r&&l});return s.jsxs("div",{className:u,ref:n,children:[s.jsxs(v1,{shouldIframe:!1,height:"100%",styles:d,children:[a&&!i&&o==="post-only"&&s.jsxs(s.Fragment,{children:[s.jsx(hs,{selector:".editor-visual-editor__post-title-wrapper",layout:h}),s.jsx(hs,{selector:".block-editor-block-list__layout.is-root-container",layout:h}),g&&s.jsx(hs,{css:S1}),y&&s.jsx(hs,{layout:h,css:y})]}),!e&&s.jsx("div",{className:p,children:s.jsx(Ya,{ref:t})}),s.jsx(Ei,{className:v,layout:h}),s.jsx(x1,{})]}),s.jsx(m1,{className:"gutenberg-kit-visual-editor__toolbar"}),s.jsx(et.Slot,{})]})}function P1(){const{hasUndo:e,hasRedo:t}=_(n=>{const o=n(x);return{hasUndo:o.hasEditorUndo(),hasRedo:o.hasEditorRedo()}},[]);f.useEffect(()=>{$d(e,t)},[e,t])}window.editor=window.editor||{};function k1(e,t){const{editEntityRecord:n}=T(C),{undo:o,redo:r,switchEditorMode:i}=T(x),{getEditedPostAttribute:a,getEditedPostContent:l}=_(x),d=f.useCallback(m=>{n("postType",e.type,e.id,m)},[n,e.id,e.type]),u=f.useRef(e.title.raw),p=f.useRef(null);p.current===null&&(p.current=Gn(Wt(e.content.raw||""))),f.useEffect(()=>(window.editor.setContent=m=>{d({content:decodeURIComponent(m)})},window.editor.setTitle=m=>{d({title:decodeURIComponent(m)})},window.editor.getContent=(m=!1)=>(m&&Yr(t.current),l()),window.editor.getTitleAndContent=(m=!1)=>{m&&Yr(t.current);const h=a("title"),g=l(),b=h!==u.current||g!==p.current;return b&&(u.current=h,p.current=g),{title:h,content:g,changed:b}},window.editor.undo=()=>{o()},window.editor.redo=()=>{r()},window.editor.switchEditorMode=m=>{i(m)},()=>{delete window.editor.setContent,delete window.editor.setTitle,delete window.editor.getContent,delete window.editor.getTitleAndContent,delete window.editor.undo,delete window.editor.redo,delete window.editor.switchEditorMode}),[t,d,a,l,r,i,o])}function Yr(e){const t=e?.ownerDocument.activeElement;if(t&&t.contentEditable==="true"){const n=new Event("compositionend");t.dispatchEvent(n)}}function j1(){f.useEffect(()=>(Di("editor.ErrorBoundary.errorLogged","GutenbergKit",e=>{Vd(e,{isHandled:!0,handledBy:"editor.ErrorBoundary.errorLogged"})}),()=>{Ld("editor.ErrorBoundary.errorLogged","GutenbergKit")}),[])}const T1=[{name:"post",baseURL:"/wp/v2/posts"},{name:"page",baseURL:"/wp/v2/pages"},{name:"attachment",baseURL:"/wp/v2/media"},{name:"wp_block",baseURL:"/wp/v2/blocks"}].map(e=>({kind:"postType",...e,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:["title","excerpt","content"]}));function E1(e){const{addEntities:t,receiveEntityRecords:n}=T(C),{setEditedPost:o,setupEditor:r}=T(x);f.useEffect(()=>{t(T1),n("postType",e.type,e),r(e,{}),o(e.type,e.id)},[])}function N1(){f.useEffect(()=>(ki("editor.MediaUpload","GutenbergKit",()=>A1),()=>{Dd("editor.MediaUpload","GutenbergKit")}),[])}function A1({render:e,...t}){const{open:n}=B1(t);return e({open:n})}function B1({onSelect:e,...t}){return f.useEffect(()=>(window.editor.setMediaUploadAttachment=o=>{e(t.multiple?o:o[0])},()=>{window.editor.setMediaUploadAttachment=()=>{}}),[e,t.multiple]),{open:f.useCallback(()=>Hd(t),[t])}}function I1({hideTitle:e}){return s.jsxs("div",{className:"gutenberg-kit-text-editor",children:[!e&&s.jsx(qa,{}),s.jsx(uo,{})]})}function R1({post:e,children:t,hideTitle:n}){const o=f.useRef(null);k1(e,o),P1(),j1(),E1(e),N1();const{isReady:r,mode:i,isRichEditingEnabled:a,currentPost:l}=_(d=>{const{__unstableIsEditorReady:u,getEditorSettings:p,getEditorMode:m}=d(x),h=p(),{getEntityRecord:g}=d(C),b=g("postType",e.type,e.id);return{isReady:u(),mode:m(),isRichEditingEnabled:h.richEditingEnabled,currentPost:b}},[e.id,e.type]);return r?s.jsx("div",{className:"gutenberg-kit-editor",ref:o,children:s.jsxs(Fd,{post:l,settings:M1,useSubRegistry:!1,children:[i==="visual"&&a&&s.jsx(C1,{hideTitle:n}),(i==="text"||!a)&&s.jsx(I1,{autoFocus:!0,hideTitle:n}),t]})}):null}const M1={};function L1({className:e}){const{notice:t,clearNotice:n}=D1(),o=[{label:c("Retry","gutenberg-kit"),onClick:()=>window.location.href="remote.html",variant:"primary"},{label:c("Dismiss","gutenberg-kit"),onClick:n,variant:"secondary"}];return t?s.jsx("div",{className:e,children:s.jsx(Et,{actions:o,status:"warning",isDismissible:!1,children:t})}):null}function D1(){const[e,t]=f.useState(null);return f.useEffect(()=>{const o=new URL(window.location.href).searchParams.get("error");let r=null;switch(o){case F1:r=c("Oops! We couldn't load your site's editor and plugins. Don't worry, you can use the default editor for now.","gutenberg-kit");break;case O1:r=c("Oops! Configuration for your site editor was unavailable. Don't worry, you can use the default editor for now.","gutenberg-kit");break;default:r=null}t(r)},[]),f.useEffect(()=>{if(e){const n=setTimeout(()=>{t(null)},2e4);return()=>clearTimeout(n)}},[e]),{notice:e,clearNotice:()=>t(null)}}const F1="remote_editor_load_error",O1="gbkit_global_unavailable";function $1(e){return s.jsxs(mh,{canCopyContent:!0,children:[s.jsx(Fm,{autosave:zd}),s.jsx(R1,{...e,children:s.jsx(th,{})}),s.jsx(L1,{className:"gutenberg-kit-layout__load-notice"})]})}function r_({createRoot:e,StrictMode:t,dispatch:n,editorStore:o,preferencesStore:r,registerCoreBlocks:i}){const{themeStyles:a,hideTitle:l,editorSettings:d}=Ud(),u=d||{defaultEditorStyles:[{css:Rx}]};n(o).updateEditorSettings(u);const p=n(r);p.setDefaults("core",{fixedToolbar:!0}),p.setDefaults("core/edit-post",{themeStyles:a}),i();const m=Wd();e(document.getElementById("root")).render(s.jsx(t,{children:s.jsx($1,{post:m,hideTitle:l})}))}export{r_ as initializeEditor}; diff --git a/ios/Sources/GutenbergKit/Gutenberg/assets/editor-tP9apWFw.js b/ios/Sources/GutenbergKit/Gutenberg/assets/editor-tP9apWFw.js new file mode 100644 index 00000000..be747412 --- /dev/null +++ b/ios/Sources/GutenbergKit/Gutenberg/assets/editor-tP9apWFw.js @@ -0,0 +1,836 @@ +import{e as V_e,o as H_e,l as U_e,a as X_e,b as G_e,g as K_e,c as Y_e}from"./bridge-CeTaRbKr.js";function Z_e(e,t){for(var n=0;no[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var u1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function f5(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function o(){return this instanceof o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}),n}var eS={exports:{}},vg={},tS={exports:{}},$n={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var jV;function Q_e(){if(jV)return $n;jV=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.iterator;function f(V){return V===null||typeof V!="object"?null:(V=p&&V[p]||V["@@iterator"],typeof V=="function"?V:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function z(V,Z,re){this.props=V,this.context=Z,this.refs=g,this.updater=re||b}z.prototype.isReactComponent={},z.prototype.setState=function(V,Z){if(typeof V!="object"&&typeof V!="function"&&V!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,V,Z,"setState")},z.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function y(){}y.prototype=z.prototype;function _(V,Z,re){this.props=V,this.context=Z,this.refs=g,this.updater=re||b}var v=_.prototype=new y;v.constructor=_,h(v,z.prototype),v.isPureReactComponent=!0;var M=Array.isArray,A=Object.prototype.hasOwnProperty,k={current:null},S={key:!0,ref:!0,__self:!0,__source:!0};function C(V,Z,re){var oe,ae={},le=null,he=null;if(Z!=null)for(oe in Z.ref!==void 0&&(he=Z.ref),Z.key!==void 0&&(le=""+Z.key),Z)A.call(Z,oe)&&!S.hasOwnProperty(oe)&&(ae[oe]=Z[oe]);var de=arguments.length-2;if(de===1)ae.children=re;else if(1/g;function nS(e,t,n,o,r){return{element:e,tokenStart:t,tokenLength:n,prevOffset:o,leadingTextStart:r,children:[]}}const Jo=(e,t)=>{if(la=e,Ka=0,bd=[],td=[],zre.lastIndex=0,!tke(t))throw new TypeError("The conversionMap provided is not valid. It must be an object with values that are React Elements");do;while(nke(t));return x.createElement(x.Fragment,null,...bd)},tke=e=>{const t=typeof e=="object",n=t&&Object.values(e);return t&&n.length&&n.every(o=>x.isValidElement(o))};function nke(e){const t=oke(),[n,o,r,s]=t,i=td.length,c=r>Ka?Ka:null;if(!e[o])return oS(),!1;switch(n){case"no-more-tokens":if(i!==0){const{leadingTextStart:p,tokenStart:f}=td.pop();bd.push(la.substr(p,f))}return oS(),!1;case"self-closed":return i===0?(c!==null&&bd.push(la.substr(c,r-c)),bd.push(e[o]),Ka=r+s,!0):($V(nS(e[o],r,s)),Ka=r+s,!0);case"opener":return td.push(nS(e[o],r,s,r+s,c)),Ka=r+s,!0;case"closer":if(i===1)return rke(r),Ka=r+s,!0;const l=td.pop(),u=la.substr(l.prevOffset,r-l.prevOffset);l.children.push(u),l.prevOffset=r+s;const d=nS(l.element,l.tokenStart,l.tokenLength,r+s);return d.children=l.children,$V(d),Ka=r+s,!0;default:return oS(),!1}}function oke(){const e=zre.exec(la);if(e===null)return["no-more-tokens"];const t=e.index,[n,o,r,s]=e,i=n.length;return s?["self-closed",r,t,i]:o?["closer",r,t,i]:["opener",r,t,i]}function oS(){const e=la.length-Ka;e!==0&&bd.push(la.substr(Ka,e))}function $V(e){const{element:t,tokenStart:n,tokenLength:o,prevOffset:r,children:s}=e,i=td[td.length-1],c=la.substr(i.prevOffset,n-i.prevOffset);c&&i.children.push(c),i.children.push(x.cloneElement(t,null,...s)),i.prevOffset=r||n+o}function rke(e){const{element:t,leadingTextStart:n,prevOffset:o,tokenStart:r,children:s}=td.pop(),i=e?la.substr(o,e-o):la.substr(o);i&&s.push(i),n!==null&&bd.push(la.substr(n,r-n)),bd.push(x.cloneElement(t,null,...s))}var rS={exports:{}},Q1={},sS={exports:{}},iS={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var VV;function ske(){return VV||(VV=1,function(e){function t(F,X){var Q=F.length;F.push(X);e:for(;0>>1,Z=F[V];if(0>>1;Vr(ae,Q))ler(he,ae)?(F[V]=he,F[le]=Q,V=le):(F[V]=ae,F[oe]=Q,V=oe);else if(ler(he,Q))F[V]=he,F[le]=Q,V=le;else break e}}return X}function r(F,X){var Q=F.sortIndex-X.sortIndex;return Q!==0?Q:F.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,c=i.now();e.unstable_now=function(){return i.now()-c}}var l=[],u=[],d=1,p=null,f=3,b=!1,h=!1,g=!1,z=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(F){for(var X=n(u);X!==null;){if(X.callback===null)o(u);else if(X.startTime<=F)o(u),X.sortIndex=X.expirationTime,t(l,X);else break;X=n(u)}}function M(F){if(g=!1,v(F),!h)if(n(l)!==null)h=!0,P(A);else{var X=n(u);X!==null&&$(M,X.startTime-F)}}function A(F,X){h=!1,g&&(g=!1,y(C),C=-1),b=!0;var Q=f;try{for(v(X),p=n(l);p!==null&&(!(p.expirationTime>X)||F&&!E());){var V=p.callback;if(typeof V=="function"){p.callback=null,f=p.priorityLevel;var Z=V(p.expirationTime<=X);X=e.unstable_now(),typeof Z=="function"?p.callback=Z:p===n(l)&&o(l),v(X)}else o(l);p=n(l)}if(p!==null)var re=!0;else{var oe=n(u);oe!==null&&$(M,oe.startTime-X),re=!1}return re}finally{p=null,f=Q,b=!1}}var k=!1,S=null,C=-1,R=5,T=-1;function E(){return!(e.unstable_now()-TF||125V?(F.sortIndex=Q,t(u,F),n(l)===null&&F===n(u)&&(g?(y(C),C=-1):g=!0,$(M,Q-V))):(F.sortIndex=Z,t(l,F),h||b||(h=!0,P(A))),F},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(F){var X=f;return function(){var Q=f;f=X;try{return F.apply(this,arguments)}finally{f=Q}}}}(iS)),iS}var HV;function ike(){return HV||(HV=1,sS.exports=ske()),sS.exports}/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var UV;function ake(){if(UV)return Q1;UV=1;var e=u3(),t=ike();function n(O){for(var w="https://reactjs.org/docs/error-decoder.html?invariant="+O,q=1;q"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),l=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},p={};function f(O){return l.call(p,O)?!0:l.call(d,O)?!1:u.test(O)?p[O]=!0:(d[O]=!0,!1)}function b(O,w,q,W){if(q!==null&&q.type===0)return!1;switch(typeof w){case"function":case"symbol":return!0;case"boolean":return W?!1:q!==null?!q.acceptsBooleans:(O=O.toLowerCase().slice(0,5),O!=="data-"&&O!=="aria-");default:return!1}}function h(O,w,q,W){if(w===null||typeof w>"u"||b(O,w,q,W))return!0;if(W)return!1;if(q!==null)switch(q.type){case 3:return!w;case 4:return w===!1;case 5:return isNaN(w);case 6:return isNaN(w)||1>w}return!1}function g(O,w,q,W,D,K,ue){this.acceptsBooleans=w===2||w===3||w===4,this.attributeName=W,this.attributeNamespace=D,this.mustUseProperty=q,this.propertyName=O,this.type=w,this.sanitizeURL=K,this.removeEmptyString=ue}var z={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(O){z[O]=new g(O,0,!1,O,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(O){var w=O[0];z[w]=new g(w,1,!1,O[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(O){z[O]=new g(O,2,!1,O.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(O){z[O]=new g(O,2,!1,O,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(O){z[O]=new g(O,3,!1,O.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(O){z[O]=new g(O,3,!0,O,null,!1,!1)}),["capture","download"].forEach(function(O){z[O]=new g(O,4,!1,O,null,!1,!1)}),["cols","rows","size","span"].forEach(function(O){z[O]=new g(O,6,!1,O,null,!1,!1)}),["rowSpan","start"].forEach(function(O){z[O]=new g(O,5,!1,O.toLowerCase(),null,!1,!1)});var y=/[\-:]([a-z])/g;function _(O){return O[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(O){var w=O.replace(y,_);z[w]=new g(w,1,!1,O,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(O){var w=O.replace(y,_);z[w]=new g(w,1,!1,O,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(O){var w=O.replace(y,_);z[w]=new g(w,1,!1,O,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(O){z[O]=new g(O,1,!1,O.toLowerCase(),null,!1,!1)}),z.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(O){z[O]=new g(O,1,!1,O.toLowerCase(),null,!0,!0)});function v(O,w,q,W){var D=z.hasOwnProperty(w)?z[w]:null;(D!==null?D.type!==0:W||!(2Re||D[ue]!==K[Re]){var Le=` +`+D[ue].replace(" at new "," at ");return O.displayName&&Le.includes("")&&(Le=Le.replace("",O.displayName)),Le}while(1<=ue&&0<=Re);break}}}finally{re=!1,Error.prepareStackTrace=q}return(O=O?O.displayName||O.name:"")?Z(O):""}function ae(O){switch(O.tag){case 5:return Z(O.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return O=oe(O.type,!1),O;case 11:return O=oe(O.type.render,!1),O;case 1:return O=oe(O.type,!0),O;default:return""}}function le(O){if(O==null)return null;if(typeof O=="function")return O.displayName||O.name||null;if(typeof O=="string")return O;switch(O){case S:return"Fragment";case k:return"Portal";case R:return"Profiler";case C:return"StrictMode";case N:return"Suspense";case j:return"SuspenseList"}if(typeof O=="object")switch(O.$$typeof){case E:return(O.displayName||"Context")+".Consumer";case T:return(O._context.displayName||"Context")+".Provider";case B:var w=O.render;return O=O.displayName,O||(O=w.displayName||w.name||"",O=O!==""?"ForwardRef("+O+")":"ForwardRef"),O;case I:return w=O.displayName||null,w!==null?w:le(O.type)||"Memo";case P:w=O._payload,O=O._init;try{return le(O(w))}catch{}}return null}function he(O){var w=O.type;switch(O.tag){case 24:return"Cache";case 9:return(w.displayName||"Context")+".Consumer";case 10:return(w._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return O=w.render,O=O.displayName||O.name||"",w.displayName||(O!==""?"ForwardRef("+O+")":"ForwardRef");case 7:return"Fragment";case 5:return w;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return le(w);case 8:return w===C?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof w=="function")return w.displayName||w.name||null;if(typeof w=="string")return w}return null}function de(O){switch(typeof O){case"boolean":case"number":case"string":case"undefined":return O;case"object":return O;default:return""}}function _e(O){var w=O.type;return(O=O.nodeName)&&O.toLowerCase()==="input"&&(w==="checkbox"||w==="radio")}function Ae(O){var w=_e(O)?"checked":"value",q=Object.getOwnPropertyDescriptor(O.constructor.prototype,w),W=""+O[w];if(!O.hasOwnProperty(w)&&typeof q<"u"&&typeof q.get=="function"&&typeof q.set=="function"){var D=q.get,K=q.set;return Object.defineProperty(O,w,{configurable:!0,get:function(){return D.call(this)},set:function(ue){W=""+ue,K.call(this,ue)}}),Object.defineProperty(O,w,{enumerable:q.enumerable}),{getValue:function(){return W},setValue:function(ue){W=""+ue},stopTracking:function(){O._valueTracker=null,delete O[w]}}}}function Be(O){O._valueTracker||(O._valueTracker=Ae(O))}function je(O){if(!O)return!1;var w=O._valueTracker;if(!w)return!0;var q=w.getValue(),W="";return O&&(W=_e(O)?O.checked?"true":"false":O.value),O=W,O!==q?(w.setValue(O),!0):!1}function ee(O){if(O=O||(typeof document<"u"?document:void 0),typeof O>"u")return null;try{return O.activeElement||O.body}catch{return O.body}}function xe(O,w){var q=w.checked;return Q({},w,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:q??O._wrapperState.initialChecked})}function se(O,w){var q=w.defaultValue==null?"":w.defaultValue,W=w.checked!=null?w.checked:w.defaultChecked;q=de(w.value!=null?w.value:q),O._wrapperState={initialChecked:W,initialValue:q,controlled:w.type==="checkbox"||w.type==="radio"?w.checked!=null:w.value!=null}}function pe(O,w){w=w.checked,w!=null&&v(O,"checked",w,!1)}function We(O,w){pe(O,w);var q=de(w.value),W=w.type;if(q!=null)W==="number"?(q===0&&O.value===""||O.value!=q)&&(O.value=""+q):O.value!==""+q&&(O.value=""+q);else if(W==="submit"||W==="reset"){O.removeAttribute("value");return}w.hasOwnProperty("value")?ie(O,w.type,q):w.hasOwnProperty("defaultValue")&&ie(O,w.type,de(w.defaultValue)),w.checked==null&&w.defaultChecked!=null&&(O.defaultChecked=!!w.defaultChecked)}function ke(O,w,q){if(w.hasOwnProperty("value")||w.hasOwnProperty("defaultValue")){var W=w.type;if(!(W!=="submit"&&W!=="reset"||w.value!==void 0&&w.value!==null))return;w=""+O._wrapperState.initialValue,q||w===O.value||(O.value=w),O.defaultValue=w}q=O.name,q!==""&&(O.name=""),O.defaultChecked=!!O._wrapperState.initialChecked,q!==""&&(O.name=q)}function ie(O,w,q){(w!=="number"||ee(O.ownerDocument)!==O)&&(q==null?O.defaultValue=""+O._wrapperState.initialValue:O.defaultValue!==""+q&&(O.defaultValue=""+q))}var L=Array.isArray;function U(O,w,q,W){if(O=O.options,w){w={};for(var D=0;D"+w.valueOf().toString()+"",w=yt.firstChild;O.firstChild;)O.removeChild(O.firstChild);for(;w.firstChild;)O.appendChild(w.firstChild)}});function ce(O,w){if(w){var q=O.firstChild;if(q&&q===O.lastChild&&q.nodeType===3){q.nodeValue=w;return}}O.textContent=w}var H={animationIterationCount:!0,aspectRatio:!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,gridArea:!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},Y=["Webkit","ms","Moz","O"];Object.keys(H).forEach(function(O){Y.forEach(function(w){w=w+O.charAt(0).toUpperCase()+O.substring(1),H[w]=H[O]})});function me(O,w,q){return w==null||typeof w=="boolean"||w===""?"":q||typeof w!="number"||w===0||H.hasOwnProperty(O)&&H[O]?(""+w).trim():w+"px"}function Se(O,w){O=O.style;for(var q in w)if(w.hasOwnProperty(q)){var W=q.indexOf("--")===0,D=me(q,w[q],W);q==="float"&&(q="cssFloat"),W?O.setProperty(q,D):O[q]=D}}var fe=Q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Oe(O,w){if(w){if(fe[O]&&(w.children!=null||w.dangerouslySetInnerHTML!=null))throw Error(n(137,O));if(w.dangerouslySetInnerHTML!=null){if(w.children!=null)throw Error(n(60));if(typeof w.dangerouslySetInnerHTML!="object"||!("__html"in w.dangerouslySetInnerHTML))throw Error(n(61))}if(w.style!=null&&typeof w.style!="object")throw Error(n(62))}}function ot(O,w){if(O.indexOf("-")===-1)return typeof w.is=="string";switch(O){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Mt=null;function rt(O){return O=O.target||O.srcElement||window,O.correspondingUseElement&&(O=O.correspondingUseElement),O.nodeType===3?O.parentNode:O}var Xe=null,vt=null,wn=null;function Wn(O){if(O=cg(O)){if(typeof Xe!="function")throw Error(n(280));var w=O.stateNode;w&&(w=hy(w),Xe(O.stateNode,O.type,w))}}function Mo(O){vt?wn?wn.push(O):wn=[O]:vt=O}function Ar(){if(vt){var O=vt,w=wn;if(wn=vt=null,Wn(O),w)for(O=0;O>>=0,O===0?32:31-(Jt(O)/sr|0)|0}var u0=64,Ki=4194304;function Ss(O){switch(O&-O){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return O&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return O&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return O}}function Ba(O,w){var q=O.pendingLanes;if(q===0)return 0;var W=0,D=O.suspendedLanes,K=O.pingedLanes,ue=q&268435455;if(ue!==0){var Re=ue&~D;Re!==0?W=Ss(Re):(K&=ue,K!==0&&(W=Ss(K)))}else ue=q&~D,ue!==0?W=Ss(ue):K!==0&&(W=Ss(K));if(W===0)return 0;if(w!==0&&w!==W&&(w&D)===0&&(D=W&-W,K=w&-w,D>=K||D===16&&(K&4194240)!==0))return w;if((W&4)!==0&&(W|=q&16),w=O.entangledLanes,w!==0)for(O=O.entanglements,w&=W;0q;q++)w.push(O);return w}function $c(O,w,q){O.pendingLanes|=w,w!==536870912&&(O.suspendedLanes=0,O.pingedLanes=0),O=O.eventTimes,w=31-ks(w),O[w]=q}function gb(O,w){var q=O.pendingLanes&~w;O.pendingLanes=w,O.suspendedLanes=0,O.pingedLanes=0,O.expiredLanes&=w,O.mutableReadLanes&=w,O.entangledLanes&=w,w=O.entanglements;var W=O.eventTimes;for(O=O.expirationTimes;0=Jm),TF=" ",EF=!1;function WF(O,w){switch(O){case"keyup":return jwe.indexOf(w.keyCode)!==-1;case"keydown":return w.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function BF(O){return O=O.detail,typeof O=="object"&&"data"in O?O.data:null}var yb=!1;function Dwe(O,w){switch(O){case"compositionend":return BF(w);case"keypress":return w.which!==32?null:(EF=!0,TF);case"textInput":return O=w.data,O===TF&&EF?null:O;default:return null}}function Fwe(O,w){if(yb)return O==="compositionend"||!Wk&&WF(O,w)?(O=_F(),ry=Sk=yu=null,yb=!1,O):null;switch(O){case"paste":return null;case"keypress":if(!(w.ctrlKey||w.altKey||w.metaKey)||w.ctrlKey&&w.altKey){if(w.char&&1=w)return{node:q,offset:w-O};O=W}e:{for(;q;){if(q.nextSibling){q=q.nextSibling;break e}q=q.parentNode}q=void 0}q=FF(q)}}function VF(O,w){return O&&w?O===w?!0:O&&O.nodeType===3?!1:w&&w.nodeType===3?VF(O,w.parentNode):"contains"in O?O.contains(w):O.compareDocumentPosition?!!(O.compareDocumentPosition(w)&16):!1:!1}function HF(){for(var O=window,w=ee();w instanceof O.HTMLIFrameElement;){try{var q=typeof w.contentWindow.location.href=="string"}catch{q=!1}if(q)O=w.contentWindow;else break;w=ee(O.document)}return w}function Lk(O){var w=O&&O.nodeName&&O.nodeName.toLowerCase();return w&&(w==="input"&&(O.type==="text"||O.type==="search"||O.type==="tel"||O.type==="url"||O.type==="password")||w==="textarea"||O.contentEditable==="true")}function Zwe(O){var w=HF(),q=O.focusedElem,W=O.selectionRange;if(w!==q&&q&&q.ownerDocument&&VF(q.ownerDocument.documentElement,q)){if(W!==null&&Lk(q)){if(w=W.start,O=W.end,O===void 0&&(O=w),"selectionStart"in q)q.selectionStart=w,q.selectionEnd=Math.min(O,q.value.length);else if(O=(w=q.ownerDocument||document)&&w.defaultView||window,O.getSelection){O=O.getSelection();var D=q.textContent.length,K=Math.min(W.start,D);W=W.end===void 0?K:Math.min(W.end,D),!O.extend&&K>W&&(D=W,W=K,K=D),D=$F(q,K);var ue=$F(q,W);D&&ue&&(O.rangeCount!==1||O.anchorNode!==D.node||O.anchorOffset!==D.offset||O.focusNode!==ue.node||O.focusOffset!==ue.offset)&&(w=w.createRange(),w.setStart(D.node,D.offset),O.removeAllRanges(),K>W?(O.addRange(w),O.extend(ue.node,ue.offset)):(w.setEnd(ue.node,ue.offset),O.addRange(w)))}}for(w=[],O=q;O=O.parentNode;)O.nodeType===1&&w.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q=document.documentMode,Ab=null,Pk=null,og=null,jk=!1;function UF(O,w,q){var W=q.window===q?q.document:q.nodeType===9?q:q.ownerDocument;jk||Ab==null||Ab!==ee(W)||(W=Ab,"selectionStart"in W&&Lk(W)?W={start:W.selectionStart,end:W.selectionEnd}:(W=(W.ownerDocument&&W.ownerDocument.defaultView||window).getSelection(),W={anchorNode:W.anchorNode,anchorOffset:W.anchorOffset,focusNode:W.focusNode,focusOffset:W.focusOffset}),og&&ng(og,W)||(og=W,W=py(Pk,"onSelect"),0kb||(O.current=Zk[kb],Zk[kb]=null,kb--)}function Qo(O,w){kb++,Zk[kb]=O.current,O.current=w}var wu={},n1=xu(wu),X1=xu(!1),vp=wu;function Sb(O,w){var q=O.type.contextTypes;if(!q)return wu;var W=O.stateNode;if(W&&W.__reactInternalMemoizedUnmaskedChildContext===w)return W.__reactInternalMemoizedMaskedChildContext;var D={},K;for(K in q)D[K]=w[K];return W&&(O=O.stateNode,O.__reactInternalMemoizedUnmaskedChildContext=w,O.__reactInternalMemoizedMaskedChildContext=D),D}function G1(O){return O=O.childContextTypes,O!=null}function my(){ar(X1),ar(n1)}function a$(O,w,q){if(n1.current!==wu)throw Error(n(168));Qo(n1,w),Qo(X1,q)}function c$(O,w,q){var W=O.stateNode;if(w=w.childContextTypes,typeof W.getChildContext!="function")return q;W=W.getChildContext();for(var D in W)if(!(D in w))throw Error(n(108,he(O)||"Unknown",D));return Q({},q,W)}function gy(O){return O=(O=O.stateNode)&&O.__reactInternalMemoizedMergedChildContext||wu,vp=n1.current,Qo(n1,O),Qo(X1,X1.current),!0}function l$(O,w,q){var W=O.stateNode;if(!W)throw Error(n(169));q?(O=c$(O,w,vp),W.__reactInternalMemoizedMergedChildContext=O,ar(X1),ar(n1),Qo(n1,O)):ar(X1),Qo(X1,q)}var Hc=null,My=!1,Qk=!1;function u$(O){Hc===null?Hc=[O]:Hc.push(O)}function l_e(O){My=!0,u$(O)}function _u(){if(!Qk&&Hc!==null){Qk=!0;var O=0,w=To;try{var q=Hc;for(To=1;O>=ue,D-=ue,Uc=1<<32-ks(w)+D|q<zn?(v0=ln,ln=null):v0=ln.sibling;var po=st($e,ln,He[zn],bt);if(po===null){ln===null&&(ln=v0);break}O&&ln&&po.alternate===null&&w($e,ln),De=K(po,De,zn),cn===null?Ut=po:cn.sibling=po,cn=po,ln=v0}if(zn===He.length)return q($e,ln),hr&&wp($e,zn),Ut;if(ln===null){for(;znzn?(v0=ln,ln=null):v0=ln.sibling;var Bu=st($e,ln,po.value,bt);if(Bu===null){ln===null&&(ln=v0);break}O&&ln&&Bu.alternate===null&&w($e,ln),De=K(Bu,De,zn),cn===null?Ut=Bu:cn.sibling=Bu,cn=Bu,ln=v0}if(po.done)return q($e,ln),hr&&wp($e,zn),Ut;if(ln===null){for(;!po.done;zn++,po=He.next())po=dt($e,po.value,bt),po!==null&&(De=K(po,De,zn),cn===null?Ut=po:cn.sibling=po,cn=po);return hr&&wp($e,zn),Ut}for(ln=W($e,ln);!po.done;zn++,po=He.next())po=Et(ln,$e,zn,po.value,bt),po!==null&&(O&&po.alternate!==null&&ln.delete(po.key===null?zn:po.key),De=K(po,De,zn),cn===null?Ut=po:cn.sibling=po,cn=po);return O&&ln.forEach(function($_e){return w($e,$_e)}),hr&&wp($e,zn),Ut}function Vr($e,De,He,bt){if(typeof He=="object"&&He!==null&&He.type===S&&He.key===null&&(He=He.props.children),typeof He=="object"&&He!==null){switch(He.$$typeof){case A:e:{for(var Ut=He.key,cn=De;cn!==null;){if(cn.key===Ut){if(Ut=He.type,Ut===S){if(cn.tag===7){q($e,cn.sibling),De=D(cn,He.props.children),De.return=$e,$e=De;break e}}else if(cn.elementType===Ut||typeof Ut=="object"&&Ut!==null&&Ut.$$typeof===P&&m$(Ut)===cn.type){q($e,cn.sibling),De=D(cn,He.props),De.ref=lg($e,cn,He),De.return=$e,$e=De;break e}q($e,cn);break}else w($e,cn);cn=cn.sibling}He.type===S?(De=Ep(He.props.children,$e.mode,bt,He.key),De.return=$e,$e=De):(bt=Uy(He.type,He.key,He.props,null,$e.mode,bt),bt.ref=lg($e,De,He),bt.return=$e,$e=bt)}return ue($e);case k:e:{for(cn=He.key;De!==null;){if(De.key===cn)if(De.tag===4&&De.stateNode.containerInfo===He.containerInfo&&De.stateNode.implementation===He.implementation){q($e,De.sibling),De=D(De,He.children||[]),De.return=$e,$e=De;break e}else{q($e,De);break}else w($e,De);De=De.sibling}De=K6(He,$e.mode,bt),De.return=$e,$e=De}return ue($e);case P:return cn=He._init,Vr($e,De,cn(He._payload),bt)}if(L(He))return Dt($e,De,He,bt);if(X(He))return $t($e,De,He,bt);Ay($e,He)}return typeof He=="string"&&He!==""||typeof He=="number"?(He=""+He,De!==null&&De.tag===6?(q($e,De.sibling),De=D(De,He),De.return=$e,$e=De):(q($e,De),De=G6(He,$e.mode,bt),De.return=$e,$e=De),ue($e)):q($e,De)}return Vr}var Tb=g$(!0),M$=g$(!1),vy=xu(null),xy=null,Eb=null,r6=null;function s6(){r6=Eb=xy=null}function i6(O){var w=vy.current;ar(vy),O._currentValue=w}function a6(O,w,q){for(;O!==null;){var W=O.alternate;if((O.childLanes&w)!==w?(O.childLanes|=w,W!==null&&(W.childLanes|=w)):W!==null&&(W.childLanes&w)!==w&&(W.childLanes|=w),O===q)break;O=O.return}}function Wb(O,w){xy=O,r6=Eb=null,O=O.dependencies,O!==null&&O.firstContext!==null&&((O.lanes&w)!==0&&(K1=!0),O.firstContext=null)}function ri(O){var w=O._currentValue;if(r6!==O)if(O={context:O,memoizedValue:w,next:null},Eb===null){if(xy===null)throw Error(n(308));Eb=O,xy.dependencies={lanes:0,firstContext:O}}else Eb=Eb.next=O;return w}var _p=null;function c6(O){_p===null?_p=[O]:_p.push(O)}function z$(O,w,q,W){var D=w.interleaved;return D===null?(q.next=q,c6(w)):(q.next=D.next,D.next=q),w.interleaved=q,Gc(O,W)}function Gc(O,w){O.lanes|=w;var q=O.alternate;for(q!==null&&(q.lanes|=w),q=O,O=O.return;O!==null;)O.childLanes|=w,q=O.alternate,q!==null&&(q.childLanes|=w),q=O,O=O.return;return q.tag===3?q.stateNode:null}var ku=!1;function l6(O){O.updateQueue={baseState:O.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function O$(O,w){O=O.updateQueue,w.updateQueue===O&&(w.updateQueue={baseState:O.baseState,firstBaseUpdate:O.firstBaseUpdate,lastBaseUpdate:O.lastBaseUpdate,shared:O.shared,effects:O.effects})}function Kc(O,w){return{eventTime:O,lane:w,tag:0,payload:null,callback:null,next:null}}function Su(O,w,q){var W=O.updateQueue;if(W===null)return null;if(W=W.shared,(co&2)!==0){var D=W.pending;return D===null?w.next=w:(w.next=D.next,D.next=w),W.pending=w,Gc(O,q)}return D=W.interleaved,D===null?(w.next=w,c6(W)):(w.next=D.next,D.next=w),W.interleaved=w,Gc(O,q)}function wy(O,w,q){if(w=w.updateQueue,w!==null&&(w=w.shared,(q&4194240)!==0)){var W=w.lanes;W&=O.pendingLanes,q|=W,w.lanes=q,Mb(O,q)}}function y$(O,w){var q=O.updateQueue,W=O.alternate;if(W!==null&&(W=W.updateQueue,q===W)){var D=null,K=null;if(q=q.firstBaseUpdate,q!==null){do{var ue={eventTime:q.eventTime,lane:q.lane,tag:q.tag,payload:q.payload,callback:q.callback,next:null};K===null?D=K=ue:K=K.next=ue,q=q.next}while(q!==null);K===null?D=K=w:K=K.next=w}else D=K=w;q={baseState:W.baseState,firstBaseUpdate:D,lastBaseUpdate:K,shared:W.shared,effects:W.effects},O.updateQueue=q;return}O=q.lastBaseUpdate,O===null?q.firstBaseUpdate=w:O.next=w,q.lastBaseUpdate=w}function _y(O,w,q,W){var D=O.updateQueue;ku=!1;var K=D.firstBaseUpdate,ue=D.lastBaseUpdate,Re=D.shared.pending;if(Re!==null){D.shared.pending=null;var Le=Re,Ge=Le.next;Le.next=null,ue===null?K=Ge:ue.next=Ge,ue=Le;var ct=O.alternate;ct!==null&&(ct=ct.updateQueue,Re=ct.lastBaseUpdate,Re!==ue&&(Re===null?ct.firstBaseUpdate=Ge:Re.next=Ge,ct.lastBaseUpdate=Le))}if(K!==null){var dt=D.baseState;ue=0,ct=Ge=Le=null,Re=K;do{var st=Re.lane,Et=Re.eventTime;if((W&st)===st){ct!==null&&(ct=ct.next={eventTime:Et,lane:0,tag:Re.tag,payload:Re.payload,callback:Re.callback,next:null});e:{var Dt=O,$t=Re;switch(st=w,Et=q,$t.tag){case 1:if(Dt=$t.payload,typeof Dt=="function"){dt=Dt.call(Et,dt,st);break e}dt=Dt;break e;case 3:Dt.flags=Dt.flags&-65537|128;case 0:if(Dt=$t.payload,st=typeof Dt=="function"?Dt.call(Et,dt,st):Dt,st==null)break e;dt=Q({},dt,st);break e;case 2:ku=!0}}Re.callback!==null&&Re.lane!==0&&(O.flags|=64,st=D.effects,st===null?D.effects=[Re]:st.push(Re))}else Et={eventTime:Et,lane:st,tag:Re.tag,payload:Re.payload,callback:Re.callback,next:null},ct===null?(Ge=ct=Et,Le=dt):ct=ct.next=Et,ue|=st;if(Re=Re.next,Re===null){if(Re=D.shared.pending,Re===null)break;st=Re,Re=st.next,st.next=null,D.lastBaseUpdate=st,D.shared.pending=null}}while(!0);if(ct===null&&(Le=dt),D.baseState=Le,D.firstBaseUpdate=Ge,D.lastBaseUpdate=ct,w=D.shared.interleaved,w!==null){D=w;do ue|=D.lane,D=D.next;while(D!==w)}else K===null&&(D.shared.lanes=0);Cp|=ue,O.lanes=ue,O.memoizedState=dt}}function A$(O,w,q){if(O=w.effects,w.effects=null,O!==null)for(w=0;wq?q:4,O(!0);var W=b6.transition;b6.transition={};try{O(!1),w()}finally{To=q,b6.transition=W}}function D$(){return si().memoizedState}function f_e(O,w,q){var W=Tu(O);if(q={lane:W,action:q,hasEagerState:!1,eagerState:null,next:null},F$(O))$$(w,q);else if(q=z$(O,w,q,W),q!==null){var D=T1();ta(q,O,W,D),V$(q,w,W)}}function b_e(O,w,q){var W=Tu(O),D={lane:W,action:q,hasEagerState:!1,eagerState:null,next:null};if(F$(O))$$(w,D);else{var K=O.alternate;if(O.lanes===0&&(K===null||K.lanes===0)&&(K=w.lastRenderedReducer,K!==null))try{var ue=w.lastRenderedState,Re=K(ue,q);if(D.hasEagerState=!0,D.eagerState=Re,Yi(Re,ue)){var Le=w.interleaved;Le===null?(D.next=D,c6(w)):(D.next=Le.next,Le.next=D),w.interleaved=D;return}}catch{}finally{}q=z$(O,w,D,W),q!==null&&(D=T1(),ta(q,O,W,D),V$(q,w,W))}}function F$(O){var w=O.alternate;return O===wr||w!==null&&w===wr}function $$(O,w){fg=Cy=!0;var q=O.pending;q===null?w.next=w:(w.next=q.next,q.next=w),O.pending=w}function V$(O,w,q){if((q&4194240)!==0){var W=w.lanes;W&=O.pendingLanes,q|=W,w.lanes=q,Mb(O,q)}}var Ty={readContext:ri,useCallback:o1,useContext:o1,useEffect:o1,useImperativeHandle:o1,useInsertionEffect:o1,useLayoutEffect:o1,useMemo:o1,useReducer:o1,useRef:o1,useState:o1,useDebugValue:o1,useDeferredValue:o1,useTransition:o1,useMutableSource:o1,useSyncExternalStore:o1,useId:o1,unstable_isNewReconciler:!1},h_e={readContext:ri,useCallback:function(O,w){return Pa().memoizedState=[O,w===void 0?null:w],O},useContext:ri,useEffect:E$,useImperativeHandle:function(O,w,q){return q=q!=null?q.concat([O]):null,qy(4194308,4,N$.bind(null,w,O),q)},useLayoutEffect:function(O,w){return qy(4194308,4,O,w)},useInsertionEffect:function(O,w){return qy(4,2,O,w)},useMemo:function(O,w){var q=Pa();return w=w===void 0?null:w,O=O(),q.memoizedState=[O,w],O},useReducer:function(O,w,q){var W=Pa();return w=q!==void 0?q(w):w,W.memoizedState=W.baseState=w,O={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:O,lastRenderedState:w},W.queue=O,O=O.dispatch=f_e.bind(null,wr,O),[W.memoizedState,O]},useRef:function(O){var w=Pa();return O={current:O},w.memoizedState=O},useState:R$,useDebugValue:y6,useDeferredValue:function(O){return Pa().memoizedState=O},useTransition:function(){var O=R$(!1),w=O[0];return O=p_e.bind(null,O[1]),Pa().memoizedState=O,[w,O]},useMutableSource:function(){},useSyncExternalStore:function(O,w,q){var W=wr,D=Pa();if(hr){if(q===void 0)throw Error(n(407));q=q()}else{if(q=w(),A0===null)throw Error(n(349));(Sp&30)!==0||_$(W,w,q)}D.memoizedState=q;var K={value:q,getSnapshot:w};return D.queue=K,E$(S$.bind(null,W,K,O),[O]),W.flags|=2048,mg(9,k$.bind(null,W,K,q,w),void 0,null),q},useId:function(){var O=Pa(),w=A0.identifierPrefix;if(hr){var q=Xc,W=Uc;q=(W&~(1<<32-ks(W)-1)).toString(32)+q,w=":"+w+"R"+q,q=bg++,0<\/script>",O=O.removeChild(O.firstChild)):typeof W.is=="string"?O=ue.createElement(q,{is:W.is}):(O=ue.createElement(q),q==="select"&&(ue=O,W.multiple?ue.multiple=!0:W.size&&(ue.size=W.size))):O=ue.createElementNS(O,q),O[Na]=w,O[ag]=W,uV(O,w,!1,!1),w.stateNode=O;e:{switch(ue=ot(q,W),q){case"dialog":ir("cancel",O),ir("close",O),D=W;break;case"iframe":case"object":case"embed":ir("load",O),D=W;break;case"video":case"audio":for(D=0;Djb&&(w.flags|=128,W=!0,gg(K,!1),w.lanes=4194304)}else{if(!W)if(O=ky(ue),O!==null){if(w.flags|=128,W=!0,q=O.updateQueue,q!==null&&(w.updateQueue=q,w.flags|=4),gg(K,!0),K.tail===null&&K.tailMode==="hidden"&&!ue.alternate&&!hr)return r1(w),null}else 2*rr()-K.renderingStartTime>jb&&q!==1073741824&&(w.flags|=128,W=!0,gg(K,!1),w.lanes=4194304);K.isBackwards?(ue.sibling=w.child,w.child=ue):(q=K.last,q!==null?q.sibling=ue:w.child=ue,K.last=ue)}return K.tail!==null?(w=K.tail,K.rendering=w,K.tail=w.sibling,K.renderingStartTime=rr(),w.sibling=null,q=xr.current,Qo(xr,W?q&1|2:q&1),w):(r1(w),null);case 22:case 23:return H6(),W=w.memoizedState!==null,O!==null&&O.memoizedState!==null!==W&&(w.flags|=8192),W&&(w.mode&1)!==0?(Ts&1073741824)!==0&&(r1(w),w.subtreeFlags&6&&(w.flags|=8192)):r1(w),null;case 24:return null;case 25:return null}throw Error(n(156,w.tag))}function v_e(O,w){switch(e6(w),w.tag){case 1:return G1(w.type)&&my(),O=w.flags,O&65536?(w.flags=O&-65537|128,w):null;case 3:return Bb(),ar(X1),ar(n1),f6(),O=w.flags,(O&65536)!==0&&(O&128)===0?(w.flags=O&-65537|128,w):null;case 5:return d6(w),null;case 13:if(ar(xr),O=w.memoizedState,O!==null&&O.dehydrated!==null){if(w.alternate===null)throw Error(n(340));Rb()}return O=w.flags,O&65536?(w.flags=O&-65537|128,w):null;case 19:return ar(xr),null;case 4:return Bb(),null;case 10:return i6(w.type._context),null;case 22:case 23:return H6(),null;case 24:return null;default:return null}}var Ny=!1,s1=!1,x_e=typeof WeakSet=="function"?WeakSet:Set,It=null;function Lb(O,w){var q=O.ref;if(q!==null)if(typeof q=="function")try{q(null)}catch(W){Br(O,w,W)}else q.current=null}function E6(O,w,q){try{q()}catch(W){Br(O,w,W)}}var fV=!1;function w_e(O,w){if(Hk=ny,O=HF(),Lk(O)){if("selectionStart"in O)var q={start:O.selectionStart,end:O.selectionEnd};else e:{q=(q=O.ownerDocument)&&q.defaultView||window;var W=q.getSelection&&q.getSelection();if(W&&W.rangeCount!==0){q=W.anchorNode;var D=W.anchorOffset,K=W.focusNode;W=W.focusOffset;try{q.nodeType,K.nodeType}catch{q=null;break e}var ue=0,Re=-1,Le=-1,Ge=0,ct=0,dt=O,st=null;t:for(;;){for(var Et;dt!==q||D!==0&&dt.nodeType!==3||(Re=ue+D),dt!==K||W!==0&&dt.nodeType!==3||(Le=ue+W),dt.nodeType===3&&(ue+=dt.nodeValue.length),(Et=dt.firstChild)!==null;)st=dt,dt=Et;for(;;){if(dt===O)break t;if(st===q&&++Ge===D&&(Re=ue),st===K&&++ct===W&&(Le=ue),(Et=dt.nextSibling)!==null)break;dt=st,st=dt.parentNode}dt=Et}q=Re===-1||Le===-1?null:{start:Re,end:Le}}else q=null}q=q||{start:0,end:0}}else q=null;for(Uk={focusedElem:O,selectionRange:q},ny=!1,It=w;It!==null;)if(w=It,O=w.child,(w.subtreeFlags&1028)!==0&&O!==null)O.return=w,It=O;else for(;It!==null;){w=It;try{var Dt=w.alternate;if((w.flags&1024)!==0)switch(w.tag){case 0:case 11:case 15:break;case 1:if(Dt!==null){var $t=Dt.memoizedProps,Vr=Dt.memoizedState,$e=w.stateNode,De=$e.getSnapshotBeforeUpdate(w.elementType===w.type?$t:Qi(w.type,$t),Vr);$e.__reactInternalSnapshotBeforeUpdate=De}break;case 3:var He=w.stateNode.containerInfo;He.nodeType===1?He.textContent="":He.nodeType===9&&He.documentElement&&He.removeChild(He.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(bt){Br(w,w.return,bt)}if(O=w.sibling,O!==null){O.return=w.return,It=O;break}It=w.return}return Dt=fV,fV=!1,Dt}function Mg(O,w,q){var W=w.updateQueue;if(W=W!==null?W.lastEffect:null,W!==null){var D=W=W.next;do{if((D.tag&O)===O){var K=D.destroy;D.destroy=void 0,K!==void 0&&E6(w,q,K)}D=D.next}while(D!==W)}}function Ly(O,w){if(w=w.updateQueue,w=w!==null?w.lastEffect:null,w!==null){var q=w=w.next;do{if((q.tag&O)===O){var W=q.create;q.destroy=W()}q=q.next}while(q!==w)}}function W6(O){var w=O.ref;if(w!==null){var q=O.stateNode;switch(O.tag){case 5:O=q;break;default:O=q}typeof w=="function"?w(O):w.current=O}}function bV(O){var w=O.alternate;w!==null&&(O.alternate=null,bV(w)),O.child=null,O.deletions=null,O.sibling=null,O.tag===5&&(w=O.stateNode,w!==null&&(delete w[Na],delete w[ag],delete w[Yk],delete w[a_e],delete w[c_e])),O.stateNode=null,O.return=null,O.dependencies=null,O.memoizedProps=null,O.memoizedState=null,O.pendingProps=null,O.stateNode=null,O.updateQueue=null}function hV(O){return O.tag===5||O.tag===3||O.tag===4}function mV(O){e:for(;;){for(;O.sibling===null;){if(O.return===null||hV(O.return))return null;O=O.return}for(O.sibling.return=O.return,O=O.sibling;O.tag!==5&&O.tag!==6&&O.tag!==18;){if(O.flags&2||O.child===null||O.tag===4)continue e;O.child.return=O,O=O.child}if(!(O.flags&2))return O.stateNode}}function B6(O,w,q){var W=O.tag;if(W===5||W===6)O=O.stateNode,w?q.nodeType===8?q.parentNode.insertBefore(O,w):q.insertBefore(O,w):(q.nodeType===8?(w=q.parentNode,w.insertBefore(O,q)):(w=q,w.appendChild(O)),q=q._reactRootContainer,q!=null||w.onclick!==null||(w.onclick=by));else if(W!==4&&(O=O.child,O!==null))for(B6(O,w,q),O=O.sibling;O!==null;)B6(O,w,q),O=O.sibling}function N6(O,w,q){var W=O.tag;if(W===5||W===6)O=O.stateNode,w?q.insertBefore(O,w):q.appendChild(O);else if(W!==4&&(O=O.child,O!==null))for(N6(O,w,q),O=O.sibling;O!==null;)N6(O,w,q),O=O.sibling}var I0=null,Ji=!1;function Cu(O,w,q){for(q=q.child;q!==null;)gV(O,w,q),q=q.sibling}function gV(O,w,q){if(_s&&typeof _s.onCommitFiberUnmount=="function")try{_s.onCommitFiberUnmount(Fc,q)}catch{}switch(q.tag){case 5:s1||Lb(q,w);case 6:var W=I0,D=Ji;I0=null,Cu(O,w,q),I0=W,Ji=D,I0!==null&&(Ji?(O=I0,q=q.stateNode,O.nodeType===8?O.parentNode.removeChild(q):O.removeChild(q)):I0.removeChild(q.stateNode));break;case 18:I0!==null&&(Ji?(O=I0,q=q.stateNode,O.nodeType===8?Kk(O.parentNode,q):O.nodeType===1&&Kk(O,q),Ym(O)):Kk(I0,q.stateNode));break;case 4:W=I0,D=Ji,I0=q.stateNode.containerInfo,Ji=!0,Cu(O,w,q),I0=W,Ji=D;break;case 0:case 11:case 14:case 15:if(!s1&&(W=q.updateQueue,W!==null&&(W=W.lastEffect,W!==null))){D=W=W.next;do{var K=D,ue=K.destroy;K=K.tag,ue!==void 0&&((K&2)!==0||(K&4)!==0)&&E6(q,w,ue),D=D.next}while(D!==W)}Cu(O,w,q);break;case 1:if(!s1&&(Lb(q,w),W=q.stateNode,typeof W.componentWillUnmount=="function"))try{W.props=q.memoizedProps,W.state=q.memoizedState,W.componentWillUnmount()}catch(Re){Br(q,w,Re)}Cu(O,w,q);break;case 21:Cu(O,w,q);break;case 22:q.mode&1?(s1=(W=s1)||q.memoizedState!==null,Cu(O,w,q),s1=W):Cu(O,w,q);break;default:Cu(O,w,q)}}function MV(O){var w=O.updateQueue;if(w!==null){O.updateQueue=null;var q=O.stateNode;q===null&&(q=O.stateNode=new x_e),w.forEach(function(W){var D=W_e.bind(null,O,W);q.has(W)||(q.add(W),W.then(D,D))})}}function ea(O,w){var q=w.deletions;if(q!==null)for(var W=0;WD&&(D=ue),W&=~K}if(W=D,W=rr()-W,W=(120>W?120:480>W?480:1080>W?1080:1920>W?1920:3e3>W?3e3:4320>W?4320:1960*k_e(W/1960))-W,10O?16:O,Ru===null)var W=!1;else{if(O=Ru,Ru=null,Fy=0,(co&6)!==0)throw Error(n(331));var D=co;for(co|=4,It=O.current;It!==null;){var K=It,ue=K.child;if((It.flags&16)!==0){var Re=K.deletions;if(Re!==null){for(var Le=0;Lerr()-j6?Rp(O,0):P6|=q),Z1(O,w)}function RV(O,w){w===0&&((O.mode&1)===0?w=1:(w=Ki,Ki<<=1,(Ki&130023424)===0&&(Ki=4194304)));var q=T1();O=Gc(O,w),O!==null&&($c(O,w,q),Z1(O,q))}function E_e(O){var w=O.memoizedState,q=0;w!==null&&(q=w.retryLane),RV(O,q)}function W_e(O,w){var q=0;switch(O.tag){case 13:var W=O.stateNode,D=O.memoizedState;D!==null&&(q=D.retryLane);break;case 19:W=O.stateNode;break;default:throw Error(n(314))}W!==null&&W.delete(w),RV(O,q)}var TV;TV=function(O,w,q){if(O!==null)if(O.memoizedProps!==w.pendingProps||X1.current)K1=!0;else{if((O.lanes&q)===0&&(w.flags&128)===0)return K1=!1,y_e(O,w,q);K1=(O.flags&131072)!==0}else K1=!1,hr&&(w.flags&1048576)!==0&&d$(w,Oy,w.index);switch(w.lanes=0,w.tag){case 2:var W=w.type;By(O,w),O=w.pendingProps;var D=Sb(w,n1.current);Wb(w,q),D=m6(null,w,W,O,D,q);var K=g6();return w.flags|=1,typeof D=="object"&&D!==null&&typeof D.render=="function"&&D.$$typeof===void 0?(w.tag=1,w.memoizedState=null,w.updateQueue=null,G1(W)?(K=!0,gy(w)):K=!1,w.memoizedState=D.state!==null&&D.state!==void 0?D.state:null,l6(w),D.updater=Ey,w.stateNode=D,D._reactInternals=w,v6(w,W,O,q),w=k6(null,w,W,!0,K,q)):(w.tag=0,hr&&K&&Jk(w),R1(null,w,D,q),w=w.child),w;case 16:W=w.elementType;e:{switch(By(O,w),O=w.pendingProps,D=W._init,W=D(W._payload),w.type=W,D=w.tag=N_e(W),O=Qi(W,O),D){case 0:w=_6(null,w,W,O,q);break e;case 1:w=rV(null,w,W,O,q);break e;case 11:w=J$(null,w,W,O,q);break e;case 14:w=eV(null,w,W,Qi(W.type,O),q);break e}throw Error(n(306,W,""))}return w;case 0:return W=w.type,D=w.pendingProps,D=w.elementType===W?D:Qi(W,D),_6(O,w,W,D,q);case 1:return W=w.type,D=w.pendingProps,D=w.elementType===W?D:Qi(W,D),rV(O,w,W,D,q);case 3:e:{if(sV(w),O===null)throw Error(n(387));W=w.pendingProps,K=w.memoizedState,D=K.element,O$(O,w),_y(w,W,null,q);var ue=w.memoizedState;if(W=ue.element,K.isDehydrated)if(K={element:W,isDehydrated:!1,cache:ue.cache,pendingSuspenseBoundaries:ue.pendingSuspenseBoundaries,transitions:ue.transitions},w.updateQueue.baseState=K,w.memoizedState=K,w.flags&256){D=Nb(Error(n(423)),w),w=iV(O,w,W,q,D);break e}else if(W!==D){D=Nb(Error(n(424)),w),w=iV(O,w,W,q,D);break e}else for(Rs=vu(w.stateNode.containerInfo.firstChild),qs=w,hr=!0,Zi=null,q=M$(w,null,W,q),w.child=q;q;)q.flags=q.flags&-3|4096,q=q.sibling;else{if(Rb(),W===D){w=Yc(O,w,q);break e}R1(O,w,W,q)}w=w.child}return w;case 5:return v$(w),O===null&&n6(w),W=w.type,D=w.pendingProps,K=O!==null?O.memoizedProps:null,ue=D.children,Xk(W,D)?ue=null:K!==null&&Xk(W,K)&&(w.flags|=32),oV(O,w),R1(O,w,ue,q),w.child;case 6:return O===null&&n6(w),null;case 13:return aV(O,w,q);case 4:return u6(w,w.stateNode.containerInfo),W=w.pendingProps,O===null?w.child=Tb(w,null,W,q):R1(O,w,W,q),w.child;case 11:return W=w.type,D=w.pendingProps,D=w.elementType===W?D:Qi(W,D),J$(O,w,W,D,q);case 7:return R1(O,w,w.pendingProps,q),w.child;case 8:return R1(O,w,w.pendingProps.children,q),w.child;case 12:return R1(O,w,w.pendingProps.children,q),w.child;case 10:e:{if(W=w.type._context,D=w.pendingProps,K=w.memoizedProps,ue=D.value,Qo(vy,W._currentValue),W._currentValue=ue,K!==null)if(Yi(K.value,ue)){if(K.children===D.children&&!X1.current){w=Yc(O,w,q);break e}}else for(K=w.child,K!==null&&(K.return=w);K!==null;){var Re=K.dependencies;if(Re!==null){ue=K.child;for(var Le=Re.firstContext;Le!==null;){if(Le.context===W){if(K.tag===1){Le=Kc(-1,q&-q),Le.tag=2;var Ge=K.updateQueue;if(Ge!==null){Ge=Ge.shared;var ct=Ge.pending;ct===null?Le.next=Le:(Le.next=ct.next,ct.next=Le),Ge.pending=Le}}K.lanes|=q,Le=K.alternate,Le!==null&&(Le.lanes|=q),a6(K.return,q,w),Re.lanes|=q;break}Le=Le.next}}else if(K.tag===10)ue=K.type===w.type?null:K.child;else if(K.tag===18){if(ue=K.return,ue===null)throw Error(n(341));ue.lanes|=q,Re=ue.alternate,Re!==null&&(Re.lanes|=q),a6(ue,q,w),ue=K.sibling}else ue=K.child;if(ue!==null)ue.return=K;else for(ue=K;ue!==null;){if(ue===w){ue=null;break}if(K=ue.sibling,K!==null){K.return=ue.return,ue=K;break}ue=ue.return}K=ue}R1(O,w,D.children,q),w=w.child}return w;case 9:return D=w.type,W=w.pendingProps.children,Wb(w,q),D=ri(D),W=W(D),w.flags|=1,R1(O,w,W,q),w.child;case 14:return W=w.type,D=Qi(W,w.pendingProps),D=Qi(W.type,D),eV(O,w,W,D,q);case 15:return tV(O,w,w.type,w.pendingProps,q);case 17:return W=w.type,D=w.pendingProps,D=w.elementType===W?D:Qi(W,D),By(O,w),w.tag=1,G1(W)?(O=!0,gy(w)):O=!1,Wb(w,q),U$(w,W,D),v6(w,W,D,q),k6(null,w,W,!0,O,q);case 19:return lV(O,w,q);case 22:return nV(O,w,q)}throw Error(n(156,w.tag))};function EV(O,w){return bu(O,w)}function B_e(O,w,q,W){this.tag=O,this.key=q,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=w,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=W,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ai(O,w,q,W){return new B_e(O,w,q,W)}function X6(O){return O=O.prototype,!(!O||!O.isReactComponent)}function N_e(O){if(typeof O=="function")return X6(O)?1:0;if(O!=null){if(O=O.$$typeof,O===B)return 11;if(O===I)return 14}return 2}function Wu(O,w){var q=O.alternate;return q===null?(q=ai(O.tag,w,O.key,O.mode),q.elementType=O.elementType,q.type=O.type,q.stateNode=O.stateNode,q.alternate=O,O.alternate=q):(q.pendingProps=w,q.type=O.type,q.flags=0,q.subtreeFlags=0,q.deletions=null),q.flags=O.flags&14680064,q.childLanes=O.childLanes,q.lanes=O.lanes,q.child=O.child,q.memoizedProps=O.memoizedProps,q.memoizedState=O.memoizedState,q.updateQueue=O.updateQueue,w=O.dependencies,q.dependencies=w===null?null:{lanes:w.lanes,firstContext:w.firstContext},q.sibling=O.sibling,q.index=O.index,q.ref=O.ref,q}function Uy(O,w,q,W,D,K){var ue=2;if(W=O,typeof O=="function")X6(O)&&(ue=1);else if(typeof O=="string")ue=5;else e:switch(O){case S:return Ep(q.children,D,K,w);case C:ue=8,D|=8;break;case R:return O=ai(12,q,w,D|2),O.elementType=R,O.lanes=K,O;case N:return O=ai(13,q,w,D),O.elementType=N,O.lanes=K,O;case j:return O=ai(19,q,w,D),O.elementType=j,O.lanes=K,O;case $:return Xy(q,D,K,w);default:if(typeof O=="object"&&O!==null)switch(O.$$typeof){case T:ue=10;break e;case E:ue=9;break e;case B:ue=11;break e;case I:ue=14;break e;case P:ue=16,W=null;break e}throw Error(n(130,O==null?O:typeof O,""))}return w=ai(ue,q,w,D),w.elementType=O,w.type=W,w.lanes=K,w}function Ep(O,w,q,W){return O=ai(7,O,W,w),O.lanes=q,O}function Xy(O,w,q,W){return O=ai(22,O,W,w),O.elementType=$,O.lanes=q,O.stateNode={isHidden:!1},O}function G6(O,w,q){return O=ai(6,O,null,w),O.lanes=q,O}function K6(O,w,q){return w=ai(4,O.children!==null?O.children:[],O.key,w),w.lanes=q,w.stateNode={containerInfo:O.containerInfo,pendingChildren:null,implementation:O.implementation},w}function L_e(O,w,q,W,D){this.tag=w,this.containerInfo=O,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Hm(0),this.expirationTimes=Hm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hm(0),this.identifierPrefix=W,this.onRecoverableError=D,this.mutableSourceEagerHydrationData=null}function Y6(O,w,q,W,D,K,ue,Re,Le){return O=new L_e(O,w,q,Re,Le),w===1?(w=1,K===!0&&(w|=8)):w=0,K=ai(3,null,null,w),O.current=K,K.stateNode=O,K.memoizedState={element:W,isDehydrated:q,cache:null,transitions:null,pendingSuspenseBoundaries:null},l6(K),O}function P_e(O,w,q){var W=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),rS.exports=ake(),rS.exports}var ps=Ore(),eA={},GV;function cke(){if(GV)return eA;GV=1;var e=Ore();return eA.createRoot=e.createRoot,eA.hydrateRoot=e.hydrateRoot,eA}var lke=cke();const uke=e=>typeof e=="number"?!1:typeof e?.valueOf()=="string"||Array.isArray(e)?!e.length:!e,S0={OS:"web",select:e=>"web"in e?e.web:e.default,isWeb:!0};/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */function KV(e){return Object.prototype.toString.call(e)==="[object Object]"}function d3(e){var t,n;return KV(e)===!1?!1:(t=e.constructor,t===void 0?!0:(n=t.prototype,!(KV(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)))}var o8=function(e,t){return o8=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])},o8(e,t)};function dke(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");o8(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Nr=function(){return Nr=Object.assign||function(t){for(var n,o=1,r=arguments.length;o0&&n>="0"&&n<="9"?"_"+n+o:""+n.toUpperCase()+o}function v4(e,t){return t===void 0&&(t={}),b5(e,Nr({delimiter:"",transform:yre},t))}function hke(e,t){return t===0?e.toLowerCase():yre(e,t)}function bB(e,t){return t===void 0&&(t={}),v4(e,Nr({transform:hke},t))}function mke(e){return e.charAt(0).toUpperCase()+e.substr(1)}function gke(e){return mke(e.toLowerCase())}function Are(e,t){return t===void 0&&(t={}),b5(e,Nr({delimiter:" ",transform:gke},t))}function Mke(e,t){return t===void 0&&(t={}),b5(e,Nr({delimiter:"."},t))}function Is(e,t){return t===void 0&&(t={}),Mke(e,Nr({delimiter:"-"},t))}function zke(e){return e.replace(/>/g,">")}const Oke=/[\u007F-\u009F "'>/="\uFDD0-\uFDEF]/;function vre(e){return e.replace(/&(?!([a-z0-9]+|#[0-9]+|#x[a-f0-9]+);)/gi,"&")}function yke(e){return e.replace(/"/g,""")}function xre(e){return e.replace(/{typeof o=="string"&&o.trim()!==""&&(n+=o)}),x.createElement("div",{dangerouslySetInnerHTML:{__html:n},...t})}const{Provider:vke,Consumer:xke}=x.createContext(void 0),wke=x.forwardRef(()=>null),_ke=new Set(["string","boolean","number"]),kke=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Ske=new Set(["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"]),Cke=new Set(["autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"]),qke=new Set(["animation","animationIterationCount","baselineShift","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","cx","cy","fillOpacity","flexGrow","flexShrink","floodOpacity","fontWeight","gridColumnEnd","gridColumnStart","gridRowEnd","gridRowStart","lineHeight","opacity","order","orphans","r","rx","ry","shapeImageThreshold","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","x","y","zIndex","zoom"]);function _re(e,t){return t.some(n=>e.indexOf(n)===0)}function Rke(e){return e==="key"||e==="children"}function Tke(e,t){switch(e){case"style":return Pke(t)}return t}const ZV=["accentHeight","alignmentBaseline","arabicForm","baselineShift","capHeight","clipPath","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","dominantBaseline","enableBackground","fillOpacity","fillRule","floodColor","floodOpacity","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","horizAdvX","horizOriginX","imageRendering","letterSpacing","lightingColor","markerEnd","markerMid","markerStart","overlinePosition","overlineThickness","paintOrder","panose1","pointerEvents","renderingIntent","shapeRendering","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","textAnchor","textDecoration","textRendering","underlinePosition","underlineThickness","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","vHanging","vIdeographic","vMathematical","vectorEffect","vertAdvY","vertOriginX","vertOriginY","wordSpacing","writingMode","xmlnsXlink","xHeight"].reduce((e,t)=>(e[t.toLowerCase()]=t,e),{}),QV=["allowReorder","attributeName","attributeType","autoReverse","baseFrequency","baseProfile","calcMode","clipPathUnits","contentScriptType","contentStyleType","diffuseConstant","edgeMode","externalResourcesRequired","filterRes","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","suppressContentEditableWarning","suppressHydrationWarning","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector"].reduce((e,t)=>(e[t.toLowerCase()]=t,e),{}),JV=["xlink:actuate","xlink:arcrole","xlink:href","xlink:role","xlink:show","xlink:title","xlink:type","xml:base","xml:lang","xml:space","xmlns:xlink"].reduce((e,t)=>(e[t.replace(":","").toLowerCase()]=t,e),{});function Eke(e){switch(e){case"htmlFor":return"for";case"className":return"class"}const t=e.toLowerCase();return QV[t]?QV[t]:ZV[t]?Is(ZV[t]):JV[t]?JV[t]:t}function Wke(e){return e.startsWith("--")?e:_re(e,["ms","O","Moz","Webkit"])?"-"+Is(e):Is(e)}function Bke(e,t){return typeof t=="number"&&t!==0&&!qke.has(e)?t+"px":t}function m1(e,t,n={}){if(e==null||e===!1)return"";if(Array.isArray(e))return gM(e,t,n);switch(typeof e){case"string":return r8(e);case"number":return e.toString()}const{type:o,props:r}=e;switch(o){case x.StrictMode:case x.Fragment:return gM(r.children,t,n);case s0:const{children:s,...i}=r;return eH(Object.keys(i).length?"div":null,{...i,dangerouslySetInnerHTML:{__html:s}},t,n)}switch(typeof o){case"string":return eH(o,r,t,n);case"function":return o.prototype&&typeof o.prototype.render=="function"?Nke(o,r,t,n):m1(o(r,n),t,n)}switch(o&&o.$$typeof){case vke.$$typeof:return gM(r.children,r.value,n);case xke.$$typeof:return m1(r.children(t||o._currentValue),t,n);case wke.$$typeof:return m1(o.render(r),t,n)}return""}function eH(e,t,n,o={}){let r="";if(e==="textarea"&&t.hasOwnProperty("value")){r=gM(t.value,n,o);const{value:i,...c}=t;t=c}else t.dangerouslySetInnerHTML&&typeof t.dangerouslySetInnerHTML.__html=="string"?r=t.dangerouslySetInnerHTML.__html:typeof t.children<"u"&&(r=gM(t.children,n,o));if(!e)return r;const s=Lke(t);return kke.has(e)?"<"+e+s+"/>":"<"+e+s+">"+r+""}function Nke(e,t,n,o={}){const r=new e(t,o);return typeof r.getChildContext=="function"&&Object.assign(o,r.getChildContext()),m1(r.render(),n,o)}function gM(e,t,n={}){let o="";e=Array.isArray(e)?e:[e];for(let r=0;r0&&!(i>=u[d-1].priority);d--);d===u.length?u[d]=l:u.splice(d,0,l),c.__current.forEach(p=>{p.name===o&&p.currentIndex>=d&&p.currentIndex++})}else c[o]={handlers:[l],runs:0};o!=="hookAdded"&&e.doAction("hookAdded",o,r,s,i)}}function tA(e,t,n=!1){return function(r,s){const i=e[t];if(!hB(r)||!n&&!kre(s))return;if(!i[r])return 0;let c=0;if(n)c=i[r].handlers.length,i[r]={runs:i[r].runs,handlers:[]};else{const l=i[r].handlers;for(let u=l.length-1;u>=0;u--)l[u].namespace===s&&(l.splice(u,1),c++,i.__current.forEach(d=>{d.name===r&&d.currentIndex>=u&&d.currentIndex--}))}return r!=="hookRemoved"&&e.doAction("hookRemoved",r,s),c}}function nH(e,t){return function(o,r){const s=e[t];return typeof r<"u"?o in s&&s[o].handlers.some(i=>i.namespace===r):o in s}}function nA(e,t,n,o){return function(s,...i){const c=e[t];c[s]||(c[s]={handlers:[],runs:0}),c[s].runs++;const l=c[s].handlers;if(!l||!l.length)return n?i[0]:void 0;const u={name:s,currentIndex:0};async function d(){try{c.__current.add(u);let f=n?i[0]:void 0;for(;u.currentIndex"u"?r.__current.size>0:Array.from(r.__current).some(s=>s.name===o)}}function sH(e,t){return function(o){const r=e[t];if(hB(o))return r[o]&&r[o].runs?r[o].runs:0}}class jke{constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=tH(this,"actions"),this.addFilter=tH(this,"filters"),this.removeAction=tA(this,"actions"),this.removeFilter=tA(this,"filters"),this.hasAction=nH(this,"actions"),this.hasFilter=nH(this,"filters"),this.removeAllActions=tA(this,"actions",!0),this.removeAllFilters=tA(this,"filters",!0),this.doAction=nA(this,"actions",!1,!1),this.doActionAsync=nA(this,"actions",!1,!0),this.applyFilters=nA(this,"filters",!0,!1),this.applyFiltersAsync=nA(this,"filters",!0,!0),this.currentAction=oH(this,"actions"),this.currentFilter=oH(this,"filters"),this.doingAction=rH(this,"actions"),this.doingFilter=rH(this,"filters"),this.didAction=sH(this,"actions"),this.didFilter=sH(this,"filters")}}function Sre(){return new jke}const Cre=Sre(),{addAction:x4,addFilter:Nn,removeAction:s8,removeFilter:i8,hasAction:amn,hasFilter:qre,removeAllActions:cmn,removeAllFilters:lmn,doAction:mB,doActionAsync:Ike,applyFilters:zr,applyFiltersAsync:Dke,currentAction:umn,currentFilter:dmn,doingAction:pmn,doingFilter:fmn,didAction:bmn,didFilter:hmn,actions:mmn,filters:gmn}=Cre,iH=Object.create(null);function Ze(e,t={}){const{since:n,version:o,alternative:r,plugin:s,link:i,hint:c}=t,l=s?` from ${s}`:"",u=n?` since version ${n}`:"",d=o?` and will be removed${l} in version ${o}`:"",p=r?` Please use ${r} instead.`:"",f=i?` See: ${i}`:"",b=c?` Note: ${c}`:"",h=`${e} is deprecated${u}${d}.${p}${f}${b}`;h in iH||(mB("deprecated",e,t,h),console.warn(h),iH[h]=!0)}function ts(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Fke=typeof Symbol=="function"&&Symbol.observable||"@@observable",aH=Fke,cH=()=>Math.random().toString(36).substring(7).split("").join("."),$ke={INIT:`@@redux/INIT${cH()}`,REPLACE:`@@redux/REPLACE${cH()}`},lH=$ke;function Vke(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Rre(e,t,n){if(typeof e!="function")throw new Error(ts(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(ts(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ts(1));return n(Rre)(e,t)}let o=e,r=t,s=new Map,i=s,c=0,l=!1;function u(){i===s&&(i=new Map,s.forEach((z,y)=>{i.set(y,z)}))}function d(){if(l)throw new Error(ts(3));return r}function p(z){if(typeof z!="function")throw new Error(ts(4));if(l)throw new Error(ts(5));let y=!0;u();const _=c++;return i.set(_,z),function(){if(y){if(l)throw new Error(ts(6));y=!1,u(),i.delete(_),s=null}}}function f(z){if(!Vke(z))throw new Error(ts(7));if(typeof z.type>"u")throw new Error(ts(8));if(typeof z.type!="string")throw new Error(ts(17));if(l)throw new Error(ts(9));try{l=!0,r=o(r,z)}finally{l=!1}return(s=i).forEach(_=>{_()}),z}function b(z){if(typeof z!="function")throw new Error(ts(10));o=z,f({type:lH.REPLACE})}function h(){const z=p;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(ts(11));function _(){const M=y;M.next&&M.next(d())}return _(),{unsubscribe:z(_)}},[aH](){return this}}}return f({type:lH.INIT}),{dispatch:f,subscribe:p,getState:d,replaceReducer:b,[aH]:h}}function Hke(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...o)=>t(n(...o)))}function Uke(...e){return t=>(n,o)=>{const r=t(n,o);let s=()=>{throw new Error(ts(15))};const i={getState:r.getState,dispatch:(l,...u)=>s(l,...u)},c=e.map(l=>l(i));return s=Hke(...c)(r.dispatch),{...r,dispatch:s}}}var aS,uH;function Xke(){if(uH)return aS;uH=1;function e(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?e=function(c){return typeof c}:e=function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},e(i)}function t(i,c){if(!(i instanceof c))throw new TypeError("Cannot call a class as a function")}function n(i,c){for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:this;this._map.forEach(function(p,f){f!==null&&e(f)==="object"&&(p=p[1]),l.call(d,p,f,u)})}},{key:"clear",value:function(){this._map=new Map,this._arrayTreeMap=new Map,this._objectTreeMap=new Map}},{key:"size",get:function(){return this._map.size}}]),i}();return aS=s,aS}var Gke=Xke();const Ua=Zr(Gke);function Kke(e){return!!e&&typeof e[Symbol.iterator]=="function"&&typeof e.next=="function"}var cS={},Ho={},oA={},dH;function Tre(){if(dH)return oA;dH=1,Object.defineProperty(oA,"__esModule",{value:!0});var e={all:Symbol("all"),error:Symbol("error"),fork:Symbol("fork"),join:Symbol("join"),race:Symbol("race"),call:Symbol("call"),cps:Symbol("cps"),subscribe:Symbol("subscribe")};return oA.default=e,oA}var pH;function Ere(){if(pH)return Ho;pH=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.createChannel=Ho.subscribe=Ho.cps=Ho.apply=Ho.call=Ho.invoke=Ho.delay=Ho.race=Ho.join=Ho.fork=Ho.error=Ho.all=void 0;var e=Tre(),t=n(e);function n(o){return o&&o.__esModule?o:{default:o}}return Ho.all=function(r){return{type:t.default.all,value:r}},Ho.error=function(r){return{type:t.default.error,error:r}},Ho.fork=function(r){for(var s=arguments.length,i=Array(s>1?s-1:0),c=1;c1?s-1:0),c=1;c2?i-2:0),l=2;l1?s-1:0),c=1;c"u"?"undefined":e(i))==="object"&&!!i},all:function(i){return r.obj(i)&&i.type===n.default.all},error:function(i){return r.obj(i)&&i.type===n.default.error},array:Array.isArray,func:function(i){return typeof i=="function"},promise:function(i){return i&&r.func(i.then)},iterator:function(i){return i&&r.func(i.next)&&r.func(i.throw)},fork:function(i){return r.obj(i)&&i.type===n.default.fork},join:function(i){return r.obj(i)&&i.type===n.default.join},race:function(i){return r.obj(i)&&i.type===n.default.race},call:function(i){return r.obj(i)&&i.type===n.default.call},cps:function(i){return r.obj(i)&&i.type===n.default.cps},subscribe:function(i){return r.obj(i)&&i.type===n.default.subscribe},channel:function(i){return r.obj(i)&&r.func(i.subscribe)}};return sA.default=r,sA}var bH;function Yke(){if(bH)return J1;bH=1,Object.defineProperty(J1,"__esModule",{value:!0}),J1.iterator=J1.array=J1.object=J1.error=J1.any=void 0;var e=m5(),t=n(e);function n(l){return l&&l.__esModule?l:{default:l}}var o=J1.any=function(u,d,p,f){return f(u),!0},r=J1.error=function(u,d,p,f,b){return t.default.error(u)?(b(u.error),!0):!1},s=J1.object=function(u,d,p,f,b){if(!t.default.all(u)||!t.default.obj(u.value))return!1;var h={},g=Object.keys(u.value),z=0,y=!1,_=function(A,k){y||(h[A]=k,z++,z===g.length&&f(h))},v=function(A,k){y||(y=!0,b(k))};return g.map(function(M){p(u.value[M],function(A){return _(M,A)},function(A){return v(M,A)})}),!0},i=J1.array=function(u,d,p,f,b){if(!t.default.all(u)||!t.default.array(u.value))return!1;var h=[],g=0,z=!1,y=function(M,A){z||(h[M]=A,g++,g===u.value.length&&f(h))},_=function(M,A){z||(z=!0,b(A))};return u.value.map(function(v,M){p(v,function(A){return y(M,A)},function(A){return _(M,A)})}),!0},c=J1.iterator=function(u,d,p,f,b){return t.default.iterator(u)?(p(u,d,b),!0):!1};return J1.default=[r,c,i,s,o],J1}var hH;function Zke(){if(hH)return rA;hH=1,Object.defineProperty(rA,"__esModule",{value:!0});var e=Yke(),t=r(e),n=m5(),o=r(n);function r(c){return c&&c.__esModule?c:{default:c}}function s(c){if(Array.isArray(c)){for(var l=0,u=Array(c.length);l(c,l,u,d,p)=>{if(!o6e(c,s))return!1;const f=i(c);return Wre(f)?f.then(d,p):d(f),!0}),o=(s,i)=>a8(s)?(t(s),i(),!0):!1;n.push(o);const r=n6e.create(n);return s=>new Promise((i,c)=>r(s,l=>{a8(l)&&t(l),i(l)},c))}function s6e(e={}){return t=>{const n=r6e(e,t.dispatch);return o=>r=>Kke(r)?n(r):o(r)}}function yr(e,t){return n=>{const o=e(n);return o.displayName=i6e(t,n),o}}const i6e=(e,t)=>{const n=t.displayName||t.name||"Component";return`${v4(e??"")}(${n})`},j1=(e,t,n)=>{let o,r,s=0,i,c,l,u=0,d=!1,p=!1,f=!0;n&&(d=!!n.leading,p="maxWait"in n,n.maxWait!==void 0&&(s=Math.max(n.maxWait,t)),f="trailing"in n?!!n.trailing:f);function b(E){const B=o,N=r;return o=void 0,r=void 0,u=E,i=e.apply(N,B),i}function h(E,B){c=setTimeout(E,B)}function g(){c!==void 0&&clearTimeout(c)}function z(E){return u=E,h(M,t),d?b(E):i}function y(E){return E-(l||0)}function _(E){const B=y(E),N=E-u,j=t-B;return p?Math.min(j,s-N):j}function v(E){const B=y(E),N=E-u;return l===void 0||B>=t||B<0||p&&N>=s}function M(){const E=Date.now();if(v(E))return k(E);h(M,_(E))}function A(){c=void 0}function k(E){return A(),f&&o?b(E):(o=r=void 0,i)}function S(){g(),u=0,A(),o=l=r=void 0}function C(){return R()?k(Date.now()):i}function R(){return c!==void 0}function T(...E){const B=Date.now(),N=v(B);if(o=E,r=this,l=B,N){if(!R())return z(l);if(p)return h(M,t),b(l)}return R()||h(M,t),i}return T.cancel=S,T.flush=C,T.pending=R,T},gB=(e,t,n)=>{let o=!0,r=!0;return n&&(o="leading"in n?!!n.leading:o,r="trailing"in n?!!n.trailing:r),j1(e,t,{leading:o,trailing:r,maxWait:t})};function zc(){const e=new Map,t=new Map;function n(o){const r=t.get(o);if(r)for(const s of r)s()}return{get(o){return e.get(o)},set(o,r){e.set(o,r),n(o)},delete(o){e.delete(o),n(o)},subscribe(o,r){let s=t.get(o);return s||(s=new Set,t.set(o,s)),s.add(r),()=>{s.delete(r),s.size===0&&t.delete(o)}}}}const Bre=(e=!1)=>(...t)=>(...n)=>{const o=t.flat();return e&&o.reverse(),o.reduce((r,s)=>[s(...r)],n)[0]},nd=Bre(),ko=Bre(!0);function a6e(e){return yr(t=>n=>e(n)?a.jsx(t,{...n}):null,"ifCondition")}function Nre(e,t){if(e===t)return!0;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;let r=0;for(;r{if(n)return n;const o=u6e(e);return t?`${t}-${o}`:o},[e,n,t])}const d6e=yr(e=>t=>{const n=xt(e);return a.jsx(e,{...t,instanceId:n})},"instanceId"),p6e=yr(e=>class extends x.Component{constructor(n){super(n),this.timeouts=[],this.setTimeout=this.setTimeout.bind(this),this.clearTimeout=this.clearTimeout.bind(this)}componentWillUnmount(){this.timeouts.forEach(clearTimeout)}setTimeout(n,o){const r=setTimeout(()=>{n(),this.clearTimeout(r)},o);return this.timeouts.push(r),r}clearTimeout(n){clearTimeout(n),this.timeouts=this.timeouts.filter(o=>o!==n)}render(){return a.jsx(e,{...this.props,setTimeout:this.setTimeout,clearTimeout:this.clearTimeout})}},"withSafeTimeout");function f6e(e){return[e?'[tabindex]:not([tabindex^="-"])':"[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])",'iframe:not([tabindex^="-"])',"object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",")}function Lre(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function b6e(e){const t=e.closest("map[name]");if(!t)return!1;const n=e.ownerDocument.querySelector('img[usemap="#'+t.name+'"]');return!!n&&Lre(n)}function g5(e,{sequential:t=!1}={}){const n=e.querySelectorAll(f6e(t));return Array.from(n).filter(o=>{if(!Lre(o))return!1;const{nodeName:r}=o;return r==="AREA"?b6e(o):!0})}const h6e=Object.freeze(Object.defineProperty({__proto__:null,find:g5},Symbol.toStringTag,{value:"Module"}));function c8(e){const t=e.getAttribute("tabindex");return t===null?0:parseInt(t,10)}function Pre(e){return c8(e)!==-1}function m6e(){const e={};return function(n,o){const{nodeName:r,type:s,checked:i,name:c}=o;if(r!=="INPUT"||s!=="radio"||!c)return n.concat(o);const l=e.hasOwnProperty(c);if(!(i||!l))return n;if(l){const d=e[c];n=n.filter(p=>p!==d)}return e[c]=o,n.concat(o)}}function g6e(e,t){return{element:e,index:t}}function M6e(e){return e.element}function z6e(e,t){const n=c8(e.element),o=c8(t.element);return n===o?e.index-t.index:n-o}function MB(e){return e.filter(Pre).map(g6e).sort(z6e).map(M6e).reduce(m6e(),[])}function O6e(e){return MB(g5(e))}function y6e(e){return MB(g5(e.ownerDocument.body)).reverse().find(t=>e.compareDocumentPosition(t)&e.DOCUMENT_POSITION_PRECEDING)}function A6e(e){return MB(g5(e.ownerDocument.body)).find(t=>e.compareDocumentPosition(t)&e.DOCUMENT_POSITION_FOLLOWING)}const v6e=Object.freeze(Object.defineProperty({__proto__:null,find:O6e,findNext:A6e,findPrevious:y6e,isTabbableIndex:Pre},Symbol.toStringTag,{value:"Module"}));function Tv(e){if(!e.collapsed){const s=Array.from(e.getClientRects());if(s.length===1)return s[0];const i=s.filter(({width:p})=>p>1);if(i.length===0)return e.getBoundingClientRect();if(i.length===1)return i[0];let{top:c,bottom:l,left:u,right:d}=i[0];for(const{top:p,bottom:f,left:b,right:h}of i)pl&&(l=f),bd&&(d=h);return new window.DOMRect(u,c,d-u,l-c)}const{startContainer:t}=e,{ownerDocument:n}=t;if(t.nodeName==="BR"){const{parentNode:s}=t,i=Array.from(s.childNodes).indexOf(t);e=n.createRange(),e.setStart(s,i),e.setEnd(s,i)}const o=e.getClientRects();if(o.length>1)return null;let r=o[0];if(!r||r.height===0){const s=n.createTextNode("​");e=e.cloneRange(),e.insertNode(s),r=e.getClientRects()[0],s.parentNode,s.parentNode.removeChild(s)}return r}function l8(e){const t=e.getSelection(),n=t.rangeCount?t.getRangeAt(0):null;return n?Tv(n):null}function jre(e){e.defaultView;const t=e.defaultView.getSelection(),n=t.rangeCount?t.getRangeAt(0):null;return!!n&&!n.collapsed}function zB(e){return e?.nodeName==="INPUT"}function Ad(e){const t=["button","checkbox","hidden","file","radio","image","range","reset","submit","number","email","time"];return zB(e)&&e.type&&!t.includes(e.type)||e.nodeName==="TEXTAREA"||e.contentEditable==="true"}function x6e(e){if(!zB(e)&&!Ad(e))return!1;try{const{selectionStart:t,selectionEnd:n}=e;return t===null||t!==n}catch{return!0}}function w6e(e){return jre(e)||!!e.activeElement&&x6e(e.activeElement)}function _6e(e){return!!e.activeElement&&(zB(e.activeElement)||Ad(e.activeElement)||jre(e))}function w4(e){return e.ownerDocument.defaultView,e.ownerDocument.defaultView.getComputedStyle(e)}function B1(e,t="vertical"){if(e){if((t==="vertical"||t==="all")&&e.scrollHeight>e.clientHeight){const{overflowY:n}=w4(e);if(/(auto|scroll)/.test(n))return e}if((t==="horizontal"||t==="all")&&e.scrollWidth>e.clientWidth){const{overflowX:n}=w4(e);if(/(auto|scroll)/.test(n))return e}return e.ownerDocument===e.parentNode?e:B1(e.parentNode,t)}}function M5(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"}function k6e(e){if(M5(e))return e.selectionStart===0&&e.value.length===e.selectionEnd;if(!e.isContentEditable)return!0;const{ownerDocument:t}=e,{defaultView:n}=t,o=n.getSelection(),r=o.rangeCount?o.getRangeAt(0):null;if(!r)return!0;const{startContainer:s,endContainer:i,startOffset:c,endOffset:l}=r;if(s===e&&i===e&&c===0&&l===e.childNodes.length)return!0;e.lastChild;const u=i.nodeType===i.TEXT_NODE?i.data.length:i.childNodes.length;return yH(s,e,"firstChild")&&yH(i,e,"lastChild")&&c===0&&l===u}function yH(e,t,n){let o=t;do{if(e===o)return!0;o=o[n]}while(o);return!1}function Ire(e){if(!e)return!1;const{tagName:t}=e;return M5(e)||t==="BUTTON"||t==="SELECT"}function OB(e){return w4(e).direction==="rtl"}function S6e(e){const t=Array.from(e.getClientRects());if(!t.length)return;const n=Math.min(...t.map(({top:r})=>r));return Math.max(...t.map(({bottom:r})=>r))-n}function Dre(e){const{anchorNode:t,focusNode:n,anchorOffset:o,focusOffset:r}=e,s=t.compareDocumentPosition(n);return s&t.DOCUMENT_POSITION_PRECEDING?!1:s&t.DOCUMENT_POSITION_FOLLOWING?!0:s===0?o<=r:!0}function C6e(e,t,n){if(e.caretRangeFromPoint)return e.caretRangeFromPoint(t,n);if(!e.caretPositionFromPoint)return null;const o=e.caretPositionFromPoint(t,n);if(!o)return null;const r=e.createRange();return r.setStart(o.offsetNode,o.offset),r.collapse(!0),r}function Fre(e,t,n,o){const r=o.style.zIndex,s=o.style.position,{position:i="static"}=w4(o);i==="static"&&(o.style.position="relative"),o.style.zIndex="10000";const c=C6e(e,t,n);return o.style.zIndex=r,o.style.position=s,c}function $re(e,t,n){let o=n();return(!o||!o.startContainer||!e.contains(o.startContainer))&&(e.scrollIntoView(t),o=n(),!o||!o.startContainer||!e.contains(o.startContainer))?null:o}function Vre(e,t,n=!1){if(M5(e)&&typeof e.selectionStart=="number")return e.selectionStart!==e.selectionEnd?!1:t?e.selectionStart===0:e.value.length===e.selectionStart;if(!e.isContentEditable)return!0;const{ownerDocument:o}=e,{defaultView:r}=o,s=r.getSelection();if(!s||!s.rangeCount)return!1;const i=s.getRangeAt(0),c=i.cloneRange(),l=Dre(s),u=s.isCollapsed;u||c.collapse(!l);const d=Tv(c),p=Tv(i);if(!d||!p)return!1;const f=S6e(i);if(!u&&f&&f>d.height&&l===t)return!1;const b=OB(e)?!t:t,h=e.getBoundingClientRect(),g=b?h.left+1:h.right-1,z=t?h.top+1:h.bottom-1,y=$re(e,t,()=>Fre(o,g,z,e));if(!y)return!1;const _=Tv(y);if(!_)return!1;const v=t?"top":"bottom",M=b?"left":"right",A=_[v]-p[v],k=_[M]-d[M],S=Math.abs(A)<=1,C=Math.abs(k)<=1;return n?S:S&&C}function lS(e,t){return Vre(e,t)}function AH(e,t){return Vre(e,t,!0)}function q6e(e,t,n){const{ownerDocument:o}=e,r=OB(e)?!t:t,s=e.getBoundingClientRect();n===void 0?n=t?s.right-1:s.left+1:n<=s.left?n=s.left+1:n>=s.right&&(n=s.right-1);const i=r?s.bottom-1:s.top+1;return Fre(o,n,i,e)}function Hre(e,t,n){if(!e)return;if(e.focus(),M5(e)){if(typeof e.selectionStart!="number")return;t?(e.selectionStart=e.value.length,e.selectionEnd=e.value.length):(e.selectionStart=0,e.selectionEnd=0);return}if(!e.isContentEditable)return;const o=$re(e,t,()=>q6e(e,t,n));if(!o)return;const{ownerDocument:r}=e,{defaultView:s}=r,i=s.getSelection();i.removeAllRanges(),i.addRange(o)}function Ure(e,t){return Hre(e,t,void 0)}function R6e(e,t,n){return Hre(e,t,n?.left)}function Xre(e,t){t.parentNode,t.parentNode.insertBefore(e,t.nextSibling)}function bf(e){e.parentNode,e.parentNode.removeChild(e)}function T6e(e,t){e.parentNode,Xre(t,e.parentNode),bf(e)}function MM(e){const t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}function vH(e,t){const n=e.ownerDocument.createElement(t);for(;e.firstChild;)n.appendChild(e.firstChild);return e.parentNode,e.parentNode.replaceChild(n,e),n}function xg(e,t){t.parentNode,t.parentNode.insertBefore(e,t),e.appendChild(t)}function z5(e){const{body:t}=document.implementation.createHTMLDocument("");t.innerHTML=e;const n=t.getElementsByTagName("*");let o=n.length;for(;o--;){const r=n[o];if(r.tagName==="SCRIPT")bf(r);else{let s=r.attributes.length;for(;s--;){const{name:i}=r.attributes[s];i.startsWith("on")&&r.removeAttribute(i)}}}return t.innerHTML}function A1(e){e=z5(e);const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body.textContent||""}function _4(e){switch(e.nodeType){case e.TEXT_NODE:return/^[ \f\n\r\t\v\u00a0]*$/.test(e.nodeValue||"");case e.ELEMENT_NODE:return e.hasAttributes()?!1:e.hasChildNodes()?Array.from(e.childNodes).every(_4):!0;default:return!0}}const zM={strong:{},em:{},s:{},del:{},ins:{},a:{attributes:["href","target","rel","id"]},code:{},abbr:{attributes:["title"]},sub:{},sup:{},br:{},small:{},q:{attributes:["cite"]},dfn:{attributes:["title"]},data:{attributes:["value"]},time:{attributes:["datetime"]},var:{},samp:{},kbd:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{attributes:["dir"]},bdo:{attributes:["dir"]},wbr:{},"#text":{}},E6e=["#text","br"];Object.keys(zM).filter(e=>!E6e.includes(e)).forEach(e=>{const{[e]:t,...n}=zM;zM[e].children=n});const W6e={audio:{attributes:["src","preload","autoplay","mediagroup","loop","muted"]},canvas:{attributes:["width","height"]},embed:{attributes:["src","type","width","height"]},img:{attributes:["alt","src","srcset","usemap","ismap","width","height"]},object:{attributes:["data","type","name","usemap","form","width","height"]},video:{attributes:["src","poster","preload","playsinline","autoplay","mediagroup","loop","muted","controls","width","height"]}},aA={...zM,...W6e};function O5(e){if(e!=="paste")return aA;const{u:t,abbr:n,data:o,time:r,wbr:s,bdi:i,bdo:c,...l}={...aA,ins:{children:aA.ins.children},del:{children:aA.del.children}};return l}function k2(e){const t=e.nodeName.toLowerCase();return O5().hasOwnProperty(t)||t==="span"}function Gre(e){const t=e.nodeName.toLowerCase();return zM.hasOwnProperty(t)||t==="span"}function B6e(e){return!!e&&e.nodeType===e.ELEMENT_NODE}const N6e=()=>{};function Zg(e,t,n,o){Array.from(e).forEach(r=>{const s=r.nodeName.toLowerCase();if(n.hasOwnProperty(s)&&(!n[s].isMatch||n[s].isMatch?.(r))){if(B6e(r)){const{attributes:i=[],classes:c=[],children:l,require:u=[],allowEmpty:d}=n[s];if(l&&!d&&_4(r)){bf(r);return}if(r.hasAttributes()&&(Array.from(r.attributes).forEach(({name:p})=>{p!=="class"&&!i.includes(p)&&r.removeAttribute(p)}),r.classList&&r.classList.length)){const p=c.map(f=>f==="*"?()=>!0:typeof f=="string"?b=>b===f:f instanceof RegExp?b=>f.test(b):N6e);Array.from(r.classList).forEach(f=>{p.some(b=>b(f))||r.classList.remove(f)}),r.classList.length||r.removeAttribute("class")}if(r.hasChildNodes()){if(l==="*")return;if(l)u.length&&!r.querySelector(u.join(","))?(Zg(r.childNodes,t,n,o),MM(r)):r.parentNode&&r.parentNode.nodeName==="BODY"&&k2(r)?(Zg(r.childNodes,t,n,o),Array.from(r.childNodes).some(p=>!k2(p))&&MM(r)):Zg(r.childNodes,t,l,o);else for(;r.firstChild;)bf(r.firstChild)}}}else Zg(r.childNodes,t,n,o),o&&!k2(r)&&r.nextElementSibling&&Xre(t.createElement("br"),r),MM(r)})}function u8(e,t,n){const o=document.implementation.createHTMLDocument("");return o.body.innerHTML=e,Zg(o.body.childNodes,o,t,n),o.body.innerHTML}function k4(e){const t=Array.from(e.files);return Array.from(e.items).forEach(n=>{const o=n.getAsFile();o&&!t.find(({name:r,type:s,size:i})=>r===o.name&&s===o.type&&i===o.size)&&t.push(o)}),t}const Xr={focusable:h6e,tabbable:v6e};function Mn(e,t){const n=x.useRef();return x.useCallback(o=>{o?n.current=e(o):n.current&&n.current()},t)}function yB(){return Mn(e=>{function t(n){const{key:o,shiftKey:r,target:s}=n;if(o!=="Tab")return;const i=r?"findPrevious":"findNext",c=Xr.tabbable[i](s)||null;if(s.contains(c)){n.preventDefault(),c?.focus();return}if(e.contains(c))return;const l=r?"append":"prepend",{ownerDocument:u}=e,d=u.createElement("div");d.tabIndex=-1,e[l](d),d.addEventListener("blur",()=>e.removeChild(d)),d.focus()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},[])}var Ev={exports:{}};/*! + * clipboard.js v2.0.11 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */var L6e=Ev.exports,xH;function P6e(){return xH||(xH=1,function(e,t){(function(o,r){e.exports=r()})(L6e,function(){return function(){var n={686:function(s,i,c){c.d(i,{default:function(){return V}});var l=c(279),u=c.n(l),d=c(370),p=c.n(d),f=c(817),b=c.n(f);function h(Z){try{return document.execCommand(Z)}catch{return!1}}var g=function(re){var oe=b()(re);return h("cut"),oe},z=g;function y(Z){var re=document.documentElement.getAttribute("dir")==="rtl",oe=document.createElement("textarea");oe.style.fontSize="12pt",oe.style.border="0",oe.style.padding="0",oe.style.margin="0",oe.style.position="absolute",oe.style[re?"right":"left"]="-9999px";var ae=window.pageYOffset||document.documentElement.scrollTop;return oe.style.top="".concat(ae,"px"),oe.setAttribute("readonly",""),oe.value=Z,oe}var _=function(re,oe){var ae=y(re);oe.container.appendChild(ae);var le=b()(ae);return h("copy"),ae.remove(),le},v=function(re){var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},ae="";return typeof re=="string"?ae=_(re,oe):re instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(re?.type)?ae=_(re.value,oe):(ae=b()(re),h("copy")),ae},M=v;function A(Z){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?A=function(oe){return typeof oe}:A=function(oe){return oe&&typeof Symbol=="function"&&oe.constructor===Symbol&&oe!==Symbol.prototype?"symbol":typeof oe},A(Z)}var k=function(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},oe=re.action,ae=oe===void 0?"copy":oe,le=re.container,he=re.target,de=re.text;if(ae!=="copy"&&ae!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(he!==void 0)if(he&&A(he)==="object"&&he.nodeType===1){if(ae==="copy"&&he.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(ae==="cut"&&(he.hasAttribute("readonly")||he.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(de)return M(de,{container:le});if(he)return ae==="cut"?z(he):M(he,{container:le})},S=k;function C(Z){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?C=function(oe){return typeof oe}:C=function(oe){return oe&&typeof Symbol=="function"&&oe.constructor===Symbol&&oe!==Symbol.prototype?"symbol":typeof oe},C(Z)}function R(Z,re){if(!(Z instanceof re))throw new TypeError("Cannot call a class as a function")}function T(Z,re){for(var oe=0;oe"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function F(Z){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(oe){return oe.__proto__||Object.getPrototypeOf(oe)},F(Z)}function X(Z,re){var oe="data-clipboard-".concat(Z);if(re.hasAttribute(oe))return re.getAttribute(oe)}var Q=function(Z){B(oe,Z);var re=j(oe);function oe(ae,le){var he;return R(this,oe),he=re.call(this),he.resolveOptions(le),he.listenClick(ae),he}return E(oe,[{key:"resolveOptions",value:function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof le.action=="function"?le.action:this.defaultAction,this.target=typeof le.target=="function"?le.target:this.defaultTarget,this.text=typeof le.text=="function"?le.text:this.defaultText,this.container=C(le.container)==="object"?le.container:document.body}},{key:"listenClick",value:function(le){var he=this;this.listener=p()(le,"click",function(de){return he.onClick(de)})}},{key:"onClick",value:function(le){var he=le.delegateTarget||le.currentTarget,de=this.action(he)||"copy",_e=S({action:de,container:this.container,target:this.target(he),text:this.text(he)});this.emit(_e?"success":"error",{action:de,text:_e,trigger:he,clearSelection:function(){he&&he.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(le){return X("action",le)}},{key:"defaultTarget",value:function(le){var he=X("target",le);if(he)return document.querySelector(he)}},{key:"defaultText",value:function(le){return X("text",le)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(le){var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return M(le,he)}},{key:"cut",value:function(le){return z(le)}},{key:"isSupported",value:function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],he=typeof le=="string"?[le]:le,de=!!document.queryCommandSupported;return he.forEach(function(_e){de=de&&!!document.queryCommandSupported(_e)}),de}}]),oe}(u()),V=Q},828:function(s){var i=9;if(typeof Element<"u"&&!Element.prototype.matches){var c=Element.prototype;c.matches=c.matchesSelector||c.mozMatchesSelector||c.msMatchesSelector||c.oMatchesSelector||c.webkitMatchesSelector}function l(u,d){for(;u&&u.nodeType!==i;){if(typeof u.matches=="function"&&u.matches(d))return u;u=u.parentNode}}s.exports=l},438:function(s,i,c){var l=c(828);function u(f,b,h,g,z){var y=p.apply(this,arguments);return f.addEventListener(h,y,z),{destroy:function(){f.removeEventListener(h,y,z)}}}function d(f,b,h,g,z){return typeof f.addEventListener=="function"?u.apply(null,arguments):typeof h=="function"?u.bind(null,document).apply(null,arguments):(typeof f=="string"&&(f=document.querySelectorAll(f)),Array.prototype.map.call(f,function(y){return u(y,b,h,g,z)}))}function p(f,b,h,g){return function(z){z.delegateTarget=l(z.target,b),z.delegateTarget&&g.call(f,z)}}s.exports=d},879:function(s,i){i.node=function(c){return c!==void 0&&c instanceof HTMLElement&&c.nodeType===1},i.nodeList=function(c){var l=Object.prototype.toString.call(c);return c!==void 0&&(l==="[object NodeList]"||l==="[object HTMLCollection]")&&"length"in c&&(c.length===0||i.node(c[0]))},i.string=function(c){return typeof c=="string"||c instanceof String},i.fn=function(c){var l=Object.prototype.toString.call(c);return l==="[object Function]"}},370:function(s,i,c){var l=c(879),u=c(438);function d(h,g,z){if(!h&&!g&&!z)throw new Error("Missing required arguments");if(!l.string(g))throw new TypeError("Second argument must be a String");if(!l.fn(z))throw new TypeError("Third argument must be a Function");if(l.node(h))return p(h,g,z);if(l.nodeList(h))return f(h,g,z);if(l.string(h))return b(h,g,z);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function p(h,g,z){return h.addEventListener(g,z),{destroy:function(){h.removeEventListener(g,z)}}}function f(h,g,z){return Array.prototype.forEach.call(h,function(y){y.addEventListener(g,z)}),{destroy:function(){Array.prototype.forEach.call(h,function(y){y.removeEventListener(g,z)})}}}function b(h,g,z){return u(document.body,h,g,z)}s.exports=d},817:function(s){function i(c){var l;if(c.nodeName==="SELECT")c.focus(),l=c.value;else if(c.nodeName==="INPUT"||c.nodeName==="TEXTAREA"){var u=c.hasAttribute("readonly");u||c.setAttribute("readonly",""),c.select(),c.setSelectionRange(0,c.value.length),u||c.removeAttribute("readonly"),l=c.value}else{c.hasAttribute("contenteditable")&&c.focus();var d=window.getSelection(),p=document.createRange();p.selectNodeContents(c),d.removeAllRanges(),d.addRange(p),l=d.toString()}return l}s.exports=i},279:function(s){function i(){}i.prototype={on:function(c,l,u){var d=this.e||(this.e={});return(d[c]||(d[c]=[])).push({fn:l,ctx:u}),this},once:function(c,l,u){var d=this;function p(){d.off(c,p),l.apply(u,arguments)}return p._=l,this.on(c,p,u)},emit:function(c){var l=[].slice.call(arguments,1),u=((this.e||(this.e={}))[c]||[]).slice(),d=0,p=u.length;for(d;d{t.current=e},[e]),t}function Xl(e,t){const n=wH(e),o=wH(t);return Mn(r=>{const s=new I6e(r,{text(){return typeof n.current=="function"?n.current():n.current||""}});return s.on("success",({clearSelection:i})=>{i(),o.current&&o.current()}),()=>{s.destroy()}},[])}function Us(e,t){var n=0,o,r;t=t||{};function s(){var i=o,c=arguments.length,l,u;e:for(;i;){if(i.args.length!==arguments.length){i=i.next;continue}for(u=0;u=0),g.type){case"b":p=parseInt(p,10).toString(2);break;case"c":p=String.fromCharCode(parseInt(p,10));break;case"d":case"i":p=parseInt(p,10);break;case"j":p=JSON.stringify(p,null,g.width?parseInt(g.width):0);break;case"e":p=g.precision?parseFloat(p).toExponential(g.precision):parseFloat(p).toExponential();break;case"f":p=g.precision?parseFloat(p).toFixed(g.precision):parseFloat(p);break;case"g":p=g.precision?String(Number(p.toPrecision(g.precision))):parseFloat(p);break;case"o":p=(parseInt(p,10)>>>0).toString(8);break;case"s":p=String(p),p=g.precision?p.substring(0,g.precision):p;break;case"t":p=String(!!p),p=g.precision?p.substring(0,g.precision):p;break;case"T":p=Object.prototype.toString.call(p).slice(8,-1).toLowerCase(),p=g.precision?p.substring(0,g.precision):p;break;case"u":p=parseInt(p,10)>>>0;break;case"v":p=p.valueOf(),p=g.precision?p.substring(0,g.precision):p;break;case"x":p=(parseInt(p,10)>>>0).toString(16);break;case"X":p=(parseInt(p,10)>>>0).toString(16).toUpperCase();break}t.json.test(g.type)?f+=p:(t.number.test(g.type)&&(!v||g.sign)?(M=v?"+":"-",p=p.toString().replace(t.sign,"")):M="",y=g.pad_char?g.pad_char==="0"?"0":g.pad_char.charAt(1):" ",_=g.width-(M+p).length,z=g.width&&_>0?y.repeat(_):"",f+=g.align?M+p+z:y==="0"?M+z+p:z+M+p)}return f}var s=Object.create(null);function i(c){if(s[c])return s[c];for(var l=c,u,d=[],p=0;l;){if((u=t.text.exec(l))!==null)d.push(u[0]);else if((u=t.modulo.exec(l))!==null)d.push("%");else if((u=t.placeholder.exec(l))!==null){if(u[2]){p|=1;var f=[],b=u[2],h=[];if((h=t.key.exec(b))!==null)for(f.push(h[1]);(b=b.substring(h[0].length))!=="";)if((h=t.key_access.exec(b))!==null)f.push(h[1]);else if((h=t.index_access.exec(b))!==null)f.push(h[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");u[2]=f}else p|=2;if(p===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");d.push({placeholder:u[0],param_no:u[1],keys:u[2],sign:u[3],pad_char:u[4],align:u[5],width:u[6],precision:u[7],type:u[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");l=l.substring(u[0].length)}return s[c]=d}e.sprintf=n,e.vsprintf=o,typeof window<"u"&&(window.sprintf=n,window.vsprintf=o)})()}(uS)),uS}var F6e=D6e();const $6e=Zr(F6e),V6e=Us(console.error);function ve(e,...t){try{return $6e.sprintf(e,...t)}catch(n){return n instanceof Error&&V6e(`sprintf error: + +`+n.toString()),e}}var d8,Kre,Qg,Yre;d8={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1};Kre=["(","?"];Qg={")":["("],":":["?","?:"]};Yre=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;function H6e(e){for(var t=[],n=[],o,r,s,i;o=e.match(Yre);){for(r=o[0],s=e.substr(0,o.index).trim(),s&&t.push(s);i=n.pop();){if(Qg[r]){if(Qg[r][0]===i){r=Qg[r][1]||r;break}}else if(Kre.indexOf(i)>=0||d8[i]":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,n){if(e)throw t;return n}};function X6e(e,t){var n=[],o,r,s,i,c,l;for(o=0;o{const o=new AB({}),r=new Set,s=()=>{r.forEach(M=>M())},i=M=>(r.add(M),()=>r.delete(M)),c=(M="default")=>o.data[M],l=(M,A="default")=>{o.data[A]={...o.data[A],...M},o.data[A][""]={...SH[""],...o.data[A]?.[""]},delete o.pluralForms[A]},u=(M,A)=>{l(M,A),s()},d=(M,A="default")=>{o.data[A]={...o.data[A],...M,"":{...SH[""],...o.data[A]?.[""],...M?.[""]}},delete o.pluralForms[A],s()},p=(M,A)=>{o.data={},o.pluralForms={},u(M,A)},f=(M="default",A,k,S,C)=>(o.data[M]||l(void 0,M),o.dcnpgettext(M,A,k,S,C)),b=(M="default")=>M,h=(M,A)=>{let k=f(A,void 0,M);return n?(k=n.applyFilters("i18n.gettext",k,M,A),n.applyFilters("i18n.gettext_"+b(A),k,M,A)):k},g=(M,A,k)=>{let S=f(k,A,M);return n?(S=n.applyFilters("i18n.gettext_with_context",S,M,A,k),n.applyFilters("i18n.gettext_with_context_"+b(k),S,M,A,k)):S},z=(M,A,k,S)=>{let C=f(S,void 0,M,A,k);return n?(C=n.applyFilters("i18n.ngettext",C,M,A,k,S),n.applyFilters("i18n.ngettext_"+b(S),C,M,A,k,S)):C},y=(M,A,k,S,C)=>{let R=f(C,S,M,A,k);return n?(R=n.applyFilters("i18n.ngettext_with_context",R,M,A,k,S,C),n.applyFilters("i18n.ngettext_with_context_"+b(C),R,M,A,k,S,C)):R},_=()=>g("ltr","text direction")==="rtl",v=(M,A,k)=>{const S=A?A+""+M:M;let C=!!o.data?.[k??"default"]?.[S];return n&&(C=n.applyFilters("i18n.has_translation",C,M,A,k),C=n.applyFilters("i18n.has_translation_"+b(k),C,M,A,k)),C};if(n){const M=A=>{Z6e.test(A)&&s()};n.addAction("hookAdded","core/i18n",M),n.addAction("hookRemoved","core/i18n",M)}return{getLocaleData:c,setLocaleData:u,addLocaleData:d,resetLocaleData:p,subscribe:i,__:h,_x:g,_n:z,_nx:y,isRTL:_,hasTranslation:v}},i0=Q6e(void 0,void 0,Cre);i0.getLocaleData.bind(i0);const zmn=i0.setLocaleData.bind(i0);i0.resetLocaleData.bind(i0);i0.subscribe.bind(i0);const m=i0.__.bind(i0),Ee=i0._x.bind(i0),Dn=i0._n.bind(i0);i0._nx.bind(i0);const Lt=i0.isRTL.bind(i0);i0.hasTranslation.bind(i0);function fa(e=null){if(!e){if(typeof window>"u")return!1;e=window}const{platform:t}=e.navigator;return t.indexOf("Mac")!==-1||["iPad","iPhone"].includes(t)}const Oc=8,Y2=9,Gr=13,vd=27,vB=32,J6e=33,eSe=34,HM=35,S2=36,_i=37,uc=38,ki=39,Ds=40,yl=46,tSe=121,na="alt",Ya="ctrl",Gp="meta",oa="shift";function Zre(e){return e.length<2?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)}function p3(e,t){return Object.fromEntries(Object.entries(e).map(([n,o])=>[n,t(o)]))}const y5={primary:e=>e()?[Gp]:[Ya],primaryShift:e=>e()?[oa,Gp]:[Ya,oa],primaryAlt:e=>e()?[na,Gp]:[Ya,na],secondary:e=>e()?[oa,na,Gp]:[Ya,oa,na],access:e=>e()?[Ya,na]:[oa,na],ctrl:()=>[Ya],alt:()=>[na],ctrlShift:()=>[Ya,oa],shift:()=>[oa],shiftAlt:()=>[oa,na],undefined:()=>[]},nSe=p3(y5,e=>(t,n=fa)=>[...e(n),t.toLowerCase()].join("+")),Qre=p3(y5,e=>(t,n=fa)=>{const o=n(),r={[na]:o?"⌥":"Alt",[Ya]:o?"⌃":"Ctrl",[Gp]:"⌘",[oa]:o?"⇧":"Shift"};return[...e(n).reduce((i,c)=>{var l;const u=(l=r[c])!==null&&l!==void 0?l:c;return o?[...i,u]:[...i,u,"+"]},[]),Zre(t)]}),fs=p3(Qre,e=>(t,n=fa)=>e(t,n).join("")),Jre=p3(y5,e=>(t,n=fa)=>{const o=n(),r={[oa]:"Shift",[Gp]:o?"Command":"Control",[Ya]:"Control",[na]:o?"Option":"Alt",",":m("Comma"),".":m("Period"),"`":m("Backtick"),"~":m("Tilde")};return[...e(n),t].map(s=>{var i;return Zre((i=r[s])!==null&&i!==void 0?i:s)}).join(o?" ":" + ")});function oSe(e){return[na,Ya,Gp,oa].filter(t=>e[`${t}Key`])}const dc=p3(y5,e=>(t,n,o=fa)=>{const r=e(o),s=oSe(t),i={Comma:",",Backslash:"\\",IntlRo:"\\",IntlYen:"\\"},c=r.filter(d=>!s.includes(d)),l=s.filter(d=>!r.includes(d));if(c.length>0||l.length>0)return!1;let u=t.key.toLowerCase();return n?(t.altKey&&n.length===1&&(u=String.fromCharCode(t.keyCode).toLowerCase()),t.shiftKey&&n.length===1&&i[t.code]&&(u=i[t.code]),n==="del"&&(n="delete"),u===n.toLowerCase()):r.includes(u)});function A5(e="firstElement"){const t=x.useRef(e),n=r=>{r.focus({preventScroll:!0})},o=x.useRef();return x.useEffect(()=>{t.current=e},[e]),Mn(r=>{var s;if(!(!r||t.current===!1)&&!r.contains((s=r.ownerDocument?.activeElement)!==null&&s!==void 0?s:null)){if(t.current!=="firstElement"){n(r);return}return o.current=setTimeout(()=>{const i=Xr.tabbable.find(r)[0];i&&n(i)},0),()=>{o.current&&clearTimeout(o.current)}}},[])}let cA=null;function xB(e){const t=x.useRef(null),n=x.useRef(null),o=x.useRef(e);return x.useEffect(()=>{o.current=e},[e]),x.useCallback(r=>{if(r){var s;if(t.current=r,n.current)return;const c=r.ownerDocument.activeElement instanceof window.HTMLIFrameElement?r.ownerDocument.activeElement.contentDocument:r.ownerDocument;n.current=(s=c?.activeElement)!==null&&s!==void 0?s:null}else if(n.current){const c=t.current?.contains(t.current?.ownerDocument.activeElement);if(t.current?.isConnected&&!c){var i;(i=cA)!==null&&i!==void 0||(cA=n.current);return}o.current?o.current():(n.current.isConnected?n.current:cA)?.focus(),cA=null}},[])}const rSe=["button","submit"];function sSe(e){if(!(e instanceof window.HTMLElement))return!1;switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return rSe.includes(e.type)}return!1}function e0e(e){const t=x.useRef(e);x.useEffect(()=>{t.current=e},[e]);const n=x.useRef(!1),o=x.useRef(),r=x.useCallback(()=>{clearTimeout(o.current)},[]);x.useEffect(()=>()=>r(),[]),x.useEffect(()=>{e||r()},[e,r]);const s=x.useCallback(c=>{const{type:l,target:u}=c;["mouseup","touchend"].includes(l)?n.current=!1:sSe(u)&&(n.current=!0)},[]),i=x.useCallback(c=>{if(c.persist(),n.current)return;const l=c.target.getAttribute("data-unstable-ignore-focus-outside-for-relatedtarget");l&&c.relatedTarget?.closest(l)||(o.current=setTimeout(()=>{if(!document.hasFocus()){c.preventDefault();return}typeof t.current=="function"&&t.current(c)},0))},[]);return{onFocus:r,onMouseDown:s,onMouseUp:s,onTouchStart:s,onTouchEnd:s,onBlur:i}}function lA(e,t){typeof e=="function"?e(t):e&&e.hasOwnProperty("current")&&(e.current=t)}function yn(e){const t=x.useRef(),n=x.useRef(!1),o=x.useRef(!1),r=x.useRef([]),s=x.useRef(e);return s.current=e,x.useLayoutEffect(()=>{o.current===!1&&n.current===!0&&e.forEach((i,c)=>{const l=r.current[c];i!==l&&(lA(l,null),lA(i,t.current))}),r.current=e},e),x.useLayoutEffect(()=>{o.current=!1}),x.useCallback(i=>{lA(t,i),o.current=!0,n.current=i!==null;const c=i?s.current:r.current;for(const l of c)lA(l,i)},[])}function t0e(e){const t=x.useRef(),{constrainTabbing:n=e.focusOnMount!==!1}=e;x.useEffect(()=>{t.current=e},Object.values(e));const o=yB(),r=A5(e.focusOnMount),s=xB(),i=e0e(l=>{t.current?.__unstableOnClose?t.current.__unstableOnClose("focus-outside",l):t.current?.onClose&&t.current.onClose()}),c=x.useCallback(l=>{l&&l.addEventListener("keydown",u=>{u.keyCode===vd&&!u.defaultPrevented&&t.current?.onClose&&(u.preventDefault(),t.current.onClose())})},[]);return[yn([n?o:null,e.focusOnMount!==!1?s:null,e.focusOnMount!==!1?r:null,c]),{...i,tabIndex:-1}]}function wB({isDisabled:e=!1}={}){return Mn(t=>{if(e)return;const n=t?.ownerDocument?.defaultView;if(!n)return;const o=[],r=()=>{t.childNodes.forEach(c=>{c instanceof n.HTMLElement&&(c.getAttribute("inert")||(c.setAttribute("inert","true"),o.push(()=>{c.removeAttribute("inert")})))})},s=j1(r,0,{leading:!0});r();const i=new window.MutationObserver(s);return i.observe(t,{childList:!0}),()=>{i&&i.disconnect(),s.cancel(),o.forEach(c=>c())}},[e])}function Ws(e){const t=x.useRef(()=>{throw new Error("Callbacks created with `useEvent` cannot be called during rendering.")});return x.useInsertionEffect(()=>{t.current=e}),x.useCallback((...n)=>t.current?.(...n),[])}const _B=typeof window<"u"?x.useLayoutEffect:x.useEffect;function n0e({onDragStart:e,onDragMove:t,onDragEnd:n}){const[o,r]=x.useState(!1),s=x.useRef({onDragStart:e,onDragMove:t,onDragEnd:n});_B(()=>{s.current.onDragStart=e,s.current.onDragMove=t,s.current.onDragEnd=n},[e,t,n]);const i=x.useCallback(u=>s.current.onDragMove&&s.current.onDragMove(u),[]),c=x.useCallback(u=>{s.current.onDragEnd&&s.current.onDragEnd(u),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",c),r(!1)},[]),l=x.useCallback(u=>{s.current.onDragStart&&s.current.onDragStart(u),document.addEventListener("mousemove",i),document.addEventListener("mouseup",c),r(!0)},[]);return x.useEffect(()=>()=>{o&&(document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",c))},[o]),{startDrag:l,endDrag:c,isDragging:o}}const CH=new Map;function iSe(e){if(!e)return null;let t=CH.get(e);return t||(typeof window<"u"&&typeof window.matchMedia=="function"?(t=window.matchMedia(e),CH.set(e,t),t):null)}function kB(e){const t=x.useMemo(()=>{const n=iSe(e);return{subscribe(o){return n?(n.addEventListener?.("change",o),()=>{n.removeEventListener?.("change",o)}):()=>{}},getValue(){var o;return(o=n?.matches)!==null&&o!==void 0?o:!1}}},[e]);return x.useSyncExternalStore(t.subscribe,t.getValue,()=>!1)}function Ir(e){const t=x.useRef();return x.useEffect(()=>{t.current=e},[e]),t.current}const I1=()=>kB("(prefers-reduced-motion: reduce)");function aSe(e,t){const n={...e};return Object.entries(t).forEach(([o,r])=>{n[o]?n[o]={...n[o],to:r.to}:n[o]=r}),n}const qH=(e,t)=>{const n=e?.findIndex(({id:r})=>typeof r=="string"?r===t.id:ls(r,t.id)),o=[...e];return n!==-1?o[n]={id:t.id,changes:aSe(o[n].changes,t.changes)}:o.push(t),o};function cSe(){let e=[],t=[],n=0;const o=()=>{e=e.slice(0,n||void 0),n=0},r=()=>{var i;const c=e.length===0?0:e.length-1;let l=(i=e[c])!==null&&i!==void 0?i:[];t.forEach(u=>{l=qH(l,u)}),t=[],e[c]=l},s=i=>!i.filter(({changes:l})=>Object.values(l).some(({from:u,to:d})=>typeof u!="function"&&typeof d!="function"&&!ls(u,d))).length;return{addRecord(i,c=!1){const l=!i||s(i);if(c){if(l)return;i.forEach(u=>{t=qH(t,u)})}else{if(o(),t.length&&r(),l)return;e.push(i)}},undo(){t.length&&(o(),r());const i=e[e.length-1+n];if(i)return n-=1,i},redo(){const i=e[e.length+n];if(i)return n+=1,i},hasUndo(){return!!e[e.length-1+n]},hasRedo(){return!!e[e.length+n]}}}const RH={xhuge:1920,huge:1440,wide:1280,xlarge:1080,large:960,medium:782,small:600,mobile:480},lSe={">=":"min-width","<":"max-width"},uSe={">=":(e,t)=>t>=e,"<":(e,t)=>t=")=>{const n=x.useContext(o0e),o=!n&&`(${lSe[t]}: ${RH[e]}px)`,r=kB(o||void 0);return n?uSe[t](RH[e],n):r};Kn.__experimentalWidthProvider=o0e.Provider;function r0e(e,t={}){const n=Ws(e),o=x.useRef(),r=x.useRef();return Ws(s=>{var i;if(s===o.current)return;(i=r.current)!==null&&i!==void 0||(r.current=new ResizeObserver(n));const{current:c}=r;o.current&&c.unobserve(o.current),o.current=s,s&&c.observe(s,t)})}const dSe=e=>{let t;if(!e.contentBoxSize)t=[e.contentRect.width,e.contentRect.height];else if(e.contentBoxSize[0]){const r=e.contentBoxSize[0];t=[r.inlineSize,r.blockSize]}else{const r=e.contentBoxSize;t=[r.inlineSize,r.blockSize]}const[n,o]=t.map(r=>Math.round(r));return{width:n,height:o}},pSe={position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",opacity:0,overflow:"hidden",zIndex:-1};function fSe({onResize:e}){const t=r0e(n=>{const o=dSe(n.at(-1));e(o)});return a.jsx("div",{ref:t,style:pSe,"aria-hidden":"true"})}function bSe(e,t){return e.width===t.width&&e.height===t.height}const TH={width:null,height:null};function hSe(){const[e,t]=x.useState(TH),n=x.useRef(TH),o=x.useCallback(s=>{bSe(n.current,s)||(n.current=s,t(s))},[]);return[a.jsx(fSe,{onResize:o}),e]}function bs(e,t={}){return e?r0e(e,t):hSe()}var dS={exports:{}},EH;function mSe(){return EH||(EH=1,function(e){(function(t){e.exports?e.exports=t():window.idleCallbackShim=t()})(function(){var t,n,o,r,s=typeof window<"u"?window:typeof u1!=null?u1:this||{},i=s.cancelRequestAnimationFrame&&s.requestAnimationFrame||setTimeout,c=s.cancelRequestAnimationFrame||clearTimeout,l=[],u=0,d=!1,p=7,f=35,b=125,h=0,g=0,z=0,y={get didTimeout(){return!1},timeRemaining:function(){var B=p-(Date.now()-g);return B<0?0:B}},_=v(function(){p=22,b=66,f=0});function v(B){var N,j,I=99,P=function(){var $=Date.now()-j;$9?o=setTimeout(S,n):(n=0,S()))}function R(){var B,N,j,I=p>9?9:1;if(g=Date.now(),d=!1,o=null,u>2||g-n-50I;N++)B=l.shift(),z++,B&&B(y);l.length?C():u=0}function T(B){return h++,l.push(B),C(),h}function E(B){var N=B-1-z;l[N]&&(l[N]=null)}if(!s.requestIdleCallback||!s.cancelIdleCallback)s.requestIdleCallback=T,s.cancelIdleCallback=E,s.document&&document.addEventListener&&(s.addEventListener("scroll",A,!0),s.addEventListener("resize",A),document.addEventListener("focus",A,!0),document.addEventListener("mouseover",A,!0),["click","keypress","touchstart","mousedown"].forEach(function(B){document.addEventListener(B,A,{capture:!0,passive:!0})}),s.MutationObserver&&new MutationObserver(A).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}));else try{s.requestIdleCallback(function(){},{timeout:0})}catch{(function(N){var j,I;if(s.requestIdleCallback=function(P,$){return $&&typeof $.timeout=="number"?N(P,$.timeout):N(P)},s.IdleCallbackDeadline&&(j=IdleCallbackDeadline.prototype)){if(I=Object.getOwnPropertyDescriptor(j,"timeRemaining"),!I||!I.configurable||!I.get)return;Object.defineProperty(j,"timeRemaining",{value:function(){return I.get.call(this)},enumerable:!0,configurable:!0})}})(s.requestIdleCallback)}return{request:T,cancel:E}})}(dS)),dS.exports}mSe();function gSe(){return typeof window>"u"?e=>{setTimeout(()=>e(Date.now()),0)}:window.requestIdleCallback}const WH=gSe(),SB=()=>{const e=new Map;let t=!1;const n=c=>{for(const[l,u]of e)if(e.delete(l),u(),typeof c=="number"||c.timeRemaining()<=0)break;if(e.size===0){t=!1;return}WH(n)};return{add:(c,l)=>{e.set(c,l),t||(t=!0,WH(n))},flush:c=>{const l=e.get(c);return l===void 0?!1:(e.delete(c),l(),!0)},cancel:c=>e.delete(c),reset:()=>{e.clear(),t=!1}}};function MSe(e,t){const n=[];for(let o=0;o{let s=MSe(e,o);s.length{ps.flushSync(()=>{r(l=>[...l,...e.slice(c,c+n)])})});return()=>i.reset()},[e]),o}function zSe(e,t){if(e.length!==t.length)return!1;for(var n=0;nj1(e,t??0,n),[e,t,n]);return x.useEffect(()=>()=>o.cancel(),[o]),o}function i0e(e=""){const[t,n]=x.useState(e),[o,r]=x.useState(e),s=S1(r,250);return x.useEffect(()=>{s(t)},[t,s]),[t,n,o]}function p8(e,t,n){const o=s0e(()=>gB(e,t??0,n),[e,t,n]);return x.useEffect(()=>()=>o.cancel(),[o]),o}function v5({dropZoneElement:e,isDisabled:t,onDrop:n,onDragStart:o,onDragEnter:r,onDragLeave:s,onDragEnd:i,onDragOver:c}){const l=Ws(n),u=Ws(o),d=Ws(r),p=Ws(s),f=Ws(i),b=Ws(c);return Mn(h=>{if(t)return;const g=e??h;let z=!1;const{ownerDocument:y}=g;function _(R){const{defaultView:T}=y;if(!R||!T||!(R instanceof T.HTMLElement)||!g.contains(R))return!1;let E=R;do if(E.dataset.isDropZone)return E===g;while(E=E.parentElement);return!1}function v(R){z||(z=!0,y.addEventListener("dragend",C),y.addEventListener("mousemove",C),o&&u(R))}function M(R){R.preventDefault(),!g.contains(R.relatedTarget)&&r&&d(R)}function A(R){!R.defaultPrevented&&c&&b(R),R.preventDefault()}function k(R){_(R.relatedTarget)||s&&p(R)}function S(R){R.defaultPrevented||(R.preventDefault(),R.dataTransfer&&R.dataTransfer.files.length,n&&l(R),C(R))}function C(R){z&&(z=!1,y.removeEventListener("dragend",C),y.removeEventListener("mousemove",C),i&&f(R))}return g.setAttribute("data-is-drop-zone","true"),g.addEventListener("drop",S),g.addEventListener("dragenter",M),g.addEventListener("dragover",A),g.addEventListener("dragleave",k),y.addEventListener("dragenter",v),()=>{g.removeAttribute("data-is-drop-zone"),g.removeEventListener("drop",S),g.removeEventListener("dragenter",M),g.removeEventListener("dragover",A),g.removeEventListener("dragleave",k),y.removeEventListener("dragend",C),y.removeEventListener("mousemove",C),y.removeEventListener("dragenter",v)}},[t,e])}function a0e(){return Mn(e=>{const{ownerDocument:t}=e;if(!t)return;const{defaultView:n}=t;if(!n)return;function o(){t&&t.activeElement===e&&e.focus()}return n.addEventListener("blur",o),()=>{n.removeEventListener("blur",o)}},[])}const OSe=30;function ySe(e,t,n,o){var r,s;const i=(r=o?.initWindowSize)!==null&&r!==void 0?r:OSe,c=(s=o?.useWindowing)!==null&&s!==void 0?s:!0,[l,u]=x.useState({visibleItems:i,start:0,end:i,itemInView:d=>d>=0&&d<=i});return x.useLayoutEffect(()=>{if(!c)return;const d=B1(e.current),p=b=>{var h;if(!d)return;const g=Math.ceil(d.clientHeight/t),z=b?g:(h=o?.windowOverscan)!==null&&h!==void 0?h:g,y=Math.floor(d.scrollTop/t),_=Math.max(0,y-z),v=Math.min(n-1,y+g+z);u(M=>{const A={visibleItems:g,start:_,end:v,itemInView:k=>_<=k&&k<=v};return M.start!==A.start||M.end!==A.end||M.visibleItems!==A.visibleItems?A:M})};p(!0);const f=j1(()=>{p()},16);return d?.addEventListener("scroll",f),d?.ownerDocument?.defaultView?.addEventListener("resize",f),d?.ownerDocument?.defaultView?.addEventListener("resize",f),()=>{d?.removeEventListener("scroll",f),d?.ownerDocument?.defaultView?.removeEventListener("resize",f)}},[t,e,n,o?.expandedState,o?.windowOverscan,c]),x.useLayoutEffect(()=>{if(!c)return;const d=B1(e.current),p=f=>{switch(f.keyCode){case S2:return d?.scrollTo({top:0});case HM:return d?.scrollTo({top:n*t});case J6e:return d?.scrollTo({top:d.scrollTop-l.visibleItems*t});case eSe:return d?.scrollTo({top:d.scrollTop+l.visibleItems*t})}};return d?.ownerDocument?.defaultView?.addEventListener("keydown",p),()=>{d?.ownerDocument?.defaultView?.removeEventListener("keydown",p)}},[n,t,e,l.visibleItems,c,o?.expandedState]),[l,u]}function UM(e,t){const[n,o]=x.useMemo(()=>[r=>e.subscribe(t,r),()=>e.get(t)],[e,t]);return x.useSyncExternalStore(n,o,o)}function c0e(e){const t=Object.keys(e);return function(o={},r){const s={};let i=!1;for(const c of t){const l=e[c],u=o[c],d=l(u,r);s[c]=d,i=i||d!==u}return i?s:o}}function At(e){const t=new WeakMap,n=(...o)=>{let r=t.get(n.registry);return r||(r=e(n.registry.select),t.set(n.registry,r)),r(...o)};return n.isRegistrySelector=!0,n}function pS(e){return e.isRegistryControl=!0,e}const ASe="@@data/SELECT",vSe="@@data/RESOLVE_SELECT",xSe="@@data/DISPATCH",wSe={[ASe]:pS(e=>({storeKey:t,selectorName:n,args:o})=>e.select(t)[n](...o)),[vSe]:pS(e=>({storeKey:t,selectorName:n,args:o})=>{const r=e.select(t)[n].hasResolver?"resolveSelect":"select";return e[r](t)[n](...o)}),[xSe]:pS(e=>({storeKey:t,actionName:n,args:o})=>e.dispatch(t)[n](...o))},_Se=["@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/commands","@wordpress/components","@wordpress/core-commands","@wordpress/core-data","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/format-library","@wordpress/patterns","@wordpress/preferences","@wordpress/reusable-blocks","@wordpress/router","@wordpress/dataviews","@wordpress/fields","@wordpress/media-utils","@wordpress/upload-media"],BH=[],kSe=!globalThis.IS_WORDPRESS_CORE,L0=(e,t)=>{if(!_Se.includes(t))throw new Error(`You tried to opt-in to unstable APIs as module "${t}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if(!kSe&&BH.includes(t))throw new Error(`You tried to opt-in to unstable APIs as module "${t}" which is already registered. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);return BH.push(t),{lock:SSe,unlock:CSe}};function SSe(e,t){if(!e)throw new Error("Cannot lock an undefined object.");const n=e;OM in n||(n[OM]={}),l0e.set(n[OM],t)}function CSe(e){if(!e)throw new Error("Cannot unlock an undefined object.");const t=e;if(!(OM in t))throw new Error("Cannot unlock an object that was not locked before. ");return l0e.get(t[OM])}const l0e=new WeakMap,OM=Symbol("Private API ID"),{lock:Jg,unlock:Db}=L0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/data"),qSe=()=>e=>t=>Wre(t)?t.then(n=>{if(n)return e(n)}):e(t),RSe=(e,t)=>()=>n=>o=>{const r=e.select(t).getCachedResolvers();return Object.entries(r).forEach(([i,c])=>{const l=e.stores[t]?.resolvers?.[i];!l||!l.shouldInvalidate||c.forEach((u,d)=>{u!==void 0&&(u.status!=="finished"&&u.status!=="error"||l.shouldInvalidate(o,...d)&&e.dispatch(t).invalidateResolution(i,d))})}),n(o)};function TSe(e){return()=>t=>n=>typeof n=="function"?n(e):t(n)}const ESe=e=>t=>(n={},o)=>{const r=o[e];if(r===void 0)return n;const s=t(n[r],o);return s===n[r]?n:{...n,[r]:s}};function Vu(e){if(e==null)return[];const t=e.length;let n=t;for(;n>0&&e[n-1]===void 0;)n--;return n===t?e:e.slice(0,n)}const WSe=ESe("selectorName")((e=new Ua,t)=>{switch(t.type){case"START_RESOLUTION":{const n=new Ua(e);return n.set(Vu(t.args),{status:"resolving"}),n}case"FINISH_RESOLUTION":{const n=new Ua(e);return n.set(Vu(t.args),{status:"finished"}),n}case"FAIL_RESOLUTION":{const n=new Ua(e);return n.set(Vu(t.args),{status:"error",error:t.error}),n}case"START_RESOLUTIONS":{const n=new Ua(e);for(const o of t.args)n.set(Vu(o),{status:"resolving"});return n}case"FINISH_RESOLUTIONS":{const n=new Ua(e);for(const o of t.args)n.set(Vu(o),{status:"finished"});return n}case"FAIL_RESOLUTIONS":{const n=new Ua(e);return t.args.forEach((o,r)=>{const s={status:"error",error:void 0},i=t.errors[r];i&&(s.error=i),n.set(Vu(o),s)}),n}case"INVALIDATE_RESOLUTION":{const n=new Ua(e);return n.delete(Vu(t.args)),n}}return e}),BSe=(e={},t)=>{switch(t.type){case"INVALIDATE_RESOLUTION_FOR_STORE":return{};case"INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR":{if(t.selectorName in e){const{[t.selectorName]:n,...o}=e;return o}return e}case"START_RESOLUTION":case"FINISH_RESOLUTION":case"FAIL_RESOLUTION":case"START_RESOLUTIONS":case"FINISH_RESOLUTIONS":case"FAIL_RESOLUTIONS":case"INVALIDATE_RESOLUTION":return WSe(e,t)}return e};var fS={};function NSe(e){return[e]}function LSe(e){return!!e&&typeof e=="object"}function PSe(){var e={clear:function(){e.head=null}};return e}function NH(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;oArray.from(t._map.values()).some(n=>n[1]?.status==="resolving"))}const USe=Pt(e=>{const t={};return Object.values(e).forEach(n=>Array.from(n._map.values()).forEach(o=>{var r;const s=(r=o[1]?.status)!==null&&r!==void 0?r:"error";t[s]||(t[s]=0),t[s]++})),t},e=>[e]),XSe=Object.freeze(Object.defineProperty({__proto__:null,countSelectorsByStatus:USe,getCachedResolvers:VSe,getIsResolving:jSe,getResolutionError:FSe,getResolutionState:Pf,hasFinishedResolution:ISe,hasResolutionFailed:DSe,hasResolvingSelectors:HSe,hasStartedResolution:u0e,isResolving:$Se},Symbol.toStringTag,{value:"Module"}));function d0e(e,t){return{type:"START_RESOLUTION",selectorName:e,args:t}}function p0e(e,t){return{type:"FINISH_RESOLUTION",selectorName:e,args:t}}function f0e(e,t,n){return{type:"FAIL_RESOLUTION",selectorName:e,args:t,error:n}}function GSe(e,t){return{type:"START_RESOLUTIONS",selectorName:e,args:t}}function KSe(e,t){return{type:"FINISH_RESOLUTIONS",selectorName:e,args:t}}function YSe(e,t,n){return{type:"FAIL_RESOLUTIONS",selectorName:e,args:t,errors:n}}function ZSe(e,t){return{type:"INVALIDATE_RESOLUTION",selectorName:e,args:t}}function QSe(){return{type:"INVALIDATE_RESOLUTION_FOR_STORE"}}function JSe(e){return{type:"INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR",selectorName:e}}const eCe=Object.freeze(Object.defineProperty({__proto__:null,failResolution:f0e,failResolutions:YSe,finishResolution:p0e,finishResolutions:KSe,invalidateResolution:ZSe,invalidateResolutionForStore:QSe,invalidateResolutionForStoreSelector:JSe,startResolution:d0e,startResolutions:GSe},Symbol.toStringTag,{value:"Module"})),bS=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--)t[n]===void 0&&t.splice(n,1);return t},od=(e,t)=>Object.fromEntries(Object.entries(e??{}).map(([n,o])=>[n,t(o,n)])),tCe=(e,t)=>t instanceof Map?Object.fromEntries(t):t instanceof window.HTMLElement?null:t;function nCe(){const e={};return{isRunning(t,n){return e[t]&&e[t].get(bS(n))},clear(t,n){e[t]&&e[t].delete(bS(n))},markAsRunning(t,n){e[t]||(e[t]=new Ua),e[t].set(bS(n),!0)}}}function LH(e){const t=new WeakMap;return{get(n,o){let r=t.get(n);return r||(r=e(n,o),t.set(n,r)),r}}}function v1(e,t){const n={},o={},r={privateActions:n,registerPrivateActions:i=>{Object.assign(n,i)},privateSelectors:o,registerPrivateSelectors:i=>{Object.assign(o,i)}},s={name:e,instantiate:i=>{const c=new Set,l=t.reducer,d=oCe(e,t,i,{registry:i,get dispatch(){return z},get select(){return S},get resolveSelect(){return B()}});Jg(d,r);const p=nCe();function f(P){return(...$)=>Promise.resolve(d.dispatch(P(...$)))}const b={...od(eCe,f),...od(t.actions,f)},h=LH(f),g=new Proxy(()=>{},{get:(P,$)=>{const F=n[$];return F?h.get(F,$):b[$]}}),z=new Proxy(g,{apply:(P,$,[F])=>d.dispatch(F)});Jg(b,g);const y=t.resolvers?iCe(t.resolvers):{};function _(P,$){P.isRegistrySelector&&(P.registry=i);const F=(...Q)=>{Q=f8(P,Q);const V=d.__unstableOriginalGetState();return P.isRegistrySelector&&(P.registry=i),P(V.root,...Q)};F.__unstableNormalizeArgs=P.__unstableNormalizeArgs;const X=y[$];return X?aCe(F,$,X,d,p):(F.hasResolver=!1,F)}function v(P){const $=(...F)=>{const X=d.__unstableOriginalGetState(),Q=F&&F[0],V=F&&F[1],Z=t?.selectors?.[Q];return Q&&Z&&(F[1]=f8(Z,V)),P(X.metadata,...F)};return $.hasResolver=!1,$}const M={...od(XSe,v),...od(t.selectors,_)},A=LH(_);for(const[P,$]of Object.entries(o))A.get($,P);const k=new Proxy(()=>{},{get:(P,$)=>{const F=o[$];return F?A.get(F,$):M[$]}}),S=new Proxy(k,{apply:(P,$,[F])=>F(d.__unstableOriginalGetState())});Jg(M,k);const C=rCe(M,d),R=sCe(M,d),T=()=>M,E=()=>b,B=()=>C,N=()=>R;d.__unstableOriginalGetState=d.getState,d.getState=()=>d.__unstableOriginalGetState().root;const j=d&&(P=>(c.add(P),()=>c.delete(P)));let I=d.__unstableOriginalGetState();return d.subscribe(()=>{const P=d.__unstableOriginalGetState(),$=P!==I;if(I=P,$)for(const F of c)F()}),{reducer:l,store:d,actions:b,selectors:M,resolvers:y,getSelectors:T,getResolveSelectors:B,getSuspendSelectors:N,getActions:E,subscribe:j}}};return Jg(s,r),s}function oCe(e,t,n,o){const r={...t.controls,...wSe},s=od(r,p=>p.isRegistryControl?p(n):p),i=[RSe(n,e),qSe,s6e(s),TSe(o)],c=[Uke(...i)];typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&c.push(window.__REDUX_DEVTOOLS_EXTENSION__({name:e,instanceId:e,serialize:{replacer:tCe}}));const{reducer:l,initialState:u}=t,d=c0e({metadata:BSe,root:l});return Rre(d,{root:u},ko(c))}function rCe(e,t){const{getIsResolving:n,hasStartedResolution:o,hasFinishedResolution:r,hasResolutionFailed:s,isResolving:i,getCachedResolvers:c,getResolutionState:l,getResolutionError:u,hasResolvingSelectors:d,countSelectorsByStatus:p,...f}=e;return od(f,(b,h)=>b.hasResolver?(...g)=>new Promise((z,y)=>{const _=()=>e.hasFinishedResolution(h,g),v=S=>{if(e.hasResolutionFailed(h,g)){const R=e.getResolutionError(h,g);y(R)}else z(S)},M=()=>b.apply(null,g),A=M();if(_())return v(A);const k=t.subscribe(()=>{_()&&(k(),v(M()))})}):async(...g)=>b.apply(null,g))}function sCe(e,t){return od(e,(n,o)=>n.hasResolver?(...r)=>{const s=n.apply(null,r);if(e.hasFinishedResolution(o,r)){if(e.hasResolutionFailed(o,r))throw e.getResolutionError(o,r);return s}throw new Promise(i=>{const c=t.subscribe(()=>{e.hasFinishedResolution(o,r)&&(i(),c())})})}:n)}function iCe(e){return od(e,t=>t.fulfill?t:{...t,fulfill:t})}function aCe(e,t,n,o,r){function s(c){const l=o.getState();if(r.isRunning(t,c)||typeof n.isFulfilled=="function"&&n.isFulfilled(l,...c))return;const{metadata:u}=o.__unstableOriginalGetState();u0e(u,t,c)||(r.markAsRunning(t,c),setTimeout(async()=>{r.clear(t,c),o.dispatch(d0e(t,c));try{const d=n.fulfill(...c);d&&await o.dispatch(d),o.dispatch(p0e(t,c))}catch(d){o.dispatch(f0e(t,c,d))}},0))}const i=(...c)=>(c=f8(e,c),s(c),e(...c));return i.hasResolver=!0,i}function f8(e,t){return e.__unstableNormalizeArgs&&typeof e.__unstableNormalizeArgs=="function"&&t?.length?e.__unstableNormalizeArgs(t):t}const cCe={name:"core/data",instantiate(e){const t=o=>(r,...s)=>e.select(r)[o](...s),n=o=>(r,...s)=>e.dispatch(r)[o](...s);return{getSelectors(){return Object.fromEntries(["getIsResolving","hasStartedResolution","hasFinishedResolution","isResolving","getCachedResolvers"].map(o=>[o,t(o)]))},getActions(){return Object.fromEntries(["startResolution","finishResolution","invalidateResolution","invalidateResolutionForStore","invalidateResolutionForStoreSelector"].map(o=>[o,n(o)]))},subscribe(){return()=>()=>{}}}}};function PH(){let e=!1,t=!1;const n=new Set,o=()=>Array.from(n).forEach(r=>r());return{get isPaused(){return e},subscribe(r){return n.add(r),()=>n.delete(r)},pause(){e=!0},resume(){e=!1,t&&(t=!1,o())},emit(){if(e){t=!0;return}o()}}}function wg(e){return typeof e=="string"?e:e.name}function x5(e={},t=null){const n={},o=PH();let r=null;function s(){o.emit()}const i=(A,k)=>{if(!k)return o.subscribe(A);const S=wg(k),C=n[S];return C?C.subscribe(A):t?t.subscribe(A,k):o.subscribe(A)};function c(A){const k=wg(A);r?.add(k);const S=n[k];return S?S.getSelectors():t?.select(k)}function l(A,k){r=new Set;try{return A.call(this)}finally{k.current=Array.from(r),r=null}}function u(A){const k=wg(A);r?.add(k);const S=n[k];return S?S.getResolveSelectors():t&&t.resolveSelect(k)}function d(A){const k=wg(A);r?.add(k);const S=n[k];return S?S.getSuspendSelectors():t&&t.suspendSelect(k)}function p(A){const k=wg(A),S=n[k];return S?S.getActions():t&&t.dispatch(k)}function f(A){return Object.fromEntries(Object.entries(A).map(([k,S])=>typeof S!="function"?[k,S]:[k,function(){return _[k].apply(null,arguments)}]))}function b(A,k){if(n[A])return console.error('Store "'+A+'" is already registered.'),n[A];const S=k();if(typeof S.getSelectors!="function")throw new TypeError("store.getSelectors must be a function");if(typeof S.getActions!="function")throw new TypeError("store.getActions must be a function");if(typeof S.subscribe!="function")throw new TypeError("store.subscribe must be a function");S.emitter=PH();const C=S.subscribe;if(S.subscribe=R=>{const T=S.emitter.subscribe(R),E=C(()=>{if(S.emitter.isPaused){S.emitter.emit();return}R()});return()=>{E?.(),T?.()}},n[A]=S,S.subscribe(s),t)try{Db(S.store).registerPrivateActions(Db(t).privateActionsOf(A)),Db(S.store).registerPrivateSelectors(Db(t).privateSelectorsOf(A))}catch{}return S}function h(A){b(A.name,()=>A.instantiate(_))}function g(A,k){Ze("wp.data.registerGenericStore",{since:"5.9",alternative:"wp.data.register( storeDescriptor )"}),b(A,()=>k)}function z(A,k){if(!k.reducer)throw new TypeError("Must specify store reducer");return b(A,()=>v1(A,k).instantiate(_)).store}function y(A){if(o.isPaused){A();return}o.pause(),Object.values(n).forEach(k=>k.emitter.pause());try{A()}finally{o.resume(),Object.values(n).forEach(k=>k.emitter.resume())}}let _={batch:y,stores:n,namespaces:n,subscribe:i,select:c,resolveSelect:u,suspendSelect:d,dispatch:p,use:v,register:h,registerGenericStore:g,registerStore:z,__unstableMarkListeningStores:l};function v(A,k){if(A)return _={..._,...A(_,k)},_}_.register(cCe);for(const[A,k]of Object.entries(e))_.register(v1(A,k));t&&t.subscribe(s);const M=f(_);return Jg(M,{privateActionsOf:A=>{try{return Db(n[A].store).privateActions}catch{return{}}},privateSelectorsOf:A=>{try{return Db(n[A].store).privateSelectors}catch{return{}}}}),M}const Rc=x5();var hS,jH;function lCe(){if(jH)return hS;jH=1;var e=function(_){return t(_)&&!n(_)};function t(y){return!!y&&typeof y=="object"}function n(y){var _=Object.prototype.toString.call(y);return _==="[object RegExp]"||_==="[object Date]"||s(y)}var o=typeof Symbol=="function"&&Symbol.for,r=o?Symbol.for("react.element"):60103;function s(y){return y.$$typeof===r}function i(y){return Array.isArray(y)?[]:{}}function c(y,_){return _.clone!==!1&&_.isMergeableObject(y)?g(i(y),y,_):y}function l(y,_,v){return y.concat(_).map(function(M){return c(M,v)})}function u(y,_){if(!_.customMerge)return g;var v=_.customMerge(y);return typeof v=="function"?v:g}function d(y){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(y).filter(function(_){return Object.propertyIsEnumerable.call(y,_)}):[]}function p(y){return Object.keys(y).concat(d(y))}function f(y,_){try{return _ in y}catch{return!1}}function b(y,_){return f(y,_)&&!(Object.hasOwnProperty.call(y,_)&&Object.propertyIsEnumerable.call(y,_))}function h(y,_,v){var M={};return v.isMergeableObject(y)&&p(y).forEach(function(A){M[A]=c(y[A],v)}),p(_).forEach(function(A){b(y,A)||(f(y,A)&&v.isMergeableObject(_[A])?M[A]=u(A,v)(y[A],_[A],v):M[A]=c(_[A],v))}),M}function g(y,_,v){v=v||{},v.arrayMerge=v.arrayMerge||l,v.isMergeableObject=v.isMergeableObject||e,v.cloneUnlessOtherwiseSpecified=c;var M=Array.isArray(_),A=Array.isArray(y),k=M===A;return k?M?v.arrayMerge(y,_,v):h(y,_,v):c(_,v)}g.all=function(_,v){if(!Array.isArray(_))throw new Error("first argument should be an array");return _.reduce(function(M,A){return g(M,A,v)},{})};var z=g;return hS=z,hS}var uCe=lCe();const b0e=Zr(uCe),h0e=x.createContext(Rc),{Consumer:Omn,Provider:CB}=h0e;function Fn(){return x.useContext(h0e)}const m0e=x.createContext(!1),{Consumer:ymn,Provider:w5}=m0e;function dCe(){return x.useContext(m0e)}const mS=SB();function pCe(e,t){if(!e||!t)return;const n=typeof e=="object"&&typeof t=="object"?Object.keys(e).filter(o=>e[o]!==t[o]):[];console.warn(`The \`useSelect\` hook returns different values when called with the same state and parameters. +This can lead to unnecessary re-renders and performance issues if not fixed. + +Non-equal value keys: %s + +`,n.join(", "))}function fCe(e,t){const n=e.select,o={};let r,s,i=!1,c,l,u;const d=new Map;function p(b){var h;return(h=e.stores[b]?.store?.getState?.())!==null&&h!==void 0?h:{}}const f=b=>{const h=[...b],g=new Set;function z(_){if(i)for(const S of h)d.get(S)!==p(S)&&(i=!1);d.clear();const v=()=>{i=!1,_()},M=()=>{c?mS.add(o,v):v()},A=[];function k(S){A.push(e.subscribe(M,S))}for(const S of h)k(S);return g.add(k),()=>{g.delete(k);for(const S of A.values())S?.();mS.cancel(o)}}function y(_){for(const v of _)if(!h.includes(v)){h.push(v);for(const M of g)M(v)}}return{subscribe:z,updateStores:y}};return(b,h)=>{function g(){if(i&&b===r)return s;const y={current:null},_=e.__unstableMarkListeningStores(()=>b(n,e),y);if(globalThis.SCRIPT_DEBUG&&!u){const v=b(n,e);ls(_,v)||(pCe(_,v),u=!0)}if(l)l.updateStores(y.current);else{for(const v of y.current)d.set(v,p(v));l=f(y.current)}ls(s,_)||(s=_),r=b,i=!0}function z(){return g(),s}return c&&!h&&(i=!1,mS.cancel(o)),g(),c=h,{subscribe:l.subscribe,getValue:z}}}function bCe(e){return Fn().select(e)}function hCe(e,t,n){const o=Fn(),r=dCe(),s=x.useMemo(()=>fCe(o),[o,e]),i=x.useCallback(t,n),{subscribe:c,getValue:l}=s(i,r),u=x.useSyncExternalStore(c,l,l);return x.useDebugValue(u),u}function G(e,t){const n=typeof e!="function",o=x.useRef(n);if(n!==o.current){const r=o.current?"static":"mapping",s=n?"static":"mapping";throw new Error(`Switching useSelect from ${r} to ${s} is not allowed`)}return n?bCe(e):hCe(!1,e,t)}const Gl=e=>yr(t=>l6e(n=>{const r=G((s,i)=>e(s,n,i));return a.jsx(t,{...n,...r})}),"withSelect"),ze=e=>{const{dispatch:t}=Fn();return e===void 0?t:t(e)},mCe=(e,t)=>{const n=Fn(),o=x.useRef(e);return _B(()=>{o.current=e}),x.useMemo(()=>{const r=o.current(n.dispatch,n);return Object.fromEntries(Object.entries(r).map(([s,i])=>(typeof i!="function"&&console.warn(`Property ${s} returned from dispatchMap in useDispatchWithMap must be a function.`),[s,(...c)=>o.current(n.dispatch,n)[s](...c)])))},[n,...t])},jf=e=>yr(t=>n=>{const r=mCe((s,i)=>e(s,n,i),[]);return a.jsx(t,{...n,...r})},"withDispatch");function t0(e){return Rc.dispatch(e)}function uo(e){return Rc.select(e)}const Q0=c0e,g0e=Rc.resolveSelect;Rc.suspendSelect;const gCe=Rc.subscribe;Rc.registerGenericStore;const MCe=Rc.registerStore;Rc.use;const Xs=Rc.register;var gS,IH;function zCe(){return IH||(IH=1,gS=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var o,r,s;if(Array.isArray(t)){if(o=t.length,o!=n.length)return!1;for(r=o;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;for(r of t.entries())if(!e(r[1],n.get(r[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(o=t.length,o!=n.length)return!1;for(r=o;r--!==0;)if(t[r]!==n[r])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),o=s.length,o!==Object.keys(n).length)return!1;for(r=o;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[r]))return!1;for(r=o;r--!==0;){var i=s[r];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n}),gS}var OCe=zCe();const N0=Zr(OCe);function yCe(e,t){if(!e)return t;let n=!1;const o={};for(const r in t)N0(e[r],t[r])?o[r]=e[r]:(n=!0,o[r]=t[r]);if(!n)return e;for(const r in e)o.hasOwnProperty(r)||(o[r]=e[r]);return o}function xd(e){return typeof e=="string"?e.split(","):Array.isArray(e)?e:null}const M0e=e=>t=>(n,o)=>n===void 0||e(o)?t(n,o):n,qB=e=>(...t)=>async({resolveSelect:n})=>{await n[e](...t)},DH=e=>t=>(n={},o)=>{const r=o[e];if(r===void 0)return n;const s=t(n[r],o);return s===n[r]?n:{...n,[r]:s}},z0e=e=>t=>(n,o)=>t(n,e(o));function ACe(e){const t=new WeakMap;return n=>{let o;return t.has(n)?o=t.get(n):(o=e(n),n!==null&&typeof n=="object"&&t.set(n,o)),o}}function vCe(e,t){return(e.rawAttributes||[]).includes(t)}function _5(e,t,n){if(!e||typeof e!="object")return e;const o=Array.isArray(t)?t:t.split(".");return o.reduce((r,s,i)=>(r[s]===void 0&&(Number.isInteger(o[i+1])?r[s]=[]:r[s]={}),i===o.length-1&&(r[s]=n),r[s]),e),e}function xCe(e,t,n){if(!e||typeof e!="object"||typeof t!="string"&&!Array.isArray(t))return e;const o=Array.isArray(t)?t:t.split(".");let r=e;return o.forEach(s=>{r=r?.[s]}),r!==void 0?r:n}function wCe(e){return/^\s*\d+\s*$/.test(e)}const yM=["create","read","update","delete"];function RB(e){const t={};if(!e)return t;const n={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(const[o,r]of Object.entries(n))t[o]=e.includes(r);return t}function k5(e,t,n){return(typeof t=="object"?[e,t.kind,t.name,t.id]:[e,t,n]).filter(Boolean).join("/")}const O0e=Symbol("RECEIVE_INTERMEDIATE_RESULTS");function y0e(e,t,n){return{type:"RECEIVE_ITEMS",items:Array.isArray(e)?e:[e],persistedEdits:t,meta:n}}function _Ce(e,t,n,o=!1){return{type:"REMOVE_ITEMS",itemIds:Array.isArray(n)?n:[n],kind:e,name:t,invalidateCache:o}}function kCe(e,t={},n,o){return{...y0e(e,n,o),query:t}}function If(e){try{return new URL(e),!0}catch{return!1}}const SCe=/^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;function A0e(e){return SCe.test(e)}const CCe=/^(tel:)?(\+)?\d{6,15}$/;function qCe(e){return e=e.replace(/[-.() ]/g,""),CCe.test(e)}function S5(e){const t=/^([^\s:]+:)/.exec(e);if(t)return t[1]}function TB(e){return e?/^[a-z\-.\+]+[0-9]*:$/i.test(e):!1}function EB(e){const t=/^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(e);if(t)return t[1]}function RCe(e){return e?/^[^\s#?]+$/.test(e):!1}function xa(e){const t=/^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(e);if(t)return t[1]}function TCe(e){return e?/^[^\s#?]+$/.test(e):!1}function WB(e){let t;try{t=new URL(e,"http://example.com").search.substring(1)}catch{}if(t)return t}function C5(e){let t="";const n=Object.entries(e);let o;for(;o=n.shift();){let[r,s]=o;if(Array.isArray(s)||s&&s.constructor===Object){const c=Object.entries(s).reverse();for(const[l,u]of c)n.unshift([`${r}[${l}]`,u])}else s!==void 0&&(s===null&&(s=""),t+="&"+[r,s].map(encodeURIComponent).join("="))}return t.substr(1)}function ECe(e){return e?/^[^\s#?\/]+$/.test(e):!1}function WCe(e){const t=xa(e),n=WB(e);let o="/";return t&&(o+=t),n&&(o+=`?${n}`),o}function v0e(e){const t=/^\S+?(#[^\s\?]*)/.exec(e);if(t)return t[1]}function b8(e){return e?/^#[^\s#?\/]*$/.test(e):!1}function Z2(e){try{return decodeURIComponent(e)}catch{return e}}function BCe(e,t,n){const o=t.length,r=o-1;for(let s=0;s{const[o,r=""]=n.split("=").filter(Boolean).map(Z2);if(o){const s=o.replace(/\]/g,"").split("[");BCe(t,s,r)}return t},Object.create(null))}function en(e="",t){if(!t||!Object.keys(t).length)return e;const n=v0e(e)||"";let o=e.replace(n,"");const r=e.indexOf("?");return r!==-1&&(t=Object.assign(jh(e),t),o=o.substr(0,r)),o+"?"+C5(t)+n}function h8(e,t){return jh(e)[t]}function FH(e,t){return h8(e,t)!==void 0}function C4(e,...t){const n=e.replace(/^[^#]*/,"");e=e.replace(/#.*/,"");const o=e.indexOf("?");if(o===-1)return e+n;const r=jh(e),s=e.substr(0,o);t.forEach(l=>delete r[l]);const i=C5(r);return(i?s+"?"+i:s)+n}const NCe=/^(?:[a-z]+:|#|\?|\.|\/)/i;function Df(e){return e&&(e=e.trim(),!NCe.test(e)&&!A0e(e)?"http://"+e:e)}function f3(e){try{return decodeURI(e)}catch{return e}}function Ih(e,t=null){if(!e)return"";let n=e.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i,"").replace(/^www\./i,"");n.match(/^[^\/]+\/$/)&&(n=n.replace("/",""));const o=/\/([^\/?]+)\.(?:[\w]+)(?=\?|$)/;if(!t||n.length<=t||!n.match(o))return n;n=n.split("?")[0];const r=n.split("/"),s=r[r.length-1];if(s.length<=t)return"…"+n.slice(-t);const i=s.lastIndexOf("."),[c,l]=[s.slice(0,i),s.slice(i+1)],u=c.slice(-3)+"."+l;return s.slice(0,t-u.length-1)+"…"+u}var _g={exports:{}},$H;function LCe(){if($H)return _g.exports;$H=1;var e={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},t=Object.keys(e).join("|"),n=new RegExp(t,"g"),o=new RegExp(t,"");function r(c){return e[c]}var s=function(c){return c.replace(n,r)},i=function(c){return!!c.match(o)};return _g.exports=s,_g.exports.has=i,_g.exports.remove=s,_g.exports}var PCe=LCe();const hs=Zr(PCe);function BB(e){return e?hs(e).replace(/[\s\./]+/g,"-").replace(/[^\p{L}\p{N}_-]+/gu,"").toLowerCase().replace(/-+/g,"-").replace(/(^-+)|(-+$)/g,""):""}function Ff(e){let t;if(e){try{t=new URL(e,"http://example.com").pathname.split("/").pop()}catch{}if(t)return t}}function VH(e){const t=e.split("?"),n=t[1],o=t[0];return n?o+"?"+n.split("&").map(r=>r.split("=")).map(r=>r.map(decodeURIComponent)).sort((r,s)=>r[0].localeCompare(s[0])).map(r=>r.map(encodeURIComponent)).map(r=>r.join("=")).join("&"):o}function jCe(e){const t={stableKey:"",page:1,perPage:10,fields:null,include:null,context:"default"},n=Object.keys(e).sort();for(let s=0;s{_=_?.[v]}),_5(g,y,_)}}else{if(!e.itemIsComplete[c]?.[b])return null;g=h}p.push(g)}return p}const x0e=Pt((e,t={})=>{let n=HH.get(e);if(n){const r=n.get(t);if(r!==void 0)return r}else n=new Ua,HH.set(e,n);const o=ICe(e,t);return n.set(t,o),o});function w0e(e,t={}){var n;const{stableKey:o,context:r}=Dh(t);return(n=e.queries?.[r]?.[o]?.meta?.totalItems)!==null&&n!==void 0?n:null}function DCe(e,t={}){var n;const{stableKey:o,context:r}=Dh(t);return(n=e.queries?.[r]?.[o]?.meta?.totalPages)!==null&&n!==void 0?n:null}function FCe(e){const t=(n,o)=>{const{headers:r={}}=n;for(const s in r)if(s.toLowerCase()==="x-wp-nonce"&&r[s]===t.nonce)return o(n);return o({...n,headers:{...r,"X-WP-Nonce":t.nonce}})};return t.nonce=e,t}const _0e=(e,t)=>{let n=e.path,o,r;return typeof e.namespace=="string"&&typeof e.endpoint=="string"&&(o=e.namespace.replace(/^\/|\/$/g,""),r=e.endpoint.replace(/^\//,""),r?n=o+"/"+r:n=o),delete e.namespace,delete e.endpoint,t({...e,path:n})},$Ce=e=>(t,n)=>_0e(t,o=>{let r=o.url,s=o.path,i;return typeof s=="string"&&(i=e,e.indexOf("?")!==-1&&(s=s.replace("?","&")),s=s.replace(/^\//,""),typeof i=="string"&&i.indexOf("?")!==-1&&(s=s.replace("?","&")),r=i+s),n({...o,url:r})});function VCe(e){const t=Object.fromEntries(Object.entries(e).map(([n,o])=>[VH(n),o]));return(n,o)=>{const{parse:r=!0}=n;let s=n.path;if(!s&&n.url){const{rest_route:l,...u}=jh(n.url);typeof l=="string"&&(s=en(l,u))}if(typeof s!="string")return o(n);const i=n.method||"GET",c=VH(s);if(i==="GET"&&t[c]){const l=t[c];return delete t[c],UH(l,!!r)}else if(i==="OPTIONS"&&t[i]&&t[i][c]){const l=t[i][c];return delete t[i][c],UH(l,!!r)}return o(n)}}function UH(e,t){if(t)return Promise.resolve(e.body);try{return Promise.resolve(new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}catch{return Object.entries(e.headers).forEach(([n,o])=>{n.toLowerCase()==="link"&&(e.headers[n]=o.replace(/<([^>]+)>/,(r,s)=>`<${encodeURI(s)}>`))}),Promise.resolve(t?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}}const HCe=({path:e,url:t,...n},o)=>({...n,url:t&&en(t,o),path:e&&en(e,o)}),XH=e=>e.json?e.json():Promise.reject(e),UCe=e=>{if(!e)return{};const t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}},GH=e=>{const{next:t}=UCe(e.headers.get("link"));return t},XCe=e=>{const t=!!e.path&&e.path.indexOf("per_page=-1")!==-1,n=!!e.url&&e.url.indexOf("per_page=-1")!==-1;return t||n},k0e=async(e,t)=>{if(e.parse===!1||!XCe(e))return t(e);const n=await Vt({...HCe(e,{per_page:100}),parse:!1}),o=await XH(n);if(!Array.isArray(o))return o;let r=GH(n);if(!r)return o;let s=[].concat(o);for(;r;){const i=await Vt({...e,path:void 0,url:r,parse:!1}),c=await XH(i);s=s.concat(c),r=GH(i)}return s},GCe=new Set(["PATCH","PUT","DELETE"]),KCe="GET",YCe=(e,t)=>{const{method:n=KCe}=e;return GCe.has(n.toUpperCase())&&(e={...e,headers:{...e.headers,"X-HTTP-Method-Override":n,"Content-Type":"application/json"},method:"POST"}),t(e)},ZCe=(e,t)=>(typeof e.url=="string"&&!FH(e.url,"_locale")&&(e.url=en(e.url,{_locale:"user"})),typeof e.path=="string"&&!FH(e.path,"_locale")&&(e.path=en(e.path,{_locale:"user"})),t(e)),QCe=(e,t=!0)=>t?e.status===204?null:e.json?e.json():Promise.reject(e):e,JCe=e=>{const t={code:"invalid_json",message:m("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch(()=>{throw t})},S0e=(e,t=!0)=>Promise.resolve(QCe(e,t)).catch(n=>NB(n,t));function NB(e,t=!0){if(!t)throw e;return JCe(e).then(n=>{const o={code:"unknown_error",message:m("An unknown error occurred.")};throw n||o})}function eqe(e){const t=!!e.method&&e.method==="POST";return(!!e.path&&e.path.indexOf("/wp/v2/media")!==-1||!!e.url&&e.url.indexOf("/wp/v2/media")!==-1)&&t}const tqe=(e,t)=>{if(!eqe(e))return t(e);let n=0;const o=5,r=s=>(n++,t({path:`/wp/v2/media/${s}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>n{if(!s.headers)return Promise.reject(s);const i=s.headers.get("x-wp-upload-attachment-id");return s.status>=500&&s.status<600&&i?r(i).catch(()=>e.parse!==!1?Promise.reject({code:"post_process",message:m("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(s)):NB(s,e.parse)}).then(s=>S0e(s,e.parse))},nqe=e=>(t,n)=>{if(typeof t.url=="string"){const o=h8(t.url,"wp_theme_preview");o===void 0?t.url=en(t.url,{wp_theme_preview:e}):o===""&&(t.url=C4(t.url,"wp_theme_preview"))}if(typeof t.path=="string"){const o=h8(t.path,"wp_theme_preview");o===void 0?t.path=en(t.path,{wp_theme_preview:e}):o===""&&(t.path=C4(t.path,"wp_theme_preview"))}return n(t)},oqe={Accept:"application/json, */*;q=0.1"},rqe={credentials:"include"},C0e=[ZCe,_0e,YCe,k0e];function sqe(e){C0e.unshift(e)}const q0e=e=>{if(e.status>=200&&e.status<300)return e;throw e},iqe=e=>{const{url:t,path:n,data:o,parse:r=!0,...s}=e;let{body:i,headers:c}=e;return c={...oqe,...c},o&&(i=JSON.stringify(o),c["Content-Type"]="application/json"),window.fetch(t||n||window.location.href,{...rqe,...s,body:i,headers:c}).then(u=>Promise.resolve(u).then(q0e).catch(d=>NB(d,r)).then(d=>S0e(d,r)),u=>{throw u&&u.name==="AbortError"?u:{code:"fetch_error",message:m("You are probably offline.")}})};let R0e=iqe;function aqe(e){R0e=e}function Vt(e){return C0e.reduceRight((n,o)=>r=>o(r,n),R0e)(e).catch(n=>n.code!=="rest_cookie_invalid_nonce"?Promise.reject(n):window.fetch(Vt.nonceEndpoint).then(q0e).then(o=>o.text()).then(o=>(Vt.nonceMiddleware.nonce=o,Vt(e))))}Vt.use=sqe;Vt.setFetchHandler=aqe;Vt.createNonceMiddleware=FCe;Vt.createPreloadingMiddleware=VCe;Vt.createRootURLMiddleware=$Ce;Vt.fetchAllMiddleware=k0e;Vt.mediaUploadMiddleware=tqe;Vt.createThemePreviewMiddleware=nqe;function cqe(e={},t){switch(t.type){case"ADD_FORMAT_TYPES":return{...e,...t.formatTypes.reduce((n,o)=>({...n,[o.name]:o}),{})};case"REMOVE_FORMAT_TYPES":return Object.fromEntries(Object.entries(e).filter(([n])=>!t.names.includes(n)))}return e}const lqe=Q0({formatTypes:cqe}),LB=Pt(e=>Object.values(e.formatTypes),e=>[e.formatTypes]);function uqe(e,t){return e.formatTypes[t]}function dqe(e,t){const n=LB(e);return n.find(({className:o,tagName:r})=>o===null&&t===r)||n.find(({className:o,tagName:r})=>o===null&&r==="*")}function pqe(e,t){return LB(e).find(({className:n})=>n===null?!1:` ${t} `.indexOf(` ${n} `)>=0)}const fqe=Object.freeze(Object.defineProperty({__proto__:null,getFormatType:uqe,getFormatTypeForBareElement:dqe,getFormatTypeForClassName:pqe,getFormatTypes:LB},Symbol.toStringTag,{value:"Module"}));function bqe(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function hqe(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}const mqe=Object.freeze(Object.defineProperty({__proto__:null,addFormatTypes:bqe,removeFormatTypes:hqe},Symbol.toStringTag,{value:"Module"})),gqe="core/rich-text",pl=v1(gqe,{reducer:lqe,selectors:fqe,actions:mqe});Xs(pl);function q4(e,t){if(e===t)return!0;if(!e||!t||e.type!==t.type)return!1;const n=e.attributes,o=t.attributes;if(n===o)return!0;if(!n||!o)return!1;const r=Object.keys(n),s=Object.keys(o);if(r.length!==s.length)return!1;const i=r.length;for(let c=0;c{const r=t[o-1];if(r){const s=n.slice();s.forEach((i,c)=>{const l=r[c];q4(i,l)&&(s[c]=l)}),t[o]=s}}),{...e,formats:t}}function KH(e,t,n){return e=e.slice(),e[t]=n,e}function Ri(e,t,n=e.start,o=e.end){const{formats:r,activeFormats:s}=e,i=r.slice();if(n===o){const c=i[n]?.find(({type:l})=>l===t.type);if(c){const l=i[n].indexOf(c);for(;i[n]&&i[n][l]===c;)i[n]=KH(i[n],l,t),n--;for(o++;i[o]&&i[o][l]===c;)i[o]=KH(i[o],l,t),o++}}else{let c=1/0;for(let l=n;ld!==t.type);const u=i[l].length;uc!==t.type)||[],t]})}function fl({implementation:e},t){return fl.body||(fl.body=e.createHTMLDocument("").body),fl.body.innerHTML=t,fl.body}const bl="",T0e="\uFEFF";function PB(e,t=[]){const{formats:n,start:o,end:r,activeFormats:s}=e;if(o===void 0)return t;if(o===r){if(s)return s;const u=n[o-1]||t,d=n[o]||t;return u.lengthq4(p,f))||c.splice(d,1)}if(c.length===0)return t}return c||t}function E0e(e){return uo(pl).getFormatType(e)}function YH(e,t){if(t)return e;const n={};for(const o in e){let r=o;o.startsWith("data-disable-rich-text-")&&(r=o.slice(23)),n[r]=e[o]}return n}function uA({type:e,tagName:t,attributes:n,unregisteredAttributes:o,object:r,boundaryClass:s,isEditableTree:i}){const c=E0e(e);let l={};if(s&&i&&(l["data-rich-text-format-boundary"]="true"),!c)return n&&(l={...n,...l}),{type:e,attributes:YH(l,i),object:r};l={...o,...l};for(const u in n){const d=c.attributes?c.attributes[u]:!1;d?l[d]=n[u]:l[u]=n[u]}return c.className&&(l.class?l.class=`${c.className} ${l.class}`:l.class=c.className),i&&c.contentEditable===!1&&(l.contenteditable="false"),{type:t||c.tagName,object:c.object,attributes:YH(l,i)}}function Mqe(e,t,n){do if(e[n]!==t[n])return!1;while(n--);return!0}function W0e({value:e,preserveWhiteSpace:t,createEmpty:n,append:o,getLastChild:r,getParent:s,isText:i,getText:c,remove:l,appendText:u,onStartIndex:d,onEndIndex:p,isEditableTree:f,placeholder:b}){const{formats:h,replacements:g,text:z,start:y,end:_}=e,v=h.length+1,M=n(),A=PB(e),k=A[A.length-1];let S,C;o(M,"");for(let R=0;R{if(N&&S&&Mqe(B,S,I)){N=r(N);return}const{type:P,tagName:$,attributes:F,unregisteredAttributes:X}=j,Q=f&&j===k,V=s(N),Z=o(V,uA({type:P,tagName:$,attributes:F,unregisteredAttributes:X,boundaryClass:Q,isEditableTree:f}));i(N)&&c(N).length===0&&l(N),N=o(Z,"")}),R===0&&(d&&y===0&&d(M,N),p&&_===0&&p(M,N)),T===bl){const j=g[R];if(!j)continue;const{type:I,attributes:P,innerHTML:$}=j,F=E0e(I);f&&I==="#comment"?(N=o(s(N),{type:"span",attributes:{contenteditable:"false","data-rich-text-comment":P["data-rich-text-comment"]}}),o(o(N,{type:"span"}),P["data-rich-text-comment"].trim())):!f&&I==="script"?(N=o(s(N),uA({type:"script",isEditableTree:f})),o(N,{html:decodeURIComponent(P["data-rich-text-script"])})):F?.contentEditable===!1?(N=o(s(N),uA({...j,isEditableTree:f,boundaryClass:y===R&&_===R+1})),$&&o(N,{html:$})):N=o(s(N),uA({...j,object:!0,isEditableTree:f})),N=o(s(N),"")}else!t&&T===` +`?(N=o(s(N),{type:"br",attributes:f?{"data-rich-text-line-break":"true"}:void 0,object:!0}),N=o(s(N),"")):i(N)?u(N,T):N=o(s(N),T);d&&y===R+1&&d(M,N),p&&_===R+1&&p(M,N),E&&R===z.length&&(o(s(N),T0e),b&&z.length===0&&o(s(N),{type:"span",attributes:{"data-rich-text-placeholder":b,style:"pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;"}})),S=B,C=T}return M}function E0({value:e,preserveWhiteSpace:t}){const n=W0e({value:e,preserveWhiteSpace:t,createEmpty:zqe,append:yqe,getLastChild:Oqe,getParent:vqe,isText:xqe,getText:wqe,remove:_qe,appendText:Aqe});return B0e(n.children)}function zqe(){return{}}function Oqe({children:e}){return e&&e[e.length-1]}function yqe(e,t){return typeof t=="string"&&(t={text:t}),t.parent=e,e.children=e.children||[],e.children.push(t),t}function Aqe(e,t){e.text+=t}function vqe({parent:e}){return e}function xqe({text:e}){return typeof e=="string"}function wqe({text:e}){return e}function _qe(e){const t=e.parent.children.indexOf(e);return t!==-1&&e.parent.children.splice(t,1),e}function kqe({type:e,attributes:t,object:n,children:o}){if(e==="#comment")return``;let r="";for(const s in t)wre(s)&&(r+=` ${s}="${h5(t[s])}"`);return n?`<${e}${r}>`:`<${e}${r}>${B0e(o)}`}function B0e(e=[]){return e.map(t=>t.html!==void 0?t.html:t.text===void 0?kqe(t):Ake(t.text)).join("")}function tf({text:e}){return e.replace(bl,"")}function Hp(){return{formats:[],replacements:[],text:""}}function Sqe({tagName:e,attributes:t}){let n;if(t&&t.class&&(n=uo(pl).getFormatTypeForClassName(t.class),n&&(t.class=` ${t.class} `.replace(` ${n.className} `," ").trim(),t.class||delete t.class)),n||(n=uo(pl).getFormatTypeForBareElement(e)),!n)return t?{type:e,attributes:t}:{type:e};if(n.__experimentalCreatePrepareEditableTree&&!n.__experimentalCreateOnChangeEditableValue)return null;if(!t)return{formatType:n,type:n.name,tagName:e};const o={},r={},s={...t};for(const i in n.attributes){const c=n.attributes[i];o[i]=s[c],delete s[c],typeof o[i]>"u"&&delete o[i]}for(const i in s)r[i]=t[i];return n.contentEditable===!1&&delete r.contenteditable,{formatType:n,type:n.name,tagName:e,attributes:o,unregisteredAttributes:r}}class Ko{#e;static empty(){return new Ko}static fromPlainText(t){return new Ko(Zn({text:t}))}static fromHTMLString(t){return new Ko(Zn({html:t}))}static fromHTMLElement(t,n={}){const{preserveWhiteSpace:o=!1}=n,r=o?t:N0e(t),s=new Ko(Zn({element:r}));return Object.defineProperty(s,"originalHTML",{value:t.innerHTML}),s}constructor(t=Hp()){this.#e=t}toPlainText(){return tf(this.#e)}toHTMLString({preserveWhiteSpace:t}={}){return this.originalHTML||E0({value:this.#e,preserveWhiteSpace:t})}valueOf(){return this.toHTMLString()}toString(){return this.toHTMLString()}toJSON(){return this.toHTMLString()}get length(){return this.text.length}get formats(){return this.#e.formats}get replacements(){return this.#e.replacements}get text(){return this.#e.text}}for(const e of Object.getOwnPropertyNames(String.prototype))Ko.prototype.hasOwnProperty(e)||Object.defineProperty(Ko.prototype,e,{value(...t){return this.toHTMLString()[e](...t)}});function Zn({element:e,text:t,html:n,range:o,__unstableIsEditableTree:r}={}){return n instanceof Ko?{text:n.text,formats:n.formats,replacements:n.replacements}:typeof t=="string"&&t.length>0?{formats:Array(t.length),replacements:Array(t.length),text:t}:(typeof n=="string"&&n.length>0&&(e=fl(document,n)),typeof e!="object"?Hp():L0e({element:e,range:o,isEditableTree:r}))}function Lu(e,t,n,o){if(!n)return;const{parentNode:r}=t,{startContainer:s,startOffset:i,endContainer:c,endOffset:l}=n,u=e.text.length;o.start!==void 0?e.start=u+o.start:t===s&&t.nodeType===t.TEXT_NODE?e.start=u+i:r===s&&t===s.childNodes[i]?e.start=u:r===s&&t===s.childNodes[i-1]?e.start=u+o.text.length:t===s&&(e.start=u),o.end!==void 0?e.end=u+o.end:t===c&&t.nodeType===t.TEXT_NODE?e.end=u+l:r===c&&t===c.childNodes[l-1]?e.end=u+o.text.length:r===c&&t===c.childNodes[l]?e.end=u:t===c&&(e.end=u+l)}function Cqe(e,t,n){if(!t)return;const{startContainer:o,endContainer:r}=t;let{startOffset:s,endOffset:i}=t;return e===o&&(s=n(e.nodeValue.slice(0,s)).length),e===r&&(i=n(e.nodeValue.slice(0,i)).length),{startContainer:o,startOffset:s,endContainer:r,endOffset:i}}function N0e(e,t=!0){const n=e.cloneNode(!0);return n.normalize(),Array.from(n.childNodes).forEach((o,r,s)=>{if(o.nodeType===o.TEXT_NODE){let i=o.nodeValue;/[\n\t\r\f]/.test(i)&&(i=i.replace(/[\n\t\r\f]+/g," ")),i.indexOf(" ")!==-1&&(i=i.replace(/ {2,}/g," ")),r===0&&i.startsWith(" ")?i=i.slice(1):t&&r===s.length-1&&i.endsWith(" ")&&(i=i.slice(0,-1)),o.nodeValue=i}else o.nodeType===o.ELEMENT_NODE&&N0e(o,!1)}),n}const qqe="\r";function ZH(e){return e.replace(new RegExp(`[${T0e}${bl}${qqe}]`,"gu"),"")}function L0e({element:e,range:t,isEditableTree:n}){const o=Hp();if(!e)return o;if(!e.hasChildNodes())return Lu(o,e,t,Hp()),o;const r=e.childNodes.length;for(let s=0;sn===t)}function Eqe({start:e,end:t,replacements:n,text:o}){if(!(e+1!==t||o[e]!==bl))return n[e]}function Kl({start:e,end:t}){if(!(e===void 0||t===void 0))return e===t}function m8({text:e}){return e.length===0}function Wqe(e,t=""){return typeof t=="string"&&(t=Zn({text:t})),Fh(e.reduce((n,{formats:o,replacements:r,text:s})=>({formats:n.formats.concat(t.formats,o),replacements:n.replacements.concat(t.replacements,r),text:n.text+t.text+s})))}function P0e(e,t){if(t={name:e,...t},typeof t.name!="string"){window.console.error("Format names must be strings.");return}if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name)){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");return}if(uo(pl).getFormatType(t.name)){window.console.error('Format "'+t.name+'" is already registered.');return}if(typeof t.tagName!="string"||t.tagName===""){window.console.error("Format tag names must be a string.");return}if((typeof t.className!="string"||t.className==="")&&t.className!==null){window.console.error("Format class names must be a string, or null to handle bare elements.");return}if(!/^[_a-zA-Z]+[a-zA-Z0-9_-]*$/.test(t.className)){window.console.error("A class name must begin with a letter, followed by any number of hyphens, underscores, letters, or numbers.");return}if(t.className===null){const n=uo(pl).getFormatTypeForBareElement(t.tagName);if(n&&n.name!=="core/unknown"){window.console.error(`Format "${n.name}" is already registered to handle bare tag name "${t.tagName}".`);return}}else{const n=uo(pl).getFormatTypeForClassName(t.className);if(n){window.console.error(`Format "${n.name}" is already registered to handle class name "${t.className}".`);return}}if(!("title"in t)||t.title===""){window.console.error('The format "'+t.name+'" must have a title.');return}if("keywords"in t&&t.keywords.length>3){window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');return}if(typeof t.title!="string"){window.console.error("Format titles must be strings.");return}return t0(pl).addFormatTypes(t),t}function np(e,t,n=e.start,o=e.end){const{formats:r,activeFormats:s}=e,i=r.slice();if(n===o){const c=i[n]?.find(({type:l})=>l===t);if(c){for(;i[n]?.find(l=>l===c);)MS(i,n,t),n--;for(o++;i[o]?.find(l=>l===c);)MS(i,o,t),o++}}else for(let c=n;cc!==t)||[]})}function MS(e,t,n){const o=e[t].filter(({type:r})=>r!==n);o.length?e[t]=o:delete e[t]}function W0(e,t,n=e.start,o=e.end){const{formats:r,replacements:s,text:i}=e;typeof t=="string"&&(t=Zn({text:t}));const c=n+t.text.length;return Fh({formats:r.slice(0,n).concat(t.formats,r.slice(o)),replacements:s.slice(0,n).concat(t.replacements,s.slice(o)),text:i.slice(0,n)+t.text+i.slice(o),start:c,end:c})}function ba(e,t,n){return W0(e,Zn(),t,n)}function Bqe({formats:e,replacements:t,text:n,start:o,end:r},s,i){return n=n.replace(s,(c,...l)=>{const u=l[l.length-2];let d=i,p,f;return typeof d=="function"&&(d=i(c,...l)),typeof d=="object"?(p=d.formats,f=d.replacements,d=d.text):(p=Array(d.length),f=Array(d.length),e[u]&&(p=p.fill(e[u]))),e=e.slice(0,u).concat(p,e.slice(u+c.length)),t=t.slice(0,u).concat(f,t.slice(u+c.length)),o&&(o=r=u+d.length),d}),Fh({formats:e,replacements:t,text:n,start:o,end:r})}function j0e(e,t,n,o){return W0(e,{formats:[,],replacements:[t],text:bl},n,o)}function Q2(e,t=e.start,n=e.end){const{formats:o,replacements:r,text:s}=e;return t===void 0||n===void 0?{...e}:{formats:o.slice(t,n),replacements:r.slice(t,n),text:s.slice(t,n)}}function IB({formats:e,replacements:t,text:n,start:o,end:r},s){if(typeof s!="string")return Nqe(...arguments);let i=0;return n.split(s).map(c=>{const l=i,u={formats:e.slice(l,l+c.length),replacements:t.slice(l,l+c.length),text:c};return i+=s.length+c.length,o!==void 0&&r!==void 0&&(o>=l&&ol&&(u.start=0),r>=l&&ri&&(u.end=c.length)),u})}function Nqe({formats:e,replacements:t,text:n,start:o,end:r},s=o,i=r){if(o===void 0||r===void 0)return;const c={formats:e.slice(0,s),replacements:t.slice(0,s),text:n.slice(0,s)},l={formats:e.slice(i),replacements:t.slice(i),text:n.slice(i),start:0,end:0};return[c,l]}function I0e(e,t){return e===t||e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}function g8(e,t,n){const o=e.parentNode;let r=0;for(;e=e.previousSibling;)r++;return n=[r,...n],o!==t&&(n=g8(o,t,n)),n}function QH(e,t){for(t=[...t];e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}function Lqe(e,t){if(t.html!==void 0)return e.innerHTML+=t.html;typeof t=="string"&&(t=e.ownerDocument.createTextNode(t));const{type:n,attributes:o}=t;if(n)if(n==="#comment")t=e.ownerDocument.createComment(o["data-rich-text-comment"]);else{t=e.ownerDocument.createElement(n);for(const r in o)t.setAttribute(r,o[r])}return e.appendChild(t)}function Pqe(e,t){e.appendData(t)}function jqe({lastChild:e}){return e}function Iqe({parentNode:e}){return e}function Dqe(e){return e.nodeType===e.TEXT_NODE}function Fqe({nodeValue:e}){return e}function $qe(e){return e.parentNode.removeChild(e)}function Vqe({value:e,prepareEditableTree:t,isEditableTree:n=!0,placeholder:o,doc:r=document}){let s=[],i=[];return t&&(e={...e,formats:t(e)}),{body:W0e({value:e,createEmpty:()=>fl(r,""),append:Lqe,getLastChild:jqe,getParent:Iqe,isText:Dqe,getText:Fqe,remove:$qe,appendText:Pqe,onStartIndex(u,d){s=g8(d,u,[d.nodeValue.length])},onEndIndex(u,d){i=g8(d,u,[d.nodeValue.length])},isEditableTree:n,placeholder:o}),selection:{startPath:s,endPath:i}}}function Hqe({value:e,current:t,prepareEditableTree:n,__unstableDomOnly:o,placeholder:r}){const{body:s,selection:i}=Vqe({value:e,prepareEditableTree:n,placeholder:r,doc:t.ownerDocument});D0e(s,t),e.start!==void 0&&!o&&Uqe(i,t)}function D0e(e,t){let n=0,o;for(;o=e.firstChild;){const r=t.childNodes[n];if(!r)t.appendChild(o);else if(r.isEqualNode(o))e.removeChild(o);else if(r.nodeName!==o.nodeName||r.nodeType===r.TEXT_NODE&&r.data!==o.data)t.replaceChild(o,r);else{const s=r.attributes,i=o.attributes;if(s){let c=s.length;for(;c--;){const{name:l}=s[c];o.getAttribute(l)||r.removeAttribute(l)}}if(i)for(let c=0;c0){if(I0e(d,u.getRangeAt(0)))return;u.removeAllRanges()}u.addRange(d),p!==c.activeElement&&p instanceof l.HTMLElement&&p.focus()}function Xqe(e){if(!(typeof document>"u")){if(document.readyState==="complete"||document.readyState==="interactive")return void e();document.addEventListener("DOMContentLoaded",e)}}function JH(e="polite"){const t=document.createElement("div");t.id=`a11y-speak-${e}`,t.className="a11y-speak-region",t.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions text"),t.setAttribute("aria-atomic","true");const{body:n}=document;return n&&n.appendChild(t),t}function Gqe(){const e=document.createElement("p");e.id="a11y-speak-intro-text",e.className="a11y-speak-intro-text",e.textContent=m("Notifications"),e.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),e.setAttribute("hidden","hidden");const{body:t}=document;return t&&t.appendChild(e),e}function Kqe(){const e=document.getElementsByClassName("a11y-speak-region"),t=document.getElementById("a11y-speak-intro-text");for(let n=0;n]+>/g," "),eU===e&&(e+=" "),eU=e,e}function Xt(e,t){Kqe(),e=Yqe(e);const n=document.getElementById("a11y-speak-intro-text"),o=document.getElementById("a11y-speak-assertive"),r=document.getElementById("a11y-speak-polite");o&&t==="assertive"?o.textContent=e:r&&(r.textContent=e),n&&n.removeAttribute("hidden")}function Zqe(){const e=document.getElementById("a11y-speak-intro-text"),t=document.getElementById("a11y-speak-assertive"),n=document.getElementById("a11y-speak-polite");e===null&&Gqe(),t===null&&JH("assertive"),n===null&&JH("polite")}Xqe(Zqe);function yc(e,t){return jB(e,t.type)?(t.title&&Xt(ve(m("%s removed."),t.title),"assertive"),np(e,t.type)):(t.title&&Xt(ve(m("%s applied."),t.title),"assertive"),Ri(e,t))}function Qqe(e,t,n,o){let r=e.startContainer;if(r.nodeType===r.TEXT_NODE&&e.startOffset===r.length&&r.nextSibling)for(r=r.nextSibling;r.firstChild;)r=r.firstChild;if(r.nodeType!==r.ELEMENT_NODE&&(r=r.parentElement),!r||r===t||!t.contains(r))return;const s=n+(o?"."+o:"");for(;r!==t;){if(r.matches(s))return r;r=r.parentElement}}function Jqe(e,t){return{contextElement:t,getBoundingClientRect(){return t.contains(e.startContainer)?e.getBoundingClientRect():t.getBoundingClientRect()}}}function zS(e,t,n){if(!e)return;const{ownerDocument:o}=e,{defaultView:r}=o,s=r.getSelection();if(!s||!s.rangeCount)return;const i=s.getRangeAt(0);if(!i||!i.startContainer)return;const c=Qqe(i,e,t,n);return c||Jqe(i,e)}function b3({editableContentElement:e,settings:t={}}){const{tagName:n,className:o,isActive:r}=t,[s,i]=x.useState(()=>zS(e,n,o)),c=Ir(r);return x.useLayoutEffect(()=>{if(!e)return;function l(){i(zS(e,n,o))}function u(){p.addEventListener("selectionchange",l)}function d(){p.removeEventListener("selectionchange",l)}const{ownerDocument:p}=e;return(e===p.activeElement||!c&&r||c&&!r)&&(i(zS(e,n,o)),u()),e.addEventListener("focusin",u),e.addEventListener("focusout",d),()=>{d(),e.removeEventListener("focusin",u),e.removeEventListener("focusout",d)}},[e,n,o,r,c]),s}const eRe="pre-wrap",tRe="1px";function nRe(){return x.useCallback(e=>{e&&(e.style.whiteSpace=eRe,e.style.minWidth=tRe)},[])}function oRe({record:e}){const t=x.useRef(),{activeFormats:n=[],replacements:o,start:r}=e.current,s=o[r];return x.useEffect(()=>{if((!n||!n.length)&&!s)return;const i="*[data-rich-text-format-boundary]",c=t.current.querySelector(i);if(!c)return;const{ownerDocument:l}=c,{defaultView:u}=l,p=u.getComputedStyle(c).color.replace(")",", 0.2)").replace("rgb","rgba"),f=`.rich-text:focus ${i}`,b=`background-color: ${p}`,h=`${f} {${b}}`,g="rich-text-boundary-style";let z=l.getElementById(g);z||(z=l.createElement("style"),z.id=g,l.head.appendChild(z)),z.innerHTML!==h&&(z.innerHTML=h)},[n,s]),t}const rRe=e=>t=>{function n(r){const{record:s}=e.current,{ownerDocument:i}=t;if(Kl(s.current)||!t.contains(i.activeElement))return;const c=Q2(s.current),l=tf(c),u=E0({value:c});r.clipboardData.setData("text/plain",l),r.clipboardData.setData("text/html",u),r.clipboardData.setData("rich-text","true"),r.preventDefault(),r.type==="cut"&&i.execCommand("delete")}const{defaultView:o}=t.ownerDocument;return o.addEventListener("copy",n),o.addEventListener("cut",n),()=>{o.removeEventListener("copy",n),o.removeEventListener("cut",n)}},sRe=()=>e=>{function t(o){const{target:r}=o;if(r===e||r.textContent&&r.isContentEditable)return;const{ownerDocument:s}=r,{defaultView:i}=s,c=i.getSelection();if(c.containsNode(r))return;const l=s.createRange(),u=r.isContentEditable?r:r.closest("[contenteditable]");l.selectNode(u),c.removeAllRanges(),c.addRange(l),o.preventDefault()}function n(o){o.relatedTarget&&!e.contains(o.relatedTarget)&&o.relatedTarget.tagName==="A"&&t(o)}return e.addEventListener("click",t),e.addEventListener("focusin",n),()=>{e.removeEventListener("click",t),e.removeEventListener("focusin",n)}},tU=[],iRe=e=>t=>{function n(o){const{keyCode:r,shiftKey:s,altKey:i,metaKey:c,ctrlKey:l}=o;if(s||i||c||l||r!==_i&&r!==ki)return;const{record:u,applyRecord:d,forceRender:p}=e.current,{text:f,formats:b,start:h,end:g,activeFormats:z=[]}=u.current,y=Kl(u.current),{ownerDocument:_}=t,{defaultView:v}=_,{direction:M}=v.getComputedStyle(t),A=M==="rtl"?ki:_i,k=o.keyCode===A;if(y&&z.length===0&&(h===0&&k||g===f.length&&!k)||!y)return;const S=b[h-1]||tU,C=b[h]||tU,R=k?S:C,T=z.every((P,$)=>P===R[$]);let E=z.length;if(T?E{t.removeEventListener("keydown",n)}},aRe=e=>t=>{function n(o){const{keyCode:r}=o,{createRecord:s,handleChange:i}=e.current;if(o.defaultPrevented||r!==yl&&r!==Oc)return;const c=s(),{start:l,end:u,text:d}=c;l===0&&u!==0&&u===d.length&&(i(ba(c)),o.preventDefault())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}};function cRe({value:e,start:t,end:n,formats:o}){const r=Math.min(t,n),s=Math.max(t,n),i=e.formats[r-1]||[],c=e.formats[s]||[];for(e.activeFormats=o.map((l,u)=>{if(i[u]){if(q4(l,i[u]))return i[u]}else if(c[u]&&q4(l,c[u]))return c[u];return l});--n>=t;)e.activeFormats.length>0?e.formats[n]=e.activeFormats:delete e.formats[n];return e}const lRe=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),nU=[],F0e="data-rich-text-placeholder";function uRe(e){const t=e.getSelection(),{anchorNode:n,anchorOffset:o}=t;if(n.nodeType!==n.ELEMENT_NODE)return;const r=n.childNodes[o];!r||r.nodeType!==r.ELEMENT_NODE||!r.hasAttribute(F0e)||t.collapseToStart()}const dRe=e=>t=>{const{ownerDocument:n}=t,{defaultView:o}=n;let r=!1;function s(d){if(r)return;let p;d&&(p=d.inputType);const{record:f,applyRecord:b,createRecord:h,handleChange:g}=e.current;if(p&&(p.indexOf("format")===0||lRe.has(p))){b(f.current);return}const z=h(),{start:y,activeFormats:_=[]}=f.current,v=cRe({value:z,start:y,end:z.start,formats:_});g(v)}function i(){const{record:d,applyRecord:p,createRecord:f,onSelectionChange:b}=e.current;if(t.contentEditable!=="true")return;if(n.activeElement!==t){n.removeEventListener("selectionchange",i);return}if(r)return;const{start:h,end:g,text:z}=f(),y=d.current;if(z!==y.text){s();return}if(h===y.start&&g===y.end){y.text.length===0&&h===0&&uRe(o);return}const _={...y,start:h,end:g,activeFormats:y._newActiveFormats,_newActiveFormats:void 0},v=PB(_,nU);_.activeFormats=v,d.current=_,p(_,{domOnly:!0}),b(h,g)}function c(){r=!0,n.removeEventListener("selectionchange",i),t.querySelector(`[${F0e}]`)?.remove()}function l(){r=!1,s({inputType:"insertText"}),n.addEventListener("selectionchange",i)}function u(){const{record:d,isSelected:p,onSelectionChange:f,applyRecord:b}=e.current;t.parentElement.closest('[contenteditable="true"]')||(p?b(d.current,{domOnly:!0}):d.current={...d.current,start:void 0,end:void 0,activeFormats:nU},f(d.current.start,d.current.end),window.queueMicrotask(i),n.addEventListener("selectionchange",i))}return t.addEventListener("input",s),t.addEventListener("compositionstart",c),t.addEventListener("compositionend",l),t.addEventListener("focus",u),()=>{t.removeEventListener("input",s),t.removeEventListener("compositionstart",c),t.removeEventListener("compositionend",l),t.removeEventListener("focus",u)}},pRe=()=>e=>{const{ownerDocument:t}=e,{defaultView:n}=t,o=n?.getSelection();let r;function s(){return o.rangeCount?o.getRangeAt(0):null}function i(c){const l=c.type==="keydown"?"keyup":"pointerup";function u(){t.removeEventListener(l,d),t.removeEventListener("selectionchange",u),t.removeEventListener("input",u)}function d(){u(),!I0e(r,s())&&t.dispatchEvent(new Event("selectionchange"))}t.addEventListener(l,d),t.addEventListener("selectionchange",u),t.addEventListener("input",u),r=s()}return e.addEventListener("pointerdown",i),e.addEventListener("keydown",i),()=>{e.removeEventListener("pointerdown",i),e.removeEventListener("keydown",i)}};function fRe(){return e=>{const{ownerDocument:t}=e,{defaultView:n}=t;let o=null;function r(i){i.defaultPrevented||i.target!==e&&i.target.contains(e)&&(o=e.getAttribute("contenteditable"),e.setAttribute("contenteditable","false"),n.getSelection().removeAllRanges())}function s(){o!==null&&(e.setAttribute("contenteditable",o),o=null)}return n.addEventListener("pointerdown",r),n.addEventListener("pointerup",s),()=>{n.removeEventListener("pointerdown",r),n.removeEventListener("pointerup",s)}}}const bRe=[rRe,sRe,iRe,aRe,dRe,pRe,fRe];function hRe(e){const t=x.useRef(e);x.useInsertionEffect(()=>{t.current=e});const n=x.useMemo(()=>bRe.map(o=>o(t)),[t]);return Mn(o=>{const r=n.map(s=>s(o));return()=>{r.forEach(s=>s())}},[n])}function $0e({value:e="",selectionStart:t,selectionEnd:n,placeholder:o,onSelectionChange:r,preserveWhiteSpace:s,onChange:i,__unstableDisableFormats:c,__unstableIsSelected:l,__unstableDependencies:u=[],__unstableAfterParse:d,__unstableBeforeSerialize:p,__unstableAddInvisibleFormats:f}){const b=Fn(),[,h]=x.useReducer(()=>({})),g=x.useRef();function z(){const{ownerDocument:{defaultView:T}}=g.current,E=T.getSelection(),B=E.rangeCount>0?E.getRangeAt(0):null;return Zn({element:g.current,range:B,__unstableIsEditableTree:!0})}function y(T,{domOnly:E}={}){Hqe({value:T,current:g.current,prepareEditableTree:f,__unstableDomOnly:E,placeholder:o})}const _=x.useRef(e),v=x.useRef();function M(){_.current=e,v.current=e,e instanceof Ko||(v.current=e?Ko.fromHTMLString(e,{preserveWhiteSpace:s}):Ko.empty()),v.current={text:v.current.text,formats:v.current.formats,replacements:v.current.replacements},c&&(v.current.formats=Array(e.length),v.current.replacements=Array(e.length)),d&&(v.current.formats=d(v.current)),v.current.start=t,v.current.end=n}const A=x.useRef(!1);v.current?(t!==v.current.start||n!==v.current.end)&&(A.current=l,v.current={...v.current,start:t,end:n,activeFormats:void 0}):(A.current=l,M());function k(T){if(v.current=T,y(T),c)_.current=T.text;else{const I=p?p(T):T.formats;T={...T,formats:I},typeof e=="string"?_.current=E0({value:T,preserveWhiteSpace:s}):_.current=new Ko(T)}const{start:E,end:B,formats:N,text:j}=v.current;b.batch(()=>{r(E,B),i(_.current,{__unstableFormats:N,__unstableText:j})}),h()}function S(){M(),y(v.current)}const C=x.useRef(!1);x.useLayoutEffect(()=>{C.current&&e!==_.current&&(S(),h())},[e]),x.useLayoutEffect(()=>{A.current&&(g.current.ownerDocument.activeElement!==g.current&&g.current.focus(),y(v.current),A.current=!1)},[A.current]);const R=yn([g,nRe(),oRe({record:v}),hRe({record:v,handleChange:k,applyRecord:y,createRecord:z,isSelected:l,onSelectionChange:r,forceRender:h}),Mn(()=>{S(),C.current=!0},[o,...u])]);return{value:v.current,getValue:()=>v.current,onChange:k,ref:R}}const J0="id",mRe=["title","excerpt","content"],V0e=[{label:m("Base"),kind:"root",name:"__unstableBase",baseURL:"/",baseURLParams:{_fields:["description","gmt_offset","home","name","site_icon","site_icon_url","site_logo","timezone_string","url","page_for_posts","page_on_front","show_on_front"].join(",")},plural:"__unstableBases",syncConfig:{fetch:async()=>Vt({path:"/"}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach(([o,r])=>{n.get(o)!==r&&n.set(o,r)})},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/base",getSyncObjectId:()=>"index"},{label:m("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"},plural:"postTypes",syncConfig:{fetch:async e=>Vt({path:`/wp/v2/types/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach(([o,r])=>{n.get(o)!==r&&n.set(o,r)})},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/postType",getSyncObjectId:e=>e},{name:"media",kind:"root",baseURL:"/wp/v2/media",baseURLParams:{context:"edit"},plural:"mediaItems",label:m("Media"),rawAttributes:["caption","title","description"],supportsPagination:!0},{name:"taxonomy",kind:"root",key:"slug",baseURL:"/wp/v2/taxonomies",baseURLParams:{context:"edit"},plural:"taxonomies",label:m("Taxonomy")},{name:"sidebar",kind:"root",baseURL:"/wp/v2/sidebars",baseURLParams:{context:"edit"},plural:"sidebars",transientEdits:{blocks:!0},label:m("Widget areas")},{name:"widget",kind:"root",baseURL:"/wp/v2/widgets",baseURLParams:{context:"edit"},plural:"widgets",transientEdits:{blocks:!0},label:m("Widgets")},{name:"widgetType",kind:"root",baseURL:"/wp/v2/widget-types",baseURLParams:{context:"edit"},plural:"widgetTypes",label:m("Widget types")},{label:m("User"),name:"user",kind:"root",baseURL:"/wp/v2/users",baseURLParams:{context:"edit"},plural:"users"},{name:"comment",kind:"root",baseURL:"/wp/v2/comments",baseURLParams:{context:"edit"},plural:"comments",label:m("Comment")},{name:"menu",kind:"root",baseURL:"/wp/v2/menus",baseURLParams:{context:"edit"},plural:"menus",label:m("Menu")},{name:"menuItem",kind:"root",baseURL:"/wp/v2/menu-items",baseURLParams:{context:"edit"},plural:"menuItems",label:m("Menu Item"),rawAttributes:["title"]},{name:"menuLocation",kind:"root",baseURL:"/wp/v2/menu-locations",baseURLParams:{context:"edit"},plural:"menuLocations",label:m("Menu Location"),key:"name"},{label:m("Global Styles"),name:"globalStyles",kind:"root",baseURL:"/wp/v2/global-styles",baseURLParams:{context:"edit"},plural:"globalStylesVariations",getTitle:()=>m("Custom Styles"),getRevisionsUrl:(e,t)=>`/wp/v2/global-styles/${e}/revisions${t?"/"+t:""}`,supportsPagination:!0},{label:m("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},plural:"themes",key:"stylesheet"},{label:m("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},plural:"plugins",key:"plugin"},{label:m("Status"),name:"status",kind:"root",baseURL:"/wp/v2/statuses",baseURLParams:{context:"edit"},plural:"statuses",key:"slug"}],H0e=[{kind:"postType",loadEntities:zRe},{kind:"taxonomy",loadEntities:ORe},{kind:"root",name:"site",plural:"sites",loadEntities:yRe}],gRe=(e,t)=>{const n={};return e?.status==="auto-draft"&&(!t.status&&!n.status&&(n.status="draft"),(!t.title||t.title==="Auto Draft")&&!n.title&&(!e?.title||e?.title==="Auto Draft")&&(n.title="")),n},OS=new WeakMap;function MRe(e){const t={...e};for(const[n,o]of Object.entries(e))o instanceof Ko&&(t[n]=o.valueOf());return t}function U0e(e){return e.map(t=>{const{innerBlocks:n,attributes:o,...r}=t;return{...r,attributes:MRe(o),innerBlocks:U0e(n)}})}async function zRe(){const e=await Vt({path:"/wp/v2/types?context=view"});return Object.entries(e??{}).map(([t,n])=>{var o;const r=["wp_template","wp_template_part"].includes(t),s=(o=n?.rest_namespace)!==null&&o!==void 0?o:"wp/v2";return{kind:"postType",baseURL:`/${s}/${n.rest_base}`,baseURLParams:{context:"edit"},name:t,label:n.name,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:mRe,getTitle:i=>{var c;return i?.title?.rendered||i?.title||(r?Are((c=i.slug)!==null&&c!==void 0?c:""):String(i.id))},__unstablePrePersist:r?void 0:gRe,__unstable_rest_base:n.rest_base,syncConfig:{fetch:async i=>Vt({path:`/${s}/${n.rest_base}/${i}?context=edit`}),applyChangesToDoc:(i,c)=>{const l=i.getMap("document");Object.entries(c).forEach(([u,d])=>{typeof d!="function"&&(u==="blocks"&&(OS.has(d)||OS.set(d,U0e(d)),d=OS.get(d)),l.get(u)!==d&&l.set(u,d))})},fromCRDTDoc:i=>i.getMap("document").toJSON()},syncObjectType:"postType/"+n.name,getSyncObjectId:i=>i,supportsPagination:!0,getRevisionsUrl:(i,c)=>`/${s}/${n.rest_base}/${i}/revisions${c?"/"+c:""}`,revisionKey:r?"wp_id":J0}})}async function ORe(){const e=await Vt({path:"/wp/v2/taxonomies?context=view"});return Object.entries(e??{}).map(([t,n])=>{var o;return{kind:"taxonomy",baseURL:`/${(o=n?.rest_namespace)!==null&&o!==void 0?o:"wp/v2"}/${n.rest_base}`,baseURLParams:{context:"edit"},name:t,label:n.name}})}async function yRe(){var e;const t={label:m("Site"),name:"site",kind:"root",baseURL:"/wp/v2/settings",syncConfig:{fetch:async()=>Vt({path:"/wp/v2/settings"}),applyChangesToDoc:(r,s)=>{const i=r.getMap("document");Object.entries(s).forEach(([c,l])=>{i.get(c)!==l&&i.set(c,l)})},fromCRDTDoc:r=>r.getMap("document").toJSON()},syncObjectType:"root/site",getSyncObjectId:()=>"index",meta:{}},n=await Vt({path:t.baseURL,method:"OPTIONS"}),o={};return Object.entries((e=n?.schema?.properties)!==null&&e!==void 0?e:{}).forEach(([r,s])=>{typeof s=="object"&&s.title&&(o[r]=s.title)}),[{...t,meta:{labels:o}}]}const J2=(e,t,n="get")=>{const o=e==="root"?"":v4(e),r=v4(t);return`${n}${o}${r}`};function X0e(e){const{query:t}=e;return t?Dh(t).context:"default"}function ARe(e,t,n,o){var r;if(n===1&&o===-1)return t;const i=(n-1)*o,c=Math.max((r=e?.length)!==null&&r!==void 0?r:0,i+t.length),l=new Array(c);for(let u=0;u=i&&u!t.some(o=>Number.isInteger(o)?o===+n:o===n)))}function vRe(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=X0e(t),o=t.key||J0;return{...e,[n]:{...e[n],...t.items.reduce((r,s)=>{const i=s?.[o];return r[i]=yCe(e?.[n]?.[i],s),r},{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map(([n,o])=>[n,G0e(o,t.itemIds)]))}return e}function xRe(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=X0e(t),{query:o,key:r=J0}=t,s=o?Dh(o):{},i=!o||!Array.isArray(s.fields);return{...e,[n]:{...e[n],...t.items.reduce((c,l)=>{const u=l?.[r];return c[u]=e?.[n]?.[u]||i,c},{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map(([n,o])=>[n,G0e(o,t.itemIds)]))}return e}const wRe=ko([M0e(e=>"query"in e),z0e(e=>e.query?{...e,...Dh(e.query)}:e),DH("context"),DH("stableKey")])((e={},t)=>{const{type:n,page:o,perPage:r,key:s=J0}=t;return n!=="RECEIVE_ITEMS"?e:{itemIds:ARe(e?.itemIds||[],t.items.map(i=>i?.[s]).filter(Boolean),o,r),meta:t.meta}}),_Re=(e={},t)=>{switch(t.type){case"RECEIVE_ITEMS":return wRe(e,t);case"REMOVE_ITEMS":const n=t.itemIds.reduce((o,r)=>(o[r]=!0,o),{});return Object.fromEntries(Object.entries(e).map(([o,r])=>[o,Object.fromEntries(Object.entries(r).map(([s,i])=>[s,{...i,itemIds:i.itemIds.filter(c=>!n[c])}]))]));default:return e}},oU=Q0({items:vRe,itemIsComplete:xRe,queries:_Re});function kRe(e={},t){switch(t.type){case"RECEIVE_TERMS":return{...e,[t.taxonomy]:t.terms}}return e}function SRe(e={byId:{},queries:{}},t){switch(t.type){case"RECEIVE_USER_QUERY":return{byId:{...e.byId,...t.users.reduce((n,o)=>({...n,[o.id]:o}),{})},queries:{...e.queries,[t.queryID]:t.users.map(n=>n.id)}}}return e}function CRe(e={},t){switch(t.type){case"RECEIVE_CURRENT_USER":return t.currentUser}return e}function qRe(e=[],t){switch(t.type){case"RECEIVE_TAXONOMIES":return t.taxonomies}return e}function RRe(e=void 0,t){switch(t.type){case"RECEIVE_CURRENT_THEME":return t.currentTheme.stylesheet}return e}function TRe(e=void 0,t){switch(t.type){case"RECEIVE_CURRENT_GLOBAL_STYLES_ID":return t.id}return e}function ERe(e={},t){switch(t.type){case"RECEIVE_THEME_GLOBAL_STYLES":return{...e,[t.stylesheet]:t.globalStyles}}return e}function WRe(e={},t){switch(t.type){case"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS":return{...e,[t.stylesheet]:t.variations}}return e}const BRe=e=>(t,n)=>{if(n.type==="UNDO"||n.type==="REDO"){const{record:o}=n;let r=t;return o.forEach(({id:{kind:s,name:i,recordId:c},changes:l})=>{r=e(r,{type:"EDIT_ENTITY_RECORD",kind:s,name:i,recordId:c,edits:Object.entries(l).reduce((u,[d,p])=>(u[d]=n.type==="UNDO"?p.from:p.to,u),{})})}),r}return e(t,n)};function NRe(e){return ko([BRe,M0e(t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind),z0e(t=>({key:e.key||J0,...t}))])(Q0({queriedData:oU,edits:(t={},n)=>{var o;switch(n.type){case"RECEIVE_ITEMS":if(((o=n?.query?.context)!==null&&o!==void 0?o:"default")!=="default")return t;const s={...t};for(const c of n.items){const l=c?.[n.key],u=s[l];if(!u)continue;const d=Object.keys(u).reduce((p,f)=>{var b;return!N0(u[f],(b=c[f]?.raw)!==null&&b!==void 0?b:c[f])&&(!n.persistedEdits||!N0(u[f],n.persistedEdits[f]))&&(p[f]=u[f]),p},{});Object.keys(d).length?s[l]=d:delete s[l]}return s;case"EDIT_ENTITY_RECORD":const i={...t[n.recordId],...n.edits};return Object.keys(i).forEach(c=>{i[c]===void 0&&delete i[c]}),{...t,[n.recordId]:i}}return t},saving:(t={},n)=>{switch(n.type){case"SAVE_ENTITY_RECORD_START":case"SAVE_ENTITY_RECORD_FINISH":return{...t,[n.recordId]:{pending:n.type==="SAVE_ENTITY_RECORD_START",error:n.error,isAutosave:n.isAutosave}}}return t},deleting:(t={},n)=>{switch(n.type){case"DELETE_ENTITY_RECORD_START":case"DELETE_ENTITY_RECORD_FINISH":return{...t,[n.recordId]:{pending:n.type==="DELETE_ENTITY_RECORD_START",error:n.error}}}return t},revisions:(t={},n)=>{if(n.type==="RECEIVE_ITEM_REVISIONS"){const o=n.recordKey;delete n.recordKey;const r=oU(t[o],{...n,type:"RECEIVE_ITEMS"});return{...t,[o]:r}}return n.type==="REMOVE_ITEMS"?Object.fromEntries(Object.entries(t).filter(([o])=>!n.itemIds.some(r=>Number.isInteger(r)?r===+o:r===o))):t}}))}function LRe(e=V0e,t){switch(t.type){case"ADD_ENTITIES":return[...e,...t.entities]}return e}const PRe=(e={},t)=>{const n=LRe(e.config,t);let o=e.reducer;if(!o||n!==e.config){const s=n.reduce((i,c)=>{const{kind:l}=c;return i[l]||(i[l]=[]),i[l].push(c),i},{});o=Q0(Object.entries(s).reduce((i,[c,l])=>{const u=Q0(l.reduce((d,p)=>({...d,[p.name]:NRe(p)}),{}));return i[c]=u,i},{}))}const r=o(e.records,t);return r===e.records&&n===e.config&&o===e.reducer?e:{reducer:o,records:r,config:n}};function jRe(e=cSe()){return e}function IRe(e={},t){switch(t.type){case"EDIT_ENTITY_RECORD":case"UNDO":case"REDO":return{}}return e}function DRe(e={},t){switch(t.type){case"RECEIVE_EMBED_PREVIEW":const{url:n,preview:o}=t;return{...e,[n]:o}}return e}function FRe(e={},t){switch(t.type){case"RECEIVE_USER_PERMISSION":return{...e,[t.key]:t.isAllowed};case"RECEIVE_USER_PERMISSIONS":return{...e,...t.permissions}}return e}function $Re(e={},t){switch(t.type){case"RECEIVE_AUTOSAVES":const{postId:n,autosaves:o}=t;return{...e,[n]:o}}return e}function VRe(e=[],t){switch(t.type){case"RECEIVE_BLOCK_PATTERNS":return t.patterns}return e}function HRe(e=[],t){switch(t.type){case"RECEIVE_BLOCK_PATTERN_CATEGORIES":return t.categories}return e}function URe(e=[],t){switch(t.type){case"RECEIVE_USER_PATTERN_CATEGORIES":return t.patternCategories}return e}function XRe(e=null,t){switch(t.type){case"RECEIVE_NAVIGATION_FALLBACK_ID":return t.fallbackId}return e}function GRe(e={},t){switch(t.type){case"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS":return{...e,[t.currentId]:t.revisions}}return e}function KRe(e={},t){switch(t.type){case"RECEIVE_DEFAULT_TEMPLATE":return{...e,[JSON.stringify(t.query)]:t.templateId}}return e}function YRe(e={},t){switch(t.type){case"RECEIVE_REGISTERED_POST_META":return{...e,[t.postType]:t.registeredPostMeta}}return e}const ZRe=Q0({terms:kRe,users:SRe,currentTheme:RRe,currentGlobalStylesId:TRe,currentUser:CRe,themeGlobalStyleVariations:WRe,themeBaseGlobalStyles:ERe,themeGlobalStyleRevisions:GRe,taxonomies:qRe,entities:PRe,editsReference:IRe,undoManager:jRe,embedPreviews:DRe,userPermissions:FRe,autosaves:$Re,blockPatterns:VRe,blockPatternCategories:HRe,userPatternCategories:URe,navigationFallbackId:XRe,defaultTemplates:KRe,registeredPostMeta:YRe}),Xo="core",QRe={},JRe=At(e=>(t,n)=>e(Xo).isResolving("getEmbedPreview",[n]));function eTe(e,t){Ze("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const n=en("/wp/v2/users/?who=authors&per_page=100",t);return K0e(e,n)}function tTe(e){return e.currentUser}const K0e=Pt((e,t)=>{var n;return((n=e.users.queries[t])!==null&&n!==void 0?n:[]).map(r=>e.users.byId[r])},(e,t)=>[e.users.queries[t],e.users.byId]);function nTe(e,t){return Ze("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),Y0e(e,t)}const Y0e=Pt((e,t)=>e.entities.config.filter(n=>n.kind===t),(e,t)=>e.entities.config);function oTe(e,t,n){return Ze("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),$h(e,t,n)}function $h(e,t,n){return e.entities.config?.find(o=>o.kind===t&&o.name===n)}const op=Pt((e,t,n,o,r)=>{var s;const i=e.entities.records?.[t]?.[n]?.queriedData;if(!i)return;const c=(s=r?.context)!==null&&s!==void 0?s:"default";if(r===void 0)return i.itemIsComplete[c]?.[o]?i.items[c][o]:void 0;const l=i.items[c]?.[o];if(l&&r._fields){var u;const d={},p=(u=xd(r._fields))!==null&&u!==void 0?u:[];for(let f=0;f{h=h?.[g]}),_5(d,b,h)}return d}return l},(e,t,n,o,r)=>{var s;const i=(s=r?.context)!==null&&s!==void 0?s:"default";return[e.entities.records?.[t]?.[n]?.queriedData?.items[i]?.[o],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[i]?.[o]]});op.__unstableNormalizeArgs=e=>{const t=[...e],n=t?.[2];return t[2]=wCe(n)?Number(n):n,t};function rTe(e,t,n,o){return op(e,t,n,o)}const Z0e=Pt((e,t,n,o)=>{const r=op(e,t,n,o);return r&&Object.keys(r).reduce((s,i)=>(vCe($h(e,t,n),i)?s[i]=r[i]?.raw!==void 0?r[i]?.raw:r[i]:s[i]=r[i],s),{})},(e,t,n,o,r)=>{var s;const i=(s=r?.context)!==null&&s!==void 0?s:"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData?.items[i]?.[o],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[i]?.[o]]});function sTe(e,t,n,o){return Array.isArray(DB(e,t,n,o))}const DB=(e,t,n,o)=>{const r=e.entities.records?.[t]?.[n]?.queriedData;return r?x0e(r,o):null},iTe=(e,t,n,o)=>{const r=e.entities.records?.[t]?.[n]?.queriedData;return r?w0e(r,o):null},aTe=(e,t,n,o)=>{const r=e.entities.records?.[t]?.[n]?.queriedData;if(!r)return null;if(o.per_page===-1)return 1;const s=w0e(r,o);return s&&(o.per_page?Math.ceil(s/o.per_page):DCe(r,o))},cTe=Pt(e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach(o=>{Object.keys(t[o]).forEach(r=>{const s=Object.keys(t[o][r].edits).filter(i=>op(e,o,r,i)&&J0e(e,o,r,i));if(s.length){const i=$h(e,o,r);s.forEach(c=>{const l=$B(e,o,r,c);n.push({key:l?l[i.key||J0]:void 0,title:i?.getTitle?.(l)||"",name:r,kind:o})})}})}),n},e=>[e.entities.records]),lTe=Pt(e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach(o=>{Object.keys(t[o]).forEach(r=>{const s=Object.keys(t[o][r].saving).filter(i=>VB(e,o,r,i));if(s.length){const i=$h(e,o,r);s.forEach(c=>{const l=$B(e,o,r,c);n.push({key:l?l[i.key||J0]:void 0,title:i?.getTitle?.(l)||"",name:r,kind:o})})}})}),n},e=>[e.entities.records]);function FB(e,t,n,o){return e.entities.records?.[t]?.[n]?.edits?.[o]}const Q0e=Pt((e,t,n,o)=>{const{transientEdits:r}=$h(e,t,n)||{},s=FB(e,t,n,o)||{};return r?Object.keys(s).reduce((i,c)=>(r[c]||(i[c]=s[c]),i),{}):s},(e,t,n,o)=>[e.entities.config,e.entities.records?.[t]?.[n]?.edits?.[o]]);function J0e(e,t,n,o){return VB(e,t,n,o)||Object.keys(Q0e(e,t,n,o)).length>0}const $B=Pt((e,t,n,o)=>{const r=Z0e(e,t,n,o),s=FB(e,t,n,o);return!r&&!s?!1:{...r,...s}},(e,t,n,o,r)=>{var s;const i=(s=r?.context)!==null&&s!==void 0?s:"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData.items[i]?.[o],e.entities.records?.[t]?.[n]?.queriedData.itemIsComplete[i]?.[o],e.entities.records?.[t]?.[n]?.edits?.[o]]});function uTe(e,t,n,o){var r;const{pending:s,isAutosave:i}=(r=e.entities.records?.[t]?.[n]?.saving?.[o])!==null&&r!==void 0?r:{};return!!(s&&i)}function VB(e,t,n,o){var r;return(r=e.entities.records?.[t]?.[n]?.saving?.[o]?.pending)!==null&&r!==void 0?r:!1}function dTe(e,t,n,o){var r;return(r=e.entities.records?.[t]?.[n]?.deleting?.[o]?.pending)!==null&&r!==void 0?r:!1}function pTe(e,t,n,o){return e.entities.records?.[t]?.[n]?.saving?.[o]?.error}function fTe(e,t,n,o){return e.entities.records?.[t]?.[n]?.deleting?.[o]?.error}function bTe(e){Ze("select( 'core' ).getUndoEdit()",{since:"6.3"})}function hTe(e){Ze("select( 'core' ).getRedoEdit()",{since:"6.3"})}function mTe(e){return e.undoManager.hasUndo()}function gTe(e){return e.undoManager.hasRedo()}function q5(e){return e.currentTheme?op(e,"root","theme",e.currentTheme):null}function e1e(e){return e.currentGlobalStylesId}function MTe(e){var t;return(t=q5(e)?.theme_supports)!==null&&t!==void 0?t:QRe}function zTe(e,t){return e.embedPreviews[t]}function OTe(e,t){const n=e.embedPreviews[t],o=''+t+"";return n?n.html===o:!1}function t1e(e,t,n,o){if(typeof n=="object"&&(!n.kind||!n.name))return!1;const s=k5(t,n,o);return e.userPermissions[s]}function yTe(e,t,n,o){return Ze("wp.data.select( 'core' ).canUserEditEntityRecord()",{since:"6.7",alternative:"wp.data.select( 'core' ).canUser( 'update', { kind, name, id } )"}),t1e(e,"update",{kind:t,name:n,id:o})}function ATe(e,t,n){return e.autosaves[n]}function vTe(e,t,n,o){return o===void 0?void 0:e.autosaves[n]?.find(s=>s.author===o)}const xTe=At(e=>(t,n,o)=>e(Xo).hasFinishedResolution("getAutosaves",[n,o]));function wTe(e){return e.editsReference}function _Te(e){const t=q5(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}function kTe(e){const t=q5(e);return t?e.themeGlobalStyleVariations[t.stylesheet]:null}function STe(e){return e.blockPatterns}function CTe(e){return e.blockPatternCategories}function qTe(e){return e.userPatternCategories}function RTe(e){Ze("select( 'core' ).getCurrentThemeGlobalStylesRevisions()",{since:"6.5.0",alternative:"select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )"});const t=e1e(e);return t?e.themeGlobalStyleRevisions[t]:null}function n1e(e,t){return e.defaultTemplates[JSON.stringify(t)]}const TTe=(e,t,n,o,r)=>{const s=e.entities.records?.[t]?.[n]?.revisions?.[o];return s?x0e(s,r):null},ETe=Pt((e,t,n,o,r,s)=>{var i;const c=e.entities.records?.[t]?.[n]?.revisions?.[o];if(!c)return;const l=(i=s?.context)!==null&&i!==void 0?i:"default";if(s===void 0)return c.itemIsComplete[l]?.[r]?c.items[l][r]:void 0;const u=c.items[l]?.[r];if(u&&s._fields){var d;const p={},f=(d=xd(s._fields))!==null&&d!==void 0?d:[];for(let b=0;b{g=g?.[z]}),_5(p,h,g)}return p}return u},(e,t,n,o,r,s)=>{var i;const c=(i=s?.context)!==null&&i!==void 0?i:"default";return[e.entities.records?.[t]?.[n]?.revisions?.[o]?.items?.[c]?.[r],e.entities.records?.[t]?.[n]?.revisions?.[o]?.itemIsComplete?.[c]?.[r]]}),WTe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalGetCurrentGlobalStylesId:e1e,__experimentalGetCurrentThemeBaseGlobalStyles:_Te,__experimentalGetCurrentThemeGlobalStylesVariations:kTe,__experimentalGetDirtyEntityRecords:cTe,__experimentalGetEntitiesBeingSaved:lTe,__experimentalGetEntityRecordNoResolver:rTe,canUser:t1e,canUserEditEntityRecord:yTe,getAuthors:eTe,getAutosave:vTe,getAutosaves:ATe,getBlockPatternCategories:CTe,getBlockPatterns:STe,getCurrentTheme:q5,getCurrentThemeGlobalStylesRevisions:RTe,getCurrentUser:tTe,getDefaultTemplateId:n1e,getEditedEntityRecord:$B,getEmbedPreview:zTe,getEntitiesByKind:nTe,getEntitiesConfig:Y0e,getEntity:oTe,getEntityConfig:$h,getEntityRecord:op,getEntityRecordEdits:FB,getEntityRecordNonTransientEdits:Q0e,getEntityRecords:DB,getEntityRecordsTotalItems:iTe,getEntityRecordsTotalPages:aTe,getLastEntityDeleteError:fTe,getLastEntitySaveError:pTe,getRawEntityRecord:Z0e,getRedoEdit:hTe,getReferenceByDistinctEdits:wTe,getRevision:ETe,getRevisions:TTe,getThemeSupports:MTe,getUndoEdit:bTe,getUserPatternCategories:qTe,getUserQueryResults:K0e,hasEditsForEntityRecord:J0e,hasEntityRecords:sTe,hasFetchedAutosaves:xTe,hasRedo:gTe,hasUndo:mTe,isAutosavingEntityRecord:uTe,isDeletingEntityRecord:dTe,isPreviewEmbedFallback:OTe,isRequestingEmbedPreview:JRe,isSavingEntityRecord:VB},Symbol.toStringTag,{value:"Module"})),{lock:BTe,unlock:eh}=L0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/core-data");function NTe(e){return e.undoManager}function LTe(e){return e.navigationFallbackId}const PTe=At(e=>Pt((t,n)=>e(Xo).getBlockPatterns().filter(({postTypes:o})=>!o||Array.isArray(o)&&o.includes(n)),()=>[e(Xo).getBlockPatterns()])),o1e=At(e=>Pt((t,n,o,r)=>(Array.isArray(r)?r:[r]).map(i=>({delete:e(Xo).canUser("delete",{kind:n,name:o,id:i}),update:e(Xo).canUser("update",{kind:n,name:o,id:i})})),t=>[t.userPermissions]));function jTe(e,t,n,o){return o1e(e,t,n,o)[0]}function ITe(e,t){var n;return(n=e.registeredPostMeta?.[t])!==null&&n!==void 0?n:{}}function r1e(e){return!e||!["number","string"].includes(typeof e)||Number(e)===0?null:e.toString()}const DTe=At(e=>Pt(()=>{const t=e(Xo).getEntityRecord("root","__unstableBase");if(!t)return null;const n=t?.show_on_front==="page"?r1e(t.page_on_front):null;return n?{postType:"page",postId:n}:{postType:"wp_template",postId:e(Xo).getDefaultTemplateId({slug:"front-page"})}},t=>[op(t,"root","__unstableBase"),n1e(t,{slug:"front-page"})])),FTe=At(e=>()=>{const t=e(Xo).getEntityRecord("root","__unstableBase");return t?.show_on_front==="page"?r1e(t.page_for_posts):null}),$Te=At(e=>(t,n,o)=>{const r=eh(e(Xo)).getHomePage();if(!r)return;if(n==="page"&&n===r?.postType&&o.toString()===r?.postId){const u=e(Xo).getEntityRecords("postType","wp_template",{per_page:-1});if(!u)return;const d=u.find(({slug:p})=>p==="front-page")?.id;if(d)return d}const s=e(Xo).getEditedEntityRecord("postType",n,o);if(!s)return;const i=eh(e(Xo)).getPostsPageId();if(n==="page"&&i===o.toString())return e(Xo).getDefaultTemplateId({slug:"home"});const c=s.template;if(c){const u=e(Xo).getEntityRecords("postType","wp_template",{per_page:-1})?.find(({slug:d})=>d===c);if(u)return u.id}let l;return s.slug?l=n==="page"?`${n}-${s.slug}`:`single-${n}-${s.slug}`:l=n==="page"?"page":`single-${n}`,e(Xo).getDefaultTemplateId({slug:l})}),VTe=Object.freeze(Object.defineProperty({__proto__:null,getBlockPatternsForPostType:PTe,getEntityRecordPermissions:jTe,getEntityRecordsPermissions:o1e,getHomePage:DTe,getNavigationFallbackId:LTe,getPostsPageId:FTe,getRegisteredPostMeta:ITe,getTemplateId:$Te,getUndoManager:NTe},Symbol.toStringTag,{value:"Module"}));let dA;const HTe=new Uint8Array(16);function UTe(){if(!dA&&(dA=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!dA))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return dA(HTe)}const F0=[];for(let e=0;e<256;++e)F0.push((e+256).toString(16).slice(1));function XTe(e,t=0){return F0[e[t+0]]+F0[e[t+1]]+F0[e[t+2]]+F0[e[t+3]]+"-"+F0[e[t+4]]+F0[e[t+5]]+"-"+F0[e[t+6]]+F0[e[t+7]]+"-"+F0[e[t+8]]+F0[e[t+9]]+"-"+F0[e[t+10]]+F0[e[t+11]]+F0[e[t+12]]+F0[e[t+13]]+F0[e[t+14]]+F0[e[t+15]]}const GTe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),rU={randomUUID:GTe};function Fs(e,t,n){if(rU.randomUUID&&!e)return rU.randomUUID();e=e||{};const o=e.random||(e.rng||UTe)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,XTe(o)}let yS=null;function KTe(e,t){const n=[...e],o=[];for(;n.length;)o.push(n.splice(0,t));return o}async function YTe(e){yS===null&&(yS=(await Vt({path:"/batch/v1",method:"OPTIONS"})).endpoints[0].args.requests.maxItems);const t=[];for(const n of KTe(e,yS)){const o=await Vt({path:"/batch/v1",method:"POST",data:{validation:"require-all-validate",requests:n.map(s=>({path:s.path,body:s.data,method:s.method,headers:s.headers}))}});let r;o.failed?r=o.responses.map(s=>({error:s?.body})):r=o.responses.map(s=>{const i={};return s.status>=200&&s.status<300?i.output=s.body:i.error=s.body,i}),t.push(...r)}return t}function ZTe(e=YTe){let t=0,n=[];const o=new QTe;return{add(r){const s=++t;o.add(s);const i=c=>new Promise((l,u)=>{n.push({input:c,resolve:l,reject:u}),o.delete(s)});return typeof r=="function"?Promise.resolve(r(i)).finally(()=>{o.delete(s)}):i(r)},async run(){o.size&&await new Promise(i=>{const c=o.subscribe(()=>{o.size||(c(),i(void 0))})});let r;try{if(r=await e(n.map(({input:i})=>i)),r.length!==n.length)throw new Error("run: Array returned by processor must be same size as input array.")}catch(i){for(const{reject:c}of n)c(i);throw i}let s=!0;return r.forEach((i,c)=>{const l=n[c];if(i?.error)l?.reject(i.error),s=!1;else{var u;l?.resolve((u=i?.output)!==null&&u!==void 0?u:i)}}),n=[],s}}}class QTe{constructor(...t){this.set=new Set(...t),this.subscribers=new Set}get size(){return this.set.size}add(t){return this.set.add(t),this.subscribers.forEach(n=>n()),this}delete(t){const n=this.set.delete(t);return this.subscribers.forEach(o=>o()),n}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}}const sU=globalThis||void 0||self,us=()=>new Map,M8=e=>{const t=us();return e.forEach((n,o)=>{t.set(o,n)}),t},x1=(e,t,n)=>{let o=e.get(t);return o===void 0&&e.set(t,o=n()),o},JTe=(e,t)=>{const n=[];for(const[o,r]of e)n.push(t(r,o));return n},e8e=(e,t)=>{for(const[n,o]of e)if(t(o,n))return!0;return!1},wd=()=>new Set,AS=e=>e[e.length-1],t8e=(e,t)=>{for(let n=0;n{this.off(t,o),n(...r)};this.on(t,o)}off(t,n){const o=this._observers.get(t);o!==void 0&&(o.delete(n),o.size===0&&this._observers.delete(t))}emit(t,n){return El((this._observers.get(t)||us()).values()).forEach(o=>o(...n))}destroy(){this._observers=us()}}class h3{constructor(){this._observers=us()}on(t,n){x1(this._observers,t,wd).add(n)}once(t,n){const o=(...r)=>{this.off(t,o),n(...r)};this.on(t,o)}off(t,n){const o=this._observers.get(t);o!==void 0&&(o.delete(n),o.size===0&&this._observers.delete(t))}emit(t,n){return El((this._observers.get(t)||us()).values()).forEach(o=>o(...n))}destroy(){this._observers=us()}}const Ac=Math.floor,Wv=Math.abs,r8e=Math.log10,HB=(e,t)=>ee>t?e:t,s1e=e=>e!==0?e<0:1/e<0,iU=1,aU=2,vS=4,xS=8,XM=32,Al=64,Ls=128,R5=31,z8=63,nf=127,s8e=2147483647,i1e=Number.MAX_SAFE_INTEGER,i8e=Number.isInteger||(e=>typeof e=="number"&&isFinite(e)&&Ac(e)===e),a8e=String.fromCharCode,c8e=e=>e.toLowerCase(),l8e=/^\s*/g,u8e=e=>e.replace(l8e,""),d8e=/([A-Z])/g,cU=(e,t)=>u8e(e.replace(d8e,n=>`${t}${c8e(n)}`)),p8e=e=>{const t=unescape(encodeURIComponent(e)),n=t.length,o=new Uint8Array(n);for(let r=0;rGM.encode(e),O8=GM?f8e:p8e;let AM=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});AM&&AM.decode(new Uint8Array).length===1&&(AM=null);class m3{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const k0=()=>new m3,b8e=e=>{let t=e.cpos;for(let n=0;n{const t=new Uint8Array(b8e(e));let n=0;for(let o=0;o{const n=e.cbuf.length;n-e.cpos{const n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},KM=x0,rn=(e,t)=>{for(;t>nf;)x0(e,Ls|nf&t),t=Ac(t/128);x0(e,nf&t)},UB=(e,t)=>{const n=s1e(t);for(n&&(t=-t),x0(e,(t>z8?Ls:0)|(n?Al:0)|z8&t),t=Ac(t/64);t>0;)x0(e,(t>nf?Ls:0)|nf&t),t=Ac(t/128)},y8=new Uint8Array(3e4),m8e=y8.length/3,g8e=(e,t)=>{if(t.length{const n=unescape(encodeURIComponent(t)),o=n.length;rn(e,o);for(let r=0;r{const n=e.cbuf.length,o=e.cpos,r=HB(n-o,t.length),s=t.length-r;e.cbuf.set(t.subarray(0,r),o),e.cpos+=r,s>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array($f(n*2,s)),e.cbuf.set(t.subarray(r)),e.cpos=s)},Lr=(e,t)=>{rn(e,t.byteLength),T5(e,t)},XB=(e,t)=>{h8e(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},z8e=(e,t)=>XB(e,4).setFloat32(0,t,!1),O8e=(e,t)=>XB(e,8).setFloat64(0,t,!1),y8e=(e,t)=>XB(e,8).setBigInt64(0,t,!1),lU=new DataView(new ArrayBuffer(4)),A8e=e=>(lU.setFloat32(0,e),lU.getFloat32(0)===e),th=(e,t)=>{switch(typeof t){case"string":x0(e,119),pc(e,t);break;case"number":i8e(t)&&Wv(t)<=s8e?(x0(e,125),UB(e,t)):A8e(t)?(x0(e,124),z8e(e,t)):(x0(e,123),O8e(e,t));break;case"bigint":x0(e,122),y8e(e,t);break;case"object":if(t===null)x0(e,126);else if(n8e(t)){x0(e,117),rn(e,t.length);for(let n=0;n0&&rn(this,this.count-1),this.count=1,this.w(this,t),this.s=t)}}const dU=e=>{e.count>0&&(UB(e.encoder,e.count===1?e.s:-e.s),e.count>1&&rn(e.encoder,e.count-2))};class Bv{constructor(){this.encoder=new m3,this.s=0,this.count=0}write(t){this.s===t?this.count++:(dU(this),this.count=1,this.s=t)}toUint8Array(){return dU(this),kr(this.encoder)}}const pU=e=>{if(e.count>0){const t=e.diff*2+(e.count===1?0:1);UB(e.encoder,t),e.count>1&&rn(e.encoder,e.count-2)}};class wS{constructor(){this.encoder=new m3,this.s=0,this.count=0,this.diff=0}write(t){this.diff===t-this.s?(this.s=t,this.count++):(pU(this),this.count=1,this.diff=t-this.s,this.s=t)}toUint8Array(){return pU(this),kr(this.encoder)}}class v8e{constructor(){this.sarr=[],this.s="",this.lensE=new Bv}write(t){this.s+=t,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(t.length)}toUint8Array(){const t=new m3;return this.sarr.push(this.s),this.s="",pc(t,this.sarr.join("")),T5(t,this.lensE.toUint8Array()),kr(t)}}const ha=e=>new Error(e),fc=()=>{throw ha("Method unimplemented")},vc=()=>{throw ha("Unexpected case")},a1e=ha("Unexpected end of array"),c1e=ha("Integer out of Range");class E5{constructor(t){this.arr=t,this.pos=0}}const Tc=e=>new E5(e),x8e=e=>e.pos!==e.arr.length,w8e=(e,t)=>{const n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},w0=e=>w8e(e,_n(e)),hf=e=>e.arr[e.pos++],_n=e=>{let t=0,n=1;const o=e.arr.length;for(;e.posi1e)throw c1e}throw a1e},GB=e=>{let t=e.arr[e.pos++],n=t&z8,o=64;const r=(t&Al)>0?-1:1;if((t&Ls)===0)return r*n;const s=e.arr.length;for(;e.posi1e)throw c1e}throw a1e},_8e=e=>{let t=_n(e);if(t===0)return"";{let n=String.fromCodePoint(hf(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(hf(e));else for(;t>0;){const o=t<1e4?t:1e4,r=e.arr.subarray(e.pos,e.pos+o);e.pos+=o,n+=String.fromCodePoint.apply(null,r),t-=o}return decodeURIComponent(escape(n))}},k8e=e=>AM.decode(w0(e)),vl=AM?k8e:_8e,KB=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},S8e=e=>KB(e,4).getFloat32(0,!1),C8e=e=>KB(e,8).getFloat64(0,!1),q8e=e=>KB(e,8).getBigInt64(0,!1),R8e=[e=>{},e=>null,GB,S8e,C8e,q8e,e=>!1,e=>!0,vl,e=>{const t=_n(e),n={};for(let o=0;o{const t=_n(e),n=[];for(let o=0;oR8e[127-hf(e)](e);class fU extends E5{constructor(t,n){super(t),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),x8e(this)?this.count=_n(this)+1:this.count=-1),this.count--,this.s}}class Nv extends E5{constructor(t){super(t),this.s=0,this.count=0}read(){if(this.count===0){this.s=GB(this);const t=s1e(this.s);this.count=1,t&&(this.s=-this.s,this.count=_n(this)+2)}return this.count--,this.s}}class _S extends E5{constructor(t){super(t),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const t=GB(this),n=t&1;this.diff=Ac(t/2),this.count=1,n&&(this.count=_n(this)+2)}return this.s+=this.diff,this.count--,this.s}}class T8e{constructor(t){this.decoder=new Nv(t),this.str=vl(this.decoder),this.spos=0}read(){const t=this.spos+this.decoder.read(),n=this.str.slice(this.spos,t);return this.spos=t,n}}const E8e=crypto.getRandomValues.bind(crypto),W8e=Math.random,l1e=()=>E8e(new Uint32Array(1))[0],B8e="10000000-1000-4000-8000"+-1e11,u1e=()=>B8e.replace(/[018]/g,e=>(e^l1e()&15>>e/4).toString(16)),Wl=Date.now,oh=e=>new Promise(e);Promise.all.bind(Promise);const N8e=e=>Promise.reject(e),YB=e=>Promise.resolve(e);var d1e={},W5={};W5.byteLength=j8e;W5.toByteArray=D8e;W5.fromByteArray=V8e;var ic=[],bi=[],L8e=typeof Uint8Array<"u"?Uint8Array:Array,kS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Fb=0,P8e=kS.length;Fb0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var o=n===t?0:4-n%4;return[n,o]}function j8e(e){var t=p1e(e),n=t[0],o=t[1];return(n+o)*3/4-o}function I8e(e,t,n){return(t+n)*3/4-n}function D8e(e){var t,n=p1e(e),o=n[0],r=n[1],s=new L8e(I8e(e,o,r)),i=0,c=r>0?o-4:o,l;for(l=0;l>16&255,s[i++]=t>>8&255,s[i++]=t&255;return r===2&&(t=bi[e.charCodeAt(l)]<<2|bi[e.charCodeAt(l+1)]>>4,s[i++]=t&255),r===1&&(t=bi[e.charCodeAt(l)]<<10|bi[e.charCodeAt(l+1)]<<4|bi[e.charCodeAt(l+2)]>>2,s[i++]=t>>8&255,s[i++]=t&255),s}function F8e(e){return ic[e>>18&63]+ic[e>>12&63]+ic[e>>6&63]+ic[e&63]}function $8e(e,t,n){for(var o,r=[],s=t;sc?c:i+s));return o===1?(t=e[n-1],r.push(ic[t>>2]+ic[t<<4&63]+"==")):o===2&&(t=(e[n-2]<<8)+e[n-1],r.push(ic[t>>10]+ic[t>>4&63]+ic[t<<2&63]+"=")),r.join("")}var ZB={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ZB.read=function(e,t,n,o,r){var s,i,c=r*8-o-1,l=(1<>1,d=-7,p=n?r-1:0,f=n?-1:1,b=e[t+p];for(p+=f,s=b&(1<<-d)-1,b>>=-d,d+=c;d>0;s=s*256+e[t+p],p+=f,d-=8);for(i=s&(1<<-d)-1,s>>=-d,d+=o;d>0;i=i*256+e[t+p],p+=f,d-=8);if(s===0)s=1-u;else{if(s===l)return i?NaN:(b?-1:1)*(1/0);i=i+Math.pow(2,o),s=s-u}return(b?-1:1)*i*Math.pow(2,s-o)};ZB.write=function(e,t,n,o,r,s){var i,c,l,u=s*8-r-1,d=(1<>1,f=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=o?0:s-1,h=o?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,i=d):(i=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-i))<1&&(i--,l*=2),i+p>=1?t+=f/l:t+=f*Math.pow(2,1-p),t*l>=2&&(i++,l/=2),i+p>=d?(c=0,i=d):i+p>=1?(c=(t*l-1)*Math.pow(2,r),i=i+p):(c=t*Math.pow(2,p-1)*Math.pow(2,r),i=0));r>=8;e[n+b]=c&255,b+=h,c/=256,r-=8);for(i=i<0;e[n+b]=i&255,b+=h,i/=256,u-=8);e[n+b-h]|=g*128};/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */(function(e){const t=W5,n=ZB,o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=d,e.SlowBuffer=A,e.INSPECT_MAX_BYTES=50;const r=2147483647;e.kMaxLength=r;const{Uint8Array:s,ArrayBuffer:i,SharedArrayBuffer:c}=globalThis;d.TYPED_ARRAY_SUPPORT=l(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{const ce=new s(1),H={foo:function(){return 42}};return Object.setPrototypeOf(H,s.prototype),Object.setPrototypeOf(ce,H),ce.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function u(ce){if(ce>r)throw new RangeError('The value "'+ce+'" is invalid for option "size"');const H=new s(ce);return Object.setPrototypeOf(H,d.prototype),H}function d(ce,H,Y){if(typeof ce=="number"){if(typeof H=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(ce)}return p(ce,H,Y)}d.poolSize=8192;function p(ce,H,Y){if(typeof ce=="string")return g(ce,H);if(i.isView(ce))return y(ce);if(ce==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ce);if(Pe(ce,i)||ce&&Pe(ce.buffer,i)||typeof c<"u"&&(Pe(ce,c)||ce&&Pe(ce.buffer,c)))return _(ce,H,Y);if(typeof ce=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const me=ce.valueOf&&ce.valueOf();if(me!=null&&me!==ce)return d.from(me,H,Y);const Se=v(ce);if(Se)return Se;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ce[Symbol.toPrimitive]=="function")return d.from(ce[Symbol.toPrimitive]("string"),H,Y);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ce)}d.from=function(ce,H,Y){return p(ce,H,Y)},Object.setPrototypeOf(d.prototype,s.prototype),Object.setPrototypeOf(d,s);function f(ce){if(typeof ce!="number")throw new TypeError('"size" argument must be of type number');if(ce<0)throw new RangeError('The value "'+ce+'" is invalid for option "size"')}function b(ce,H,Y){return f(ce),ce<=0?u(ce):H!==void 0?typeof Y=="string"?u(ce).fill(H,Y):u(ce).fill(H):u(ce)}d.alloc=function(ce,H,Y){return b(ce,H,Y)};function h(ce){return f(ce),u(ce<0?0:M(ce)|0)}d.allocUnsafe=function(ce){return h(ce)},d.allocUnsafeSlow=function(ce){return h(ce)};function g(ce,H){if((typeof H!="string"||H==="")&&(H="utf8"),!d.isEncoding(H))throw new TypeError("Unknown encoding: "+H);const Y=k(ce,H)|0;let me=u(Y);const Se=me.write(ce,H);return Se!==Y&&(me=me.slice(0,Se)),me}function z(ce){const H=ce.length<0?0:M(ce.length)|0,Y=u(H);for(let me=0;me=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return ce|0}function A(ce){return+ce!=ce&&(ce=0),d.alloc(+ce)}d.isBuffer=function(H){return H!=null&&H._isBuffer===!0&&H!==d.prototype},d.compare=function(H,Y){if(Pe(H,s)&&(H=d.from(H,H.offset,H.byteLength)),Pe(Y,s)&&(Y=d.from(Y,Y.offset,Y.byteLength)),!d.isBuffer(H)||!d.isBuffer(Y))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(H===Y)return 0;let me=H.length,Se=Y.length;for(let fe=0,Oe=Math.min(me,Se);feSe.length?(d.isBuffer(Oe)||(Oe=d.from(Oe)),Oe.copy(Se,fe)):s.prototype.set.call(Se,Oe,fe);else if(d.isBuffer(Oe))Oe.copy(Se,fe);else throw new TypeError('"list" argument must be an Array of Buffers');fe+=Oe.length}return Se};function k(ce,H){if(d.isBuffer(ce))return ce.length;if(i.isView(ce)||Pe(ce,i))return ce.byteLength;if(typeof ce!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ce);const Y=ce.length,me=arguments.length>2&&arguments[2]===!0;if(!me&&Y===0)return 0;let Se=!1;for(;;)switch(H){case"ascii":case"latin1":case"binary":return Y;case"utf8":case"utf-8":return L(ce).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y*2;case"hex":return Y>>>1;case"base64":return ye(ce).length;default:if(Se)return me?-1:L(ce).length;H=(""+H).toLowerCase(),Se=!0}}d.byteLength=k;function S(ce,H,Y){let me=!1;if((H===void 0||H<0)&&(H=0),H>this.length||((Y===void 0||Y>this.length)&&(Y=this.length),Y<=0)||(Y>>>=0,H>>>=0,Y<=H))return"";for(ce||(ce="utf8");;)switch(ce){case"hex":return Z(this,H,Y);case"utf8":case"utf-8":return $(this,H,Y);case"ascii":return Q(this,H,Y);case"latin1":case"binary":return V(this,H,Y);case"base64":return P(this,H,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,H,Y);default:if(me)throw new TypeError("Unknown encoding: "+ce);ce=(ce+"").toLowerCase(),me=!0}}d.prototype._isBuffer=!0;function C(ce,H,Y){const me=ce[H];ce[H]=ce[Y],ce[Y]=me}d.prototype.swap16=function(){const H=this.length;if(H%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Y=0;YY&&(H+=" ... "),""},o&&(d.prototype[o]=d.prototype.inspect),d.prototype.compare=function(H,Y,me,Se,fe){if(Pe(H,s)&&(H=d.from(H,H.offset,H.byteLength)),!d.isBuffer(H))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof H);if(Y===void 0&&(Y=0),me===void 0&&(me=H?H.length:0),Se===void 0&&(Se=0),fe===void 0&&(fe=this.length),Y<0||me>H.length||Se<0||fe>this.length)throw new RangeError("out of range index");if(Se>=fe&&Y>=me)return 0;if(Se>=fe)return-1;if(Y>=me)return 1;if(Y>>>=0,me>>>=0,Se>>>=0,fe>>>=0,this===H)return 0;let Oe=fe-Se,ot=me-Y;const Mt=Math.min(Oe,ot),rt=this.slice(Se,fe),Xe=H.slice(Y,me);for(let vt=0;vt2147483647?Y=2147483647:Y<-2147483648&&(Y=-2147483648),Y=+Y,nt(Y)&&(Y=Se?0:ce.length-1),Y<0&&(Y=ce.length+Y),Y>=ce.length){if(Se)return-1;Y=ce.length-1}else if(Y<0)if(Se)Y=0;else return-1;if(typeof H=="string"&&(H=d.from(H,me)),d.isBuffer(H))return H.length===0?-1:T(ce,H,Y,me,Se);if(typeof H=="number")return H=H&255,typeof s.prototype.indexOf=="function"?Se?s.prototype.indexOf.call(ce,H,Y):s.prototype.lastIndexOf.call(ce,H,Y):T(ce,[H],Y,me,Se);throw new TypeError("val must be string, number or Buffer")}function T(ce,H,Y,me,Se){let fe=1,Oe=ce.length,ot=H.length;if(me!==void 0&&(me=String(me).toLowerCase(),me==="ucs2"||me==="ucs-2"||me==="utf16le"||me==="utf-16le")){if(ce.length<2||H.length<2)return-1;fe=2,Oe/=2,ot/=2,Y/=2}function Mt(Xe,vt){return fe===1?Xe[vt]:Xe.readUInt16BE(vt*fe)}let rt;if(Se){let Xe=-1;for(rt=Y;rtOe&&(Y=Oe-ot),rt=Y;rt>=0;rt--){let Xe=!0;for(let vt=0;vtSe&&(me=Se)):me=Se;const fe=H.length;me>fe/2&&(me=fe/2);let Oe;for(Oe=0;Oe>>0,isFinite(me)?(me=me>>>0,Se===void 0&&(Se="utf8")):(Se=me,me=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const fe=this.length-Y;if((me===void 0||me>fe)&&(me=fe),H.length>0&&(me<0||Y<0)||Y>this.length)throw new RangeError("Attempt to write outside buffer bounds");Se||(Se="utf8");let Oe=!1;for(;;)switch(Se){case"hex":return E(this,H,Y,me);case"utf8":case"utf-8":return B(this,H,Y,me);case"ascii":case"latin1":case"binary":return N(this,H,Y,me);case"base64":return j(this,H,Y,me);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,H,Y,me);default:if(Oe)throw new TypeError("Unknown encoding: "+Se);Se=(""+Se).toLowerCase(),Oe=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function P(ce,H,Y){return H===0&&Y===ce.length?t.fromByteArray(ce):t.fromByteArray(ce.slice(H,Y))}function $(ce,H,Y){Y=Math.min(ce.length,Y);const me=[];let Se=H;for(;Se239?4:fe>223?3:fe>191?2:1;if(Se+ot<=Y){let Mt,rt,Xe,vt;switch(ot){case 1:fe<128&&(Oe=fe);break;case 2:Mt=ce[Se+1],(Mt&192)===128&&(vt=(fe&31)<<6|Mt&63,vt>127&&(Oe=vt));break;case 3:Mt=ce[Se+1],rt=ce[Se+2],(Mt&192)===128&&(rt&192)===128&&(vt=(fe&15)<<12|(Mt&63)<<6|rt&63,vt>2047&&(vt<55296||vt>57343)&&(Oe=vt));break;case 4:Mt=ce[Se+1],rt=ce[Se+2],Xe=ce[Se+3],(Mt&192)===128&&(rt&192)===128&&(Xe&192)===128&&(vt=(fe&15)<<18|(Mt&63)<<12|(rt&63)<<6|Xe&63,vt>65535&&vt<1114112&&(Oe=vt))}}Oe===null?(Oe=65533,ot=1):Oe>65535&&(Oe-=65536,me.push(Oe>>>10&1023|55296),Oe=56320|Oe&1023),me.push(Oe),Se+=ot}return X(me)}const F=4096;function X(ce){const H=ce.length;if(H<=F)return String.fromCharCode.apply(String,ce);let Y="",me=0;for(;meme)&&(Y=me);let Se="";for(let fe=H;feme&&(H=me),Y<0?(Y+=me,Y<0&&(Y=0)):Y>me&&(Y=me),YY)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(H,Y,me){H=H>>>0,Y=Y>>>0,me||oe(H,Y,this.length);let Se=this[H],fe=1,Oe=0;for(;++Oe>>0,Y=Y>>>0,me||oe(H,Y,this.length);let Se=this[H+--Y],fe=1;for(;Y>0&&(fe*=256);)Se+=this[H+--Y]*fe;return Se},d.prototype.readUint8=d.prototype.readUInt8=function(H,Y){return H=H>>>0,Y||oe(H,1,this.length),this[H]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(H,Y){return H=H>>>0,Y||oe(H,2,this.length),this[H]|this[H+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(H,Y){return H=H>>>0,Y||oe(H,2,this.length),this[H]<<8|this[H+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(H,Y){return H=H>>>0,Y||oe(H,4,this.length),(this[H]|this[H+1]<<8|this[H+2]<<16)+this[H+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(H,Y){return H=H>>>0,Y||oe(H,4,this.length),this[H]*16777216+(this[H+1]<<16|this[H+2]<<8|this[H+3])},d.prototype.readBigUInt64LE=yt(function(H){H=H>>>0,pe(H,"offset");const Y=this[H],me=this[H+7];(Y===void 0||me===void 0)&&We(H,this.length-8);const Se=Y+this[++H]*2**8+this[++H]*2**16+this[++H]*2**24,fe=this[++H]+this[++H]*2**8+this[++H]*2**16+me*2**24;return BigInt(Se)+(BigInt(fe)<>>0,pe(H,"offset");const Y=this[H],me=this[H+7];(Y===void 0||me===void 0)&&We(H,this.length-8);const Se=Y*2**24+this[++H]*2**16+this[++H]*2**8+this[++H],fe=this[++H]*2**24+this[++H]*2**16+this[++H]*2**8+me;return(BigInt(Se)<>>0,Y=Y>>>0,me||oe(H,Y,this.length);let Se=this[H],fe=1,Oe=0;for(;++Oe=fe&&(Se-=Math.pow(2,8*Y)),Se},d.prototype.readIntBE=function(H,Y,me){H=H>>>0,Y=Y>>>0,me||oe(H,Y,this.length);let Se=Y,fe=1,Oe=this[H+--Se];for(;Se>0&&(fe*=256);)Oe+=this[H+--Se]*fe;return fe*=128,Oe>=fe&&(Oe-=Math.pow(2,8*Y)),Oe},d.prototype.readInt8=function(H,Y){return H=H>>>0,Y||oe(H,1,this.length),this[H]&128?(255-this[H]+1)*-1:this[H]},d.prototype.readInt16LE=function(H,Y){H=H>>>0,Y||oe(H,2,this.length);const me=this[H]|this[H+1]<<8;return me&32768?me|4294901760:me},d.prototype.readInt16BE=function(H,Y){H=H>>>0,Y||oe(H,2,this.length);const me=this[H+1]|this[H]<<8;return me&32768?me|4294901760:me},d.prototype.readInt32LE=function(H,Y){return H=H>>>0,Y||oe(H,4,this.length),this[H]|this[H+1]<<8|this[H+2]<<16|this[H+3]<<24},d.prototype.readInt32BE=function(H,Y){return H=H>>>0,Y||oe(H,4,this.length),this[H]<<24|this[H+1]<<16|this[H+2]<<8|this[H+3]},d.prototype.readBigInt64LE=yt(function(H){H=H>>>0,pe(H,"offset");const Y=this[H],me=this[H+7];(Y===void 0||me===void 0)&&We(H,this.length-8);const Se=this[H+4]+this[H+5]*2**8+this[H+6]*2**16+(me<<24);return(BigInt(Se)<>>0,pe(H,"offset");const Y=this[H],me=this[H+7];(Y===void 0||me===void 0)&&We(H,this.length-8);const Se=(Y<<24)+this[++H]*2**16+this[++H]*2**8+this[++H];return(BigInt(Se)<>>0,Y||oe(H,4,this.length),n.read(this,H,!0,23,4)},d.prototype.readFloatBE=function(H,Y){return H=H>>>0,Y||oe(H,4,this.length),n.read(this,H,!1,23,4)},d.prototype.readDoubleLE=function(H,Y){return H=H>>>0,Y||oe(H,8,this.length),n.read(this,H,!0,52,8)},d.prototype.readDoubleBE=function(H,Y){return H=H>>>0,Y||oe(H,8,this.length),n.read(this,H,!1,52,8)};function ae(ce,H,Y,me,Se,fe){if(!d.isBuffer(ce))throw new TypeError('"buffer" argument must be a Buffer instance');if(H>Se||Hce.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(H,Y,me,Se){if(H=+H,Y=Y>>>0,me=me>>>0,!Se){const ot=Math.pow(2,8*me)-1;ae(this,H,Y,me,ot,0)}let fe=1,Oe=0;for(this[Y]=H&255;++Oe>>0,me=me>>>0,!Se){const ot=Math.pow(2,8*me)-1;ae(this,H,Y,me,ot,0)}let fe=me-1,Oe=1;for(this[Y+fe]=H&255;--fe>=0&&(Oe*=256);)this[Y+fe]=H/Oe&255;return Y+me},d.prototype.writeUint8=d.prototype.writeUInt8=function(H,Y,me){return H=+H,Y=Y>>>0,me||ae(this,H,Y,1,255,0),this[Y]=H&255,Y+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(H,Y,me){return H=+H,Y=Y>>>0,me||ae(this,H,Y,2,65535,0),this[Y]=H&255,this[Y+1]=H>>>8,Y+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(H,Y,me){return H=+H,Y=Y>>>0,me||ae(this,H,Y,2,65535,0),this[Y]=H>>>8,this[Y+1]=H&255,Y+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(H,Y,me){return H=+H,Y=Y>>>0,me||ae(this,H,Y,4,4294967295,0),this[Y+3]=H>>>24,this[Y+2]=H>>>16,this[Y+1]=H>>>8,this[Y]=H&255,Y+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(H,Y,me){return H=+H,Y=Y>>>0,me||ae(this,H,Y,4,4294967295,0),this[Y]=H>>>24,this[Y+1]=H>>>16,this[Y+2]=H>>>8,this[Y+3]=H&255,Y+4};function le(ce,H,Y,me,Se){se(H,me,Se,ce,Y,7);let fe=Number(H&BigInt(4294967295));ce[Y++]=fe,fe=fe>>8,ce[Y++]=fe,fe=fe>>8,ce[Y++]=fe,fe=fe>>8,ce[Y++]=fe;let Oe=Number(H>>BigInt(32)&BigInt(4294967295));return ce[Y++]=Oe,Oe=Oe>>8,ce[Y++]=Oe,Oe=Oe>>8,ce[Y++]=Oe,Oe=Oe>>8,ce[Y++]=Oe,Y}function he(ce,H,Y,me,Se){se(H,me,Se,ce,Y,7);let fe=Number(H&BigInt(4294967295));ce[Y+7]=fe,fe=fe>>8,ce[Y+6]=fe,fe=fe>>8,ce[Y+5]=fe,fe=fe>>8,ce[Y+4]=fe;let Oe=Number(H>>BigInt(32)&BigInt(4294967295));return ce[Y+3]=Oe,Oe=Oe>>8,ce[Y+2]=Oe,Oe=Oe>>8,ce[Y+1]=Oe,Oe=Oe>>8,ce[Y]=Oe,Y+8}d.prototype.writeBigUInt64LE=yt(function(H,Y=0){return le(this,H,Y,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=yt(function(H,Y=0){return he(this,H,Y,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(H,Y,me,Se){if(H=+H,Y=Y>>>0,!Se){const Mt=Math.pow(2,8*me-1);ae(this,H,Y,me,Mt-1,-Mt)}let fe=0,Oe=1,ot=0;for(this[Y]=H&255;++fe>0)-ot&255;return Y+me},d.prototype.writeIntBE=function(H,Y,me,Se){if(H=+H,Y=Y>>>0,!Se){const Mt=Math.pow(2,8*me-1);ae(this,H,Y,me,Mt-1,-Mt)}let fe=me-1,Oe=1,ot=0;for(this[Y+fe]=H&255;--fe>=0&&(Oe*=256);)H<0&&ot===0&&this[Y+fe+1]!==0&&(ot=1),this[Y+fe]=(H/Oe>>0)-ot&255;return Y+me},d.prototype.writeInt8=function(H,Y,me){return H=+H,Y=Y>>>0,me||ae(this,H,Y,1,127,-128),H<0&&(H=255+H+1),this[Y]=H&255,Y+1},d.prototype.writeInt16LE=function(H,Y,me){return H=+H,Y=Y>>>0,me||ae(this,H,Y,2,32767,-32768),this[Y]=H&255,this[Y+1]=H>>>8,Y+2},d.prototype.writeInt16BE=function(H,Y,me){return H=+H,Y=Y>>>0,me||ae(this,H,Y,2,32767,-32768),this[Y]=H>>>8,this[Y+1]=H&255,Y+2},d.prototype.writeInt32LE=function(H,Y,me){return H=+H,Y=Y>>>0,me||ae(this,H,Y,4,2147483647,-2147483648),this[Y]=H&255,this[Y+1]=H>>>8,this[Y+2]=H>>>16,this[Y+3]=H>>>24,Y+4},d.prototype.writeInt32BE=function(H,Y,me){return H=+H,Y=Y>>>0,me||ae(this,H,Y,4,2147483647,-2147483648),H<0&&(H=4294967295+H+1),this[Y]=H>>>24,this[Y+1]=H>>>16,this[Y+2]=H>>>8,this[Y+3]=H&255,Y+4},d.prototype.writeBigInt64LE=yt(function(H,Y=0){return le(this,H,Y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=yt(function(H,Y=0){return he(this,H,Y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function de(ce,H,Y,me,Se,fe){if(Y+me>ce.length)throw new RangeError("Index out of range");if(Y<0)throw new RangeError("Index out of range")}function _e(ce,H,Y,me,Se){return H=+H,Y=Y>>>0,Se||de(ce,H,Y,4),n.write(ce,H,Y,me,23,4),Y+4}d.prototype.writeFloatLE=function(H,Y,me){return _e(this,H,Y,!0,me)},d.prototype.writeFloatBE=function(H,Y,me){return _e(this,H,Y,!1,me)};function Ae(ce,H,Y,me,Se){return H=+H,Y=Y>>>0,Se||de(ce,H,Y,8),n.write(ce,H,Y,me,52,8),Y+8}d.prototype.writeDoubleLE=function(H,Y,me){return Ae(this,H,Y,!0,me)},d.prototype.writeDoubleBE=function(H,Y,me){return Ae(this,H,Y,!1,me)},d.prototype.copy=function(H,Y,me,Se){if(!d.isBuffer(H))throw new TypeError("argument should be a Buffer");if(me||(me=0),!Se&&Se!==0&&(Se=this.length),Y>=H.length&&(Y=H.length),Y||(Y=0),Se>0&&Se=this.length)throw new RangeError("Index out of range");if(Se<0)throw new RangeError("sourceEnd out of bounds");Se>this.length&&(Se=this.length),H.length-Y>>0,me=me===void 0?this.length:me>>>0,H||(H=0);let fe;if(typeof H=="number")for(fe=Y;fe2**32?Se=ee(String(Y)):typeof Y=="bigint"&&(Se=String(Y),(Y>BigInt(2)**BigInt(32)||Y<-(BigInt(2)**BigInt(32)))&&(Se=ee(Se)),Se+="n"),me+=` It must be ${H}. Received ${Se}`,me},RangeError);function ee(ce){let H="",Y=ce.length;const me=ce[0]==="-"?1:0;for(;Y>=me+4;Y-=3)H=`_${ce.slice(Y-3,Y)}${H}`;return`${ce.slice(0,Y)}${H}`}function xe(ce,H,Y){pe(H,"offset"),(ce[H]===void 0||ce[H+Y]===void 0)&&We(H,ce.length-(Y+1))}function se(ce,H,Y,me,Se,fe){if(ce>Y||ce= 0${Oe} and < 2${Oe} ** ${(fe+1)*8}${Oe}`:ot=`>= -(2${Oe} ** ${(fe+1)*8-1}${Oe}) and < 2 ** ${(fe+1)*8-1}${Oe}`,new Be.ERR_OUT_OF_RANGE("value",ot,ce)}xe(me,Se,fe)}function pe(ce,H){if(typeof ce!="number")throw new Be.ERR_INVALID_ARG_TYPE(H,"number",ce)}function We(ce,H,Y){throw Math.floor(ce)!==ce?(pe(ce,Y),new Be.ERR_OUT_OF_RANGE("offset","an integer",ce)):H<0?new Be.ERR_BUFFER_OUT_OF_BOUNDS:new Be.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${H}`,ce)}const ke=/[^+/0-9A-Za-z-_]/g;function ie(ce){if(ce=ce.split("=")[0],ce=ce.trim().replace(ke,""),ce.length<2)return"";for(;ce.length%4!==0;)ce=ce+"=";return ce}function L(ce,H){H=H||1/0;let Y;const me=ce.length;let Se=null;const fe=[];for(let Oe=0;Oe55295&&Y<57344){if(!Se){if(Y>56319){(H-=3)>-1&&fe.push(239,191,189);continue}else if(Oe+1===me){(H-=3)>-1&&fe.push(239,191,189);continue}Se=Y;continue}if(Y<56320){(H-=3)>-1&&fe.push(239,191,189),Se=Y;continue}Y=(Se-55296<<10|Y-56320)+65536}else Se&&(H-=3)>-1&&fe.push(239,191,189);if(Se=null,Y<128){if((H-=1)<0)break;fe.push(Y)}else if(Y<2048){if((H-=2)<0)break;fe.push(Y>>6|192,Y&63|128)}else if(Y<65536){if((H-=3)<0)break;fe.push(Y>>12|224,Y>>6&63|128,Y&63|128)}else if(Y<1114112){if((H-=4)<0)break;fe.push(Y>>18|240,Y>>12&63|128,Y>>6&63|128,Y&63|128)}else throw new Error("Invalid code point")}return fe}function U(ce){const H=[];for(let Y=0;Y>8,Se=Y%256,fe.push(Se),fe.push(me);return fe}function ye(ce){return t.toByteArray(ie(ce))}function qe(ce,H,Y,me){let Se;for(Se=0;Se=H.length||Se>=ce.length);++Se)H[Se+Y]=ce[Se];return Se}function Pe(ce,H){return ce instanceof H||ce!=null&&ce.constructor!=null&&ce.constructor.name!=null&&ce.constructor.name===H.name}function nt(ce){return ce!==ce}const Tt=function(){const ce="0123456789abcdef",H=new Array(256);for(let Y=0;Y<16;++Y){const me=Y*16;for(let Se=0;Se<16;++Se)H[me+Se]=ce[Y]+ce[Se]}return H}();function yt(ce){return typeof BigInt>"u"?wt:ce}function wt(){throw new Error("BigInt not supported")}})(d1e);const rh=d1e.Buffer;function H8e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var f1e={exports:{}},Qr=f1e.exports={},Za,Qa;function A8(){throw new Error("setTimeout has not been defined")}function v8(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Za=setTimeout:Za=A8}catch{Za=A8}try{typeof clearTimeout=="function"?Qa=clearTimeout:Qa=v8}catch{Qa=v8}})();function b1e(e){if(Za===setTimeout)return setTimeout(e,0);if((Za===A8||!Za)&&setTimeout)return Za=setTimeout,setTimeout(e,0);try{return Za(e,0)}catch{try{return Za.call(null,e,0)}catch{return Za.call(this,e,0)}}}function U8e(e){if(Qa===clearTimeout)return clearTimeout(e);if((Qa===v8||!Qa)&&clearTimeout)return Qa=clearTimeout,clearTimeout(e);try{return Qa(e)}catch{try{return Qa.call(null,e)}catch{return Qa.call(this,e)}}}var hl=[],C2=!1,Kp,Lv=-1;function X8e(){!C2||!Kp||(C2=!1,Kp.length?hl=Kp.concat(hl):Lv=-1,hl.length&&h1e())}function h1e(){if(!C2){var e=b1e(X8e);C2=!0;for(var t=hl.length;t;){for(Kp=hl,hl=[];++Lv1)for(var n=1;ne===void 0?null:e;class K8e{constructor(){this.map=new Map}setItem(t,n){this.map.set(t,n)}getItem(t){return this.map.get(t)}}let g1e=new K8e,QB=!0;try{typeof localStorage<"u"&&localStorage&&(g1e=localStorage,QB=!1)}catch{}const M1e=g1e,Y8e=e=>QB||addEventListener("storage",e),Z8e=e=>QB||removeEventListener("storage",e),Q8e=Object.assign,z1e=Object.keys,J8e=(e,t)=>{for(const n in e)t(e[n],n)},hU=e=>z1e(e).length,mU=e=>z1e(e).length,eEe=e=>{for(const t in e)return!1;return!0},tEe=(e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0},O1e=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),nEe=(e,t)=>e===t||mU(e)===mU(t)&&tEe(e,(n,o)=>(n!==void 0||O1e(t,o))&&t[o]===n),oEe=Object.freeze,y1e=e=>{for(const t in e){const n=e[t];(typeof n=="object"||typeof n=="function")&&y1e(e[t])}return oEe(e)},JB=(e,t,n=0)=>{try{for(;n{},sEe=e=>e,iEe=(e,t)=>e===t,vM=(e,t)=>{if(e==null||t==null)return iEe(e,t);if(e.constructor!==t.constructor)return!1;if(e===t)return!0;switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:{if(e.byteLength!==t.byteLength)return!1;for(let n=0;nt.includes(e);var A1e={};const sh=typeof yi<"u"&&yi.release&&/node|io\.js/.test(yi.release.name)&&Object.prototype.toString.call(typeof yi<"u"?yi:0)==="[object process]",v1e=typeof window<"u"&&typeof document<"u"&&!sh;let Ia;const cEe=()=>{if(Ia===void 0)if(sh){Ia=us();const e=yi.argv;let t=null;for(let n=0;n{if(e.length!==0){const[t,n]=e.split("=");Ia.set(`--${cU(t,"-")}`,n),Ia.set(`-${cU(t,"-")}`,n)}})):Ia=us();return Ia},x8=e=>cEe().has(e),YM=e=>bU(sh?A1e[e.toUpperCase().replaceAll("-","_")]:M1e.getItem(e)),x1e=e=>x8("--"+e)||YM(e)!==null;x1e("production");const lEe=sh&&aEe(A1e.FORCE_COLOR,["true","1","2"]),uEe=lEe||!x8("--no-colors")&&!x1e("no-color")&&(!sh||yi.stdout.isTTY)&&(!sh||x8("--color")||YM("COLORTERM")!==null||(YM("TERM")||"").includes("color")),w1e=e=>new Uint8Array(e),dEe=(e,t,n)=>new Uint8Array(e,t,n),pEe=e=>new Uint8Array(e),fEe=e=>{let t="";for(let n=0;nrh.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),hEe=e=>{const t=atob(e),n=w1e(t.length);for(let o=0;o{const t=rh.from(e,"base64");return dEe(t.buffer,t.byteOffset,t.byteLength)},_1e=v1e?fEe:bEe,eN=v1e?hEe:mEe,gEe=e=>{const t=w1e(e.byteLength);return t.set(e),t};class MEe{constructor(t,n){this.left=t,this.right=n}}const Qc=(e,t)=>new MEe(e,t);typeof DOMParser<"u"&&new DOMParser;const zEe=e=>JTe(e,(t,n)=>`${n}:${t};`).join(""),OEe=JSON.stringify,Zl=Symbol,Si=Zl(),mf=Zl(),k1e=Zl(),tN=Zl(),S1e=Zl(),C1e=Zl(),q1e=Zl(),B5=Zl(),N5=Zl(),yEe=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[];let o=0;for(;o0&&n.push(t.join(""));o{const n=gU[SS],o=YM("log"),r=o!==null&&(o==="*"||o==="true"||new RegExp(o,"gi").test(t));return SS=(SS+1)%gU.length,t+=": ",r?(...s)=>{s.length===1&&s[0]?.constructor===Function&&(s=s[0]());const i=Wl(),c=i-MU;MU=i,e(n,t,N5,...s.map(l=>{switch(l!=null&&l.constructor===Uint8Array&&(l=Array.from(l)),typeof l){case"string":case"symbol":return l;default:return OEe(l)}}),n," +"+c+"ms")}:rEe},vEe={[Si]:Qc("font-weight","bold"),[mf]:Qc("font-weight","normal"),[k1e]:Qc("color","blue"),[S1e]:Qc("color","green"),[tN]:Qc("color","grey"),[C1e]:Qc("color","red"),[q1e]:Qc("color","purple"),[B5]:Qc("color","orange"),[N5]:Qc("color","black")},xEe=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[],o=us();let r=[],s=0;for(;s0||l.length>0?(t.push("%c"+i),n.push(l)):t.push(i)}else break}}for(s>0&&(r=n,r.unshift(t.join("")));s{console.log(...R1e(e)),E1e.forEach(t=>t.print(e))},wEe=(...e)=>{console.warn(...R1e(e)),e.unshift(B5),E1e.forEach(t=>t.print(e))},E1e=wd(),_Ee=e=>AEe(T1e,e),W1e=e=>({[Symbol.iterator](){return this},next:e}),kEe=(e,t)=>W1e(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),CS=(e,t)=>W1e(()=>{const{done:n,value:o}=e.next();return{done:n,value:n?void 0:t(o)}});class nN{constructor(t,n){this.clock=t,this.len=n}}class g3{constructor(){this.clients=new Map}}const B1e=(e,t,n)=>t.clients.forEach((o,r)=>{const s=e.doc.store.clients.get(r);for(let i=0;i{let n=0,o=e.length-1;for(;n<=o;){const r=Ac((n+o)/2),s=e[r],i=s.clock;if(i<=t){if(t{const n=e.clients.get(t.client);return n!==void 0&&SEe(n,t.clock)!==null},oN=e=>{e.clients.forEach(t=>{t.sort((r,s)=>r.clock-s.clock);let n,o;for(n=1,o=1;n=s.clock?r.len=$f(r.len,s.clock+s.len-r.clock):(o{const t=new g3;for(let n=0;n{if(!t.clients.has(r)){const s=o.slice();for(let i=n+1;i{x1(e.clients,t,()=>[]).push(new nN(n,o))},qEe=()=>new g3,REe=e=>{const t=qEe();return e.clients.forEach((n,o)=>{const r=[];for(let s=0;s0&&t.clients.set(o,r)}),t},Vh=(e,t)=>{rn(e.restEncoder,t.clients.size),El(t.clients.entries()).sort((n,o)=>o[0]-n[0]).forEach(([n,o])=>{e.resetDsCurVal(),rn(e.restEncoder,n);const r=o.length;rn(e.restEncoder,r);for(let s=0;s{const t=new g3,n=_n(e.restDecoder);for(let o=0;o0){const i=x1(t.clients,r,()=>[]);for(let c=0;c{const o=new g3,r=_n(e.restDecoder);for(let s=0;s0){const s=new gf;return rn(s.restEncoder,0),Vh(s,o),s.toUint8Array()}return null},L1e=l1e;class Hh extends o8e{constructor({guid:t=u1e(),collectionid:n=null,gc:o=!0,gcFilter:r=()=>!0,meta:s=null,autoLoad:i=!1,shouldLoad:c=!0}={}){super(),this.gc=o,this.gcFilter=r,this.clientID=L1e(),this.guid=t,this.collectionid=n,this.share=new Map,this.store=new X1e,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=c,this.autoLoad=i,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=oh(u=>{this.on("load",()=>{this.isLoaded=!0,u(this)})});const l=()=>oh(u=>{const d=p=>{(p===void 0||p===!0)&&(this.off("sync",d),u())};this.on("sync",d)});this.on("sync",u=>{u===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=u===void 0||u===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){const t=this._item;t!==null&&!this.shouldLoad&&Uo(t.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(El(this.subdocs).map(t=>t.guid))}transact(t,n=null){return Uo(this,t,n)}get(t,n=K0){const o=x1(this.share,t,()=>{const s=new n;return s._integrate(this,null),s}),r=o.constructor;if(n!==K0&&r!==n)if(r===K0){const s=new n;s._map=o._map,o._map.forEach(i=>{for(;i!==null;i=i.left)i.parent=s}),s._start=o._start;for(let i=s._start;i!==null;i=i.right)i.parent=s;return s._length=o._length,this.share.set(t,s),s._integrate(this,null),s}else throw new Error(`Type with the name ${t} has already been defined with a different constructor`);return o}getArray(t=""){return this.get(t,R2)}getText(t=""){return this.get(t,ch)}getMap(t=""){return this.get(t,ah)}getXmlElement(t=""){return this.get(t,lh)}getXmlFragment(t=""){return this.get(t,Mf)}toJSON(){const t={};return this.share.forEach((n,o)=>{t[o]=n.toJSON()}),t}destroy(){this.isDestroyed=!0,El(this.subdocs).forEach(n=>n.destroy());const t=this._item;if(t!==null){this._item=null;const n=t.content;n.doc=new Hh({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,Uo(t.parent.doc,o=>{const r=n.doc;t.deleted||o.subdocsAdded.add(r),o.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class P1e{constructor(t){this.restDecoder=t}resetDsCurVal(){}readDsClock(){return _n(this.restDecoder)}readDsLen(){return _n(this.restDecoder)}}class j1e extends P1e{readLeftID(){return Qn(_n(this.restDecoder),_n(this.restDecoder))}readRightID(){return Qn(_n(this.restDecoder),_n(this.restDecoder))}readClient(){return _n(this.restDecoder)}readInfo(){return hf(this.restDecoder)}readString(){return vl(this.restDecoder)}readParentInfo(){return _n(this.restDecoder)===1}readTypeRef(){return _n(this.restDecoder)}readLen(){return _n(this.restDecoder)}readAny(){return nh(this.restDecoder)}readBuf(){return gEe(w0(this.restDecoder))}readJSON(){return JSON.parse(vl(this.restDecoder))}readKey(){return vl(this.restDecoder)}}class TEe{constructor(t){this.dsCurrVal=0,this.restDecoder=t}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=_n(this.restDecoder),this.dsCurrVal}readDsLen(){const t=_n(this.restDecoder)+1;return this.dsCurrVal+=t,t}}class ih extends TEe{constructor(t){super(t),this.keys=[],_n(t),this.keyClockDecoder=new _S(w0(t)),this.clientDecoder=new Nv(w0(t)),this.leftClockDecoder=new _S(w0(t)),this.rightClockDecoder=new _S(w0(t)),this.infoDecoder=new fU(w0(t),hf),this.stringDecoder=new T8e(w0(t)),this.parentInfoDecoder=new fU(w0(t),hf),this.typeRefDecoder=new Nv(w0(t)),this.lenDecoder=new Nv(w0(t))}readLeftID(){return new q2(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new q2(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return nh(this.restDecoder)}readBuf(){return w0(this.restDecoder)}readJSON(){return nh(this.restDecoder)}readKey(){const t=this.keyClockDecoder.read();if(t{o=$f(o,t[0].id.clock);const r=xc(t,o);rn(e.restEncoder,t.length-r),e.writeClient(n),rn(e.restEncoder,o);const s=t[r];s.write(e,o-s.id.clock);for(let i=r+1;i{const o=new Map;n.forEach((r,s)=>{R0(t,s)>r&&o.set(s,r)}),L5(t).forEach((r,s)=>{n.has(s)||o.set(s,0)}),rn(e.restEncoder,o.size),El(o.entries()).sort((r,s)=>s[0]-r[0]).forEach(([r,s])=>{EEe(e,t.clients.get(r),r,s)})},WEe=(e,t)=>{const n=us(),o=_n(e.restDecoder);for(let r=0;r{const o=[];let r=El(n.keys()).sort((b,h)=>b-h);if(r.length===0)return null;const s=()=>{if(r.length===0)return null;let b=n.get(r[r.length-1]);for(;b.refs.length===b.i;)if(r.pop(),r.length>0)b=n.get(r[r.length-1]);else return null;return b};let i=s();if(i===null)return null;const c=new X1e,l=new Map,u=(b,h)=>{const g=l.get(b);(g==null||g>h)&&l.set(b,h)};let d=i.refs[i.i++];const p=new Map,f=()=>{for(const b of o){const h=b.id.client,g=n.get(h);g?(g.i--,c.clients.set(h,g.refs.slice(g.i)),n.delete(h),g.i=0,g.refs=[]):c.clients.set(h,[b]),r=r.filter(z=>z!==h)}o.length=0};for(;;){if(d.constructor!==vi){const h=x1(p,d.id.client,()=>R0(t,d.id.client))-d.id.clock;if(h<0)o.push(d),u(d.id.client,d.id.clock-1),f();else{const g=d.getMissing(e,t);if(g!==null){o.push(d);const z=n.get(g)||{refs:[],i:0};if(z.refs.length===z.i)u(g,R0(t,g)),f();else{d=z.refs[z.i++];continue}}else(h===0||h0)d=o.pop();else if(i!==null&&i.i0){const b=new gf;return sN(b,c,new Map),rn(b.restEncoder,0),{missing:l,update:b.toUint8Array()}}return null},NEe=(e,t)=>sN(e,t.doc.store,t.beforeState),LEe=(e,t,n,o=new ih(e))=>Uo(t,r=>{r.local=!1;let s=!1;const i=r.doc,c=i.store,l=WEe(o,i),u=BEe(r,c,l),d=c.pendingStructs;if(d){for(const[f,b]of d.missing)if(bb)&&d.missing.set(f,b)}d.update=T4([d.update,u.update])}}else c.pendingStructs=u;const p=zU(o,r,c);if(c.pendingDs){const f=new ih(Tc(c.pendingDs));_n(f.restDecoder);const b=zU(f,r,c);p&&b?c.pendingDs=T4([p,b]):c.pendingDs=p||b}else c.pendingDs=p;if(s){const f=c.pendingStructs.update;c.pendingStructs=null,F1e(r.doc,f)}},n,!1),F1e=(e,t,n,o=ih)=>{const r=Tc(t);LEe(r,e,n,new o(r))},$1e=(e,t,n)=>F1e(e,t,n,j1e),PEe=(e,t,n=new Map)=>{sN(e,t.store,n),Vh(e,REe(t.store))},jEe=(e,t=new Uint8Array([0]),n=new gf)=>{const o=V1e(t);PEe(n,e,o);const r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(eWe(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===M3)return QEe(r.map((s,i)=>i===0?s:nWe(s)));if(n.constructor===gf)return T4(r)}return r[0]},iN=(e,t)=>jEe(e,t,new M3),IEe=e=>{const t=new Map,n=_n(e.restDecoder);for(let o=0;oIEe(new P1e(Tc(e))),H1e=(e,t)=>(rn(e.restEncoder,t.size),El(t.entries()).sort((n,o)=>o[0]-n[0]).forEach(([n,o])=>{rn(e.restEncoder,n),rn(e.restEncoder,o)}),e),DEe=(e,t)=>H1e(e,L5(t.store)),FEe=(e,t=new D1e)=>(e instanceof Map?H1e(t,e):DEe(t,e),t.toUint8Array()),$Ee=e=>FEe(e,new I1e);class VEe{constructor(){this.l=[]}}const OU=()=>new VEe,yU=(e,t)=>e.l.push(t),AU=(e,t)=>{const n=e.l,o=n.length;e.l=n.filter(r=>t!==r),o===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},U1e=(e,t,n)=>JB(e.l,[t,n]);class q2{constructor(t,n){this.client=t,this.clock=n}}const pA=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,Qn=(e,t)=>new q2(e,t),HEe=e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw vc()},o2=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!N1e(t.ds,e.id),w8=(e,t)=>{const n=x1(e.meta,w8,wd),o=e.doc.store;n.has(t)||(t.sv.forEach((r,s)=>{r{}),n.add(t))};class X1e{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const L5=e=>{const t=new Map;return e.clients.forEach((n,o)=>{const r=n[n.length-1];t.set(o,r.id.clock+r.length)}),t},R0=(e,t)=>{const n=e.clients.get(t);if(n===void 0)return 0;const o=n[n.length-1];return o.id.clock+o.length},G1e=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{const o=n[n.length-1];if(o.id.clock+o.length!==t.id.clock)throw vc()}n.push(t)},xc=(e,t)=>{let n=0,o=e.length-1,r=e[o],s=r.id.clock;if(s===t)return o;let i=Ac(t/(s+r.length-1)*o);for(;n<=o;){if(r=e[i],s=r.id.clock,s<=t){if(t{const n=e.clients.get(t.client);return n[xc(n,t.clock)]},qS=UEe,_8=(e,t,n)=>{const o=xc(t,n),r=t[o];return r.id.clock{const n=e.doc.store.clients.get(t.client);return n[_8(e,n,t.clock)]},vU=(e,t,n)=>{const o=t.clients.get(n.client),r=xc(o,n.clock),s=o[r];return n.clock!==s.id.clock+s.length-1&&s.constructor!==Ai&&o.splice(r+1,0,P4(e,s,n.clock-s.id.clock+1)),s},XEe=(e,t,n)=>{const o=e.clients.get(t.id.client);o[xc(o,t.id.clock)]=n},K1e=(e,t,n,o,r)=>{if(o===0)return;const s=n+o;let i=_8(e,t,n),c;do c=t[i++],st.deleteSet.clients.size===0&&!e8e(t.afterState,(n,o)=>t.beforeState.get(o)!==n)?!1:(oN(t.deleteSet),NEe(e,t),Vh(e,t.deleteSet),!0),wU=(e,t,n)=>{const o=t._item;(o===null||o.id.clock<(e.beforeState.get(o.id.client)||0)&&!o.deleted)&&x1(e.changed,t,wd).add(n)},Pv=(e,t)=>{let n=e[t],o=e[t-1],r=t;for(;r>0;n=o,o=e[--r-1]){if(o.deleted===n.deleted&&o.constructor===n.constructor&&o.mergeWith(n)){n instanceof p1&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,o);continue}break}const s=t-r;return s&&e.splice(t+1-s,s),s},KEe=(e,t,n)=>{for(const[o,r]of e.clients.entries()){const s=t.clients.get(o);for(let i=r.length-1;i>=0;i--){const c=r[i],l=c.clock+c.len;for(let u=xc(s,c.clock),d=s[u];u{e.clients.forEach((n,o)=>{const r=t.clients.get(o);for(let s=n.length-1;s>=0;s--){const i=n[s],c=HB(r.length-1,1+xc(r,i.clock+i.len-1));for(let l=c,u=r[l];l>0&&u.id.clock>=i.clock;u=r[l])l-=1+Pv(r,l)}})},Y1e=(e,t)=>{if(tc.push(()=>{(u._item===null||!u._item.deleted)&&u._callObserver(n,l)})),c.push(()=>{n.changedParentTypes.forEach((l,u)=>{u._dEH.l.length>0&&(u._item===null||!u._item.deleted)&&(l=l.filter(d=>d.target._item===null||!d.target._item.deleted),l.forEach(d=>{d.currentTarget=u,d._path=null}),l.sort((d,p)=>d.path.length-p.path.length),U1e(u._dEH,l,n))})}),c.push(()=>o.emit("afterTransaction",[n,o])),JB(c,[]),n._needFormattingCleanup&&mWe(n)}finally{o.gc&&KEe(s,r,o.gcFilter),YEe(s,r),n.afterState.forEach((d,p)=>{const f=n.beforeState.get(p)||0;if(f!==d){const b=r.clients.get(p),h=$f(xc(b,f),1);for(let g=b.length-1;g>=h;)g-=1+Pv(b,g)}});for(let d=i.length-1;d>=0;d--){const{client:p,clock:f}=i[d].id,b=r.clients.get(p),h=xc(b,f);h+11||h>0&&Pv(b,h)}if(!n.local&&n.afterState.get(o.clientID)!==n.beforeState.get(o.clientID)&&(T1e(B5,Si,"[yjs] ",mf,C1e,"Changed the client-id because another client seems to be using it."),o.clientID=L1e()),o.emit("afterTransactionCleanup",[n,o]),o._observers.has("update")){const d=new M3;xU(d,n)&&o.emit("update",[d.toUint8Array(),n.origin,o,n])}if(o._observers.has("updateV2")){const d=new gf;xU(d,n)&&o.emit("updateV2",[d.toUint8Array(),n.origin,o,n])}const{subdocsAdded:c,subdocsLoaded:l,subdocsRemoved:u}=n;(c.size>0||u.size>0||l.size>0)&&(c.forEach(d=>{d.clientID=o.clientID,d.collectionid==null&&(d.collectionid=o.collectionid),o.subdocs.add(d)}),u.forEach(d=>o.subdocs.delete(d)),o.emit("subdocs",[{loaded:l,added:c,removed:u},o,n]),u.forEach(d=>d.destroy())),e.length<=t+1?(o._transactionCleanups=[],o.emit("afterAllTransactions",[o,e])):Y1e(e,t+1)}}},Uo=(e,t,n=null,o=!0)=>{const r=e._transactionCleanups;let s=!1,i=null;e._transaction===null&&(s=!0,e._transaction=new GEe(e,n,o),r.push(e._transaction),r.length===1&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{i=t(e._transaction)}finally{if(s){const c=e._transaction===r[0];e._transaction=null,c&&Y1e(r,0)}}return i};function*ZEe(e){const t=_n(e.restDecoder);for(let n=0;nT4(e,j1e,M3),JEe=(e,t)=>{if(e.constructor===Ai){const{client:n,clock:o}=e.id;return new Ai(Qn(n,o+t),e.length-t)}else if(e.constructor===vi){const{client:n,clock:o}=e.id;return new vi(Qn(n,o+t),e.length-t)}else{const n=e,{client:o,clock:r}=n.id;return new p1(Qn(o,r+t),null,Qn(o,r+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},T4=(e,t=ih,n=gf)=>{if(e.length===1)return e[0];const o=e.map(d=>new t(Tc(d)));let r=o.map(d=>new aN(d,!0)),s=null;const i=new n,c=new cN(i);for(;r=r.filter(f=>f.curr!==null),r.sort((f,b)=>{if(f.curr.id.client===b.curr.id.client){const h=f.curr.id.clock-b.curr.id.clock;return h===0?f.curr.constructor===b.curr.constructor?0:f.curr.constructor===vi?1:-1:h}else return b.curr.id.client-f.curr.id.client}),r.length!==0;){const d=r[0],p=d.curr.id.client;if(s!==null){let f=d.curr,b=!1;for(;f!==null&&f.id.clock+f.length<=s.struct.id.clock+s.struct.length&&f.id.client>=s.struct.id.client;)f=d.next(),b=!0;if(f===null||f.id.client!==p||b&&f.id.clock>s.struct.id.clock+s.struct.length)continue;if(p!==s.struct.id.client)Qu(c,s.struct,s.offset),s={struct:f,offset:0},d.next();else if(s.struct.id.clock+s.struct.length0&&(s.struct.constructor===vi?s.struct.length-=h:f=JEe(f,h)),s.struct.mergeWith(f)||(Qu(c,s.struct,s.offset),s={struct:f,offset:0},d.next())}}else s={struct:d.curr,offset:0},d.next();for(let f=d.curr;f!==null&&f.id.client===p&&f.id.clock===s.struct.id.clock+s.struct.length&&f.constructor!==vi;f=d.next())Qu(c,s.struct,s.offset),s={struct:f,offset:0}}s!==null&&(Qu(c,s.struct,s.offset),s=null),lN(c);const l=o.map(d=>rN(d)),u=CEe(l);return Vh(i,u),i.toUint8Array()},eWe=(e,t,n=ih,o=gf)=>{const r=V1e(t),s=new o,i=new cN(s),c=new n(Tc(e)),l=new aN(c,!1);for(;l.curr;){const d=l.curr,p=d.id.client,f=r.get(p)||0;if(l.curr.constructor===vi){l.next();continue}if(d.id.clock+d.length>f)for(Qu(i,d,$f(f-d.id.clock,0)),l.next();l.curr&&l.curr.id.client===p;)Qu(i,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===p&&l.curr.id.clock+l.curr.length<=f;)l.next()}lN(i);const u=rN(c);return Vh(s,u),s.toUint8Array()},Z1e=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:kr(e.encoder.restEncoder)}),e.encoder.restEncoder=k0(),e.written=0)},Qu=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&Z1e(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),rn(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},lN=e=>{Z1e(e);const t=e.encoder.restEncoder;rn(t,e.clientStructs.length);for(let n=0;n{const r=new n(Tc(e)),s=new aN(r,!1),i=new o,c=new cN(i);for(let u=s.curr;u!==null;u=s.next())Qu(c,t(u),0);lN(c);const l=rN(r);return Vh(i,l),i.toUint8Array()},nWe=e=>tWe(e,sEe,ih,M3),_U="You must not compute changes after the event-handler fired.";class P5{constructor(t,n){this.target=t,this.currentTarget=t,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=oWe(this.currentTarget,this.target))}deletes(t){return N1e(this.transaction.deleteSet,t.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw ha(_U);const t=new Map,n=this.target;this.transaction.changed.get(n).forEach(r=>{if(r!==null){const s=n._map.get(r);let i,c;if(this.adds(s)){let l=s.left;for(;l!==null&&this.adds(l);)l=l.left;if(this.deletes(s))if(l!==null&&this.deletes(l))i="delete",c=AS(l.content.getContent());else return;else l!==null&&this.deletes(l)?(i="update",c=AS(l.content.getContent())):(i="add",c=void 0)}else if(this.deletes(s))i="delete",c=AS(s.content.getContent());else return;t.set(r,{action:i,oldValue:c})}}),this._keys=t}return this._keys}get delta(){return this.changes.delta}adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}get changes(){let t=this._changes;if(t===null){if(this.transaction.doc._transactionCleanups.length===0)throw ha(_U);const n=this.target,o=wd(),r=wd(),s=[];if(t={added:o,deleted:r,delta:s,keys:this.keys},this.transaction.changed.get(n).has(null)){let c=null;const l=()=>{c&&s.push(c)};for(let u=n._start;u!==null;u=u.right)u.deleted?this.deletes(u)&&!this.adds(u)&&((c===null||c.delete===void 0)&&(l(),c={delete:0}),c.delete+=u.length,r.add(u)):this.adds(u)?((c===null||c.insert===void 0)&&(l(),c={insert:[]}),c.insert=c.insert.concat(u.content.getContent()),o.add(u)):((c===null||c.retain===void 0)&&(l(),c={retain:0}),c.retain+=u.length);c!==null&&c.retain===void 0&&l()}this._changes=t}return t}}const oWe=(e,t)=>{const n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let o=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(o+=r.length),r=r.right;n.unshift(o)}t=t._item.parent}return n},g1=()=>{wEe("Invalid access: Add Yjs type to a document before reading data.")},Q1e=80;let uN=0;class rWe{constructor(t,n){t.marker=!0,this.p=t,this.index=n,this.timestamp=uN++}}const sWe=e=>{e.timestamp=uN++},J1e=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=uN++},iWe=(e,t,n)=>{if(e.length>=Q1e){const o=e.reduce((r,s)=>r.timestamp{if(e._start===null||t===0||e._searchMarker===null)return null;const n=e._searchMarker.length===0?null:e._searchMarker.reduce((s,i)=>Wv(t-s.index)t;)o=o.left,!o.deleted&&o.countable&&(r-=o.length);for(;o.left!==null&&o.left.id.client===o.id.client&&o.left.id.clock+o.left.length===o.id.clock;)o=o.left,!o.deleted&&o.countable&&(r-=o.length);return n!==null&&Wv(n.index-r){for(let o=e.length-1;o>=0;o--){const r=e[o];if(n>0){let s=r.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(r.index-=s.length);if(s===null||s.marker===!0){e.splice(o,1);continue}r.p=s,s.marker=!0}(t0&&t===r.index)&&(r.index=$f(t,r.index+n))}},I5=(e,t,n)=>{const o=e,r=t.changedParentTypes;for(;x1(r,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;U1e(o._eH,n,t)};class K0{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=OU(),this._dEH=OU(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,n){this.doc=t,this._item=n}_copy(){throw fc()}clone(){throw fc()}_write(t){}get _first(){let t=this._start;for(;t!==null&&t.deleted;)t=t.right;return t}_callObserver(t,n){!t.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(t){yU(this._eH,t)}observeDeep(t){yU(this._dEH,t)}unobserve(t){AU(this._eH,t)}unobserveDeep(t){AU(this._dEH,t)}toJSON(){}}const ese=(e,t,n)=>{e.doc??g1(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let o=n-t;const r=[];let s=e._start;for(;s!==null&&o>0;){if(s.countable&&!s.deleted){const i=s.content.getContent();if(i.length<=t)t-=i.length;else{for(let c=t;c0;c++)r.push(i[c]),o--;t=0}}s=s.right}return r},tse=e=>{e.doc??g1();const t=[];let n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){const o=n.content.getContent();for(let r=0;r{let n=0,o=e._start;for(e.doc??g1();o!==null;){if(o.countable&&!o.deleted){const r=o.content.getContent();for(let s=0;s{const n=[];return QM(e,(o,r)=>{n.push(t(o,r,e))}),n},aWe=e=>{let t=e._start,n=null,o=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),o=0,t=t.right}const r=n[o++];return n.length<=o&&(n=null),{done:!1,value:r}}}},ose=(e,t)=>{e.doc??g1();const n=j5(e,t);let o=e._start;for(n!==null&&(o=n.p,t-=n.index);o!==null;o=o.right)if(!o.deleted&&o.countable){if(t{let r=n;const s=e.doc,i=s.clientID,c=s.store,l=n===null?t._start:n.right;let u=[];const d=()=>{u.length>0&&(r=new p1(Qn(i,R0(c,i)),r,r&&r.lastId,l,l&&l.id,t,null,new zf(u)),r.integrate(e,0),u=[])};o.forEach(p=>{if(p===null)u.push(p);else switch(p.constructor){case Number:case Object:case Boolean:case Array:case String:u.push(p);break;default:switch(d(),p.constructor){case Uint8Array:case ArrayBuffer:r=new p1(Qn(i,R0(c,i)),r,r&&r.lastId,l,l&&l.id,t,null,new z3(new Uint8Array(p))),r.integrate(e,0);break;case Hh:r=new p1(Qn(i,R0(c,i)),r,r&&r.lastId,l,l&&l.id,t,null,new O3(p)),r.integrate(e,0);break;default:if(p instanceof K0)r=new p1(Qn(i,R0(c,i)),r,r&&r.lastId,l,l&&l.id,t,null,new Ql(p)),r.integrate(e,0);else throw new Error("Unexpected content type in insert operation")}}}),d()},rse=()=>ha("Length exceeded!"),sse=(e,t,n,o)=>{if(n>t._length)throw rse();if(n===0)return t._searchMarker&&ZM(t._searchMarker,n,o.length),E4(e,t,null,o);const r=n,s=j5(t,n);let i=t._start;for(s!==null&&(i=s.p,n-=s.index,n===0&&(i=i.prev,n+=i&&i.countable&&!i.deleted?i.length:0));i!==null;i=i.right)if(!i.deleted&&i.countable){if(n<=i.length){n{let r=(t._searchMarker||[]).reduce((s,i)=>i.index>s.index?i:s,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return E4(e,t,r,n)},ise=(e,t,n,o)=>{if(o===0)return;const r=n,s=o,i=j5(t,n);let c=t._start;for(i!==null&&(c=i.p,n-=i.index);c!==null&&n>0;c=c.right)!c.deleted&&c.countable&&(n0&&c!==null;)c.deleted||(o0)throw rse();t._searchMarker&&ZM(t._searchMarker,r,-s+o)},W4=(e,t,n)=>{const o=t._map.get(n);o!==void 0&&o.delete(e)},dN=(e,t,n,o)=>{const r=t._map.get(n)||null,s=e.doc,i=s.clientID;let c;if(o==null)c=new zf([o]);else switch(o.constructor){case Number:case Object:case Boolean:case Array:case String:c=new zf([o]);break;case Uint8Array:c=new z3(o);break;case Hh:c=new O3(o);break;default:if(o instanceof K0)c=new Ql(o);else throw new Error("Unexpected content type")}new p1(Qn(i,R0(s.store,i)),r,r&&r.lastId,null,null,t,n,c).integrate(e,0)},pN=(e,t)=>{e.doc??g1();const n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},ase=e=>{const t={};return e.doc??g1(),e._map.forEach((n,o)=>{n.deleted||(t[o]=n.content.getContent()[n.length-1])}),t},cse=(e,t)=>{e.doc??g1();const n=e._map.get(t);return n!==void 0&&!n.deleted},lWe=(e,t)=>{const n={};return e._map.forEach((o,r)=>{let s=o;for(;s!==null&&(!t.sv.has(s.id.client)||s.id.clock>=(t.sv.get(s.id.client)||0));)s=s.left;s!==null&&o2(s,t)&&(n[r]=s.content.getContent()[s.length-1])}),n},fA=e=>(e.doc??g1(),kEe(e._map.entries(),t=>!t[1].deleted));class uWe extends P5{}class R2 extends K0{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){const n=new R2;return n.push(t),n}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new R2}clone(){const t=new R2;return t.insert(0,this.toArray().map(n=>n instanceof K0?n.clone():n)),t}get length(){return this.doc??g1(),this._length}_callObserver(t,n){super._callObserver(t,n),I5(this,t,new uWe(this,t))}insert(t,n){this.doc!==null?Uo(this.doc,o=>{sse(o,this,t,n)}):this._prelimContent.splice(t,0,...n)}push(t){this.doc!==null?Uo(this.doc,n=>{cWe(n,this,t)}):this._prelimContent.push(...t)}unshift(t){this.insert(0,t)}delete(t,n=1){this.doc!==null?Uo(this.doc,o=>{ise(o,this,t,n)}):this._prelimContent.splice(t,n)}get(t){return ose(this,t)}toArray(){return tse(this)}slice(t=0,n=this.length){return ese(this,t,n)}toJSON(){return this.map(t=>t instanceof K0?t.toJSON():t)}map(t){return nse(this,t)}forEach(t){QM(this,t)}[Symbol.iterator](){return aWe(this)}_write(t){t.writeTypeRef(BWe)}}const dWe=e=>new R2;class pWe extends P5{constructor(t,n,o){super(t,n),this.keysChanged=o}}class ah extends K0{constructor(t){super(),this._prelimContent=null,t===void 0?this._prelimContent=new Map:this._prelimContent=new Map(t)}_integrate(t,n){super._integrate(t,n),this._prelimContent.forEach((o,r)=>{this.set(r,o)}),this._prelimContent=null}_copy(){return new ah}clone(){const t=new ah;return this.forEach((n,o)=>{t.set(o,n instanceof K0?n.clone():n)}),t}_callObserver(t,n){I5(this,t,new pWe(this,t,n))}toJSON(){this.doc??g1();const t={};return this._map.forEach((n,o)=>{if(!n.deleted){const r=n.content.getContent()[n.length-1];t[o]=r instanceof K0?r.toJSON():r}}),t}get size(){return[...fA(this)].length}keys(){return CS(fA(this),t=>t[0])}values(){return CS(fA(this),t=>t[1].content.getContent()[t[1].length-1])}entries(){return CS(fA(this),t=>[t[0],t[1].content.getContent()[t[1].length-1]])}forEach(t){this.doc??g1(),this._map.forEach((n,o)=>{n.deleted||t(n.content.getContent()[n.length-1],o,this)})}[Symbol.iterator](){return this.entries()}delete(t){this.doc!==null?Uo(this.doc,n=>{W4(n,this,t)}):this._prelimContent.delete(t)}set(t,n){return this.doc!==null?Uo(this.doc,o=>{dN(o,this,t,n)}):this._prelimContent.set(t,n),n}get(t){return pN(this,t)}has(t){return cse(this,t)}clear(){this.doc!==null?Uo(this.doc,t=>{this.forEach(function(n,o,r){W4(t,r,o)})}):this._prelimContent.clear()}_write(t){t.writeTypeRef(NWe)}}const fWe=e=>new ah,rd=(e,t)=>e===t||typeof e=="object"&&typeof t=="object"&&e&&t&&nEe(e,t);class k8{constructor(t,n,o,r){this.left=t,this.right=n,this.index=o,this.currentAttributes=r}forward(){switch(this.right===null&&vc(),this.right.content.constructor){case m0:this.right.deleted||Uh(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const kU=(e,t,n)=>{for(;t.right!==null&&n>0;){switch(t.right.content.constructor){case m0:t.right.deleted||Uh(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n{const r=new Map,s=o?j5(t,n):null;if(s){const i=new k8(s.p.left,s.p,s.index,r);return kU(e,i,n-s.index)}else{const i=new k8(null,t._start,0,r);return kU(e,i,n)}},lse=(e,t,n,o)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===m0&&rd(o.get(n.right.content.key),n.right.content.value));)n.right.deleted||o.delete(n.right.content.key),n.forward();const r=e.doc,s=r.clientID;o.forEach((i,c)=>{const l=n.left,u=n.right,d=new p1(Qn(s,R0(r.store,s)),l,l&&l.lastId,u,u&&u.id,t,null,new m0(c,i));d.integrate(e,0),n.right=d,n.forward()})},Uh=(e,t)=>{const{key:n,value:o}=t;o===null?e.delete(n):e.set(n,o)},use=(e,t)=>{for(;e.right!==null;){if(!(e.right.deleted||e.right.content.constructor===m0&&rd(t[e.right.content.key]??null,e.right.content.value)))break;e.forward()}},dse=(e,t,n,o)=>{const r=e.doc,s=r.clientID,i=new Map;for(const c in o){const l=o[c],u=n.currentAttributes.get(c)??null;if(!rd(u,l)){i.set(c,u);const{left:d,right:p}=n;n.right=new p1(Qn(s,R0(r.store,s)),d,d&&d.lastId,p,p&&p.id,t,null,new m0(c,l)),n.right.integrate(e,0),n.forward()}}return i},RS=(e,t,n,o,r)=>{n.currentAttributes.forEach((f,b)=>{r[b]===void 0&&(r[b]=null)});const s=e.doc,i=s.clientID;use(n,r);const c=dse(e,t,n,r),l=o.constructor===String?new wc(o):o instanceof K0?new Ql(o):new Vf(o);let{left:u,right:d,index:p}=n;t._searchMarker&&ZM(t._searchMarker,n.index,l.getLength()),d=new p1(Qn(i,R0(s.store,i)),u,u&&u.lastId,d,d&&d.id,t,null,l),d.integrate(e,0),n.right=d,n.index=p,n.forward(),lse(e,t,n,c)},SU=(e,t,n,o,r)=>{const s=e.doc,i=s.clientID;use(n,r);const c=dse(e,t,n,r);e:for(;n.right!==null&&(o>0||c.size>0&&(n.right.deleted||n.right.content.constructor===m0));){if(!n.right.deleted)switch(n.right.content.constructor){case m0:{const{key:l,value:u}=n.right.content,d=r[l];if(d!==void 0){if(rd(d,u))c.delete(l);else{if(o===0)break e;c.set(l,u)}n.right.delete(e)}else n.currentAttributes.set(l,u);break}default:o0){let l="";for(;o>0;o--)l+=` +`;n.right=new p1(Qn(i,R0(s.store,i)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new wc(l)),n.right.integrate(e,0),n.forward()}lse(e,t,n,c)},pse=(e,t,n,o,r)=>{let s=t;const i=us();for(;s&&(!s.countable||s.deleted);){if(!s.deleted&&s.content.constructor===m0){const u=s.content;i.set(u.key,u)}s=s.right}let c=0,l=!1;for(;t!==s;){if(n===t&&(l=!0),!t.deleted){const u=t.content;switch(u.constructor){case m0:{const{key:d,value:p}=u,f=o.get(d)??null;(i.get(d)!==u||f===p)&&(t.delete(e),c++,!l&&(r.get(d)??null)===p&&f!==p&&(f===null?r.delete(d):r.set(d,f))),!l&&!t.deleted&&Uh(r,u);break}}}t=t.right}return c},bWe=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;const n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===m0){const o=t.content.key;n.has(o)?t.delete(e):n.add(o)}t=t.left}},hWe=e=>{let t=0;return Uo(e.doc,n=>{let o=e._start,r=e._start,s=us();const i=M8(s);for(;r;){if(r.deleted===!1)switch(r.content.constructor){case m0:Uh(i,r.content);break;default:t+=pse(n,o,r,s,i),s=M8(i),o=r;break}r=r.right}}),t},mWe=e=>{const t=new Set,n=e.doc;for(const[o,r]of e.afterState.entries()){const s=e.beforeState.get(o)||0;r!==s&&K1e(e,n.store.clients.get(o),s,r,i=>{!i.deleted&&i.content.constructor===m0&&i.constructor!==Ai&&t.add(i.parent)})}Uo(n,o=>{B1e(e,e.deleteSet,r=>{if(r instanceof Ai||!r.parent._hasFormatting||t.has(r.parent))return;const s=r.parent;r.content.constructor===m0?t.add(s):bWe(o,r)});for(const r of t)hWe(r)})},CU=(e,t,n)=>{const o=n,r=M8(t.currentAttributes),s=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case Ql:case Vf:case wc:n{r===null?this.childListChanged=!0:this.keysChanged.add(r)})}get changes(){if(this._changes===null){const t={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=t}return this._changes}get delta(){if(this._delta===null){const t=this.target.doc,n=[];Uo(t,o=>{const r=new Map,s=new Map;let i=this.target._start,c=null;const l={};let u="",d=0,p=0;const f=()=>{if(c!==null){let b=null;switch(c){case"delete":p>0&&(b={delete:p}),p=0;break;case"insert":(typeof u=="object"||u.length>0)&&(b={insert:u},r.size>0&&(b.attributes={},r.forEach((h,g)=>{h!==null&&(b.attributes[g]=h)}))),u="";break;case"retain":d>0&&(b={retain:d},eEe(l)||(b.attributes=Q8e({},l))),d=0;break}b&&n.push(b),c=null}};for(;i!==null;){switch(i.content.constructor){case Ql:case Vf:this.adds(i)?this.deletes(i)||(f(),c="insert",u=i.content.getContent()[0],f()):this.deletes(i)?(c!=="delete"&&(f(),c="delete"),p+=1):i.deleted||(c!=="retain"&&(f(),c="retain"),d+=1);break;case wc:this.adds(i)?this.deletes(i)||(c!=="insert"&&(f(),c="insert"),u+=i.content.str):this.deletes(i)?(c!=="delete"&&(f(),c="delete"),p+=i.length):i.deleted||(c!=="retain"&&(f(),c="retain"),d+=i.length);break;case m0:{const{key:b,value:h}=i.content;if(this.adds(i)){if(!this.deletes(i)){const g=r.get(b)??null;rd(g,h)?h!==null&&i.delete(o):(c==="retain"&&f(),rd(h,s.get(b)??null)?delete l[b]:l[b]=h)}}else if(this.deletes(i)){s.set(b,h);const g=r.get(b)??null;rd(g,h)||(c==="retain"&&f(),l[b]=g)}else if(!i.deleted){s.set(b,h);const g=l[b];g!==void 0&&(rd(g,h)?g!==null&&i.delete(o):(c==="retain"&&f(),h===null?delete l[b]:l[b]=h))}i.deleted||(c==="insert"&&f(),Uh(r,i.content));break}}i=i.right}for(f();n.length>0;){const b=n[n.length-1];if(b.retain!==void 0&&b.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class ch extends K0{constructor(t){super(),this._pending=t!==void 0?[()=>this.insert(0,t)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??g1(),this._length}_integrate(t,n){super._integrate(t,n);try{this._pending.forEach(o=>o())}catch(o){console.error(o)}this._pending=null}_copy(){return new ch}clone(){const t=new ch;return t.applyDelta(this.toDelta()),t}_callObserver(t,n){super._callObserver(t,n);const o=new gWe(this,t,n);I5(this,t,o),!t.local&&this._hasFormatting&&(t._needFormattingCleanup=!0)}toString(){this.doc??g1();let t="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===wc&&(t+=n.content.str),n=n.right;return t}toJSON(){return this.toString()}applyDelta(t,{sanitize:n=!0}={}){this.doc!==null?Uo(this.doc,o=>{const r=new k8(null,this._start,0,new Map);for(let s=0;s0)&&RS(o,this,r,c,i.attributes||{})}else i.retain!==void 0?SU(o,this,r,i.retain,i.attributes||{}):i.delete!==void 0&&CU(o,r,i.delete)}}):this._pending.push(()=>this.applyDelta(t))}toDelta(t,n,o){this.doc??g1();const r=[],s=new Map,i=this.doc;let c="",l=this._start;function u(){if(c.length>0){const p={};let f=!1;s.forEach((h,g)=>{f=!0,p[g]=h});const b={insert:c};f&&(b.attributes=p),r.push(b),c=""}}const d=()=>{for(;l!==null;){if(o2(l,t)||n!==void 0&&o2(l,n))switch(l.content.constructor){case wc:{const p=s.get("ychange");t!==void 0&&!o2(l,t)?(p===void 0||p.user!==l.id.client||p.type!=="removed")&&(u(),s.set("ychange",o?o("removed",l.id):{type:"removed"})):n!==void 0&&!o2(l,n)?(p===void 0||p.user!==l.id.client||p.type!=="added")&&(u(),s.set("ychange",o?o("added",l.id):{type:"added"})):p!==void 0&&(u(),s.delete("ychange")),c+=l.content.str;break}case Ql:case Vf:{u();const p={insert:l.content.getContent()[0]};if(s.size>0){const f={};p.attributes=f,s.forEach((b,h)=>{f[h]=b})}r.push(p);break}case m0:o2(l,t)&&(u(),Uh(s,l.content));break}l=l.right}u()};return t||n?Uo(i,p=>{t&&w8(p,t),n&&w8(p,n),d()},"cleanup"):d(),r}insert(t,n,o){if(n.length<=0)return;const r=this.doc;r!==null?Uo(r,s=>{const i=bA(s,this,t,!o);o||(o={},i.currentAttributes.forEach((c,l)=>{o[l]=c})),RS(s,this,i,n,o)}):this._pending.push(()=>this.insert(t,n,o))}insertEmbed(t,n,o){const r=this.doc;r!==null?Uo(r,s=>{const i=bA(s,this,t,!o);RS(s,this,i,n,o||{})}):this._pending.push(()=>this.insertEmbed(t,n,o||{}))}delete(t,n){if(n===0)return;const o=this.doc;o!==null?Uo(o,r=>{CU(r,bA(r,this,t,!0),n)}):this._pending.push(()=>this.delete(t,n))}format(t,n,o){if(n===0)return;const r=this.doc;r!==null?Uo(r,s=>{const i=bA(s,this,t,!1);i.right!==null&&SU(s,this,i,n,o)}):this._pending.push(()=>this.format(t,n,o))}removeAttribute(t){this.doc!==null?Uo(this.doc,n=>{W4(n,this,t)}):this._pending.push(()=>this.removeAttribute(t))}setAttribute(t,n){this.doc!==null?Uo(this.doc,o=>{dN(o,this,t,n)}):this._pending.push(()=>this.setAttribute(t,n))}getAttribute(t){return pN(this,t)}getAttributes(){return ase(this)}_write(t){t.writeTypeRef(LWe)}}const MWe=e=>new ch;class TS{constructor(t,n=()=>!0){this._filter=n,this._root=t,this._currentNode=t._start,this._firstCall=!0,t.doc??g1()}[Symbol.iterator](){return this}next(){let t=this._currentNode,n=t&&t.content&&t.content.type;if(t!==null&&(!this._firstCall||t.deleted||!this._filter(n)))do if(n=t.content.type,!t.deleted&&(n.constructor===lh||n.constructor===Mf)&&n._start!==null)t=n._start;else for(;t!==null;){const o=t.next;if(o!==null){t=o;break}else t.parent===this._root?t=null:t=t.parent._item}while(t!==null&&(t.deleted||!this._filter(t.content.type)));return this._firstCall=!1,t===null?{value:void 0,done:!0}:(this._currentNode=t,{value:t.content.type,done:!1})}}class Mf extends K0{constructor(){super(),this._prelimContent=[]}get firstChild(){const t=this._first;return t?t.content.getContent()[0]:null}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Mf}clone(){const t=new Mf;return t.insert(0,this.toArray().map(n=>n instanceof K0?n.clone():n)),t}get length(){return this.doc??g1(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(t){return new TS(this,t)}querySelector(t){t=t.toUpperCase();const o=new TS(this,r=>r.nodeName&&r.nodeName.toUpperCase()===t).next();return o.done?null:o.value}querySelectorAll(t){return t=t.toUpperCase(),El(new TS(this,n=>n.nodeName&&n.nodeName.toUpperCase()===t))}_callObserver(t,n){I5(this,t,new yWe(this,n,t))}toString(){return nse(this,t=>t.toString()).join("")}toJSON(){return this.toString()}toDOM(t=document,n={},o){const r=t.createDocumentFragment();return o!==void 0&&o._createAssociation(r,this),QM(this,s=>{r.insertBefore(s.toDOM(t,n,o),null)}),r}insert(t,n){this.doc!==null?Uo(this.doc,o=>{sse(o,this,t,n)}):this._prelimContent.splice(t,0,...n)}insertAfter(t,n){if(this.doc!==null)Uo(this.doc,o=>{const r=t&&t instanceof K0?t._item:t;E4(o,this,r,n)});else{const o=this._prelimContent,r=t===null?0:o.findIndex(s=>s===t)+1;if(r===0&&t!==null)throw ha("Reference item not found");o.splice(r,0,...n)}}delete(t,n=1){this.doc!==null?Uo(this.doc,o=>{ise(o,this,t,n)}):this._prelimContent.splice(t,n)}toArray(){return tse(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return ose(this,t)}slice(t=0,n=this.length){return ese(this,t,n)}forEach(t){QM(this,t)}_write(t){t.writeTypeRef(jWe)}}const zWe=e=>new Mf;class lh extends Mf{constructor(t="UNDEFINED"){super(),this.nodeName=t,this._prelimAttrs=new Map}get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_integrate(t,n){super._integrate(t,n),this._prelimAttrs.forEach((o,r)=>{this.setAttribute(r,o)}),this._prelimAttrs=null}_copy(){return new lh(this.nodeName)}clone(){const t=new lh(this.nodeName),n=this.getAttributes();return J8e(n,(o,r)=>{typeof o=="string"&&t.setAttribute(r,o)}),t.insert(0,this.toArray().map(o=>o instanceof K0?o.clone():o)),t}toString(){const t=this.getAttributes(),n=[],o=[];for(const c in t)o.push(c);o.sort();const r=o.length;for(let c=0;c0?" "+n.join(" "):"";return`<${s}${i}>${super.toString()}`}removeAttribute(t){this.doc!==null?Uo(this.doc,n=>{W4(n,this,t)}):this._prelimAttrs.delete(t)}setAttribute(t,n){this.doc!==null?Uo(this.doc,o=>{dN(o,this,t,n)}):this._prelimAttrs.set(t,n)}getAttribute(t){return pN(this,t)}hasAttribute(t){return cse(this,t)}getAttributes(t){return t?lWe(this,t):ase(this)}toDOM(t=document,n={},o){const r=t.createElement(this.nodeName),s=this.getAttributes();for(const i in s){const c=s[i];typeof c=="string"&&r.setAttribute(i,c)}return QM(this,i=>{r.appendChild(i.toDOM(t,n,o))}),o!==void 0&&o._createAssociation(r,this),r}_write(t){t.writeTypeRef(PWe),t.writeKey(this.nodeName)}}const OWe=e=>new lh(e.readKey());class yWe extends P5{constructor(t,n,o){super(t,o),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(r=>{r===null?this.childListChanged=!0:this.attributesChanged.add(r)})}}class B4 extends ah{constructor(t){super(),this.hookName=t}_copy(){return new B4(this.hookName)}clone(){const t=new B4(this.hookName);return this.forEach((n,o)=>{t.set(o,n)}),t}toDOM(t=document,n={},o){const r=n[this.hookName];let s;return r!==void 0?s=r.createDom(this):s=document.createElement(this.hookName),s.setAttribute("data-yjs-hook",this.hookName),o!==void 0&&o._createAssociation(s,this),s}_write(t){t.writeTypeRef(IWe),t.writeKey(this.hookName)}}const AWe=e=>new B4(e.readKey());class N4 extends ch{get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_copy(){return new N4}clone(){const t=new N4;return t.applyDelta(this.toDelta()),t}toDOM(t=document,n,o){const r=t.createTextNode(this.toString());return o!==void 0&&o._createAssociation(r,this),r}toString(){return this.toDelta().map(t=>{const n=[];for(const r in t.attributes){const s=[];for(const i in t.attributes[r])s.push({key:i,value:t.attributes[r][i]});s.sort((i,c)=>i.keyr.nodeName=0;r--)o+=``;return o}).join("")}toJSON(){return this.toString()}_write(t){t.writeTypeRef(DWe)}}const vWe=e=>new N4;class fN{constructor(t,n){this.id=t,this.length=n}get deleted(){throw fc()}mergeWith(t){return!1}write(t,n,o){throw fc()}integrate(t,n){throw fc()}}const xWe=0;class Ai extends fN{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,n){n>0&&(this.id.clock+=n,this.length-=n),G1e(t.doc.store,this)}write(t,n){t.writeInfo(xWe),t.writeLen(this.length-n)}getMissing(t,n){return null}}class z3{constructor(t){this.content=t}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new z3(this.content)}splice(t){throw fc()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeBuf(this.content)}getRef(){return 3}}const wWe=e=>new z3(e.readBuf());class JM{constructor(t){this.len=t}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new JM(this.len)}splice(t){const n=new JM(this.len-t);return this.len=t,n}mergeWith(t){return this.len+=t.len,!0}integrate(t,n){R4(t.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(t){}gc(t){}write(t,n){t.writeLen(this.len-n)}getRef(){return 1}}const _We=e=>new JM(e.readLen()),fse=(e,t)=>new Hh({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class O3{constructor(t){t._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=t;const n={};this.opts=n,t.gc||(n.gc=!1),t.autoLoad&&(n.autoLoad=!0),t.meta!==null&&(n.meta=t.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new O3(fse(this.doc.guid,this.opts))}splice(t){throw fc()}mergeWith(t){return!1}integrate(t,n){this.doc._item=n,t.subdocsAdded.add(this.doc),this.doc.shouldLoad&&t.subdocsLoaded.add(this.doc)}delete(t){t.subdocsAdded.has(this.doc)?t.subdocsAdded.delete(this.doc):t.subdocsRemoved.add(this.doc)}gc(t){}write(t,n){t.writeString(this.doc.guid),t.writeAny(this.opts)}getRef(){return 9}}const kWe=e=>new O3(fse(e.readString(),e.readAny()));class Vf{constructor(t){this.embed=t}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new Vf(this.embed)}splice(t){throw fc()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeJSON(this.embed)}getRef(){return 5}}const SWe=e=>new Vf(e.readJSON());class m0{constructor(t,n){this.key=t,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new m0(this.key,this.value)}splice(t){throw fc()}mergeWith(t){return!1}integrate(t,n){const o=n.parent;o._searchMarker=null,o._hasFormatting=!0}delete(t){}gc(t){}write(t,n){t.writeKey(this.key),t.writeJSON(this.value)}getRef(){return 6}}const CWe=e=>new m0(e.readKey(),e.readJSON());class L4{constructor(t){this.arr=t}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new L4(this.arr)}splice(t){const n=new L4(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){const o=this.arr.length;t.writeLen(o-n);for(let r=n;r{const t=e.readLen(),n=[];for(let o=0;o{const t=e.readLen(),n=[];for(let o=0;o=55296&&o<=56319&&(this.str=this.str.slice(0,t-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(t){return this.str+=t.str,!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const EWe=e=>new wc(e.readString()),WWe=[dWe,fWe,MWe,OWe,zWe,AWe,vWe],BWe=0,NWe=1,LWe=2,PWe=3,jWe=4,IWe=5,DWe=6;class Ql{constructor(t){this.type=t}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Ql(this.type._copy())}splice(t){throw fc()}mergeWith(t){return!1}integrate(t,n){this.type._integrate(t.doc,n)}delete(t){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(t.beforeState.get(n.id.client)||0)&&t._mergeStructs.push(n):n.delete(t),n=n.right;this.type._map.forEach(o=>{o.deleted?o.id.clock<(t.beforeState.get(o.id.client)||0)&&t._mergeStructs.push(o):o.delete(t)}),t.changed.delete(this.type)}gc(t){let n=this.type._start;for(;n!==null;)n.gc(t,!0),n=n.right;this.type._start=null,this.type._map.forEach(o=>{for(;o!==null;)o.gc(t,!0),o=o.left}),this.type._map=new Map}write(t,n){this.type._write(t)}getRef(){return 7}}const FWe=e=>new Ql(WWe[e.readTypeRef()](e)),P4=(e,t,n)=>{const{client:o,clock:r}=t.id,s=new p1(Qn(o,r+n),t,Qn(o,r+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&s.markDeleted(),t.keep&&(s.keep=!0),t.redone!==null&&(s.redone=Qn(t.redone.client,t.redone.clock+n)),t.right=s,s.right!==null&&(s.right.left=s),e._mergeStructs.push(s),s.parentSub!==null&&s.right===null&&s.parent._map.set(s.parentSub,s),t.length=n,s};let p1=class S8 extends fN{constructor(t,n,o,r,s,i,c,l){super(t,l.getLength()),this.origin=o,this.left=n,this.right=r,this.rightOrigin=s,this.parent=i,this.parentSub=c,this.redone=null,this.content=l,this.info=this.content.isCountable()?aU:0}set marker(t){(this.info&xS)>0!==t&&(this.info^=xS)}get marker(){return(this.info&xS)>0}get keep(){return(this.info&iU)>0}set keep(t){this.keep!==t&&(this.info^=iU)}get countable(){return(this.info&aU)>0}get deleted(){return(this.info&vS)>0}set deleted(t){this.deleted!==t&&(this.info^=vS)}markDeleted(){this.info|=vS}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=R0(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=R0(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===q2&&this.id.client!==this.parent.client&&this.parent.clock>=R0(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=vU(t,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=_d(t,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Ai||this.right&&this.right.constructor===Ai)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===S8?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===S8&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===q2){const o=qS(n,this.parent);o.constructor===Ai?this.parent=null:this.parent=o.content.type}return null}integrate(t,n){if(n>0&&(this.id.clock+=n,this.left=vU(t,t.doc.store,Qn(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let o=this.left,r;if(o!==null)r=o.right;else if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start;const s=new Set,i=new Set;for(;r!==null&&r!==this.right;){if(i.add(r),s.add(r),pA(this.origin,r.origin)){if(r.id.client{o.p===t&&(o.p=this,!this.deleted&&this.countable&&(o.index-=this.length))}),t.keep&&(this.keep=!0),this.right=t.right,this.right!==null&&(this.right.left=this),this.length+=t.length,!0}return!1}delete(t){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),R4(t.deleteSet,this.id.client,this.id.clock,this.length),wU(t,n,this.parentSub),this.content.delete(t)}}gc(t,n){if(!this.deleted)throw vc();this.content.gc(t),n?XEe(t,this,new Ai(this.id,this.length)):this.content=new JM(this.length)}write(t,n){const o=n>0?Qn(this.id.client,this.id.clock+n-1):this.origin,r=this.rightOrigin,s=this.parentSub,i=this.content.getRef()&R5|(o===null?0:Ls)|(r===null?0:Al)|(s===null?0:XM);if(t.writeInfo(i),o!==null&&t.writeLeftID(o),r!==null&&t.writeRightID(r),o===null&&r===null){const c=this.parent;if(c._item!==void 0){const l=c._item;if(l===null){const u=HEe(c);t.writeParentInfo(!0),t.writeString(u)}else t.writeParentInfo(!1),t.writeLeftID(l.id)}else c.constructor===String?(t.writeParentInfo(!0),t.writeString(c)):c.constructor===q2?(t.writeParentInfo(!1),t.writeLeftID(c)):vc();s!==null&&t.writeString(s)}this.content.write(t,n)}};const bse=(e,t)=>$We[t&R5](e),$We=[()=>{vc()},_We,qWe,wWe,EWe,SWe,CWe,FWe,TWe,kWe,()=>{vc()}],VWe=10;class vi extends fN{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,n){vc()}write(t,n){t.writeInfo(VWe),rn(t.restEncoder,this.length-n)}getMissing(t,n){return null}}const hse=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof sU<"u"?sU:{},mse="__ $YJS$ __";hse[mse]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");hse[mse]=!0;const Hf=e=>oh((t,n)=>{e.onerror=o=>n(new Error(o.target.error)),e.onsuccess=o=>t(o.target.result)}),HWe=(e,t)=>oh((n,o)=>{const r=indexedDB.open(e);r.onupgradeneeded=s=>t(s.target.result),r.onerror=s=>o(ha(s.target.error)),r.onsuccess=s=>{const i=s.target.result;i.onversionchange=()=>{i.close()},n(i)}}),UWe=e=>Hf(indexedDB.deleteDatabase(e)),XWe=(e,t)=>t.forEach(n=>e.createObjectStore.apply(e,n)),eM=(e,t,n="readwrite")=>{const o=e.transaction(t,n);return t.map(r=>tBe(o,r))},gse=(e,t)=>Hf(e.count(t)),GWe=(e,t)=>Hf(e.get(t)),Mse=(e,t)=>Hf(e.delete(t)),KWe=(e,t,n)=>Hf(e.put(t,n)),C8=(e,t)=>Hf(e.add(t)),YWe=(e,t,n)=>Hf(e.getAll(t,n)),ZWe=(e,t,n)=>{let o=null;return eBe(e,t,r=>(o=r,!1),n).then(()=>o)},QWe=(e,t=null)=>ZWe(e,t,"prev"),JWe=(e,t)=>oh((n,o)=>{e.onerror=o,e.onsuccess=async r=>{const s=r.target.result;if(s===null||await t(s)===!1)return n();s.continue()}}),eBe=(e,t,n,o="next")=>JWe(e.openKeyCursor(t,o),r=>n(r.key)),tBe=(e,t)=>e.objectStore(t),nBe=(e,t)=>IDBKeyRange.upperBound(e,t),oBe=(e,t)=>IDBKeyRange.lowerBound(e,t),ES="custom",zse="updates",Ose=500,yse=(e,t=()=>{},n=()=>{})=>{const[o]=eM(e.db,[zse]);return YWe(o,oBe(e._dbref,!1)).then(r=>{e._destroyed||(t(o),Uo(e.doc,()=>{r.forEach(s=>$1e(e.doc,s))},e,!1),n(o))}).then(()=>QWe(o).then(r=>{e._dbref=r+1})).then(()=>gse(o).then(r=>{e._dbsize=r})).then(()=>o)},rBe=(e,t=!0)=>yse(e).then(n=>{(t||e._dbsize>=Ose)&&C8(n,iN(e.doc)).then(()=>Mse(n,nBe(e._dbref,!0))).then(()=>gse(n).then(o=>{e._dbsize=o}))});class sBe extends h3{constructor(t,n){super(),this.doc=n,this.name=t,this._dbref=0,this._dbsize=0,this._destroyed=!1,this.db=null,this.synced=!1,this._db=HWe(t,o=>XWe(o,[["updates",{autoIncrement:!0}],["custom"]])),this.whenSynced=oh(o=>this.on("synced",()=>o(this))),this._db.then(o=>{this.db=o,yse(this,i=>C8(i,iN(n)),()=>{if(this._destroyed)return this;this.synced=!0,this.emit("synced",[this])})}),this._storeTimeout=1e3,this._storeTimeoutId=null,this._storeUpdate=(o,r)=>{if(this.db&&r!==this){const[s]=eM(this.db,[zse]);C8(s,o),++this._dbsize>=Ose&&(this._storeTimeoutId!==null&&clearTimeout(this._storeTimeoutId),this._storeTimeoutId=setTimeout(()=>{rBe(this,!1),this._storeTimeoutId=null},this._storeTimeout))}},n.on("update",this._storeUpdate),this.destroy=this.destroy.bind(this),n.on("destroy",this.destroy)}destroy(){return this._storeTimeoutId&&clearTimeout(this._storeTimeoutId),this.doc.off("update",this._storeUpdate),this.doc.off("destroy",this.destroy),this._destroyed=!0,this._db.then(t=>{t.close()})}clearData(){return this.destroy().then(()=>{UWe(this.name)})}get(t){return this._db.then(n=>{const[o]=eM(n,[ES],"readonly");return GWe(o,t)})}set(t,n){return this._db.then(o=>{const[r]=eM(o,[ES]);return KWe(r,n,t)})}del(t){return this._db.then(n=>{const[o]=eM(n,[ES]);return Mse(o,t)})}}function iBe(e,t,n){const o=`${t}-${e}`,r=new sBe(o,n);return new Promise(s=>{r.on("synced",()=>{s(()=>r.destroy())})})}const aBe=1200,cBe=2500,j4=3e4,q8=e=>{if(e.shouldConnect&&e.ws===null){const t=new WebSocket(e.url),n=e.binaryType;let o=null;n&&(t.binaryType=n),e.ws=t,e.connecting=!0,e.connected=!1,t.onmessage=i=>{e.lastMessageReceived=Wl();const c=i.data,l=typeof c=="string"?JSON.parse(c):c;l&&l.type==="pong"&&(clearTimeout(o),o=setTimeout(s,j4/2)),e.emit("message",[l,e])};const r=i=>{e.ws!==null&&(e.ws=null,e.connecting=!1,e.connected?(e.connected=!1,e.emit("disconnect",[{type:"disconnect",error:i},e])):e.unsuccessfulReconnects++,setTimeout(q8,HB(r8e(e.unsuccessfulReconnects+1)*aBe,cBe),e)),clearTimeout(o)},s=()=>{e.ws===t&&e.send({type:"ping"})};t.onclose=()=>r(null),t.onerror=i=>r(i),t.onopen=()=>{e.lastMessageReceived=Wl(),e.connecting=!1,e.connected=!0,e.unsuccessfulReconnects=0,e.emit("connect",[{type:"connect"},e]),o=setTimeout(s,j4/2)}}};class lBe extends h3{constructor(t,{binaryType:n}={}){super(),this.url=t,this.ws=null,this.binaryType=n||null,this.connected=!1,this.connecting=!1,this.unsuccessfulReconnects=0,this.lastMessageReceived=0,this.shouldConnect=!0,this._checkInterval=setInterval(()=>{this.connected&&j4n.key===t&&this.onmessage!==null&&this.onmessage({data:eN(n.newValue||"")}),Y8e(this._onChange)}postMessage(t){M1e.setItem(this.room,_1e(pEe(t)))}close(){Z8e(this._onChange)}}const dBe=typeof BroadcastChannel>"u"?uBe:BroadcastChannel,bN=e=>x1(Ase,e,()=>{const t=wd(),n=new dBe(e);return n.onmessage=o=>t.forEach(r=>r(o.data,"broadcastchannel")),{bc:n,subs:t}}),pBe=(e,t)=>(bN(e).subs.add(t),t),fBe=(e,t)=>{const n=bN(e),o=n.subs.delete(t);return o&&n.subs.size===0&&(n.bc.close(),Ase.delete(e)),o},bBe=(e,t,n=null)=>{const o=bN(e);o.bc.postMessage(t),o.subs.forEach(r=>r(t,n))},hBe=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}};function hA(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var WS={exports:{}},qU;function mBe(){return qU||(qU=1,function(e,t){(function(n){e.exports=n()})(function(){var n=Math.floor,o=Math.abs,r=Math.pow;return function(){function s(i,c,l){function u(f,b){if(!c[f]){if(!i[f]){var h=typeof hA=="function"&&hA;if(!b&&h)return h(f,!0);if(d)return d(f,!0);var g=new Error("Cannot find module '"+f+"'");throw g.code="MODULE_NOT_FOUND",g}var z=c[f]={exports:{}};i[f][0].call(z.exports,function(y){var _=i[f][1][y];return u(_||y)},z,z.exports,s,i,c,l)}return c[f].exports}for(var d=typeof hA=="function"&&hA,p=0;p>16,T[E++]=255&A>>8,T[E++]=255&A;return R===2&&(A=g[M.charCodeAt(k)]<<2|g[M.charCodeAt(k+1)]>>4,T[E++]=255&A),R===1&&(A=g[M.charCodeAt(k)]<<10|g[M.charCodeAt(k+1)]<<4|g[M.charCodeAt(k+2)]>>2,T[E++]=255&A>>8,T[E++]=255&A),T}function p(M){return h[63&M>>18]+h[63&M>>12]+h[63&M>>6]+h[63&M]}function f(M,A,k){for(var S,C=[],R=A;RE?E:T+R));return S===1?(A=M[k-1],C.push(h[A>>2]+h[63&A<<4]+"==")):S===2&&(A=(M[k-2]<<8)+M[k-1],C.push(h[A>>10]+h[63&A>>4]+h[63&A<<2]+"=")),C.join("")}c.byteLength=function(M){var A=l(M),k=A[0],S=A[1];return 3*(k+S)/4-S},c.toByteArray=d,c.fromByteArray=b;for(var h=[],g=[],z=typeof Uint8Array>"u"?Array:Uint8Array,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_=0,v=y.length;_L)throw new RangeError('The value "'+L+'" is invalid for option "size"')}function h(L,U,ne){return b(L),0>=L||U===void 0?d(L):typeof ne=="string"?d(L).fill(U,ne):d(L).fill(U)}function g(L){return b(L),d(0>L?0:0|M(L))}function z(L,U){if((typeof U!="string"||U==="")&&(U="utf8"),!p.isEncoding(U))throw new TypeError("Unknown encoding: "+U);var ne=0|A(L,U),ye=d(ne),qe=ye.write(L,U);return qe!==ne&&(ye=ye.slice(0,qe)),ye}function y(L){for(var U=0>L.length?0:0|M(L.length),ne=d(U),ye=0;yeU||L.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|L}function A(L,U){if(p.isBuffer(L))return L.length;if(ArrayBuffer.isView(L)||se(L,ArrayBuffer))return L.byteLength;if(typeof L!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof L);var ne=L.length,ye=2>>1;case"base64":return ee(L).length;default:if(qe)return ye?-1:Ae(L).length;U=(""+U).toLowerCase(),qe=!0}}function k(L,U,ne){var ye=!1;if((U===void 0||0>U)&&(U=0),U>this.length||((ne===void 0||ne>this.length)&&(ne=this.length),0>=ne)||(ne>>>=0,U>>>=0,ne<=U))return"";for(L||(L="utf8");;)switch(L){case"hex":return V(this,U,ne);case"utf8":case"utf-8":return $(this,U,ne);case"ascii":return X(this,U,ne);case"latin1":case"binary":return Q(this,U,ne);case"base64":return P(this,U,ne);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,U,ne);default:if(ye)throw new TypeError("Unknown encoding: "+L);L=(L+"").toLowerCase(),ye=!0}}function S(L,U,ne){var ye=L[U];L[U]=L[ne],L[ne]=ye}function C(L,U,ne,ye,qe){if(L.length===0)return-1;if(typeof ne=="string"?(ye=ne,ne=0):2147483647ne&&(ne=-2147483648),ne=+ne,pe(ne)&&(ne=qe?0:L.length-1),0>ne&&(ne=L.length+ne),ne>=L.length){if(qe)return-1;ne=L.length-1}else if(0>ne)if(qe)ne=0;else return-1;if(typeof U=="string"&&(U=p.from(U,ye)),p.isBuffer(U))return U.length===0?-1:R(L,U,ne,ye,qe);if(typeof U=="number")return U&=255,typeof Uint8Array.prototype.indexOf=="function"?qe?Uint8Array.prototype.indexOf.call(L,U,ne):Uint8Array.prototype.lastIndexOf.call(L,U,ne):R(L,[U],ne,ye,qe);throw new TypeError("val must be string, number or Buffer")}function R(L,U,ne,ye,qe){function Pe(me,Se){return nt===1?me[Se]:me.readUInt16BE(Se*nt)}var nt=1,Tt=L.length,yt=U.length;if(ye!==void 0&&(ye=(ye+"").toLowerCase(),ye==="ucs2"||ye==="ucs-2"||ye==="utf16le"||ye==="utf-16le")){if(2>L.length||2>U.length)return-1;nt=2,Tt/=2,yt/=2,ne/=2}var wt;if(qe){var ce=-1;for(wt=ne;wtTt&&(ne=Tt-yt),wt=ne;0<=wt;wt--){for(var H=!0,Y=0;Yqe&&(ye=qe)):ye=qe;var Pe=U.length;ye>Pe/2&&(ye=Pe/2);for(var nt,Tt=0;TtPe&&(nt=Pe):Tt===2?(yt=L[qe+1],(192&yt)==128&&(H=(31&Pe)<<6|63&yt,127H||57343H&&(nt=H)))}nt===null?(nt=65533,Tt=1):65535>>10),nt=56320|1023&nt),ye.push(nt),qe+=Tt}return F(ye)}function F(L){var U=L.length;if(U<=4096)return l.apply(String,L);for(var ne="",ye=0;yeU)&&(U=0),(!ne||0>ne||ne>ye)&&(ne=ye);for(var qe="",Pe=U;PeL)throw new RangeError("offset is not uint");if(L+U>ne)throw new RangeError("Trying to access beyond buffer length")}function oe(L,U,ne,ye,qe,Pe){if(!p.isBuffer(L))throw new TypeError('"buffer" argument must be a Buffer instance');if(U>qe||UL.length)throw new RangeError("Index out of range")}function ae(L,U,ne,ye){if(ne+ye>L.length)throw new RangeError("Index out of range");if(0>ne)throw new RangeError("Index out of range")}function le(L,U,ne,ye,qe){return U=+U,ne>>>=0,qe||ae(L,U,ne,4),ke.write(L,U,ne,ye,23,4),ne+4}function he(L,U,ne,ye,qe){return U=+U,ne>>>=0,qe||ae(L,U,ne,8),ke.write(L,U,ne,ye,52,8),ne+8}function de(L){if(L=L.split("=")[0],L=L.trim().replace(ie,""),2>L.length)return"";for(;L.length%4!=0;)L+="=";return L}function _e(L){return 16>L?"0"+L.toString(16):L.toString(16)}function Ae(L,U){U=U||1/0;for(var ne,ye=L.length,qe=null,Pe=[],nt=0;ntne){if(!qe){if(56319ne){-1<(U-=3)&&Pe.push(239,191,189),qe=ne;continue}ne=(qe-55296<<10|ne-56320)+65536}else qe&&-1<(U-=3)&&Pe.push(239,191,189);if(qe=null,128>ne){if(0>(U-=1))break;Pe.push(ne)}else if(2048>ne){if(0>(U-=2))break;Pe.push(192|ne>>6,128|63&ne)}else if(65536>ne){if(0>(U-=3))break;Pe.push(224|ne>>12,128|63&ne>>6,128|63&ne)}else if(1114112>ne){if(0>(U-=4))break;Pe.push(240|ne>>18,128|63&ne>>12,128|63&ne>>6,128|63&ne)}else throw new Error("Invalid code point")}return Pe}function Be(L){for(var U=[],ne=0;ne(U-=2));++nt)ne=L.charCodeAt(nt),ye=ne>>8,qe=ne%256,Pe.push(qe),Pe.push(ye);return Pe}function ee(L){return We.toByteArray(de(L))}function xe(L,U,ne,ye){for(var qe=0;qe=U.length||qe>=L.length);++qe)U[qe+ne]=L[qe];return qe}function se(L,U){return L instanceof U||L!=null&&L.constructor!=null&&L.constructor.name!=null&&L.constructor.name===U.name}function pe(L){return L!==L}var We=s("base64-js"),ke=s("ieee754");c.Buffer=p,c.SlowBuffer=function(L){return+L!=L&&(L=0),p.alloc(+L)},c.INSPECT_MAX_BYTES=50,c.kMaxLength=2147483647,p.TYPED_ARRAY_SUPPORT=function(){try{var L=new Uint8Array(1);return L.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},L.foo()===42}catch{return!1}}(),p.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){return p.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){return p.isBuffer(this)?this.byteOffset:void 0}}),typeof Symbol<"u"&&Symbol.species!=null&&p[Symbol.species]===p&&Object.defineProperty(p,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),p.poolSize=8192,p.from=function(L,U,ne){return f(L,U,ne)},p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array,p.alloc=function(L,U,ne){return h(L,U,ne)},p.allocUnsafe=function(L){return g(L)},p.allocUnsafeSlow=function(L){return g(L)},p.isBuffer=function(L){return L!=null&&L._isBuffer===!0&&L!==p.prototype},p.compare=function(L,U){if(se(L,Uint8Array)&&(L=p.from(L,L.offset,L.byteLength)),se(U,Uint8Array)&&(U=p.from(U,U.offset,U.byteLength)),!p.isBuffer(L)||!p.isBuffer(U))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(L===U)return 0;for(var ne=L.length,ye=U.length,qe=0,Pe=u(ne,ye);qeU&&(L+=" ... "),""},p.prototype.compare=function(L,U,ne,ye,qe){if(se(L,Uint8Array)&&(L=p.from(L,L.offset,L.byteLength)),!p.isBuffer(L))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof L);if(U===void 0&&(U=0),ne===void 0&&(ne=L?L.length:0),ye===void 0&&(ye=0),qe===void 0&&(qe=this.length),0>U||ne>L.length||0>ye||qe>this.length)throw new RangeError("out of range index");if(ye>=qe&&U>=ne)return 0;if(ye>=qe)return-1;if(U>=ne)return 1;if(U>>>=0,ne>>>=0,ye>>>=0,qe>>>=0,this===L)return 0;for(var Pe=qe-ye,nt=ne-U,Tt=u(Pe,nt),yt=this.slice(ye,qe),wt=L.slice(U,ne),ce=0;ce>>=0,isFinite(ne)?(ne>>>=0,ye===void 0&&(ye="utf8")):(ye=ne,ne=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var qe=this.length-U;if((ne===void 0||ne>qe)&&(ne=qe),0ne||0>U)||U>this.length)throw new RangeError("Attempt to write outside buffer bounds");ye||(ye="utf8");for(var Pe=!1;;)switch(ye){case"hex":return T(this,L,U,ne);case"utf8":case"utf-8":return E(this,L,U,ne);case"ascii":return B(this,L,U,ne);case"latin1":case"binary":return N(this,L,U,ne);case"base64":return j(this,L,U,ne);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,L,U,ne);default:if(Pe)throw new TypeError("Unknown encoding: "+ye);ye=(""+ye).toLowerCase(),Pe=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},p.prototype.slice=function(L,U){var ne=this.length;L=~~L,U=U===void 0?ne:~~U,0>L?(L+=ne,0>L&&(L=0)):L>ne&&(L=ne),0>U?(U+=ne,0>U&&(U=0)):U>ne&&(U=ne),U>>=0,U>>>=0,ne||re(L,U,this.length);for(var ye=this[L],qe=1,Pe=0;++Pe>>=0,U>>>=0,ne||re(L,U,this.length);for(var ye=this[L+--U],qe=1;0>>=0,U||re(L,1,this.length),this[L]},p.prototype.readUInt16LE=function(L,U){return L>>>=0,U||re(L,2,this.length),this[L]|this[L+1]<<8},p.prototype.readUInt16BE=function(L,U){return L>>>=0,U||re(L,2,this.length),this[L]<<8|this[L+1]},p.prototype.readUInt32LE=function(L,U){return L>>>=0,U||re(L,4,this.length),(this[L]|this[L+1]<<8|this[L+2]<<16)+16777216*this[L+3]},p.prototype.readUInt32BE=function(L,U){return L>>>=0,U||re(L,4,this.length),16777216*this[L]+(this[L+1]<<16|this[L+2]<<8|this[L+3])},p.prototype.readIntLE=function(L,U,ne){L>>>=0,U>>>=0,ne||re(L,U,this.length);for(var ye=this[L],qe=1,Pe=0;++Pe=qe&&(ye-=r(2,8*U)),ye},p.prototype.readIntBE=function(L,U,ne){L>>>=0,U>>>=0,ne||re(L,U,this.length);for(var ye=U,qe=1,Pe=this[L+--ye];0=qe&&(Pe-=r(2,8*U)),Pe},p.prototype.readInt8=function(L,U){return L>>>=0,U||re(L,1,this.length),128&this[L]?-1*(255-this[L]+1):this[L]},p.prototype.readInt16LE=function(L,U){L>>>=0,U||re(L,2,this.length);var ne=this[L]|this[L+1]<<8;return 32768&ne?4294901760|ne:ne},p.prototype.readInt16BE=function(L,U){L>>>=0,U||re(L,2,this.length);var ne=this[L+1]|this[L]<<8;return 32768&ne?4294901760|ne:ne},p.prototype.readInt32LE=function(L,U){return L>>>=0,U||re(L,4,this.length),this[L]|this[L+1]<<8|this[L+2]<<16|this[L+3]<<24},p.prototype.readInt32BE=function(L,U){return L>>>=0,U||re(L,4,this.length),this[L]<<24|this[L+1]<<16|this[L+2]<<8|this[L+3]},p.prototype.readFloatLE=function(L,U){return L>>>=0,U||re(L,4,this.length),ke.read(this,L,!0,23,4)},p.prototype.readFloatBE=function(L,U){return L>>>=0,U||re(L,4,this.length),ke.read(this,L,!1,23,4)},p.prototype.readDoubleLE=function(L,U){return L>>>=0,U||re(L,8,this.length),ke.read(this,L,!0,52,8)},p.prototype.readDoubleBE=function(L,U){return L>>>=0,U||re(L,8,this.length),ke.read(this,L,!1,52,8)},p.prototype.writeUIntLE=function(L,U,ne,ye){if(L=+L,U>>>=0,ne>>>=0,!ye){var qe=r(2,8*ne)-1;oe(this,L,U,ne,qe,0)}var Pe=1,nt=0;for(this[U]=255&L;++nt>>=0,ne>>>=0,!ye){var qe=r(2,8*ne)-1;oe(this,L,U,ne,qe,0)}var Pe=ne-1,nt=1;for(this[U+Pe]=255&L;0<=--Pe&&(nt*=256);)this[U+Pe]=255&L/nt;return U+ne},p.prototype.writeUInt8=function(L,U,ne){return L=+L,U>>>=0,ne||oe(this,L,U,1,255,0),this[U]=255&L,U+1},p.prototype.writeUInt16LE=function(L,U,ne){return L=+L,U>>>=0,ne||oe(this,L,U,2,65535,0),this[U]=255&L,this[U+1]=L>>>8,U+2},p.prototype.writeUInt16BE=function(L,U,ne){return L=+L,U>>>=0,ne||oe(this,L,U,2,65535,0),this[U]=L>>>8,this[U+1]=255&L,U+2},p.prototype.writeUInt32LE=function(L,U,ne){return L=+L,U>>>=0,ne||oe(this,L,U,4,4294967295,0),this[U+3]=L>>>24,this[U+2]=L>>>16,this[U+1]=L>>>8,this[U]=255&L,U+4},p.prototype.writeUInt32BE=function(L,U,ne){return L=+L,U>>>=0,ne||oe(this,L,U,4,4294967295,0),this[U]=L>>>24,this[U+1]=L>>>16,this[U+2]=L>>>8,this[U+3]=255&L,U+4},p.prototype.writeIntLE=function(L,U,ne,ye){if(L=+L,U>>>=0,!ye){var qe=r(2,8*ne-1);oe(this,L,U,ne,qe-1,-qe)}var Pe=0,nt=1,Tt=0;for(this[U]=255&L;++PeL&&Tt===0&&this[U+Pe-1]!==0&&(Tt=1),this[U+Pe]=255&(L/nt>>0)-Tt;return U+ne},p.prototype.writeIntBE=function(L,U,ne,ye){if(L=+L,U>>>=0,!ye){var qe=r(2,8*ne-1);oe(this,L,U,ne,qe-1,-qe)}var Pe=ne-1,nt=1,Tt=0;for(this[U+Pe]=255&L;0<=--Pe&&(nt*=256);)0>L&&Tt===0&&this[U+Pe+1]!==0&&(Tt=1),this[U+Pe]=255&(L/nt>>0)-Tt;return U+ne},p.prototype.writeInt8=function(L,U,ne){return L=+L,U>>>=0,ne||oe(this,L,U,1,127,-128),0>L&&(L=255+L+1),this[U]=255&L,U+1},p.prototype.writeInt16LE=function(L,U,ne){return L=+L,U>>>=0,ne||oe(this,L,U,2,32767,-32768),this[U]=255&L,this[U+1]=L>>>8,U+2},p.prototype.writeInt16BE=function(L,U,ne){return L=+L,U>>>=0,ne||oe(this,L,U,2,32767,-32768),this[U]=L>>>8,this[U+1]=255&L,U+2},p.prototype.writeInt32LE=function(L,U,ne){return L=+L,U>>>=0,ne||oe(this,L,U,4,2147483647,-2147483648),this[U]=255&L,this[U+1]=L>>>8,this[U+2]=L>>>16,this[U+3]=L>>>24,U+4},p.prototype.writeInt32BE=function(L,U,ne){return L=+L,U>>>=0,ne||oe(this,L,U,4,2147483647,-2147483648),0>L&&(L=4294967295+L+1),this[U]=L>>>24,this[U+1]=L>>>16,this[U+2]=L>>>8,this[U+3]=255&L,U+4},p.prototype.writeFloatLE=function(L,U,ne){return le(this,L,U,!0,ne)},p.prototype.writeFloatBE=function(L,U,ne){return le(this,L,U,!1,ne)},p.prototype.writeDoubleLE=function(L,U,ne){return he(this,L,U,!0,ne)},p.prototype.writeDoubleBE=function(L,U,ne){return he(this,L,U,!1,ne)},p.prototype.copy=function(L,U,ne,ye){if(!p.isBuffer(L))throw new TypeError("argument should be a Buffer");if(ne||(ne=0),ye||ye===0||(ye=this.length),U>=L.length&&(U=L.length),U||(U=0),0U)throw new RangeError("targetStart out of bounds");if(0>ne||ne>=this.length)throw new RangeError("Index out of range");if(0>ye)throw new RangeError("sourceEnd out of bounds");ye>this.length&&(ye=this.length),L.length-Uqe||ye==="latin1")&&(L=qe)}}else typeof L=="number"&&(L&=255);if(0>U||this.length>>=0,ne=ne===void 0?this.length:ne>>>0,L||(L=0);var Pe;if(typeof L=="number")for(Pe=U;Pe{g==="%%"||(b++,g==="%c"&&(h=b))}),p.splice(h,0,f)},c.save=function(p){try{p?c.storage.setItem("debug",p):c.storage.removeItem("debug")}catch{}},c.load=u,c.useColors=function(){return!!(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))||!(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&(typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},c.storage=function(){try{return localStorage}catch{}}(),c.destroy=(()=>{let p=!1;return()=>{p||(p=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),c.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],c.log=console.debug||console.log||(()=>{}),i.exports=s("./common")(c);const{formatters:d}=i.exports;d.j=function(p){try{return JSON.stringify(p)}catch(f){return"[UnexpectedJSONParseError]: "+f.message}}}).call(this)}).call(this,s("_process"))},{"./common":5,_process:12}],5:[function(s,i){i.exports=function(c){function l(p){function f(...g){if(!f.enabled)return;const z=f,y=+new Date,_=y-(b||y);z.diff=_,z.prev=b,z.curr=y,b=y,g[0]=l.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let v=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,(A,k)=>{if(A==="%%")return"%";v++;const S=l.formatters[k];if(typeof S=="function"){const C=g[v];A=S.call(z,C),g.splice(v,1),v--}return A}),l.formatArgs.call(z,g),(z.log||l.log).apply(z,g)}let b,h=null;return f.namespace=p,f.useColors=l.useColors(),f.color=l.selectColor(p),f.extend=u,f.destroy=l.destroy,Object.defineProperty(f,"enabled",{enumerable:!0,configurable:!1,get:()=>h===null?l.enabled(p):h,set:g=>{h=g}}),typeof l.init=="function"&&l.init(f),f}function u(p,f){const b=l(this.namespace+(typeof f>"u"?":":f)+p);return b.log=this.log,b}function d(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}return l.debug=l,l.default=l,l.coerce=function(p){return p instanceof Error?p.stack||p.message:p},l.disable=function(){const p=[...l.names.map(d),...l.skips.map(d).map(f=>"-"+f)].join(",");return l.enable(""),p},l.enable=function(p){l.save(p),l.names=[],l.skips=[];let f;const b=(typeof p=="string"?p:"").split(/[\s,]+/),h=b.length;for(f=0;f{l[p]=c[p]}),l.names=[],l.skips=[],l.formatters={},l.selectColor=function(p){let f=0;for(let b=0;bj&&!P.warned){P.warned=!0;var $=new Error("Possible EventEmitter memory leak detected. "+P.length+" "+(E+" listeners added. Use emitter.setMaxListeners() to increase limit"));$.name="MaxListenersExceededWarning",$.emitter=T,$.type=E,$.count=P.length,c($)}return T}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function b(T,E,B){var N={fired:!1,wrapFn:void 0,target:T,type:E,listener:B},j=f.bind(N);return j.listener=B,N.wrapFn=j,j}function h(T,E,B){var N=T._events;if(N===void 0)return[];var j=N[E];return j===void 0?[]:typeof j=="function"?B?[j.listener||j]:[j]:B?_(j):z(j,j.length)}function g(T){var E=this._events;if(E!==void 0){var B=E[T];if(typeof B=="function")return 1;if(B!==void 0)return B.length}return 0}function z(T,E){for(var B=Array(E),N=0;NT||C(T))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+T+".");R=T}}),l.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(T){if(typeof T!="number"||0>T||C(T))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+T+".");return this._maxListeners=T,this},l.prototype.getMaxListeners=function(){return d(this)},l.prototype.emit=function(T){for(var E=[],B=1;Bj)return this;j===0?B.shift():y(B,j),B.length===1&&(N[T]=B[0]),N.removeListener!==void 0&&this.emit("removeListener",T,P||E)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(T){var E,B,N;if(B=this._events,B===void 0)return this;if(B.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):B[T]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete B[T]),this;if(arguments.length===0){var j,I=Object.keys(B);for(N=0;N"u")return null;var c={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return c.RTCPeerConnection?c:null}},{}],9:[function(s,i,c){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */c.read=function(l,u,d,p,f){var b,h,g=8*f-p-1,z=(1<>1,_=-7,v=d?f-1:0,M=d?-1:1,A=l[u+v];for(v+=M,b=A&(1<<-_)-1,A>>=-_,_+=g;0<_;b=256*b+l[u+v],v+=M,_-=8);for(h=b&(1<<-_)-1,b>>=-_,_+=p;0<_;h=256*h+l[u+v],v+=M,_-=8);if(b===0)b=1-y;else{if(b===z)return h?NaN:(A?-1:1)*(1/0);h+=r(2,p),b-=y}return(A?-1:1)*h*r(2,b-p)},c.write=function(l,u,d,p,f,b){var h,g,z,y=Math.LN2,_=Math.log,v=8*b-f-1,M=(1<>1,k=f===23?r(2,-24)-r(2,-77):0,S=p?0:b-1,C=p?1:-1,R=0>u||u===0&&0>1/u?1:0;for(u=o(u),isNaN(u)||u===1/0?(g=isNaN(u)?1:0,h=M):(h=n(_(u)/y),1>u*(z=r(2,-h))&&(h--,z*=2),u+=1<=h+A?k/z:k*r(2,1-A),2<=u*z&&(h++,z/=2),h+A>=M?(g=0,h=M):1<=h+A?(g=(u*z-1)*r(2,f),h+=A):(g=u*r(2,A-1)*r(2,f),h=0));8<=f;l[d+S]=255&g,S+=C,g/=256,f-=8);for(h=h<=1.5*h?"s":"")}i.exports=function(f,b){b=b||{};var h=typeof f;if(h=="string"&&0 */let l;i.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window>"u"?c:window):u=>(l||(l=Promise.resolve())).then(u).catch(d=>setTimeout(()=>{throw d},0))}).call(this)}).call(this,typeof u1>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:u1)},{}],14:[function(s,i){(function(c,l){(function(){var u=s("safe-buffer").Buffer,d=l.crypto||l.msCrypto;i.exports=d&&d.getRandomValues?function(p,f){if(p>4294967295)throw new RangeError("requested too many random bytes");var b=u.allocUnsafe(p);if(0"u"?typeof self>"u"?typeof window>"u"?{}:window:self:u1)},{_process:12,"safe-buffer":30}],15:[function(s,i){function c(h,g){h.prototype=Object.create(g.prototype),h.prototype.constructor=h,h.__proto__=g}function l(h,g,z){function y(v,M,A){return typeof g=="string"?g:g(v,M,A)}z||(z=Error);var _=function(v){function M(A,k,S){return v.call(this,y(A,k,S))||this}return c(M,v),M}(z);_.prototype.name=z.name,_.prototype.code=h,b[h]=_}function u(h,g){if(Array.isArray(h)){var z=h.length;return h=h.map(function(y){return y+""}),2h.length)&&(z=h.length),h.substring(z-g.length,z)===g}function f(h,g,z){return typeof z!="number"&&(z=0),!(z+g.length>h.length)&&h.indexOf(g,z)!==-1}var b={};l("ERR_INVALID_OPT_VALUE",function(h,g){return'The value "'+g+'" is invalid for option "'+h+'"'},TypeError),l("ERR_INVALID_ARG_TYPE",function(h,g,z){var y;typeof g=="string"&&d(g,"not ")?(y="must not be",g=g.replace(/^not /,"")):y="must be";var _;if(p(h," argument"))_="The ".concat(h," ").concat(y," ").concat(u(g,"type"));else{var v=f(h,".")?"property":"argument";_='The "'.concat(h,'" ').concat(v," ").concat(y," ").concat(u(g,"type"))}return _+=". Received type ".concat(typeof z),_},TypeError),l("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),l("ERR_METHOD_NOT_IMPLEMENTED",function(h){return"The "+h+" method is not implemented"}),l("ERR_STREAM_PREMATURE_CLOSE","Premature close"),l("ERR_STREAM_DESTROYED",function(h){return"Cannot call "+h+" after a stream was destroyed"}),l("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),l("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),l("ERR_STREAM_WRITE_AFTER_END","write after end"),l("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),l("ERR_UNKNOWN_ENCODING",function(h){return"Unknown encoding: "+h},TypeError),l("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),i.exports.codes=b},{}],16:[function(s,i){(function(c){(function(){function l(y){return this instanceof l?(f.call(this,y),b.call(this,y),this.allowHalfOpen=!0,void(y&&(y.readable===!1&&(this.readable=!1),y.writable===!1&&(this.writable=!1),y.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",u))))):new l(y)}function u(){this._writableState.ended||c.nextTick(d,this)}function d(y){y.end()}var p=Object.keys||function(y){var _=[];for(var v in y)_.push(v);return _};i.exports=l;var f=s("./_stream_readable"),b=s("./_stream_writable");s("inherits")(l,f);for(var h,g=p(b.prototype),z=0;z>>1,ie|=ie>>>2,ie|=ie>>>4,ie|=ie>>>8,ie|=ie>>>16,ie++),ie}function _(ie,L){return 0>=ie||L.length===0&&L.ended?0:L.objectMode?1:ie===ie?(ie>L.highWaterMark&&(L.highWaterMark=y(ie)),ie<=L.length?ie:L.ended?L.length:(L.needReadable=!0,0)):L.flowing&&L.length?L.buffer.head.data.length:L.length}function v(ie,L){if(X("onEofChunk"),!L.ended){if(L.decoder){var U=L.decoder.end();U&&U.length&&(L.buffer.push(U),L.length+=L.objectMode?1:U.length)}L.ended=!0,L.sync?M(ie):(L.needReadable=!1,!L.emittedReadable&&(L.emittedReadable=!0,A(ie)))}}function M(ie){var L=ie._readableState;X("emitReadable",L.needReadable,L.emittedReadable),L.needReadable=!1,L.emittedReadable||(X("emitReadable",L.flowing),L.emittedReadable=!0,c.nextTick(A,ie))}function A(ie){var L=ie._readableState;X("emitReadable_",L.destroyed,L.length,L.ended),!L.destroyed&&(L.length||L.ended)&&(ie.emit("readable"),L.emittedReadable=!1),L.needReadable=!L.flowing&&!L.ended&&L.length<=L.highWaterMark,N(ie)}function k(ie,L){L.readingMore||(L.readingMore=!0,c.nextTick(S,ie,L))}function S(ie,L){for(;!L.reading&&!L.ended&&(L.length=L.length?(U=L.decoder?L.buffer.join(""):L.buffer.length===1?L.buffer.first():L.buffer.concat(L.length),L.buffer.clear()):U=L.buffer.consume(ie,L.decoder),U}function I(ie){var L=ie._readableState;X("endReadable",L.endEmitted),L.endEmitted||(L.ended=!0,c.nextTick(P,L,ie))}function P(ie,L){if(X("endReadableNT",ie.endEmitted,ie.length),!ie.endEmitted&&ie.length===0&&(ie.endEmitted=!0,L.readable=!1,L.emit("end"),ie.autoDestroy)){var U=L._writableState;(!U||U.autoDestroy&&U.finished)&&L.destroy()}}function $(ie,L){for(var U=0,ne=ie.length;U=L.highWaterMark)||L.ended))return X("read: emitReadable",L.length,L.ended),L.length===0&&L.ended?I(this):M(this),null;if(ie=_(ie,L),ie===0&&L.ended)return L.length===0&&I(this),null;var ne=L.needReadable;X("need readable",ne),(L.length===0||L.length-ie"u"?typeof self>"u"?typeof window>"u"?{}:window:self:u1)},{"../errors":15,"./_stream_duplex":16,"./internal/streams/async_iterator":21,"./internal/streams/buffer_list":22,"./internal/streams/destroy":23,"./internal/streams/from":25,"./internal/streams/state":27,"./internal/streams/stream":28,_process:12,buffer:3,events:7,inherits:10,"string_decoder/":31,util:2}],19:[function(s,i){function c(y,_){var v=this._transformState;v.transforming=!1;var M=v.writecb;if(M===null)return this.emit("error",new b);v.writechunk=null,v.writecb=null,_!=null&&this.push(_),M(y);var A=this._readableState;A.reading=!1,(A.needReadable||A.length"u"?typeof self>"u"?typeof window>"u"?{}:window:self:u1)},{"../errors":15,"./_stream_duplex":16,"./internal/streams/destroy":23,"./internal/streams/state":27,"./internal/streams/stream":28,_process:12,buffer:3,inherits:10,"util-deprecate":32}],21:[function(s,i){(function(c){(function(){function l(C,R,T){return R in C?Object.defineProperty(C,R,{value:T,enumerable:!0,configurable:!0,writable:!0}):C[R]=T,C}function u(C,R){return{value:C,done:R}}function d(C){var R=C[g];if(R!==null){var T=C[A].read();T!==null&&(C[v]=null,C[g]=null,C[z]=null,R(u(T,!1)))}}function p(C){c.nextTick(d,C)}function f(C,R){return function(T,E){C.then(function(){return R[_]?void T(u(void 0,!0)):void R[M](T,E)},E)}}var b,h=s("./end-of-stream"),g=Symbol("lastResolve"),z=Symbol("lastReject"),y=Symbol("error"),_=Symbol("ended"),v=Symbol("lastPromise"),M=Symbol("handlePromise"),A=Symbol("stream"),k=Object.getPrototypeOf(function(){}),S=Object.setPrototypeOf((b={get stream(){return this[A]},next:function(){var C=this,R=this[y];if(R!==null)return Promise.reject(R);if(this[_])return Promise.resolve(u(void 0,!0));if(this[A].destroyed)return new Promise(function(N,j){c.nextTick(function(){C[y]?j(C[y]):N(u(void 0,!0))})});var T,E=this[v];if(E)T=new Promise(f(E,this));else{var B=this[A].read();if(B!==null)return Promise.resolve(u(B,!1));T=new Promise(this[M])}return this[v]=T,T}},l(b,Symbol.asyncIterator,function(){return this}),l(b,"return",function(){var C=this;return new Promise(function(R,T){C[A].destroy(null,function(E){return E?void T(E):void R(u(void 0,!0))})})}),b),k);i.exports=function(C){var R,T=Object.create(S,(R={},l(R,A,{value:C,writable:!0}),l(R,g,{value:null,writable:!0}),l(R,z,{value:null,writable:!0}),l(R,y,{value:null,writable:!0}),l(R,_,{value:C._readableState.endEmitted,writable:!0}),l(R,M,{value:function(E,B){var N=T[A].read();N?(T[v]=null,T[g]=null,T[z]=null,E(u(N,!1))):(T[g]=E,T[z]=B)},writable:!0}),R));return T[v]=null,h(C,function(E){if(E&&E.code!=="ERR_STREAM_PREMATURE_CLOSE"){var B=T[z];return B!==null&&(T[v]=null,T[g]=null,T[z]=null,B(E)),void(T[y]=E)}var N=T[g];N!==null&&(T[v]=null,T[g]=null,T[z]=null,N(u(void 0,!0))),T[_]=!0}),C.on("readable",p.bind(null,T)),T}}).call(this)}).call(this,s("_process"))},{"./end-of-stream":24,_process:12}],22:[function(s,i){function c(v,M){var A=Object.keys(v);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(v);M&&(k=k.filter(function(S){return Object.getOwnPropertyDescriptor(v,S).enumerable})),A.push.apply(A,k)}return A}function l(v){for(var M,A=1;A>>0),k=this.head,S=0;k;)b(k.data,A,S),S+=k.data.length,k=k.next;return A}},{key:"consume",value:function(M,A){var k;return MC.length?C.length:M;if(S+=R===C.length?C:C.slice(0,M),M-=R,M===0){R===C.length?(++k,this.head=A.next?A.next:this.tail=null):(this.head=A,A.data=C.slice(R));break}++k}return this.length-=k,S}},{key:"_getBuffer",value:function(M){var A=g.allocUnsafe(M),k=this.head,S=1;for(k.data.copy(A),M-=k.data.length;k=k.next;){var C=k.data,R=M>C.length?C.length:M;if(C.copy(A,A.length-M,0,R),M-=R,M===0){R===C.length?(++S,this.head=k.next?k.next:this.tail=null):(this.head=k,k.data=C.slice(R));break}++S}return this.length-=S,A}},{key:_,value:function(M,A){return y(this,l({},A,{depth:0,customInspect:!1}))}}]),v}()},{buffer:3,util:2}],23:[function(s,i){(function(c){(function(){function l(p,f){d(p,f),u(p)}function u(p){p._writableState&&!p._writableState.emitClose||p._readableState&&!p._readableState.emitClose||p.emit("close")}function d(p,f){p.emit("error",f)}i.exports={destroy:function(p,f){var b=this,h=this._readableState&&this._readableState.destroyed,g=this._writableState&&this._writableState.destroyed;return h||g?(f?f(p):p&&(this._writableState?!this._writableState.errorEmitted&&(this._writableState.errorEmitted=!0,c.nextTick(d,this,p)):c.nextTick(d,this,p)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(p||null,function(z){!f&&z?b._writableState?b._writableState.errorEmitted?c.nextTick(u,b):(b._writableState.errorEmitted=!0,c.nextTick(l,b,z)):c.nextTick(l,b,z):f?(c.nextTick(u,b),f(z)):c.nextTick(u,b)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(p,f){var b=p._readableState,h=p._writableState;b&&b.autoDestroy||h&&h.autoDestroy?p.destroy(f):p.emit("error",f)}}}).call(this)}).call(this,s("_process"))},{_process:12}],24:[function(s,i){function c(f){var b=!1;return function(){if(!b){b=!0;for(var h=arguments.length,g=Array(h),z=0;zv.length)throw new z("streams");var k,S=v.map(function(C,R){var T=Rb){var h=f?p:"highWaterMark";throw new l(h,b)}return n(b)}return u.objectMode?16:16384}}},{"../../../errors":15}],28:[function(s,i){i.exports=s("events").EventEmitter},{events:7}],29:[function(s,i,c){c=i.exports=s("./lib/_stream_readable.js"),c.Stream=c,c.Readable=c,c.Writable=s("./lib/_stream_writable.js"),c.Duplex=s("./lib/_stream_duplex.js"),c.Transform=s("./lib/_stream_transform.js"),c.PassThrough=s("./lib/_stream_passthrough.js"),c.finished=s("./lib/internal/streams/end-of-stream.js"),c.pipeline=s("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":16,"./lib/_stream_passthrough.js":17,"./lib/_stream_readable.js":18,"./lib/_stream_transform.js":19,"./lib/_stream_writable.js":20,"./lib/internal/streams/end-of-stream.js":24,"./lib/internal/streams/pipeline.js":26}],30:[function(s,i,c){function l(f,b){for(var h in f)b[h]=f[h]}function u(f,b,h){return p(f,b,h)}/*! safe-buffer. MIT License. Feross Aboukhadijeh */var d=s("buffer"),p=d.Buffer;p.from&&p.alloc&&p.allocUnsafe&&p.allocUnsafeSlow?i.exports=d:(l(d,c),c.Buffer=u),u.prototype=Object.create(p.prototype),l(p,u),u.from=function(f,b,h){if(typeof f=="number")throw new TypeError("Argument must not be a number");return p(f,b,h)},u.alloc=function(f,b,h){if(typeof f!="number")throw new TypeError("Argument must be a number");var g=p(f);return b===void 0?g.fill(0):typeof h=="string"?g.fill(b,h):g.fill(b),g},u.allocUnsafe=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return p(f)},u.allocUnsafeSlow=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return d.SlowBuffer(f)}},{buffer:3}],31:[function(s,i,c){function l(S){if(!S)return"utf8";for(var C;;)switch(S){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return S;default:if(C)return;S=(""+S).toLowerCase(),C=!0}}function u(S){var C=l(S);if(typeof C!="string"&&(A.isEncoding===k||!k(S)))throw new Error("Unknown encoding: "+S);return C||S}function d(S){this.encoding=u(S);var C;switch(this.encoding){case"utf16le":this.text=g,this.end=z,C=4;break;case"utf8":this.fillLast=h,C=4;break;case"base64":this.text=y,this.end=_,C=3;break;default:return this.write=v,void(this.end=M)}this.lastNeed=0,this.lastTotal=0,this.lastChar=A.allocUnsafe(C)}function p(S){return 127>=S?0:S>>5==6?2:S>>4==14?3:S>>3==30?4:S>>6==2?-1:-2}function f(S,C,R){var T=C.length-1;if(T=T)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1],R.slice(0,-1)}return R}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=S[S.length-1],S.toString("utf16le",C,S.length-1)}function z(S){var C=S&&S.length?this.write(S):"";if(this.lastNeed){var R=this.lastTotal-this.lastNeed;return C+this.lastChar.toString("utf16le",0,R)}return C}function y(S,C){var R=(S.length-C)%3;return R==0?S.toString("base64",C):(this.lastNeed=3-R,this.lastTotal=3,R==1?this.lastChar[0]=S[S.length-1]:(this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1]),S.toString("base64",C,S.length-R))}function _(S){var C=S&&S.length?this.write(S):"";return this.lastNeed?C+this.lastChar.toString("base64",0,3-this.lastNeed):C}function v(S){return S.toString(this.encoding)}function M(S){return S&&S.length?this.write(S):""}var A=s("safe-buffer").Buffer,k=A.isEncoding||function(S){switch(S=""+S,S&&S.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};c.StringDecoder=d,d.prototype.write=function(S){if(S.length===0)return"";var C,R;if(this.lastNeed){if(C=this.fillLast(S),C===void 0)return"";R=this.lastNeed,this.lastNeed=0}else R=0;return R"u"?typeof self>"u"?typeof window>"u"?{}:window:self:u1)},{}],"/":[function(s,i){function c(_){return _.replace(/a=ice-options:trickle\s\n/g,"")}function l(_){console.warn(_)}/*! simple-peer. MIT License. Feross Aboukhadijeh */const u=s("debug")("simple-peer"),d=s("get-browser-rtc"),p=s("randombytes"),f=s("readable-stream"),b=s("queue-microtask"),h=s("err-code"),{Buffer:g}=s("buffer"),z=65536;class y extends f.Duplex{constructor(v){if(v=Object.assign({allowHalfOpen:!1},v),super(v),this._id=p(4).toString("hex").slice(0,7),this._debug("new peer %o",v),this.channelName=v.initiator?v.channelName||p(20).toString("hex"):null,this.initiator=v.initiator||!1,this.channelConfig=v.channelConfig||y.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},y.config,v.config),this.offerOptions=v.offerOptions||{},this.answerOptions=v.answerOptions||{},this.sdpTransform=v.sdpTransform||(M=>M),this.streams=v.streams||(v.stream?[v.stream]:[]),this.trickle=v.trickle===void 0||v.trickle,this.allowHalfTrickle=v.allowHalfTrickle!==void 0&&v.allowHalfTrickle,this.iceCompleteTimeout=v.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=v.wrtc&&typeof v.wrtc=="object"?v.wrtc:d(),!this._wrtc)throw h(typeof window>"u"?new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"):new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(M){return void this.destroy(h(M,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc=typeof this._pc._peerConnectionId=="number",this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=M=>{this._onIceCandidate(M)},typeof this._pc.peerIdentity=="object"&&this._pc.peerIdentity.catch(M=>{this.destroy(h(M,"ERR_PC_PEER_IDENTITY"))}),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=M=>{this._setupData(M)},this.streams&&this.streams.forEach(M=>{this.addStream(M)}),this._pc.ontrack=M=>{this._onTrack(M)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&this._channel.readyState==="open"}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(v){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if(typeof v=="string")try{v=JSON.parse(v)}catch{v={}}this._debug("signal()"),v.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),v.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(v.transceiverRequest.kind,v.transceiverRequest.init)),v.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(v.candidate):this._pendingCandidates.push(v.candidate)),v.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(v)).then(()=>{this.destroyed||(this._pendingCandidates.forEach(M=>{this._addIceCandidate(M)}),this._pendingCandidates=[],this._pc.remoteDescription.type==="offer"&&this._createAnswer())}).catch(M=>{this.destroy(h(M,"ERR_SET_REMOTE_DESCRIPTION"))}),v.sdp||v.candidate||v.renegotiate||v.transceiverRequest||this.destroy(h(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(v){const M=new this._wrtc.RTCIceCandidate(v);this._pc.addIceCandidate(M).catch(A=>{!M.address||M.address.endsWith(".local")?l("Ignoring unsupported ICE candidate."):this.destroy(h(A,"ERR_ADD_ICE_CANDIDATE"))})}send(v){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(v)}}addTransceiver(v,M){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(v,M),this._needsNegotiation()}catch(A){this.destroy(h(A,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:v,init:M}})}}addStream(v){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),v.getTracks().forEach(M=>{this.addTrack(M,v)})}}addTrack(v,M){if(this.destroying)return;if(this.destroyed)throw h(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const A=this._senderMap.get(v)||new Map;let k=A.get(M);if(!k)k=this._pc.addTrack(v,M),A.set(M,k),this._senderMap.set(v,A),this._needsNegotiation();else throw k.removed?h(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):h(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED")}replaceTrack(v,M,A){if(this.destroying)return;if(this.destroyed)throw h(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");const k=this._senderMap.get(v),S=k?k.get(A):null;if(!S)throw h(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");M&&this._senderMap.set(M,k),S.replaceTrack==null?this.destroy(h(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK")):S.replaceTrack(M)}removeTrack(v,M){if(this.destroying)return;if(this.destroyed)throw h(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const A=this._senderMap.get(v),k=A?A.get(M):null;if(!k)throw h(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{k.removed=!0,this._pc.removeTrack(k)}catch(S){S.name==="NS_ERROR_UNEXPECTED"?this._sendersAwaitingStable.push(k):this.destroy(h(S,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(v){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),v.getTracks().forEach(M=>{this.removeTrack(M,v)})}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,b(()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1}))}negotiate(){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout(()=>{this._createOffer()},0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(v){this._destroy(v,()=>{})}_destroy(v,M){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",v&&(v.message||v)),b(()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",v&&(v.message||v)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch{}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch{}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,v&&this.emit("error",v),this.emit("close"),M()}))}_setupData(v){if(!v.channel)return this.destroy(h(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=v.channel,this._channel.binaryType="arraybuffer",typeof this._channel.bufferedAmountLowThreshold=="number"&&(this._channel.bufferedAmountLowThreshold=z),this.channelName=this._channel.label,this._channel.onmessage=A=>{this._onChannelMessage(A)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=A=>{const k=A.error instanceof Error?A.error:new Error(`Datachannel error: ${A.message} ${A.filename}:${A.lineno}:${A.colno}`);this.destroy(h(k,"ERR_DATA_CHANNEL"))};let M=!1;this._closingInterval=setInterval(()=>{this._channel&&this._channel.readyState==="closing"?(M&&this._onChannelClose(),M=!0):M=!1},5e3)}_read(){}_write(v,M,A){if(this.destroyed)return A(h(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(v)}catch(k){return this.destroy(h(k,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>z?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=A):A(null)}else this._debug("write before connect"),this._chunk=v,this._cb=A}_onFinish(){if(!this.destroyed){const v=()=>{setTimeout(()=>this.destroy(),1e3)};this._connected?v():this.once("connect",v)}}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout(()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))},this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then(v=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(v.sdp=c(v.sdp)),v.sdp=this.sdpTransform(v.sdp);const M=()=>{if(!this.destroyed){const A=this._pc.localDescription||v;this._debug("signal"),this.emit("signal",{type:A.type,sdp:A.sdp})}};this._pc.setLocalDescription(v).then(()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?M():this.once("_iceComplete",M))}).catch(A=>{this.destroy(h(A,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(v=>{this.destroy(h(v,"ERR_CREATE_OFFER"))})}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach(v=>{v.mid||!v.sender.track||v.requested||(v.requested=!0,this.addTransceiver(v.sender.track.kind))})}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then(v=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(v.sdp=c(v.sdp)),v.sdp=this.sdpTransform(v.sdp);const M=()=>{if(!this.destroyed){const A=this._pc.localDescription||v;this._debug("signal"),this.emit("signal",{type:A.type,sdp:A.sdp}),this.initiator||this._requestMissingTransceivers()}};this._pc.setLocalDescription(v).then(()=>{this.destroyed||(this.trickle||this._iceComplete?M():this.once("_iceComplete",M))}).catch(A=>{this.destroy(h(A,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(v=>{this.destroy(h(v,"ERR_CREATE_ANSWER"))})}_onConnectionStateChange(){this.destroyed||this._pc.connectionState==="failed"&&this.destroy(h(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;const v=this._pc.iceConnectionState,M=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",v,M),this.emit("iceStateChange",v,M),(v==="connected"||v==="completed")&&(this._pcReady=!0,this._maybeReady()),v==="failed"&&this.destroy(h(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),v==="closed"&&this.destroy(h(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(v){const M=A=>(Object.prototype.toString.call(A.values)==="[object Array]"&&A.values.forEach(k=>{Object.assign(A,k)}),A);this._pc.getStats.length===0||this._isReactNativeWebrtc?this._pc.getStats().then(A=>{const k=[];A.forEach(S=>{k.push(M(S))}),v(null,k)},A=>v(A)):0{if(this.destroyed)return;const k=[];A.result().forEach(S=>{const C={};S.names().forEach(R=>{C[R]=S.stat(R)}),C.id=S.id,C.type=S.type,C.timestamp=S.timestamp,k.push(M(C))}),v(null,k)},A=>v(A)):v(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const v=()=>{this.destroyed||this.getStats((M,A)=>{if(this.destroyed)return;M&&(A=[]);const k={},S={},C={};let R=!1;A.forEach(E=>{(E.type==="remotecandidate"||E.type==="remote-candidate")&&(k[E.id]=E),(E.type==="localcandidate"||E.type==="local-candidate")&&(S[E.id]=E),(E.type==="candidatepair"||E.type==="candidate-pair")&&(C[E.id]=E)});const T=E=>{R=!0;let B=S[E.localCandidateId];B&&(B.ip||B.address)?(this.localAddress=B.ip||B.address,this.localPort=+B.port):B&&B.ipAddress?(this.localAddress=B.ipAddress,this.localPort=+B.portNumber):typeof E.googLocalAddress=="string"&&(B=E.googLocalAddress.split(":"),this.localAddress=B[0],this.localPort=+B[1]),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let N=k[E.remoteCandidateId];N&&(N.ip||N.address)?(this.remoteAddress=N.ip||N.address,this.remotePort=+N.port):N&&N.ipAddress?(this.remoteAddress=N.ipAddress,this.remotePort=+N.portNumber):typeof E.googRemoteAddress=="string"&&(N=E.googRemoteAddress.split(":"),this.remoteAddress=N[0],this.remotePort=+N[1]),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(A.forEach(E=>{E.type==="transport"&&E.selectedCandidatePairId&&T(C[E.selectedCandidatePairId]),(E.type==="googCandidatePair"&&E.googActiveConnection==="true"||(E.type==="candidatepair"||E.type==="candidate-pair")&&E.selected)&&T(E)}),!R&&(!Object.keys(C).length||Object.keys(S).length))return void setTimeout(v,100);if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(B){return this.destroy(h(B,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');const E=this._cb;this._cb=null,E(null)}typeof this._channel.bufferedAmountLowThreshold!="number"&&(this._interval=setInterval(()=>this._onInterval(),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")})};v()}_onInterval(){this._cb&&this._channel&&!(this._channel.bufferedAmount>z)&&this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||(this._pc.signalingState==="stable"&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach(v=>{this._pc.removeTrack(v),this._queuedNegotiation=!0}),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(v){this.destroyed||(v.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:v.candidate.candidate,sdpMLineIndex:v.candidate.sdpMLineIndex,sdpMid:v.candidate.sdpMid}}):!v.candidate&&!this._iceComplete&&(this._iceComplete=!0,this.emit("_iceComplete")),v.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(v){if(this.destroyed)return;let M=v.data;M instanceof ArrayBuffer&&(M=g.from(M)),this.push(M)}_onChannelBufferedAmountLow(){if(!this.destroyed&&this._cb){this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);const v=this._cb;this._cb=null,v(null)}}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(v){this.destroyed||v.streams.forEach(M=>{this._debug("on track"),this.emit("track",v.track,M),this._remoteTracks.push({track:v.track,stream:M}),this._remoteStreams.some(A=>A.id===M.id)||(this._remoteStreams.push(M),b(()=>{this._debug("on stream"),this.emit("stream",M)}))})}_debug(){const v=[].slice.call(arguments);v[0]="["+this._id+"] "+v[0],u.apply(null,v)}}y.WEBRTC_SUPPORT=!!d(),y.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},y.channelConfig={},i.exports=y},{buffer:3,debug:4,"err-code":6,"get-browser-rtc":8,"queue-microtask":13,randombytes:14,"readable-stream":29}]},{},[])("/")})}(WS)),WS.exports}var gBe=mBe();const MBe=Zr(gBe),hN=0,mN=1,vse=2,xse=(e,t)=>{rn(e,hN);const n=$Ee(t);Lr(e,n)},wse=(e,t,n)=>{rn(e,mN),Lr(e,iN(t,n))},zBe=(e,t,n)=>wse(t,n,w0(e)),_se=(e,t,n)=>{try{$1e(t,w0(e),n)}catch(o){console.error("Caught error while handling a Yjs update",o)}},OBe=(e,t)=>{rn(e,vse),Lr(e,t)},yBe=_se,ABe=(e,t,n,o)=>{const r=_n(e);switch(r){case hN:zBe(e,t,n);break;case mN:_se(e,n,o);break;case vse:yBe(e,n,o);break;default:throw new Error("Unknown message type")}return r},BS=3e4;class vBe extends h3{constructor(t){super(),this.doc=t,this.clientID=t.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const n=Wl();this.getLocalState()!==null&&BS/2<=n-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const o=[];this.meta.forEach((r,s)=>{s!==this.clientID&&BS<=n-r.lastUpdated&&this.states.has(s)&&o.push(s)}),o.length>0&&R8(this,o,"timeout")},Ac(BS/10)),t.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(t){const n=this.clientID,o=this.meta.get(n),r=o===void 0?0:o.clock+1,s=this.states.get(n);t===null?this.states.delete(n):this.states.set(n,t),this.meta.set(n,{clock:r,lastUpdated:Wl()});const i=[],c=[],l=[],u=[];t===null?u.push(n):s==null?t!=null&&i.push(n):(c.push(n),vM(s,t)||l.push(n)),(i.length>0||l.length>0||u.length>0)&&this.emit("change",[{added:i,updated:l,removed:u},"local"]),this.emit("update",[{added:i,updated:c,removed:u},"local"])}setLocalStateField(t,n){const o=this.getLocalState();o!==null&&this.setLocalState({...o,[t]:n})}getStates(){return this.states}}const R8=(e,t,n)=>{const o=[];for(let r=0;r0&&(e.emit("change",[{added:[],updated:[],removed:o},n]),e.emit("update",[{added:[],updated:[],removed:o},n]))},I4=(e,t,n=e.states)=>{const o=t.length,r=k0();rn(r,o);for(let s=0;s{const o=Tc(t),r=Wl(),s=[],i=[],c=[],l=[],u=_n(o);for(let d=0;d0||c.length>0||l.length>0)&&e.emit("change",[{added:s,updated:c,removed:l},n]),(s.length>0||i.length>0||l.length>0)&&e.emit("update",[{added:s,updated:i,removed:l},n])},wBe=(e,t)=>{const n=O8(e).buffer,o=O8(t).buffer;return crypto.subtle.importKey("raw",n,"PBKDF2",!1,["deriveKey"]).then(r=>crypto.subtle.deriveKey({name:"PBKDF2",salt:o,iterations:1e5,hash:"SHA-256"},r,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"]))},kse=(e,t)=>{if(!t)return YB(e);const n=crypto.getRandomValues(new Uint8Array(12));return crypto.subtle.encrypt({name:"AES-GCM",iv:n},t,e).then(o=>{const r=k0();return pc(r,"AES-GCM"),Lr(r,n),Lr(r,new Uint8Array(o)),kr(r)})},_Be=(e,t)=>{const n=k0();return th(n,e),kse(kr(n),t)},Sse=(e,t)=>{if(!t)return YB(e);const n=Tc(e);vl(n)!=="AES-GCM"&&N8e(ha("Unknown encryption algorithm"));const r=w0(n),s=w0(n);return crypto.subtle.decrypt({name:"AES-GCM",iv:r},t,s).then(i=>new Uint8Array(i))},Cse=(e,t)=>Sse(e,t).then(n=>nh(Tc(new Uint8Array(n)))),T0=_Ee("y-webrtc"),T2=0,qse=3,ez=1,gN=4,tz=new Map,bc=new Map,Rse=e=>{let t=!0;e.webrtcConns.forEach(n=>{n.synced||(t=!1)}),(!t&&e.synced||t&&!e.synced)&&(e.synced=t,e.provider.emit("synced",[{synced:t}]),T0("synced ",Si,e.name,mf," with all peers"))},Tse=(e,t,n)=>{const o=Tc(t),r=k0(),s=_n(o);if(e===void 0)return null;const i=e.awareness,c=e.doc;let l=!1;switch(s){case T2:{rn(r,T2);const u=ABe(o,r,c,e);u===mN&&!e.synced&&n(),u===hN&&(l=!0);break}case qse:rn(r,ez),Lr(r,I4(i,Array.from(i.getStates().keys()))),l=!0;break;case ez:xBe(i,w0(o),e);break;case gN:{const u=hf(o)===1,d=vl(o);if(d!==e.peerId&&(e.bcConns.has(d)&&!u||!e.bcConns.has(d)&&u)){const p=[],f=[];u?(e.bcConns.add(d),f.push(d)):(e.bcConns.delete(d),p.push(d)),e.provider.emit("peers",[{added:f,removed:p,webrtcPeers:Array.from(e.webrtcConns.keys()),bcPeers:Array.from(e.bcConns)}]),Ese(e)}break}default:return console.error("Unable to compute message"),r}return l?r:null},kBe=(e,t)=>{const n=e.room;return T0("received message from ",Si,e.remotePeerId,tN," (",n.name,")",mf,N5),Tse(n,t,()=>{e.synced=!0,T0("synced ",Si,n.name,mf," with ",Si,e.remotePeerId),Rse(n)})},NS=(e,t)=>{T0("send message to ",Si,e.remotePeerId,mf,tN," (",e.room.name,")",N5);try{e.peer.send(kr(t))}catch{}},SBe=(e,t)=>{T0("broadcast message in ",Si,e.name,mf),e.webrtcConns.forEach(n=>{try{n.peer.send(t)}catch{}})};class D4{constructor(t,n,o,r){T0("establishing connection to ",Si,o),this.room=r,this.remotePeerId=o,this.glareToken=void 0,this.closed=!1,this.connected=!1,this.synced=!1,this.peer=new MBe({initiator:n,...r.provider.peerOpts}),this.peer.on("signal",s=>{this.glareToken===void 0&&(this.glareToken=Date.now()+Math.random()),D5(t,r,{to:o,from:r.peerId,type:"signal",token:this.glareToken,signal:s})}),this.peer.on("connect",()=>{T0("connected to ",Si,o),this.connected=!0;const i=r.provider.doc,c=r.awareness,l=k0();rn(l,T2),xse(l,i),NS(this,l);const u=c.getStates();if(u.size>0){const d=k0();rn(d,ez),Lr(d,I4(c,Array.from(u.keys()))),NS(this,d)}}),this.peer.on("close",()=>{this.connected=!1,this.closed=!0,r.webrtcConns.has(this.remotePeerId)&&(r.webrtcConns.delete(this.remotePeerId),r.provider.emit("peers",[{removed:[this.remotePeerId],added:[],webrtcPeers:Array.from(r.webrtcConns.keys()),bcPeers:Array.from(r.bcConns)}])),Rse(r),this.peer.destroy(),T0("closed connection to ",Si,o),T8(r)}),this.peer.on("error",s=>{T0("Error in connection to ",Si,o,": ",s),T8(r)}),this.peer.on("data",s=>{const i=kBe(this,s);i!==null&&NS(this,i)})}destroy(){this.peer.destroy()}}const Gu=(e,t)=>kse(t,e.key).then(n=>e.mux(()=>bBe(e.name,n))),RU=(e,t)=>{e.bcconnected&&Gu(e,t),SBe(e,t)},T8=e=>{tz.forEach(t=>{t.connected&&(t.send({type:"subscribe",topics:[e.name]}),e.webrtcConns.size{if(e.provider.filterBcConns){const t=k0();rn(t,gN),KM(t,1),pc(t,e.peerId),Gu(e,kr(t))}};class CBe{constructor(t,n,o,r){this.peerId=u1e(),this.doc=t,this.awareness=n.awareness,this.provider=n,this.synced=!1,this.name=o,this.key=r,this.webrtcConns=new Map,this.bcConns=new Set,this.mux=hBe(),this.bcconnected=!1,this._bcSubscriber=s=>Sse(new Uint8Array(s),r).then(i=>this.mux(()=>{const c=Tse(this,i,()=>{});c&&Gu(this,kr(c))})),this._docUpdateHandler=(s,i)=>{const c=k0();rn(c,T2),OBe(c,s),RU(this,kr(c))},this._awarenessUpdateHandler=({added:s,updated:i,removed:c},l)=>{const u=s.concat(i).concat(c),d=k0();rn(d,ez),Lr(d,I4(this.awareness,u)),RU(this,kr(d))},this._beforeUnloadHandler=()=>{R8(this.awareness,[t.clientID],"window unload"),bc.forEach(s=>{s.disconnect()})},typeof window<"u"?window.addEventListener("beforeunload",this._beforeUnloadHandler):typeof yi<"u"&&yi.on("exit",this._beforeUnloadHandler)}connect(){this.doc.on("update",this._docUpdateHandler),this.awareness.on("update",this._awarenessUpdateHandler),T8(this);const t=this.name;pBe(t,this._bcSubscriber),this.bcconnected=!0,Ese(this);const n=k0();rn(n,T2),xse(n,this.doc),Gu(this,kr(n));const o=k0();rn(o,T2),wse(o,this.doc),Gu(this,kr(o));const r=k0();rn(r,qse),Gu(this,kr(r));const s=k0();rn(s,ez),Lr(s,I4(this.awareness,[this.doc.clientID])),Gu(this,kr(s))}disconnect(){tz.forEach(n=>{n.connected&&n.send({type:"unsubscribe",topics:[this.name]})}),R8(this.awareness,[this.doc.clientID],"disconnect");const t=k0();rn(t,gN),KM(t,0),pc(t,this.peerId),Gu(this,kr(t)),fBe(this.name,this._bcSubscriber),this.bcconnected=!1,this.doc.off("update",this._docUpdateHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.webrtcConns.forEach(n=>n.destroy())}destroy(){this.disconnect(),typeof window<"u"?window.removeEventListener("beforeunload",this._beforeUnloadHandler):typeof yi<"u"&&yi.off("exit",this._beforeUnloadHandler)}}const qBe=(e,t,n,o)=>{if(bc.has(n))throw ha(`A Yjs Doc connected to room "${n}" already exists!`);const r=new CBe(e,t,n,o);return bc.set(n,r),r},D5=(e,t,n)=>{t.key?_Be(n,t.key).then(o=>{e.send({type:"publish",topic:t.name,data:_1e(o)})}):e.send({type:"publish",topic:t.name,data:n})};class Wse extends lBe{constructor(t){super(t),this.providers=new Set,this.on("connect",()=>{T0(`connected (${t})`);const n=Array.from(bc.keys());this.send({type:"subscribe",topics:n}),bc.forEach(o=>D5(this,o,{type:"announce",from:o.peerId}))}),this.on("message",n=>{switch(n.type){case"publish":{const o=n.topic,r=bc.get(o);if(r==null||typeof o!="string")return;const s=i=>{const c=r.webrtcConns,l=r.peerId;if(i==null||i.from===l||i.to!==void 0&&i.to!==l||r.bcConns.has(i.from))return;const u=c.has(i.from)?()=>{}:()=>r.provider.emit("peers",[{removed:[],added:[i.from],webrtcPeers:Array.from(r.webrtcConns.keys()),bcPeers:Array.from(r.bcConns)}]);switch(i.type){case"announce":c.sizenew D4(this,!0,i.from,r)),u());break;case"signal":if(i.signal.type==="offer"){const d=c.get(i.from);if(d){const p=i.token,f=d.glareToken;if(f&&f>p){T0("offer rejected: ",i.from);return}d.glareToken=void 0}}if(i.signal.type==="answer"){T0("offer answered by: ",i.from);const d=c.get(i.from);d.glareToken=void 0}i.to===l&&(x1(c,i.from,()=>new D4(this,!1,i.from,r)).peer.signal(i.signal),u());break}};r.key?typeof n.data=="string"&&Cse(eN(n.data),r.key).then(s):s(n.data)}}}),this.on("disconnect",()=>T0(`disconnect (${t})`))}}class RBe extends h3{constructor(t,n,{signaling:o=["wss://y-webrtc-eu.fly.dev"],password:r=null,awareness:s=new vBe(n),maxConns:i=20+Ac(W8e()*15),filterBcConns:c=!0,peerOpts:l={}}={}){super(),this.roomName=t,this.doc=n,this.filterBcConns=c,this.awareness=s,this.shouldConnect=!1,this.signalingUrls=o,this.signalingConns=[],this.maxConns=i,this.peerOpts=l,this.key=r?wBe(r,t):YB(null),this.room=null,this.key.then(u=>{this.room=qBe(n,this,t,u),this.shouldConnect?this.room.connect():this.room.disconnect()}),this.connect(),this.destroy=this.destroy.bind(this),n.on("destroy",this.destroy)}get connected(){return this.room!==null&&this.shouldConnect}connect(){this.shouldConnect=!0,this.signalingUrls.forEach(t=>{const n=x1(tz,t,()=>new Wse(t));this.signalingConns.push(n),n.providers.add(this)}),this.room&&this.room.connect()}disconnect(){this.shouldConnect=!1,this.signalingConns.forEach(t=>{t.providers.delete(this),t.providers.size===0&&(t.destroy(),tz.delete(t.url))}),this.room&&this.room.disconnect()}destroy(){this.doc.off("destroy",this.destroy),this.key.then(()=>{this.room.destroy(),bc.delete(this.roomName)}),super.destroy()}}function TBe(e,t){e.on("connect",()=>{T0(`connected (${t})`);const n=Array.from(bc.keys());e.send({type:"subscribe",topics:n}),bc.forEach(o=>D5(e,o,{type:"announce",from:o.peerId}))}),e.on("message",n=>{switch(n.type){case"publish":{const o=n.topic,r=bc.get(o);if(r===null||typeof o!="string"||r===void 0)return;const s=i=>{const c=r.webrtcConns,l=r.peerId;if(i===null||i.from===l||i.to!==void 0&&i.to!==l||r.bcConns.has(i.from))return;const u=c.has(i.from)?()=>{}:()=>r.provider.emit("peers",[{removed:[],added:[i.from],webrtcPeers:Array.from(r.webrtcConns.keys()),bcPeers:Array.from(r.bcConns)}]);switch(i.type){case"announce":c.sizenew D4(e,!0,i.from,r)),u());break;case"signal":if(i.signal.type==="offer"){const d=c.get(i.from);if(d){const p=i.token,f=d.glareToken;if(f&&f>p){T0("offer rejected: ",i.from);return}d.glareToken=void 0}}if(i.signal.type==="answer"){T0("offer answered by: ",i.from);const d=c.get(i.from);d&&(d.glareToken=void 0)}i.to===l&&(x1(c,i.from,()=>new D4(e,!1,i.from,r)).peer.signal(i.signal),u());break}};r.key?typeof n.data=="string"&&Cse(eN(n.data),r.key).then(s):s(n.data)}}}),e.on("disconnect",()=>T0(`disconnect (${t})`))}function TU(e){if(e.shouldConnect&&e.ws===null){const t=Math.floor(1e5+Math.random()*9e5),n=e.url,o=new window.EventSource(en(n,{subscriber_id:t,action:"gutenberg_signaling_server"}));let r=null;o.onmessage=l=>{e.lastMessageReceived=Date.now();const u=l.data;if(u){const d=JSON.parse(u);Array.isArray(d)&&d.forEach(s)}},e.ws=o,e.connecting=!0,e.connected=!1;const s=l=>{l&&l.type==="pong"&&(clearTimeout(r),r=setTimeout(c,F4/2)),e.emit("message",[l,e])},i=l=>{e.ws!==null&&(e.ws.close(),e.ws=null,e.connecting=!1,e.connected?(e.connected=!1,e.emit("disconnect",[{type:"disconnect",error:l},e])):e.unsuccessfulReconnects++),clearTimeout(r)},c=()=>{e.ws&&e.ws.readyState===window.EventSource.OPEN&&e.send({type:"ping"})};e.ws&&(e.ws.onclose=()=>{i(null)},e.ws.send=function(u){window.fetch(n,{body:new URLSearchParams({subscriber_id:t.toString(),action:"gutenberg_signaling_server",message:u}),method:"POST"}).catch(()=>{T0("Error sending to server with message: "+u)})}),o.onerror=()=>{},o.onopen=()=>{e.connected||o.readyState===window.EventSource.OPEN&&(e.lastMessageReceived=Date.now(),e.connecting=!1,e.connected=!0,e.unsuccessfulReconnects=0,e.emit("connect",[{type:"connect"},e]),r=setTimeout(c,F4/2))}}}const F4=3e4;class EBe extends h3{constructor(t){super(),this.url=t,this.ws=null,this.binaryType=null,this.connected=!1,this.connecting=!1,this.unsuccessfulReconnects=0,this.lastMessageReceived=0,this.shouldConnect=!0,this._checkInterval=setInterval(()=>{this.connected&&F4{const n=x1(tz,t,t.startsWith("ws://")||t.startsWith("wss://")?()=>new Wse(t):()=>new EBe(t));this.signalingConns.push(n),n.providers.add(this)}),this.room&&this.room.connect()}}function BBe({signaling:e,password:t}){return function(n,o,r){const s=`${o}-${n}`;return new WBe(s,r,{signaling:e,password:t}),Promise.resolve(()=>!0)}}const NBe=(e,t)=>{const n={},o={},r={};function s(u,d){n[u]=d}async function i(u,d,p){const f=new Hh;r[u]=r[u]||{},r[u][d]=f;const b=()=>{const z=n[u].fromCRDTDoc(f);p(z)};f.on("update",b);const h=await e(d,u,f);t&&await t(d,u,f);const g=n[u].fetch;g&&g(d).then(z=>{f.transact(()=>{n[u].applyChangesToDoc(f,z)})}),o[u]=o[u]||{},o[u][d]=()=>{h(),f.off("update",b)}}async function c(u,d,p){const f=r[u][d];if(!f)throw"Error doc "+u+" "+d+" not found";f.transact(()=>{n[u].applyChangesToDoc(f,p)})}async function l(u,d){o?.[u]?.[d]&&o[u][d]()}return{register:s,bootstrap:i,update:c,discard:l}};let LS;function E8(){return LS||(LS=NBe(iBe,BBe({signaling:[window?.wp?.ajax?.settings?.url],password:window?.__experimentalCollaborativeEditingSecret}))),LS}function LBe(e,t){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(t)?t:[t],queryID:e}}function PBe(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function jBe(e){return{type:"ADD_ENTITIES",entities:e}}function IBe(e,t,n,o,r=!1,s,i){e==="postType"&&(n=(Array.isArray(n)?n:[n]).map(l=>l.status==="auto-draft"?{...l,title:""}:l));let c;return o?c=kCe(n,o,s,i):c=y0e(n,s,i),{...c,kind:e,name:t,invalidateCache:r}}function DBe(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function FBe(e){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:e}}function $Be(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:e,globalStyles:t}}function VBe(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:e,variations:t}}function HBe(){return Ze("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function UBe(e,t){return Ze("wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()",{since:"6.5.0",alternative:"wp.data.dispatch( 'core' ).receiveRevisions"}),{type:"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS",currentId:e,revisions:t}}function XBe(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}const Bse=(e,t,n,o,{__unstableFetch:r=Vt,throwOnError:s=!1}={})=>async({dispatch:i,resolveSelect:c})=>{const u=(await c.getEntitiesConfig(e)).find(b=>b.kind===e&&b.name===t);let d,p=!1;if(!u)return;const f=await i.__unstableAcquireStoreLock(Xo,["entities","records",e,t,n],{exclusive:!0});try{i({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:n});let b=!1;try{let h=`${u.baseURL}/${n}`;o&&(h=en(h,o)),p=await r({path:h,method:"DELETE"}),await i(_Ce(e,t,n,!0))}catch(h){b=!0,d=h}if(i({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:n,error:d}),b&&s)throw d;return p}finally{i.__unstableReleaseStoreLock(f)}},GBe=(e,t,n,o,r={})=>({select:s,dispatch:i})=>{const c=s.getEntityConfig(e,t);if(!c)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);const{mergedEdits:l={}}=c,u=s.getRawEntityRecord(e,t,n),d=s.getEditedEntityRecord(e,t,n),p={kind:e,name:t,recordId:n,edits:Object.keys(o).reduce((f,b)=>{const h=u[b],g=d[b],z=l[b]?{...g,...o[b]}:o[b];return f[b]=N0(h,z)?void 0:z,f},{})};if(window.__experimentalEnableSync&&c.syncConfig){if(globalThis.IS_GUTENBERG_PLUGIN){const f=c.getSyncObjectId(n);E8().update(c.syncObjectType+"--edit",f,p.edits)}}else r.undoIgnore||s.getUndoManager().addRecord([{id:{kind:e,name:t,recordId:n},changes:Object.keys(o).reduce((f,b)=>(f[b]={from:d[b],to:o[b]},f),{})}],r.isCached),i({type:"EDIT_ENTITY_RECORD",...p})},KBe=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().undo();n&&t({type:"UNDO",record:n})},YBe=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().redo();n&&t({type:"REDO",record:n})},ZBe=()=>({select:e})=>{e.getUndoManager().addRecord()},Nse=(e,t,n,{isAutosave:o=!1,__unstableFetch:r=Vt,throwOnError:s=!1}={})=>async({select:i,resolveSelect:c,dispatch:l})=>{const d=(await c.getEntitiesConfig(e)).find(h=>h.kind===e&&h.name===t);if(!d)return;const p=d.key||J0,f=n[p],b=await l.__unstableAcquireStoreLock(Xo,["entities","records",e,t,f||Fs()],{exclusive:!0});try{for(const[y,_]of Object.entries(n))if(typeof _=="function"){const v=_(i.getEditedEntityRecord(e,t,f));l.editEntityRecord(e,t,f,{[y]:v},{undoIgnore:!0}),n[y]=v}l({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:f,isAutosave:o});let h,g,z=!1;try{const y=`${d.baseURL}${f?"/"+f:""}`,_=i.getRawEntityRecord(e,t,f);if(o){const v=i.getCurrentUser(),M=v?v.id:void 0,A=await c.getAutosave(_.type,_.id,M);let k={..._,...A,...n};if(k=Object.keys(k).reduce((S,C)=>(["title","excerpt","content","meta"].includes(C)&&(S[C]=k[C]),S),{status:k.status==="auto-draft"?"draft":void 0}),h=await r({path:`${y}/autosaves`,method:"POST",data:k}),_.id===h.id){let S={..._,...k,...h};S=Object.keys(S).reduce((C,R)=>(["title","excerpt","content"].includes(R)?C[R]=S[R]:R==="status"?C[R]=_.status==="auto-draft"&&S.status==="draft"?S.status:_.status:C[R]=_[R],C),{}),l.receiveEntityRecords(e,t,S,void 0,!0)}else l.receiveAutosaves(_.id,h)}else{let v=n;d.__unstablePrePersist&&(v={...v,...d.__unstablePrePersist(_,v)}),h=await r({path:y,method:f?"PUT":"POST",data:v}),l.receiveEntityRecords(e,t,h,void 0,!0,v)}}catch(y){z=!0,g=y}if(l({type:"SAVE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:f,error:g,isAutosave:o}),z&&s)throw g;return h}finally{l.__unstableReleaseStoreLock(b)}},QBe=e=>async({dispatch:t})=>{const n=ZTe(),o={saveEntityRecord(i,c,l,u){return n.add(d=>t.saveEntityRecord(i,c,l,{...u,__unstableFetch:d}))},saveEditedEntityRecord(i,c,l,u){return n.add(d=>t.saveEditedEntityRecord(i,c,l,{...u,__unstableFetch:d}))},deleteEntityRecord(i,c,l,u,d){return n.add(p=>t.deleteEntityRecord(i,c,l,u,{...d,__unstableFetch:p}))}},r=e.map(i=>i(o)),[,...s]=await Promise.all([n.run(),...r]);return s},JBe=(e,t,n,o)=>async({select:r,dispatch:s,resolveSelect:i})=>{if(!r.hasEditsForEntityRecord(e,t,n))return;const l=(await i.getEntitiesConfig(e)).find(f=>f.kind===e&&f.name===t);if(!l)return;const u=l.key||J0,d=r.getEntityRecordNonTransientEdits(e,t,n),p={[u]:n,...d};return await s.saveEntityRecord(e,t,p,o)},eNe=(e,t,n,o,r)=>async({select:s,dispatch:i,resolveSelect:c})=>{if(!s.hasEditsForEntityRecord(e,t,n))return;const l=s.getEntityRecordNonTransientEdits(e,t,n),u={};for(const b of o)_5(u,b,xCe(l,b));const f=(await c.getEntitiesConfig(e)).find(b=>b.kind===e&&b.name===t)?.key||J0;return n&&(u[f]=n),await i.saveEntityRecord(e,t,u,r)};function tNe(e){return Ze("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),Lse("create/media",e)}function Lse(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function nNe(e){return{type:"RECEIVE_USER_PERMISSIONS",permissions:e}}function oNe(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:Array.isArray(t)?t:[t]}}function rNe(e){return{type:"RECEIVE_NAVIGATION_FALLBACK_ID",fallbackId:e}}function sNe(e,t){return{type:"RECEIVE_DEFAULT_TEMPLATE",query:e,templateId:t}}const iNe=(e,t,n,o,r,s=!1,i)=>async({dispatch:c,resolveSelect:l})=>{const d=(await l.getEntitiesConfig(e)).find(f=>f.kind===e&&f.name===t),p=d&&d?.revisionKey?d.revisionKey:J0;c({type:"RECEIVE_ITEM_REVISIONS",key:p,items:Array.isArray(o)?o:[o],recordKey:n,meta:i,query:r,kind:e,name:t,invalidateCache:s})},aNe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalBatch:QBe,__experimentalReceiveCurrentGlobalStylesId:FBe,__experimentalReceiveThemeBaseGlobalStyles:$Be,__experimentalReceiveThemeGlobalStyleVariations:VBe,__experimentalSaveSpecifiedEntityEdits:eNe,__unstableCreateUndoLevel:ZBe,addEntities:jBe,deleteEntityRecord:Bse,editEntityRecord:GBe,receiveAutosaves:oNe,receiveCurrentTheme:DBe,receiveCurrentUser:PBe,receiveDefaultTemplateId:sNe,receiveEmbedPreview:XBe,receiveEntityRecords:IBe,receiveNavigationFallbackId:rNe,receiveRevisions:iNe,receiveThemeGlobalStyleRevisions:UBe,receiveThemeSupports:HBe,receiveUploadPermissions:tNe,receiveUserPermission:Lse,receiveUserPermissions:nNe,receiveUserQuery:LBe,redo:YBe,saveEditedEntityRecord:JBe,saveEntityRecord:Nse,undo:KBe},Symbol.toStringTag,{value:"Module"}));function cNe(e,t){return{type:"RECEIVE_REGISTERED_POST_META",postType:e,registeredPostMeta:t}}const lNe=Object.freeze(Object.defineProperty({__proto__:null,receiveRegisteredPostMeta:cNe},Symbol.toStringTag,{value:"Module"}));let $b;function Bt(e){if(typeof e!="string"||e.indexOf("&")===-1)return e;$b===void 0&&(document.implementation&&document.implementation.createHTMLDocument?$b=document.implementation.createHTMLDocument("").createElement("textarea"):$b=document.createElement("textarea")),$b.innerHTML=e;const t=$b.textContent;return $b.innerHTML="",t}async function uNe(e,t={},n={}){const o=t.isInitialSuggestions&&t.initialSuggestionsSearchOptions?{...t,...t.initialSuggestionsSearchOptions}:t,{type:r,subtype:s,page:i,perPage:c=t.isInitialSuggestions?3:20}=o,{disablePostFormats:l=!1}=n,u=[];(!r||r==="post")&&u.push(Vt({path:en("/wp/v2/search",{search:e,page:i,per_page:c,type:"post",subtype:s})}).then(f=>f.map(b=>({id:b.id,url:b.url,title:Bt(b.title||"")||m("(no title)"),type:b.subtype||b.type,kind:"post-type"}))).catch(()=>[])),(!r||r==="term")&&u.push(Vt({path:en("/wp/v2/search",{search:e,page:i,per_page:c,type:"term",subtype:s})}).then(f=>f.map(b=>({id:b.id,url:b.url,title:Bt(b.title||"")||m("(no title)"),type:b.subtype||b.type,kind:"taxonomy"}))).catch(()=>[])),!l&&(!r||r==="post-format")&&u.push(Vt({path:en("/wp/v2/search",{search:e,page:i,per_page:c,type:"post-format",subtype:s})}).then(f=>f.map(b=>({id:b.id,url:b.url,title:Bt(b.title||"")||m("(no title)"),type:b.subtype||b.type,kind:"taxonomy"}))).catch(()=>[])),(!r||r==="attachment")&&u.push(Vt({path:en("/wp/v2/media",{search:e,page:i,per_page:c})}).then(f=>f.map(b=>({id:b.id,url:b.source_url,title:Bt(b.title.rendered||"")||m("(no title)"),type:b.type,kind:"media"}))).catch(()=>[]));let p=(await Promise.all(u)).flat();return p=p.filter(f=>!!f.id),p=dNe(p,e),p=p.slice(0,c),p}function dNe(e,t){const n=EU(t),o={};for(const r of e)if(r.title){const s=EU(r.title),i=s.filter(d=>n.some(p=>d===p)),c=s.filter(d=>n.some(p=>d!==p&&d.includes(p))),l=i.length/s.length*10,u=c.length/s.length;o[r.id]=l+u}else o[r.id]=0;return e.sort((r,s)=>o[s.id]-o[r.id])}function EU(e){return e.toLowerCase().match(/[\p{L}\p{N}]+/gu)||[]}const PS=new Map,pNe=async(e,t={})=>{const n="/wp-block-editor/v1/url-details",o={url:Df(e)};if(!If(e))return Promise.reject(`${e} is not a valid URL.`);const r=S5(e);return!r||!TB(r)||!r.startsWith("http")||!/^https?:\/\/[^\/\s]/i.test(e)?Promise.reject(`${e} does not have a valid protocol. URLs must be "http" based`):PS.has(e)?PS.get(e):Vt({path:en(n,o),...t}).then(s=>(PS.set(e,s),s))};async function fNe(){const e=await Vt({path:"/wp/v2/block-patterns/patterns"});return e?e.map(t=>Object.fromEntries(Object.entries(t).map(([n,o])=>[bB(n),o]))):[]}const bNe=e=>async({dispatch:t})=>{const n=en("/wp/v2/users/?who=authors&per_page=100",e),o=await Vt({path:n});t.receiveUserQuery(n,o)},hNe=()=>async({dispatch:e})=>{const t=await Vt({path:"/wp/v2/users/me"});e.receiveCurrentUser(t)},Pse=(e,t,n="",o)=>async({select:r,dispatch:s,registry:i,resolveSelect:c})=>{const u=(await c.getEntitiesConfig(e)).find(p=>p.name===t&&p.kind===e);if(!u)return;const d=await s.__unstableAcquireStoreLock(Xo,["entities","records",e,t,n],{exclusive:!1});try{if(window.__experimentalEnableSync&&u.syncConfig&&!o){if(globalThis.IS_GUTENBERG_PLUGIN){const p=u.getSyncObjectId(n);await E8().bootstrap(u.syncObjectType,p,f=>{s.receiveEntityRecords(e,t,f,o)}),await E8().bootstrap(u.syncObjectType+"--edit",p,f=>{s({type:"EDIT_ENTITY_RECORD",kind:e,name:t,recordId:n,edits:f,meta:{undo:void 0}})})}}else{o!==void 0&&o._fields&&(o={...o,_fields:[...new Set([...xd(o._fields)||[],u.key||J0])].join()});const p=en(u.baseURL+(n?"/"+n:""),{...u.baseURLParams,...o});if(o!==void 0&&o._fields&&(o={...o,include:[n]},r.hasEntityRecords(e,t,o)))return;const f=await Vt({path:p,parse:!1}),b=await f.json(),h=RB(f.headers?.get("allow")),g=[],z={};for(const y of yM)z[k5(y,{kind:e,name:t,id:n})]=h[y],g.push([y,{kind:e,name:t,id:n}]);i.batch(()=>{s.receiveEntityRecords(e,t,b,o),s.receiveUserPermissions(z),s.finishResolutions("canUser",g)})}}finally{s.__unstableReleaseStoreLock(d)}},mNe=qB("getEntityRecord"),gNe=qB("getEntityRecord"),$4=(e,t,n={})=>async({dispatch:o,registry:r,resolveSelect:s})=>{const c=(await s.getEntitiesConfig(e)).find(p=>p.name===t&&p.kind===e);if(!c)return;const l=await o.__unstableAcquireStoreLock(Xo,["entities","records",e,t],{exclusive:!1}),u=c.key||J0;function d(p){return p.filter(f=>f?.[u]).map(f=>[e,t,f[u]])}try{n._fields&&(n={...n,_fields:[...new Set([...xd(n._fields)||[],c.key||J0])].join()});const p=en(c.baseURL,{...c.baseURLParams,...n});let f=[],b;if(c.supportsPagination&&n.per_page!==-1){const h=await Vt({path:p,parse:!1});f=Object.values(await h.json()),b={totalItems:parseInt(h.headers.get("X-WP-Total")),totalPages:parseInt(h.headers.get("X-WP-TotalPages"))}}else if(n.per_page===-1&&n[O0e]===!0){let h=1,g;do{const z=await Vt({path:en(p,{page:h,per_page:100}),parse:!1}),y=Object.values(await z.json());g=parseInt(z.headers.get("X-WP-TotalPages")),f.push(...y),r.batch(()=>{o.receiveEntityRecords(e,t,f,n),o.finishResolutions("getEntityRecord",d(y))}),h++}while(h<=g);b={totalItems:f.length,totalPages:1}}else f=Object.values(await Vt({path:p})),b={totalItems:f.length,totalPages:1};n._fields&&(f=f.map(h=>(n._fields.split(",").forEach(g=>{h.hasOwnProperty(g)||(h[g]=void 0)}),h))),r.batch(()=>{if(o.receiveEntityRecords(e,t,f,n,!1,void 0,b),!n?._fields&&!n.context){const h=f.filter(y=>y?.[u]).map(y=>({id:y[u],permissions:RB(y?._links?.self?.[0].targetHints.allow)})),g=[],z={};for(const y of h)for(const _ of yM)g.push([_,{kind:e,name:t,id:y.id}]),z[k5(_,{kind:e,name:t,id:y.id})]=y.permissions[_];o.receiveUserPermissions(z),o.finishResolutions("getEntityRecord",d(f)),o.finishResolutions("canUser",g)}o.__unstableReleaseStoreLock(l)})}catch{o.__unstableReleaseStoreLock(l)}};$4.shouldInvalidate=(e,t,n)=>(e.type==="RECEIVE_ITEMS"||e.type==="REMOVE_ITEMS")&&e.invalidateCache&&t===e.kind&&n===e.name;const MNe=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("root","theme",{status:"active"});e.receiveCurrentTheme(n[0])},zNe=qB("getCurrentTheme"),ONe=e=>async({dispatch:t})=>{try{const n=await Vt({path:en("/oembed/1.0/proxy",{url:e})});t.receiveEmbedPreview(e,n)}catch{t.receiveEmbedPreview(e,!1)}},jse=(e,t,n)=>async({dispatch:o,registry:r,resolveSelect:s})=>{if(!yM.includes(e))throw new Error(`'${e}' is not a valid action.`);const{hasStartedResolution:i}=r.select(Xo);for(const d of yM){if(d===e)continue;if(i("canUser",[d,t,n]))return}let c=null;if(typeof t=="object"){if(!t.kind||!t.name)throw new Error("The entity resource object is not valid.");const p=(await s.getEntitiesConfig(t.kind)).find(f=>f.name===t.name&&f.kind===t.kind);if(!p)return;c=p.baseURL+(t.id?"/"+t.id:"")}else c=`/wp/v2/${t}`+(n?"/"+n:"");let l;try{l=await Vt({path:c,method:"OPTIONS",parse:!1})}catch{return}const u=RB(l.headers?.get("allow"));r.batch(()=>{for(const d of yM){const p=k5(d,t,n);o.receiveUserPermission(p,u[d]),d!==e&&o.finishResolution("canUser",[d,t,n])}})},yNe=(e,t,n)=>async({dispatch:o})=>{await o(jse("update",{kind:e,name:t,id:n}))},ANe=(e,t)=>async({dispatch:n,resolveSelect:o})=>{const{rest_base:r,rest_namespace:s="wp/v2",supports:i}=await o.getPostType(e);if(!i?.autosave)return;const c=await Vt({path:`/${s}/${r}/${t}/autosaves?context=edit`});c&&c.length&&n.receiveAutosaves(t,c)},vNe=(e,t)=>async({resolveSelect:n})=>{await n.getAutosaves(e,t)},xNe=()=>async({dispatch:e,resolveSelect:t})=>{const o=(await t.getEntityRecords("root","theme",{status:"active"}))?.[0]?._links?.["wp:user-global-styles"]?.[0]?.href;if(!o)return;const r=o.match(/\/(\d+)(?:\?|$)/),s=r?Number(r[1]):null;s&&e.__experimentalReceiveCurrentGlobalStylesId(s)},wNe=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),o=await Vt({path:`/wp/v2/global-styles/themes/${n.stylesheet}?context=view`});t.__experimentalReceiveThemeBaseGlobalStyles(n.stylesheet,o)},_Ne=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),o=await Vt({path:`/wp/v2/global-styles/themes/${n.stylesheet}/variations?context=view`});t.__experimentalReceiveThemeGlobalStyleVariations(n.stylesheet,o)},Ise=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.__experimentalGetCurrentGlobalStylesId(),r=(n?await e.getEntityRecord("root","globalStyles",n):void 0)?._links?.["version-history"]?.[0]?.href;if(r){const i=(await Vt({url:r}))?.map(c=>Object.fromEntries(Object.entries(c).map(([l,u])=>[bB(l),u])));t.receiveThemeGlobalStyleRevisions(n,i)}};Ise.shouldInvalidate=e=>e.type==="SAVE_ENTITY_RECORD_FINISH"&&e.kind==="root"&&!e.error&&e.name==="globalStyles";const kNe=()=>async({dispatch:e})=>{const t=await fNe();e({type:"RECEIVE_BLOCK_PATTERNS",patterns:t})},SNe=()=>async({dispatch:e})=>{const t=await Vt({path:"/wp/v2/block-patterns/categories"});e({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:t})},CNe=()=>async({dispatch:e,resolveSelect:t})=>{const o=(await t.getEntityRecords("taxonomy","wp_pattern_category",{per_page:-1,_fields:"id,name,description,slug",context:"view"}))?.map(r=>({...r,label:Bt(r.name),name:r.slug}))||[];e({type:"RECEIVE_USER_PATTERN_CATEGORIES",patternCategories:o})},qNe=()=>async({dispatch:e,select:t,registry:n})=>{const o=await Vt({path:en("/wp-block-editor/v1/navigation-fallback",{_embed:!0})}),r=o?._embedded?.self;n.batch(()=>{if(e.receiveNavigationFallbackId(o?.id),!r)return;const i=!t.getEntityRecord("postType","wp_navigation",o.id);e.receiveEntityRecords("postType","wp_navigation",r,void 0,i),e.finishResolution("getEntityRecord",["postType","wp_navigation",o.id])})},RNe=e=>async({dispatch:t,registry:n,resolveSelect:o})=>{const r=await Vt({path:en("/wp/v2/templates/lookup",e)});await o.getEntitiesConfig("postType"),r?.id&&n.batch(()=>{t.receiveDefaultTemplateId(e,r.id),t.receiveEntityRecords("postType","wp_template",[r]),t.finishResolution("getEntityRecord",["postType","wp_template",r.id])})},Dse=(e,t,n,o={})=>async({dispatch:r,registry:s,resolveSelect:i})=>{const l=(await i.getEntitiesConfig(e)).find(h=>h.name===t&&h.kind===e);if(!l)return;o._fields&&(o={...o,_fields:[...new Set([...xd(o._fields)||[],l.revisionKey||J0])].join()});const u=en(l.getRevisionsUrl(n),o);let d,p;const f={},b=l.supportsPagination&&o.per_page!==-1;try{p=await Vt({path:u,parse:!b})}catch{return}p&&(b?(d=Object.values(await p.json()),f.totalItems=parseInt(p.headers.get("X-WP-Total"))):d=Object.values(p),o._fields&&(d=d.map(h=>(o._fields.split(",").forEach(g=>{h.hasOwnProperty(g)||(h[g]=void 0)}),h))),s.batch(()=>{if(r.receiveRevisions(e,t,n,d,o,!1,f),!o?._fields&&!o.context){const h=l.key||J0,g=d.filter(z=>z[h]).map(z=>[e,t,n,z[h]]);r.finishResolutions("getRevision",g)}}))};Dse.shouldInvalidate=(e,t,n,o)=>e.type==="SAVE_ENTITY_RECORD_FINISH"&&n===e.name&&t===e.kind&&!e.error&&o===e.recordId;const TNe=(e,t,n,o,r)=>async({dispatch:s,resolveSelect:i})=>{const l=(await i.getEntitiesConfig(e)).find(p=>p.name===t&&p.kind===e);if(!l)return;r!==void 0&&r._fields&&(r={...r,_fields:[...new Set([...xd(r._fields)||[],l.revisionKey||J0])].join()});const u=en(l.getRevisionsUrl(n,o),r);let d;try{d=await Vt({path:u})}catch{return}d&&s.receiveRevisions(e,t,n,d,r)},ENe=e=>async({dispatch:t,resolveSelect:n})=>{let o;try{const{rest_namespace:r="wp/v2",rest_base:s}=await n.getPostType(e)||{};o=await Vt({path:`${r}/${s}/?context=edit`,method:"OPTIONS"})}catch{return}o&&t.receiveRegisteredPostMeta(e,o?.schema?.properties?.meta?.properties)},WNe=e=>async({dispatch:t})=>{const n=H0e.find(o=>o.kind===e);if(n)try{const o=await n.loadEntities();if(!o.length)return;t.addEntities(o)}catch{}},BNe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalGetCurrentGlobalStylesId:xNe,__experimentalGetCurrentThemeBaseGlobalStyles:wNe,__experimentalGetCurrentThemeGlobalStylesVariations:_Ne,canUser:jse,canUserEditEntityRecord:yNe,getAuthors:bNe,getAutosave:vNe,getAutosaves:ANe,getBlockPatternCategories:SNe,getBlockPatterns:kNe,getCurrentTheme:MNe,getCurrentThemeGlobalStylesRevisions:Ise,getCurrentUser:hNe,getDefaultTemplateId:RNe,getEditedEntityRecord:gNe,getEmbedPreview:ONe,getEntitiesConfig:WNe,getEntityRecord:Pse,getEntityRecords:$4,getNavigationFallbackId:qNe,getRawEntityRecord:mNe,getRegisteredPostMeta:ENe,getRevision:TNe,getRevisions:Dse,getThemeSupports:zNe,getUserPatternCategories:CNe},Symbol.toStringTag,{value:"Module"}));function WU(e,t){const n={...e};let o=n;for(const r of t)o.children={...o.children,[r]:{locks:[],children:{},...o.children[r]}},o=o.children[r];return n}function W8(e,t){let n=e;for(const o of t){const r=n.children[o];if(!r)return null;n=r}return n}function*NNe(e,t){let n=e;yield n;for(const o of t){const r=n.children[o];if(!r)break;yield r,n=r}}function*LNe(e){const t=Object.values(e.children);for(;t.length;){const n=t.pop();yield n,t.push(...Object.values(n.children))}}function BU({exclusive:e},t){return!!(e&&t.length||!e&&t.filter(n=>n.exclusive).length)}const PNe={requests:[],tree:{locks:[],children:{}}};function mA(e=PNe,t){switch(t.type){case"ENQUEUE_LOCK_REQUEST":{const{request:n}=t;return{...e,requests:[n,...e.requests]}}case"GRANT_LOCK_REQUEST":{const{lock:n,request:o}=t,{store:r,path:s}=o,i=[r,...s],c=WU(e.tree,i),l=W8(c,i);return l.locks=[...l.locks,n],{...e,requests:e.requests.filter(u=>u!==o),tree:c}}case"RELEASE_LOCK":{const{lock:n}=t,o=[n.store,...n.path],r=WU(e.tree,o),s=W8(r,o);return s.locks=s.locks.filter(i=>i!==n),{...e,tree:r}}}return e}function jNe(e){return e.requests}function INe(e,t,n,{exclusive:o}){const r=[t,...n],s=e.tree;for(const c of NNe(s,r))if(BU({exclusive:o},c.locks))return!1;const i=W8(s,r);if(!i)return!0;for(const c of LNe(i))if(BU({exclusive:o},c.locks))return!1;return!0}function DNe(){let e=mA(void 0,{type:"@@INIT"});function t(){for(const r of jNe(e)){const{store:s,path:i,exclusive:c,notifyAcquired:l}=r;if(INe(e,s,i,{exclusive:c})){const u={store:s,path:i,exclusive:c};e=mA(e,{type:"GRANT_LOCK_REQUEST",lock:u,request:r}),l(u)}}}function n(r,s,i){return new Promise(c=>{e=mA(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:r,path:s,exclusive:i,notifyAcquired:c}}),t()})}function o(r){e=mA(e,{type:"RELEASE_LOCK",lock:r}),t()}return{acquire:n,release:o}}function FNe(){const e=DNe();function t(o,r,{exclusive:s}){return()=>e.acquire(o,r,s)}function n(o){return()=>e.release(o)}return{__unstableAcquireStoreLock:t,__unstableReleaseStoreLock:n}}let $Ne,VNe;const B8=x.createContext({});function N8({kind:e,type:t,id:n,children:o}){const r=x.useContext(B8),s=x.useMemo(()=>({...r,[e]:{...r?.[e],[t]:n}}),[r,e,t,n]);return a.jsx(B8.Provider,{value:s,children:o})}let rs=function(e){return e.Idle="IDLE",e.Resolving="RESOLVING",e.Error="ERROR",e.Success="SUCCESS",e}({});const HNe=["getIsResolving","hasStartedResolution","hasFinishedResolution","isResolving","getCachedResolvers"];function MN(e,t){return G((n,o)=>e(s=>UNe(n(s)),o),t)}const UNe=Us(e=>{const t={};for(const n in e)HNe.includes(n)||Object.defineProperty(t,n,{get:()=>(...o)=>{const r=e[n](...o),s=e.getResolutionState(n,o)?.status;let i;switch(s){case"resolving":i=rs.Resolving;break;case"finished":i=rs.Success;break;case"error":i=rs.Error;break;case void 0:i=rs.Idle;break}return{data:r,status:i,isResolving:i===rs.Resolving,hasStarted:i!==rs.Idle,hasResolved:i===rs.Success||i===rs.Error}}});return t}),NU={};function F5(e,t,n,o={enabled:!0}){const{editEntityRecord:r,saveEditedEntityRecord:s}=ze(Me),i=x.useMemo(()=>({edit:(f,b={})=>r(e,t,n,f,b),save:(f={})=>s(e,t,n,{throwOnError:!0,...f})}),[r,e,t,n,s]),{editedRecord:c,hasEdits:l,edits:u}=G(f=>o.enabled?{editedRecord:f(Me).getEditedEntityRecord(e,t,n),hasEdits:f(Me).hasEditsForEntityRecord(e,t,n),edits:f(Me).getEntityRecordNonTransientEdits(e,t,n)}:{editedRecord:NU,hasEdits:!1,edits:NU},[e,t,n,o.enabled]),{data:d,...p}=MN(f=>o.enabled?f(Me).getEntityRecord(e,t,n):{data:null},[e,t,n,o.enabled]);return{record:d,editedRecord:c,hasEdits:l,edits:u,...p,...i}}const XNe=[];function xl(e,t,n={},o={enabled:!0}){const r=en("",n),{data:s,...i}=MN(u=>o.enabled?u(Me).getEntityRecords(e,t,n):{data:XNe},[e,t,r,o.enabled]),{totalItems:c,totalPages:l}=G(u=>o.enabled?{totalItems:u(Me).getEntityRecordsTotalItems(e,t,n),totalPages:u(Me).getEntityRecordsTotalPages(e,t,n)}:{totalItems:null,totalPages:null},[e,t,r,o.enabled]);return{records:s,totalItems:c,totalPages:l,...i}}function GNe(e,t,n={},o={enabled:!0}){const r=G(d=>d(Me).getEntityConfig(e,t),[e,t]),{records:s,...i}=xl(e,t,n,o),c=x.useMemo(()=>{var d;return(d=s?.map(p=>{var f;return p[(f=r?.key)!==null&&f!==void 0?f:"id"]}))!==null&&d!==void 0?d:[]},[s,r?.key]),l=G(d=>{const{getEntityRecordsPermissions:p}=eh(d(Me));return p(e,t,c)},[c,e,t]);return{records:x.useMemo(()=>{var d;return(d=s?.map((p,f)=>({...p,permissions:l[f]})))!==null&&d!==void 0?d:[]},[s,l]),...i}}const LU=new Set;function KNe(){return globalThis.SCRIPT_DEBUG===!0}function On(e){if(KNe()&&!LU.has(e)){console.warn(e);try{throw Error(e)}catch{}LU.add(e)}}function Fse(e,t){const n=typeof e=="object",o=n?JSON.stringify(e):e;return MN(r=>{const s=n?!!e.id:!1,{canUser:i}=r(Me),c=i("create",n?{kind:e.kind,name:e.name}:e);if(!s){const h=i("read",e),g=c.isResolving||h.isResolving,z=c.hasResolved&&h.hasResolved;let y=rs.Idle;return g?y=rs.Resolving:z&&(y=rs.Success),{status:y,isResolving:g,hasResolved:z,canCreate:c.hasResolved&&c.data,canRead:h.hasResolved&&h.data}}const l=i("read",e,t),u=i("update",e,t),d=i("delete",e,t),p=l.isResolving||c.isResolving||u.isResolving||d.isResolving,f=l.hasResolved&&c.hasResolved&&u.hasResolved&&d.hasResolved;let b=rs.Idle;return p?b=rs.Resolving:f&&(b=rs.Success),{status:b,isResolving:p,hasResolved:f,canRead:f&&l.data,canCreate:f&&c.data,canUpdate:f&&u.data,canDelete:f&&d.data}},[o,t])}var YNe={grad:.9,turn:360,rad:360/(2*Math.PI)},Jc=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},_0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Ci=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},$se=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},PU=function(e){return{r:Ci(e.r,0,255),g:Ci(e.g,0,255),b:Ci(e.b,0,255),a:Ci(e.a)}},jS=function(e){return{r:_0(e.r),g:_0(e.g),b:_0(e.b),a:_0(e.a,3)}},ZNe=/^#([0-9a-f]{3,8})$/i,gA=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Vse=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,s=Math.max(t,n,o),i=s-Math.min(t,n,o),c=i?s===t?(n-o)/i:s===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(c<0?c+6:c),s:s?i/s*100:0,v:s/255*100,a:r}},Hse=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var s=Math.floor(t),i=o*(1-n),c=o*(1-(t-s)*n),l=o*(1-(1-t+s)*n),u=s%6;return{r:255*[o,c,i,i,l,o][u],g:255*[l,o,o,c,i,i][u],b:255*[i,i,l,o,o,c][u],a:r}},jU=function(e){return{h:$se(e.h),s:Ci(e.s,0,100),l:Ci(e.l,0,100),a:Ci(e.a)}},IU=function(e){return{h:_0(e.h),s:_0(e.s),l:_0(e.l),a:_0(e.a,3)}},DU=function(e){return Hse((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},xM=function(e){return{h:(t=Vse(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},QNe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,JNe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,eLe=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,tLe=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,L8={string:[[function(e){var t=ZNe.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:e.length===4?_0(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?_0(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=eLe.exec(e)||tLe.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:PU({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:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=QNe.exec(e)||JNe.exec(e);if(!t)return null;var n,o,r=jU({h:(n=t[1],o=t[2],o===void 0&&(o="deg"),Number(n)*(YNe[o]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return DU(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,s=r===void 0?1:r;return Jc(t)&&Jc(n)&&Jc(o)?PU({r:Number(t),g:Number(n),b:Number(o),a:Number(s)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,s=r===void 0?1:r;if(!Jc(t)||!Jc(n)||!Jc(o))return null;var i=jU({h:Number(t),s:Number(n),l:Number(o),a:Number(s)});return DU(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,s=r===void 0?1:r;if(!Jc(t)||!Jc(n)||!Jc(o))return null;var i=function(c){return{h:$se(c.h),s:Ci(c.s,0,100),v:Ci(c.v,0,100),a:Ci(c.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(s)});return Hse(i)},"hsv"]]},FU=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=jS(this.rgba),n=t.r,o=t.g,r=t.b,i=(s=t.a)<1?gA(_0(255*s)):"","#"+gA(n)+gA(o)+gA(r)+i;var t,n,o,r,s,i},e.prototype.toRgb=function(){return jS(this.rgba)},e.prototype.toRgbString=function(){return t=jS(this.rgba),n=t.r,o=t.g,r=t.b,(s=t.a)<1?"rgba("+n+", "+o+", "+r+", "+s+")":"rgb("+n+", "+o+", "+r+")";var t,n,o,r,s},e.prototype.toHsl=function(){return IU(xM(this.rgba))},e.prototype.toHslString=function(){return t=IU(xM(this.rgba)),n=t.h,o=t.s,r=t.l,(s=t.a)<1?"hsla("+n+", "+o+"%, "+r+"%, "+s+")":"hsl("+n+", "+o+"%, "+r+"%)";var t,n,o,r,s},e.prototype.toHsv=function(){return t=Vse(this.rgba),{h:_0(t.h),s:_0(t.s),v:_0(t.v),a:_0(t.a,3)};var t},e.prototype.invert=function(){return sn({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),sn(IS(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),sn(IS(this.rgba,-t))},e.prototype.grayscale=function(){return sn(IS(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),sn($U(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),sn($U(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?sn({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):_0(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=xM(this.rgba);return typeof t=="number"?sn({h:t,s:n.s,l:n.l,a:n.a}):_0(n.h)},e.prototype.isEqual=function(t){return this.toHex()===sn(t).toHex()},e}(),sn=function(e){return e instanceof P8?e:new P8(e)},VU=[],Gs=function(e){e.forEach(function(t){VU.indexOf(t)<0&&(t(P8,L8),VU.push(t))})};function Ks(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 s={};e.prototype.toName=function(i){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var c,l,u=o[this.toHex()];if(u)return u;if(i?.closest){var d=this.toRgb(),p=1/0,f="black";if(!s.length)for(var b in n)s[b]=new e(n[b]).toRgb();for(var h in n){var g=(c=d,l=s[h],Math.pow(c.r-l.r,2)+Math.pow(c.g-l.g,2)+Math.pow(c.b-l.b,2));gl?(c+.05)/(l+.05):(l+.05)/(c+.05),(o=2)===void 0&&(o=0),r===void 0&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(t,n){return t===void 0&&(t="#FFF"),n===void 0&&(n={}),this.contrast(t)>=(c=(i=(o=n).size)===void 0?"normal":i,(s=(r=o.level)===void 0?"AA":r)==="AAA"&&c==="normal"?7:s==="AA"&&c==="large"?3:4.5);var o,r,s,i,c}}const Use="block-default",j8=["attributes","supports","save","migrate","isEligible","apiVersion"],Dp={"--wp--style--color--link":{value:["color","link"],support:["color","link"]},aspectRatio:{value:["dimensions","aspectRatio"],support:["dimensions","aspectRatio"],useEngine:!0},background:{value:["color","gradient"],support:["color","gradients"],useEngine:!0},backgroundColor:{value:["color","background"],support:["color","background"],requiresOptOut:!0,useEngine:!0},backgroundImage:{value:["background","backgroundImage"],support:["background","backgroundImage"],useEngine:!0},backgroundRepeat:{value:["background","backgroundRepeat"],support:["background","backgroundRepeat"],useEngine:!0},backgroundSize:{value:["background","backgroundSize"],support:["background","backgroundSize"],useEngine:!0},backgroundPosition:{value:["background","backgroundPosition"],support:["background","backgroundPosition"],useEngine:!0},borderColor:{value:["border","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRadius:{value:["border","radius"],support:["__experimentalBorder","radius"],properties:{borderTopLeftRadius:"topLeft",borderTopRightRadius:"topRight",borderBottomLeftRadius:"bottomLeft",borderBottomRightRadius:"bottomRight"},useEngine:!0},borderStyle:{value:["border","style"],support:["__experimentalBorder","style"],useEngine:!0},borderWidth:{value:["border","width"],support:["__experimentalBorder","width"],useEngine:!0},borderTopColor:{value:["border","top","color"],support:["__experimentalBorder","color"],useEngine:!0},borderTopStyle:{value:["border","top","style"],support:["__experimentalBorder","style"],useEngine:!0},borderTopWidth:{value:["border","top","width"],support:["__experimentalBorder","width"],useEngine:!0},borderRightColor:{value:["border","right","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRightStyle:{value:["border","right","style"],support:["__experimentalBorder","style"],useEngine:!0},borderRightWidth:{value:["border","right","width"],support:["__experimentalBorder","width"],useEngine:!0},borderBottomColor:{value:["border","bottom","color"],support:["__experimentalBorder","color"],useEngine:!0},borderBottomStyle:{value:["border","bottom","style"],support:["__experimentalBorder","style"],useEngine:!0},borderBottomWidth:{value:["border","bottom","width"],support:["__experimentalBorder","width"],useEngine:!0},borderLeftColor:{value:["border","left","color"],support:["__experimentalBorder","color"],useEngine:!0},borderLeftStyle:{value:["border","left","style"],support:["__experimentalBorder","style"],useEngine:!0},borderLeftWidth:{value:["border","left","width"],support:["__experimentalBorder","width"],useEngine:!0},color:{value:["color","text"],support:["color","text"],requiresOptOut:!0,useEngine:!0},columnCount:{value:["typography","textColumns"],support:["typography","textColumns"],useEngine:!0},filter:{value:["filter","duotone"],support:["filter","duotone"]},linkColor:{value:["elements","link","color","text"],support:["color","link"]},captionColor:{value:["elements","caption","color","text"],support:["color","caption"]},buttonColor:{value:["elements","button","color","text"],support:["color","button"]},buttonBackgroundColor:{value:["elements","button","color","background"],support:["color","button"]},headingColor:{value:["elements","heading","color","text"],support:["color","heading"]},headingBackgroundColor:{value:["elements","heading","color","background"],support:["color","heading"]},fontFamily:{value:["typography","fontFamily"],support:["typography","__experimentalFontFamily"],useEngine:!0},fontSize:{value:["typography","fontSize"],support:["typography","fontSize"],useEngine:!0},fontStyle:{value:["typography","fontStyle"],support:["typography","__experimentalFontStyle"],useEngine:!0},fontWeight:{value:["typography","fontWeight"],support:["typography","__experimentalFontWeight"],useEngine:!0},lineHeight:{value:["typography","lineHeight"],support:["typography","lineHeight"],useEngine:!0},margin:{value:["spacing","margin"],support:["spacing","margin"],properties:{marginTop:"top",marginRight:"right",marginBottom:"bottom",marginLeft:"left"},useEngine:!0},minHeight:{value:["dimensions","minHeight"],support:["dimensions","minHeight"],useEngine:!0},padding:{value:["spacing","padding"],support:["spacing","padding"],properties:{paddingTop:"top",paddingRight:"right",paddingBottom:"bottom",paddingLeft:"left"},useEngine:!0},textAlign:{value:["typography","textAlign"],support:["typography","textAlign"],useEngine:!1},textDecoration:{value:["typography","textDecoration"],support:["typography","__experimentalTextDecoration"],useEngine:!0},textTransform:{value:["typography","textTransform"],support:["typography","__experimentalTextTransform"],useEngine:!0},letterSpacing:{value:["typography","letterSpacing"],support:["typography","__experimentalLetterSpacing"],useEngine:!0},writingMode:{value:["typography","writingMode"],support:["typography","__experimentalWritingMode"],useEngine:!0},"--wp--style--root--padding":{value:["spacing","padding"],support:["spacing","padding"],properties:{"--wp--style--root--padding-top":"top","--wp--style--root--padding-right":"right","--wp--style--root--padding-bottom":"bottom","--wp--style--root--padding-left":"left"},rootOnly:!0}},Ja={link:"a:where(:not(.wp-element-button))",heading:"h1, h2, h3, h4, h5, h6",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",button:".wp-element-button, .wp-block-button__link",caption:".wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption",cite:"cite"},oLe={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"dimensions.aspectRatios":!0,"typography.fontSizes":!0,"spacing.spacingSizes":!0},{lock:rLe,unlock:Of}=L0("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/blocks"),HU={title:"block title",description:"block description",keywords:["block keyword"],styles:[{label:"block style label"}],variations:[{title:"block variation title",description:"block variation description",keywords:["block variation keyword"]}]};function V4(e){return e!==null&&typeof e=="object"}function sLe({textdomain:e,...t}){const n=["apiVersion","title","category","parent","ancestor","icon","description","keywords","attributes","providesContext","usesContext","selectors","supports","styles","example","variations","blockHooks","allowedBlocks"],o=Object.fromEntries(Object.entries(t).filter(([r])=>n.includes(r)));return e&&Object.keys(HU).forEach(r=>{o[r]&&(o[r]=I8(HU[r],o[r],e))}),o}function iLe(e,t){const n=V4(e)?e.name:e;if(typeof n!="string"){globalThis.SCRIPT_DEBUG===!0&&On("Block names must be strings.");return}if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(n)){globalThis.SCRIPT_DEBUG===!0&&On("Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block");return}if(uo(Ct).getBlockType(n)){globalThis.SCRIPT_DEBUG===!0&&On('Block "'+n+'" is already registered.');return}const{addBootstrappedBlockType:o,addUnprocessedBlockType:r}=Of(t0(Ct));if(V4(e)){const s=sLe(e);o(n,s)}return r(n,t),uo(Ct).getBlockType(n)}function I8(e,t,n){return typeof e=="string"&&typeof t=="string"?Ee(t,e,n):Array.isArray(e)&&e.length&&Array.isArray(t)?t.map(o=>I8(e[0],o,n)):V4(e)&&Object.entries(e).length&&V4(t)?Object.keys(t).reduce((o,r)=>e[r]?(o[r]=I8(e[r],t[r],n),o):(o[r]=t[r],o),{}):t}function aLe(e){t0(Ct).setFreeformFallbackBlockName(e)}function kd(){return uo(Ct).getFreeformFallbackBlockName()}function Xse(){return uo(Ct).getGroupingBlockName()}function cLe(e){t0(Ct).setUnregisteredFallbackBlockName(e)}function y3(){return uo(Ct).getUnregisteredFallbackBlockName()}function lLe(e){t0(Ct).setDefaultBlockName(e)}function uLe(e){t0(Ct).setGroupingBlockName(e)}function lr(){return uo(Ct).getDefaultBlockName()}function nn(e){return uo(Ct)?.getBlockType(e)}function ms(){return uo(Ct).getBlockTypes()}function An(e,t,n){return uo(Ct).getBlockSupport(e,t,n)}function Rt(e,t,n){return uo(Ct).hasBlockSupport(e,t,n)}function rp(e){return e?.name==="core/block"}function Xh(e){return e?.name==="core/template-part"}const $5=(e,t)=>uo(Ct).getBlockVariations(e,t),UU=e=>{const{name:t,label:n,usesContext:o,getValues:r,setValues:s,canUserEditValue:i,getFieldsList:c}=e,l=Of(uo(Ct)).getBlockBindingsSource(t),u=["label","usesContext"];for(const d in l)if(!u.includes(d)&&l[d]){globalThis.SCRIPT_DEBUG===!0&&On('Block bindings source "'+t+'" is already registered.');return}if(!t){globalThis.SCRIPT_DEBUG===!0&&On("Block bindings source must contain a name.");return}if(typeof t!="string"){globalThis.SCRIPT_DEBUG===!0&&On("Block bindings source name must be a string.");return}if(/[A-Z]+/.test(t)){globalThis.SCRIPT_DEBUG===!0&&On("Block bindings source name must not contain uppercase characters.");return}if(!/^[a-z0-9/-]+$/.test(t)){globalThis.SCRIPT_DEBUG===!0&&On("Block bindings source name must contain only valid characters: lowercase characters, hyphens, or digits. Example: my-plugin/my-custom-source.");return}if(!/^[a-z0-9-]+\/[a-z0-9-]+$/.test(t)){globalThis.SCRIPT_DEBUG===!0&&On("Block bindings source name must contain a namespace and valid characters. Example: my-plugin/my-custom-source.");return}if(!n&&!l?.label){globalThis.SCRIPT_DEBUG===!0&&On("Block bindings source must contain a label.");return}if(n&&typeof n!="string"){globalThis.SCRIPT_DEBUG===!0&&On("Block bindings source label must be a string.");return}if(n&&l?.label&&n!==l?.label&&globalThis.SCRIPT_DEBUG===!0&&On('Block bindings "'+t+'" source label was overridden.'),o&&!Array.isArray(o)){globalThis.SCRIPT_DEBUG===!0&&On("Block bindings source usesContext must be an array.");return}if(r&&typeof r!="function"){globalThis.SCRIPT_DEBUG===!0&&On("Block bindings source getValues must be a function.");return}if(s&&typeof s!="function"){globalThis.SCRIPT_DEBUG===!0&&On("Block bindings source setValues must be a function.");return}if(i&&typeof i!="function"){globalThis.SCRIPT_DEBUG===!0&&On("Block bindings source canUserEditValue must be a function.");return}if(c&&typeof c!="function"){globalThis.SCRIPT_DEBUG===!0&&On("Block bindings source getFieldsList must be a function.");return}return Of(t0(Ct)).addBlockBindingsSource(e)};function wl(e){return Of(uo(Ct)).getBlockBindingsSource(e)}function Gse(){return Of(uo(Ct)).getAllBlockBindingsSources()}Gs([Ks,Uf]);const XU=["#191e23","#f8f9f9"];function E2(e){var t;return Object.entries((t=nn(e.name)?.attributes)!==null&&t!==void 0?t:{}).every(([n,o])=>{const r=e.attributes[n];return o.hasOwnProperty("default")?r===o.default:o.type==="rich-text"?!r?.length:r===void 0})}function Bl(e){return e.name===lr()&&E2(e)}function Kse(e){return!!e&&(typeof e=="string"||x.isValidElement(e)||typeof e=="function"||e instanceof x.Component)}function dLe(e){if(e=e||Use,Kse(e))return{src:e};if("background"in e){const t=sn(e.background),n=r=>t.contrast(r),o=Math.max(...XU.map(n));return{...e,foreground:e.foreground?e.foreground:XU.find(r=>n(r)===o),shadowColor:t.alpha(.3).toRgbString()}}return e}function A3(e){return typeof e=="string"?nn(e):e}function Yse(e,t,n="visual"){const{__experimentalLabel:o,title:r}=e,s=o&&o(t,{context:n});return s?s.toPlainText?s.toPlainText():A1(s):r}function Zse(e){if(e.default!==void 0)return e.default;if(e.type==="rich-text")return new Ko}function Qse(e){return nn(e)!==void 0}function zN(e,t){const n=nn(e);if(n===void 0)throw new Error(`Block type '${e}' is not registered.`);return Object.entries(n.attributes).reduce((o,[r,s])=>{const i=t[r];if(i!==void 0)s.type==="rich-text"?i instanceof Ko?o[r]=i:typeof i=="string"&&(o[r]=Ko.fromHTMLString(i)):s.type==="string"&&i instanceof Ko?o[r]=i.toHTMLString():o[r]=i;else{const c=Zse(s);c!==void 0&&(o[r]=c)}return["node","children"].indexOf(s.source)!==-1&&(typeof o[r]=="string"?o[r]=[o[r]]:Array.isArray(o[r])||(o[r]=[])),o},{})}function pLe(e,t){const n=nn(e)?.attributes;return n?Object.keys(n).filter(r=>{const s=n[r];return s?.role===t?!0:s?.__experimentalRole===t?(Ze("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${e} block.`}),!0):!1}):[]}function fLe(e){const t=nn(e)?.attributes;return t?!!Object.keys(t)?.some(n=>{const o=t[n];return o?.role==="content"||o?.__experimentalRole==="content"}):!1}function Xf(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>!t.includes(n)))}const bLe=[{slug:"text",title:m("Text")},{slug:"media",title:m("Media")},{slug:"design",title:m("Design")},{slug:"widgets",title:m("Widgets")},{slug:"theme",title:m("Theme")},{slug:"embed",title:m("Embeds")},{slug:"reusable",title:m("Reusable blocks")}];function ON(e){return e.reduce((t,n)=>({...t,[n.name]:n}),{})}function H4(e){return e.reduce((t,n)=>(t.some(o=>o.name===n.name)||t.push(n),t),[])}function hLe(e={},t){switch(t.type){case"ADD_BOOTSTRAPPED_BLOCK_TYPE":const{name:n,blockType:o}=t,r=e[n];let s;return r?(r.blockHooks===void 0&&o.blockHooks&&(s={...r,...s,blockHooks:o.blockHooks}),r.allowedBlocks===void 0&&o.allowedBlocks&&(s={...r,...s,allowedBlocks:o.allowedBlocks})):(s=Object.fromEntries(Object.entries(o).filter(([,i])=>i!=null).map(([i,c])=>[bB(i),c])),s.name=n),s?{...e,[n]:s}:e;case"REMOVE_BLOCK_TYPES":return Xf(e,t.names)}return e}function mLe(e={},t){switch(t.type){case"ADD_UNPROCESSED_BLOCK_TYPE":return{...e,[t.name]:t.blockType};case"REMOVE_BLOCK_TYPES":return Xf(e,t.names)}return e}function gLe(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...ON(t.blockTypes)};case"REMOVE_BLOCK_TYPES":return Xf(e,t.names)}return e}function MLe(e={},t){var n;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(ON(t.blockTypes)).map(([r,s])=>{var i,c;return[r,H4([...((i=s.styles)!==null&&i!==void 0?i:[]).map(l=>({...l,source:"block"})),...((c=e[s.name])!==null&&c!==void 0?c:[]).filter(({source:l})=>l!=="block")])]}))};case"ADD_BLOCK_STYLES":const o={};return t.blockNames.forEach(r=>{var s;o[r]=H4([...(s=e[r])!==null&&s!==void 0?s:[],...t.styles])}),{...e,...o};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:((n=e[t.blockName])!==null&&n!==void 0?n:[]).filter(r=>t.styleNames.indexOf(r.name)===-1)}}return e}function zLe(e={},t){var n,o;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(ON(t.blockTypes)).map(([r,s])=>{var i,c;return[r,H4([...((i=s.variations)!==null&&i!==void 0?i:[]).map(l=>({...l,source:"block"})),...((c=e[s.name])!==null&&c!==void 0?c:[]).filter(({source:l})=>l!=="block")])]}))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:H4([...(n=e[t.blockName])!==null&&n!==void 0?n:[],...t.variations])};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:((o=e[t.blockName])!==null&&o!==void 0?o:[]).filter(r=>t.variationNames.indexOf(r.name)===-1)}}return e}function V5(e){return(t=null,n)=>{switch(n.type){case"REMOVE_BLOCK_TYPES":return n.names.indexOf(t)!==-1?null:t;case e:return n.name||null}return t}}const OLe=V5("SET_DEFAULT_BLOCK_NAME"),yLe=V5("SET_FREEFORM_FALLBACK_BLOCK_NAME"),ALe=V5("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),vLe=V5("SET_GROUPING_BLOCK_NAME");function xLe(e=bLe,t){switch(t.type){case"SET_CATEGORIES":const n=new Map;return(t.categories||[]).forEach(o=>{n.set(o.slug,o)}),[...n.values()];case"UPDATE_CATEGORY":{if(!t.category||!Object.keys(t.category).length)return e;if(e.find(({slug:r})=>r===t.slug))return e.map(r=>r.slug===t.slug?{...r,...t.category}:r)}}return e}function wLe(e={},t){switch(t.type){case"ADD_BLOCK_COLLECTION":return{...e,[t.namespace]:{title:t.title,icon:t.icon}};case"REMOVE_BLOCK_COLLECTION":return Xf(e,t.namespace)}return e}function _Le(e=[],t=[]){const n=Array.from(new Set(e.concat(t)));return n.length>0?n:void 0}function kLe(e={},t){switch(t.type){case"ADD_BLOCK_BINDINGS_SOURCE":let n;return(globalThis.IS_GUTENBERG_PLUGIN||t.name==="core/post-meta")&&(n=t.getFieldsList),{...e,[t.name]:{label:t.label||e[t.name]?.label,usesContext:_Le(e[t.name]?.usesContext,t.usesContext),getValues:t.getValues,setValues:t.setValues,canUserEditValue:t.setValues&&t.canUserEditValue,getFieldsList:n}};case"REMOVE_BLOCK_BINDINGS_SOURCE":return Xf(e,t.name)}return e}const SLe=Q0({bootstrappedBlockTypes:hLe,unprocessedBlockTypes:mLe,blockTypes:gLe,blockStyles:MLe,blockVariations:zLe,defaultBlockName:OLe,freeformFallbackBlockName:yLe,unregisteredFallbackBlockName:ALe,groupingBlockName:vLe,categories:xLe,collections:wLe,blockBindingsSources:kLe}),nz=(e,t,n)=>{var o;const r=Array.isArray(t)?t:t.split(".");let s=e;return r.forEach(i=>{s=s?.[i]}),(o=s)!==null&&o!==void 0?o:n};function GU(e){return typeof e=="object"&&e.constructor===Object&&e!==null}function Jse(e,t){return GU(e)&&GU(t)?Object.entries(t).every(([n,o])=>Jse(e?.[n],o)):e===t}const CLe=["background","backgroundColor","color","linkColor","captionColor","buttonColor","headingColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","padding","contentSize","wideSize","blockGap","textDecoration","textTransform","letterSpacing"];function KU(e,t,n){return e.filter(o=>!(o==="fontSize"&&n==="heading"||o==="textDecoration"&&!t&&n!=="link"||o==="textTransform"&&!t&&!(["heading","h1","h2","h3","h4","h5","h6"].includes(n)||n==="button"||n==="caption"||n==="text")||o==="letterSpacing"&&!t&&!(["heading","h1","h2","h3","h4","h5","h6"].includes(n)||n==="button"||n==="caption"||n==="text")||o==="textColumns"&&!t))}const qLe=Pt((e,t,n)=>{if(!t)return KU(CLe,t,n);const o=v3(e,t);if(!o)return[];const r=[];return o?.supports?.spacing?.blockGap&&r.push("blockGap"),o?.supports?.shadow&&r.push("shadow"),Object.keys(Dp).forEach(s=>{if(Dp[s].support){if(Dp[s].requiresOptOut&&Dp[s].support[0]in o.supports&&nz(o.supports,Dp[s].support)!==!1){r.push(s);return}nz(o.supports,Dp[s].support,!1)&&r.push(s)}}),KU(r,t,n)},(e,t)=>[e.blockTypes[t]]);function RLe(e,t){return e.bootstrappedBlockTypes[t]}function TLe(e){return e.unprocessedBlockTypes}function ELe(e){return e.blockBindingsSources}function WLe(e,t){return e.blockBindingsSources[t]}const eie=(e,t)=>{const n=v3(e,t);return n?Object.values(n.attributes).some(({role:o,__experimentalRole:r})=>o==="content"?!0:r==="content"?(Ze("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${t} block.`}),!0):!1):!1},BLe=Object.freeze(Object.defineProperty({__proto__:null,getAllBlockBindingsSources:ELe,getBlockBindingsSource:WLe,getBootstrappedBlockType:RLe,getSupportedStyles:qLe,getUnprocessedBlockTypes:TLe,hasContentRoleAttribute:eie},Symbol.toStringTag,{value:"Module"})),tie=(e,t)=>typeof t=="string"?v3(e,t):t,nie=Pt(e=>Object.values(e.blockTypes),e=>[e.blockTypes]);function v3(e,t){return e.blockTypes[t]}function NLe(e,t){return e.blockStyles[t]}const yN=Pt((e,t,n)=>{const o=e.blockVariations[t];return!o||!n?o:o.filter(r=>(r.scope||["block","inserter"]).includes(n))},(e,t)=>[e.blockVariations[t]]);function LLe(e,t,n,o){const r=yN(e,t,o);if(!r)return r;const s=v3(e,t),i=Object.keys(s?.attributes||{});let c,l=0;for(const u of r)if(Array.isArray(u.isActive)){const d=u.isActive.filter(b=>{const h=b.split(".")[0];return i.includes(h)}),p=d.length;if(p===0)continue;d.every(b=>{const h=nz(u.attributes,b);if(h===void 0)return!1;let g=nz(n,b);return g instanceof Ko&&(g=g.toHTMLString()),Jse(g,h)})&&p>l&&(c=u,l=p)}else if(u.isActive?.(n,u.attributes))return c||u;return c}function PLe(e,t,n){const o=yN(e,t,n);return[...o].reverse().find(({isDefault:s})=>!!s)||o[0]}function jLe(e){return e.categories}function ILe(e){return e.collections}function DLe(e){return e.defaultBlockName}function FLe(e){return e.freeformFallbackBlockName}function $Le(e){return e.unregisteredFallbackBlockName}function VLe(e){return e.groupingBlockName}const AN=Pt((e,t)=>nie(e).filter(n=>n.parent?.includes(t)).map(({name:n})=>n),e=>[e.blockTypes]),oie=(e,t,n,o)=>{const r=tie(e,t);return r?.supports?nz(r.supports,n,o):o};function rie(e,t,n,o){return!!oie(e,t,n,o)}function YU(e){return hs(e??"").toLowerCase().trim()}function HLe(e,t,n=""){const o=tie(e,t),r=YU(n),s=i=>YU(i).includes(r);return s(o.title)||o.keywords?.some(s)||s(o.category)||typeof o.description=="string"&&s(o.description)}const ULe=(e,t)=>AN(e,t).length>0,XLe=(e,t)=>AN(e,t).some(n=>rie(e,n,"inserter",!0)),GLe=(...e)=>(Ze("__experimentalHasContentRoleAttribute",{since:"6.7",version:"6.8",hint:"This is a private selector."}),eie(...e)),KLe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalHasContentRoleAttribute:GLe,getActiveBlockVariation:LLe,getBlockStyles:NLe,getBlockSupport:oie,getBlockType:v3,getBlockTypes:nie,getBlockVariations:yN,getCategories:jLe,getChildBlockNames:AN,getCollections:ILe,getDefaultBlockName:DLe,getDefaultBlockVariation:PLe,getFreeformFallbackBlockName:FLe,getGroupingBlockName:VLe,getUnregisteredFallbackBlockName:$Le,hasBlockSupport:rie,hasChildBlocks:ULe,hasChildBlocksWithInserterSupport:XLe,isMatchingSearchTerm:HLe},Symbol.toStringTag,{value:"Module"}));var VS={exports:{}},wo={};/** + * @license React + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ZU;function YLe(){if(ZU)return wo;ZU=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),h;h=Symbol.for("react.module.reference");function g(z){if(typeof z=="object"&&z!==null){var y=z.$$typeof;switch(y){case e:switch(z=z.type,z){case n:case r:case o:case u:case d:return z;default:switch(z=z&&z.$$typeof,z){case c:case i:case l:case f:case p:case s:return z;default:return y}}case t:return y}}}return wo.ContextConsumer=i,wo.ContextProvider=s,wo.Element=e,wo.ForwardRef=l,wo.Fragment=n,wo.Lazy=f,wo.Memo=p,wo.Portal=t,wo.Profiler=r,wo.StrictMode=o,wo.Suspense=u,wo.SuspenseList=d,wo.isAsyncMode=function(){return!1},wo.isConcurrentMode=function(){return!1},wo.isContextConsumer=function(z){return g(z)===i},wo.isContextProvider=function(z){return g(z)===s},wo.isElement=function(z){return typeof z=="object"&&z!==null&&z.$$typeof===e},wo.isForwardRef=function(z){return g(z)===l},wo.isFragment=function(z){return g(z)===n},wo.isLazy=function(z){return g(z)===f},wo.isMemo=function(z){return g(z)===p},wo.isPortal=function(z){return g(z)===t},wo.isProfiler=function(z){return g(z)===r},wo.isStrictMode=function(z){return g(z)===o},wo.isSuspense=function(z){return g(z)===u},wo.isSuspenseList=function(z){return g(z)===d},wo.isValidElementType=function(z){return typeof z=="string"||typeof z=="function"||z===n||z===r||z===o||z===u||z===d||z===b||typeof z=="object"&&z!==null&&(z.$$typeof===f||z.$$typeof===p||z.$$typeof===s||z.$$typeof===i||z.$$typeof===l||z.$$typeof===h||z.getModuleId!==void 0)},wo.typeOf=g,wo}var QU;function ZLe(){return QU||(QU=1,VS.exports=YLe()),VS.exports}var QLe=ZLe();const JU={common:"text",formatting:"text",layout:"design"};function JLe(e=[],t=[]){const n=[...e];return t.forEach(o=>{const r=n.findIndex(s=>s.name===o.name);r!==-1?n[r]={...n[r],...o}:n.push(o)}),n}const sie=(e,t)=>({select:n})=>{const o=n.getBootstrappedBlockType(e),r={name:e,icon:Use,keywords:[],attributes:{},providesContext:{},usesContext:[],selectors:{},supports:{},styles:[],blockHooks:{},save:()=>null,...o,...t,variations:JLe(Array.isArray(o?.variations)?o.variations:[],Array.isArray(t?.variations)?t.variations:[])},s=zr("blocks.registerBlockType",r,e,null);if(s.description&&typeof s.description!="string"&&Ze("Declaring non-string block descriptions",{since:"6.2"}),s.deprecated&&(s.deprecated=s.deprecated.map(i=>Object.fromEntries(Object.entries(zr("blocks.registerBlockType",{...Xf(r,j8),...i},r.name,i)).filter(([c])=>j8.includes(c))))),!d3(s)){globalThis.SCRIPT_DEBUG===!0&&On("Block settings must be a valid object.");return}if(typeof s.save!="function"){globalThis.SCRIPT_DEBUG===!0&&On('The "save" property must be a valid function.');return}if("edit"in s&&!QLe.isValidElementType(s.edit)){globalThis.SCRIPT_DEBUG===!0&&On('The "edit" property must be a valid component.');return}if(JU.hasOwnProperty(s.category)&&(s.category=JU[s.category]),"category"in s&&!n.getCategories().some(({slug:i})=>i===s.category)&&(globalThis.SCRIPT_DEBUG===!0&&On('The block "'+e+'" is registered with an invalid category "'+s.category+'".'),delete s.category),!("title"in s)||s.title===""){globalThis.SCRIPT_DEBUG===!0&&On('The block "'+e+'" must have a title.');return}if(typeof s.title!="string"){globalThis.SCRIPT_DEBUG===!0&&On("Block titles must be strings.");return}if(s.icon=dLe(s.icon),!Kse(s.icon.src)){globalThis.SCRIPT_DEBUG===!0&&On("The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional");return}if((typeof s?.parent=="string"||s?.parent instanceof String)&&(s.parent=[s.parent],globalThis.SCRIPT_DEBUG===!0&&On("Parent must be undefined or an array of strings (block types), but it is a string.")),!Array.isArray(s?.parent)&&s?.parent!==void 0){globalThis.SCRIPT_DEBUG===!0&&On("Parent must be undefined or an array of block types, but it is ",s.parent);return}if(s?.parent?.length===1&&e===s.parent[0]){globalThis.SCRIPT_DEBUG===!0&&On('Block "'+e+'" cannot be a parent of itself. Please remove the block name from the parent list.');return}return s};function ePe(e){return{type:"ADD_BLOCK_TYPES",blockTypes:Array.isArray(e)?e:[e]}}function iie(){return({dispatch:e,select:t})=>{const n=[];for(const[o,r]of Object.entries(t.getUnprocessedBlockTypes())){const s=e(sie(o,r));s&&n.push(s)}n.length&&e.addBlockTypes(n)}}function tPe(){return Ze('wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters',{since:"6.4",alternative:"reapplyBlockFilters"}),iie()}function nPe(e){return{type:"REMOVE_BLOCK_TYPES",names:Array.isArray(e)?e:[e]}}function oPe(e,t){return{type:"ADD_BLOCK_STYLES",styles:Array.isArray(t)?t:[t],blockNames:Array.isArray(e)?e:[e]}}function rPe(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:Array.isArray(t)?t:[t],blockName:e}}function sPe(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:Array.isArray(t)?t:[t],blockName:e}}function iPe(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:Array.isArray(t)?t:[t],blockName:e}}function aPe(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function cPe(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function lPe(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function uPe(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function dPe(e){return{type:"SET_CATEGORIES",categories:e}}function pPe(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function fPe(e,t,n){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:n}}function bPe(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}const hPe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalReapplyBlockFilters:tPe,addBlockCollection:fPe,addBlockStyles:oPe,addBlockTypes:ePe,addBlockVariations:sPe,reapplyBlockTypeFilters:iie,removeBlockCollection:bPe,removeBlockStyles:rPe,removeBlockTypes:nPe,removeBlockVariations:iPe,setCategories:dPe,setDefaultBlockName:aPe,setFreeformFallbackBlockName:cPe,setGroupingBlockName:uPe,setUnregisteredFallbackBlockName:lPe,updateCategory:pPe},Symbol.toStringTag,{value:"Module"}));function mPe(e,t){return{type:"ADD_BOOTSTRAPPED_BLOCK_TYPE",name:e,blockType:t}}function gPe(e,t){return({dispatch:n})=>{n({type:"ADD_UNPROCESSED_BLOCK_TYPE",name:e,blockType:t});const o=n(sie(e,t));o&&n.addBlockTypes(o)}}function MPe(e){return{type:"ADD_BLOCK_BINDINGS_SOURCE",name:e.name,label:e.label,usesContext:e.usesContext,getValues:e.getValues,setValues:e.setValues,canUserEditValue:e.canUserEditValue,getFieldsList:e.getFieldsList}}function zPe(e){return{type:"REMOVE_BLOCK_BINDINGS_SOURCE",name:e}}const OPe=Object.freeze(Object.defineProperty({__proto__:null,addBlockBindingsSource:MPe,addBootstrappedBlockType:mPe,addUnprocessedBlockType:gPe,removeBlockBindingsSource:zPe},Symbol.toStringTag,{value:"Module"})),yPe="core/blocks",Ct=v1(yPe,{reducer:SLe,selectors:KLe,actions:hPe});Xs(Ct);Of(Ct).registerPrivateSelectors(BLe);Of(Ct).registerPrivateActions(OPe);function Te(e,t={},n=[]){if(!Qse(e))return Te("core/missing",{originalName:e,originalContent:"",originalUndelimitedContent:""});const o=zN(e,t);return{clientId:Fs(),name:e,isValid:!0,attributes:o,innerBlocks:n}}function Sd(e=[]){return e.map(t=>{const n=Array.isArray(t)?t:[t.name,t.attributes,t.innerBlocks],[o,r,s=[]]=n;return Te(o,r,Sd(s))})}function aie(e,t={},n){const{name:o}=e;if(!Qse(o))return Te("core/missing",{originalName:o,originalContent:"",originalUndelimitedContent:""});const r=Fs(),s=zN(o,{...e.attributes,...t});return{...e,clientId:r,attributes:s,innerBlocks:n||e.innerBlocks.map(i=>aie(i))}}function Do(e,t={},n){const o=Fs();return{...e,clientId:o,attributes:{...e.attributes,...t},innerBlocks:n||e.innerBlocks.map(r=>Do(r))}}const cie=(e,t,n)=>{if(!n.length)return!1;const o=n.length>1,r=n[0].name;if(!(W2(e)||!o||e.isMultiBlock)||!W2(e)&&!n.every(u=>u.name===r)||!(e.type==="block"))return!1;const c=n[0];return!(!(t!=="from"||e.blocks.indexOf(c.name)!==-1||W2(e))||!o&&t==="from"&&eX(c.name)&&eX(e.blockName)||!D8(e,n))},APe=e=>e.length?ms().filter(o=>{const r=Ei("from",o.name);return!!_c(r,s=>cie(s,"from",e))}):[],vPe=e=>{if(!e.length)return[];const t=e[0],n=nn(t.name);return(n?Ei("to",n.name):[]).filter(i=>i&&cie(i,"to",e)).map(i=>i.blocks).flat().map(nn)},W2=e=>e&&e.type==="block"&&Array.isArray(e.blocks)&&e.blocks.includes("*"),eX=e=>e===Xse();function lie(e){if(!e.length)return[];const t=APe(e),n=vPe(e);return[...new Set([...t,...n])]}function _c(e,t){const n=Sre();for(let o=0;os||r,r.priority)}return n.applyFilters("transform",null)}function Ei(e,t){if(t===void 0)return ms().map(({name:c})=>Ei(e,c)).flat();const n=A3(t),{name:o,transforms:r}=n||{};if(!r||!Array.isArray(r[e]))return[];const s=r.supportedMobileTransforms&&Array.isArray(r.supportedMobileTransforms);return(s?r[e].filter(c=>c.type==="raw"||c.type==="prefix"?!0:!c.blocks||!c.blocks.length?!1:W2(c)?!0:c.blocks.every(l=>r.supportedMobileTransforms.includes(l))):r[e]).map(c=>({...c,blockName:o,usingMobileTransformations:s}))}function D8(e,t){if(typeof e.isMatch!="function")return!0;const n=t[0],o=e.isMultiBlock?t.map(s=>s.attributes):n.attributes,r=e.isMultiBlock?t:n;return e.isMatch(o,r)}function Kr(e,t){const n=Array.isArray(e)?e:[e],o=n.length>1,r=n[0],s=r.name,i=Ei("from",t),c=Ei("to",s),l=_c(c,f=>f.type==="block"&&(W2(f)||f.blocks.indexOf(t)!==-1)&&(!o||f.isMultiBlock)&&D8(f,n))||_c(i,f=>f.type==="block"&&(W2(f)||f.blocks.indexOf(s)!==-1)&&(!o||f.isMultiBlock)&&D8(f,n));if(!l)return null;let u;return l.isMultiBlock?"__experimentalConvert"in l?u=l.__experimentalConvert(n):u=l.transform(n.map(f=>f.attributes),n.map(f=>f.innerBlocks)):"__experimentalConvert"in l?u=l.__experimentalConvert(r):u=l.transform(r.attributes,r.innerBlocks),u===null||typeof u!="object"||(u=Array.isArray(u)?u:[u],u.some(f=>!nn(f.name)))||!u.some(f=>f.name===t)?null:u.map((f,b,h)=>zr("blocks.switchToBlockType.transformedBlock",f,e,b,h))}const vN=(e,t)=>{var n;return Te(e,t.attributes,((n=t.innerBlocks)!==null&&n!==void 0?n:[]).map(o=>vN(o.name,o)))};let hc,ec,yf,sd;const uie=/)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function jv(e,t,n,o,r){return{blockName:e,attrs:t,innerBlocks:n,innerHTML:o,innerContent:r}}function xN(e){return jv(null,{},[],e,[e])}function xPe(e,t,n,o,r){return{block:e,tokenStart:t,tokenLength:n,prevOffset:o||t+n,leadingHtmlStart:r}}const die=e=>{hc=e,ec=0,yf=[],sd=[],uie.lastIndex=0;do;while(wPe());return yf};function wPe(){const e=sd.length,t=kPe(),[n,o,r,s,i]=t,c=s>ec?ec:null;switch(n){case"no-more-tokens":if(e===0)return HS(),!1;if(e===1)return US(),!1;for(;0{const o="(<("+("(?=!--|!\\[CDATA\\[)((?=!-)"+"!(?:-(?!->)[^\\-]*)*(?:-->)?"+"|"+"!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?"+")")+"|[^>]*>?))";return new RegExp(o)})();function CPe(e){const t=[];let n=e,o;for(;o=n.match(SPe);){const r=o.index;t.push(n.slice(0,r)),t.push(o[0]),n=n.slice(r+o[0].length)}return n.length&&t.push(n),t}function qPe(e,t){const n=CPe(e);let o=!1;const r=Object.keys(t);for(let s=1;s"),i=s.pop();e="";for(let c=0;c";n.push([d,l.substr(u)+""]),e+=l.substr(0,u)+d}e+=i}e=e.replace(/\s*/g,` + +`);const o="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";e=e.replace(new RegExp("(<"+o+"[\\s/>])","g"),` + +$1`),e=e.replace(new RegExp("()","g"),`$1 + +`),e=e.replace(/\r\n|\r/g,` +`),e=qPe(e,{"\n":" "}),e.indexOf("\s*/g,"")),e.indexOf("")!==-1&&(e=e.replace(/(]*>)\s*/g,"$1"),e=e.replace(/\s*<\/object>/g,""),e=e.replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),(e.indexOf("\]]*[>\]])\s*/g,"$1"),e=e.replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1"),e=e.replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),e.indexOf("]*>)/,"$1"),e=e.replace(/<\/figcaption>\s*/,"")),e=e.replace(/\n\n+/g,` + +`);const r=e.split(/\n\s*\n/).filter(Boolean);return e="",r.forEach(s=>{e+="

"+s.replace(/^\n*|\n*$/g,"")+`

+`}),e=e.replace(/

\s*<\/p>/g,""),e=e.replace(/

([^<]+)<\/(div|address|form)>/g,"

$1

"),e=e.replace(new RegExp("

\\s*(]*>)\\s*

","g"),"$1"),e=e.replace(/

(/g,"$1"),e=e.replace(/

]*)>/gi,"

"),e=e.replace(/<\/blockquote><\/p>/g,"

"),e=e.replace(new RegExp("

\\s*(]*>)","g"),"$1"),e=e.replace(new RegExp("(]*>)\\s*

","g"),"$1"),t&&(e=e.replace(/<(script|style).*?<\/\\1>/g,s=>s[0].replace(/\n/g,"")),e=e.replace(/
|/g,"
"),e=e.replace(/(
)?\s*\n/g,(s,i)=>i?s:`
+`),e=e.replace(//g,` +`)),e=e.replace(new RegExp("(]*>)\\s*
","g"),"$1"),e=e.replace(/
(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1"),e=e.replace(/\n<\/p>$/g,"

"),n.forEach(s=>{const[i,c]=s;e=e.replace(i,c)}),e.indexOf("")!==-1&&(e=e.replace(/\s?\s?/g,` +`)),e}function fie(e){const t="blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure",n=t+"|div|p",o=t+"|pre",r=[];let s=!1,i=!1;return e?((e.indexOf("]*>[\s\S]*?<\/\1>/g,c=>(r.push(c),""))),e.indexOf("]*>[\s\S]+?<\/pre>/g,c=>(c=c.replace(/
(\r\n|\n)?/g,""),c=c.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,""),c.replace(/\r?\n/g,"")))),e.indexOf("[caption")!==-1&&(i=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,c=>c.replace(/]*)>/g,"").replace(/[\r\n\t]+/,""))),e=e.replace(new RegExp("\\s*\\s*","g"),` +`),e=e.replace(new RegExp("\\s*<((?:"+n+")(?: [^>]*)?)>","g"),` +<$1>`),e=e.replace(/(

]+>[\s\S]*?)<\/p>/g,"$1"),e=e.replace(/]*)?>\s*

/gi,` + +`),e=e.replace(/\s*

/gi,""),e=e.replace(/\s*<\/p>\s*/gi,` + +`),e=e.replace(/\n[\s\u00a0]+\n/g,` + +`),e=e.replace(/(\s*)
\s*/gi,(c,l)=>l&&l.indexOf(` +`)!==-1?` + +`:` +`),e=e.replace(/\s*

\s*/g,`
+`),e=e.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,` + +[caption$1[/caption] + +`),e=e.replace(/caption\]\n\n+\[caption/g,`caption] + +[caption`),e=e.replace(new RegExp("\\s*<((?:"+o+")(?: [^>]*)?)\\s*>","g"),` +<$1>`),e=e.replace(new RegExp("\\s*\\s*","g"),` +`),e=e.replace(/<((li|dt|dd)[^>]*)>/g," <$1>"),e.indexOf("/g,` +`)),e.indexOf("]*)?>\s*/g,` + + + +`)),e.indexOf("/g,c=>c.replace(/[\r\n]+/g,""))),e=e.replace(/<\/p#>/g,`

+`),e=e.replace(/\s*(

]+>[\s\S]*?<\/p>)/g,` +$1`),e=e.replace(/^\s+/,""),e=e.replace(/[\s\u00a0]+$/,""),s&&(e=e.replace(//g,` +`)),i&&(e=e.replace(/]*)>/g,"")),r.length&&(e=e.replace(//g,()=>r.shift())),e):""}function oz(e,t={}){const{isCommentDelimited:n=!0}=t,{blockName:o,attrs:r={},innerBlocks:s=[],innerContent:i=[]}=e;let c=0;const l=i.map(u=>u!==null?u:oz(s[c++],t)).join(` +`).replace(/\n+/g,` +`).trim();return n?mie(o,r,l):l}function U4(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return zr("blocks.getBlockDefaultClassName",t,e)}function wN(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return zr("blocks.getBlockMenuDefaultClassName",t,e)}const F8={},bie={};function X4(e={}){const{blockType:t,attributes:n}=F8;return X4.skipFilters?e:zr("blocks.getSaveContent.extraProps",{...e},t,n)}function RPe(e={}){const{innerBlocks:t}=bie;if(!Array.isArray(t))return{...e,children:t};const n=Ys(t,{isInnerBlocks:!0});return{...e,children:a.jsx(s0,{children:n})}}function hie(e,t,n=[]){const o=A3(e);if(!o?.save)return null;let{save:r}=o;if(r.prototype instanceof x.Component){const i=new r({attributes:t});r=i.render.bind(i)}F8.blockType=o,F8.attributes=t,bie.innerBlocks=n;let s=r({attributes:t,innerBlocks:n});if(s!==null&&typeof s=="object"&&qre("blocks.getSaveContent.extraProps")&&!(o.apiVersion>1)){const i=zr("blocks.getSaveContent.extraProps",{...s.props},o,t);ls(i,s.props)||(s=x.cloneElement(s,i))}return zr("blocks.getSaveElement",s,o,t)}function Gf(e,t,n){const o=A3(e);return m1(hie(o,t,n))}function TPe(e,t){var n;return Object.entries((n=e.attributes)!==null&&n!==void 0?n:{}).reduce((o,[r,s])=>{const i=t[r];return i===void 0||s.source!==void 0||s.role==="local"?o:s.__experimentalRole==="local"?(Ze("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${e?.name} block.`}),o):("default"in s&&JSON.stringify(s.default)===JSON.stringify(i)||(o[r]=i),o)},{})}function EPe(e){return JSON.stringify(e).replace(/--/g,"\\u002d\\u002d").replace(//g,"\\u003e").replace(/&/g,"\\u0026").replace(/\\"/g,"\\u0022")}function H5(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=Gf(e.name,e.attributes,e.innerBlocks)}catch{}return t}function mie(e,t,n){const o=t&&Object.entries(t).length?EPe(t)+" ":"",r=e?.startsWith("core/")?e.slice(5):e;return n?` +`+n+` +`:``}function WPe(e,{isInnerBlocks:t=!1}={}){if(!e.isValid&&e.__unstableBlockSource)return oz(e.__unstableBlockSource);const n=e.name,o=H5(e);if(n===y3()||!t&&n===kd())return o;const r=nn(n);if(!r)return o;const s=TPe(r,e.attributes);return mie(n,s,o)}function Jl(e){e.length===1&&Bl(e[0])&&(e=[]);let t=Ys(e);return e.length===1&&e[0].name===kd()&&e[0].name==="core/freeform"&&(t=fie(t)),t}function Ys(e,t){return(Array.isArray(e)?e:[e]).map(o=>WPe(o,t)).join(` + +`)}var BPe=/[\t\n\f ]/,NPe=/[A-Za-z]/,LPe=/\r\n?/g;function i1(e){return BPe.test(e)}function nX(e){return NPe.test(e)}function PPe(e){return e.replace(LPe,` +`)}var jPe=function(){function e(t,n,o){o===void 0&&(o="precompile"),this.delegate=t,this.entityParser=n,this.mode=o,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var r=this.peek();if(r==="<"&&!this.isIgnoredEndTag())this.transitionTo("tagOpen"),this.markTagStart(),this.consume();else{if(this.mode==="precompile"&&r===` +`){var s=this.tagNameBuffer.toLowerCase();(s==="pre"||s==="textarea")&&this.consume()}this.transitionTo("data"),this.delegate.beginData()}},data:function(){var r=this.peek(),s=this.tagNameBuffer;r==="<"&&!this.isIgnoredEndTag()?(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume()):r==="&"&&s!=="script"&&s!=="style"?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(r))},tagOpen:function(){var r=this.consume();r==="!"?this.transitionTo("markupDeclarationOpen"):r==="/"?this.transitionTo("endTagOpen"):(r==="@"||r===":"||nX(r))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(r))},markupDeclarationOpen:function(){var r=this.consume();if(r==="-"&&this.peek()==="-")this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment();else{var s=r.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase();s==="DOCTYPE"&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())}},doctype:function(){var r=this.consume();i1(r)&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var r=this.consume();i1(r)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(r.toLowerCase()))},doctypeName:function(){var r=this.consume();i1(r)?this.transitionTo("afterDoctypeName"):r===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(r.toLowerCase())},afterDoctypeName:function(){var r=this.consume();if(!i1(r))if(r===">")this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var s=r.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),i=s.toUpperCase()==="PUBLIC",c=s.toUpperCase()==="SYSTEM";(i||c)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),i?this.transitionTo("afterDoctypePublicKeyword"):c&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var r=this.peek();i1(r)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):r==='"'?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):r==="'"?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):r===">"&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var r=this.consume();r==='"'?this.transitionTo("afterDoctypePublicIdentifier"):r===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(r)},doctypePublicIdentifierSingleQuoted:function(){var r=this.consume();r==="'"?this.transitionTo("afterDoctypePublicIdentifier"):r===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(r)},afterDoctypePublicIdentifier:function(){var r=this.consume();i1(r)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):r===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):r==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):r==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var r=this.consume();i1(r)||(r===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):r==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):r==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var r=this.consume();r==='"'?this.transitionTo("afterDoctypeSystemIdentifier"):r===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(r)},doctypeSystemIdentifierSingleQuoted:function(){var r=this.consume();r==="'"?this.transitionTo("afterDoctypeSystemIdentifier"):r===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(r)},afterDoctypeSystemIdentifier:function(){var r=this.consume();i1(r)||r===">"&&(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},commentStart:function(){var r=this.consume();r==="-"?this.transitionTo("commentStartDash"):r===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(r),this.transitionTo("comment"))},commentStartDash:function(){var r=this.consume();r==="-"?this.transitionTo("commentEnd"):r===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var r=this.consume();r==="-"?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(r)},commentEndDash:function(){var r=this.consume();r==="-"?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+r),this.transitionTo("comment"))},commentEnd:function(){var r=this.consume();r===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+r),this.transitionTo("comment"))},tagName:function(){var r=this.consume();i1(r)?this.transitionTo("beforeAttributeName"):r==="/"?this.transitionTo("selfClosingStartTag"):r===">"?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(r)},endTagName:function(){var r=this.consume();i1(r)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):r==="/"?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):r===">"?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(r)},beforeAttributeName:function(){var r=this.peek();if(i1(r)){this.consume();return}else r==="/"?(this.transitionTo("selfClosingStartTag"),this.consume()):r===">"?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):r==="="?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(r)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var r=this.peek();i1(r)?(this.transitionTo("afterAttributeName"),this.consume()):r==="/"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):r==="="?(this.transitionTo("beforeAttributeValue"),this.consume()):r===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):r==='"'||r==="'"||r==="<"?(this.delegate.reportSyntaxError(r+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(r)):(this.consume(),this.delegate.appendToAttributeName(r))},afterAttributeName:function(){var r=this.peek();if(i1(r)){this.consume();return}else r==="/"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):r==="="?(this.consume(),this.transitionTo("beforeAttributeValue")):r===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(r))},beforeAttributeValue:function(){var r=this.peek();i1(r)?this.consume():r==='"'?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):r==="'"?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):r===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(r))},attributeValueDoubleQuoted:function(){var r=this.consume();r==='"'?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):r==="&"?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(r)},attributeValueSingleQuoted:function(){var r=this.consume();r==="'"?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):r==="&"?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(r)},attributeValueUnquoted:function(){var r=this.peek();i1(r)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):r==="/"?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):r==="&"?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):r===">"?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(r))},afterAttributeValueQuoted:function(){var r=this.peek();i1(r)?(this.consume(),this.transitionTo("beforeAttributeName")):r==="/"?(this.consume(),this.transitionTo("selfClosingStartTag")):r===">"?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){var r=this.peek();r===">"?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var r=this.consume();(r==="@"||r===":"||nX(r))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(r))}},this.reset()}return e.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},e.prototype.transitionTo=function(t){this.state=t},e.prototype.tokenize=function(t){this.reset(),this.tokenizePart(t),this.tokenizeEOF()},e.prototype.tokenizePart=function(t){for(this.input+=PPe(t);this.index"||t==="style"&&this.input.substring(this.index,this.index+8)!==""||t==="script"&&this.input.substring(this.index,this.index+9)!=="<\/script>"},e}(),IPe=function(){function e(t,n){n===void 0&&(n={}),this.options=n,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new jPe(this,t,n.mode),this._currentAttribute=void 0}return e.prototype.tokenize=function(t){return this.tokens=[],this.tokenizer.tokenize(t),this.tokens},e.prototype.tokenizePart=function(t){return this.tokens=[],this.tokenizer.tokenizePart(t),this.tokens},e.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},e.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},e.prototype.current=function(){var t=this.token;if(t===null)throw new Error("token was unexpectedly null");if(arguments.length===0)return t;for(var n=0;nt("Block validation: "+o,...r)}return{error:e(console.error),warning:e(console.warn),getItems(){return[]}}}function DPe(){const e=[],t=Gh();return{error(...n){e.push({log:t.error,args:n})},warning(...n){e.push({log:t.warning,args:n})},getItems(){return e}}}const FPe=e=>e,$Pe=/[\t\n\r\v\f ]+/g,VPe=/^[\t\n\r\v\f ]*$/,HPe=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,gie=["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"],UPe=["autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],XPe=[...gie,...UPe],oX=[FPe,JPe],GPe=/^[\da-z]+$/i,KPe=/^#\d+$/,YPe=/^#x[\da-f]+$/i;function ZPe(e){return GPe.test(e)||KPe.test(e)||YPe.test(e)}class QPe{parse(t){if(ZPe(t))return Bt("&"+t+";")}}function _N(e){return e.trim().split($Pe)}function JPe(e){return _N(e).join(" ")}function eje(e){return e.attributes.filter(t=>{const[n,o]=t;return o||n.indexOf("data-")===0||XPe.includes(n)})}function rX(e,t,n=Gh()){let o=e.chars,r=t.chars;for(let s=0;s{const[o,...r]=n.split(":"),s=r.join(":");return[o.trim(),nje(s.trim())]});return Object.fromEntries(t)}const rje={class:(e,t)=>{const[n,o]=[e,t].map(_N),r=n.filter(i=>!o.includes(i)),s=o.filter(i=>!n.includes(i));return r.length===0&&s.length===0},style:(e,t)=>N0(...[e,t].map(oje)),...Object.fromEntries(gie.map(e=>[e,()=>!0]))};function sje(e,t,n=Gh()){if(e.length!==t.length)return n.warning("Expected attributes %o, instead saw %o.",t,e),!1;const o={};for(let r=0;re.tagName!==t.tagName&&e.tagName.toLowerCase()!==t.tagName.toLowerCase()?(n.warning("Expected tag name `%s`, instead saw `%s`.",t.tagName,e.tagName),!1):sje(...[e,t].map(eje),n),Chars:rX,Comment:rX};function kg(e){let t;for(;t=e.shift();)if(t.type!=="Chars"||!VPe.test(t.chars))return t}function aje(e,t=Gh()){try{return new IPe(new QPe).tokenize(e)}catch{t.warning("Malformed HTML detected: %s",e)}return null}function sX(e,t){return e.selfClosing?!!(t&&t.tagName===e.tagName&&t.type==="EndTag"):!1}function cje(e,t,n=Gh()){if(e===t)return!0;const[o,r]=[e,t].map(c=>aje(c,n));if(!o||!r)return!1;let s,i;for(;s=kg(o);){if(i=kg(r),!i)return n.warning("Expected end of content, instead saw %o.",s),!1;if(s.type!==i.type)return n.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",i.type,i,s.type,s),!1;const c=ije[s.type];if(c&&!c(s,i,n))return!1;sX(s,r[0])?kg(r):sX(i,o[0])&&kg(o)}return(i=kg(r))?(n.warning("Expected %o, instead saw end of content.",i),!1):!0}function rz(e,t=e.name){if(e.name===kd()||e.name===y3())return[!0,[]];const o=DPe(),r=A3(t);let s;try{s=Gf(r,e.attributes)}catch(c){return o.error(`Block validation failed because an error occurred while generating block content: + +%s`,c.toString()),[!1,o.getItems()]}const i=cje(e.originalContent,s,o);return i||o.error(`Block validation failed for \`%s\` (%o). + +Content generated by \`save\` function: + +%s + +Content retrieved from post body: + +%s`,r.name,r,s,e.originalContent),[i,o.getItems()]}function Mie(e,t){const n={...t};if(e==="core/cover-image"&&(e="core/cover"),(e==="core/text"||e==="core/cover-text")&&(e="core/paragraph"),e&&e.indexOf("core/social-link-")===0&&(n.service=e.substring(17),e="core/social-link"),e&&e.indexOf("core-embed/")===0){const o=e.substring(11),r={speaker:"speaker-deck",polldaddy:"crowdsignal"};n.providerNameSlug=o in r?r[o]:o,["amazon-kindle","wordpress"].includes(o)||(n.responsive=!0),e="core/embed"}if(e==="core/post-comment-author"&&(e="core/comment-author-name"),e==="core/post-comment-content"&&(e="core/comment-content"),e==="core/post-comment-date"&&(e="core/comment-date"),e==="core/comments-query-loop"){e="core/comments";const{className:o=""}=n;o.includes("wp-block-comments-query-loop")||(n.className=["wp-block-comments-query-loop",o].join(" "))}if(e==="core/post-comments"&&(e="core/comments",n.legacy=!0),t.layout?.type==="grid"&&typeof t.layout?.columnCount=="string"&&(n.layout={...n.layout,columnCount:parseInt(t.layout.columnCount,10)}),typeof t.style?.layout?.columnSpan=="string"){const o=parseInt(t.style.layout.columnSpan,10);n.style={...n.style,layout:{...n.style.layout,columnSpan:isNaN(o)?void 0:o}}}if(typeof t.style?.layout?.rowSpan=="string"){const o=parseInt(t.style.layout.rowSpan,10);n.style={...n.style,layout:{...n.style.layout,rowSpan:isNaN(o)?void 0:o}}}if(globalThis.IS_GUTENBERG_PLUGIN&&n.metadata?.bindings&&(e==="core/paragraph"||e==="core/heading"||e==="core/image"||e==="core/button")&&n.metadata.bindings.__default?.source!=="core/pattern-overrides"){const o=["content","url","title","id","alt","text","linkTarget"];let r=!1;o.forEach(s=>{n.metadata.bindings[s]?.source==="core/pattern-overrides"&&(r=!0,n.metadata={...n.metadata,bindings:{...n.metadata.bindings}},delete n.metadata.bindings[s])}),r&&(n.metadata.bindings.__default={source:"core/pattern-overrides"})}return[e,n]}function lje(e,t){for(var n=t.split("."),o;o=n.shift();){if(!(o in e))return;e=e[o]}return e}var uje=function(){var e;return function(){return e||(e=document.implementation.createHTMLDocument("")),e}}();function kN(e,t){if(t){if(typeof e=="string"){var n=uje();n.body.innerHTML=e,e=n.body}if(typeof t=="function")return t(e);if(Object===t.constructor)return Object.keys(t).reduce(function(o,r){var s=t[r];return o[r]=kN(e,s),o},{})}}function SN(e,t){var n,o;return arguments.length===1?(n=e,o=void 0):(n=t,o=e),function(r){var s=r;if(o&&(s=r.querySelector(o)),s)return lje(s,n)}}function dje(e,t){var n,o;return arguments.length===1?(n=e,o=void 0):(n=t,o=e),function(r){var s=SN(o,"attributes")(r);if(s&&Object.prototype.hasOwnProperty.call(s,n))return s[n].value}}function pje(e){return SN(e,"textContent")}function fje(e,t){return function(n){var o=n.querySelectorAll(e);return[].map.call(o,function(r){return kN(r,t)})}}function bje(e){return Ze("wp.blocks.children.getChildrenArray",{since:"6.1",version:"6.3",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e}function hje(...e){Ze("wp.blocks.children.concat",{since:"6.1",version:"6.3",alternative:"wp.richText.concat",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=[];for(let n=0;n{let n=t;return e&&(n=t.querySelector(e)),n?CN(n.childNodes):[]}}const $8={concat:hje,getChildrenArray:bje,fromDOM:CN,toHTML:mje,matcher:zie};function gje(e){const t={};for(let n=0;n{let n=t;e&&(n=t.querySelector(e));try{return Oie(n)}catch{return null}}}function zje(e,t){return n=>{let o=n;if(e&&(o=n.querySelector(e)),!o)return"";if(t){let r="";const s=o.children.length;for(let i=0;in=>{const o=e?n.querySelector(e):n;return o?Ko.fromHTMLElement(o,{preserveWhiteSpace:t}):Ko.empty()},yje=e=>t=>e(t)!==void 0;function Aje(e,t){switch(t){case"rich-text":return e instanceof Ko;case"string":return typeof e=="string";case"boolean":return typeof e=="boolean";case"object":return!!e&&e.constructor===Object;case"null":return e===null;case"array":return Array.isArray(e);case"integer":case"number":return typeof e=="number"}return!0}function vje(e,t){return t.some(n=>Aje(e,n))}function xje(e,t,n,o,r){let s;switch(t.source){case void 0:s=o?o[e]:void 0;break;case"raw":s=r;break;case"attribute":case"property":case"html":case"text":case"rich-text":case"children":case"node":case"query":case"tag":s=U5(n,t);break}return(!wje(s,t.type)||!_je(s,t.enum))&&(s=void 0),s===void 0&&(s=Zse(t)),s}function wje(e,t){return t===void 0||vje(e,Array.isArray(t)?t:[t])}function _je(e,t){return!Array.isArray(t)||t.includes(e)}const yie=Us(e=>{switch(e.source){case"attribute":{let n=dje(e.selector,e.attribute);return e.type==="boolean"&&(n=yje(n)),n}case"html":return zje(e.selector,e.multiline);case"text":return pje(e.selector);case"rich-text":return Oje(e.selector,e.__unstablePreserveWhiteSpace);case"children":return zie(e.selector);case"node":return Mje(e.selector);case"query":const t=Object.fromEntries(Object.entries(e.query).map(([n,o])=>[n,yie(o)]));return fje(e.selector,t);case"tag":{const n=SN(e.selector,"nodeName");return o=>n(o)?.toLowerCase()}default:console.error(`Unknown source type "${e.source}"`)}});function Aie(e){return kN(e,t=>t)}function U5(e,t){return yie(t)(Aie(e))}function Nl(e,t,n={}){var o;const r=Aie(t),s=A3(e),i=Object.fromEntries(Object.entries((o=s.attributes)!==null&&o!==void 0?o:{}).map(([c,l])=>[c,xje(c,l,r,n,t)]));return zr("blocks.getBlockAttributes",i,s,t,n)}const kje={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function iX(e){const t=U5(`

${e}
`,kje);return t?t.trim().split(/\s+/):[]}function Sje(e,t,n){if(!Rt(t,"customClassName",!0))return e;const o={...e},{className:r,...s}=o,i=Gf(t,s),c=iX(i),u=iX(n).filter(d=>!c.includes(d));return u.length?o.className=u.join(" "):i&&delete o.className,o}const Cje={type:"string",source:"attribute",selector:"[data-aria-label] > *",attribute:"aria-label"};function qje(e){return U5(`
${e}
`,Cje)}function Rje(e,t,n){if(!Rt(t,"ariaLabel",!1))return e;const o={...e},r=qje(n);return r&&(o.ariaLabel=r),o}function G4(e,t){const{attributes:n,originalContent:o}=e;let r=n;return r=Sje(n,t,o),r=Rje(r,t,o),{...e,attributes:r}}function Tje(){return!1}function Eje(e,t,n){const o=t.attrs,{deprecated:r}=n;if(!r||!r.length)return e;for(let s=0;svie(d,t)).filter(d=>!!d),i=Te(n.blockName,Nl(o,n.innerHTML,n.attrs),s);i.originalContent=n.innerHTML;const c=Lje(i,o),{validationIssues:l}=c,u=Eje(c,n,o);return u.isValid||(u.__unstableBlockSource=e),!c.isValid&&u.isValid&&!t?.__unstableSkipMigrationLogs?(console.groupCollapsed("Updated Block: %s",o.name),console.info(`Block successfully updated for \`%s\` (%o). + +New content generated by \`save\` function: + +%s + +Content retrieved from post body: + +%s`,o.name,o,Gf(o,u.attributes),u.originalContent),console.groupEnd()):!c.isValid&&!u.isValid&&l.forEach(({log:d,args:p})=>d(...p)),u}function Zo(e,t){return die(e).reduce((n,o)=>{const r=vie(o,t);return r&&n.push(r),n},[])}function xie(){return Ei("from").filter(({type:e})=>e==="raw").map(e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)})}function wie(e,t){const n=document.implementation.createHTMLDocument("");return n.body.innerHTML=e,Array.from(n.body.children).flatMap(o=>{const r=_c(xie(),({isMatch:c})=>c(o));if(!r)return S0.isNative?Zo(`${o.outerHTML}`):Te("core/html",Nl("core/html",o.outerHTML));const{transform:s,blockName:i}=r;if(s){const c=s(o,t);return o.hasAttribute("class")&&(c.attributes.className=o.getAttribute("class")),c}return Te(i,Nl(i,o.outerHTML))})}function X5(e,t={}){const n=document.implementation.createHTMLDocument(""),o=document.implementation.createHTMLDocument(""),r=n.body,s=o.body;for(r.innerHTML=e;r.firstChild;){const i=r.firstChild;i.nodeType===i.TEXT_NODE?_4(i)?r.removeChild(i):((!s.lastChild||s.lastChild.nodeName!=="P")&&s.appendChild(o.createElement("P")),s.lastChild.appendChild(i)):i.nodeType===i.ELEMENT_NODE?i.nodeName==="BR"?(i.nextSibling&&i.nextSibling.nodeName==="BR"&&(s.appendChild(o.createElement("P")),r.removeChild(i.nextSibling)),s.lastChild&&s.lastChild.nodeName==="P"&&s.lastChild.hasChildNodes()?s.lastChild.appendChild(i):r.removeChild(i)):i.nodeName==="P"?_4(i)&&!t.raw?r.removeChild(i):s.appendChild(i):k2(i)?((!s.lastChild||s.lastChild.nodeName!=="P")&&s.appendChild(o.createElement("P")),s.lastChild.appendChild(i)):s.appendChild(i):r.removeChild(i)}return s.innerHTML}function _ie(e,t){if(e.nodeType!==e.COMMENT_NODE||e.nodeValue!=="nextpage"&&e.nodeValue.indexOf("more")!==0)return;const n=Pje(e,t);if(!e.parentNode||e.parentNode.nodeName!=="P")T6e(e,n);else{const o=Array.from(e.parentNode.childNodes),r=o.indexOf(e),s=e.parentNode.parentNode||t.body,i=(c,l)=>(c||(c=t.createElement("p")),c.appendChild(l),c);[o.slice(0,r).reduce(i,null),n,o.slice(r+1).reduce(i,null)].forEach(c=>c&&s.insertBefore(c,e.parentNode)),bf(e.parentNode)}}function Pje(e,t){if(e.nodeValue==="nextpage")return Ije(t);const n=e.nodeValue.slice(4).trim();let o=e,r=!1;for(;o=o.nextSibling;)if(o.nodeType===o.COMMENT_NODE&&o.nodeValue==="noteaser"){r=!0,bf(o);break}return jje(n,r,t)}function jje(e,t,n){const o=n.createElement("wp-block");return o.dataset.block="core/more",e&&(o.dataset.customText=e),t&&(o.dataset.noTeaser=""),o}function Ije(e){const t=e.createElement("wp-block");return t.dataset.block="core/nextpage",t}function aX(e){return e.nodeName==="OL"||e.nodeName==="UL"}function Dje(e){return Array.from(e.childNodes).map(({nodeValue:t=""})=>t).join("")}function kie(e){if(!aX(e))return;const t=e,n=e.previousElementSibling;if(n&&n.nodeName===e.nodeName&&t.children.length===1){for(;t.firstChild;)n.appendChild(t.firstChild);t.parentNode.removeChild(t)}const o=e.parentNode;if(o&&o.nodeName==="LI"&&o.children.length===1&&!/\S/.test(Dje(o))){const r=o,s=r.previousElementSibling,i=r.parentNode;s&&(s.appendChild(t),i.removeChild(r))}if(o&&aX(o)){const r=e.previousElementSibling;r?r.appendChild(e):MM(e)}}function Sie(e){return t=>{t.nodeName==="BLOCKQUOTE"&&(t.innerHTML=X5(t.innerHTML,e))}}function Fje(e,t){var n;const o=e.nodeName.toLowerCase();return o==="figcaption"||Gre(e)?!1:o in((n=t?.figure?.children)!==null&&n!==void 0?n:{})}function $je(e,t){var n;return e.nodeName.toLowerCase()in((n=t?.figure?.children?.a?.children)!==null&&n!==void 0?n:{})}function XS(e,t=e){const n=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(n,t),n.appendChild(e)}function Cie(e,t,n){if(!Fje(e,n))return;let o=e;const r=e.parentNode;$je(e,n)&&r.nodeName==="A"&&r.childNodes.length===1&&(o=e.parentNode);const s=o.closest("p,div");s?e.classList?(e.classList.contains("alignright")||e.classList.contains("alignleft")||e.classList.contains("aligncenter")||!s.textContent.trim())&&XS(o,s):XS(o,s):XS(o)}function qN(e,t,n=0){const o=sz(e);o.lastIndex=n;const r=o.exec(t);if(!r)return;if(r[1]==="["&&r[7]==="]")return qN(e,t,o.lastIndex);const s={index:r.index,content:r[0],shortcode:RN(r)};return r[1]&&(s.content=s.content.slice(1),s.index++),r[7]&&(s.content=s.content.slice(0,-1)),s}function Vje(e,t,n){return t.replace(sz(e),function(o,r,s,i,c,l,u,d){if(r==="["&&d==="]")return o;const p=n(RN(arguments));return p||p===""?r+p+d:o})}function Hje(e){return new TN(e).string()}function sz(e){return new RegExp("\\[(\\[?)("+e+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}const cX=Us(e=>{const t={},n=[],o=/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;e=e.replace(/[\u00a0\u200b]/g," ");let r;for(;r=o.exec(e);)r[1]?t[r[1].toLowerCase()]=r[2]:r[3]?t[r[3].toLowerCase()]=r[4]:r[5]?t[r[5].toLowerCase()]=r[6]:r[7]?n.push(r[7]):r[8]?n.push(r[8]):r[9]&&n.push(r[9]);return{named:t,numeric:n}});function RN(e){let t;return e[4]?t="self-closing":e[6]?t="closed":t="single",new TN({tag:e[2],attrs:e[3],type:t,content:e[5]})}const TN=Object.assign(function(e){const{tag:t,attrs:n,type:o,content:r}=e||{};if(Object.assign(this,{tag:t,type:o,content:r}),this.attrs={named:{},numeric:[]},!n)return;const s=["named","numeric"];typeof n=="string"?this.attrs=cX(n):n.length===s.length&&s.every((i,c)=>i===n[c])?this.attrs=n:Object.entries(n).forEach(([i,c])=>{this.set(i,c)})},{next:qN,replace:Vje,string:Hje,regexp:sz,attrs:cX,fromMatch:RN});Object.assign(TN.prototype,{get(e){return this.attrs[typeof e=="number"?"numeric":"named"][e]},set(e,t){return this.attrs[typeof e=="number"?"numeric":"named"][e]=t,this},string(){let e="["+this.tag;return this.attrs.numeric.forEach(t=>{/\s/.test(t)?e+=' "'+t+'"':e+=" "+t}),Object.entries(this.attrs.named).forEach(([t,n])=>{e+=" "+t+'="'+n+'"'}),this.type==="single"?e+"]":this.type==="self-closing"?e+" /]":(e+="]",this.content&&(e+=this.content),e+"[/"+this.tag+"]")}});const lX=e=>Array.isArray(e)?e:[e],uX=/(\n|

)\s*$/,dX=/^\s*(\n|<\/p>)/;function u2(e,t=0,n=[]){const o=Ei("from"),r=_c(o,u=>n.indexOf(u.blockName)===-1&&u.type==="shortcode"&&lX(u.tag).some(d=>sz(d).test(e)));if(!r)return[e];const i=lX(r.tag).find(u=>sz(u).test(e));let c;const l=t;if(c=qN(i,e,t)){t=c.index+c.content.length;const u=e.substr(0,c.index),d=e.substr(t);if(!c.shortcode.content?.includes("<")&&!(uX.test(u)&&dX.test(d)))return u2(e,t);if(r.isMatch&&!r.isMatch(c.shortcode.attrs))return u2(e,l,[...n,r.blockName]);let p=[];if(typeof r.transform=="function")p=[].concat(r.transform(c.shortcode.attrs,c)),p=p.map(f=>(f.originalContent=c.shortcode.content,G4(f,nn(f.name))));else{const f=Object.fromEntries(Object.entries(r.attributes).filter(([,z])=>z.shortcode).map(([z,y])=>[z,y.shortcode(c.shortcode.attrs,c)])),b=nn(r.blockName);if(!b)return[e];const h={...b,attributes:r.attributes};let g=Te(r.blockName,Nl(h,c.shortcode.content,f));g.originalContent=c.shortcode.content,g=G4(g,h),p=[g]}return[...u2(u.replace(uX,"")),...p,...u2(d.replace(dX,""))]}return[e]}function Uje(e,t){const o={phrasingContentSchema:O5(t),isPaste:t==="paste"},r=e.map(({isMatch:l,blockName:u,schema:d})=>{const p=Rt(u,"anchor");return d=typeof d=="function"?d(o):d,!p&&!l?d:d?Object.fromEntries(Object.entries(d).map(([f,b])=>{let h=b.attributes||[];return p&&(h=[...h,"id"]),[f,{...b,attributes:h,isMatch:l||void 0}]})):{}});function s(l,u,d){switch(d){case"children":return l==="*"||u==="*"?"*":{...l,...u};case"attributes":case"require":return[...l||[],...u||[]];case"isMatch":return!l||!u?void 0:(...p)=>l(...p)||u(...p)}}function i(l,u){for(const d in u)l[d]=l[d]?s(l[d],u[d],d):{...u[d]};return l}function c(l,u){for(const d in u)l[d]=l[d]?i(l[d],u[d]):{...u[d]};return l}return r.reduce(c,{})}function qie(e){return Uje(xie(),e)}function Xje(e){return!/<(?!br[ />])/i.test(e)}function Rie(e,t,n,o){Array.from(e).forEach(r=>{Rie(r.childNodes,t,n,o),t.forEach(s=>{n.contains(r)&&s(r,n,o)})})}function of(e,t=[],n){const o=document.implementation.createHTMLDocument("");return o.body.innerHTML=e,Rie(o.body.childNodes,t,o,n),o.body.innerHTML}function K4(e,t){const n=e[`${t}Sibling`];if(n&&k2(n))return n;const{parentNode:o}=e;if(!(!o||!k2(o)))return K4(o,t)}function Tie(e){e.nodeType===e.COMMENT_NODE&&bf(e)}function Gje(e,t){if(Gre(e))return!0;if(!t)return!1;const n=e.nodeName.toLowerCase();return[["ul","li","ol"],["h1","h2","h3","h4","h5","h6"]].some(r=>[n,t].filter(s=>!r.includes(s)).length===0)}function Eie(e,t){return e.every(n=>Gje(n,t)&&Eie(Array.from(n.children),t))}function Kje(e){return e.nodeName==="BR"&&e.previousSibling&&e.previousSibling.nodeName==="BR"}function Yje(e,t){const n=document.implementation.createHTMLDocument("");n.body.innerHTML=e;const o=Array.from(n.body.children);return!o.some(Kje)&&Eie(o,t)}function Wie(e,t){if(e.nodeName==="SPAN"&&e.style){const{fontWeight:n,fontStyle:o,textDecorationLine:r,textDecoration:s,verticalAlign:i}=e.style;(n==="bold"||n==="700")&&xg(t.createElement("strong"),e),o==="italic"&&xg(t.createElement("em"),e),(r==="line-through"||s.includes("line-through"))&&xg(t.createElement("s"),e),i==="super"?xg(t.createElement("sup"),e):i==="sub"&&xg(t.createElement("sub"),e)}else e.nodeName==="B"?e=vH(e,"strong"):e.nodeName==="I"?e=vH(e,"em"):e.nodeName==="A"&&(e.target&&e.target.toLowerCase()==="_blank"?e.rel="noreferrer noopener":(e.removeAttribute("target"),e.removeAttribute("rel")),e.name&&!e.id&&(e.id=e.name),e.id&&!e.ownerDocument.querySelector(`[href="#${e.id}"]`)&&e.removeAttribute("id"))}function Bie(e){e.nodeName!=="SCRIPT"&&e.nodeName!=="NOSCRIPT"&&e.nodeName!=="TEMPLATE"&&e.nodeName!=="STYLE"||e.parentNode.removeChild(e)}function Nie(e){if(e.nodeType!==e.ELEMENT_NODE)return;const t=e.getAttribute("style");if(!t||!t.includes("mso-list"))return;t.split(";").reduce((o,r)=>{const[s,i]=r.split(":");return s&&i&&(o[s.trim().toLowerCase()]=i.trim().toLowerCase()),o},{})["mso-list"]==="ignore"&&e.remove()}function GS(e){return e.nodeName==="OL"||e.nodeName==="UL"}function Zje(e,t){if(e.nodeName!=="P")return;const n=e.getAttribute("style");if(!n||!n.includes("mso-list"))return;const o=e.previousElementSibling;if(!o||!GS(o)){const d=e.textContent.trim().slice(0,1),p=/[1iIaA]/.test(d),f=t.createElement(p?"ol":"ul");p&&f.setAttribute("type",d),e.parentNode.insertBefore(f,e)}const r=e.previousElementSibling,s=r.nodeName,i=t.createElement("li");let c=r;i.innerHTML=of(e.innerHTML,[Nie]);const l=/mso-list\s*:[^;]+level([0-9]+)/i.exec(n);let u=l&&parseInt(l[1],10)-1||0;for(;u--;)c=c.lastChild||c,GS(c)&&(c=c.lastChild||c);GS(c)||(c=c.appendChild(t.createElement(s))),c.appendChild(i),e.parentNode.removeChild(e)}const Y4={};function as(e){const t=window.URL.createObjectURL(e);return Y4[t]=e,t}function Lie(e){return Y4[e]}function Pie(e){return Lie(e)?.type.split("/")[0]}function Z4(e){Y4[e]&&window.URL.revokeObjectURL(e),delete Y4[e]}function Wr(e){return!e||!e.indexOf?!1:e.indexOf("blob:")===0}function pX(e,t,n=""){if(!e||!t)return;const o=new window.Blob([t],{type:n}),r=window.URL.createObjectURL(o),s=document.createElement("a");s.href=r,s.download=e,s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(r)}function Qje(e){if(e.nodeName==="IMG"){if(e.src.indexOf("file:")===0&&(e.src=""),e.src.indexOf("data:")===0){const[t,n]=e.src.split(","),[o]=t.slice(5).split(";");if(!n||!o){e.src="";return}let r;try{r=atob(n)}catch{e.src="";return}const s=new Uint8Array(r.length);for(let l=0;l (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex:

foo
",type:"boolean"},emoji:{defaultValue:!1,description:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,description:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``",type:"boolean"},completeHTMLDocument:{defaultValue:!1,description:"Outputs a complete html document, including ``, `` and `` tags",type:"boolean"},metadata:{defaultValue:!1,description:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,description:"Split adjacent blockquote blocks",type:"boolean"}};if(M===!1)return JSON.parse(JSON.stringify(A));var k={};for(var S in A)A.hasOwnProperty(S)&&(k[S]=A[S].defaultValue);return k}function n(){var M=t(!0),A={};for(var k in M)M.hasOwnProperty(k)&&(A[k]=!0);return A}var o={},r={},s={},i=t(!0),c="vanilla",l={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:t(!0),allOn:n()};o.helper={},o.extensions={},o.setOption=function(M,A){return i[M]=A,this},o.getOption=function(M){return i[M]},o.getOptions=function(){return i},o.resetOptions=function(){i=t(!0)},o.setFlavor=function(M){if(!l.hasOwnProperty(M))throw Error(M+" flavor was not found");o.resetOptions();var A=l[M];c=M;for(var k in A)A.hasOwnProperty(k)&&(i[k]=A[k])},o.getFlavor=function(){return c},o.getFlavorOptions=function(M){if(l.hasOwnProperty(M))return l[M]},o.getDefaultOptions=function(M){return t(M)},o.subParser=function(M,A){if(o.helper.isString(M))if(typeof A<"u")r[M]=A;else{if(r.hasOwnProperty(M))return r[M];throw Error("SubParser named "+M+" not registered!")}},o.extension=function(M,A){if(!o.helper.isString(M))throw Error("Extension 'name' must be a string");if(M=o.helper.stdExtName(M),o.helper.isUndefined(A)){if(!s.hasOwnProperty(M))throw Error("Extension named "+M+" is not registered!");return s[M]}else{typeof A=="function"&&(A=A()),o.helper.isArray(A)||(A=[A]);var k=u(A,M);if(k.valid)s[M]=A;else throw Error(k.error)}},o.getAllExtensions=function(){return s},o.removeExtension=function(M){delete s[M]},o.resetExtensions=function(){s={}};function u(M,A){var k=A?"Error in "+A+" extension->":"Error in unnamed extension",S={valid:!0,error:""};o.helper.isArray(M)||(M=[M]);for(var C=0;C"u"},o.helper.forEach=function(M,A){if(o.helper.isUndefined(M))throw new Error("obj param is required");if(o.helper.isUndefined(A))throw new Error("callback param is required");if(!o.helper.isFunction(A))throw new Error("callback param must be a function/closure");if(typeof M.forEach=="function")M.forEach(A);else if(o.helper.isArray(M))for(var k=0;k").replace(/&/g,"&")};var p=function(M,A,k,S){var C=S||"",R=C.indexOf("g")>-1,T=new RegExp(A+"|"+k,"g"+C.replace(/g/g,"")),E=new RegExp(A,C.replace(/g/g,"")),B=[],N,j,I,P,$;do for(N=0;I=T.exec(M);)if(E.test(I[0]))N++||(j=T.lastIndex,P=j-I[0].length);else if(N&&!--N){$=I.index+I[0].length;var F={left:{start:P,end:j},match:{start:j,end:I.index},right:{start:I.index,end:$},wholeMatch:{start:P,end:$}};if(B.push(F),!R)return B}while(N&&(T.lastIndex=j));return B};o.helper.matchRecursiveRegExp=function(M,A,k,S){for(var C=p(M,A,k,S),R=[],T=0;T0){var N=[];T[0].wholeMatch.start!==0&&N.push(M.slice(0,T[0].wholeMatch.start));for(var j=0;j=0?S+(k||0):S},o.helper.splitAtIndex=function(M,A){if(!o.helper.isString(M))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[M.substring(0,A),M.substring(A)]},o.helper.encodeEmailAddress=function(M){var A=[function(k){return"&#"+k.charCodeAt(0)+";"},function(k){return"&#x"+k.charCodeAt(0).toString(16)+";"},function(k){return k}];return M=M.replace(/./g,function(k){if(k==="@")k=A[Math.floor(Math.random()*2)](k);else{var S=Math.random();k=S>.9?A[2](k):S>.45?A[1](k):A[0](k)}return k}),M},o.helper.padEnd=function(A,k,S){return k=k>>0,S=String(S||" "),A.length>k?String(A):(k=k-A.length,k>S.length&&(S+=S.repeat(k/S.length)),String(A)+S.slice(0,k))},typeof console>"u"&&(console={warn:function(M){alert(M)},log:function(M){alert(M)},error:function(M){throw M}}),o.helper.regexes={asteriskDashAndColon:/([*_:~])/g},o.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:':octocat:',showdown:`S`},o.Converter=function(M){var A={},k=[],S=[],C={},R=c,T={parsed:{},raw:"",format:""};E();function E(){M=M||{};for(var P in i)i.hasOwnProperty(P)&&(A[P]=i[P]);if(typeof M=="object")for(var $ in M)M.hasOwnProperty($)&&(A[$]=M[$]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof M+" was passed instead.");A.extensions&&o.helper.forEach(A.extensions,B)}function B(P,$){if($=$||null,o.helper.isString(P))if(P=o.helper.stdExtName(P),$=P,o.extensions[P]){console.warn("DEPRECATION WARNING: "+P+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),N(o.extensions[P],P);return}else if(!o.helper.isUndefined(s[P]))P=s[P];else throw Error('Extension "'+P+'" could not be loaded. It was either not found or is not a valid extension.');typeof P=="function"&&(P=P()),o.helper.isArray(P)||(P=[P]);var F=u(P,$);if(!F.valid)throw Error(F.error);for(var X=0;X[ \t]+¨NBSP;<"),!$)if(window&&window.document)$=window.document;else throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");var F=$.createElement("div");F.innerHTML=P;var X={preList:oe(F)};re(F);for(var Q=F.childNodes,V="",Z=0;Z'}else he.push(le[de].innerHTML),le[de].innerHTML="",le[de].setAttribute("prenum",de.toString());return he}return V},this.setOption=function(P,$){A[P]=$},this.getOption=function(P){return A[P]},this.getOptions=function(){return A},this.addExtension=function(P,$){$=$||null,B(P,$)},this.useExtension=function(P){B(P)},this.setFlavor=function(P){if(!l.hasOwnProperty(P))throw Error(P+" flavor was not found");var $=l[P];R=P;for(var F in $)$.hasOwnProperty(F)&&(A[F]=$[F])},this.getFlavor=function(){return R},this.removeExtension=function(P){o.helper.isArray(P)||(P=[P]);for(var $=0;$? ?(['"].*['"])?\)$/m)>-1)E="";else if(!E)if(T||(T=R.toLowerCase().replace(/ ?\n/g," ")),E="#"+T,!o.helper.isUndefined(k.gUrls[T]))E=k.gUrls[T],o.helper.isUndefined(k.gTitles[T])||(j=k.gTitles[T]);else return C;E=E.replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback);var I='",I};return M=M.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,S),M=M.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,S),M=M.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]??(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,S),M=M.replace(/\[([^\[\]]+)]()()()()()/g,S),A.ghMentions&&(M=M.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi,function(C,R,T,E,B){if(T==="\\")return R+E;if(!o.helper.isString(A.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var N=A.ghMentionsLink.replace(/\{u}/g,B),j="";return A.openLinksInNewWindow&&(j=' rel="noopener noreferrer" target="¨E95Eblank"'),R+'"+E+""})),M=k.converter._dispatch("anchors.after",M,A,k),M});var f=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,b=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,h=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,g=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,z=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,y=function(M){return function(A,k,S,C,R,T,E){S=S.replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback);var B=S,N="",j="",I=k||"",P=E||"";return/^www\./i.test(S)&&(S=S.replace(/^www\./i,"http://www.")),M.excludeTrailingPunctuationFromURLs&&T&&(N=T),M.openLinksInNewWindow&&(j=' rel="noopener noreferrer" target="¨E95Eblank"'),I+'"+B+""+N+P}},_=function(M,A){return function(k,S,C){var R="mailto:";return S=S||"",C=o.subParser("unescapeSpecialChars")(C,M,A),M.encodeEmails?(R=o.helper.encodeEmailAddress(R+C),C=o.helper.encodeEmailAddress(C)):R=R+C,S+''+C+""}};o.subParser("autoLinks",function(M,A,k){return M=k.converter._dispatch("autoLinks.before",M,A,k),M=M.replace(h,y(A)),M=M.replace(z,_(A,k)),M=k.converter._dispatch("autoLinks.after",M,A,k),M}),o.subParser("simplifiedAutoLinks",function(M,A,k){return A.simplifiedAutoLink&&(M=k.converter._dispatch("simplifiedAutoLinks.before",M,A,k),A.excludeTrailingPunctuationFromURLs?M=M.replace(b,y(A)):M=M.replace(f,y(A)),M=M.replace(g,_(A,k)),M=k.converter._dispatch("simplifiedAutoLinks.after",M,A,k)),M}),o.subParser("blockGamut",function(M,A,k){return M=k.converter._dispatch("blockGamut.before",M,A,k),M=o.subParser("blockQuotes")(M,A,k),M=o.subParser("headers")(M,A,k),M=o.subParser("horizontalRule")(M,A,k),M=o.subParser("lists")(M,A,k),M=o.subParser("codeBlocks")(M,A,k),M=o.subParser("tables")(M,A,k),M=o.subParser("hashHTMLBlocks")(M,A,k),M=o.subParser("paragraphs")(M,A,k),M=k.converter._dispatch("blockGamut.after",M,A,k),M}),o.subParser("blockQuotes",function(M,A,k){M=k.converter._dispatch("blockQuotes.before",M,A,k),M=M+` + +`;var S=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return A.splitAdjacentBlockquotes&&(S=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),M=M.replace(S,function(C){return C=C.replace(/^[ \t]*>[ \t]?/gm,""),C=C.replace(/¨0/g,""),C=C.replace(/^[ \t]+$/gm,""),C=o.subParser("githubCodeBlocks")(C,A,k),C=o.subParser("blockGamut")(C,A,k),C=C.replace(/(^|\n)/g,"$1 "),C=C.replace(/(\s*
[^\r]+?<\/pre>)/gm,function(R,T){var E=T;return E=E.replace(/^  /mg,"¨0"),E=E.replace(/¨0/g,""),E}),o.subParser("hashBlock")(`
+`+C+` +
`,A,k)}),M=k.converter._dispatch("blockQuotes.after",M,A,k),M}),o.subParser("codeBlocks",function(M,A,k){M=k.converter._dispatch("codeBlocks.before",M,A,k),M+="¨0";var S=/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;return M=M.replace(S,function(C,R,T){var E=R,B=T,N=` +`;return E=o.subParser("outdent")(E,A,k),E=o.subParser("encodeCode")(E,A,k),E=o.subParser("detab")(E,A,k),E=E.replace(/^\n+/g,""),E=E.replace(/\n+$/g,""),A.omitExtraWLInCodeBlocks&&(N=""),E="
"+E+N+"
",o.subParser("hashBlock")(E,A,k)+B}),M=M.replace(/¨0/,""),M=k.converter._dispatch("codeBlocks.after",M,A,k),M}),o.subParser("codeSpans",function(M,A,k){return M=k.converter._dispatch("codeSpans.before",M,A,k),typeof M>"u"&&(M=""),M=M.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(S,C,R,T){var E=T;return E=E.replace(/^([ \t]*)/g,""),E=E.replace(/[ \t]*$/g,""),E=o.subParser("encodeCode")(E,A,k),E=C+""+E+"",E=o.subParser("hashHTMLSpans")(E,A,k),E}),M=k.converter._dispatch("codeSpans.after",M,A,k),M}),o.subParser("completeHTMLDocument",function(M,A,k){if(!A.completeHTMLDocument)return M;M=k.converter._dispatch("completeHTMLDocument.before",M,A,k);var S="html",C=` +`,R="",T=` +`,E="",B="";typeof k.metadata.parsed.doctype<"u"&&(C=" +`,S=k.metadata.parsed.doctype.toString().toLowerCase(),(S==="html"||S==="html5")&&(T=''));for(var N in k.metadata.parsed)if(k.metadata.parsed.hasOwnProperty(N))switch(N.toLowerCase()){case"doctype":break;case"title":R=""+k.metadata.parsed.title+` +`;break;case"charset":S==="html"||S==="html5"?T=' +`:T=' +`;break;case"language":case"lang":E=' lang="'+k.metadata.parsed[N]+'"',B+=' +`;break;default:B+=' +`}return M=C+" + +`+R+T+B+` + +`+M.trim()+` + +`,M=k.converter._dispatch("completeHTMLDocument.after",M,A,k),M}),o.subParser("detab",function(M,A,k){return M=k.converter._dispatch("detab.before",M,A,k),M=M.replace(/\t(?=\t)/g," "),M=M.replace(/\t/g,"¨A¨B"),M=M.replace(/¨B(.+?)¨A/g,function(S,C){for(var R=C,T=4-R.length%4,E=0;E/g,">"),M=k.converter._dispatch("encodeAmpsAndAngles.after",M,A,k),M}),o.subParser("encodeBackslashEscapes",function(M,A,k){return M=k.converter._dispatch("encodeBackslashEscapes.before",M,A,k),M=M.replace(/\\(\\)/g,o.helper.escapeCharactersCallback),M=M.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,o.helper.escapeCharactersCallback),M=k.converter._dispatch("encodeBackslashEscapes.after",M,A,k),M}),o.subParser("encodeCode",function(M,A,k){return M=k.converter._dispatch("encodeCode.before",M,A,k),M=M.replace(/&/g,"&").replace(//g,">").replace(/([*_{}\[\]\\=~-])/g,o.helper.escapeCharactersCallback),M=k.converter._dispatch("encodeCode.after",M,A,k),M}),o.subParser("escapeSpecialCharsWithinTagAttributes",function(M,A,k){M=k.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",M,A,k);var S=/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,C=/-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;return M=M.replace(S,function(R){return R.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,o.helper.escapeCharactersCallback)}),M=M.replace(C,function(R){return R.replace(/([\\`*_~=|])/g,o.helper.escapeCharactersCallback)}),M=k.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",M,A,k),M}),o.subParser("githubCodeBlocks",function(M,A,k){return A.ghCodeBlocks?(M=k.converter._dispatch("githubCodeBlocks.before",M,A,k),M+="¨0",M=M.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(S,C,R,T){var E=A.omitExtraWLInCodeBlocks?"":` +`;return T=o.subParser("encodeCode")(T,A,k),T=o.subParser("detab")(T,A,k),T=T.replace(/^\n+/g,""),T=T.replace(/\n+$/g,""),T="
"+T+E+"
",T=o.subParser("hashBlock")(T,A,k),` + +¨G`+(k.ghCodeBlocks.push({text:S,codeblock:T})-1)+`G + +`}),M=M.replace(/¨0/,""),k.converter._dispatch("githubCodeBlocks.after",M,A,k)):M}),o.subParser("hashBlock",function(M,A,k){return M=k.converter._dispatch("hashBlock.before",M,A,k),M=M.replace(/(^\n+|\n+$)/g,""),M=` + +¨K`+(k.gHtmlBlocks.push(M)-1)+`K + +`,M=k.converter._dispatch("hashBlock.after",M,A,k),M}),o.subParser("hashCodeTags",function(M,A,k){M=k.converter._dispatch("hashCodeTags.before",M,A,k);var S=function(C,R,T,E){var B=T+o.subParser("encodeCode")(R,A,k)+E;return"¨C"+(k.gHtmlSpans.push(B)-1)+"C"};return M=o.helper.replaceRecursiveRegExp(M,S,"]*>","","gim"),M=k.converter._dispatch("hashCodeTags.after",M,A,k),M}),o.subParser("hashElement",function(M,A,k){return function(S,C){var R=C;return R=R.replace(/\n\n/g,` +`),R=R.replace(/^\n/,""),R=R.replace(/\n+$/g,""),R=` + +¨K`+(k.gHtmlBlocks.push(R)-1)+`K + +`,R}}),o.subParser("hashHTMLBlocks",function(M,A,k){M=k.converter._dispatch("hashHTMLBlocks.before",M,A,k);var S=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],C=function(P,$,F,X){var Q=P;return F.search(/\bmarkdown\b/)!==-1&&(Q=F+k.converter.makeHtml($)+X),` + +¨K`+(k.gHtmlBlocks.push(Q)-1)+`K + +`};A.backslashEscapesHTMLTags&&(M=M.replace(/\\<(\/?[^>]+?)>/g,function(P,$){return"<"+$+">"}));for(var R=0;R]*>)","im"),B="<"+S[R]+"\\b[^>]*>",N="";(T=o.helper.regexIndexOf(M,E))!==-1;){var j=o.helper.splitAtIndex(M,T),I=o.helper.replaceRecursiveRegExp(j[1],C,B,N,"im");if(I===j[1])break;M=j[0].concat(I)}return M=M.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,o.subParser("hashElement")(M,A,k)),M=o.helper.replaceRecursiveRegExp(M,function(P){return` + +¨K`+(k.gHtmlBlocks.push(P)-1)+`K + +`},"^ {0,3}","gm"),M=M.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,o.subParser("hashElement")(M,A,k)),M=k.converter._dispatch("hashHTMLBlocks.after",M,A,k),M}),o.subParser("hashHTMLSpans",function(M,A,k){M=k.converter._dispatch("hashHTMLSpans.before",M,A,k);function S(C){return"¨C"+(k.gHtmlSpans.push(C)-1)+"C"}return M=M.replace(/<[^>]+?\/>/gi,function(C){return S(C)}),M=M.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(C){return S(C)}),M=M.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(C){return S(C)}),M=M.replace(/<[^>]+?>/gi,function(C){return S(C)}),M=k.converter._dispatch("hashHTMLSpans.after",M,A,k),M}),o.subParser("unhashHTMLSpans",function(M,A,k){M=k.converter._dispatch("unhashHTMLSpans.before",M,A,k);for(var S=0;S]*>\\s*]*>","^ {0,3}\\s*
","gim"),M=k.converter._dispatch("hashPreCodeTags.after",M,A,k),M}),o.subParser("headers",function(M,A,k){M=k.converter._dispatch("headers.before",M,A,k);var S=isNaN(parseInt(A.headerLevelStart))?1:parseInt(A.headerLevelStart),C=A.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,R=A.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;M=M.replace(C,function(B,N){var j=o.subParser("spanGamut")(N,A,k),I=A.noHeaderId?"":' id="'+E(N)+'"',P=S,$=""+j+"";return o.subParser("hashBlock")($,A,k)}),M=M.replace(R,function(B,N){var j=o.subParser("spanGamut")(N,A,k),I=A.noHeaderId?"":' id="'+E(N)+'"',P=S+1,$=""+j+"";return o.subParser("hashBlock")($,A,k)});var T=A.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;M=M.replace(T,function(B,N,j){var I=j;A.customizedHeaderId&&(I=j.replace(/\s?\{([^{]+?)}\s*$/,""));var P=o.subParser("spanGamut")(I,A,k),$=A.noHeaderId?"":' id="'+E(j)+'"',F=S-1+N.length,X=""+P+"";return o.subParser("hashBlock")(X,A,k)});function E(B){var N,j;if(A.customizedHeaderId){var I=B.match(/\{([^{]+?)}\s*$/);I&&I[1]&&(B=I[1])}return N=B,o.helper.isString(A.prefixHeaderId)?j=A.prefixHeaderId:A.prefixHeaderId===!0?j="section-":j="",A.rawPrefixHeaderId||(N=j+N),A.ghCompatibleHeaderId?N=N.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():A.rawHeaderId?N=N.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():N=N.replace(/[^\w]/g,"").toLowerCase(),A.rawPrefixHeaderId&&(N=j+N),k.hashLinkCounts[N]?N=N+"-"+k.hashLinkCounts[N]++:k.hashLinkCounts[N]=1,N}return M=k.converter._dispatch("headers.after",M,A,k),M}),o.subParser("horizontalRule",function(M,A,k){M=k.converter._dispatch("horizontalRule.before",M,A,k);var S=o.subParser("hashBlock")("
",A,k);return M=M.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,S),M=M.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,S),M=M.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,S),M=k.converter._dispatch("horizontalRule.after",M,A,k),M}),o.subParser("images",function(M,A,k){M=k.converter._dispatch("images.before",M,A,k);var S=/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,C=/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,R=/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,T=/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,E=/!\[([^\[\]]+)]()()()()()/g;function B(j,I,P,$,F,X,Q,V){return $=$.replace(/\s/g,""),N(j,I,P,$,F,X,Q,V)}function N(j,I,P,$,F,X,Q,V){var Z=k.gUrls,re=k.gTitles,oe=k.gDimensions;if(P=P.toLowerCase(),V||(V=""),j.search(/\(? ?(['"].*['"])?\)$/m)>-1)$="";else if($===""||$===null)if((P===""||P===null)&&(P=I.toLowerCase().replace(/ ?\n/g," ")),$="#"+P,!o.helper.isUndefined(Z[P]))$=Z[P],o.helper.isUndefined(re[P])||(V=re[P]),o.helper.isUndefined(oe[P])||(F=oe[P].width,X=oe[P].height);else return j;I=I.replace(/"/g,""").replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback),$=$.replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback);var ae=''+I+'","
")}),M=M.replace(/\b__(\S[\s\S]*?)__\b/g,function(C,R){return S(R,"","")}),M=M.replace(/\b_(\S[\s\S]*?)_\b/g,function(C,R){return S(R,"","")})):(M=M.replace(/___(\S[\s\S]*?)___/g,function(C,R){return/\S$/.test(R)?S(R,"",""):C}),M=M.replace(/__(\S[\s\S]*?)__/g,function(C,R){return/\S$/.test(R)?S(R,"",""):C}),M=M.replace(/_([^\s_][\s\S]*?)_/g,function(C,R){return/\S$/.test(R)?S(R,"",""):C})),A.literalMidWordAsterisks?(M=M.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,function(C,R,T){return S(T,R+"","")}),M=M.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,function(C,R,T){return S(T,R+"","")}),M=M.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,function(C,R,T){return S(T,R+"","")})):(M=M.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(C,R){return/\S$/.test(R)?S(R,"",""):C}),M=M.replace(/\*\*(\S[\s\S]*?)\*\*/g,function(C,R){return/\S$/.test(R)?S(R,"",""):C}),M=M.replace(/\*([^\s*][\s\S]*?)\*/g,function(C,R){return/\S$/.test(R)?S(R,"",""):C})),M=k.converter._dispatch("italicsAndBold.after",M,A,k),M}),o.subParser("lists",function(M,A,k){function S(T,E){k.gListLevel++,T=T.replace(/\n{2,}$/,` +`),T+="¨0";var B=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,N=/\n[ \t]*\n(?!¨0)/.test(T);return A.disableForced4SpacesIndentedSublists&&(B=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),T=T.replace(B,function(j,I,P,$,F,X,Q){Q=Q&&Q.trim()!=="";var V=o.subParser("outdent")(F,A,k),Z="";return X&&A.tasklists&&(Z=' class="task-list-item" style="list-style-type: none;"',V=V.replace(/^[ \t]*\[(x|X| )?]/m,function(){var re='-1?(V=o.subParser("githubCodeBlocks")(V,A,k),V=o.subParser("blockGamut")(V,A,k)):(V=o.subParser("lists")(V,A,k),V=V.replace(/\n$/,""),V=o.subParser("hashHTMLBlocks")(V,A,k),V=V.replace(/\n\n+/g,` + +`),N?V=o.subParser("paragraphs")(V,A,k):V=o.subParser("spanGamut")(V,A,k)),V=V.replace("¨A",""),V=""+V+` +`,V}),T=T.replace(/¨0/g,""),k.gListLevel--,E&&(T=T.replace(/\s+$/,"")),T}function C(T,E){if(E==="ol"){var B=T.match(/^ *(\d+)\./);if(B&&B[1]!=="1")return' start="'+B[1]+'"'}return""}function R(T,E,B){var N=A.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,j=A.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,I=E==="ul"?N:j,P="";if(T.search(I)!==-1)(function F(X){var Q=X.search(I),V=C(T,E);Q!==-1?(P+=` + +<`+E+V+`> +`+S(X.slice(0,Q),!!B)+" +`,E=E==="ul"?"ol":"ul",I=E==="ul"?N:j,F(X.slice(Q))):P+=` + +<`+E+V+`> +`+S(X,!!B)+" +`})(T);else{var $=C(T,E);P=` + +<`+E+$+`> +`+S(T,!!B)+" +`}return P}return M=k.converter._dispatch("lists.before",M,A,k),M+="¨0",k.gListLevel?M=M.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(T,E,B){var N=B.search(/[*+-]/g)>-1?"ul":"ol";return R(E,N,!0)}):M=M.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(T,E,B,N){var j=N.search(/[*+-]/g)>-1?"ul":"ol";return R(B,j,!1)}),M=M.replace(/¨0/,""),M=k.converter._dispatch("lists.after",M,A,k),M}),o.subParser("metadata",function(M,A,k){if(!A.metadata)return M;M=k.converter._dispatch("metadata.before",M,A,k);function S(C){k.metadata.raw=C,C=C.replace(/&/g,"&").replace(/"/g,"""),C=C.replace(/\n {4}/g," "),C.replace(/^([\S ]+): +([\s\S]+?)$/gm,function(R,T,E){return k.metadata.parsed[T]=E,""})}return M=M.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,function(C,R,T){return S(T),"¨M"}),M=M.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,function(C,R,T){return R&&(k.metadata.format=R),S(T),"¨M"}),M=M.replace(/¨M/g,""),M=k.converter._dispatch("metadata.after",M,A,k),M}),o.subParser("outdent",function(M,A,k){return M=k.converter._dispatch("outdent.before",M,A,k),M=M.replace(/^(\t|[ ]{1,4})/gm,"¨0"),M=M.replace(/¨0/g,""),M=k.converter._dispatch("outdent.after",M,A,k),M}),o.subParser("paragraphs",function(M,A,k){M=k.converter._dispatch("paragraphs.before",M,A,k),M=M.replace(/^\n+/g,""),M=M.replace(/\n+$/g,"");for(var S=M.split(/\n{2,}/g),C=[],R=S.length,T=0;T=0?C.push(E):E.search(/\S/)>=0&&(E=o.subParser("spanGamut")(E,A,k),E=E.replace(/^([ \t]*)/g,"

"),E+="

",C.push(E))}for(R=C.length,T=0;T]*>\s*]*>/.test(N)&&(j=!0)}C[T]=N}return M=C.join(` +`),M=M.replace(/^\n+/g,""),M=M.replace(/\n+$/g,""),k.converter._dispatch("paragraphs.after",M,A,k)}),o.subParser("runExtension",function(M,A,k,S){if(M.filter)A=M.filter(A,S.converter,k);else if(M.regex){var C=M.regex;C instanceof RegExp||(C=new RegExp(C,"g")),A=A.replace(C,M.replace)}return A}),o.subParser("spanGamut",function(M,A,k){return M=k.converter._dispatch("spanGamut.before",M,A,k),M=o.subParser("codeSpans")(M,A,k),M=o.subParser("escapeSpecialCharsWithinTagAttributes")(M,A,k),M=o.subParser("encodeBackslashEscapes")(M,A,k),M=o.subParser("images")(M,A,k),M=o.subParser("anchors")(M,A,k),M=o.subParser("autoLinks")(M,A,k),M=o.subParser("simplifiedAutoLinks")(M,A,k),M=o.subParser("emoji")(M,A,k),M=o.subParser("underline")(M,A,k),M=o.subParser("italicsAndBold")(M,A,k),M=o.subParser("strikethrough")(M,A,k),M=o.subParser("ellipsis")(M,A,k),M=o.subParser("hashHTMLSpans")(M,A,k),M=o.subParser("encodeAmpsAndAngles")(M,A,k),A.simpleLineBreaks?/\n\n¨K/.test(M)||(M=M.replace(/\n+/g,`
+`)):M=M.replace(/ +\n/g,`
+`),M=k.converter._dispatch("spanGamut.after",M,A,k),M}),o.subParser("strikethrough",function(M,A,k){function S(C){return A.simplifiedAutoLink&&(C=o.subParser("simplifiedAutoLinks")(C,A,k)),""+C+""}return A.strikethrough&&(M=k.converter._dispatch("strikethrough.before",M,A,k),M=M.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(C,R){return S(R)}),M=k.converter._dispatch("strikethrough.after",M,A,k)),M}),o.subParser("stripLinkDefinitions",function(M,A,k){var S=/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,C=/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;M+="¨0";var R=function(T,E,B,N,j,I,P){return E=E.toLowerCase(),B.match(/^data:.+?\/.+?;base64,/)?k.gUrls[E]=B.replace(/\s/g,""):k.gUrls[E]=o.subParser("encodeAmpsAndAngles")(B,A,k),I?I+P:(P&&(k.gTitles[E]=P.replace(/"|'/g,""")),A.parseImgDimensions&&N&&j&&(k.gDimensions[E]={width:N,height:j}),"")};return M=M.replace(C,R),M=M.replace(S,R),M=M.replace(/¨0/,""),M}),o.subParser("tables",function(M,A,k){if(!A.tables)return M;var S=/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,C=/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;function R(j){return/^:[ \t]*--*$/.test(j)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(j)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(j)?' style="text-align:center;"':""}function T(j,I){var P="";return j=j.trim(),(A.tablesHeaderId||A.tableHeaderId)&&(P=' id="'+j.replace(/ /g,"_").toLowerCase()+'"'),j=o.subParser("spanGamut")(j,A,k),""+j+` +`}function E(j,I){var P=o.subParser("spanGamut")(j,A,k);return""+P+` +`}function B(j,I){for(var P=` + + +`,$=j.length,F=0;F<$;++F)P+=j[F];for(P+=` + + +`,F=0;F +`;for(var X=0;X<$;++X)P+=I[F][X];P+=` +`}return P+=` +
+`,P}function N(j){var I,P=j.split(` +`);for(I=0;I"+C+""}),M=M.replace(/\b__(\S[\s\S]*?)__\b/g,function(S,C){return""+C+""})):(M=M.replace(/___(\S[\s\S]*?)___/g,function(S,C){return/\S$/.test(C)?""+C+"":S}),M=M.replace(/__(\S[\s\S]*?)__/g,function(S,C){return/\S$/.test(C)?""+C+"":S})),M=M.replace(/(_)/g,o.helper.escapeCharactersCallback),M=k.converter._dispatch("underline.after",M,A,k)),M}),o.subParser("unescapeSpecialChars",function(M,A,k){return M=k.converter._dispatch("unescapeSpecialChars.before",M,A,k),M=M.replace(/¨E(\d+)E/g,function(S,C){var R=parseInt(C);return String.fromCharCode(R)}),M=k.converter._dispatch("unescapeSpecialChars.after",M,A,k),M}),o.subParser("makeMarkdown.blockquote",function(M,A){var k="";if(M.hasChildNodes())for(var S=M.childNodes,C=S.length,R=0;R "+k.split(` +`).join(` +> `),k}),o.subParser("makeMarkdown.codeBlock",function(M,A){var k=M.getAttribute("language"),S=M.getAttribute("precodenum");return"```"+k+` +`+A.preList[S]+"\n```"}),o.subParser("makeMarkdown.codeSpan",function(M){return"`"+M.innerHTML+"`"}),o.subParser("makeMarkdown.emphasis",function(M,A){var k="";if(M.hasChildNodes()){k+="*";for(var S=M.childNodes,C=S.length,R=0;R",M.hasAttribute("width")&&M.hasAttribute("height")&&(A+=" ="+M.getAttribute("width")+"x"+M.getAttribute("height")),M.hasAttribute("title")&&(A+=' "'+M.getAttribute("title")+'"'),A+=")"),A}),o.subParser("makeMarkdown.links",function(M,A){var k="";if(M.hasChildNodes()&&M.hasAttribute("href")){var S=M.childNodes,C=S.length;k="[";for(var R=0;R",M.hasAttribute("title")&&(k+=' "'+M.getAttribute("title")+'"'),k+=")"}return k}),o.subParser("makeMarkdown.list",function(M,A,k){var S="";if(!M.hasChildNodes())return"";for(var C=M.childNodes,R=C.length,T=M.getAttribute("start")||1,E=0;E"u"||C[E].tagName.toLowerCase()!=="li")){var B="";k==="ol"?B=T.toString()+". ":B="- ",S+=B+o.subParser("makeMarkdown.listItem")(C[E],A),++T}return S+=` + +`,S.trim()}),o.subParser("makeMarkdown.listItem",function(M,A){for(var k="",S=M.childNodes,C=S.length,R=0;R + +`;if(M.nodeType!==1)return"";var C=M.tagName.toLowerCase();switch(C){case"h1":k||(S=o.subParser("makeMarkdown.header")(M,A,1)+` + +`);break;case"h2":k||(S=o.subParser("makeMarkdown.header")(M,A,2)+` + +`);break;case"h3":k||(S=o.subParser("makeMarkdown.header")(M,A,3)+` + +`);break;case"h4":k||(S=o.subParser("makeMarkdown.header")(M,A,4)+` + +`);break;case"h5":k||(S=o.subParser("makeMarkdown.header")(M,A,5)+` + +`);break;case"h6":k||(S=o.subParser("makeMarkdown.header")(M,A,6)+` + +`);break;case"p":k||(S=o.subParser("makeMarkdown.paragraph")(M,A)+` + +`);break;case"blockquote":k||(S=o.subParser("makeMarkdown.blockquote")(M,A)+` + +`);break;case"hr":k||(S=o.subParser("makeMarkdown.hr")(M,A)+` + +`);break;case"ol":k||(S=o.subParser("makeMarkdown.list")(M,A,"ol")+` + +`);break;case"ul":k||(S=o.subParser("makeMarkdown.list")(M,A,"ul")+` + +`);break;case"precode":k||(S=o.subParser("makeMarkdown.codeBlock")(M,A)+` + +`);break;case"pre":k||(S=o.subParser("makeMarkdown.pre")(M,A)+` + +`);break;case"table":k||(S=o.subParser("makeMarkdown.table")(M,A)+` + +`);break;case"code":S=o.subParser("makeMarkdown.codeSpan")(M,A);break;case"em":case"i":S=o.subParser("makeMarkdown.emphasis")(M,A);break;case"strong":case"b":S=o.subParser("makeMarkdown.strong")(M,A);break;case"del":S=o.subParser("makeMarkdown.strikethrough")(M,A);break;case"a":S=o.subParser("makeMarkdown.links")(M,A);break;case"img":S=o.subParser("makeMarkdown.image")(M,A);break;default:S=M.outerHTML+` + +`}return S}),o.subParser("makeMarkdown.paragraph",function(M,A){var k="";if(M.hasChildNodes())for(var S=M.childNodes,C=S.length,R=0;R"+A.preList[k]+""}),o.subParser("makeMarkdown.strikethrough",function(M,A){var k="";if(M.hasChildNodes()){k+="~~";for(var S=M.childNodes,C=S.length,R=0;Rtr>th"),R=M.querySelectorAll("tbody>tr"),T,E;for(T=0;TF&&(F=X)}for(T=0;T/g,"\\$1>"),A=A.replace(/^#/gm,"\\#"),A=A.replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3"),A=A.replace(/^( {0,3}\d+)\./gm,"$1\\."),A=A.replace(/^( {0,3})([+-])/gm,"$1\\$2"),A=A.replace(/]([\s]*)\(/g,"\\]$1\\("),A=A.replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:"),A});var v=this;e.exports?e.exports=o:v.showdown=o}).call(e7e)}(Iv)),Iv.exports}var n7e=t7e();const o7e=Zr(n7e),r7e=new o7e.Converter({noHeaderId:!0,tables:!0,literalMidWordUnderscores:!0,omitExtraWLInCodeBlocks:!0,simpleLineBreaks:!0,strikethrough:!0});function s7e(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,(t,n,o,r)=>`${n} +${o} +${r}`)}function i7e(e){return e.replace(/(^|\n)•( +)/g,"$1*$2")}function a7e(e){return r7e.makeHtml(s7e(i7e(e)))}function c7e(e){if(e.nodeName==="IFRAME"){const t=e.ownerDocument.createTextNode(e.src);e.parentNode.replaceChild(t,e)}}function jie(e){!e.id||e.id.indexOf("docs-internal-guid-")!==0||(e.tagName==="B"?MM(e):e.removeAttribute("id"))}function l7e(e){return e===" "||e==="\r"||e===` +`||e===" "}function Iie(e){if(e.nodeType!==e.TEXT_NODE)return;let t=e;for(;t=t.parentNode;)if(t.nodeType===t.ELEMENT_NODE&&t.nodeName==="PRE")return;let n=e.data.replace(/[ \r\n\t]+/g," ");if(n[0]===" "){const o=K4(e,"previous");(!o||o.nodeName==="BR"||o.textContent.slice(-1)===" ")&&(n=n.slice(1))}if(n[n.length-1]===" "){const o=K4(e,"next");(!o||o.nodeName==="BR"||o.nodeType===o.TEXT_NODE&&l7e(o.textContent[0]))&&(n=n.slice(0,-1))}n?e.data=n:e.parentNode.removeChild(e)}function Die(e){e.nodeName==="BR"&&(K4(e,"next")||e.parentNode.removeChild(e))}function u7e(e){e.nodeName==="P"&&(e.hasChildNodes()||e.parentNode.removeChild(e))}function d7e(e){if(e.nodeName!=="SPAN"||e.getAttribute("data-stringify-type")!=="paragraph-break")return;const{parentNode:t}=e;t.insertBefore(e.ownerDocument.createElement("br"),e),t.insertBefore(e.ownerDocument.createElement("br"),e),t.removeChild(e)}const Fie=(...e)=>window?.console?.log?.(...e);function bX(e){return e=of(e,[Bie,jie,Nie,Wie,Tie]),e=u8(e,O5("paste"),{}),e=of(e,[Iie,Die]),Fie(`Processed inline HTML: + +`,e),e}function Kh({HTML:e="",plainText:t="",mode:n="AUTO",tagName:o}){if(e=e.replace(/]+>/g,""),e=e.replace(/^\s*]*>\s*]*>(?:\s*)?/i,""),e=e.replace(/(?:\s*)?<\/body>\s*<\/html>\s*$/i,""),n!=="INLINE"){const d=e||t;if(d.indexOf("",n=e.indexOf(t);if(n>-1)e=e.substring(n+t.length);else return e;const r=e.indexOf("");return r>-1&&(e=e.substring(0,r)),e}function H5t(e){const t="";return e.startsWith(t)?e.slice(t.length):e}function w7({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}catch{return}n=V5t(n),n=H5t(n);const o=k4(e);return o.length&&!U5t(o,n)?{files:o}:{html:n,plainText:t,files:[]}}function U5t(e,t){if(t&&e?.length===1&&e[0].type.indexOf("image/")===0){const n=/<\s*img\b/gi;if(t.match(n)?.length!==1)return!0;const o=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(o))return!0}return!1}const Mme=Symbol("requiresWrapperOnCopy");function zme(e,t,n){let o=t;const[r]=t;if(r&&n.select(Ct).getBlockType(r.name)[Mme]){const{getBlockRootClientId:c,getBlockName:l,getBlockAttributes:u}=n.select(J),d=c(r.clientId),p=l(d);p&&(o=Te(p,u(d),o))}const s=Ys(o);e.clipboardData.setData("text/plain",G5t(s)),e.clipboardData.setData("text/html",s)}function X5t(e,t){const{plainText:n,html:o,files:r}=w7(e);let s=[];if(r.length){const i=Ei("from");s=r.reduce((c,l)=>{const u=_c(i,d=>d.type==="files"&&d.isMatch([l]));return u&&c.push(u.transform([l])),c},[]).flat()}else s=Kh({HTML:o,plainText:n,mode:"BLOCKS"});return s}function G5t(e){return e=e.replace(/
/g,` +`),A1(e).trim().replace(/\n\n+/g,` + +`)}function K5t(){const e=Fn(),{getBlocksByClientId:t,getSelectedBlockClientIds:n,hasMultiSelection:o,getSettings:r,getBlockName:s,__unstableIsFullySelected:i,__unstableIsSelectionCollapsed:c,__unstableIsSelectionMergeable:l,__unstableGetSelectedBlocksWithPartialSelection:u,canInsertBlockType:d,getBlockRootClientId:p}=G(J),{flashBlock:f,removeBlocks:b,replaceBlocks:h,__unstableDeleteSelection:g,__unstableExpandSelection:z,__unstableSplitSelection:y}=ze(J),_=x7();return Mn(v=>{function M(A){if(A.defaultPrevented)return;const k=n();if(k.length===0)return;if(!o()){const{target:E}=A,{ownerDocument:B}=E;if(A.type==="copy"||A.type==="cut"?w6e(B):_6e(B)&&!B.activeElement.isContentEditable)return}const{activeElement:S}=A.target.ownerDocument;if(!v.contains(S))return;const C=l(),R=c()||i(),T=!R&&!C;if(A.type==="copy"||A.type==="cut")if(A.preventDefault(),k.length===1&&f(k[0]),T)z();else{_(A.type,k);let E;if(R)E=t(k);else{const[B,N]=u(),j=t(k.slice(1,k.length-1));E=[B,...j,N]}zme(A,E,e)}if(A.type==="cut")R&&!T?b(k):(A.target.ownerDocument.activeElement.contentEditable=!1,g());else if(A.type==="paste"){const{__experimentalCanUserUseUnfilteredHTML:E}=r();if(A.clipboardData.getData("rich-text")==="true")return;const{plainText:N,html:j,files:I}=w7(A),P=i();let $=[];if(I.length){const V=Ei("from");$=I.reduce((Z,re)=>{const oe=_c(V,ae=>ae.type==="files"&&ae.isMatch([re]));return oe&&Z.push(oe.transform([re])),Z},[]).flat()}else $=Kh({HTML:j,plainText:N,mode:P?"BLOCKS":"AUTO"});if(typeof $=="string")return;if(P){h(k,$,$.length-1,-1),A.preventDefault();return}if(!o()&&!Rt(s(k[0]),"splitting",!1)&&!A.__deprecatedOnSplit)return;const[F]=k,X=p(F),Q=[];for(const V of $)if(d(V.name,X))Q.push(V);else{const Z=s(X),re=V.name!==Z?Kr(V,Z):[V];if(!re)return;for(const oe of re)for(const ae of oe.innerBlocks)Q.push(ae)}y(Q),A.preventDefault()}}return v.ownerDocument.addEventListener("copy",M),v.ownerDocument.addEventListener("cut",M),v.ownerDocument.addEventListener("paste",M),()=>{v.ownerDocument.removeEventListener("copy",M),v.ownerDocument.removeEventListener("cut",M),v.ownerDocument.removeEventListener("paste",M)}},[])}function Ome(){const[e,t,n]=E5t(),o=G(r=>r(J).hasMultiSelection(),[]);return[e,yn([t,K5t(),$5t(),L5t(),D5t(),F5t(),T5t(),N5t(),B5t(),Mn(r=>(r.tabIndex=0,r.dataset.hasMultiSelection=o,o?(r.setAttribute("aria-label",m("Multiple selected blocks")),()=>{delete r.dataset.hasMultiSelection,r.removeAttribute("aria-label")}):()=>{delete r.dataset.hasMultiSelection}),[o])]),n]}function Y5t({children:e,...t},n){const[o,r,s]=Ome();return a.jsxs(a.Fragment,{children:[o,a.jsx("div",{...t,ref:yn([r,n]),className:te(t.className,"block-editor-writing-flow"),children:e}),s]})}const Z5t=x.forwardRef(Y5t);let JA=null;function Q5t(){return JA||(JA=Array.from(document.styleSheets).reduce((e,t)=>{try{t.cssRules}catch{return e}const{ownerNode:n,cssRules:o}=t;if(n===null||!o||n.id.startsWith("wp-")||!n.id)return e;function r(s){return Array.from(s).find(({selectorText:i,conditionText:c,cssRules:l})=>c?r(l):i&&(i.includes(".editor-styles-wrapper")||i.includes(".wp-block")))}if(r(o)){const s=n.tagName==="STYLE";if(s){const i=n.id.replace("-inline-css","-css"),c=document.getElementById(i);c&&e.push(c.cloneNode(!0))}if(e.push(n.cloneNode(!0)),!s){const i=n.id.replace("-css","-inline-css"),c=document.getElementById(i);c&&e.push(c.cloneNode(!0))}}return e},[]),JA)}function CQ({frameSize:e,containerWidth:t,maxContainerWidth:n,scaleContainerWidth:o}){return(Math.min(t,n)-e*2)/o}function J5t(e,t){const{scaleValue:n,scrollHeight:o}=e,{frameSize:r,scaleValue:s}=t;return o*(s/n)+r*2}function ewt(e,t){const{containerHeight:n,frameSize:o,scaleValue:r,scrollTop:s}=e,{containerHeight:i,frameSize:c,scaleValue:l,scrollHeight:u}=t;let d=s;d=(d+n/2-o)/r-n/2,d=(d+i/2)*l+c-i/2,d=s<=o?0:d;const p=u-i;return Math.round(Math.min(Math.max(0,d),Math.max(0,p)))}function twt(e,t){const{scaleValue:n,frameSize:o,scrollTop:r}=e,{scaleValue:s,frameSize:i,scrollTop:c}=t;return[{translate:"0 0",scale:n,paddingTop:`${o/n}px`,paddingBottom:`${o/n}px`},{translate:`0 ${r-c}px`,scale:s,paddingTop:`${i/s}px`,paddingBottom:`${i/s}px`}]}function nwt({frameSize:e,iframeDocument:t,maxContainerWidth:n=750,scale:o}){const[r,{height:s}]=bs(),[i,{width:c,height:l}]=bs(),u=x.useRef(0),d=o!==1,p=I1(),f=o==="auto-scaled",b=x.useRef(!1),h=x.useRef(null);x.useEffect(()=>{d||(u.current=c)},[c,d]);const g=Math.max(u.current,c),z=f?CQ({frameSize:e,containerWidth:c,maxContainerWidth:n,scaleContainerWidth:g}):o,y=x.useRef({scaleValue:z,frameSize:e,containerHeight:0,scrollTop:0,scrollHeight:0}),_=x.useRef({scaleValue:z,frameSize:e,containerHeight:0,scrollTop:0,scrollHeight:0}),v=x.useCallback(()=>{const{scrollTop:k}=y.current,{scrollTop:S}=_.current;return t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scroll-top",`${k}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scroll-top-next",`${S}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-overflow-behavior",y.current.scrollHeight===y.current.containerHeight?"auto":"scroll"),t.documentElement.classList.add("zoom-out-animation"),t.documentElement.animate(twt(y.current,_.current),{easing:"cubic-bezier(0.46, 0.03, 0.52, 0.96)",duration:400})},[t]),M=x.useCallback(()=>{b.current=!1,h.current=null,t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale",_.current.scaleValue),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size",`${_.current.frameSize}px`),t.documentElement.classList.remove("zoom-out-animation"),t.documentElement.scrollTop=_.current.scrollTop,t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scroll-top"),t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scroll-top-next"),t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-overflow-behavior"),y.current=_.current},[t]),A=x.useRef(!1);return x.useEffect(()=>{const k=t&&A.current!==d;if(A.current=d,!!k&&(b.current=!0,!!d))return t.documentElement.classList.add("is-zoomed-out"),()=>{t.documentElement.classList.remove("is-zoomed-out")}},[t,d]),x.useEffect(()=>{if(t&&(f&&y.current.scaleValue!==1&&(y.current.scaleValue=CQ({frameSize:y.current.frameSize,containerWidth:c,maxContainerWidth:n,scaleContainerWidth:c})),z<1&&(b.current||(t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale",z),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size",`${e}px`)),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-content-height",`${s}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-inner-height",`${l}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-container-width",`${c}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale-container-width",`${g}px`)),b.current))if(b.current=!1,h.current){h.current.reverse();const k=y.current,S=_.current;y.current=S,_.current=k}else y.current.scrollTop=t.documentElement.scrollTop,y.current.scrollHeight=t.documentElement.scrollHeight,y.current.containerHeight=l,_.current={scaleValue:z,frameSize:e,containerHeight:t.documentElement.clientHeight},_.current.scrollHeight=J5t(y.current,_.current),_.current.scrollTop=ewt(y.current,_.current),h.current=v(),p?M():h.current.onfinish=M},[v,M,p,f,z,e,t,s,c,l,n,g]),{isZoomedOut:d,scaleContainerWidth:g,contentResizeListener:r,containerResizeListener:i}}function yme(e,t,n){const o={};for(const i in e)o[i]=e[i];if(e instanceof n.contentDocument.defaultView.MouseEvent){const i=n.getBoundingClientRect();o.clientX+=i.left,o.clientY+=i.top}const r=new t(e.type,o);o.defaultPrevented&&r.preventDefault(),!n.dispatchEvent(r)&&e.preventDefault()}function owt(e){return Mn(()=>{const{defaultView:t}=e;if(!t)return;const{frameElement:n}=t,o=e.documentElement,r=["dragover","mousemove"],s={};for(const i of r)s[i]=c=>{const u=Object.getPrototypeOf(c).constructor.name,d=window[u];yme(c,d,n)},o.addEventListener(i,s[i]);return()=>{for(const i of r)o.removeEventListener(i,s[i])}})}function rwt({contentRef:e,children:t,tabIndex:n=0,scale:o=1,frameSize:r=0,readonly:s,forwardedRef:i,title:c=m("Editor canvas"),...l}){const{resolvedAssets:u,isPreviewMode:d}=G($=>{const{getSettings:F}=$(J),X=F();return{resolvedAssets:X.__unstableResolvedAssets,isPreviewMode:X.isPreviewMode}},[]),{styles:p="",scripts:f=""}=u,[b,h]=x.useState(),[g,z]=x.useState([]),y=v7(),[_,v,M]=Ome(),A=Mn($=>{$._load=()=>{h($.contentDocument)};let F;function X(Z){Z.preventDefault()}const{ownerDocument:Q}=$;z(Array.from(Q.body.classList).filter(Z=>Z.startsWith("admin-color-")||Z.startsWith("post-type-")||Z==="wp-embed-responsive"));function V(){const{contentDocument:Z}=$,{documentElement:re}=Z;F=Z,re.classList.add("block-editor-iframe__html"),y(re),Z.dir=Q.dir;for(const oe of Q5t())Z.getElementById(oe.id)||(Z.head.appendChild(oe.cloneNode(!0)),d||console.warn(`${oe.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,oe));F.addEventListener("dragover",X,!1),F.addEventListener("drop",X,!1),F.addEventListener("click",oe=>{if(oe.target.tagName==="A"){oe.preventDefault();const ae=oe.target.getAttribute("href");ae?.startsWith("#")&&(F.defaultView.location.hash=ae.slice(1))}})}return $.addEventListener("load",V),()=>{delete $._load,$.removeEventListener("load",V),F?.removeEventListener("dragover",X),F?.removeEventListener("drop",X)}},[]),{contentResizeListener:k,containerResizeListener:S,isZoomedOut:C,scaleContainerWidth:R}=nwt({scale:o,frameSize:parseInt(r),iframeDocument:b}),T=wB({isDisabled:!s}),E=yn([owt(b),e,y,v,T]),B=` + + + + + - + + + + diff --git a/ios/Sources/GutenbergKit/Gutenberg/remote.html b/ios/Sources/GutenbergKit/Gutenberg/remote.html index 2afcc9cd..f94a68a6 100644 --- a/ios/Sources/GutenbergKit/Gutenberg/remote.html +++ b/ios/Sources/GutenbergKit/Gutenberg/remote.html @@ -7,8 +7,10 @@ content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> Gutenberg - - + + + + From 26bcf2a521f63fcda259e53e00f7b06e9d0a049a Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 5 May 2025 14:35:47 -0400 Subject: [PATCH 31/48] fix: Lazy load bundled `@wordpress` packages after locale is set Using static imports means the packages are loaded before the locale is set, leading to incorrect translation strings in various places. --- src/index.jsx | 18 +++++------------- src/remote.jsx | 3 ++- src/utils/local-editor.js | 23 +++++++++++++++++++++++ 3 files changed, 30 insertions(+), 14 deletions(-) create mode 100644 src/utils/local-editor.js diff --git a/src/index.jsx b/src/index.jsx index 2432aecd..d8632cb0 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -2,10 +2,6 @@ * WordPress dependencies */ import { createRoot, StrictMode } from '@wordpress/element'; -import { dispatch } from '@wordpress/data'; -import { store as editorStore } from '@wordpress/editor'; -import { store as preferencesStore } from '@wordpress/preferences'; -import { registerCoreBlocks } from '@wordpress/block-library'; /** * Internal dependencies @@ -16,22 +12,18 @@ import { configureLocale } from './utils/localization'; import './index.scss'; import EditorLoadError from './components/editor-load-error'; import { error } from './utils/logger'; +import { loadEditorAssets } from './utils/local-editor'; try { await awaitGBKitGlobal(); initializeApiFetch(); await configureLocale(); - // Postpone importing `@wordpress` packages until after setting the locale + // Ensure the correct translation strings are used by postponing the import + // of `@wordpress` packages until after the locale is set. + const wpDependencies = await loadEditorAssets(); const { initializeEditor } = await import( './utils/editor' ); - initializeEditor( { - StrictMode, - createRoot, - dispatch, - editorStore, - preferencesStore, - registerCoreBlocks, - } ); + initializeEditor( wpDependencies ); } catch ( err ) { error( 'Error initializing editor', err ); const root = document.getElementById( 'root' ); diff --git a/src/remote.jsx b/src/remote.jsx index 84cb6f39..82f66147 100644 --- a/src/remote.jsx +++ b/src/remote.jsx @@ -27,7 +27,8 @@ try { const { configureLocale } = await import( './utils/localization' ); await configureLocale(); - // Load the rest of the packages, excluding the i18n packages. + // Ensure the correct translation strings are used by postponing the import + // of the remaining `@wordpress` packages until after the locale is set. const { allowedBlockTypes, wpDependencies } = await loadEditorAssets( { disallowedPackages: I18N_PACKAGES, } ); diff --git a/src/utils/local-editor.js b/src/utils/local-editor.js new file mode 100644 index 00000000..3323256b --- /dev/null +++ b/src/utils/local-editor.js @@ -0,0 +1,23 @@ +/** + * Loads the editor assets for the local editor. + * + * @return {Promise} The editor assets. + */ +export async function loadEditorAssets() { + const { createRoot, StrictMode } = await import( '@wordpress/element' ); + const { dispatch } = await import( '@wordpress/data' ); + const { store: editorStore } = await import( '@wordpress/editor' ); + const { store: preferencesStore } = await import( + '@wordpress/preferences' + ); + const { registerCoreBlocks } = await import( '@wordpress/block-library' ); + + return { + createRoot, + StrictMode, + dispatch, + editorStore, + preferencesStore, + registerCoreBlocks, + }; +} From be3786b4ad065e2d1e45e63ddeeb7291e391e4fe Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 5 May 2025 14:37:07 -0400 Subject: [PATCH 32/48] fix: Ensure foundational styles are available for early error UI If the editor fails early in the load process, these styles need to be present for presenting error message UI. Therefore, we hoist them to the entry file. --- src/components/visual-editor/index.jsx | 10 ---------- src/index.jsx | 10 ++++++++++ src/remote.jsx | 10 ++++++++++ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/components/visual-editor/index.jsx b/src/components/visual-editor/index.jsx index e431155a..3803120d 100644 --- a/src/components/visual-editor/index.jsx +++ b/src/components/visual-editor/index.jsx @@ -16,17 +16,7 @@ import { Popover } from '@wordpress/components'; import { store as editorStore, PostTitle } from '@wordpress/editor'; import { useSelect } from '@wordpress/data'; import { store as editPostStore } from '@wordpress/edit-post'; -// Default styles that are needed for the editor. -import '@wordpress/components/build-style/style.css'; -import '@wordpress/block-editor/build-style/style.css'; -// Default styles that are needed for the core blocks. -import '@wordpress/block-library/build-style/style.css'; -import '@wordpress/block-library/build-style/editor.css'; -import '@wordpress/block-library/build-style/theme.css'; import '@wordpress/format-library'; -import '@wordpress/format-library/build-style/style.css'; -import '@wordpress/block-editor/build-style/content.css'; -import '@wordpress/editor/build-style/style.css'; /** * Internal dependencies diff --git a/src/index.jsx b/src/index.jsx index d8632cb0..36f099b5 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -2,6 +2,16 @@ * WordPress dependencies */ import { createRoot, StrictMode } from '@wordpress/element'; +// Default styles that are needed for the editor. +import '@wordpress/components/build-style/style.css'; +import '@wordpress/block-editor/build-style/style.css'; +// Default styles that are needed for the core blocks. +import '@wordpress/block-library/build-style/style.css'; +import '@wordpress/block-library/build-style/editor.css'; +import '@wordpress/block-library/build-style/theme.css'; +import '@wordpress/format-library/build-style/style.css'; +import '@wordpress/block-editor/build-style/content.css'; +import '@wordpress/editor/build-style/style.css'; /** * Internal dependencies diff --git a/src/remote.jsx b/src/remote.jsx index 82f66147..ed3d6bed 100644 --- a/src/remote.jsx +++ b/src/remote.jsx @@ -2,6 +2,16 @@ * WordPress dependencies */ import apiFetch from '@wordpress/api-fetch'; +// Default styles that are needed for the editor. +import '@wordpress/components/build-style/style.css'; +import '@wordpress/block-editor/build-style/style.css'; +// Default styles that are needed for the core blocks. +import '@wordpress/block-library/build-style/style.css'; +import '@wordpress/block-library/build-style/editor.css'; +import '@wordpress/block-library/build-style/theme.css'; +import '@wordpress/format-library/build-style/style.css'; +import '@wordpress/block-editor/build-style/content.css'; +import '@wordpress/editor/build-style/style.css'; /** * Internal dependencies From f2682b8f89033d7340420c88022db954322b4edf Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Tue, 6 May 2025 12:25:00 -0400 Subject: [PATCH 33/48] refactor: Separate block utilities Limit scope of file responsibilities. --- src/remote.jsx | 6 +++--- src/utils/blocks.js | 26 ++++++++++++++++++++++++++ src/utils/editor.jsx | 23 ----------------------- 3 files changed, 29 insertions(+), 26 deletions(-) create mode 100644 src/utils/blocks.js diff --git a/src/remote.jsx b/src/remote.jsx index ed3d6bed..597f7ffb 100644 --- a/src/remote.jsx +++ b/src/remote.jsx @@ -18,6 +18,7 @@ import '@wordpress/editor/build-style/style.css'; */ import { awaitGBKitGlobal } from './utils/bridge'; import { initializeApiFetch } from './utils/api-fetch'; +import { unregisterDisallowedBlocks } from './utils/blocks'; import { loadEditorAssets } from './utils/remote-editor'; import { error } from './utils/logger'; import './index.scss'; @@ -42,9 +43,8 @@ try { const { allowedBlockTypes, wpDependencies } = await loadEditorAssets( { disallowedPackages: I18N_PACKAGES, } ); - const { initializeEditor, unregisterDisallowedBlocks } = await import( - './utils/editor' - ); + const { initializeEditor } = await import( './utils/editor' ); + initializeEditor( wpDependencies ); unregisterDisallowedBlocks( allowedBlockTypes ); } catch ( err ) { diff --git a/src/utils/blocks.js b/src/utils/blocks.js new file mode 100644 index 00000000..51eced65 --- /dev/null +++ b/src/utils/blocks.js @@ -0,0 +1,26 @@ +/** + * WordPress dependencies + */ +import { getBlockTypes, unregisterBlockType } from '@wordpress/blocks'; +import { debug } from './logger'; + +/** + * Unregister blocks that are disallowed. + * + * @param {Array} allowedBlockTypes The list of allowed block types. + */ +export function unregisterDisallowedBlocks( allowedBlockTypes ) { + if ( ! allowedBlockTypes ) { + return; + } + + const unregisteredBlocks = []; + getBlockTypes().forEach( ( block ) => { + if ( ! allowedBlockTypes.includes( block.name ) ) { + unregisterBlockType( block.name ); + unregisteredBlocks.push( block.name ); + } + } ); + + debug( 'Blocks unregistered:', unregisteredBlocks ); +} diff --git a/src/utils/editor.jsx b/src/utils/editor.jsx index aaeadb41..6e7a19fc 100644 --- a/src/utils/editor.jsx +++ b/src/utils/editor.jsx @@ -1,7 +1,6 @@ /** * WordPress dependencies */ -import { getBlockTypes, unregisterBlockType } from '@wordpress/blocks'; import defaultEditorStyles from '@wordpress/block-editor/build-style/default-editor-styles.css?inline'; /** @@ -9,7 +8,6 @@ import defaultEditorStyles from '@wordpress/block-editor/build-style/default-edi */ import Layout from '../components/layout'; import { getGBKit, getPost } from './bridge'; -import { debug } from './logger'; /** * Configure editor settings and styles, and render the editor. @@ -58,24 +56,3 @@ export function initializeEditor( { ); } - -/** - * Unregister blocks that are disallowed. - * - * @param {Array} allowedBlockTypes The list of allowed block types. - */ -export function unregisterDisallowedBlocks( allowedBlockTypes ) { - if ( ! allowedBlockTypes ) { - return; - } - - const unregisteredBlocks = []; - getBlockTypes().forEach( ( block ) => { - if ( ! allowedBlockTypes.includes( block.name ) ) { - unregisterBlockType( block.name ); - unregisteredBlocks.push( block.name ); - } - } ); - - debug( 'Blocks unregistered:', unregisteredBlocks ); -} From 930917bace3b103d2230f83cc8cbae15b8259f8e Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Tue, 6 May 2025 12:44:38 -0400 Subject: [PATCH 34/48] refactor: `initializeEditor` provides default WP packages Simplify initializing the local editor. --- src/index.jsx | 4 +--- src/remote.jsx | 3 +-- src/utils/editor.jsx | 22 +++++++++++++++------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/index.jsx b/src/index.jsx index 36f099b5..4c82ce2e 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -22,7 +22,6 @@ import { configureLocale } from './utils/localization'; import './index.scss'; import EditorLoadError from './components/editor-load-error'; import { error } from './utils/logger'; -import { loadEditorAssets } from './utils/local-editor'; try { await awaitGBKitGlobal(); @@ -31,9 +30,8 @@ try { // Ensure the correct translation strings are used by postponing the import // of `@wordpress` packages until after the locale is set. - const wpDependencies = await loadEditorAssets(); const { initializeEditor } = await import( './utils/editor' ); - initializeEditor( wpDependencies ); + initializeEditor(); } catch ( err ) { error( 'Error initializing editor', err ); const root = document.getElementById( 'root' ); diff --git a/src/remote.jsx b/src/remote.jsx index 597f7ffb..d8296c2e 100644 --- a/src/remote.jsx +++ b/src/remote.jsx @@ -19,6 +19,7 @@ import '@wordpress/editor/build-style/style.css'; import { awaitGBKitGlobal } from './utils/bridge'; import { initializeApiFetch } from './utils/api-fetch'; import { unregisterDisallowedBlocks } from './utils/blocks'; +import { initializeEditor } from './utils/editor'; import { loadEditorAssets } from './utils/remote-editor'; import { error } from './utils/logger'; import './index.scss'; @@ -43,8 +44,6 @@ try { const { allowedBlockTypes, wpDependencies } = await loadEditorAssets( { disallowedPackages: I18N_PACKAGES, } ); - const { initializeEditor } = await import( './utils/editor' ); - initializeEditor( wpDependencies ); unregisterDisallowedBlocks( allowedBlockTypes ); } catch ( err ) { diff --git a/src/utils/editor.jsx b/src/utils/editor.jsx index 6e7a19fc..2ad7d5ee 100644 --- a/src/utils/editor.jsx +++ b/src/utils/editor.jsx @@ -7,6 +7,14 @@ import defaultEditorStyles from '@wordpress/block-editor/build-style/default-edi * Internal dependencies */ import Layout from '../components/layout'; +import { + createRoot as _createRoot, + StrictMode as _StrictMode, +} from '@wordpress/element'; +import { dispatch as _dispatch } from '@wordpress/data'; +import { store as _editorStore } from '@wordpress/editor'; +import { store as _preferencesStore } from '@wordpress/preferences'; +import { registerCoreBlocks as _registerCoreBlocks } from '@wordpress/block-library'; import { getGBKit, getPost } from './bridge'; /** @@ -25,13 +33,13 @@ import { getGBKit, getPost } from './bridge'; * @param {Function} wpDependencies.registerCoreBlocks */ export function initializeEditor( { - createRoot, - StrictMode, - dispatch, - editorStore, - preferencesStore, - registerCoreBlocks, -} ) { + createRoot = _createRoot, + StrictMode = _StrictMode, + dispatch = _dispatch, + editorStore = _editorStore, + preferencesStore = _preferencesStore, + registerCoreBlocks = _registerCoreBlocks, +} = {} ) { const { themeStyles, hideTitle, editorSettings } = getGBKit(); const settings = editorSettings || { From 310616c08eb355ce78c9ccafb7ebdc8dfc4ba088 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 8 May 2025 12:27:35 -0400 Subject: [PATCH 35/48] build: Prevent unintentional preloading of `@wordpress` modules The locale must be set before most `@wordpress` modules load, as they rely upon globals for retrieving translation strings. However, the manual chunks configuration seemingly led to preloading of all `@wordpress` modules even before they were dynamically imported. https://github.com/vitejs/vite/discussions/8617#discussioncomment-10638744 --- vite.config.js | 10 ---------- vite.config.remote.js | 8 -------- 2 files changed, 18 deletions(-) diff --git a/vite.config.js b/vite.config.js index 1ae41d8e..882162ee 100644 --- a/vite.config.js +++ b/vite.config.js @@ -10,16 +10,6 @@ export default defineConfig( { build: { outDir: '../dist', target: 'esnext', - rollupOptions: { - output: { - manualChunks: { - // Chunk to avoid circular dependency - bridge: [ 'src/utils/bridge.js' ], - // The dynamic import of this module fails without this - editor: [ 'src/utils/editor.jsx' ], - }, - }, - }, }, plugins: [ nodePolyfills(), react() ], root: 'src', diff --git a/vite.config.remote.js b/vite.config.remote.js index ca01c0d2..251c6a83 100644 --- a/vite.config.remote.js +++ b/vite.config.remote.js @@ -19,14 +19,6 @@ export default defineConfig( { rollupOptions: { input: resolve( __dirname, 'src/remote.html' ), external: externalize, - output: { - manualChunks: { - // Chunk to avoid circular dependency - bridge: [ 'src/utils/bridge.js' ], - // The dynamic import of this module fails without this - editor: [ 'src/utils/editor.jsx' ], - }, - }, }, target: 'esnext', }, From 0bb5fe6c07ecdbc57d3277182fa1722bef34d23d Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 8 May 2025 12:31:58 -0400 Subject: [PATCH 36/48] task: Capture build output --- .../Gutenberg/assets/bridge-CeTaRbKr.js | 2 - .../Gutenberg/assets/cy-CGIlBSk6.js | 12 + .../Gutenberg/assets/cy-CqzxJAfu.js | 12 - .../Gutenberg/assets/editor-2DRWlLPS.js | 782 ++++++++++++++++ .../Gutenberg/assets/editor-Beg1s0b0.js | 4 - .../Gutenberg/assets/editor-tP9apWFw.js | 836 ------------------ .../Gutenberg/assets/gl-BLUmXQ2R.js | 13 + .../Gutenberg/assets/gl-NvaeEG05.js | 13 - .../Gutenberg/assets/index-BppLUDwx.js | 57 ++ .../Gutenberg/assets/index-DO4E_UAn.js | 2 - ...editor-Cn5dddl1.css => index-OGmBC7ij.css} | 2 +- .../Gutenberg/assets/index-lwjbap72.css | 1 - .../Gutenberg/assets/localization-BKA8CWIV.js | 1 + .../Gutenberg/assets/localization-KXdhtQ45.js | 1 - .../Gutenberg/assets/remote-B2_s7g-L.js | 5 + .../Gutenberg/assets/remote-BcVlfPFi.css | 1 + .../Gutenberg/assets/remote-CQD0zuAs.css | 1 - .../Gutenberg/assets/remote-pYQAibFN.js | 2 - ios/Sources/GutenbergKit/Gutenberg/index.html | 7 +- .../GutenbergKit/Gutenberg/remote.html | 7 +- 20 files changed, 876 insertions(+), 885 deletions(-) delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/bridge-CeTaRbKr.js create mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/cy-CGIlBSk6.js delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/cy-CqzxJAfu.js create mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/editor-2DRWlLPS.js delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/editor-Beg1s0b0.js delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/editor-tP9apWFw.js create mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/gl-BLUmXQ2R.js delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/gl-NvaeEG05.js create mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/index-BppLUDwx.js delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/index-DO4E_UAn.js rename ios/Sources/GutenbergKit/Gutenberg/assets/{editor-Cn5dddl1.css => index-OGmBC7ij.css} (99%) delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/index-lwjbap72.css create mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/localization-BKA8CWIV.js delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/localization-KXdhtQ45.js create mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/remote-B2_s7g-L.js create mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/remote-BcVlfPFi.css delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/remote-CQD0zuAs.css delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/remote-pYQAibFN.js diff --git a/ios/Sources/GutenbergKit/Gutenberg/assets/bridge-CeTaRbKr.js b/ios/Sources/GutenbergKit/Gutenberg/assets/bridge-CeTaRbKr.js deleted file mode 100644 index 64ebf738..00000000 --- a/ios/Sources/GutenbergKit/Gutenberg/assets/bridge-CeTaRbKr.js +++ /dev/null @@ -1,2 +0,0 @@ -const f="0.2.0",r="?";function d(t,e,n,i){const o={filename:t,function:e===""?r:e,in_app:!0};return n!==void 0&&(o.lineno=n),i!==void 0&&(o.colno=i),o}const l=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,u=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,m=/\((\S*)(?::(\d+))(?::(\d+))\)/,p=t=>{const e=l.exec(t);if(e){const[,i,o,s]=e;return d(i,r,+o,+s)}const n=u.exec(t);if(n){if(n[2]&&n[2].indexOf("eval")===0){const a=m.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}const o=n[1]||r,s=n[2];return d(s,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},b=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,k=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,y=t=>{const e=b.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const s=k.exec(e[3]);s&&(e[1]=e[1]||"eval",e[3]=s[1],e[4]=s[2],e[5]="")}const i=e[3],o=e[1]||r;return d(i,o,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},g=50,E=[p,y],h=t=>{const e=t.stacktrace||t.stack||"",n=[],i=e.split(` -`);for(let s=0;s1024)&&!a.match(/\S*Error: /)){for(const w of E){const c=w(a);if(c){n.push(c);break}}if(n.length>=g)break}}const o=Array.from(n).reverse();return o.slice(0,g).map(s=>({...s,filename:s.filename||o[o.length-1].filename}))},x=t=>{const e=t?.message;return e?typeof e.error?.message=="string"?e.error.message:e:"No error message"},v=t=>{const e={type:t?.name,message:x(t)},n=h(t);return n.length&&(e.stacktrace=n),e.type===void 0&&e.message===""&&(e.message="Unknown error"),e},D=(t,{context:e,tags:n}={})=>({...v(t),context:{...e},tags:{...n,gutenberg_kit_version:f}});function S(){window.editorDelegate&&window.editorDelegate.onEditorLoaded(),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorLoaded",body:{}})}function M(){window.editorDelegate&&window.editorDelegate.onEditorContentChanged(),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorContentChanged"})}function K(t,e){window.editorDelegate&&window.editorDelegate.onEditorHistoryChanged(t,e),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorHistoryChanged",body:{hasUndo:t,hasRedo:e}})}function N(t){window.editorDelegate&&window.editorDelegate.openMediaLibrary(JSON.stringify(t)),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"openMediaLibrary",body:t})}function C(){if(window.GBKit)return window.GBKit;try{return JSON.parse(localStorage.getItem("GBKit"))||{}}catch{return{}}}function B(){const{post:t}=C();return t?{id:t.id,type:t.type||"post",status:t.status,title:{raw:decodeURIComponent(t.title)},content:{raw:decodeURIComponent(t.content)}}:{id:-1,type:"post",status:"auto-draft",title:{raw:""},content:{raw:""}}}function G(t,{context:e,tags:n,isHandled:i,handledBy:o}={context:{},tags:{},isHandled:!1,handledBy:"Unknown"}){const s={...D(t,{context:e,tags:n}),isHandled:i,handledBy:o};window.editorDelegate&&window.editorDelegate.onEditorExceptionLogged(JSON.stringify(s)),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorExceptionLogged",body:s})}function H(t=3e3){return new Promise((e,n)=>{const i=Date.now(),o=()=>{if(window.GBKit){e(window.GBKit);return}if(Date.now()-i>=t){n(new Error("GBKit global not available after timeout"));return}setTimeout(o,100)};o()})}export{N as a,M as b,B as c,H as d,S as e,C as g,G as l,K as o}; diff --git a/ios/Sources/GutenbergKit/Gutenberg/assets/cy-CGIlBSk6.js b/ios/Sources/GutenbergKit/Gutenberg/assets/cy-CGIlBSk6.js new file mode 100644 index 00000000..caa79847 --- /dev/null +++ b/ios/Sources/GutenbergKit/Gutenberg/assets/cy-CGIlBSk6.js @@ -0,0 +1,12 @@ +const e=["Torri"],a=["Anwybyddu"],o=["Ehangu"],n=["Dwysedd"],i=["Trosolwg"],d=["Deuliwiau"],t=["Sylwadau"],l=["Fformatau"],r=["Dangos"],s=["Cuddiedig"],y=["Priodweddau"],c=["Teiposod"],u=["Tudalen Cartref"],w=["Mwyaf"],h=["Lleiaf"],g=["Priodweddau"],f=["Fformat"],m=["Lledu"],p=["Pŵl"],b=["Mewnosodiad"],k=["Allosodiad"],v=["Paletau"],C=["Ar gau"],D=["Agor"],A=["Analluogi"],T=["Galluogi"],S=["Dadamseru"],M=["Dadgyhoeddi"],P=["Rhesi"],L=["Gwrthwneud"],G=["Wedi cloi"],$=["Ailadrodd"],R=["Gan llaw"],Y=["Heb ei hidlo"],E=["Amodau"],N=["Yn"],x=["Mewnosodwr"],B=["Hygyrchedd"],I=["Rhyngwyneb"],F=["Adfer"],W=["Sbwriel"],H=["Drafftiau"],U=["Gwerth"],O=["Angenrheidiol"],z=["Dull"],V=["E-bost"],q=["Ffynhonnell"],j=["Ffontiau"],J=["Gosod"],_=["Hysbysiad"],Q=["Dad-grwpio"],X=["Troednodau"],K=["Parhau"],Z=["Datgysylltu"],ee=["Cyfrinair"],ae=["Troednodyn"],oe=["Rhifau"],ne=["Graddio"],ie=["Rhiant"],de=["Dan ystyriaeth"],te=["Awgrymiadau"],le=["Iaith"],re=["Gweithredu"],se=["Cydraniad"],ye=["Mewnosod"],ce=["Openverse"],ue=["Cysgod"],we=["Canol"],he=["Safle"],ge=["Gludiog"],fe=["Tilde"],me=["CSS"],pe=["Fideos"],be=["Sefydlog"],ke=["Gostyngiad"],ve=["Cynyddiad"],Ce=["Capsiwn"],De=["Patrwm"],Ae=["dolen"],Te=["XXL"],Se=["Ffont"],Me=["Cyfyngedig"],Pe=["H6"],Le=["H5"],Ge=["H4"],$e=["H3"],Re=["H2"],Ye=["H1"],Ee=["Tacsonomïau"],Ne=["Hofran"],xe=["Dadosod"],Be=["Nawr"],Ie=["Rhieni"],Fe=["Olddodiad"],We=["Rhagddodiad"],He=["yn dweud"],Ue=["Ymateb"],Oe=["Ymatebion"],ze=["Stacio"],Ve=["Wythnos"],qe=["Annilys"],je=["Cloi"],Je=["Datgloi"],_e=["rhagolwg"],Qe=["Gorffen"],Xe=["Eicon"],Ke=["Dileu"],Ze=["Gweithredoedd"],ea=["Ailenwi"],aa=["Aa"],oa=["arddulliau"],na=["Dewislenni"],ia=["Ateb"],da=["Elfennau"],ta=["Is ddewislen"],la=["Pob tro"],ra=["Dangosydd"],sa=["nod tudalen"],ya=["Amlygu"],ca=["Palet"],ua=["Lliwiau"],wa=["Saeth"],ha=["Rhes"],ga=["Unioni"],fa=["Llif"],ma=["Flex"],pa=["Cyhoeddi"],ba=["Arddull"],ka=["Radiws"],va=["Ymyl"],Ca=["Deuarlliw"],Da=["Logo"],Aa=["Uchafbwyntiau"],Ta=["Cysgodion"],Sa=["Cynllun"],Ma=["Dotiog"],Pa=["Llinell Doredig"],La=["Cyfaddasu"],Ga=["Border"],$a=["Grid"],Ra=["Ardal"],Ya=["Mewnoliad"],Ea=["Alloliad"],Na=["Mewn trefn"],xa=["Ddim mewn trefn"],Ba=["Llusgo"],Ia=["Alinio"],Fa=["Prif Lythrennu"],Wa=["Llythrennau Bach"],Ha=["Prif Lythennau"],Ua=["Fertigol"],Oa=["Llorweddol"],za=["Themâu"],Va=["Allweddair"],qa=["Hidlau"],ja=["Addurno"],Ja=["Dim ond"],_a=["Eithrio"],Qa=["Cynnwys"],Xa=["Gwedd"],Ka=["Dewisiadau"],Za=["Saesneg"],eo=["Math"],ao=["Label"],oo=["Pennawdau"],no=["Disgrifiadau"],io=["Capsiynau"],to=["Isdeitlau"],lo=["Manylion"],ro=["Rheiddiol"],so=["Llinol"],yo=["Di-enw"],co=["Nodau"],uo=["Disgrifiad"],wo=["Sail"],ho=["Awdur"],go=["Gwreiddiol"],fo=["Enw"],mo=["Portread"],po=["Tirlun"],bo=["Cymysg"],ko=["De"],vo=["Chwith"],Co=["Gwaelod"],Do=["Brig"],Ao=["Padio"],To=["Bylchu"],So=["Cyfeiriad"],Mo=["Tocio"],Po=["Cylchdroi"],Lo=["Chwyddo"],Go=["Cynllun"],$o=["Testun"],Ro=["Hysbysiadau"],Yo=["Atred"],Eo=["Cofnodion"],No=["Tudalennau"],xo=["Heb Gategori"],Bo=["Gwyn"],Io=["Du"],Fo=["Uwchysgrif"],Wo=["Isysgrif"],Ho=["Patrymau"],Uo=["Teipograffeg"],Oo=["Cynnwys"],zo=["Dewislen"],Vo=["Cysylltiad"],qo=["Ynghylch"],jo=["Cartref"],Jo=["Defnyddwyr"],_o=["Gwefan"],Qo=["Yn creu"],Xo=["Bwrdd Gwaith"],Ko=["Symudol"],Zo=["Tabled"],en=["arolwg"],an=["cymdeithasol"],on=["Solet"],nn=["Math"],dn=["Ongl"],tn=["Dewis"],ln=["Thema"],rn=["Gwag"],sn=["Botymau"],yn=["Cefndir"],cn=["Cymorth"],un=["Dideitl"],wn=["Nesaf"],hn=["Nôl"],gn=["Gorffen"],fn=["Amnewid"],mn=["mewnosodwr"],pn=["podlediad"],bn=["Llywio"],kn=["Templed"],vn=["Graddiant"],Cn=["Canol Nos"],Dn=["Fersiwn"],An=["Dimensiynau"],Tn=["Templedi"],Sn=["Ychwanegu"],Mn=["Lliw"],Pn=["Cyfaddasu"],Ln=["Drafft"],Gn=["Hepgor"],$n=["Dolenni"],Rn=["dewislen"],Yn=["Troedyn"],En=["Grŵp"],Nn=["Tacsonomi"],xn=["Rhagosodedig"],Bn=["Chwilio"],In=["Calendr"],Fn=["Nôl"],Wn=["eLyfr"],Hn=["Tanlinellu"],Un=["Llun bach"],On=["Anodiadau"],zn=["cyfrwng"],Vn=["Cyfrwng"],qn=["Arddulliau"],jn=["Cyffredinol"],Jn=["Dewisiadau"],_n=["Munud"],Qn=["Awr"],Xn=["Amser"],Kn=["Blwyddyn"],Zn=["Diwrnod"],ei=["Rhagfyr"],ai=["Tachwedd"],oi=["Hydref"],ni=["Medi"],ii=["Awst"],di=["Gorffennaf"],ti=["Mehefin"],li=["Mai"],ri=["Ebrill"],si=["Mawrth"],yi=["Chwefror"],ci=["Ionawr"],ui=["Mis"],wi=["Clawr"],hi=["Anferth"],gi=["Canolig"],fi=["Arferol"],mi=["Amodau"],pi=["Afatar"],bi=["Datryswyd"],ki=["Gweld"],vi=["HTML"],Ci=["Troshaen"],Di=["Ôldic"],Ai=["Atalnod llawn"],Ti=["Atalnod"],Si=["Cyfredol"],Mi=["Teitl"],Pi=["Creu"],Li=["Orielau"],Gi=["XL"],$i=["M"],Ri=["A"],Yi=["S"],Ei=["Bach"],Ni=["Wedi'i Fudo"],xi=["Awto"],Bi=["Rhaglwytho"],Ii=["Cymorth"],Fi=["Archif"],Wi=["Mawr"],Hi=["Ffeil"],Ui=["Colofn"],Oi=["Cylchu"],zi=["Awtochwarae"],Vi=["Awtogadw"],qi=["Is-bennawd"],ji=["Iawn"],Ji=["Datgysylltu"],_i=["Tudaleniad"],Qi=["Uchder"],Xi=["Lled"],Ki=["Uwch"],Zi=["Amserlenwyd"],ed=["Ategion"],ad=["Paragraffau"],od=["Penawdau"],nd=["Geiriau"],id=["Cyhoeddus"],dd=["Preifat"],td=["Term"],ld=["Tag"],rd=["Ar unwaith"],sd=["Cadw"],yd=["Cyhoeddwyd"],cd=["Amserlennu"],ud=["Diweddaru"],wd=["Copïo"],hd=["Sgwrs"],gd=["Statws"],fd=["Safonol"],md=["Neilleb"],pd=["Trefn"],bd=["Cadwyd"],kd=["Mewnblannu"],vd=["Blociau"],Cd=["Dadwneud"],Dd=["Ail-wneud"],Ad=["Dyblygu"],Td=["Tynnu"],Sd=["Gwelededd"],Md=["Bloc"],Pd=["Dogfen"],Ld=["Offer"],Gd=["Golygydd"],$d=["Gosodiadau"],Rd=["Ailosod"],Yd=["Diffodd"],Ed=["PM"],Nd=["AM"],xd=["URL"],Bd=["Cyflwyno"],Id=["Cau"],Fd=["Dolen"],Wd=["Llinell Drwodd"],Hd=["Italig"],Ud=["Trwm"],Od=["Categori"],zd=["Dewis"],Vd=["Fideo"],qd=["Ysgrifennu"],jd=["Tabl"],Jd=["Cod byr"],_d=["Ymwahanydd"],Qd=["Dyfyniad"],Xd=["Paragraff"],Kd=["Rhestr"],Zd=["ffoto"],et=["Maint"],at=["Delwedd"],ot=["Rhagolwg"],nt=["Pennyn"],it=["Delweddau"],dt=["Dim"],tt=["Oriel"],lt=["Mwy"],rt=["Clasurol"],st=["fideo"],yt=["sain"],ct=["cerddoriaeth"],ut=["delwedd"],wt=["blog"],ht=["cofnod"],gt=["Colofnau"],ft=["Arbrofion"],mt=["Cod"],pt=["Categorïau"],bt=["Botwm"],kt=["Gweithredu"],vt=["Diddymu"],Ct=["Golygu"],Dt=["Sain"],At=["Clirio"],Tt=["Teclynnau"],St=["Awduron"],Mt=["Bonyn"],Pt=["Sylw"],Lt=["Trafodaeth"],Gt=["Dyfyniad"],$t=["Cyhoeddi"],Rt=["Metadata"],Yt=["Cadw"],Et=["Adolygiadau"],Nt=["Dogfennaeth"],xt=["Gutenberg"],Bt=["Gweld"],It={100:["100"],"Bebo Valdés":["Bebo Valdés"],"Betty Carter":["Betty Carter"],"Jaco Pastorius":["Jaco Pastorius"],"Julio Cortázar":["Julio Cortázar"],"Cannot inherit the current template query when placed inside the singular content (e.g., post, page, 404, blank).":["Does dim modd etifeddu'r ymholiad templed cyfredol pan fydd wedi'i osod o fewn y cyd-destun unigol (e.e., cofnod, tudalen, 404, gwag)."],"Snow Patrol":["Patrol Eira"],"Only include headings up to and including this level.":["Dim ond cynnwys penynnau dim ond hyd at a chynnwys y lefel yma."],"Including all heading levels in the table of contents.":["Cynnwys pob lefel pennyn yn y tabl cynnwys."],"All levels":["Pob lefel"],"Include headings down to level":["Cynnwys penynnau lawr i lefel"],"Limit heading levels":["Cyfyngu lefelau penynnau"],"Paste the copied style to the selected block(s).":["Copïwch yr arddull wedi'i gopïo i'r bloc(iau) hyn."],"Only visible to those who know the password.":["Dim ond yn weladwy i'r rheini sy'n gwybod y cyfrinair."],"Show or hide the Settings panel":["Dangos neu guddio'r panel Gosodiadau"],"The theme you are currently using does not support this screen.":["Dyw'r thema rydych yn ei defnyddio ar hyn o bryd ddim yn cynnal y sgrin hon."],"A list of allowed area values for template parts.":["Rhestr o werthoedd ardal sy'n cael eu caniatáu ar gyfer rhannau o dempled."],"A list of default template types.":["Rhestr o fathau templedi rhagosodedig."],"Only one file can be used here.":["Dim ond un ffeil y mae modd ei defnyddio yma."],"panel button labelSettings":["Gosodiadau"],"noun, panelDocument":["Dogfen"],"This change will affect other parts of your site that use this template.":["Bydd y newid hwn yn effeithio ar rannau eraill o'ch gwefan sy'n defnyddio'r templed hwn."],"The requested page could not be found. Please check the URL.":["Nid oedd modd dod o hyd i'r dudalen y gofynnwyd amdani. Gwiriwch yr URL."],"Muted because of Autoplay.":["Wedi'i dawelu oherwydd Awtochwarae."],"Descending by order":["Gostwng yn ôl trefn"],"Ascending by order":["Esgyn yn ol trefn"],Cut:e,"Paste the selected block(s).":["Gludo'r bloc(iau) dewiswyd."],"Cut the selected block(s).":["Torri'r bloc(iau) dewiswyd."],"Copy the selected block(s).":["Copïo'r bloc(iau) dewiswyd."],"Displays the %s post format archive.":["Yn dangos archif fformat cofnod %s."],"Template namePost Format: %s":["Fformat Cofnodi: %s"],Ignore:a,"Whether to ignore sticky posts or not.":["P'um ai i anwybyddu cofnodion gludiog ai peidio."],"Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users.":["Yn cadw'r cyrchwr testun o fewn blociau wrth lywio gyda bysellau saeth, ei atal rhag symud i flociau eraill a gwella hygyrchedd i ddefnyddwyr bysellfwrdd."],"Global Styles pagination":["Tudaleniad Arddulliau Eang"],"Previous Post":["Cofnod Blaenorol"],"Next Post":["Cofnod Nesaf"],"Example link text for Navigation SubmenuAbout":["Ynghylch"],"%s menu":["Dewislen %s"],"Enables multiple Details blocks with the same name attribute to be connected, with only one open at a time.":["Yn galluogi cysylltu blociau Manylion lluosog gyda'r un enw priodwedd, gyda dim ond un ar agor ar y tro."],"Name attribute":["Priodoledd enw"],"The ")!==-1&&(e=e.replace(/(]*>)\s*/g,"$1"),e=e.replace(/\s*<\/object>/g,""),e=e.replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),(e.indexOf("\]]*[>\]])\s*/g,"$1"),e=e.replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1"),e=e.replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),e.indexOf("]*>)/,"$1"),e=e.replace(/<\/figcaption>\s*/,"")),e=e.replace(/\n\n+/g,` + +`);const r=e.split(/\n\s*\n/).filter(Boolean);return e="",r.forEach(s=>{e+="

"+s.replace(/^\n*|\n*$/g,"")+`

+`}),e=e.replace(/

\s*<\/p>/g,""),e=e.replace(/

([^<]+)<\/(div|address|form)>/g,"

$1

"),e=e.replace(new RegExp("

\\s*(]*>)\\s*

","g"),"$1"),e=e.replace(/

(/g,"$1"),e=e.replace(/

]*)>/gi,"

"),e=e.replace(/<\/blockquote><\/p>/g,"

"),e=e.replace(new RegExp("

\\s*(]*>)","g"),"$1"),e=e.replace(new RegExp("(]*>)\\s*

","g"),"$1"),t&&(e=e.replace(/<(script|style).*?<\/\\1>/g,s=>s[0].replace(/\n/g,"")),e=e.replace(/
|/g,"
"),e=e.replace(/(
)?\s*\n/g,(s,i)=>i?s:`
+`),e=e.replace(//g,` +`)),e=e.replace(new RegExp("(]*>)\\s*
","g"),"$1"),e=e.replace(/
(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1"),e=e.replace(/\n<\/p>$/g,"

"),n.forEach(s=>{const[i,c]=s;e=e.replace(i,c)}),e.indexOf("")!==-1&&(e=e.replace(/\s?\s?/g,` +`)),e}function hne(e){const t="blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure",n=t+"|div|p",o=t+"|pre",r=[];let s=!1,i=!1;return e?((e.indexOf("]*>[\s\S]*?<\/\1>/g,c=>(r.push(c),""))),e.indexOf("]*>[\s\S]+?<\/pre>/g,c=>(c=c.replace(/
(\r\n|\n)?/g,""),c=c.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,""),c.replace(/\r?\n/g,"")))),e.indexOf("[caption")!==-1&&(i=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,c=>c.replace(/]*)>/g,"").replace(/[\r\n\t]+/,""))),e=e.replace(new RegExp("\\s*\\s*","g"),` +`),e=e.replace(new RegExp("\\s*<((?:"+n+")(?: [^>]*)?)>","g"),` +<$1>`),e=e.replace(/(

]+>[\s\S]*?)<\/p>/g,"$1"),e=e.replace(/]*)?>\s*

/gi,` + +`),e=e.replace(/\s*

/gi,""),e=e.replace(/\s*<\/p>\s*/gi,` + +`),e=e.replace(/\n[\s\u00a0]+\n/g,` + +`),e=e.replace(/(\s*)
\s*/gi,(c,l)=>l&&l.indexOf(` +`)!==-1?` + +`:` +`),e=e.replace(/\s*

\s*/g,`
+`),e=e.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,` + +[caption$1[/caption] + +`),e=e.replace(/caption\]\n\n+\[caption/g,`caption] + +[caption`),e=e.replace(new RegExp("\\s*<((?:"+o+")(?: [^>]*)?)\\s*>","g"),` +<$1>`),e=e.replace(new RegExp("\\s*\\s*","g"),` +`),e=e.replace(/<((li|dt|dd)[^>]*)>/g," <$1>"),e.indexOf("/g,` +`)),e.indexOf("]*)?>\s*/g,` + + + +`)),e.indexOf("/g,c=>c.replace(/[\r\n]+/g,""))),e=e.replace(/<\/p#>/g,`

+`),e=e.replace(/\s*(

]+>[\s\S]*?<\/p>)/g,` +$1`),e=e.replace(/^\s+/,""),e=e.replace(/[\s\u00a0]+$/,""),s&&(e=e.replace(//g,` +`)),i&&(e=e.replace(/]*)>/g,"")),r.length&&(e=e.replace(//g,()=>r.shift())),e):""}function J2(e,t={}){const{isCommentDelimited:n=!0}=t,{blockName:o,attrs:r={},innerBlocks:s=[],innerContent:i=[]}=e;let c=0;const l=i.map(u=>u!==null?u:J2(s[c++],t)).join(` +`).replace(/\n+/g,` +`).trim();return n?Mne(o,r,l):l}function p3(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return k0("blocks.getBlockDefaultClassName",t,e)}function uR(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return k0("blocks.getBlockMenuDefaultClassName",t,e)}const xk={},mne={};function f3(e={}){const{blockType:t,attributes:n}=xk;return f3.skipFilters?e:k0("blocks.getSaveContent.extraProps",{...e},t,n)}function KZe(e={}){const{innerBlocks:t}=mne;if(!Array.isArray(t))return{...e,children:t};const n=m1(t,{isInnerBlocks:!0});return{...e,children:a.jsx(qo,{children:n})}}function gne(e,t,n=[]){const o=mm(e);if(!o?.save)return null;let{save:r}=o;if(r.prototype instanceof v.Component){const i=new r({attributes:t});r=i.render.bind(i)}xk.blockType=o,xk.attributes=t,mne.innerBlocks=n;let s=r({attributes:t,innerBlocks:n});if(s!==null&&typeof s=="object"&&LU("blocks.getSaveContent.extraProps")&&!(o.apiVersion>1)){const i=k0("blocks.getSaveContent.extraProps",{...s.props},o,t);Fr(i,s.props)||(s=v.cloneElement(s,i))}return k0("blocks.getSaveElement",s,o,t)}function Ku(e,t,n){const o=mm(e);return Si(gne(o,t,n))}function YZe(e,t){var n;return Object.entries((n=e.attributes)!==null&&n!==void 0?n:{}).reduce((o,[r,s])=>{const i=t[r];return i===void 0||s.source!==void 0||s.role==="local"?o:s.__experimentalRole==="local"?(Le("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${e?.name} block.`}),o):("default"in s&&JSON.stringify(s.default)===JSON.stringify(i)||(o[r]=i),o)},{})}function ZZe(e){return JSON.stringify(e).replace(/--/g,"\\u002d\\u002d").replace(//g,"\\u003e").replace(/&/g,"\\u0026").replace(/\\"/g,"\\u0022")}function Wy(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=Ku(e.name,e.attributes,e.innerBlocks)}catch{}return t}function Mne(e,t,n){const o=t&&Object.entries(t).length?ZZe(t)+" ":"",r=e?.startsWith("core/")?e.slice(5):e;return n?` +`+n+` +`:``}function QZe(e,{isInnerBlocks:t=!1}={}){if(!e.isValid&&e.__unstableBlockSource)return J2(e.__unstableBlockSource);const n=e.name,o=Wy(e);if(n===hm()||!t&&n===Yc())return o;const r=_t(n);if(!r)return o;const s=YZe(r,e.attributes);return Mne(n,s,o)}function Va(e){e.length===1&&_a(e[0])&&(e=[]);let t=m1(e);return e.length===1&&e[0].name===Yc()&&e[0].name==="core/freeform"&&(t=hne(t)),t}function m1(e,t){return(Array.isArray(e)?e:[e]).map(o=>QZe(o,t)).join(` + +`)}var JZe=/[\t\n\f ]/,eQe=/[A-Za-z]/,tQe=/\r\n?/g;function Ko(e){return JZe.test(e)}function mP(e){return eQe.test(e)}function nQe(e){return e.replace(tQe,` +`)}var oQe=function(){function e(t,n,o){o===void 0&&(o="precompile"),this.delegate=t,this.entityParser=n,this.mode=o,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var r=this.peek();if(r==="<"&&!this.isIgnoredEndTag())this.transitionTo("tagOpen"),this.markTagStart(),this.consume();else{if(this.mode==="precompile"&&r===` +`){var s=this.tagNameBuffer.toLowerCase();(s==="pre"||s==="textarea")&&this.consume()}this.transitionTo("data"),this.delegate.beginData()}},data:function(){var r=this.peek(),s=this.tagNameBuffer;r==="<"&&!this.isIgnoredEndTag()?(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume()):r==="&"&&s!=="script"&&s!=="style"?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(r))},tagOpen:function(){var r=this.consume();r==="!"?this.transitionTo("markupDeclarationOpen"):r==="/"?this.transitionTo("endTagOpen"):(r==="@"||r===":"||mP(r))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(r))},markupDeclarationOpen:function(){var r=this.consume();if(r==="-"&&this.peek()==="-")this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment();else{var s=r.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase();s==="DOCTYPE"&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())}},doctype:function(){var r=this.consume();Ko(r)&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var r=this.consume();Ko(r)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(r.toLowerCase()))},doctypeName:function(){var r=this.consume();Ko(r)?this.transitionTo("afterDoctypeName"):r===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(r.toLowerCase())},afterDoctypeName:function(){var r=this.consume();if(!Ko(r))if(r===">")this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var s=r.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),i=s.toUpperCase()==="PUBLIC",c=s.toUpperCase()==="SYSTEM";(i||c)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),i?this.transitionTo("afterDoctypePublicKeyword"):c&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var r=this.peek();Ko(r)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):r==='"'?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):r==="'"?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):r===">"&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var r=this.consume();r==='"'?this.transitionTo("afterDoctypePublicIdentifier"):r===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(r)},doctypePublicIdentifierSingleQuoted:function(){var r=this.consume();r==="'"?this.transitionTo("afterDoctypePublicIdentifier"):r===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(r)},afterDoctypePublicIdentifier:function(){var r=this.consume();Ko(r)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):r===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):r==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):r==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var r=this.consume();Ko(r)||(r===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):r==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):r==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var r=this.consume();r==='"'?this.transitionTo("afterDoctypeSystemIdentifier"):r===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(r)},doctypeSystemIdentifierSingleQuoted:function(){var r=this.consume();r==="'"?this.transitionTo("afterDoctypeSystemIdentifier"):r===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(r)},afterDoctypeSystemIdentifier:function(){var r=this.consume();Ko(r)||r===">"&&(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},commentStart:function(){var r=this.consume();r==="-"?this.transitionTo("commentStartDash"):r===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(r),this.transitionTo("comment"))},commentStartDash:function(){var r=this.consume();r==="-"?this.transitionTo("commentEnd"):r===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var r=this.consume();r==="-"?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(r)},commentEndDash:function(){var r=this.consume();r==="-"?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+r),this.transitionTo("comment"))},commentEnd:function(){var r=this.consume();r===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+r),this.transitionTo("comment"))},tagName:function(){var r=this.consume();Ko(r)?this.transitionTo("beforeAttributeName"):r==="/"?this.transitionTo("selfClosingStartTag"):r===">"?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(r)},endTagName:function(){var r=this.consume();Ko(r)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):r==="/"?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):r===">"?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(r)},beforeAttributeName:function(){var r=this.peek();if(Ko(r)){this.consume();return}else r==="/"?(this.transitionTo("selfClosingStartTag"),this.consume()):r===">"?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):r==="="?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(r)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var r=this.peek();Ko(r)?(this.transitionTo("afterAttributeName"),this.consume()):r==="/"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):r==="="?(this.transitionTo("beforeAttributeValue"),this.consume()):r===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):r==='"'||r==="'"||r==="<"?(this.delegate.reportSyntaxError(r+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(r)):(this.consume(),this.delegate.appendToAttributeName(r))},afterAttributeName:function(){var r=this.peek();if(Ko(r)){this.consume();return}else r==="/"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):r==="="?(this.consume(),this.transitionTo("beforeAttributeValue")):r===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(r))},beforeAttributeValue:function(){var r=this.peek();Ko(r)?this.consume():r==='"'?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):r==="'"?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):r===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(r))},attributeValueDoubleQuoted:function(){var r=this.consume();r==='"'?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):r==="&"?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(r)},attributeValueSingleQuoted:function(){var r=this.consume();r==="'"?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):r==="&"?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(r)},attributeValueUnquoted:function(){var r=this.peek();Ko(r)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):r==="/"?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):r==="&"?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):r===">"?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(r))},afterAttributeValueQuoted:function(){var r=this.peek();Ko(r)?(this.consume(),this.transitionTo("beforeAttributeName")):r==="/"?(this.consume(),this.transitionTo("selfClosingStartTag")):r===">"?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){var r=this.peek();r===">"?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var r=this.consume();(r==="@"||r===":"||mP(r))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(r))}},this.reset()}return e.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},e.prototype.transitionTo=function(t){this.state=t},e.prototype.tokenize=function(t){this.reset(),this.tokenizePart(t),this.tokenizeEOF()},e.prototype.tokenizePart=function(t){for(this.input+=nQe(t);this.index"||t==="style"&&this.input.substring(this.index,this.index+8)!==""||t==="script"&&this.input.substring(this.index,this.index+9)!=="<\/script>"},e}(),rQe=function(){function e(t,n){n===void 0&&(n={}),this.options=n,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new oQe(this,t,n.mode),this._currentAttribute=void 0}return e.prototype.tokenize=function(t){return this.tokens=[],this.tokenizer.tokenize(t),this.tokens},e.prototype.tokenizePart=function(t){return this.tokens=[],this.tokenizer.tokenizePart(t),this.tokens},e.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},e.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},e.prototype.current=function(){var t=this.token;if(t===null)throw new Error("token was unexpectedly null");if(arguments.length===0)return t;for(var n=0;nt("Block validation: "+o,...r)}return{error:e(console.error),warning:e(console.warn),getItems(){return[]}}}function sQe(){const e=[],t=_f();return{error(...n){e.push({log:t.error,args:n})},warning(...n){e.push({log:t.warning,args:n})},getItems(){return e}}}const iQe=e=>e,aQe=/[\t\n\r\v\f ]+/g,cQe=/^[\t\n\r\v\f ]*$/,lQe=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,zne=["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"],uQe=["autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],dQe=[...zne,...uQe],gP=[iQe,gQe],pQe=/^[\da-z]+$/i,fQe=/^#\d+$/,bQe=/^#x[\da-f]+$/i;function hQe(e){return pQe.test(e)||fQe.test(e)||bQe.test(e)}class mQe{parse(t){if(hQe(t))return ht("&"+t+";")}}function dR(e){return e.trim().split(aQe)}function gQe(e){return dR(e).join(" ")}function MQe(e){return e.attributes.filter(t=>{const[n,o]=t;return o||n.indexOf("data-")===0||dQe.includes(n)})}function MP(e,t,n=_f()){let o=e.chars,r=t.chars;for(let s=0;s{const[o,...r]=n.split(":"),s=r.join(":");return[o.trim(),OQe(s.trim())]});return Object.fromEntries(t)}const AQe={class:(e,t)=>{const[n,o]=[e,t].map(dR),r=n.filter(i=>!o.includes(i)),s=o.filter(i=>!n.includes(i));return r.length===0&&s.length===0},style:(e,t)=>$o(...[e,t].map(yQe)),...Object.fromEntries(zne.map(e=>[e,()=>!0]))};function vQe(e,t,n=_f()){if(e.length!==t.length)return n.warning("Expected attributes %o, instead saw %o.",t,e),!1;const o={};for(let r=0;re.tagName!==t.tagName&&e.tagName.toLowerCase()!==t.tagName.toLowerCase()?(n.warning("Expected tag name `%s`, instead saw `%s`.",t.tagName,e.tagName),!1):vQe(...[e,t].map(MQe),n),Chars:MP,Comment:MP};function hb(e){let t;for(;t=e.shift();)if(t.type!=="Chars"||!cQe.test(t.chars))return t}function _Qe(e,t=_f()){try{return new rQe(new mQe).tokenize(e)}catch{t.warning("Malformed HTML detected: %s",e)}return null}function zP(e,t){return e.selfClosing?!!(t&&t.tagName===e.tagName&&t.type==="EndTag"):!1}function wQe(e,t,n=_f()){if(e===t)return!0;const[o,r]=[e,t].map(c=>_Qe(c,n));if(!o||!r)return!1;let s,i;for(;s=hb(o);){if(i=hb(r),!i)return n.warning("Expected end of content, instead saw %o.",s),!1;if(s.type!==i.type)return n.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",i.type,i,s.type,s),!1;const c=xQe[s.type];if(c&&!c(s,i,n))return!1;zP(s,r[0])?hb(r):zP(i,o[0])&&hb(o)}return(i=hb(r))?(n.warning("Expected %o, instead saw end of content.",i),!1):!0}function eh(e,t=e.name){if(e.name===Yc()||e.name===hm())return[!0,[]];const o=sQe(),r=mm(t);let s;try{s=Ku(r,e.attributes)}catch(c){return o.error(`Block validation failed because an error occurred while generating block content: + +%s`,c.toString()),[!1,o.getItems()]}const i=wQe(e.originalContent,s,o);return i||o.error(`Block validation failed for \`%s\` (%o). + +Content generated by \`save\` function: + +%s + +Content retrieved from post body: + +%s`,r.name,r,s,e.originalContent),[i,o.getItems()]}function One(e,t){const n={...t};if(e==="core/cover-image"&&(e="core/cover"),(e==="core/text"||e==="core/cover-text")&&(e="core/paragraph"),e&&e.indexOf("core/social-link-")===0&&(n.service=e.substring(17),e="core/social-link"),e&&e.indexOf("core-embed/")===0){const o=e.substring(11),r={speaker:"speaker-deck",polldaddy:"crowdsignal"};n.providerNameSlug=o in r?r[o]:o,["amazon-kindle","wordpress"].includes(o)||(n.responsive=!0),e="core/embed"}if(e==="core/post-comment-author"&&(e="core/comment-author-name"),e==="core/post-comment-content"&&(e="core/comment-content"),e==="core/post-comment-date"&&(e="core/comment-date"),e==="core/comments-query-loop"){e="core/comments";const{className:o=""}=n;o.includes("wp-block-comments-query-loop")||(n.className=["wp-block-comments-query-loop",o].join(" "))}if(e==="core/post-comments"&&(e="core/comments",n.legacy=!0),t.layout?.type==="grid"&&typeof t.layout?.columnCount=="string"&&(n.layout={...n.layout,columnCount:parseInt(t.layout.columnCount,10)}),typeof t.style?.layout?.columnSpan=="string"){const o=parseInt(t.style.layout.columnSpan,10);n.style={...n.style,layout:{...n.style.layout,columnSpan:isNaN(o)?void 0:o}}}if(typeof t.style?.layout?.rowSpan=="string"){const o=parseInt(t.style.layout.rowSpan,10);n.style={...n.style,layout:{...n.style.layout,rowSpan:isNaN(o)?void 0:o}}}if(globalThis.IS_GUTENBERG_PLUGIN&&n.metadata?.bindings&&(e==="core/paragraph"||e==="core/heading"||e==="core/image"||e==="core/button")&&n.metadata.bindings.__default?.source!=="core/pattern-overrides"){const o=["content","url","title","id","alt","text","linkTarget"];let r=!1;o.forEach(s=>{n.metadata.bindings[s]?.source==="core/pattern-overrides"&&(r=!0,n.metadata={...n.metadata,bindings:{...n.metadata.bindings}},delete n.metadata.bindings[s])}),r&&(n.metadata.bindings.__default={source:"core/pattern-overrides"})}return[e,n]}function kQe(e,t){for(var n=t.split("."),o;o=n.shift();){if(!(o in e))return;e=e[o]}return e}var SQe=function(){var e;return function(){return e||(e=document.implementation.createHTMLDocument("")),e}}();function pR(e,t){if(t){if(typeof e=="string"){var n=SQe();n.body.innerHTML=e,e=n.body}if(typeof t=="function")return t(e);if(Object===t.constructor)return Object.keys(t).reduce(function(o,r){var s=t[r];return o[r]=pR(e,s),o},{})}}function fR(e,t){var n,o;return arguments.length===1?(n=e,o=void 0):(n=t,o=e),function(r){var s=r;if(o&&(s=r.querySelector(o)),s)return kQe(s,n)}}function CQe(e,t){var n,o;return arguments.length===1?(n=e,o=void 0):(n=t,o=e),function(r){var s=fR(o,"attributes")(r);if(s&&Object.prototype.hasOwnProperty.call(s,n))return s[n].value}}function qQe(e){return fR(e,"textContent")}function RQe(e,t){return function(n){var o=n.querySelectorAll(e);return[].map.call(o,function(r){return pR(r,t)})}}function TQe(e){return Le("wp.blocks.children.getChildrenArray",{since:"6.1",version:"6.3",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e}function EQe(...e){Le("wp.blocks.children.concat",{since:"6.1",version:"6.3",alternative:"wp.richText.concat",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=[];for(let n=0;n{let n=t;return e&&(n=t.querySelector(e)),n?bR(n.childNodes):[]}}const _k={concat:EQe,getChildrenArray:TQe,fromDOM:bR,toHTML:WQe,matcher:yne};function BQe(e){const t={};for(let n=0;n{let n=t;e&&(n=t.querySelector(e));try{return Ane(n)}catch{return null}}}function LQe(e,t){return n=>{let o=n;if(e&&(o=n.querySelector(e)),!o)return"";if(t){let r="";const s=o.children.length;for(let i=0;in=>{const o=e?n.querySelector(e):n;return o?l0.fromHTMLElement(o,{preserveWhiteSpace:t}):l0.empty()},PQe=e=>t=>e(t)!==void 0;function IQe(e,t){switch(t){case"rich-text":return e instanceof l0;case"string":return typeof e=="string";case"boolean":return typeof e=="boolean";case"object":return!!e&&e.constructor===Object;case"null":return e===null;case"array":return Array.isArray(e);case"integer":case"number":return typeof e=="number"}return!0}function DQe(e,t){return t.some(n=>IQe(e,n))}function FQe(e,t,n,o,r){let s;switch(t.source){case void 0:s=o?o[e]:void 0;break;case"raw":s=r;break;case"attribute":case"property":case"html":case"text":case"rich-text":case"children":case"node":case"query":case"tag":s=By(n,t);break}return(!$Qe(s,t.type)||!VQe(s,t.enum))&&(s=void 0),s===void 0&&(s=Jte(t)),s}function $Qe(e,t){return t===void 0||DQe(e,Array.isArray(t)?t:[t])}function VQe(e,t){return!Array.isArray(t)||t.includes(e)}const vne=Ss(e=>{switch(e.source){case"attribute":{let n=CQe(e.selector,e.attribute);return e.type==="boolean"&&(n=PQe(n)),n}case"html":return LQe(e.selector,e.multiline);case"text":return qQe(e.selector);case"rich-text":return jQe(e.selector,e.__unstablePreserveWhiteSpace);case"children":return yne(e.selector);case"node":return NQe(e.selector);case"query":const t=Object.fromEntries(Object.entries(e.query).map(([n,o])=>[n,vne(o)]));return RQe(e.selector,t);case"tag":{const n=fR(e.selector,"nodeName");return o=>n(o)?.toLowerCase()}default:console.error(`Unknown source type "${e.source}"`)}});function xne(e){return pR(e,t=>t)}function By(e,t){return vne(t)(xne(e))}function wa(e,t,n={}){var o;const r=xne(t),s=mm(e),i=Object.fromEntries(Object.entries((o=s.attributes)!==null&&o!==void 0?o:{}).map(([c,l])=>[c,FQe(c,l,r,n,t)]));return k0("blocks.getBlockAttributes",i,s,t,n)}const UQe={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function OP(e){const t=By(`

${e}
`,UQe);return t?t.trim().split(/\s+/):[]}function HQe(e,t,n){if(!ft(t,"customClassName",!0))return e;const o={...e},{className:r,...s}=o,i=Ku(t,s),c=OP(i),u=OP(n).filter(d=>!c.includes(d));return u.length?o.className=u.join(" "):i&&delete o.className,o}const XQe={type:"string",source:"attribute",selector:"[data-aria-label] > *",attribute:"aria-label"};function GQe(e){return By(`
${e}
`,XQe)}function KQe(e,t,n){if(!ft(t,"ariaLabel",!1))return e;const o={...e},r=GQe(n);return r&&(o.ariaLabel=r),o}function b3(e,t){const{attributes:n,originalContent:o}=e;let r=n;return r=HQe(n,t,o),r=KQe(r,t,o),{...e,attributes:r}}function YQe(){return!1}function ZQe(e,t,n){const o=t.attrs,{deprecated:r}=n;if(!r||!r.length)return e;for(let s=0;s_ne(d,t)).filter(d=>!!d),i=ve(n.blockName,wa(o,n.innerHTML,n.attrs),s);i.originalContent=n.innerHTML;const c=tJe(i,o),{validationIssues:l}=c,u=ZQe(c,n,o);return u.isValid||(u.__unstableBlockSource=e),!c.isValid&&u.isValid&&!t?.__unstableSkipMigrationLogs?(console.groupCollapsed("Updated Block: %s",o.name),console.info(`Block successfully updated for \`%s\` (%o). + +New content generated by \`save\` function: + +%s + +Content retrieved from post body: + +%s`,o.name,o,Ku(o,u.attributes),u.originalContent),console.groupEnd()):!c.isValid&&!u.isValid&&l.forEach(({log:d,args:p})=>d(...p)),u}function u0(e,t){return fne(e).reduce((n,o)=>{const r=_ne(o,t);return r&&n.push(r),n},[])}function wne(){return H1("from").filter(({type:e})=>e==="raw").map(e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)})}function kne(e,t){const n=document.implementation.createHTMLDocument("");return n.body.innerHTML=e,Array.from(n.body.children).flatMap(o=>{const r=Ai(wne(),({isMatch:c})=>c(o));if(!r)return vo.isNative?u0(`${o.outerHTML}`):ve("core/html",wa("core/html",o.outerHTML));const{transform:s,blockName:i}=r;if(s){const c=s(o,t);return o.hasAttribute("class")&&(c.attributes.className=o.getAttribute("class")),c}return ve(i,wa(i,o.outerHTML))})}function Ny(e,t={}){const n=document.implementation.createHTMLDocument(""),o=document.implementation.createHTMLDocument(""),r=n.body,s=o.body;for(r.innerHTML=e;r.firstChild;){const i=r.firstChild;i.nodeType===i.TEXT_NODE?kz(i)?r.removeChild(i):((!s.lastChild||s.lastChild.nodeName!=="P")&&s.appendChild(o.createElement("P")),s.lastChild.appendChild(i)):i.nodeType===i.ELEMENT_NODE?i.nodeName==="BR"?(i.nextSibling&&i.nextSibling.nodeName==="BR"&&(s.appendChild(o.createElement("P")),r.removeChild(i.nextSibling)),s.lastChild&&s.lastChild.nodeName==="P"&&s.lastChild.hasChildNodes()?s.lastChild.appendChild(i):r.removeChild(i)):i.nodeName==="P"?kz(i)&&!t.raw?r.removeChild(i):s.appendChild(i):Kd(i)?((!s.lastChild||s.lastChild.nodeName!=="P")&&s.appendChild(o.createElement("P")),s.lastChild.appendChild(i)):s.appendChild(i):r.removeChild(i)}return s.innerHTML}function Sne(e,t){if(e.nodeType!==e.COMMENT_NODE||e.nodeValue!=="nextpage"&&e.nodeValue.indexOf("more")!==0)return;const n=nJe(e,t);if(!e.parentNode||e.parentNode.nodeName!=="P")ume(e,n);else{const o=Array.from(e.parentNode.childNodes),r=o.indexOf(e),s=e.parentNode.parentNode||t.body,i=(c,l)=>(c||(c=t.createElement("p")),c.appendChild(l),c);[o.slice(0,r).reduce(i,null),n,o.slice(r+1).reduce(i,null)].forEach(c=>c&&s.insertBefore(c,e.parentNode)),lu(e.parentNode)}}function nJe(e,t){if(e.nodeValue==="nextpage")return rJe(t);const n=e.nodeValue.slice(4).trim();let o=e,r=!1;for(;o=o.nextSibling;)if(o.nodeType===o.COMMENT_NODE&&o.nodeValue==="noteaser"){r=!0,lu(o);break}return oJe(n,r,t)}function oJe(e,t,n){const o=n.createElement("wp-block");return o.dataset.block="core/more",e&&(o.dataset.customText=e),t&&(o.dataset.noTeaser=""),o}function rJe(e){const t=e.createElement("wp-block");return t.dataset.block="core/nextpage",t}function yP(e){return e.nodeName==="OL"||e.nodeName==="UL"}function sJe(e){return Array.from(e.childNodes).map(({nodeValue:t=""})=>t).join("")}function Cne(e){if(!yP(e))return;const t=e,n=e.previousElementSibling;if(n&&n.nodeName===e.nodeName&&t.children.length===1){for(;t.firstChild;)n.appendChild(t.firstChild);t.parentNode.removeChild(t)}const o=e.parentNode;if(o&&o.nodeName==="LI"&&o.children.length===1&&!/\S/.test(sJe(o))){const r=o,s=r.previousElementSibling,i=r.parentNode;s&&(s.appendChild(t),i.removeChild(r))}if(o&&yP(o)){const r=e.previousElementSibling;r?r.appendChild(e):Hb(e)}}function qne(e){return t=>{t.nodeName==="BLOCKQUOTE"&&(t.innerHTML=Ny(t.innerHTML,e))}}function iJe(e,t){var n;const o=e.nodeName.toLowerCase();return o==="figcaption"||iH(e)?!1:o in((n=t?.figure?.children)!==null&&n!==void 0?n:{})}function aJe(e,t){var n;return e.nodeName.toLowerCase()in((n=t?.figure?.children?.a?.children)!==null&&n!==void 0?n:{})}function kv(e,t=e){const n=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(n,t),n.appendChild(e)}function Rne(e,t,n){if(!iJe(e,n))return;let o=e;const r=e.parentNode;aJe(e,n)&&r.nodeName==="A"&&r.childNodes.length===1&&(o=e.parentNode);const s=o.closest("p,div");s?e.classList?(e.classList.contains("alignright")||e.classList.contains("alignleft")||e.classList.contains("aligncenter")||!s.textContent.trim())&&kv(o,s):kv(o,s):kv(o)}function hR(e,t,n=0){const o=th(e);o.lastIndex=n;const r=o.exec(t);if(!r)return;if(r[1]==="["&&r[7]==="]")return hR(e,t,o.lastIndex);const s={index:r.index,content:r[0],shortcode:mR(r)};return r[1]&&(s.content=s.content.slice(1),s.index++),r[7]&&(s.content=s.content.slice(0,-1)),s}function cJe(e,t,n){return t.replace(th(e),function(o,r,s,i,c,l,u,d){if(r==="["&&d==="]")return o;const p=n(mR(arguments));return p||p===""?r+p+d:o})}function lJe(e){return new gR(e).string()}function th(e){return new RegExp("\\[(\\[?)("+e+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}const AP=Ss(e=>{const t={},n=[],o=/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;e=e.replace(/[\u00a0\u200b]/g," ");let r;for(;r=o.exec(e);)r[1]?t[r[1].toLowerCase()]=r[2]:r[3]?t[r[3].toLowerCase()]=r[4]:r[5]?t[r[5].toLowerCase()]=r[6]:r[7]?n.push(r[7]):r[8]?n.push(r[8]):r[9]&&n.push(r[9]);return{named:t,numeric:n}});function mR(e){let t;return e[4]?t="self-closing":e[6]?t="closed":t="single",new gR({tag:e[2],attrs:e[3],type:t,content:e[5]})}const gR=Object.assign(function(e){const{tag:t,attrs:n,type:o,content:r}=e||{};if(Object.assign(this,{tag:t,type:o,content:r}),this.attrs={named:{},numeric:[]},!n)return;const s=["named","numeric"];typeof n=="string"?this.attrs=AP(n):n.length===s.length&&s.every((i,c)=>i===n[c])?this.attrs=n:Object.entries(n).forEach(([i,c])=>{this.set(i,c)})},{next:hR,replace:cJe,string:lJe,regexp:th,attrs:AP,fromMatch:mR});Object.assign(gR.prototype,{get(e){return this.attrs[typeof e=="number"?"numeric":"named"][e]},set(e,t){return this.attrs[typeof e=="number"?"numeric":"named"][e]=t,this},string(){let e="["+this.tag;return this.attrs.numeric.forEach(t=>{/\s/.test(t)?e+=' "'+t+'"':e+=" "+t}),Object.entries(this.attrs.named).forEach(([t,n])=>{e+=" "+t+'="'+n+'"'}),this.type==="single"?e+"]":this.type==="self-closing"?e+" /]":(e+="]",this.content&&(e+=this.content),e+"[/"+this.tag+"]")}});const vP=e=>Array.isArray(e)?e:[e],xP=/(\n|

)\s*$/,_P=/^\s*(\n|<\/p>)/;function Pd(e,t=0,n=[]){const o=H1("from"),r=Ai(o,u=>n.indexOf(u.blockName)===-1&&u.type==="shortcode"&&vP(u.tag).some(d=>th(d).test(e)));if(!r)return[e];const i=vP(r.tag).find(u=>th(u).test(e));let c;const l=t;if(c=hR(i,e,t)){t=c.index+c.content.length;const u=e.substr(0,c.index),d=e.substr(t);if(!c.shortcode.content?.includes("<")&&!(xP.test(u)&&_P.test(d)))return Pd(e,t);if(r.isMatch&&!r.isMatch(c.shortcode.attrs))return Pd(e,l,[...n,r.blockName]);let p=[];if(typeof r.transform=="function")p=[].concat(r.transform(c.shortcode.attrs,c)),p=p.map(f=>(f.originalContent=c.shortcode.content,b3(f,_t(f.name))));else{const f=Object.fromEntries(Object.entries(r.attributes).filter(([,z])=>z.shortcode).map(([z,O])=>[z,O.shortcode(c.shortcode.attrs,c)])),b=_t(r.blockName);if(!b)return[e];const m={...b,attributes:r.attributes};let g=ve(r.blockName,wa(m,c.shortcode.content,f));g.originalContent=c.shortcode.content,g=b3(g,m),p=[g]}return[...Pd(u.replace(xP,"")),...p,...Pd(d.replace(_P,""))]}return[e]}function uJe(e,t){const o={phrasingContentSchema:bO(t),isPaste:t==="paste"},r=e.map(({isMatch:l,blockName:u,schema:d})=>{const p=ft(u,"anchor");return d=typeof d=="function"?d(o):d,!p&&!l?d:d?Object.fromEntries(Object.entries(d).map(([f,b])=>{let m=b.attributes||[];return p&&(m=[...m,"id"]),[f,{...b,attributes:m,isMatch:l||void 0}]})):{}});function s(l,u,d){switch(d){case"children":return l==="*"||u==="*"?"*":{...l,...u};case"attributes":case"require":return[...l||[],...u||[]];case"isMatch":return!l||!u?void 0:(...p)=>l(...p)||u(...p)}}function i(l,u){for(const d in u)l[d]=l[d]?s(l[d],u[d],d):{...u[d]};return l}function c(l,u){for(const d in u)l[d]=l[d]?i(l[d],u[d]):{...u[d]};return l}return r.reduce(c,{})}function Tne(e){return uJe(wne(),e)}function dJe(e){return!/<(?!br[ />])/i.test(e)}function Ene(e,t,n,o){Array.from(e).forEach(r=>{Ene(r.childNodes,t,n,o),t.forEach(s=>{n.contains(r)&&s(r,n,o)})})}function su(e,t=[],n){const o=document.implementation.createHTMLDocument("");return o.body.innerHTML=e,Ene(o.body.childNodes,t,o,n),o.body.innerHTML}function h3(e,t){const n=e[`${t}Sibling`];if(n&&Kd(n))return n;const{parentNode:o}=e;if(!(!o||!Kd(o)))return h3(o,t)}function Wne(e){e.nodeType===e.COMMENT_NODE&&lu(e)}function pJe(e,t){if(iH(e))return!0;if(!t)return!1;const n=e.nodeName.toLowerCase();return[["ul","li","ol"],["h1","h2","h3","h4","h5","h6"]].some(r=>[n,t].filter(s=>!r.includes(s)).length===0)}function Bne(e,t){return e.every(n=>pJe(n,t)&&Bne(Array.from(n.children),t))}function fJe(e){return e.nodeName==="BR"&&e.previousSibling&&e.previousSibling.nodeName==="BR"}function bJe(e,t){const n=document.implementation.createHTMLDocument("");n.body.innerHTML=e;const o=Array.from(n.body.children);return!o.some(fJe)&&Bne(o,t)}function Nne(e,t){if(e.nodeName==="SPAN"&&e.style){const{fontWeight:n,fontStyle:o,textDecorationLine:r,textDecoration:s,verticalAlign:i}=e.style;(n==="bold"||n==="700")&&nb(t.createElement("strong"),e),o==="italic"&&nb(t.createElement("em"),e),(r==="line-through"||s.includes("line-through"))&&nb(t.createElement("s"),e),i==="super"?nb(t.createElement("sup"),e):i==="sub"&&nb(t.createElement("sub"),e)}else e.nodeName==="B"?e=bB(e,"strong"):e.nodeName==="I"?e=bB(e,"em"):e.nodeName==="A"&&(e.target&&e.target.toLowerCase()==="_blank"?e.rel="noreferrer noopener":(e.removeAttribute("target"),e.removeAttribute("rel")),e.name&&!e.id&&(e.id=e.name),e.id&&!e.ownerDocument.querySelector(`[href="#${e.id}"]`)&&e.removeAttribute("id"))}function Lne(e){e.nodeName!=="SCRIPT"&&e.nodeName!=="NOSCRIPT"&&e.nodeName!=="TEMPLATE"&&e.nodeName!=="STYLE"||e.parentNode.removeChild(e)}function jne(e){if(e.nodeType!==e.ELEMENT_NODE)return;const t=e.getAttribute("style");if(!t||!t.includes("mso-list"))return;t.split(";").reduce((o,r)=>{const[s,i]=r.split(":");return s&&i&&(o[s.trim().toLowerCase()]=i.trim().toLowerCase()),o},{})["mso-list"]==="ignore"&&e.remove()}function Sv(e){return e.nodeName==="OL"||e.nodeName==="UL"}function hJe(e,t){if(e.nodeName!=="P")return;const n=e.getAttribute("style");if(!n||!n.includes("mso-list"))return;const o=e.previousElementSibling;if(!o||!Sv(o)){const d=e.textContent.trim().slice(0,1),p=/[1iIaA]/.test(d),f=t.createElement(p?"ol":"ul");p&&f.setAttribute("type",d),e.parentNode.insertBefore(f,e)}const r=e.previousElementSibling,s=r.nodeName,i=t.createElement("li");let c=r;i.innerHTML=su(e.innerHTML,[jne]);const l=/mso-list\s*:[^;]+level([0-9]+)/i.exec(n);let u=l&&parseInt(l[1],10)-1||0;for(;u--;)c=c.lastChild||c,Sv(c)&&(c=c.lastChild||c);Sv(c)||(c=c.appendChild(t.createElement(s))),c.appendChild(i),e.parentNode.removeChild(e)}const m3={};function Pr(e){const t=window.URL.createObjectURL(e);return m3[t]=e,t}function Pne(e){return m3[e]}function Ine(e){return Pne(e)?.type.split("/")[0]}function g3(e){m3[e]&&window.URL.revokeObjectURL(e),delete m3[e]}function j0(e){return!e||!e.indexOf?!1:e.indexOf("blob:")===0}function wP(e,t,n=""){if(!e||!t)return;const o=new window.Blob([t],{type:n}),r=window.URL.createObjectURL(o),s=document.createElement("a");s.href=r,s.download=e,s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(r)}function mJe(e){if(e.nodeName==="IMG"){if(e.src.indexOf("file:")===0&&(e.src=""),e.src.indexOf("data:")===0){const[t,n]=e.src.split(","),[o]=t.slice(5).split(";");if(!n||!o){e.src="";return}let r;try{r=atob(n)}catch{e.src="";return}const s=new Uint8Array(r.length);for(let l=0;l (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex:

foo
",type:"boolean"},emoji:{defaultValue:!1,description:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,description:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``",type:"boolean"},completeHTMLDocument:{defaultValue:!1,description:"Outputs a complete html document, including ``, `` and `` tags",type:"boolean"},metadata:{defaultValue:!1,description:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,description:"Split adjacent blockquote blocks",type:"boolean"}};if(M===!1)return JSON.parse(JSON.stringify(y));var x={};for(var w in y)y.hasOwnProperty(w)&&(x[w]=y[w].defaultValue);return x}function n(){var M=t(!0),y={};for(var x in M)M.hasOwnProperty(x)&&(y[x]=!0);return y}var o={},r={},s={},i=t(!0),c="vanilla",l={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:t(!0),allOn:n()};o.helper={},o.extensions={},o.setOption=function(M,y){return i[M]=y,this},o.getOption=function(M){return i[M]},o.getOptions=function(){return i},o.resetOptions=function(){i=t(!0)},o.setFlavor=function(M){if(!l.hasOwnProperty(M))throw Error(M+" flavor was not found");o.resetOptions();var y=l[M];c=M;for(var x in y)y.hasOwnProperty(x)&&(i[x]=y[x])},o.getFlavor=function(){return c},o.getFlavorOptions=function(M){if(l.hasOwnProperty(M))return l[M]},o.getDefaultOptions=function(M){return t(M)},o.subParser=function(M,y){if(o.helper.isString(M))if(typeof y<"u")r[M]=y;else{if(r.hasOwnProperty(M))return r[M];throw Error("SubParser named "+M+" not registered!")}},o.extension=function(M,y){if(!o.helper.isString(M))throw Error("Extension 'name' must be a string");if(M=o.helper.stdExtName(M),o.helper.isUndefined(y)){if(!s.hasOwnProperty(M))throw Error("Extension named "+M+" is not registered!");return s[M]}else{typeof y=="function"&&(y=y()),o.helper.isArray(y)||(y=[y]);var x=u(y,M);if(x.valid)s[M]=y;else throw Error(x.error)}},o.getAllExtensions=function(){return s},o.removeExtension=function(M){delete s[M]},o.resetExtensions=function(){s={}};function u(M,y){var x=y?"Error in "+y+" extension->":"Error in unnamed extension",w={valid:!0,error:""};o.helper.isArray(M)||(M=[M]);for(var k=0;k"u"},o.helper.forEach=function(M,y){if(o.helper.isUndefined(M))throw new Error("obj param is required");if(o.helper.isUndefined(y))throw new Error("callback param is required");if(!o.helper.isFunction(y))throw new Error("callback param must be a function/closure");if(typeof M.forEach=="function")M.forEach(y);else if(o.helper.isArray(M))for(var x=0;x").replace(/&/g,"&")};var p=function(M,y,x,w){var k=w||"",S=k.indexOf("g")>-1,C=new RegExp(y+"|"+x,"g"+k.replace(/g/g,"")),q=new RegExp(y,k.replace(/g/g,"")),T=[],E,W,N,B,P;do for(E=0;N=C.exec(M);)if(q.test(N[0]))E++||(W=C.lastIndex,B=W-N[0].length);else if(E&&!--E){P=N.index+N[0].length;var I={left:{start:B,end:W},match:{start:W,end:N.index},right:{start:N.index,end:P},wholeMatch:{start:B,end:P}};if(T.push(I),!S)return T}while(E&&(C.lastIndex=W));return T};o.helper.matchRecursiveRegExp=function(M,y,x,w){for(var k=p(M,y,x,w),S=[],C=0;C0){var E=[];C[0].wholeMatch.start!==0&&E.push(M.slice(0,C[0].wholeMatch.start));for(var W=0;W=0?w+(x||0):w},o.helper.splitAtIndex=function(M,y){if(!o.helper.isString(M))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[M.substring(0,y),M.substring(y)]},o.helper.encodeEmailAddress=function(M){var y=[function(x){return"&#"+x.charCodeAt(0)+";"},function(x){return"&#x"+x.charCodeAt(0).toString(16)+";"},function(x){return x}];return M=M.replace(/./g,function(x){if(x==="@")x=y[Math.floor(Math.random()*2)](x);else{var w=Math.random();x=w>.9?y[2](x):w>.45?y[1](x):y[0](x)}return x}),M},o.helper.padEnd=function(y,x,w){return x=x>>0,w=String(w||" "),y.length>x?String(y):(x=x-y.length,x>w.length&&(w+=w.repeat(x/w.length)),String(y)+w.slice(0,x))},typeof console>"u"&&(console={warn:function(M){alert(M)},log:function(M){alert(M)},error:function(M){throw M}}),o.helper.regexes={asteriskDashAndColon:/([*_:~])/g},o.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:':octocat:',showdown:`S`},o.Converter=function(M){var y={},x=[],w=[],k={},S=c,C={parsed:{},raw:"",format:""};q();function q(){M=M||{};for(var B in i)i.hasOwnProperty(B)&&(y[B]=i[B]);if(typeof M=="object")for(var P in M)M.hasOwnProperty(P)&&(y[P]=M[P]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof M+" was passed instead.");y.extensions&&o.helper.forEach(y.extensions,T)}function T(B,P){if(P=P||null,o.helper.isString(B))if(B=o.helper.stdExtName(B),P=B,o.extensions[B]){console.warn("DEPRECATION WARNING: "+B+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),E(o.extensions[B],B);return}else if(!o.helper.isUndefined(s[B]))B=s[B];else throw Error('Extension "'+B+'" could not be loaded. It was either not found or is not a valid extension.');typeof B=="function"&&(B=B()),o.helper.isArray(B)||(B=[B]);var I=u(B,P);if(!I.valid)throw Error(I.error);for(var $=0;$[ \t]+¨NBSP;<"),!P)if(window&&window.document)P=window.document;else throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");var I=P.createElement("div");I.innerHTML=B;var $={preList:J(I)};ee(I);for(var G=I.childNodes,U="",Y=0;Y'}else pe.push(ie[ue].innerHTML),ie[ue].innerHTML="",ie[ue].setAttribute("prenum",ue.toString());return pe}return U},this.setOption=function(B,P){y[B]=P},this.getOption=function(B){return y[B]},this.getOptions=function(){return y},this.addExtension=function(B,P){P=P||null,T(B,P)},this.useExtension=function(B){T(B)},this.setFlavor=function(B){if(!l.hasOwnProperty(B))throw Error(B+" flavor was not found");var P=l[B];S=B;for(var I in P)P.hasOwnProperty(I)&&(y[I]=P[I])},this.getFlavor=function(){return S},this.removeExtension=function(B){o.helper.isArray(B)||(B=[B]);for(var P=0;P? ?(['"].*['"])?\)$/m)>-1)q="";else if(!q)if(C||(C=S.toLowerCase().replace(/ ?\n/g," ")),q="#"+C,!o.helper.isUndefined(x.gUrls[C]))q=x.gUrls[C],o.helper.isUndefined(x.gTitles[C])||(W=x.gTitles[C]);else return k;q=q.replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback);var N='",N};return M=M.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,w),M=M.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,w),M=M.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]??(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,w),M=M.replace(/\[([^\[\]]+)]()()()()()/g,w),y.ghMentions&&(M=M.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi,function(k,S,C,q,T){if(C==="\\")return S+q;if(!o.helper.isString(y.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var E=y.ghMentionsLink.replace(/\{u}/g,T),W="";return y.openLinksInNewWindow&&(W=' rel="noopener noreferrer" target="¨E95Eblank"'),S+'"+q+""})),M=x.converter._dispatch("anchors.after",M,y,x),M});var f=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,b=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,m=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,g=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,z=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,O=function(M){return function(y,x,w,k,S,C,q){w=w.replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback);var T=w,E="",W="",N=x||"",B=q||"";return/^www\./i.test(w)&&(w=w.replace(/^www\./i,"http://www.")),M.excludeTrailingPunctuationFromURLs&&C&&(E=C),M.openLinksInNewWindow&&(W=' rel="noopener noreferrer" target="¨E95Eblank"'),N+'"+T+""+E+B}},_=function(M,y){return function(x,w,k){var S="mailto:";return w=w||"",k=o.subParser("unescapeSpecialChars")(k,M,y),M.encodeEmails?(S=o.helper.encodeEmailAddress(S+k),k=o.helper.encodeEmailAddress(k)):S=S+k,w+''+k+""}};o.subParser("autoLinks",function(M,y,x){return M=x.converter._dispatch("autoLinks.before",M,y,x),M=M.replace(m,O(y)),M=M.replace(z,_(y,x)),M=x.converter._dispatch("autoLinks.after",M,y,x),M}),o.subParser("simplifiedAutoLinks",function(M,y,x){return y.simplifiedAutoLink&&(M=x.converter._dispatch("simplifiedAutoLinks.before",M,y,x),y.excludeTrailingPunctuationFromURLs?M=M.replace(b,O(y)):M=M.replace(f,O(y)),M=M.replace(g,_(y,x)),M=x.converter._dispatch("simplifiedAutoLinks.after",M,y,x)),M}),o.subParser("blockGamut",function(M,y,x){return M=x.converter._dispatch("blockGamut.before",M,y,x),M=o.subParser("blockQuotes")(M,y,x),M=o.subParser("headers")(M,y,x),M=o.subParser("horizontalRule")(M,y,x),M=o.subParser("lists")(M,y,x),M=o.subParser("codeBlocks")(M,y,x),M=o.subParser("tables")(M,y,x),M=o.subParser("hashHTMLBlocks")(M,y,x),M=o.subParser("paragraphs")(M,y,x),M=x.converter._dispatch("blockGamut.after",M,y,x),M}),o.subParser("blockQuotes",function(M,y,x){M=x.converter._dispatch("blockQuotes.before",M,y,x),M=M+` + +`;var w=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return y.splitAdjacentBlockquotes&&(w=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),M=M.replace(w,function(k){return k=k.replace(/^[ \t]*>[ \t]?/gm,""),k=k.replace(/¨0/g,""),k=k.replace(/^[ \t]+$/gm,""),k=o.subParser("githubCodeBlocks")(k,y,x),k=o.subParser("blockGamut")(k,y,x),k=k.replace(/(^|\n)/g,"$1 "),k=k.replace(/(\s*
[^\r]+?<\/pre>)/gm,function(S,C){var q=C;return q=q.replace(/^  /mg,"¨0"),q=q.replace(/¨0/g,""),q}),o.subParser("hashBlock")(`
+`+k+` +
`,y,x)}),M=x.converter._dispatch("blockQuotes.after",M,y,x),M}),o.subParser("codeBlocks",function(M,y,x){M=x.converter._dispatch("codeBlocks.before",M,y,x),M+="¨0";var w=/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;return M=M.replace(w,function(k,S,C){var q=S,T=C,E=` +`;return q=o.subParser("outdent")(q,y,x),q=o.subParser("encodeCode")(q,y,x),q=o.subParser("detab")(q,y,x),q=q.replace(/^\n+/g,""),q=q.replace(/\n+$/g,""),y.omitExtraWLInCodeBlocks&&(E=""),q="
"+q+E+"
",o.subParser("hashBlock")(q,y,x)+T}),M=M.replace(/¨0/,""),M=x.converter._dispatch("codeBlocks.after",M,y,x),M}),o.subParser("codeSpans",function(M,y,x){return M=x.converter._dispatch("codeSpans.before",M,y,x),typeof M>"u"&&(M=""),M=M.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(w,k,S,C){var q=C;return q=q.replace(/^([ \t]*)/g,""),q=q.replace(/[ \t]*$/g,""),q=o.subParser("encodeCode")(q,y,x),q=k+""+q+"",q=o.subParser("hashHTMLSpans")(q,y,x),q}),M=x.converter._dispatch("codeSpans.after",M,y,x),M}),o.subParser("completeHTMLDocument",function(M,y,x){if(!y.completeHTMLDocument)return M;M=x.converter._dispatch("completeHTMLDocument.before",M,y,x);var w="html",k=` +`,S="",C=` +`,q="",T="";typeof x.metadata.parsed.doctype<"u"&&(k=" +`,w=x.metadata.parsed.doctype.toString().toLowerCase(),(w==="html"||w==="html5")&&(C=''));for(var E in x.metadata.parsed)if(x.metadata.parsed.hasOwnProperty(E))switch(E.toLowerCase()){case"doctype":break;case"title":S=""+x.metadata.parsed.title+` +`;break;case"charset":w==="html"||w==="html5"?C=' +`:C=' +`;break;case"language":case"lang":q=' lang="'+x.metadata.parsed[E]+'"',T+=' +`;break;default:T+=' +`}return M=k+" + +`+S+C+T+` + +`+M.trim()+` + +`,M=x.converter._dispatch("completeHTMLDocument.after",M,y,x),M}),o.subParser("detab",function(M,y,x){return M=x.converter._dispatch("detab.before",M,y,x),M=M.replace(/\t(?=\t)/g," "),M=M.replace(/\t/g,"¨A¨B"),M=M.replace(/¨B(.+?)¨A/g,function(w,k){for(var S=k,C=4-S.length%4,q=0;q/g,">"),M=x.converter._dispatch("encodeAmpsAndAngles.after",M,y,x),M}),o.subParser("encodeBackslashEscapes",function(M,y,x){return M=x.converter._dispatch("encodeBackslashEscapes.before",M,y,x),M=M.replace(/\\(\\)/g,o.helper.escapeCharactersCallback),M=M.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,o.helper.escapeCharactersCallback),M=x.converter._dispatch("encodeBackslashEscapes.after",M,y,x),M}),o.subParser("encodeCode",function(M,y,x){return M=x.converter._dispatch("encodeCode.before",M,y,x),M=M.replace(/&/g,"&").replace(//g,">").replace(/([*_{}\[\]\\=~-])/g,o.helper.escapeCharactersCallback),M=x.converter._dispatch("encodeCode.after",M,y,x),M}),o.subParser("escapeSpecialCharsWithinTagAttributes",function(M,y,x){M=x.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",M,y,x);var w=/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,k=/-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;return M=M.replace(w,function(S){return S.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,o.helper.escapeCharactersCallback)}),M=M.replace(k,function(S){return S.replace(/([\\`*_~=|])/g,o.helper.escapeCharactersCallback)}),M=x.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",M,y,x),M}),o.subParser("githubCodeBlocks",function(M,y,x){return y.ghCodeBlocks?(M=x.converter._dispatch("githubCodeBlocks.before",M,y,x),M+="¨0",M=M.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(w,k,S,C){var q=y.omitExtraWLInCodeBlocks?"":` +`;return C=o.subParser("encodeCode")(C,y,x),C=o.subParser("detab")(C,y,x),C=C.replace(/^\n+/g,""),C=C.replace(/\n+$/g,""),C="
"+C+q+"
",C=o.subParser("hashBlock")(C,y,x),` + +¨G`+(x.ghCodeBlocks.push({text:w,codeblock:C})-1)+`G + +`}),M=M.replace(/¨0/,""),x.converter._dispatch("githubCodeBlocks.after",M,y,x)):M}),o.subParser("hashBlock",function(M,y,x){return M=x.converter._dispatch("hashBlock.before",M,y,x),M=M.replace(/(^\n+|\n+$)/g,""),M=` + +¨K`+(x.gHtmlBlocks.push(M)-1)+`K + +`,M=x.converter._dispatch("hashBlock.after",M,y,x),M}),o.subParser("hashCodeTags",function(M,y,x){M=x.converter._dispatch("hashCodeTags.before",M,y,x);var w=function(k,S,C,q){var T=C+o.subParser("encodeCode")(S,y,x)+q;return"¨C"+(x.gHtmlSpans.push(T)-1)+"C"};return M=o.helper.replaceRecursiveRegExp(M,w,"]*>","","gim"),M=x.converter._dispatch("hashCodeTags.after",M,y,x),M}),o.subParser("hashElement",function(M,y,x){return function(w,k){var S=k;return S=S.replace(/\n\n/g,` +`),S=S.replace(/^\n/,""),S=S.replace(/\n+$/g,""),S=` + +¨K`+(x.gHtmlBlocks.push(S)-1)+`K + +`,S}}),o.subParser("hashHTMLBlocks",function(M,y,x){M=x.converter._dispatch("hashHTMLBlocks.before",M,y,x);var w=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],k=function(B,P,I,$){var G=B;return I.search(/\bmarkdown\b/)!==-1&&(G=I+x.converter.makeHtml(P)+$),` + +¨K`+(x.gHtmlBlocks.push(G)-1)+`K + +`};y.backslashEscapesHTMLTags&&(M=M.replace(/\\<(\/?[^>]+?)>/g,function(B,P){return"<"+P+">"}));for(var S=0;S]*>)","im"),T="<"+w[S]+"\\b[^>]*>",E="";(C=o.helper.regexIndexOf(M,q))!==-1;){var W=o.helper.splitAtIndex(M,C),N=o.helper.replaceRecursiveRegExp(W[1],k,T,E,"im");if(N===W[1])break;M=W[0].concat(N)}return M=M.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,o.subParser("hashElement")(M,y,x)),M=o.helper.replaceRecursiveRegExp(M,function(B){return` + +¨K`+(x.gHtmlBlocks.push(B)-1)+`K + +`},"^ {0,3}","gm"),M=M.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,o.subParser("hashElement")(M,y,x)),M=x.converter._dispatch("hashHTMLBlocks.after",M,y,x),M}),o.subParser("hashHTMLSpans",function(M,y,x){M=x.converter._dispatch("hashHTMLSpans.before",M,y,x);function w(k){return"¨C"+(x.gHtmlSpans.push(k)-1)+"C"}return M=M.replace(/<[^>]+?\/>/gi,function(k){return w(k)}),M=M.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(k){return w(k)}),M=M.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(k){return w(k)}),M=M.replace(/<[^>]+?>/gi,function(k){return w(k)}),M=x.converter._dispatch("hashHTMLSpans.after",M,y,x),M}),o.subParser("unhashHTMLSpans",function(M,y,x){M=x.converter._dispatch("unhashHTMLSpans.before",M,y,x);for(var w=0;w]*>\\s*]*>","^ {0,3}\\s*
","gim"),M=x.converter._dispatch("hashPreCodeTags.after",M,y,x),M}),o.subParser("headers",function(M,y,x){M=x.converter._dispatch("headers.before",M,y,x);var w=isNaN(parseInt(y.headerLevelStart))?1:parseInt(y.headerLevelStart),k=y.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,S=y.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;M=M.replace(k,function(T,E){var W=o.subParser("spanGamut")(E,y,x),N=y.noHeaderId?"":' id="'+q(E)+'"',B=w,P=""+W+"";return o.subParser("hashBlock")(P,y,x)}),M=M.replace(S,function(T,E){var W=o.subParser("spanGamut")(E,y,x),N=y.noHeaderId?"":' id="'+q(E)+'"',B=w+1,P=""+W+"";return o.subParser("hashBlock")(P,y,x)});var C=y.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;M=M.replace(C,function(T,E,W){var N=W;y.customizedHeaderId&&(N=W.replace(/\s?\{([^{]+?)}\s*$/,""));var B=o.subParser("spanGamut")(N,y,x),P=y.noHeaderId?"":' id="'+q(W)+'"',I=w-1+E.length,$=""+B+"";return o.subParser("hashBlock")($,y,x)});function q(T){var E,W;if(y.customizedHeaderId){var N=T.match(/\{([^{]+?)}\s*$/);N&&N[1]&&(T=N[1])}return E=T,o.helper.isString(y.prefixHeaderId)?W=y.prefixHeaderId:y.prefixHeaderId===!0?W="section-":W="",y.rawPrefixHeaderId||(E=W+E),y.ghCompatibleHeaderId?E=E.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():y.rawHeaderId?E=E.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():E=E.replace(/[^\w]/g,"").toLowerCase(),y.rawPrefixHeaderId&&(E=W+E),x.hashLinkCounts[E]?E=E+"-"+x.hashLinkCounts[E]++:x.hashLinkCounts[E]=1,E}return M=x.converter._dispatch("headers.after",M,y,x),M}),o.subParser("horizontalRule",function(M,y,x){M=x.converter._dispatch("horizontalRule.before",M,y,x);var w=o.subParser("hashBlock")("
",y,x);return M=M.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,w),M=M.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,w),M=M.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,w),M=x.converter._dispatch("horizontalRule.after",M,y,x),M}),o.subParser("images",function(M,y,x){M=x.converter._dispatch("images.before",M,y,x);var w=/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,k=/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,S=/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,C=/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,q=/!\[([^\[\]]+)]()()()()()/g;function T(W,N,B,P,I,$,G,U){return P=P.replace(/\s/g,""),E(W,N,B,P,I,$,G,U)}function E(W,N,B,P,I,$,G,U){var Y=x.gUrls,ee=x.gTitles,J=x.gDimensions;if(B=B.toLowerCase(),U||(U=""),W.search(/\(? ?(['"].*['"])?\)$/m)>-1)P="";else if(P===""||P===null)if((B===""||B===null)&&(B=N.toLowerCase().replace(/ ?\n/g," ")),P="#"+B,!o.helper.isUndefined(Y[B]))P=Y[B],o.helper.isUndefined(ee[B])||(U=ee[B]),o.helper.isUndefined(J[B])||(I=J[B].width,$=J[B].height);else return W;N=N.replace(/"/g,""").replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback),P=P.replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback);var ne=''+N+'","
")}),M=M.replace(/\b__(\S[\s\S]*?)__\b/g,function(k,S){return w(S,"","")}),M=M.replace(/\b_(\S[\s\S]*?)_\b/g,function(k,S){return w(S,"","")})):(M=M.replace(/___(\S[\s\S]*?)___/g,function(k,S){return/\S$/.test(S)?w(S,"",""):k}),M=M.replace(/__(\S[\s\S]*?)__/g,function(k,S){return/\S$/.test(S)?w(S,"",""):k}),M=M.replace(/_([^\s_][\s\S]*?)_/g,function(k,S){return/\S$/.test(S)?w(S,"",""):k})),y.literalMidWordAsterisks?(M=M.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,function(k,S,C){return w(C,S+"","")}),M=M.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,function(k,S,C){return w(C,S+"","")}),M=M.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,function(k,S,C){return w(C,S+"","")})):(M=M.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(k,S){return/\S$/.test(S)?w(S,"",""):k}),M=M.replace(/\*\*(\S[\s\S]*?)\*\*/g,function(k,S){return/\S$/.test(S)?w(S,"",""):k}),M=M.replace(/\*([^\s*][\s\S]*?)\*/g,function(k,S){return/\S$/.test(S)?w(S,"",""):k})),M=x.converter._dispatch("italicsAndBold.after",M,y,x),M}),o.subParser("lists",function(M,y,x){function w(C,q){x.gListLevel++,C=C.replace(/\n{2,}$/,` +`),C+="¨0";var T=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,E=/\n[ \t]*\n(?!¨0)/.test(C);return y.disableForced4SpacesIndentedSublists&&(T=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),C=C.replace(T,function(W,N,B,P,I,$,G){G=G&&G.trim()!=="";var U=o.subParser("outdent")(I,y,x),Y="";return $&&y.tasklists&&(Y=' class="task-list-item" style="list-style-type: none;"',U=U.replace(/^[ \t]*\[(x|X| )?]/m,function(){var ee='-1?(U=o.subParser("githubCodeBlocks")(U,y,x),U=o.subParser("blockGamut")(U,y,x)):(U=o.subParser("lists")(U,y,x),U=U.replace(/\n$/,""),U=o.subParser("hashHTMLBlocks")(U,y,x),U=U.replace(/\n\n+/g,` + +`),E?U=o.subParser("paragraphs")(U,y,x):U=o.subParser("spanGamut")(U,y,x)),U=U.replace("¨A",""),U=""+U+` +`,U}),C=C.replace(/¨0/g,""),x.gListLevel--,q&&(C=C.replace(/\s+$/,"")),C}function k(C,q){if(q==="ol"){var T=C.match(/^ *(\d+)\./);if(T&&T[1]!=="1")return' start="'+T[1]+'"'}return""}function S(C,q,T){var E=y.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,W=y.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,N=q==="ul"?E:W,B="";if(C.search(N)!==-1)(function I($){var G=$.search(N),U=k(C,q);G!==-1?(B+=` + +<`+q+U+`> +`+w($.slice(0,G),!!T)+" +`,q=q==="ul"?"ol":"ul",N=q==="ul"?E:W,I($.slice(G))):B+=` + +<`+q+U+`> +`+w($,!!T)+" +`})(C);else{var P=k(C,q);B=` + +<`+q+P+`> +`+w(C,!!T)+" +`}return B}return M=x.converter._dispatch("lists.before",M,y,x),M+="¨0",x.gListLevel?M=M.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(C,q,T){var E=T.search(/[*+-]/g)>-1?"ul":"ol";return S(q,E,!0)}):M=M.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(C,q,T,E){var W=E.search(/[*+-]/g)>-1?"ul":"ol";return S(T,W,!1)}),M=M.replace(/¨0/,""),M=x.converter._dispatch("lists.after",M,y,x),M}),o.subParser("metadata",function(M,y,x){if(!y.metadata)return M;M=x.converter._dispatch("metadata.before",M,y,x);function w(k){x.metadata.raw=k,k=k.replace(/&/g,"&").replace(/"/g,"""),k=k.replace(/\n {4}/g," "),k.replace(/^([\S ]+): +([\s\S]+?)$/gm,function(S,C,q){return x.metadata.parsed[C]=q,""})}return M=M.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,function(k,S,C){return w(C),"¨M"}),M=M.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,function(k,S,C){return S&&(x.metadata.format=S),w(C),"¨M"}),M=M.replace(/¨M/g,""),M=x.converter._dispatch("metadata.after",M,y,x),M}),o.subParser("outdent",function(M,y,x){return M=x.converter._dispatch("outdent.before",M,y,x),M=M.replace(/^(\t|[ ]{1,4})/gm,"¨0"),M=M.replace(/¨0/g,""),M=x.converter._dispatch("outdent.after",M,y,x),M}),o.subParser("paragraphs",function(M,y,x){M=x.converter._dispatch("paragraphs.before",M,y,x),M=M.replace(/^\n+/g,""),M=M.replace(/\n+$/g,"");for(var w=M.split(/\n{2,}/g),k=[],S=w.length,C=0;C=0?k.push(q):q.search(/\S/)>=0&&(q=o.subParser("spanGamut")(q,y,x),q=q.replace(/^([ \t]*)/g,"

"),q+="

",k.push(q))}for(S=k.length,C=0;C]*>\s*]*>/.test(E)&&(W=!0)}k[C]=E}return M=k.join(` +`),M=M.replace(/^\n+/g,""),M=M.replace(/\n+$/g,""),x.converter._dispatch("paragraphs.after",M,y,x)}),o.subParser("runExtension",function(M,y,x,w){if(M.filter)y=M.filter(y,w.converter,x);else if(M.regex){var k=M.regex;k instanceof RegExp||(k=new RegExp(k,"g")),y=y.replace(k,M.replace)}return y}),o.subParser("spanGamut",function(M,y,x){return M=x.converter._dispatch("spanGamut.before",M,y,x),M=o.subParser("codeSpans")(M,y,x),M=o.subParser("escapeSpecialCharsWithinTagAttributes")(M,y,x),M=o.subParser("encodeBackslashEscapes")(M,y,x),M=o.subParser("images")(M,y,x),M=o.subParser("anchors")(M,y,x),M=o.subParser("autoLinks")(M,y,x),M=o.subParser("simplifiedAutoLinks")(M,y,x),M=o.subParser("emoji")(M,y,x),M=o.subParser("underline")(M,y,x),M=o.subParser("italicsAndBold")(M,y,x),M=o.subParser("strikethrough")(M,y,x),M=o.subParser("ellipsis")(M,y,x),M=o.subParser("hashHTMLSpans")(M,y,x),M=o.subParser("encodeAmpsAndAngles")(M,y,x),y.simpleLineBreaks?/\n\n¨K/.test(M)||(M=M.replace(/\n+/g,`
+`)):M=M.replace(/ +\n/g,`
+`),M=x.converter._dispatch("spanGamut.after",M,y,x),M}),o.subParser("strikethrough",function(M,y,x){function w(k){return y.simplifiedAutoLink&&(k=o.subParser("simplifiedAutoLinks")(k,y,x)),""+k+""}return y.strikethrough&&(M=x.converter._dispatch("strikethrough.before",M,y,x),M=M.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(k,S){return w(S)}),M=x.converter._dispatch("strikethrough.after",M,y,x)),M}),o.subParser("stripLinkDefinitions",function(M,y,x){var w=/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,k=/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;M+="¨0";var S=function(C,q,T,E,W,N,B){return q=q.toLowerCase(),T.match(/^data:.+?\/.+?;base64,/)?x.gUrls[q]=T.replace(/\s/g,""):x.gUrls[q]=o.subParser("encodeAmpsAndAngles")(T,y,x),N?N+B:(B&&(x.gTitles[q]=B.replace(/"|'/g,""")),y.parseImgDimensions&&E&&W&&(x.gDimensions[q]={width:E,height:W}),"")};return M=M.replace(k,S),M=M.replace(w,S),M=M.replace(/¨0/,""),M}),o.subParser("tables",function(M,y,x){if(!y.tables)return M;var w=/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,k=/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;function S(W){return/^:[ \t]*--*$/.test(W)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(W)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(W)?' style="text-align:center;"':""}function C(W,N){var B="";return W=W.trim(),(y.tablesHeaderId||y.tableHeaderId)&&(B=' id="'+W.replace(/ /g,"_").toLowerCase()+'"'),W=o.subParser("spanGamut")(W,y,x),""+W+` +`}function q(W,N){var B=o.subParser("spanGamut")(W,y,x);return""+B+` +`}function T(W,N){for(var B=` + + +`,P=W.length,I=0;I + + +`,I=0;I +`;for(var $=0;$ +`}return B+=` +
+`,B}function E(W){var N,B=W.split(` +`);for(N=0;N"+k+""}),M=M.replace(/\b__(\S[\s\S]*?)__\b/g,function(w,k){return""+k+""})):(M=M.replace(/___(\S[\s\S]*?)___/g,function(w,k){return/\S$/.test(k)?""+k+"":w}),M=M.replace(/__(\S[\s\S]*?)__/g,function(w,k){return/\S$/.test(k)?""+k+"":w})),M=M.replace(/(_)/g,o.helper.escapeCharactersCallback),M=x.converter._dispatch("underline.after",M,y,x)),M}),o.subParser("unescapeSpecialChars",function(M,y,x){return M=x.converter._dispatch("unescapeSpecialChars.before",M,y,x),M=M.replace(/¨E(\d+)E/g,function(w,k){var S=parseInt(k);return String.fromCharCode(S)}),M=x.converter._dispatch("unescapeSpecialChars.after",M,y,x),M}),o.subParser("makeMarkdown.blockquote",function(M,y){var x="";if(M.hasChildNodes())for(var w=M.childNodes,k=w.length,S=0;S "+x.split(` +`).join(` +> `),x}),o.subParser("makeMarkdown.codeBlock",function(M,y){var x=M.getAttribute("language"),w=M.getAttribute("precodenum");return"```"+x+` +`+y.preList[w]+"\n```"}),o.subParser("makeMarkdown.codeSpan",function(M){return"`"+M.innerHTML+"`"}),o.subParser("makeMarkdown.emphasis",function(M,y){var x="";if(M.hasChildNodes()){x+="*";for(var w=M.childNodes,k=w.length,S=0;S",M.hasAttribute("width")&&M.hasAttribute("height")&&(y+=" ="+M.getAttribute("width")+"x"+M.getAttribute("height")),M.hasAttribute("title")&&(y+=' "'+M.getAttribute("title")+'"'),y+=")"),y}),o.subParser("makeMarkdown.links",function(M,y){var x="";if(M.hasChildNodes()&&M.hasAttribute("href")){var w=M.childNodes,k=w.length;x="[";for(var S=0;S",M.hasAttribute("title")&&(x+=' "'+M.getAttribute("title")+'"'),x+=")"}return x}),o.subParser("makeMarkdown.list",function(M,y,x){var w="";if(!M.hasChildNodes())return"";for(var k=M.childNodes,S=k.length,C=M.getAttribute("start")||1,q=0;q"u"||k[q].tagName.toLowerCase()!=="li")){var T="";x==="ol"?T=C.toString()+". ":T="- ",w+=T+o.subParser("makeMarkdown.listItem")(k[q],y),++C}return w+=` + +`,w.trim()}),o.subParser("makeMarkdown.listItem",function(M,y){for(var x="",w=M.childNodes,k=w.length,S=0;S + +`;if(M.nodeType!==1)return"";var k=M.tagName.toLowerCase();switch(k){case"h1":x||(w=o.subParser("makeMarkdown.header")(M,y,1)+` + +`);break;case"h2":x||(w=o.subParser("makeMarkdown.header")(M,y,2)+` + +`);break;case"h3":x||(w=o.subParser("makeMarkdown.header")(M,y,3)+` + +`);break;case"h4":x||(w=o.subParser("makeMarkdown.header")(M,y,4)+` + +`);break;case"h5":x||(w=o.subParser("makeMarkdown.header")(M,y,5)+` + +`);break;case"h6":x||(w=o.subParser("makeMarkdown.header")(M,y,6)+` + +`);break;case"p":x||(w=o.subParser("makeMarkdown.paragraph")(M,y)+` + +`);break;case"blockquote":x||(w=o.subParser("makeMarkdown.blockquote")(M,y)+` + +`);break;case"hr":x||(w=o.subParser("makeMarkdown.hr")(M,y)+` + +`);break;case"ol":x||(w=o.subParser("makeMarkdown.list")(M,y,"ol")+` + +`);break;case"ul":x||(w=o.subParser("makeMarkdown.list")(M,y,"ul")+` + +`);break;case"precode":x||(w=o.subParser("makeMarkdown.codeBlock")(M,y)+` + +`);break;case"pre":x||(w=o.subParser("makeMarkdown.pre")(M,y)+` + +`);break;case"table":x||(w=o.subParser("makeMarkdown.table")(M,y)+` + +`);break;case"code":w=o.subParser("makeMarkdown.codeSpan")(M,y);break;case"em":case"i":w=o.subParser("makeMarkdown.emphasis")(M,y);break;case"strong":case"b":w=o.subParser("makeMarkdown.strong")(M,y);break;case"del":w=o.subParser("makeMarkdown.strikethrough")(M,y);break;case"a":w=o.subParser("makeMarkdown.links")(M,y);break;case"img":w=o.subParser("makeMarkdown.image")(M,y);break;default:w=M.outerHTML+` + +`}return w}),o.subParser("makeMarkdown.paragraph",function(M,y){var x="";if(M.hasChildNodes())for(var w=M.childNodes,k=w.length,S=0;S"+y.preList[x]+""}),o.subParser("makeMarkdown.strikethrough",function(M,y){var x="";if(M.hasChildNodes()){x+="~~";for(var w=M.childNodes,k=w.length,S=0;Str>th"),S=M.querySelectorAll("tbody>tr"),C,q;for(C=0;CI&&(I=$)}for(C=0;C/g,"\\$1>"),y=y.replace(/^#/gm,"\\#"),y=y.replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3"),y=y.replace(/^( {0,3}\d+)\./gm,"$1\\."),y=y.replace(/^( {0,3})([+-])/gm,"$1\\$2"),y=y.replace(/]([\s]*)\(/g,"\\]$1\\("),y=y.replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:"),y});var A=this;e.exports?e.exports=o:A.showdown=o}).call(MJe)}(lz)),lz.exports}var OJe=zJe();const yJe=fr(OJe),AJe=new yJe.Converter({noHeaderId:!0,tables:!0,literalMidWordUnderscores:!0,omitExtraWLInCodeBlocks:!0,simpleLineBreaks:!0,strikethrough:!0});function vJe(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,(t,n,o,r)=>`${n} +${o} +${r}`)}function xJe(e){return e.replace(/(^|\n)•( +)/g,"$1*$2")}function _Je(e){return AJe.makeHtml(vJe(xJe(e)))}function wJe(e){if(e.nodeName==="IFRAME"){const t=e.ownerDocument.createTextNode(e.src);e.parentNode.replaceChild(t,e)}}function Dne(e){!e.id||e.id.indexOf("docs-internal-guid-")!==0||(e.tagName==="B"?Hb(e):e.removeAttribute("id"))}function kJe(e){return e===" "||e==="\r"||e===` +`||e===" "}function Fne(e){if(e.nodeType!==e.TEXT_NODE)return;let t=e;for(;t=t.parentNode;)if(t.nodeType===t.ELEMENT_NODE&&t.nodeName==="PRE")return;let n=e.data.replace(/[ \r\n\t]+/g," ");if(n[0]===" "){const o=h3(e,"previous");(!o||o.nodeName==="BR"||o.textContent.slice(-1)===" ")&&(n=n.slice(1))}if(n[n.length-1]===" "){const o=h3(e,"next");(!o||o.nodeName==="BR"||o.nodeType===o.TEXT_NODE&&kJe(o.textContent[0]))&&(n=n.slice(0,-1))}n?e.data=n:e.parentNode.removeChild(e)}function $ne(e){e.nodeName==="BR"&&(h3(e,"next")||e.parentNode.removeChild(e))}function SJe(e){e.nodeName==="P"&&(e.hasChildNodes()||e.parentNode.removeChild(e))}function CJe(e){if(e.nodeName!=="SPAN"||e.getAttribute("data-stringify-type")!=="paragraph-break")return;const{parentNode:t}=e;t.insertBefore(e.ownerDocument.createElement("br"),e),t.insertBefore(e.ownerDocument.createElement("br"),e),t.removeChild(e)}const Vne=(...e)=>window?.console?.log?.(...e);function SP(e){return e=su(e,[Lne,Dne,jne,Nne,Wne]),e=G_(e,bO("paste"),{}),e=su(e,[Fne,$ne]),Vne(`Processed inline HTML: + +`,e),e}function wf({HTML:e="",plainText:t="",mode:n="AUTO",tagName:o}){if(e=e.replace(/]+>/g,""),e=e.replace(/^\s*]*>\s*]*>(?:\s*)?/i,""),e=e.replace(/(?:\s*)?<\/body>\s*<\/html>\s*$/i,""),n!=="INLINE"){const d=e||t;if(d.indexOf("",n=e.indexOf(t);if(n>-1)e=e.substring(n+t.length);else return e;const r=e.indexOf("");return r>-1&&(e=e.substring(0,r)),e}function Cct(e){const t="";return e.startsWith(t)?e.slice(t.length):e}function l8({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}catch{return}n=Sct(n),n=Cct(n);const o=Sz(e);return o.length&&!qct(o,n)?{files:o}:{html:n,plainText:t,files:[]}}function qct(e,t){if(t&&e?.length===1&&e[0].type.indexOf("image/")===0){const n=/<\s*img\b/gi;if(t.match(n)?.length!==1)return!0;const o=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(o))return!0}return!1}const rre=Symbol("requiresWrapperOnCopy");function sre(e,t,n){let o=t;const[r]=t;if(r&&n.select(ct).getBlockType(r.name)[rre]){const{getBlockRootClientId:c,getBlockName:l,getBlockAttributes:u}=n.select(V),d=c(r.clientId),p=l(d);p&&(o=ve(p,u(d),o))}const s=m1(o);e.clipboardData.setData("text/plain",Tct(s)),e.clipboardData.setData("text/html",s)}function Rct(e,t){const{plainText:n,html:o,files:r}=l8(e);let s=[];if(r.length){const i=H1("from");s=r.reduce((c,l)=>{const u=Ai(i,d=>d.type==="files"&&d.isMatch([l]));return u&&c.push(u.transform([l])),c},[]).flat()}else s=wf({HTML:o,plainText:n,mode:"BLOCKS"});return s}function Tct(e){return e=e.replace(/
/g,` +`),lr(e).trim().replace(/\n\n+/g,` + +`)}function Ect(){const e=dn(),{getBlocksByClientId:t,getSelectedBlockClientIds:n,hasMultiSelection:o,getSettings:r,getBlockName:s,__unstableIsFullySelected:i,__unstableIsSelectionCollapsed:c,__unstableIsSelectionMergeable:l,__unstableGetSelectedBlocksWithPartialSelection:u,canInsertBlockType:d,getBlockRootClientId:p}=j(V),{flashBlock:f,removeBlocks:b,replaceBlocks:m,__unstableDeleteSelection:g,__unstableExpandSelection:z,__unstableSplitSelection:O}=de(V),_=c8();return jt(A=>{function M(y){if(y.defaultPrevented)return;const x=n();if(x.length===0)return;if(!o()){const{target:q}=y,{ownerDocument:T}=q;if(y.type==="copy"||y.type==="cut"?ome(T):rme(T)&&!T.activeElement.isContentEditable)return}const{activeElement:w}=y.target.ownerDocument;if(!A.contains(w))return;const k=l(),S=c()||i(),C=!S&&!k;if(y.type==="copy"||y.type==="cut")if(y.preventDefault(),x.length===1&&f(x[0]),C)z();else{_(y.type,x);let q;if(S)q=t(x);else{const[T,E]=u(),W=t(x.slice(1,x.length-1));q=[T,...W,E]}sre(y,q,e)}if(y.type==="cut")S&&!C?b(x):(y.target.ownerDocument.activeElement.contentEditable=!1,g());else if(y.type==="paste"){const{__experimentalCanUserUseUnfilteredHTML:q}=r();if(y.clipboardData.getData("rich-text")==="true")return;const{plainText:E,html:W,files:N}=l8(y),B=i();let P=[];if(N.length){const U=H1("from");P=N.reduce((Y,ee)=>{const J=Ai(U,ne=>ne.type==="files"&&ne.isMatch([ee]));return J&&Y.push(J.transform([ee])),Y},[]).flat()}else P=wf({HTML:W,plainText:E,mode:B?"BLOCKS":"AUTO"});if(typeof P=="string")return;if(B){m(x,P,P.length-1,-1),y.preventDefault();return}if(!o()&&!ft(s(x[0]),"splitting",!1)&&!y.__deprecatedOnSplit)return;const[I]=x,$=p(I),G=[];for(const U of P)if(d(U.name,$))G.push(U);else{const Y=s($),ee=U.name!==Y?J0(U,Y):[U];if(!ee)return;for(const J of ee)for(const ne of J.innerBlocks)G.push(ne)}O(G),y.preventDefault()}}return A.ownerDocument.addEventListener("copy",M),A.ownerDocument.addEventListener("cut",M),A.ownerDocument.addEventListener("paste",M),()=>{A.ownerDocument.removeEventListener("copy",M),A.ownerDocument.removeEventListener("cut",M),A.ownerDocument.removeEventListener("paste",M)}},[])}function ire(){const[e,t,n]=gct(),o=j(r=>r(V).hasMultiSelection(),[]);return[e,Dt([t,Ect(),kct(),yct(),_ct(),wct(),mct(),Oct(),zct(),jt(r=>(r.tabIndex=0,r.dataset.hasMultiSelection=o,o?(r.setAttribute("aria-label",h("Multiple selected blocks")),()=>{delete r.dataset.hasMultiSelection,r.removeAttribute("aria-label")}):()=>{delete r.dataset.hasMultiSelection}),[o])]),n]}function Wct({children:e,...t},n){const[o,r,s]=ire();return a.jsxs(a.Fragment,{children:[o,a.jsx("div",{...t,ref:Dt([r,n]),className:X(t.className,"block-editor-writing-flow"),children:e}),s]})}const Bct=v.forwardRef(Wct);let nM=null;function Nct(){return nM||(nM=Array.from(document.styleSheets).reduce((e,t)=>{try{t.cssRules}catch{return e}const{ownerNode:n,cssRules:o}=t;if(n===null||!o||n.id.startsWith("wp-")||!n.id)return e;function r(s){return Array.from(s).find(({selectorText:i,conditionText:c,cssRules:l})=>c?r(l):i&&(i.includes(".editor-styles-wrapper")||i.includes(".wp-block")))}if(r(o)){const s=n.tagName==="STYLE";if(s){const i=n.id.replace("-inline-css","-css"),c=document.getElementById(i);c&&e.push(c.cloneNode(!0))}if(e.push(n.cloneNode(!0)),!s){const i=n.id.replace("-css","-inline-css"),c=document.getElementById(i);c&&e.push(c.cloneNode(!0))}}return e},[]),nM)}function kI({frameSize:e,containerWidth:t,maxContainerWidth:n,scaleContainerWidth:o}){return(Math.min(t,n)-e*2)/o}function Lct(e,t){const{scaleValue:n,scrollHeight:o}=e,{frameSize:r,scaleValue:s}=t;return o*(s/n)+r*2}function jct(e,t){const{containerHeight:n,frameSize:o,scaleValue:r,scrollTop:s}=e,{containerHeight:i,frameSize:c,scaleValue:l,scrollHeight:u}=t;let d=s;d=(d+n/2-o)/r-n/2,d=(d+i/2)*l+c-i/2,d=s<=o?0:d;const p=u-i;return Math.round(Math.min(Math.max(0,d),Math.max(0,p)))}function Pct(e,t){const{scaleValue:n,frameSize:o,scrollTop:r}=e,{scaleValue:s,frameSize:i,scrollTop:c}=t;return[{translate:"0 0",scale:n,paddingTop:`${o/n}px`,paddingBottom:`${o/n}px`},{translate:`0 ${r-c}px`,scale:s,paddingTop:`${i/s}px`,paddingBottom:`${i/s}px`}]}function Ict({frameSize:e,iframeDocument:t,maxContainerWidth:n=750,scale:o}){const[r,{height:s}]=Xr(),[i,{width:c,height:l}]=Xr(),u=v.useRef(0),d=o!==1,p=wr(),f=o==="auto-scaled",b=v.useRef(!1),m=v.useRef(null);v.useEffect(()=>{d||(u.current=c)},[c,d]);const g=Math.max(u.current,c),z=f?kI({frameSize:e,containerWidth:c,maxContainerWidth:n,scaleContainerWidth:g}):o,O=v.useRef({scaleValue:z,frameSize:e,containerHeight:0,scrollTop:0,scrollHeight:0}),_=v.useRef({scaleValue:z,frameSize:e,containerHeight:0,scrollTop:0,scrollHeight:0}),A=v.useCallback(()=>{const{scrollTop:x}=O.current,{scrollTop:w}=_.current;return t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scroll-top",`${x}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scroll-top-next",`${w}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-overflow-behavior",O.current.scrollHeight===O.current.containerHeight?"auto":"scroll"),t.documentElement.classList.add("zoom-out-animation"),t.documentElement.animate(Pct(O.current,_.current),{easing:"cubic-bezier(0.46, 0.03, 0.52, 0.96)",duration:400})},[t]),M=v.useCallback(()=>{b.current=!1,m.current=null,t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale",_.current.scaleValue),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size",`${_.current.frameSize}px`),t.documentElement.classList.remove("zoom-out-animation"),t.documentElement.scrollTop=_.current.scrollTop,t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scroll-top"),t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scroll-top-next"),t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-overflow-behavior"),O.current=_.current},[t]),y=v.useRef(!1);return v.useEffect(()=>{const x=t&&y.current!==d;if(y.current=d,!!x&&(b.current=!0,!!d))return t.documentElement.classList.add("is-zoomed-out"),()=>{t.documentElement.classList.remove("is-zoomed-out")}},[t,d]),v.useEffect(()=>{if(t&&(f&&O.current.scaleValue!==1&&(O.current.scaleValue=kI({frameSize:O.current.frameSize,containerWidth:c,maxContainerWidth:n,scaleContainerWidth:c})),z<1&&(b.current||(t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale",z),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size",`${e}px`)),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-content-height",`${s}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-inner-height",`${l}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-container-width",`${c}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale-container-width",`${g}px`)),b.current))if(b.current=!1,m.current){m.current.reverse();const x=O.current,w=_.current;O.current=w,_.current=x}else O.current.scrollTop=t.documentElement.scrollTop,O.current.scrollHeight=t.documentElement.scrollHeight,O.current.containerHeight=l,_.current={scaleValue:z,frameSize:e,containerHeight:t.documentElement.clientHeight},_.current.scrollHeight=Lct(O.current,_.current),_.current.scrollTop=jct(O.current,_.current),m.current=A(),p?M():m.current.onfinish=M},[A,M,p,f,z,e,t,s,c,l,n,g]),{isZoomedOut:d,scaleContainerWidth:g,contentResizeListener:r,containerResizeListener:i}}function are(e,t,n){const o={};for(const i in e)o[i]=e[i];if(e instanceof n.contentDocument.defaultView.MouseEvent){const i=n.getBoundingClientRect();o.clientX+=i.left,o.clientY+=i.top}const r=new t(e.type,o);o.defaultPrevented&&r.preventDefault(),!n.dispatchEvent(r)&&e.preventDefault()}function Dct(e){return jt(()=>{const{defaultView:t}=e;if(!t)return;const{frameElement:n}=t,o=e.documentElement,r=["dragover","mousemove"],s={};for(const i of r)s[i]=c=>{const u=Object.getPrototypeOf(c).constructor.name,d=window[u];are(c,d,n)},o.addEventListener(i,s[i]);return()=>{for(const i of r)o.removeEventListener(i,s[i])}})}function Fct({contentRef:e,children:t,tabIndex:n=0,scale:o=1,frameSize:r=0,readonly:s,forwardedRef:i,title:c=h("Editor canvas"),...l}){const{resolvedAssets:u,isPreviewMode:d}=j(P=>{const{getSettings:I}=P(V),$=I();return{resolvedAssets:$.__unstableResolvedAssets,isPreviewMode:$.isPreviewMode}},[]),{styles:p="",scripts:f=""}=u,[b,m]=v.useState(),[g,z]=v.useState([]),O=a8(),[_,A,M]=ire(),y=jt(P=>{P._load=()=>{m(P.contentDocument)};let I;function $(Y){Y.preventDefault()}const{ownerDocument:G}=P;z(Array.from(G.body.classList).filter(Y=>Y.startsWith("admin-color-")||Y.startsWith("post-type-")||Y==="wp-embed-responsive"));function U(){const{contentDocument:Y}=P,{documentElement:ee}=Y;I=Y,ee.classList.add("block-editor-iframe__html"),O(ee),Y.dir=G.dir;for(const J of Nct())Y.getElementById(J.id)||(Y.head.appendChild(J.cloneNode(!0)),d||console.warn(`${J.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,J));I.addEventListener("dragover",$,!1),I.addEventListener("drop",$,!1),I.addEventListener("click",J=>{if(J.target.tagName==="A"){J.preventDefault();const ne=J.target.getAttribute("href");ne?.startsWith("#")&&(I.defaultView.location.hash=ne.slice(1))}})}return P.addEventListener("load",U),()=>{delete P._load,P.removeEventListener("load",U),I?.removeEventListener("dragover",$),I?.removeEventListener("drop",$)}},[]),{contentResizeListener:x,containerResizeListener:w,isZoomedOut:k,scaleContainerWidth:S}=Ict({scale:o,frameSize:parseInt(r),iframeDocument:b}),C=sS({isDisabled:!s}),q=Dt([Dct(b),e,O,A,C]),T=` + + + + + - - - - + +
diff --git a/ios/Sources/GutenbergKit/Gutenberg/remote.html b/ios/Sources/GutenbergKit/Gutenberg/remote.html index f94a68a6..972f2901 100644 --- a/ios/Sources/GutenbergKit/Gutenberg/remote.html +++ b/ios/Sources/GutenbergKit/Gutenberg/remote.html @@ -7,11 +7,8 @@ content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> Gutenberg - - - - - + +
From 7e228320001e91a2f50f077caa97b18362d13e07 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 8 May 2025 15:31:48 -0400 Subject: [PATCH 37/48] fix: Workaround circular dependency A circular dependency causes the dynamic import to never resolve. Using a Promise circumvents the issue, as it appears to function differently than top-level await. Ideally, we resolve the circular dependency. However, using Rollup's `manualChunks` configuration does not appear to be an option, as it results in preloading of `@wordpress` modules. The preloading results in untranslated strings as `@wordpress` modules load before the globals they rely upon for localization, which are set by `setLocaleData`. --- src/index.jsx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/index.jsx b/src/index.jsx index 4c82ce2e..4b0ef114 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -30,9 +30,24 @@ try { // Ensure the correct translation strings are used by postponing the import // of `@wordpress` packages until after the locale is set. - const { initializeEditor } = await import( './utils/editor' ); - initializeEditor(); + // + // @TODO: A circular dependency prevents the use of async/await. Addressing + // the circular dependency with Rollup's `manualChunks` leads to + // unexpectedly preloading `@wordpress` modules, which results in missing + // locale strings due to `@wordpress` components relying upon global + // variables. Ideally, we remove the circular dependency. + import( './utils/editor' ) + .then( ( { initializeEditor } ) => { + initializeEditor(); + } ) + .catch( ( err ) => { + handleError( err ); + } ); } catch ( err ) { + handleError( err ); +} + +function handleError( err ) { error( 'Error initializing editor', err ); const root = document.getElementById( 'root' ); createRoot( root ).render( From 1b3e577680ac3086094fa60d5f6b9359e16e3136 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Thu, 8 May 2025 15:55:07 -0400 Subject: [PATCH 38/48] task: Capture build output --- ...{editor-2DRWlLPS.js => editor-S_ooKLJB.js} | 2 +- .../Gutenberg/assets/gl-BLUmXQ2R.js | 13 ---------- .../Gutenberg/assets/gl-McDu_gir.js | 13 ++++++++++ .../{index-BppLUDwx.js => index-77l0d5Cy.js} | 26 +++++++++---------- ...n-BKA8CWIV.js => localization-BorwqnJH.js} | 2 +- ...{remote-B2_s7g-L.js => remote-Wq2A4nN0.js} | 2 +- ios/Sources/GutenbergKit/Gutenberg/index.html | 2 +- .../GutenbergKit/Gutenberg/remote.html | 2 +- 8 files changed, 31 insertions(+), 31 deletions(-) rename ios/Sources/GutenbergKit/Gutenberg/assets/{editor-2DRWlLPS.js => editor-S_ooKLJB.js} (99%) delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/gl-BLUmXQ2R.js create mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/gl-McDu_gir.js rename ios/Sources/GutenbergKit/Gutenberg/assets/{index-BppLUDwx.js => index-77l0d5Cy.js} (80%) rename ios/Sources/GutenbergKit/Gutenberg/assets/{localization-BKA8CWIV.js => localization-BorwqnJH.js} (97%) rename ios/Sources/GutenbergKit/Gutenberg/assets/{remote-B2_s7g-L.js => remote-Wq2A4nN0.js} (99%) diff --git a/ios/Sources/GutenbergKit/Gutenberg/assets/editor-2DRWlLPS.js b/ios/Sources/GutenbergKit/Gutenberg/assets/editor-S_ooKLJB.js similarity index 99% rename from ios/Sources/GutenbergKit/Gutenberg/assets/editor-2DRWlLPS.js rename to ios/Sources/GutenbergKit/Gutenberg/assets/editor-S_ooKLJB.js index b00afa78..34b72f5a 100644 --- a/ios/Sources/GutenbergKit/Gutenberg/assets/editor-2DRWlLPS.js +++ b/ios/Sources/GutenbergKit/Gutenberg/assets/editor-S_ooKLJB.js @@ -1,4 +1,4 @@ -import{r as v,n as j6,_ as Mo,g as gU,a as fr,j as a,u as st,b as h,c as Qo,d as _i,e as wi,t as MU,f as cn,h as Wc,s as Mr,i as F0,k as I_,l as qn,m as i2e,o as Az,p as zU,q as iO,v as hp,w as er,x as Nr,y as cl,z as u1,A as Ue,P as P6,B as OU,C as Vt,D as $t,E as yU,F as Rt,G as Go,H as Ut,I as Ht,J as tf,K as P0,L as AU,M as a2e,N as D_,O as ud,Q as vU,R as c2e,S as Wn,T as E1,U as Dr,V as Fo,W as I6,X as l2e,Y as mp,Z as Ru,$ as xU,a0 as u2e,a1 as _U,a2 as sB,a3 as D6,a4 as d2e,a5 as p2e,a6 as F6,a7 as K1,a8 as ki,a9 as f2e,aa as Gd,ab as b2e,ac as h2e,ad as m2e,ae as wU,af as g2e,ag as F_,ah as M2e,ai as z2e,aj as O2e,ak as y2e,al as p0,am as kU,an as A2e,ao as aO,ap as v2e,aq as x2e,ar as _2e,as as $6,at as vz,au as w2e,av as k2e,aw as S2e,ax as C2e,ay as SU,az as CU,aA as q2e,aB as R2e,aC as T2e,aD as E2e,aE as V6,aF as W2e,aG as qU,aH as RU,aI as TU,aJ as B2e,aK as N2e,aL as L2e,aM as j2e,aN as P2e,aO as I2e,aP as D2e,aQ as F2e,aR as gt,aS as $2e,aT as Ss,aU as Ee,aV as d1,aW as bn,aX as ce,aY as X,aZ as xo,a_ as Xt,a$ as Tn,b0 as Le,b1 as nn,b2 as jn,b3 as se,b4 as EU,b5 as WU,b6 as Ch,b7 as Qn,b8 as U6,b9 as Oe,ba as H6,bb as V2e,bc as U2e,bd as X6,be as vt,bf as he,bg as za,bh as H2e,bi as X2e,bj as G2e,bk as K2e,bl as Y2e,bm as iB,bn as Z2e,bo as Gt,bp as Q2e,bq as J2e,br as BU,bs as ehe,bt as the,bu as aB,bv as qh,bw as nhe,bx as un,by as Si,bz as e0,bA as xe,bB as cO,bC as $o,bD as NU,bE as ohe,bF as rr,bG as xz,bH as $_,bI as k0,bJ as rhe,bK as Wt,bL as Pt,bM as she,bN as LU,bO as qo,bP as ihe,bQ as jU,bR as rn,bS as ahe,bT as che,bU as lhe,bV as M2,bW as uhe,bX as V_,bY as PU,bZ as ug,b_ as IU,b$ as lO,c0 as cB,c1 as lB,c2 as DU,c3 as FU,c4 as dhe,c5 as phe,c6 as fhe,c7 as bhe,c8 as hhe,c9 as mhe,ca as ghe,cb as Mhe}from"./index-BppLUDwx.js";let ms,Xs,kc,bc;const $U=/<(\/)?(\w+)\s*(\/)?>/g;function n4(e,t,n,o,r){return{element:e,tokenStart:t,tokenLength:n,prevOffset:o,leadingTextStart:r,children:[]}}const f0=(e,t)=>{if(ms=e,Xs=0,kc=[],bc=[],$U.lastIndex=0,!zhe(t))throw new TypeError("The conversionMap provided is not valid. It must be an object with values that are React Elements");do;while(Ohe(t));return v.createElement(v.Fragment,null,...kc)},zhe=e=>{const t=typeof e=="object",n=t&&Object.values(e);return t&&n.length&&n.every(o=>v.isValidElement(o))};function Ohe(e){const t=yhe(),[n,o,r,s]=t,i=bc.length,c=r>Xs?Xs:null;if(!e[o])return o4(),!1;switch(n){case"no-more-tokens":if(i!==0){const{leadingTextStart:p,tokenStart:f}=bc.pop();kc.push(ms.substr(p,f))}return o4(),!1;case"self-closed":return i===0?(c!==null&&kc.push(ms.substr(c,r-c)),kc.push(e[o]),Xs=r+s,!0):(uB(n4(e[o],r,s)),Xs=r+s,!0);case"opener":return bc.push(n4(e[o],r,s,r+s,c)),Xs=r+s,!0;case"closer":if(i===1)return Ahe(r),Xs=r+s,!0;const l=bc.pop(),u=ms.substr(l.prevOffset,r-l.prevOffset);l.children.push(u),l.prevOffset=r+s;const d=n4(l.element,l.tokenStart,l.tokenLength,r+s);return d.children=l.children,uB(d),Xs=r+s,!0;default:return o4(),!1}}function yhe(){const e=$U.exec(ms);if(e===null)return["no-more-tokens"];const t=e.index,[n,o,r,s]=e,i=n.length;return s?["self-closed",r,t,i]:o?["closer",r,t,i]:["opener",r,t,i]}function o4(){const e=ms.length-Xs;e!==0&&kc.push(ms.substr(Xs,e))}function uB(e){const{element:t,tokenStart:n,tokenLength:o,prevOffset:r,children:s}=e,i=bc[bc.length-1],c=ms.substr(i.prevOffset,n-i.prevOffset);c&&i.children.push(c),i.children.push(v.cloneElement(t,null,...s)),i.prevOffset=r||n+o}function Ahe(e){const{element:t,leadingTextStart:n,prevOffset:o,tokenStart:r,children:s}=bc.pop(),i=e?ms.substr(o,e-o):ms.substr(o);i&&s.push(i),n!==null&&kc.push(ms.substr(n,r-n)),kc.push(v.cloneElement(t,null,...s))}const vhe=e=>typeof e=="number"?!1:typeof e?.valueOf()=="string"||Array.isArray(e)?!e.length:!e,vo={OS:"web",select:e=>"web"in e?e.web:e.default,isWeb:!0};function VU(e,t){var n=e.charAt(0),o=e.substr(1).toLowerCase();return t>0&&n>="0"&&n<="9"?"_"+n+o:""+n.toUpperCase()+o}function _z(e,t){return t===void 0&&(t={}),j6(e,Mo({delimiter:"",transform:VU},t))}function xhe(e,t){return t===0?e.toLowerCase():VU(e,t)}function G6(e,t){return t===void 0&&(t={}),_z(e,Mo({transform:xhe},t))}function _he(e){return e.charAt(0).toUpperCase()+e.substr(1)}function whe(e){return _he(e.toLowerCase())}function UU(e,t){return t===void 0&&(t={}),j6(e,Mo({delimiter:" ",transform:whe},t))}function Tu(e){try{return new URL(e),!0}catch{return!1}}const khe=/^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;function HU(e){return khe.test(e)}const She=/^(tel:)?(\+)?\d{6,15}$/;function Che(e){return e=e.replace(/[-.() ]/g,""),She.test(e)}function uO(e){const t=/^([^\s:]+:)/.exec(e);if(t)return t[1]}function K6(e){return e?/^[a-z\-.\+]+[0-9]*:$/i.test(e):!1}function Y6(e){const t=/^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(e);if(t)return t[1]}function qhe(e){return e?/^[^\s#?]+$/.test(e):!1}function Cs(e){const t=/^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(e);if(t)return t[1]}function Rhe(e){return e?/^[^\s#?]+$/.test(e):!1}function The(e){return e?/^[^\s#?\/]+$/.test(e):!1}function Ehe(e){const t=Cs(e),n=gU(e);let o="/";return t&&(o+=t),n&&(o+=`?${n}`),o}function U_(e){return e?/^#[^\s#?\/]*$/.test(e):!1}const Whe=/^(?:[a-z]+:|#|\?|\.|\/)/i;function Eu(e){return e&&(e=e.trim(),!Whe.test(e)&&!HU(e)?"http://"+e:e)}function Rh(e){try{return decodeURI(e)}catch{return e}}function nf(e,t=null){if(!e)return"";let n=e.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i,"").replace(/^www\./i,"");n.match(/^[^\/]+\/$/)&&(n=n.replace("/",""));const o=/\/([^\/?]+)\.(?:[\w]+)(?=\?|$)/;if(!t||n.length<=t||!n.match(o))return n;n=n.split("?")[0];const r=n.split("/"),s=r[r.length-1];if(s.length<=t)return"…"+n.slice(-t);const i=s.lastIndexOf("."),[c,l]=[s.slice(0,i),s.slice(i+1)],u=c.slice(-3)+"."+l;return s.slice(0,t-u.length-1)+"…"+u}var tb={exports:{}},dB;function Bhe(){if(dB)return tb.exports;dB=1;var e={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},t=Object.keys(e).join("|"),n=new RegExp(t,"g"),o=new RegExp(t,"");function r(c){return e[c]}var s=function(c){return c.replace(n,r)},i=function(c){return!!c.match(o)};return tb.exports=s,tb.exports.has=i,tb.exports.remove=s,tb.exports}var Nhe=Bhe();const Ur=fr(Nhe);function Z6(e){return e?Ur(e).replace(/[\s\./]+/g,"-").replace(/[^\p{L}\p{N}_-]+/gu,"").toLowerCase().replace(/-+/g,"-").replace(/(^-+)|(-+$)/g,""):""}function Wu(e){let t;if(e){try{t=new URL(e,"http://example.com").pathname.split("/").pop()}catch{}if(t)return t}}const Lhe="hr",jhe="blockquote",Bc="div";function S0(e,t){return n=>{const o=e(n);return o.displayName=Phe(t,n),o}}const Phe=(e,t)=>{const n=t.displayName||t.name||"Component";return`${_z(e??"")}(${n})`},_r=(e,t,n)=>{let o,r,s=0,i,c,l,u=0,d=!1,p=!1,f=!0;n&&(d=!!n.leading,p="maxWait"in n,n.maxWait!==void 0&&(s=Math.max(n.maxWait,t)),f="trailing"in n?!!n.trailing:f);function b(q){const T=o,E=r;return o=void 0,r=void 0,u=q,i=e.apply(E,T),i}function m(q,T){c=setTimeout(q,T)}function g(){c!==void 0&&clearTimeout(c)}function z(q){return u=q,m(M,t),d?b(q):i}function O(q){return q-(l||0)}function _(q){const T=O(q),E=q-u,W=t-T;return p?Math.min(W,s-E):W}function A(q){const T=O(q),E=q-u;return l===void 0||T>=t||T<0||p&&E>=s}function M(){const q=Date.now();if(A(q))return x(q);m(M,_(q))}function y(){c=void 0}function x(q){return y(),f&&o?b(q):(o=r=void 0,i)}function w(){g(),u=0,y(),o=l=r=void 0}function k(){return S()?x(Date.now()):i}function S(){return c!==void 0}function C(...q){const T=Date.now(),E=A(T);if(o=q,r=this,l=T,E){if(!S())return z(l);if(p)return m(M,t),b(l)}return S()||m(M,t),i}return C.cancel=w,C.flush=k,C.pending=S,C},Q6=(e,t,n)=>{let o=!0,r=!0;return n&&(o="leading"in n?!!n.leading:o,r="trailing"in n?!!n.trailing:r),_r(e,t,{leading:o,trailing:r,maxWait:t})};function bi(){const e=new Map,t=new Map;function n(o){const r=t.get(o);if(r)for(const s of r)s()}return{get(o){return e.get(o)},set(o,r){e.set(o,r),n(o)},delete(o){e.delete(o),n(o)},subscribe(o,r){let s=t.get(o);return s||(s=new Set,t.set(o,s)),s.add(r),()=>{s.delete(r),s.size===0&&t.delete(o)}}}}const XU=(e=!1)=>(...t)=>(...n)=>{const o=t.flat();return e&&o.reverse(),o.reduce((r,s)=>[s(...r)],n)[0]},hc=XU(),$n=XU(!0);function Ihe(e){return S0(t=>n=>e(n)?a.jsx(t,{...n}):null,"ifCondition")}function GU(e,t){if(e===t)return!0;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;let r=0;for(;rt=>{const n=st(e);return a.jsx(e,{...t,instanceId:n})},"instanceId"),Vhe=S0(e=>class extends v.Component{constructor(n){super(n),this.timeouts=[],this.setTimeout=this.setTimeout.bind(this),this.clearTimeout=this.clearTimeout.bind(this)}componentWillUnmount(){this.timeouts.forEach(clearTimeout)}setTimeout(n,o){const r=setTimeout(()=>{n(),this.clearTimeout(r)},o);return this.timeouts.push(r),r}clearTimeout(n){clearTimeout(n),this.timeouts=this.timeouts.filter(o=>o!==n)}render(){return a.jsx(e,{...this.props,setTimeout:this.setTimeout,clearTimeout:this.clearTimeout})}},"withSafeTimeout");function Uhe(e){return[e?'[tabindex]:not([tabindex^="-"])':"[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])",'iframe:not([tabindex^="-"])',"object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",")}function KU(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function Hhe(e){const t=e.closest("map[name]");if(!t)return!1;const n=e.ownerDocument.querySelector('img[usemap="#'+t.name+'"]');return!!n&&KU(n)}function dO(e,{sequential:t=!1}={}){const n=e.querySelectorAll(Uhe(t));return Array.from(n).filter(o=>{if(!KU(o))return!1;const{nodeName:r}=o;return r==="AREA"?Hhe(o):!0})}const Xhe=Object.freeze(Object.defineProperty({__proto__:null,find:dO},Symbol.toStringTag,{value:"Module"}));function H_(e){const t=e.getAttribute("tabindex");return t===null?0:parseInt(t,10)}function YU(e){return H_(e)!==-1}function Ghe(){const e={};return function(n,o){const{nodeName:r,type:s,checked:i,name:c}=o;if(r!=="INPUT"||s!=="radio"||!c)return n.concat(o);const l=e.hasOwnProperty(c);if(!(i||!l))return n;if(l){const d=e[c];n=n.filter(p=>p!==d)}return e[c]=o,n.concat(o)}}function Khe(e,t){return{element:e,index:t}}function Yhe(e){return e.element}function Zhe(e,t){const n=H_(e.element),o=H_(t.element);return n===o?e.index-t.index:n-o}function J6(e){return e.filter(YU).map(Khe).sort(Zhe).map(Yhe).reduce(Ghe(),[])}function Qhe(e){return J6(dO(e))}function Jhe(e){return J6(dO(e.ownerDocument.body)).reverse().find(t=>e.compareDocumentPosition(t)&e.DOCUMENT_POSITION_PRECEDING)}function eme(e){return J6(dO(e.ownerDocument.body)).find(t=>e.compareDocumentPosition(t)&e.DOCUMENT_POSITION_FOLLOWING)}const tme=Object.freeze(Object.defineProperty({__proto__:null,find:Qhe,findNext:eme,findPrevious:Jhe,isTabbableIndex:YU},Symbol.toStringTag,{value:"Module"}));function BM(e){if(!e.collapsed){const s=Array.from(e.getClientRects());if(s.length===1)return s[0];const i=s.filter(({width:p})=>p>1);if(i.length===0)return e.getBoundingClientRect();if(i.length===1)return i[0];let{top:c,bottom:l,left:u,right:d}=i[0];for(const{top:p,bottom:f,left:b,right:m}of i)pl&&(l=f),bd&&(d=m);return new window.DOMRect(u,c,d-u,l-c)}const{startContainer:t}=e,{ownerDocument:n}=t;if(t.nodeName==="BR"){const{parentNode:s}=t,i=Array.from(s.childNodes).indexOf(t);e=n.createRange(),e.setStart(s,i),e.setEnd(s,i)}const o=e.getClientRects();if(o.length>1)return null;let r=o[0];if(!r||r.height===0){const s=n.createTextNode("​");e=e.cloneRange(),e.insertNode(s),r=e.getClientRects()[0],s.parentNode,s.parentNode.removeChild(s)}return r}function X_(e){const t=e.getSelection(),n=t.rangeCount?t.getRangeAt(0):null;return n?BM(n):null}function ZU(e){e.defaultView;const t=e.defaultView.getSelection(),n=t.rangeCount?t.getRangeAt(0):null;return!!n&&!n.collapsed}function eS(e){return e?.nodeName==="INPUT"}function Nc(e){const t=["button","checkbox","hidden","file","radio","image","range","reset","submit","number","email","time"];return eS(e)&&e.type&&!t.includes(e.type)||e.nodeName==="TEXTAREA"||e.contentEditable==="true"}function nme(e){if(!eS(e)&&!Nc(e))return!1;try{const{selectionStart:t,selectionEnd:n}=e;return t===null||t!==n}catch{return!0}}function ome(e){return ZU(e)||!!e.activeElement&&nme(e.activeElement)}function rme(e){return!!e.activeElement&&(eS(e.activeElement)||Nc(e.activeElement)||ZU(e))}function wz(e){return e.ownerDocument.defaultView,e.ownerDocument.defaultView.getComputedStyle(e)}function yr(e,t="vertical"){if(e){if((t==="vertical"||t==="all")&&e.scrollHeight>e.clientHeight){const{overflowY:n}=wz(e);if(/(auto|scroll)/.test(n))return e}if((t==="horizontal"||t==="all")&&e.scrollWidth>e.clientWidth){const{overflowX:n}=wz(e);if(/(auto|scroll)/.test(n))return e}return e.ownerDocument===e.parentNode?e:yr(e.parentNode,t)}}function pO(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"}function sme(e){if(pO(e))return e.selectionStart===0&&e.value.length===e.selectionEnd;if(!e.isContentEditable)return!0;const{ownerDocument:t}=e,{defaultView:n}=t,o=n.getSelection(),r=o.rangeCount?o.getRangeAt(0):null;if(!r)return!0;const{startContainer:s,endContainer:i,startOffset:c,endOffset:l}=r;if(s===e&&i===e&&c===0&&l===e.childNodes.length)return!0;e.lastChild;const u=i.nodeType===i.TEXT_NODE?i.data.length:i.childNodes.length;return pB(s,e,"firstChild")&&pB(i,e,"lastChild")&&c===0&&l===u}function pB(e,t,n){let o=t;do{if(e===o)return!0;o=o[n]}while(o);return!1}function QU(e){if(!e)return!1;const{tagName:t}=e;return pO(e)||t==="BUTTON"||t==="SELECT"}function tS(e){return wz(e).direction==="rtl"}function ime(e){const t=Array.from(e.getClientRects());if(!t.length)return;const n=Math.min(...t.map(({top:r})=>r));return Math.max(...t.map(({bottom:r})=>r))-n}function JU(e){const{anchorNode:t,focusNode:n,anchorOffset:o,focusOffset:r}=e,s=t.compareDocumentPosition(n);return s&t.DOCUMENT_POSITION_PRECEDING?!1:s&t.DOCUMENT_POSITION_FOLLOWING?!0:s===0?o<=r:!0}function ame(e,t,n){if(e.caretRangeFromPoint)return e.caretRangeFromPoint(t,n);if(!e.caretPositionFromPoint)return null;const o=e.caretPositionFromPoint(t,n);if(!o)return null;const r=e.createRange();return r.setStart(o.offsetNode,o.offset),r.collapse(!0),r}function eH(e,t,n,o){const r=o.style.zIndex,s=o.style.position,{position:i="static"}=wz(o);i==="static"&&(o.style.position="relative"),o.style.zIndex="10000";const c=ame(e,t,n);return o.style.zIndex=r,o.style.position=s,c}function tH(e,t,n){let o=n();return(!o||!o.startContainer||!e.contains(o.startContainer))&&(e.scrollIntoView(t),o=n(),!o||!o.startContainer||!e.contains(o.startContainer))?null:o}function nH(e,t,n=!1){if(pO(e)&&typeof e.selectionStart=="number")return e.selectionStart!==e.selectionEnd?!1:t?e.selectionStart===0:e.value.length===e.selectionStart;if(!e.isContentEditable)return!0;const{ownerDocument:o}=e,{defaultView:r}=o,s=r.getSelection();if(!s||!s.rangeCount)return!1;const i=s.getRangeAt(0),c=i.cloneRange(),l=JU(s),u=s.isCollapsed;u||c.collapse(!l);const d=BM(c),p=BM(i);if(!d||!p)return!1;const f=ime(i);if(!u&&f&&f>d.height&&l===t)return!1;const b=tS(e)?!t:t,m=e.getBoundingClientRect(),g=b?m.left+1:m.right-1,z=t?m.top+1:m.bottom-1,O=tH(e,t,()=>eH(o,g,z,e));if(!O)return!1;const _=BM(O);if(!_)return!1;const A=t?"top":"bottom",M=b?"left":"right",y=_[A]-p[A],x=_[M]-d[M],w=Math.abs(y)<=1,k=Math.abs(x)<=1;return n?w:w&&k}function r4(e,t){return nH(e,t)}function fB(e,t){return nH(e,t,!0)}function cme(e,t,n){const{ownerDocument:o}=e,r=tS(e)?!t:t,s=e.getBoundingClientRect();n===void 0?n=t?s.right-1:s.left+1:n<=s.left?n=s.left+1:n>=s.right&&(n=s.right-1);const i=r?s.bottom-1:s.top+1;return eH(o,n,i,e)}function oH(e,t,n){if(!e)return;if(e.focus(),pO(e)){if(typeof e.selectionStart!="number")return;t?(e.selectionStart=e.value.length,e.selectionEnd=e.value.length):(e.selectionStart=0,e.selectionEnd=0);return}if(!e.isContentEditable)return;const o=tH(e,t,()=>cme(e,t,n));if(!o)return;const{ownerDocument:r}=e,{defaultView:s}=r,i=s.getSelection();i.removeAllRanges(),i.addRange(o)}function rH(e,t){return oH(e,t,void 0)}function lme(e,t,n){return oH(e,t,n?.left)}function sH(e,t){t.parentNode,t.parentNode.insertBefore(e,t.nextSibling)}function lu(e){e.parentNode,e.parentNode.removeChild(e)}function ume(e,t){e.parentNode,sH(t,e.parentNode),lu(e)}function Hb(e){const t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}function bB(e,t){const n=e.ownerDocument.createElement(t);for(;e.firstChild;)n.appendChild(e.firstChild);return e.parentNode,e.parentNode.replaceChild(n,e),n}function nb(e,t){t.parentNode,t.parentNode.insertBefore(e,t),e.appendChild(t)}function fO(e){const{body:t}=document.implementation.createHTMLDocument("");t.innerHTML=e;const n=t.getElementsByTagName("*");let o=n.length;for(;o--;){const r=n[o];if(r.tagName==="SCRIPT")lu(r);else{let s=r.attributes.length;for(;s--;){const{name:i}=r.attributes[s];i.startsWith("on")&&r.removeAttribute(i)}}}return t.innerHTML}function lr(e){e=fO(e);const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body.textContent||""}function kz(e){switch(e.nodeType){case e.TEXT_NODE:return/^[ \f\n\r\t\v\u00a0]*$/.test(e.nodeValue||"");case e.ELEMENT_NODE:return e.hasAttributes()?!1:e.hasChildNodes()?Array.from(e.childNodes).every(kz):!0;default:return!0}}const Xb={strong:{},em:{},s:{},del:{},ins:{},a:{attributes:["href","target","rel","id"]},code:{},abbr:{attributes:["title"]},sub:{},sup:{},br:{},small:{},q:{attributes:["cite"]},dfn:{attributes:["title"]},data:{attributes:["value"]},time:{attributes:["datetime"]},var:{},samp:{},kbd:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{attributes:["dir"]},bdo:{attributes:["dir"]},wbr:{},"#text":{}},dme=["#text","br"];Object.keys(Xb).filter(e=>!dme.includes(e)).forEach(e=>{const{[e]:t,...n}=Xb;Xb[e].children=n});const pme={audio:{attributes:["src","preload","autoplay","mediagroup","loop","muted"]},canvas:{attributes:["width","height"]},embed:{attributes:["src","type","width","height"]},img:{attributes:["alt","src","srcset","usemap","ismap","width","height"]},object:{attributes:["data","type","name","usemap","form","width","height"]},video:{attributes:["src","poster","preload","playsinline","autoplay","mediagroup","loop","muted","controls","width","height"]}},dg={...Xb,...pme};function bO(e){if(e!=="paste")return dg;const{u:t,abbr:n,data:o,time:r,wbr:s,bdi:i,bdo:c,...l}={...dg,ins:{children:dg.ins.children},del:{children:dg.del.children}};return l}function Kd(e){const t=e.nodeName.toLowerCase();return bO().hasOwnProperty(t)||t==="span"}function iH(e){const t=e.nodeName.toLowerCase();return Xb.hasOwnProperty(t)||t==="span"}function fme(e){return!!e&&e.nodeType===e.ELEMENT_NODE}const bme=()=>{};function kb(e,t,n,o){Array.from(e).forEach(r=>{const s=r.nodeName.toLowerCase();if(n.hasOwnProperty(s)&&(!n[s].isMatch||n[s].isMatch?.(r))){if(fme(r)){const{attributes:i=[],classes:c=[],children:l,require:u=[],allowEmpty:d}=n[s];if(l&&!d&&kz(r)){lu(r);return}if(r.hasAttributes()&&(Array.from(r.attributes).forEach(({name:p})=>{p!=="class"&&!i.includes(p)&&r.removeAttribute(p)}),r.classList&&r.classList.length)){const p=c.map(f=>f==="*"?()=>!0:typeof f=="string"?b=>b===f:f instanceof RegExp?b=>f.test(b):bme);Array.from(r.classList).forEach(f=>{p.some(b=>b(f))||r.classList.remove(f)}),r.classList.length||r.removeAttribute("class")}if(r.hasChildNodes()){if(l==="*")return;if(l)u.length&&!r.querySelector(u.join(","))?(kb(r.childNodes,t,n,o),Hb(r)):r.parentNode&&r.parentNode.nodeName==="BODY"&&Kd(r)?(kb(r.childNodes,t,n,o),Array.from(r.childNodes).some(p=>!Kd(p))&&Hb(r)):kb(r.childNodes,t,l,o);else for(;r.firstChild;)lu(r.firstChild)}}}else kb(r.childNodes,t,n,o),o&&!Kd(r)&&r.nextElementSibling&&sH(t.createElement("br"),r),Hb(r)})}function G_(e,t,n){const o=document.implementation.createHTMLDocument("");return o.body.innerHTML=e,kb(o.body.childNodes,o,t,n),o.body.innerHTML}function Sz(e){const t=Array.from(e.files);return Array.from(e.items).forEach(n=>{const o=n.getAsFile();o&&!t.find(({name:r,type:s,size:i})=>r===o.name&&s===o.type&&i===o.size)&&t.push(o)}),t}const Z0={focusable:Xhe,tabbable:tme};function jt(e,t){const n=v.useRef();return v.useCallback(o=>{o?n.current=e(o):n.current&&n.current()},t)}function nS(){return jt(e=>{function t(n){const{key:o,shiftKey:r,target:s}=n;if(o!=="Tab")return;const i=r?"findPrevious":"findNext",c=Z0.tabbable[i](s)||null;if(s.contains(c)){n.preventDefault(),c?.focus();return}if(e.contains(c))return;const l=r?"append":"prepend",{ownerDocument:u}=e,d=u.createElement("div");d.tabIndex=-1,e[l](d),d.addEventListener("blur",()=>e.removeChild(d)),d.focus()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},[])}var NM={exports:{}};/*! +import{r as v,n as j6,_ as Mo,g as gU,a as fr,j as a,u as st,b as h,c as Qo,d as _i,e as wi,t as MU,f as cn,h as Wc,s as Mr,i as F0,k as I_,l as qn,m as i2e,o as Az,p as zU,q as iO,v as hp,w as er,x as Nr,y as cl,z as u1,A as Ue,P as P6,B as OU,C as Vt,D as $t,E as yU,F as Rt,G as Go,H as Ut,I as Ht,J as tf,K as P0,L as AU,M as a2e,N as D_,O as ud,Q as vU,R as c2e,S as Wn,T as E1,U as Dr,V as Fo,W as I6,X as l2e,Y as mp,Z as Ru,$ as xU,a0 as u2e,a1 as _U,a2 as sB,a3 as D6,a4 as d2e,a5 as p2e,a6 as F6,a7 as K1,a8 as ki,a9 as f2e,aa as Gd,ab as b2e,ac as h2e,ad as m2e,ae as wU,af as g2e,ag as F_,ah as M2e,ai as z2e,aj as O2e,ak as y2e,al as p0,am as kU,an as A2e,ao as aO,ap as v2e,aq as x2e,ar as _2e,as as $6,at as vz,au as w2e,av as k2e,aw as S2e,ax as C2e,ay as SU,az as CU,aA as q2e,aB as R2e,aC as T2e,aD as E2e,aE as V6,aF as W2e,aG as qU,aH as RU,aI as TU,aJ as B2e,aK as N2e,aL as L2e,aM as j2e,aN as P2e,aO as I2e,aP as D2e,aQ as F2e,aR as gt,aS as $2e,aT as Ss,aU as Ee,aV as d1,aW as bn,aX as ce,aY as X,aZ as xo,a_ as Xt,a$ as Tn,b0 as Le,b1 as nn,b2 as jn,b3 as se,b4 as EU,b5 as WU,b6 as Ch,b7 as Qn,b8 as U6,b9 as Oe,ba as H6,bb as V2e,bc as U2e,bd as X6,be as vt,bf as he,bg as za,bh as H2e,bi as X2e,bj as G2e,bk as K2e,bl as Y2e,bm as iB,bn as Z2e,bo as Gt,bp as Q2e,bq as J2e,br as BU,bs as ehe,bt as the,bu as aB,bv as qh,bw as nhe,bx as un,by as Si,bz as e0,bA as xe,bB as cO,bC as $o,bD as NU,bE as ohe,bF as rr,bG as xz,bH as $_,bI as k0,bJ as rhe,bK as Wt,bL as Pt,bM as she,bN as LU,bO as qo,bP as ihe,bQ as jU,bR as rn,bS as ahe,bT as che,bU as lhe,bV as M2,bW as uhe,bX as V_,bY as PU,bZ as ug,b_ as IU,b$ as lO,c0 as cB,c1 as lB,c2 as DU,c3 as FU,c4 as dhe,c5 as phe,c6 as fhe,c7 as bhe,c8 as hhe,c9 as mhe,ca as ghe,cb as Mhe}from"./index-77l0d5Cy.js";let ms,Xs,kc,bc;const $U=/<(\/)?(\w+)\s*(\/)?>/g;function n4(e,t,n,o,r){return{element:e,tokenStart:t,tokenLength:n,prevOffset:o,leadingTextStart:r,children:[]}}const f0=(e,t)=>{if(ms=e,Xs=0,kc=[],bc=[],$U.lastIndex=0,!zhe(t))throw new TypeError("The conversionMap provided is not valid. It must be an object with values that are React Elements");do;while(Ohe(t));return v.createElement(v.Fragment,null,...kc)},zhe=e=>{const t=typeof e=="object",n=t&&Object.values(e);return t&&n.length&&n.every(o=>v.isValidElement(o))};function Ohe(e){const t=yhe(),[n,o,r,s]=t,i=bc.length,c=r>Xs?Xs:null;if(!e[o])return o4(),!1;switch(n){case"no-more-tokens":if(i!==0){const{leadingTextStart:p,tokenStart:f}=bc.pop();kc.push(ms.substr(p,f))}return o4(),!1;case"self-closed":return i===0?(c!==null&&kc.push(ms.substr(c,r-c)),kc.push(e[o]),Xs=r+s,!0):(uB(n4(e[o],r,s)),Xs=r+s,!0);case"opener":return bc.push(n4(e[o],r,s,r+s,c)),Xs=r+s,!0;case"closer":if(i===1)return Ahe(r),Xs=r+s,!0;const l=bc.pop(),u=ms.substr(l.prevOffset,r-l.prevOffset);l.children.push(u),l.prevOffset=r+s;const d=n4(l.element,l.tokenStart,l.tokenLength,r+s);return d.children=l.children,uB(d),Xs=r+s,!0;default:return o4(),!1}}function yhe(){const e=$U.exec(ms);if(e===null)return["no-more-tokens"];const t=e.index,[n,o,r,s]=e,i=n.length;return s?["self-closed",r,t,i]:o?["closer",r,t,i]:["opener",r,t,i]}function o4(){const e=ms.length-Xs;e!==0&&kc.push(ms.substr(Xs,e))}function uB(e){const{element:t,tokenStart:n,tokenLength:o,prevOffset:r,children:s}=e,i=bc[bc.length-1],c=ms.substr(i.prevOffset,n-i.prevOffset);c&&i.children.push(c),i.children.push(v.cloneElement(t,null,...s)),i.prevOffset=r||n+o}function Ahe(e){const{element:t,leadingTextStart:n,prevOffset:o,tokenStart:r,children:s}=bc.pop(),i=e?ms.substr(o,e-o):ms.substr(o);i&&s.push(i),n!==null&&kc.push(ms.substr(n,r-n)),kc.push(v.cloneElement(t,null,...s))}const vhe=e=>typeof e=="number"?!1:typeof e?.valueOf()=="string"||Array.isArray(e)?!e.length:!e,vo={OS:"web",select:e=>"web"in e?e.web:e.default,isWeb:!0};function VU(e,t){var n=e.charAt(0),o=e.substr(1).toLowerCase();return t>0&&n>="0"&&n<="9"?"_"+n+o:""+n.toUpperCase()+o}function _z(e,t){return t===void 0&&(t={}),j6(e,Mo({delimiter:"",transform:VU},t))}function xhe(e,t){return t===0?e.toLowerCase():VU(e,t)}function G6(e,t){return t===void 0&&(t={}),_z(e,Mo({transform:xhe},t))}function _he(e){return e.charAt(0).toUpperCase()+e.substr(1)}function whe(e){return _he(e.toLowerCase())}function UU(e,t){return t===void 0&&(t={}),j6(e,Mo({delimiter:" ",transform:whe},t))}function Tu(e){try{return new URL(e),!0}catch{return!1}}const khe=/^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;function HU(e){return khe.test(e)}const She=/^(tel:)?(\+)?\d{6,15}$/;function Che(e){return e=e.replace(/[-.() ]/g,""),She.test(e)}function uO(e){const t=/^([^\s:]+:)/.exec(e);if(t)return t[1]}function K6(e){return e?/^[a-z\-.\+]+[0-9]*:$/i.test(e):!1}function Y6(e){const t=/^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(e);if(t)return t[1]}function qhe(e){return e?/^[^\s#?]+$/.test(e):!1}function Cs(e){const t=/^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(e);if(t)return t[1]}function Rhe(e){return e?/^[^\s#?]+$/.test(e):!1}function The(e){return e?/^[^\s#?\/]+$/.test(e):!1}function Ehe(e){const t=Cs(e),n=gU(e);let o="/";return t&&(o+=t),n&&(o+=`?${n}`),o}function U_(e){return e?/^#[^\s#?\/]*$/.test(e):!1}const Whe=/^(?:[a-z]+:|#|\?|\.|\/)/i;function Eu(e){return e&&(e=e.trim(),!Whe.test(e)&&!HU(e)?"http://"+e:e)}function Rh(e){try{return decodeURI(e)}catch{return e}}function nf(e,t=null){if(!e)return"";let n=e.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i,"").replace(/^www\./i,"");n.match(/^[^\/]+\/$/)&&(n=n.replace("/",""));const o=/\/([^\/?]+)\.(?:[\w]+)(?=\?|$)/;if(!t||n.length<=t||!n.match(o))return n;n=n.split("?")[0];const r=n.split("/"),s=r[r.length-1];if(s.length<=t)return"…"+n.slice(-t);const i=s.lastIndexOf("."),[c,l]=[s.slice(0,i),s.slice(i+1)],u=c.slice(-3)+"."+l;return s.slice(0,t-u.length-1)+"…"+u}var tb={exports:{}},dB;function Bhe(){if(dB)return tb.exports;dB=1;var e={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},t=Object.keys(e).join("|"),n=new RegExp(t,"g"),o=new RegExp(t,"");function r(c){return e[c]}var s=function(c){return c.replace(n,r)},i=function(c){return!!c.match(o)};return tb.exports=s,tb.exports.has=i,tb.exports.remove=s,tb.exports}var Nhe=Bhe();const Ur=fr(Nhe);function Z6(e){return e?Ur(e).replace(/[\s\./]+/g,"-").replace(/[^\p{L}\p{N}_-]+/gu,"").toLowerCase().replace(/-+/g,"-").replace(/(^-+)|(-+$)/g,""):""}function Wu(e){let t;if(e){try{t=new URL(e,"http://example.com").pathname.split("/").pop()}catch{}if(t)return t}}const Lhe="hr",jhe="blockquote",Bc="div";function S0(e,t){return n=>{const o=e(n);return o.displayName=Phe(t,n),o}}const Phe=(e,t)=>{const n=t.displayName||t.name||"Component";return`${_z(e??"")}(${n})`},_r=(e,t,n)=>{let o,r,s=0,i,c,l,u=0,d=!1,p=!1,f=!0;n&&(d=!!n.leading,p="maxWait"in n,n.maxWait!==void 0&&(s=Math.max(n.maxWait,t)),f="trailing"in n?!!n.trailing:f);function b(q){const T=o,E=r;return o=void 0,r=void 0,u=q,i=e.apply(E,T),i}function m(q,T){c=setTimeout(q,T)}function g(){c!==void 0&&clearTimeout(c)}function z(q){return u=q,m(M,t),d?b(q):i}function O(q){return q-(l||0)}function _(q){const T=O(q),E=q-u,W=t-T;return p?Math.min(W,s-E):W}function A(q){const T=O(q),E=q-u;return l===void 0||T>=t||T<0||p&&E>=s}function M(){const q=Date.now();if(A(q))return x(q);m(M,_(q))}function y(){c=void 0}function x(q){return y(),f&&o?b(q):(o=r=void 0,i)}function w(){g(),u=0,y(),o=l=r=void 0}function k(){return S()?x(Date.now()):i}function S(){return c!==void 0}function C(...q){const T=Date.now(),E=A(T);if(o=q,r=this,l=T,E){if(!S())return z(l);if(p)return m(M,t),b(l)}return S()||m(M,t),i}return C.cancel=w,C.flush=k,C.pending=S,C},Q6=(e,t,n)=>{let o=!0,r=!0;return n&&(o="leading"in n?!!n.leading:o,r="trailing"in n?!!n.trailing:r),_r(e,t,{leading:o,trailing:r,maxWait:t})};function bi(){const e=new Map,t=new Map;function n(o){const r=t.get(o);if(r)for(const s of r)s()}return{get(o){return e.get(o)},set(o,r){e.set(o,r),n(o)},delete(o){e.delete(o),n(o)},subscribe(o,r){let s=t.get(o);return s||(s=new Set,t.set(o,s)),s.add(r),()=>{s.delete(r),s.size===0&&t.delete(o)}}}}const XU=(e=!1)=>(...t)=>(...n)=>{const o=t.flat();return e&&o.reverse(),o.reduce((r,s)=>[s(...r)],n)[0]},hc=XU(),$n=XU(!0);function Ihe(e){return S0(t=>n=>e(n)?a.jsx(t,{...n}):null,"ifCondition")}function GU(e,t){if(e===t)return!0;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;let r=0;for(;rt=>{const n=st(e);return a.jsx(e,{...t,instanceId:n})},"instanceId"),Vhe=S0(e=>class extends v.Component{constructor(n){super(n),this.timeouts=[],this.setTimeout=this.setTimeout.bind(this),this.clearTimeout=this.clearTimeout.bind(this)}componentWillUnmount(){this.timeouts.forEach(clearTimeout)}setTimeout(n,o){const r=setTimeout(()=>{n(),this.clearTimeout(r)},o);return this.timeouts.push(r),r}clearTimeout(n){clearTimeout(n),this.timeouts=this.timeouts.filter(o=>o!==n)}render(){return a.jsx(e,{...this.props,setTimeout:this.setTimeout,clearTimeout:this.clearTimeout})}},"withSafeTimeout");function Uhe(e){return[e?'[tabindex]:not([tabindex^="-"])':"[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])",'iframe:not([tabindex^="-"])',"object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",")}function KU(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function Hhe(e){const t=e.closest("map[name]");if(!t)return!1;const n=e.ownerDocument.querySelector('img[usemap="#'+t.name+'"]');return!!n&&KU(n)}function dO(e,{sequential:t=!1}={}){const n=e.querySelectorAll(Uhe(t));return Array.from(n).filter(o=>{if(!KU(o))return!1;const{nodeName:r}=o;return r==="AREA"?Hhe(o):!0})}const Xhe=Object.freeze(Object.defineProperty({__proto__:null,find:dO},Symbol.toStringTag,{value:"Module"}));function H_(e){const t=e.getAttribute("tabindex");return t===null?0:parseInt(t,10)}function YU(e){return H_(e)!==-1}function Ghe(){const e={};return function(n,o){const{nodeName:r,type:s,checked:i,name:c}=o;if(r!=="INPUT"||s!=="radio"||!c)return n.concat(o);const l=e.hasOwnProperty(c);if(!(i||!l))return n;if(l){const d=e[c];n=n.filter(p=>p!==d)}return e[c]=o,n.concat(o)}}function Khe(e,t){return{element:e,index:t}}function Yhe(e){return e.element}function Zhe(e,t){const n=H_(e.element),o=H_(t.element);return n===o?e.index-t.index:n-o}function J6(e){return e.filter(YU).map(Khe).sort(Zhe).map(Yhe).reduce(Ghe(),[])}function Qhe(e){return J6(dO(e))}function Jhe(e){return J6(dO(e.ownerDocument.body)).reverse().find(t=>e.compareDocumentPosition(t)&e.DOCUMENT_POSITION_PRECEDING)}function eme(e){return J6(dO(e.ownerDocument.body)).find(t=>e.compareDocumentPosition(t)&e.DOCUMENT_POSITION_FOLLOWING)}const tme=Object.freeze(Object.defineProperty({__proto__:null,find:Qhe,findNext:eme,findPrevious:Jhe,isTabbableIndex:YU},Symbol.toStringTag,{value:"Module"}));function BM(e){if(!e.collapsed){const s=Array.from(e.getClientRects());if(s.length===1)return s[0];const i=s.filter(({width:p})=>p>1);if(i.length===0)return e.getBoundingClientRect();if(i.length===1)return i[0];let{top:c,bottom:l,left:u,right:d}=i[0];for(const{top:p,bottom:f,left:b,right:m}of i)pl&&(l=f),bd&&(d=m);return new window.DOMRect(u,c,d-u,l-c)}const{startContainer:t}=e,{ownerDocument:n}=t;if(t.nodeName==="BR"){const{parentNode:s}=t,i=Array.from(s.childNodes).indexOf(t);e=n.createRange(),e.setStart(s,i),e.setEnd(s,i)}const o=e.getClientRects();if(o.length>1)return null;let r=o[0];if(!r||r.height===0){const s=n.createTextNode("​");e=e.cloneRange(),e.insertNode(s),r=e.getClientRects()[0],s.parentNode,s.parentNode.removeChild(s)}return r}function X_(e){const t=e.getSelection(),n=t.rangeCount?t.getRangeAt(0):null;return n?BM(n):null}function ZU(e){e.defaultView;const t=e.defaultView.getSelection(),n=t.rangeCount?t.getRangeAt(0):null;return!!n&&!n.collapsed}function eS(e){return e?.nodeName==="INPUT"}function Nc(e){const t=["button","checkbox","hidden","file","radio","image","range","reset","submit","number","email","time"];return eS(e)&&e.type&&!t.includes(e.type)||e.nodeName==="TEXTAREA"||e.contentEditable==="true"}function nme(e){if(!eS(e)&&!Nc(e))return!1;try{const{selectionStart:t,selectionEnd:n}=e;return t===null||t!==n}catch{return!0}}function ome(e){return ZU(e)||!!e.activeElement&&nme(e.activeElement)}function rme(e){return!!e.activeElement&&(eS(e.activeElement)||Nc(e.activeElement)||ZU(e))}function wz(e){return e.ownerDocument.defaultView,e.ownerDocument.defaultView.getComputedStyle(e)}function yr(e,t="vertical"){if(e){if((t==="vertical"||t==="all")&&e.scrollHeight>e.clientHeight){const{overflowY:n}=wz(e);if(/(auto|scroll)/.test(n))return e}if((t==="horizontal"||t==="all")&&e.scrollWidth>e.clientWidth){const{overflowX:n}=wz(e);if(/(auto|scroll)/.test(n))return e}return e.ownerDocument===e.parentNode?e:yr(e.parentNode,t)}}function pO(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"}function sme(e){if(pO(e))return e.selectionStart===0&&e.value.length===e.selectionEnd;if(!e.isContentEditable)return!0;const{ownerDocument:t}=e,{defaultView:n}=t,o=n.getSelection(),r=o.rangeCount?o.getRangeAt(0):null;if(!r)return!0;const{startContainer:s,endContainer:i,startOffset:c,endOffset:l}=r;if(s===e&&i===e&&c===0&&l===e.childNodes.length)return!0;e.lastChild;const u=i.nodeType===i.TEXT_NODE?i.data.length:i.childNodes.length;return pB(s,e,"firstChild")&&pB(i,e,"lastChild")&&c===0&&l===u}function pB(e,t,n){let o=t;do{if(e===o)return!0;o=o[n]}while(o);return!1}function QU(e){if(!e)return!1;const{tagName:t}=e;return pO(e)||t==="BUTTON"||t==="SELECT"}function tS(e){return wz(e).direction==="rtl"}function ime(e){const t=Array.from(e.getClientRects());if(!t.length)return;const n=Math.min(...t.map(({top:r})=>r));return Math.max(...t.map(({bottom:r})=>r))-n}function JU(e){const{anchorNode:t,focusNode:n,anchorOffset:o,focusOffset:r}=e,s=t.compareDocumentPosition(n);return s&t.DOCUMENT_POSITION_PRECEDING?!1:s&t.DOCUMENT_POSITION_FOLLOWING?!0:s===0?o<=r:!0}function ame(e,t,n){if(e.caretRangeFromPoint)return e.caretRangeFromPoint(t,n);if(!e.caretPositionFromPoint)return null;const o=e.caretPositionFromPoint(t,n);if(!o)return null;const r=e.createRange();return r.setStart(o.offsetNode,o.offset),r.collapse(!0),r}function eH(e,t,n,o){const r=o.style.zIndex,s=o.style.position,{position:i="static"}=wz(o);i==="static"&&(o.style.position="relative"),o.style.zIndex="10000";const c=ame(e,t,n);return o.style.zIndex=r,o.style.position=s,c}function tH(e,t,n){let o=n();return(!o||!o.startContainer||!e.contains(o.startContainer))&&(e.scrollIntoView(t),o=n(),!o||!o.startContainer||!e.contains(o.startContainer))?null:o}function nH(e,t,n=!1){if(pO(e)&&typeof e.selectionStart=="number")return e.selectionStart!==e.selectionEnd?!1:t?e.selectionStart===0:e.value.length===e.selectionStart;if(!e.isContentEditable)return!0;const{ownerDocument:o}=e,{defaultView:r}=o,s=r.getSelection();if(!s||!s.rangeCount)return!1;const i=s.getRangeAt(0),c=i.cloneRange(),l=JU(s),u=s.isCollapsed;u||c.collapse(!l);const d=BM(c),p=BM(i);if(!d||!p)return!1;const f=ime(i);if(!u&&f&&f>d.height&&l===t)return!1;const b=tS(e)?!t:t,m=e.getBoundingClientRect(),g=b?m.left+1:m.right-1,z=t?m.top+1:m.bottom-1,O=tH(e,t,()=>eH(o,g,z,e));if(!O)return!1;const _=BM(O);if(!_)return!1;const A=t?"top":"bottom",M=b?"left":"right",y=_[A]-p[A],x=_[M]-d[M],w=Math.abs(y)<=1,k=Math.abs(x)<=1;return n?w:w&&k}function r4(e,t){return nH(e,t)}function fB(e,t){return nH(e,t,!0)}function cme(e,t,n){const{ownerDocument:o}=e,r=tS(e)?!t:t,s=e.getBoundingClientRect();n===void 0?n=t?s.right-1:s.left+1:n<=s.left?n=s.left+1:n>=s.right&&(n=s.right-1);const i=r?s.bottom-1:s.top+1;return eH(o,n,i,e)}function oH(e,t,n){if(!e)return;if(e.focus(),pO(e)){if(typeof e.selectionStart!="number")return;t?(e.selectionStart=e.value.length,e.selectionEnd=e.value.length):(e.selectionStart=0,e.selectionEnd=0);return}if(!e.isContentEditable)return;const o=tH(e,t,()=>cme(e,t,n));if(!o)return;const{ownerDocument:r}=e,{defaultView:s}=r,i=s.getSelection();i.removeAllRanges(),i.addRange(o)}function rH(e,t){return oH(e,t,void 0)}function lme(e,t,n){return oH(e,t,n?.left)}function sH(e,t){t.parentNode,t.parentNode.insertBefore(e,t.nextSibling)}function lu(e){e.parentNode,e.parentNode.removeChild(e)}function ume(e,t){e.parentNode,sH(t,e.parentNode),lu(e)}function Hb(e){const t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}function bB(e,t){const n=e.ownerDocument.createElement(t);for(;e.firstChild;)n.appendChild(e.firstChild);return e.parentNode,e.parentNode.replaceChild(n,e),n}function nb(e,t){t.parentNode,t.parentNode.insertBefore(e,t),e.appendChild(t)}function fO(e){const{body:t}=document.implementation.createHTMLDocument("");t.innerHTML=e;const n=t.getElementsByTagName("*");let o=n.length;for(;o--;){const r=n[o];if(r.tagName==="SCRIPT")lu(r);else{let s=r.attributes.length;for(;s--;){const{name:i}=r.attributes[s];i.startsWith("on")&&r.removeAttribute(i)}}}return t.innerHTML}function lr(e){e=fO(e);const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body.textContent||""}function kz(e){switch(e.nodeType){case e.TEXT_NODE:return/^[ \f\n\r\t\v\u00a0]*$/.test(e.nodeValue||"");case e.ELEMENT_NODE:return e.hasAttributes()?!1:e.hasChildNodes()?Array.from(e.childNodes).every(kz):!0;default:return!0}}const Xb={strong:{},em:{},s:{},del:{},ins:{},a:{attributes:["href","target","rel","id"]},code:{},abbr:{attributes:["title"]},sub:{},sup:{},br:{},small:{},q:{attributes:["cite"]},dfn:{attributes:["title"]},data:{attributes:["value"]},time:{attributes:["datetime"]},var:{},samp:{},kbd:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{attributes:["dir"]},bdo:{attributes:["dir"]},wbr:{},"#text":{}},dme=["#text","br"];Object.keys(Xb).filter(e=>!dme.includes(e)).forEach(e=>{const{[e]:t,...n}=Xb;Xb[e].children=n});const pme={audio:{attributes:["src","preload","autoplay","mediagroup","loop","muted"]},canvas:{attributes:["width","height"]},embed:{attributes:["src","type","width","height"]},img:{attributes:["alt","src","srcset","usemap","ismap","width","height"]},object:{attributes:["data","type","name","usemap","form","width","height"]},video:{attributes:["src","poster","preload","playsinline","autoplay","mediagroup","loop","muted","controls","width","height"]}},dg={...Xb,...pme};function bO(e){if(e!=="paste")return dg;const{u:t,abbr:n,data:o,time:r,wbr:s,bdi:i,bdo:c,...l}={...dg,ins:{children:dg.ins.children},del:{children:dg.del.children}};return l}function Kd(e){const t=e.nodeName.toLowerCase();return bO().hasOwnProperty(t)||t==="span"}function iH(e){const t=e.nodeName.toLowerCase();return Xb.hasOwnProperty(t)||t==="span"}function fme(e){return!!e&&e.nodeType===e.ELEMENT_NODE}const bme=()=>{};function kb(e,t,n,o){Array.from(e).forEach(r=>{const s=r.nodeName.toLowerCase();if(n.hasOwnProperty(s)&&(!n[s].isMatch||n[s].isMatch?.(r))){if(fme(r)){const{attributes:i=[],classes:c=[],children:l,require:u=[],allowEmpty:d}=n[s];if(l&&!d&&kz(r)){lu(r);return}if(r.hasAttributes()&&(Array.from(r.attributes).forEach(({name:p})=>{p!=="class"&&!i.includes(p)&&r.removeAttribute(p)}),r.classList&&r.classList.length)){const p=c.map(f=>f==="*"?()=>!0:typeof f=="string"?b=>b===f:f instanceof RegExp?b=>f.test(b):bme);Array.from(r.classList).forEach(f=>{p.some(b=>b(f))||r.classList.remove(f)}),r.classList.length||r.removeAttribute("class")}if(r.hasChildNodes()){if(l==="*")return;if(l)u.length&&!r.querySelector(u.join(","))?(kb(r.childNodes,t,n,o),Hb(r)):r.parentNode&&r.parentNode.nodeName==="BODY"&&Kd(r)?(kb(r.childNodes,t,n,o),Array.from(r.childNodes).some(p=>!Kd(p))&&Hb(r)):kb(r.childNodes,t,l,o);else for(;r.firstChild;)lu(r.firstChild)}}}else kb(r.childNodes,t,n,o),o&&!Kd(r)&&r.nextElementSibling&&sH(t.createElement("br"),r),Hb(r)})}function G_(e,t,n){const o=document.implementation.createHTMLDocument("");return o.body.innerHTML=e,kb(o.body.childNodes,o,t,n),o.body.innerHTML}function Sz(e){const t=Array.from(e.files);return Array.from(e.items).forEach(n=>{const o=n.getAsFile();o&&!t.find(({name:r,type:s,size:i})=>r===o.name&&s===o.type&&i===o.size)&&t.push(o)}),t}const Z0={focusable:Xhe,tabbable:tme};function jt(e,t){const n=v.useRef();return v.useCallback(o=>{o?n.current=e(o):n.current&&n.current()},t)}function nS(){return jt(e=>{function t(n){const{key:o,shiftKey:r,target:s}=n;if(o!=="Tab")return;const i=r?"findPrevious":"findNext",c=Z0.tabbable[i](s)||null;if(s.contains(c)){n.preventDefault(),c?.focus();return}if(e.contains(c))return;const l=r?"append":"prepend",{ownerDocument:u}=e,d=u.createElement("div");d.tabIndex=-1,e[l](d),d.addEventListener("blur",()=>e.removeChild(d)),d.focus()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},[])}var NM={exports:{}};/*! * clipboard.js v2.0.11 * https://clipboardjs.com/ * diff --git a/ios/Sources/GutenbergKit/Gutenberg/assets/gl-BLUmXQ2R.js b/ios/Sources/GutenbergKit/Gutenberg/assets/gl-BLUmXQ2R.js deleted file mode 100644 index ba6f4a17..00000000 --- a/ios/Sources/GutenbergKit/Gutenberg/assets/gl-BLUmXQ2R.js +++ /dev/null @@ -1,13 +0,0 @@ -const e=["Cortar"],o=["Ignorar"],a=["Agrandar"],t=["Densidade"],s=["Resumo"],i=[],n=[],r=[],d=[],l=[],c=[],u=[],p=[],m=[],b=[],h=[],g=[],v=[],f=[],y=[],k=[],w=[],x=["Pechado"],A=["Aberto"],q=["Desactivar"],S=[],C=[],P=[],E=[],T=[],z=[],L=[],M=[],D=[],I=[],N=[],$=[],R=[],O=[],B=[],F=[],U=[],H=[],W=[],V=[],G=[],Y=["Orixe"],j=["Fontes"],X=["Instalar"],J=["Aviso"],_=["Desagrupar"],Q=["Notas ao pé de páxina"],K=["Continuar"],Z=["Separar"],ee=["Contrasinal"],oe=["Notas ao pé de páxina"],ae=["Números"],te=["Escala"],se=["Pai"],ie=["Pendente"],ne=["Suxerencias"],re=[],de=[],le=[],ce=[],ue=["Openverse"],pe=["Sombra"],me=["Centrar"],be=["Posición"],he=["Fixo"],ge=["Til"],ve=["CSS"],fe=["Vídeos"],ye=["Fixo"],ke=["Diminuír"],we=["Aumentar"],xe=["Lenda"],Ae=["Padrón"],qe=["dúas barras"],Se=["XXL"],Ce=["Fonte"],Pe=["Constrinxido"],Ee=["H6"],Te=["H5"],ze=["H4"],Le=["H3"],Me=["H2"],De=["H1"],Ie=["Taxonomías"],Ne=["Ao pasar o cursor"],$e=["Non establecido"],Re=["Agora"],Oe=["Principais"],Be=["Sufixo"],Fe=["Prefixo"],Ue=["di"],He=["Resposta"],We=["Respostas"],Ve=["Pila"],Ge=["Semana"],Ye=["Non válido"],je=["Bloquear"],Xe=["Desbloquear"],Je=["vista previa"],_e=["Feito"],Qe=["Icona"],Ke=["Borrar"],Ze=["Accións"],eo=["Renomear"],oo=["Aa"],ao=["estilos"],to=["Menús"],so=["Responder"],io=["Elementos"],no=["Submenús"],ro=["Sempre"],lo=["Visualización"],co=["marcador"],uo=["Resaltar"],po=["Paleta"],mo=["Cores"],bo=["Frecha"],ho=["Fila"],go=["Xustificación"],vo=["Fluxo"],fo=["Flexible"],yo=["Publicando"],ko=["Estilo"],wo=["Radio"],xo=["Marxe"],Ao=["Duotono"],qo=["Logotipo"],So=["Resaltados"],Co=["Sombras"],Po=["Disposición"],Eo=["Punteado"],To=["Guiones"],zo=["Personalización"],Lo=["Bordo"],Mo=[],Do=["Área"],Io=["Aumentar marxe"],No=["Diminuír marxe"],$o=["Ordenada"],Ro=["Sen ordenar"],Oo=["Arrastrar"],Bo=["Aliñar"],Fo=["Iniciais en maiúscula"],Uo=["Minúsculas"],Ho=["Maiúsculas"],Wo=["Vertical"],Vo=["Horizontal"],Go=["Temas"],Yo=["Palabra clave"],jo=["Filtros"],Xo=["Decoración"],Jo=["Só"],_o=["Excluír"],Qo=["Incluír"],Ko=["Aparencia"],Zo=["Preferencias"],ea=["Inglés"],oa=["Tipo"],aa=["Etiqueta"],ta=["Capítulos"],sa=["Descricións"],ia=["Lendas"],na=["Subtítulos"],ra=["Detalles"],da=["Radial"],la=["Lineal"],ca=["Anónimo"],ua=["Caracteres"],pa=["Descrición"],ma=["Base"],ba=["Autor"],ha=["Orixinal"],ga=["Nome"],va=["Vertical"],fa=["Horizontal"],ya=["Mixto"],ka=["Dereita"],wa=["Esquerda"],xa=["Abaixo"],Aa=["Arriba"],qa=["Recheo"],Sa=["Espazado"],Ca=["Orientación"],Pa=["Recortar"],Ea=["Rotar"],Ta=["Zoom"],za=["Deseño"],La=["Texto"],Ma=["Avisos"],Da=["Compensación"],Ia=["Entradas"],Na=["Páxinas"],$a=["Sen categoría"],Ra=["Branco"],Oa=["Negro"],Ba=["Superíndice"],Fa=["Subíndice"],Ua=["Padróns"],Ha=["Tipografía"],Wa=["Contido"],Va=["Menú"],Ga=["Contacto"],Ya=["Acerca de"],ja=["Inicio"],Xa=["Usuario"],Ja=["Sitio"],_a=["Creando"],Qa=["Escritorio"],Ka=["Móbil"],Za=["Tableta"],et=["enquisa"],ot=["social"],at=["Sólido"],tt=["Tipo"],st=["Ángulo"],it=["Elixir"],nt=["Tema"],rt=["Baleiro"],dt=["Botóns"],lt=["Fondo"],ct=["Axuda"],ut=["Sen título"],pt=["Seguinte"],mt=["Anterior"],bt=["Finalizar"],ht=["Substituír"],gt=["insertador"],vt=["podcast"],ft=["Navegación"],yt=["Modelo"],kt=["Degradado"],wt=["Medianoite"],xt=["Versión"],At=["Dimensións"],qt=["Modelos"],St=["Engadir"],Ct=["Cor"],Pt=["Personalizado"],Et=["Borrador"],Tt=["Saltar"],zt=["Ligazóns"],Lt=["menú"],Mt=["Pé de páxina"],Dt=["Grupo"],It=["Taxonomía"],Nt=["Por defecto"],$t=["Buscar"],Rt=["Calendario"],Ot=["Voltar"],Bt=["ebook"],Ft=["subliñado"],Ut=["Miniatura"],Ht=["Notas"],Wt=["medios"],Vt=["Multimedia"],Gt=["Estilos"],Yt=["Xeral"],jt=["Opcións"],Xt=["Minutos"],Jt=["Horas"],_t=["Hora"],Qt=["Ano"],Kt=["Día"],Zt=["Decembro"],es=["Novembro"],os=["Outubro"],as=["Setembro"],ts=["Agosto"],ss=["Xullo"],is=["Xuño"],ns=["Maio"],rs=["Abril"],ds=["Marzo"],ls=["Febreiro"],cs=["Xaneiro"],us=["Mes"],ps=["Portada"],ms=["Enorme"],bs=["Medio"],hs=["Normal"],gs=["Termos"],vs=["Avatar"],fs=[],ys=["Ver"],ks=["HTML"],ws=["Superposición"],xs=["Acento grave"],As=["Período"],qs=["Coma"],Ss=["Actual"],Cs=["Título"],Ps=["Crear"],Es=["Galerías"],Ts=["XL"],zs=["L"],Ls=["M"],Ms=["S"],Ds=["Pequeno"],Is=["Apagado"],Ns=["Auto"],$s=["Precargar"],Rs=["Soporte"],Os=["Histórico"],Bs=["Grande"],Fs=["Ficheiro "],Us=["Columna"],Hs=["Bucle"],Ws=["Reprodución automática"],Vs=["Gardando automaticamente"],Gs=["Subcabeceira"],Ys=["Aceptar"],js=["Desfacer a ligazón"],Xs=["Paxinación"],Js=["Altura"],_s=["Anchura"],Qs=["Avanzado"],Ks=["Programado"],Zs=["Plugins"],ei=["Párrafos"],oi=["Títulos"],ai=["Palabras:"],ti=["Público"],si=["Privado"],ii=["Termo"],ni=["Etiqueta"],ri=["Inmediatamente"],di=["Gardando"],li=["Publicado"],ci=["Programar"],ui=["Actualizar"],pi=["Copiar"],mi=["Chat"],bi=["Estado "],hi=["Estándar "],gi=["Minientrada"],vi=["Orde"],fi=["Gardado"],yi=["Incrustados"],ki=["Bloques"],wi=["Desfacer"],xi=["Refacer"],Ai=["Duplicar"],qi=["Eliminar"],Si=["Visibilidade"],Ci=["Bloque "],Pi=["Documento"],Ei=["Ferramentas "],Ti=["Editor"],zi=["Configuración"],Li=["Restablecer"],Mi=["Desactivado"],Di=["PM"],Ii=["AM"],Ni=["URL"],$i=["Enviar"],Ri=["Pechar"],Oi=["Ligazón"],Bi=["Riscado"],Fi=["Cursiva"],Ui=["Negra"],Hi=["Categoría"],Wi=["Seleccionar"],Vi=["Vídeo"],Gi=["Escribir"],Yi=["Táboa "],ji=["Shortcode"],Xi=["Separador"],Ji=["Cita"],_i=["Parágrafo"],Qi=["Lista"],Ki=["foto "],Zi=["Tamaño"],en=["Imaxe"],on=["Previsualizar"],an=["Título"],tn=["Imaxes"],sn=["Ningún"],nn=["Galeria"],rn=["Máis"],dn=["Clásico "],ln=["vídeo"],cn=["audio"],un=["música"],pn=["imaxe"],mn=["blog"],bn=["entrada"],hn=["Columnas"],gn=["Experimentos"],vn=["Código"],fn=["Categorías"],yn=["Botón"],kn=["Aplicar"],wn=["Cancelar"],xn=["Editar"],An=["Audio"],qn=["Limpar"],Sn=["Widgets"],Cn=["Autores"],Pn=["Slug"],En=["Comentario"],Tn=["Comentarios"],zn=["Extracto"],Ln=["Publicar"],Mn=["Metadatos"],Dn=["Gardar"],In=["Revisións"],Nn=["Documentación"],$n=["Gutenberg"],Rn=["Demo"],On={100:["100"],"Bebo Valdés":["Bebo Valdés"],"Betty Carter":["Betty Carter"],"Jaco Pastorius":["Jaco Pastorius"],"Julio Cortázar":["Julio Cortázar"],"Cannot inherit the current template query when placed inside the singular content (e.g., post, page, 404, blank).":[],"Snow Patrol":["Snow Patrol"],"Only include headings up to and including this level.":[],"Including all heading levels in the table of contents.":[],"All levels":["Todos os niveis"],"Include headings down to level":["Inclúe títulos ata o nivel"],"Limit heading levels":["Niveis límite dos títulos"],"Paste the copied style to the selected block(s).":["Pega o estilo copiado ao(s) bloque(s) seleccionado(s)."],"Only visible to those who know the password.":["Só visible para quen coñeza o contrasinal."],"Show or hide the Settings panel":["Amosa ou oculta o panel de axustes"],"The theme you are currently using does not support this screen.":["O tema que estás a usar non é compatible con esta pantalla."],"A list of allowed area values for template parts.":["Unha lista dos valores de área permitidos para as partes do modelo."],"A list of default template types.":["Unha lista de tipos de modelo por defecto."],"Only one file can be used here.":["Aquí só pode usarse un arquivo."],"panel button labelSettings":["Axustes"],"noun, panelDocument":["Documento"],"This change will affect other parts of your site that use this template.":["Este cambio afectará a outras partes do teu sitio que usan este modelo."],"The requested page could not be found. Please check the URL.":["A páxina solicitada non se atopou. Por favor, verifica a URL."],"Muted because of Autoplay.":["Silenciado por causa da reprodución automática."],"Descending by order":["Descendente por orde"],"Ascending by order":["Ascendente por orde"],Cut:e,"Paste the selected block(s).":["Pega o(s) bloque(s) seleccionado(s)."],"Cut the selected block(s).":["Corta o(s) bloque(s) seleccionado(s)."],"Copy the selected block(s).":["Copia o(s) bloque(s) seleccionado(s)."],"Displays the %s post format archive.":["Mostra o arquivo do formato de entrada %s."],"Template namePost Format: %s":["Formato de entrada: %s"],Ignore:o,"Whether to ignore sticky posts or not.":["Ignorar ou non as entradas fixas."],"Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users.":[],"Global Styles pagination":["Paxinación dos estilos globais"],"Previous Post":["Entrada anterior"],"Next Post":["Seguinte entrada"],"Example link text for Navigation SubmenuAbout":["Acerca de"],"%s menu":["Menú %s"],"Enables multiple Details blocks with the same name attribute to be connected, with only one open at a time.":["Permite conectar varios bloques de detalles co mesmo atributo de nome, con só un aberto a un tempo."],"Name attribute":["Atributo de nome"],"The