From 7ab31c53a8dd2f6a5ebc587d356da608657ecea6 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Tue, 21 Jan 2025 16:04:39 -0500 Subject: [PATCH 01/10] feat: Add rudimentary error boundary Catch render errors with Gutenberg's default error boundary component. --- src/components/editor/index.jsx | 56 +++++++++++++------------ src/components/visual-editor/style.scss | 8 ++++ 2 files changed, 37 insertions(+), 27 deletions(-) diff --git a/src/components/editor/index.jsx b/src/components/editor/index.jsx index 9481586e..3d750a13 100644 --- a/src/components/editor/index.jsx +++ b/src/components/editor/index.jsx @@ -4,7 +4,7 @@ import { useEntityBlockEditor } from '@wordpress/core-data'; import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; import { useSelect } from '@wordpress/data'; -import { store as editorStore } from '@wordpress/editor'; +import { store as editorStore, ErrorBoundary } from '@wordpress/editor'; /** * Internal dependencies @@ -64,33 +64,35 @@ export default function Editor({ post, children }) { }, []); return ( -
- - - {mode === 'visual' && isRichEditingEnabled && ( - - )} + +
+ + + {mode === 'visual' && isRichEditingEnabled && ( + + )} - {(mode === 'text' || !isRichEditingEnabled) && ( - - )} + {(mode === 'text' || !isRichEditingEnabled) && ( + + )} - {children} - -
+ {children} +
+
+ ); } diff --git a/src/components/visual-editor/style.scss b/src/components/visual-editor/style.scss index 65d29525..bb141692 100644 --- a/src/components/visual-editor/style.scss +++ b/src/components/visual-editor/style.scss @@ -63,3 +63,11 @@ padding: 0; margin: 0; } + +// TODO: Styles improving small-screen layout. Ideally we instead improve +// Gutenberg itself or implement our own error boudnary--including matching copy +// content/error functionality. +.editor-error-boundary { + margin-left: 16px; + margin-right: 16px; +} From 6298ae8a7c3fa3aadd551b598669f02010feaa8b Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 22 Jan 2025 09:28:07 -0500 Subject: [PATCH 02/10] feat: Log render errors to the host app Allow the host app to act on errors. --- src/components/editor/index.jsx | 2 ++ .../editor/use-host-error-logging.js | 20 +++++++++++++++++++ src/utils/bridge.js | 18 +++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 src/components/editor/use-host-error-logging.js diff --git a/src/components/editor/index.jsx b/src/components/editor/index.jsx index 3d750a13..7ec2f409 100644 --- a/src/components/editor/index.jsx +++ b/src/components/editor/index.jsx @@ -14,6 +14,7 @@ import EditorLoadNotice from '../editor-load-notice'; import './style.scss'; import { useSyncHistoryControls } from './use-sync-history-controls'; import { useHostBridge } from './use-host-bridge'; +import { useHostErrorLogging } from './use-host-error-logging'; import { useEditorSetup } from './use-editor-setup'; import { useMediaUpload } from './use-media-upload'; import { useGBKitSettings } from './use-gbkit-settings'; @@ -40,6 +41,7 @@ const { ExperimentalBlockEditorProvider: BlockEditorProvider } = unlock( export default function Editor({ post, children }) { useSyncHistoryControls(); useHostBridge(post); + useHostErrorLogging(); useEditorSetup(post); useMediaUpload(); diff --git a/src/components/editor/use-host-error-logging.js b/src/components/editor/use-host-error-logging.js new file mode 100644 index 00000000..58e35454 --- /dev/null +++ b/src/components/editor/use-host-error-logging.js @@ -0,0 +1,20 @@ +/** + * WordPress dependencies + */ +import { useEffect } from '@wordpress/element'; +import { addAction, removeAction } from '@wordpress/hooks'; + +/** + * Internal dependencies + */ +import { logError } from '../../utils/bridge'; + +export function useHostErrorLogging() { + useEffect(() => { + addAction('editor.ErrorBoundary.errorLogged', 'GutenbergKit', logError); + + return () => { + removeAction('editor.ErrorBoundary.errorLogged', 'GutenbergKit'); + }; + }, []); +} diff --git a/src/utils/bridge.js b/src/utils/bridge.js index 9e7e3bc1..98b7371e 100644 --- a/src/utils/bridge.js +++ b/src/utils/bridge.js @@ -174,3 +174,21 @@ export function getPost() { id: -1, }; } + +/** + * Logs an error to the host app. + * + * @param {Error} error - The error object to be logged. + */ +export function logError(error) { + if (window.editorDelegate) { + window.editorDelegate.logError(error); + } + + if (window.webkit) { + window.webkit.messageHandlers.editorDelegate.postMessage({ + message: 'logError', + body: { error: error.message }, + }); + } +} From 4899f41a30c4728f9459e10a3ebb0fd14dd47ed5 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 22 Jan 2025 12:51:04 -0500 Subject: [PATCH 03/10] feat: Log error details to iOS host app Allow the iOS host app to act on errors. --- .../GutenbergKit/Sources/EditorJSMessage.swift | 10 ++++++++++ .../Sources/EditorViewController.swift | 4 ++++ .../Sources/EditorViewControllerDelegate.swift | 11 +++++++++++ src/utils/bridge.js | 14 +++++++++++--- 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/ios/Sources/GutenbergKit/Sources/EditorJSMessage.swift b/ios/Sources/GutenbergKit/Sources/EditorJSMessage.swift index 7a0e5b72..4bcb65fd 100644 --- a/ios/Sources/GutenbergKit/Sources/EditorJSMessage.swift +++ b/ios/Sources/GutenbergKit/Sources/EditorJSMessage.swift @@ -29,6 +29,8 @@ struct EditorJSMessage { case onEditorContentChanged /// The editor history (undo, redo) changed. case onEditorHistoryChanged + /// The editor logged an error + case onEditorErrorLogged /// The user tapped the inserter button. case showBlockPicker /// User requested the Media Library @@ -43,4 +45,12 @@ struct EditorJSMessage { let hasUndo: Bool let hasRedo: Bool } + + struct DidLogErrorBody: Decodable { + let message: String + let stack: String + let sourceURL: String + let line: Int + let column: Int + } } diff --git a/ios/Sources/GutenbergKit/Sources/EditorViewController.swift b/ios/Sources/GutenbergKit/Sources/EditorViewController.swift index 2f599691..373a913e 100644 --- a/ios/Sources/GutenbergKit/Sources/EditorViewController.swift +++ b/ios/Sources/GutenbergKit/Sources/EditorViewController.swift @@ -309,6 +309,10 @@ public final class EditorViewController: UIViewController, GutenbergEditorContro self.state.hasUndo = body.hasUndo self.state.hasRedo = body.hasRedo delegate?.editor(self, didUpdateHistoryState: state) + case .onEditorErrorLogged: + let error = try message.decode(EditorJSMessage.DidLogErrorBody.self) + let editorError: EditorError = .init(message: error.message, stack: error.stack, sourceURL: error.sourceURL, line: error.line, column: error.column) + delegate?.editor(self, didLogError: editorError) case .showBlockPicker: showBlockInserter() case .openMediaLibrary: diff --git a/ios/Sources/GutenbergKit/Sources/EditorViewControllerDelegate.swift b/ios/Sources/GutenbergKit/Sources/EditorViewControllerDelegate.swift index 99829e48..d9e2de24 100644 --- a/ios/Sources/GutenbergKit/Sources/EditorViewControllerDelegate.swift +++ b/ios/Sources/GutenbergKit/Sources/EditorViewControllerDelegate.swift @@ -27,6 +27,9 @@ public protocol EditorViewControllerDelegate: AnyObject { /// Notifies the client about new history state. func editor(_ viewController: EditorViewController, didUpdateHistoryState state: EditorState) + /// Notifies the client about an error that occurred during the editor + func editor(_ viewController: EditorViewController, didLogError error: EditorError) + func editor(_ viewController: EditorViewController, didRequestMediaFromSiteMediaLibrary config: OpenMediaLibraryAction) } @@ -39,6 +42,14 @@ public struct EditorState { public var hasRedo = false } +public struct EditorError { + public let message: String + public let stack: String + public let sourceURL: String + public let line: Int + public let column: Int +} + public struct OpenMediaLibraryAction: Codable { public let allowedTypes: [MediaType]? public let multiple: Bool diff --git a/src/utils/bridge.js b/src/utils/bridge.js index 98b7371e..624627fd 100644 --- a/src/utils/bridge.js +++ b/src/utils/bridge.js @@ -181,14 +181,22 @@ export function getPost() { * @param {Error} error - The error object to be logged. */ export function logError(error) { + const errorDetails = { + message: error.message, + stack: error.stack, + line: error.line, + column: error.column, + sourceURL: error.sourceURL, + }; + if (window.editorDelegate) { - window.editorDelegate.logError(error); + window.editorDelegate.onEditorErrorLogged(JSON.stringify(errorDetails)); } if (window.webkit) { window.webkit.messageHandlers.editorDelegate.postMessage({ - message: 'logError', - body: { error: error.message }, + message: 'onEditorErrorLogged', + body: errorDetails, }); } } From ed19c6f2fa8c9f6760c5297818859ecc76684a34 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Fri, 24 Jan 2025 17:10:31 -0500 Subject: [PATCH 04/10] feat: Parse errors Extract relevant attributes for logging to monitoring services. --- .../Sources/EditorJSMessage.swift | 10 +- .../Sources/EditorViewController.swift | 9 +- .../EditorViewControllerDelegate.swift | 54 +++++++- .../editor/use-host-error-logging.js | 13 +- src/utils/bridge.js | 42 ++++-- src/utils/parse-exception.js | 101 ++++++++++++++ src/utils/stack-parsers.js | 126 ++++++++++++++++++ 7 files changed, 323 insertions(+), 32 deletions(-) create mode 100644 src/utils/parse-exception.js create mode 100644 src/utils/stack-parsers.js diff --git a/ios/Sources/GutenbergKit/Sources/EditorJSMessage.swift b/ios/Sources/GutenbergKit/Sources/EditorJSMessage.swift index 4bcb65fd..0c70579a 100644 --- a/ios/Sources/GutenbergKit/Sources/EditorJSMessage.swift +++ b/ios/Sources/GutenbergKit/Sources/EditorJSMessage.swift @@ -30,7 +30,7 @@ struct EditorJSMessage { /// The editor history (undo, redo) changed. case onEditorHistoryChanged /// The editor logged an error - case onEditorErrorLogged + case onEditorExceptionLogged /// The user tapped the inserter button. case showBlockPicker /// User requested the Media Library @@ -45,12 +45,4 @@ struct EditorJSMessage { let hasUndo: Bool let hasRedo: Bool } - - struct DidLogErrorBody: Decodable { - let message: String - let stack: String - let sourceURL: String - let line: Int - let column: Int - } } diff --git a/ios/Sources/GutenbergKit/Sources/EditorViewController.swift b/ios/Sources/GutenbergKit/Sources/EditorViewController.swift index 373a913e..e901a738 100644 --- a/ios/Sources/GutenbergKit/Sources/EditorViewController.swift +++ b/ios/Sources/GutenbergKit/Sources/EditorViewController.swift @@ -309,10 +309,11 @@ public final class EditorViewController: UIViewController, GutenbergEditorContro self.state.hasUndo = body.hasUndo self.state.hasRedo = body.hasRedo delegate?.editor(self, didUpdateHistoryState: state) - case .onEditorErrorLogged: - let error = try message.decode(EditorJSMessage.DidLogErrorBody.self) - let editorError: EditorError = .init(message: error.message, stack: error.stack, sourceURL: error.sourceURL, line: error.line, column: error.column) - delegate?.editor(self, didLogError: editorError) + case .onEditorExceptionLogged: + let editorError = GutenbergJSException(from: message.body as! [AnyHashable : Any]) + if let editorError = editorError { + delegate?.editor(self, didLogException: editorError) + } case .showBlockPicker: showBlockInserter() case .openMediaLibrary: diff --git a/ios/Sources/GutenbergKit/Sources/EditorViewControllerDelegate.swift b/ios/Sources/GutenbergKit/Sources/EditorViewControllerDelegate.swift index d9e2de24..674a4a75 100644 --- a/ios/Sources/GutenbergKit/Sources/EditorViewControllerDelegate.swift +++ b/ios/Sources/GutenbergKit/Sources/EditorViewControllerDelegate.swift @@ -28,7 +28,7 @@ public protocol EditorViewControllerDelegate: AnyObject { func editor(_ viewController: EditorViewController, didUpdateHistoryState state: EditorState) /// Notifies the client about an error that occurred during the editor - func editor(_ viewController: EditorViewController, didLogError error: EditorError) + func editor(_ viewController: EditorViewController, didLogException error: GutenbergJSException) func editor(_ viewController: EditorViewController, didRequestMediaFromSiteMediaLibrary config: OpenMediaLibraryAction) } @@ -42,12 +42,54 @@ public struct EditorState { public var hasRedo = false } -public struct EditorError { +// Definition of JavaScript exception, which will be used to +// log exception to the Crash Logging service. +public struct GutenbergJSException { + public let type: String public let message: String - public let stack: String - public let sourceURL: String - public let line: Int - public let column: Int + public let stacktrace: [StacktraceLine] + public let context: [String: Any] + public let tags: [String: String] + public let isHandled: Bool + public let handledBy: String + + public struct StacktraceLine { + public let filename: String? + public let function: String + public let lineno: NSNumber? + public let colno: NSNumber? + + init?(from dict: [AnyHashable: Any]) { + guard let function = dict["function"] as? String else { + return nil + } + self.filename = dict["filename"] as? String + self.function = function + self.lineno = dict["lineno"] as? NSNumber + self.colno = dict["colno"] as? NSNumber + } + } + + init?(from dict: [AnyHashable: Any]) { + guard let type = dict["type"] as? String, + let message = dict["message"] as? String, + let rawStacktrace = dict["stacktrace"] as? [[AnyHashable: Any]], + let context = dict["context"] as? [String: Any], + let tags = dict["tags"] as? [String: String], + let isHandled = dict["isHandled"] as? Bool, + let handledBy = dict["handledBy"] as? String + else { + return nil + } + + self.type = type + self.message = message + self.stacktrace = rawStacktrace.compactMap { StacktraceLine(from: $0) } + self.context = context + self.tags = tags + self.isHandled = isHandled + self.handledBy = handledBy + } } public struct OpenMediaLibraryAction: Codable { diff --git a/src/components/editor/use-host-error-logging.js b/src/components/editor/use-host-error-logging.js index 58e35454..5652eb57 100644 --- a/src/components/editor/use-host-error-logging.js +++ b/src/components/editor/use-host-error-logging.js @@ -7,11 +7,20 @@ import { addAction, removeAction } from '@wordpress/hooks'; /** * Internal dependencies */ -import { logError } from '../../utils/bridge'; +import { logException } from '../../utils/bridge'; export function useHostErrorLogging() { useEffect(() => { - addAction('editor.ErrorBoundary.errorLogged', 'GutenbergKit', logError); + addAction( + 'editor.ErrorBoundary.errorLogged', + 'GutenbergKit', + (error) => { + logException(error, { + isHandled: true, + handledBy: 'editor.ErrorBoundary.errorLogged', + }); + } + ); return () => { removeAction('editor.ErrorBoundary.errorLogged', 'GutenbergKit'); diff --git a/src/utils/bridge.js b/src/utils/bridge.js index 624627fd..1fd1e331 100644 --- a/src/utils/bridge.js +++ b/src/utils/bridge.js @@ -1,3 +1,8 @@ +/** + * Internal dependencies + */ +import parseException from './parse-exception'; + /** * Notifies the native host that the editor has loaded. * @@ -178,25 +183,40 @@ export function getPost() { /** * Logs an error to the host app. * - * @param {Error} error - The error object to be logged. + * @param {Error} error The error object to be logged. + * @param {Object} [options] Additional options. + * @param {Object} [options.context] Additional context to be logged. + * @param {Object} [options.tags] Additional tags to be logged. + * @param {boolean} [options.isHandled=false] Whether the error is handled. + * @param {string} [options.handledBy='Unknown'] The name of the error handler. + * + * @return {void} */ -export function logError(error) { - const errorDetails = { - message: error.message, - stack: error.stack, - line: error.line, - column: error.column, - sourceURL: error.sourceURL, +export function logException( + error, + { context, tags, isHandled, handledBy } = { + context: {}, + tags: {}, + isHandled: false, + handledBy: 'Unknown', + } +) { + const parsedException = { + ...parseException(error, { context, tags }), + isHandled, + handledBy, }; if (window.editorDelegate) { - window.editorDelegate.onEditorErrorLogged(JSON.stringify(errorDetails)); + window.editorDelegate.onEditorExceptionLogged( + JSON.stringify(parsedException) + ); } if (window.webkit) { window.webkit.messageHandlers.editorDelegate.postMessage({ - message: 'onEditorErrorLogged', - body: errorDetails, + message: 'onEditorExceptionLogged', + body: parsedException, }); } } diff --git a/src/utils/parse-exception.js b/src/utils/parse-exception.js new file mode 100644 index 00000000..47edd113 --- /dev/null +++ b/src/utils/parse-exception.js @@ -0,0 +1,101 @@ +/** + * Internal dependencies + */ +import { version as gbkVersion } from '../../package.json'; +import { chromeStackParser, geckoStackParser } from './stack-parsers'; + +// The stack trace is limited to prevent crash logging service fail processing the exception. +const STACKTRACE_LIMIT = 50; + +const stackParsers = [chromeStackParser, geckoStackParser]; + +// Based on function `createStackParser` and `parseStackFrames` of Sentry JavaScript SDK: +// - https://github.com/getsentry/sentry-javascript/blob/de681dcf7d6dac69da9374bbdbe2e2f7e00f0fdc/packages/utils/src/stacktrace.ts#L16-L59 +// - https://github.com/getsentry/sentry-javascript/blob/de681dcf7d6dac69da9374bbdbe2e2f7e00f0fdc/packages/browser/src/eventbuilder.ts#L100-L118 +// And function `stripSentryFramesAndReverse` of Sentry React Native SDK: +// https://github.com/getsentry/sentry-javascript/blob/de681dcf7d6dac69da9374bbdbe2e2f7e00f0fdc/packages/utils/src/stacktrace.ts#L80-L117 +const parseStacktrace = (exception) => { + const plainStacktrace = exception.stacktrace || exception.stack || ''; + const frames = []; + const lines = plainStacktrace.split('\n'); + + for (let i = 0; i < lines.length; i++) { + const line = lines[i]; + // Ignore lines over 1kb as they are unlikely to be valid frames. + if (line.length > 1024) { + continue; + } + + // Skip error message lines. + if (line.match(/\S*Error: /)) { + continue; + } + + for (const parser of stackParsers) { + const entry = parser(line); + + if (entry) { + frames.push(entry); + break; + } + } + + if (frames.length >= STACKTRACE_LIMIT) { + break; + } + } + + const reverseFrames = Array.from(frames).reverse(); + + return reverseFrames.slice(0, STACKTRACE_LIMIT).map((entry) => ({ + ...entry, + filename: + entry.filename || reverseFrames[reverseFrames.length - 1].filename, + })); +}; + +// Based on function `extractMessage` of Sentry JavaScript SDK: +// https://github.com/getsentry/sentry-javascript/blob/de681dcf7d6dac69da9374bbdbe2e2f7e00f0fdc/packages/browser/src/eventbuilder.ts#L142-L151 +const extractMessage = (exception) => { + const message = exception?.message; + if (!message) { + return 'No error message'; + } + if (typeof message.error?.message === 'string') { + return message.error.message; + } + return message; +}; + +// Based on function `exceptionFromError` of Sentry JavaScript SDK: +// https://github.com/getsentry/sentry-javascript/blob/de681dcf7d6dac69da9374bbdbe2e2f7e00f0fdc/packages/browser/src/eventbuilder.ts#L31-L49 +const parseException = (originalException) => { + const exception = { + type: originalException?.name, + message: extractMessage(originalException), + }; + + const stacktrace = parseStacktrace(originalException); + if (stacktrace.length) { + exception.stacktrace = stacktrace; + } + + if (exception.type === undefined && exception.message === '') { + exception.message = 'Unknown error'; + } + + return exception; +}; + +export default (exception, { context, tags } = {}) => { + return { + ...parseException(exception), + context: { + ...context, + }, + tags: { + ...tags, + gutenberg_kit_version: gbkVersion, + }, + }; +}; diff --git a/src/utils/stack-parsers.js b/src/utils/stack-parsers.js new file mode 100644 index 00000000..5f3eec20 --- /dev/null +++ b/src/utils/stack-parsers.js @@ -0,0 +1,126 @@ +// Copyright (c) 2012 Functional Software, Inc. dba Sentry +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +// of the Software, and to permit persons to whom the Software is furnished to do +// so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +const UNKNOWN_FUNCTION = '?'; + +function createFrame(filename, func, lineno, colno) { + const frame = { + filename, + function: func === '' ? UNKNOWN_FUNCTION : func, + in_app: true, // All browser frames are considered in_app + }; + + if (lineno !== undefined) { + frame.lineno = lineno; + } + + if (colno !== undefined) { + frame.colno = colno; + } + + return frame; +} + +// This regex matches frames that have no function name (ie. are at the top level of a module). +// For example "at http://localhost:5000//script.js:1:126" +// Frames _with_ function names usually look as follows: "at commitLayoutEffects (react-dom.development.js:23426:1)" +const chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i; + +// This regex matches all the frames that have a function name. +const chromeRegex = + /^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i; + +const chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/; + +// Chromium based browsers: Chrome, Brave, new Opera, new Edge +// We cannot call this variable `chrome` because it can conflict with global `chrome` variable in certain environments +// See: https://github.com/getsentry/sentry-javascript/issues/6880 +export const chromeStackParser = (line) => { + // If the stack line has no function name, we need to parse it differently + const noFnParts = chromeRegexNoFnName.exec(line); + + if (noFnParts) { + const [, filename, _line, col] = noFnParts; + return createFrame(filename, UNKNOWN_FUNCTION, +_line, +col); + } + + const parts = chromeRegex.exec(line); + + if (parts) { + const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line + + if (isEval) { + const subMatch = chromeEvalRegex.exec(parts[2]); + + if (subMatch) { + // throw out eval line/column and use top-most line/column number + parts[2] = subMatch[1]; // url + parts[3] = subMatch[2]; // line + parts[4] = subMatch[3]; // column + } + } + + const func = parts[1] || UNKNOWN_FUNCTION; + const filename = parts[2]; + + return createFrame( + filename, + func, + parts[3] ? +parts[3] : undefined, + parts[4] ? +parts[4] : undefined + ); + } +}; + +// gecko regex: `(?:bundle|\d+\.js)`: `bundle` is for react native, `\d+\.js` also but specifically for ram bundles because it +// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js +// We need this specific case for now because we want no other regex to match. +const geckoREgex = + /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i; +const geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i; + +export const geckoStackParser = (line) => { + const parts = geckoREgex.exec(line); + + if (parts) { + const isEval = parts[3] && parts[3].indexOf(' > eval') > -1; + if (isEval) { + const subMatch = geckoEvalRegex.exec(parts[3]); + + if (subMatch) { + // throw out eval line/column and use top-most line number + parts[1] = parts[1] || 'eval'; + parts[3] = subMatch[1]; + parts[4] = subMatch[2]; + parts[5] = ''; // no column when eval + } + } + + const filename = parts[3]; + const func = parts[1] || UNKNOWN_FUNCTION; + + return createFrame( + filename, + func, + parts[4] ? +parts[4] : undefined, + parts[5] ? +parts[5] : undefined + ); + } +}; From 7cfd6a87cb3704fa8a79d1dc7e91dc5ab9b16642 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Sat, 25 Jan 2025 13:26:27 -0500 Subject: [PATCH 05/10] refactor: Hoist error boundary into layout component Catch errors within the editor component. --- src/components/editor/index.jsx | 56 ++++++++++++++++----------------- src/components/layout.jsx | 26 +++++++++++++++ src/index.jsx | 8 ++--- src/remote.jsx | 4 +-- 4 files changed, 58 insertions(+), 36 deletions(-) create mode 100644 src/components/layout.jsx diff --git a/src/components/editor/index.jsx b/src/components/editor/index.jsx index 7ec2f409..582d33cb 100644 --- a/src/components/editor/index.jsx +++ b/src/components/editor/index.jsx @@ -4,7 +4,7 @@ import { useEntityBlockEditor } from '@wordpress/core-data'; import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; import { useSelect } from '@wordpress/data'; -import { store as editorStore, ErrorBoundary } from '@wordpress/editor'; +import { store as editorStore } from '@wordpress/editor'; /** * Internal dependencies @@ -66,35 +66,33 @@ export default function Editor({ post, children }) { }, []); return ( - -
- - - {mode === 'visual' && isRichEditingEnabled && ( - - )} +
+ + + {mode === 'visual' && isRichEditingEnabled && ( + + )} - {(mode === 'text' || !isRichEditingEnabled) && ( - - )} + {(mode === 'text' || !isRichEditingEnabled) && ( + + )} - {children} - -
- + {children} +
+
); } diff --git a/src/components/layout.jsx b/src/components/layout.jsx new file mode 100644 index 00000000..1ad363f4 --- /dev/null +++ b/src/components/layout.jsx @@ -0,0 +1,26 @@ +/** + * WordPress dependencies + */ +import { EditorSnackbars, ErrorBoundary } from '@wordpress/editor'; + +/** + * Internal dependencies + */ +import Editor from './editor'; + +/** + * Top-level layout, including the Editor component wrapped in an ErrorBoundary. + * + * @param {Object} props The settings passed along to the Editor component. + * + * @return {JSX.Element} The rendered Layout component. + */ +export default function Layout(props) { + return ( + + + + + + ); +} diff --git a/src/index.jsx b/src/index.jsx index 7365a083..48cc027f 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -4,7 +4,7 @@ import { createRoot, StrictMode } from '@wordpress/element'; import apiFetch from '@wordpress/api-fetch'; import { dispatch } from '@wordpress/data'; -import { store as editorStore, EditorSnackbars } from '@wordpress/editor'; +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'; @@ -13,7 +13,7 @@ import defaultEditorStyles from '@wordpress/block-editor/build-style/default-edi */ import { initializeApiFetch } from './utils/api-fetch-setup'; import { getGBKit, getPost } from './utils/bridge'; -import Editor from './components/editor'; +import Layout from './components/layout'; import './index.scss'; window.GBKit = getGBKit(); @@ -49,9 +49,7 @@ function initializeEditor() { createRoot(document.getElementById('root')).render( - - - + ); } diff --git a/src/remote.jsx b/src/remote.jsx index dbfa9a7f..554f9fdb 100644 --- a/src/remote.jsx +++ b/src/remote.jsx @@ -52,10 +52,10 @@ async function initalizeRemoteEditor() { const post = getPost(); const settings = { post }; - const { default: Editor } = await import('./components/editor'); + const { default: Layout } = await import('./components/layout'); const { createRoot, createElement, StrictMode } = window.wp.element; createRoot(document.getElementById('root')).render( - createElement(StrictMode, null, createElement(Editor, settings)) + createElement(StrictMode, null, createElement(Layout, settings)) ); } catch (error) { // Fallback to the local editor and display a notice. Because the remote From c7cb2693ac91078cabbc15b806372e0742e69756 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 27 Jan 2025 14:59:35 -0500 Subject: [PATCH 06/10] build: Add Gson Enable parsing stringified JSON objects sent from WebViews to the host Android app. --- android/Gutenberg/build.gradle.kts | 1 + android/gradle/libs.versions.toml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/android/Gutenberg/build.gradle.kts b/android/Gutenberg/build.gradle.kts index cde133ad..719310af 100644 --- a/android/Gutenberg/build.gradle.kts +++ b/android/Gutenberg/build.gradle.kts @@ -49,6 +49,7 @@ dependencies { implementation(libs.androidx.appcompat) implementation(libs.material) implementation(libs.androidx.webkit) + implementation(libs.gson) testImplementation(libs.junit) androidTestImplementation(libs.androidx.junit) diff --git a/android/gradle/libs.versions.toml b/android/gradle/libs.versions.toml index badb6aee..d044afaa 100644 --- a/android/gradle/libs.versions.toml +++ b/android/gradle/libs.versions.toml @@ -10,6 +10,7 @@ material = "1.12.0" activity = "1.9.0" constraintlayout = "2.1.4" webkit = "1.11.0" +gson = "2.8.9" [libraries] androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } @@ -21,6 +22,7 @@ material = { group = "com.google.android.material", name = "material", version.r androidx-activity = { group = "androidx.activity", name = "activity", version.ref = "activity" } androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" } androidx-webkit = { group = "androidx.webkit", name = "webkit", version.ref = "webkit" } +gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" } [plugins] android-application = { id = "com.android.application", version.ref = "agp" } From 0ba22abab1d0ba0a48449c6e9bcf1280e6abee24 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 27 Jan 2025 15:29:28 -0500 Subject: [PATCH 07/10] feat: Add logic for logging exceptions to Android host Enable the Android host app to act upon editor exceptions. --- .../gutenberg/GutenbergJsException.kt | 66 +++++++++++++++++++ .../org/wordpress/gutenberg/GutenbergView.kt | 15 +++++ 2 files changed, 81 insertions(+) create mode 100644 android/Gutenberg/src/main/java/org/wordpress/gutenberg/GutenbergJsException.kt diff --git a/android/Gutenberg/src/main/java/org/wordpress/gutenberg/GutenbergJsException.kt b/android/Gutenberg/src/main/java/org/wordpress/gutenberg/GutenbergJsException.kt new file mode 100644 index 00000000..73655026 --- /dev/null +++ b/android/Gutenberg/src/main/java/org/wordpress/gutenberg/GutenbergJsException.kt @@ -0,0 +1,66 @@ +package org.wordpress.gutenberg + +import com.google.gson.Gson +import com.google.gson.JsonObject + +data class JsExceptionStackTraceElement ( + val fileName: String?, + val lineNumber: Int?, + val colNumber: Int?, + val function: String, +) +class GutenbergJsException ( + val type: String, + val message: String, + var stackTrace: List, + val context: Map = emptyMap(), + val tags: Map = emptyMap(), + val isHandled: Boolean, + val handledBy: String +) { + + companion object { + @JvmStatic + fun fromString(exceptionString: String): GutenbergJsException { + val gson = Gson() + val rawException = gson.fromJson(exceptionString, JsonObject::class.java) + + val type = rawException.get("type")?.asString ?: "" + val message = rawException.get("message")?.asString ?: "" + + val stackTrace = rawException.getAsJsonArray("stacktrace")?.map { element -> + val stackTraceElement = element.asJsonObject + val stackTraceFunction = stackTraceElement.get("function")?.asString + stackTraceFunction?.let { + JsExceptionStackTraceElement( + stackTraceElement.get("filename")?.asString, + stackTraceElement.get("lineno")?.asInt, + stackTraceElement.get("colno")?.asInt, + stackTraceFunction + ) + } + }?.filterNotNull() ?: emptyList() + + val context = rawException.getAsJsonObject("context")?.entrySet()?.associate { + it.key to it.value.asString + } ?: emptyMap() + + val tags = rawException.getAsJsonObject("tags")?.entrySet()?.associate { + it.key to it.value.asString + } ?: emptyMap() + + val isHandled = rawException.get("isHandled")?.asBoolean ?: false + val handledBy = rawException.get("handledBy")?.asString ?: "" + + return GutenbergJsException( + type, + message, + stackTrace, + context, + tags, + isHandled, + handledBy + ) + } + } +} 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 65042c66..ce78a3dd 100644 --- a/android/Gutenberg/src/main/java/org/wordpress/gutenberg/GutenbergView.kt +++ b/android/Gutenberg/src/main/java/org/wordpress/gutenberg/GutenbergView.kt @@ -56,6 +56,7 @@ class GutenbergView : WebView { private var historyChangeListener: HistoryChangeListener? = null private var openMediaLibraryListener: OpenMediaLibraryListener? = null private var editorDidBecomeAvailableListener: EditorAvailableListener? = null + private var logJsExceptionListener: LogJsExceptionListener? = null var textEditorEnabled: Boolean = false set(value) { @@ -78,6 +79,10 @@ class GutenbergView : WebView { openMediaLibraryListener = listener } + fun setLogJsExceptionListener(listener: LogJsExceptionListener) { + logJsExceptionListener = listener + } + fun setOnFileChooserRequestedListener(listener: (Intent, Int) -> Unit) { onFileChooserRequested = listener } @@ -305,6 +310,10 @@ class GutenbergView : WebView { fun onEditorAvailable(view: GutenbergView?) } + interface LogJsExceptionListener { + fun onLogJsException(exception: GutenbergJsException) + } + fun getTitleAndContent(callback: TitleAndContentCallback, clearFocus: Boolean = true) { if (!isEditorLoaded) { Log.e("GutenbergView", "You can't change the editor content until it has loaded") @@ -422,6 +431,12 @@ class GutenbergView : WebView { this.evaluateJavascript("editor.setMediaUploadAttachment($media);", null) } + @JavascriptInterface + fun onEditorExceptionLogged(exception: String) { + val parsedException = GutenbergJsException.fromString(exception) + logJsExceptionListener?.onLogJsException(parsedException) + } + @JavascriptInterface fun showBlockPicker() { Log.i("GutenbergView", "BlockPickerShouldShow") From ff7e97410c56dd54c145b4511752996d38f49a96 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 27 Jan 2025 15:39:20 -0500 Subject: [PATCH 08/10] task: Capture build output --- .../Gutenberg/assets/index-CVihFZVi.js | 830 ++++++++++++++++++ .../Gutenberg/assets/index-CkUrYNsQ.css | 1 - .../Gutenberg/assets/index-DB9nabmU.js | 1 - ...{index-CTMt5Mdc.css => index-HX5OH3UO.css} | 2 +- .../Gutenberg/assets/index-eRoeZfC2.js | 814 ----------------- .../Gutenberg/assets/layout-6w9yLuYZ.css | 1 + .../Gutenberg/assets/layout-nZjJAiRL.js | 1 + .../Gutenberg/assets/remote-DNSCyFTM.js | 2 - .../Gutenberg/assets/remote-fhURWyNl.js | 3 + ios/Sources/GutenbergKit/Gutenberg/index.html | 4 +- .../GutenbergKit/Gutenberg/remote.html | 2 +- 11 files changed, 839 insertions(+), 822 deletions(-) create mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/index-CVihFZVi.js delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/index-CkUrYNsQ.css delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/index-DB9nabmU.js rename ios/Sources/GutenbergKit/Gutenberg/assets/{index-CTMt5Mdc.css => index-HX5OH3UO.css} (98%) delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/index-eRoeZfC2.js create mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/layout-6w9yLuYZ.css create mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/layout-nZjJAiRL.js delete mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/remote-DNSCyFTM.js create mode 100644 ios/Sources/GutenbergKit/Gutenberg/assets/remote-fhURWyNl.js diff --git a/ios/Sources/GutenbergKit/Gutenberg/assets/index-CVihFZVi.js b/ios/Sources/GutenbergKit/Gutenberg/assets/index-CVihFZVi.js new file mode 100644 index 00000000..e6b9387c --- /dev/null +++ b/ios/Sources/GutenbergKit/Gutenberg/assets/index-CVihFZVi.js @@ -0,0 +1,830 @@ +var Fwe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Hfn=Fwe((y2n,s4)=>{function $we(e,t){for(var n=0;no[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&o(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function o(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();var s1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Y5(e){if(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 X6={exports:{}},ug={},G6={exports:{}},In={};/** + * @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 hV;function Vwe(){if(hV)return In;hV=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(X){return X===null||typeof X!="object"?null:(X=p&&X[p]||X["@@iterator"],typeof X=="function"?X:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function O(X,Q,ne){this.props=X,this.context=Q,this.refs=g,this.updater=ne||b}O.prototype.isReactComponent={},O.prototype.setState=function(X,Q){if(typeof X!="object"&&typeof X!="function"&&X!=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,X,Q,"setState")},O.prototype.forceUpdate=function(X){this.updater.enqueueForceUpdate(this,X,"forceUpdate")};function v(){}v.prototype=O.prototype;function _(X,Q,ne){this.props=X,this.context=Q,this.refs=g,this.updater=ne||b}var A=_.prototype=new v;A.constructor=_,h(A,O.prototype),A.isPureReactComponent=!0;var M=Array.isArray,y=Object.prototype.hasOwnProperty,k={current:null},S={key:!0,ref:!0,__self:!0,__source:!0};function C(X,Q,ne){var ae,be={},re=null,de=null;if(Q!=null)for(ae in Q.ref!==void 0&&(de=Q.ref),Q.key!==void 0&&(re=""+Q.key),Q)y.call(Q,ae)&&!S.hasOwnProperty(ae)&&(be[ae]=Q[ae]);var le=arguments.length-2;if(le===1)be.children=ne;else if(1/g;function K6(e,t,n,o,r){return{element:e,tokenStart:t,tokenLength:n,prevOffset:o,leadingTextStart:r,children:[]}}const Gr=(e,t)=>{if(Yi=e,Ba=0,ed=[],Fu=[],Noe.lastIndex=0,!Xwe(t))throw new TypeError("The conversionMap provided is not valid. It must be an object with values that are React Elements");do;while(Gwe(t));return x.createElement(x.Fragment,null,...ed)},Xwe=e=>{const t=typeof e=="object",n=t&&Object.values(e);return t&&n.length&&n.every(o=>x.isValidElement(o))};function Gwe(e){const t=Kwe(),[n,o,r,s]=t,i=Fu.length,c=r>Ba?Ba:null;if(!e[o])return Y6(),!1;switch(n){case"no-more-tokens":if(i!==0){const{leadingTextStart:p,tokenStart:f}=Fu.pop();ed.push(Yi.substr(p,f))}return Y6(),!1;case"self-closed":return i===0?(c!==null&&ed.push(Yi.substr(c,r-c)),ed.push(e[o]),Ba=r+s,!0):(zV(K6(e[o],r,s)),Ba=r+s,!0);case"opener":return Fu.push(K6(e[o],r,s,r+s,c)),Ba=r+s,!0;case"closer":if(i===1)return Ywe(r),Ba=r+s,!0;const l=Fu.pop(),u=Yi.substr(l.prevOffset,r-l.prevOffset);l.children.push(u),l.prevOffset=r+s;const d=K6(l.element,l.tokenStart,l.tokenLength,r+s);return d.children=l.children,zV(d),Ba=r+s,!0;default:return Y6(),!1}}function Kwe(){const e=Noe.exec(Yi);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 Y6(){const e=Yi.length-Ba;e!==0&&ed.push(Yi.substr(Ba,e))}function zV(e){const{element:t,tokenStart:n,tokenLength:o,prevOffset:r,children:s}=e,i=Fu[Fu.length-1],c=Yi.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 Ywe(e){const{element:t,leadingTextStart:n,prevOffset:o,tokenStart:r,children:s}=Fu.pop(),i=e?Yi.substr(o,e-o):Yi.substr(o);i&&s.push(i),n!==null&&ed.push(Yi.substr(n,r-n)),ed.push(x.cloneElement(t,null,...s))}var Z6={exports:{}},H1={},Q6={exports:{}},J6={};/** + * @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 OV;function Zwe(){return OV||(OV=1,function(e){function t(F,U){var Z=F.length;F.push(U);e:for(;0>>1,Q=F[X];if(0>>1;Xr(be,Z))rer(de,be)?(F[X]=de,F[re]=Z,X=re):(F[X]=be,F[ae]=Z,X=ae);else if(rer(de,Z))F[X]=de,F[re]=Z,X=re;else break e}}return U}function r(F,U){var Z=F.sortIndex-U.sortIndex;return Z!==0?Z:F.id-U.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,O=typeof setTimeout=="function"?setTimeout:null,v=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 A(F){for(var U=n(u);U!==null;){if(U.callback===null)o(u);else if(U.startTime<=F)o(u),U.sortIndex=U.expirationTime,t(l,U);else break;U=n(u)}}function M(F){if(g=!1,A(F),!h)if(n(l)!==null)h=!0,j(y);else{var U=n(u);U!==null&&H(M,U.startTime-F)}}function y(F,U){h=!1,g&&(g=!1,v(C),C=-1),b=!0;var Z=f;try{for(A(U),p=n(l);p!==null&&(!(p.expirationTime>U)||F&&!E());){var X=p.callback;if(typeof X=="function"){p.callback=null,f=p.priorityLevel;var Q=X(p.expirationTime<=U);U=e.unstable_now(),typeof Q=="function"?p.callback=Q:p===n(l)&&o(l),A(U)}else o(l);p=n(l)}if(p!==null)var ne=!0;else{var ae=n(u);ae!==null&&H(M,ae.startTime-U),ne=!1}return ne}finally{p=null,f=Z,b=!1}}var k=!1,S=null,C=-1,R=5,T=-1;function E(){return!(e.unstable_now()-TF||125X?(F.sortIndex=Z,t(u,F),n(l)===null&&F===n(u)&&(g?(v(C),C=-1):g=!0,H(M,Z-X))):(F.sortIndex=Q,t(l,F),h||b||(h=!0,j(y))),F},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(F){var U=f;return function(){var Z=f;f=U;try{return F.apply(this,arguments)}finally{f=Z}}}}(J6)),J6}var yV;function Qwe(){return yV||(yV=1,Q6.exports=Zwe()),Q6.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 AV;function Jwe(){if(AV)return H1;AV=1;var e=Hz(),t=Qwe();function n(z){for(var w="https://reactjs.org/docs/error-decoder.html?invariant="+z,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(z){return l.call(p,z)?!0:l.call(d,z)?!1:u.test(z)?p[z]=!0:(d[z]=!0,!1)}function b(z,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:(z=z.toLowerCase().slice(0,5),z!=="data-"&&z!=="aria-");default:return!1}}function h(z,w,q,W){if(w===null||typeof w>"u"||b(z,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(z,w,q,W,D,G,ue){this.acceptsBooleans=w===2||w===3||w===4,this.attributeName=W,this.attributeNamespace=D,this.mustUseProperty=q,this.propertyName=z,this.type=w,this.sanitizeURL=G,this.removeEmptyString=ue}var O={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(z){O[z]=new g(z,0,!1,z,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(z){var w=z[0];O[w]=new g(w,1,!1,z[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(z){O[z]=new g(z,2,!1,z.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(z){O[z]=new g(z,2,!1,z,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(z){O[z]=new g(z,3,!1,z.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(z){O[z]=new g(z,3,!0,z,null,!1,!1)}),["capture","download"].forEach(function(z){O[z]=new g(z,4,!1,z,null,!1,!1)}),["cols","rows","size","span"].forEach(function(z){O[z]=new g(z,6,!1,z,null,!1,!1)}),["rowSpan","start"].forEach(function(z){O[z]=new g(z,5,!1,z.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function _(z){return z[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(z){var w=z.replace(v,_);O[w]=new g(w,1,!1,z,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(z){var w=z.replace(v,_);O[w]=new g(w,1,!1,z,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(z){var w=z.replace(v,_);O[w]=new g(w,1,!1,z,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(z){O[z]=new g(z,1,!1,z.toLowerCase(),null,!1,!1)}),O.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(z){O[z]=new g(z,1,!1,z.toLowerCase(),null,!0,!0)});function A(z,w,q,W){var D=O.hasOwnProperty(w)?O[w]:null;(D!==null?D.type!==0:W||!(2qe||D[ue]!==G[qe]){var Ne=` +`+D[ue].replace(" at new "," at ");return z.displayName&&Ne.includes("")&&(Ne=Ne.replace("",z.displayName)),Ne}while(1<=ue&&0<=qe);break}}}finally{ne=!1,Error.prepareStackTrace=q}return(z=z?z.displayName||z.name:"")?Q(z):""}function be(z){switch(z.tag){case 5:return Q(z.type);case 16:return Q("Lazy");case 13:return Q("Suspense");case 19:return Q("SuspenseList");case 0:case 2:case 15:return z=ae(z.type,!1),z;case 11:return z=ae(z.type.render,!1),z;case 1:return z=ae(z.type,!0),z;default:return""}}function re(z){if(z==null)return null;if(typeof z=="function")return z.displayName||z.name||null;if(typeof z=="string")return z;switch(z){case S:return"Fragment";case k:return"Portal";case R:return"Profiler";case C:return"StrictMode";case L:return"Suspense";case P:return"SuspenseList"}if(typeof z=="object")switch(z.$$typeof){case E:return(z.displayName||"Context")+".Consumer";case T:return(z._context.displayName||"Context")+".Provider";case N:var w=z.render;return z=z.displayName,z||(z=w.displayName||w.name||"",z=z!==""?"ForwardRef("+z+")":"ForwardRef"),z;case I:return w=z.displayName||null,w!==null?w:re(z.type)||"Memo";case j:w=z._payload,z=z._init;try{return re(z(w))}catch{}}return null}function de(z){var w=z.type;switch(z.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 z=w.render,z=z.displayName||z.name||"",w.displayName||(z!==""?"ForwardRef("+z+")":"ForwardRef");case 7:return"Fragment";case 5:return w;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return re(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 le(z){switch(typeof z){case"boolean":case"number":case"string":case"undefined":return z;case"object":return z;default:return""}}function ze(z){var w=z.type;return(z=z.nodeName)&&z.toLowerCase()==="input"&&(w==="checkbox"||w==="radio")}function ye(z){var w=ze(z)?"checked":"value",q=Object.getOwnPropertyDescriptor(z.constructor.prototype,w),W=""+z[w];if(!z.hasOwnProperty(w)&&typeof q<"u"&&typeof q.get=="function"&&typeof q.set=="function"){var D=q.get,G=q.set;return Object.defineProperty(z,w,{configurable:!0,get:function(){return D.call(this)},set:function(ue){W=""+ue,G.call(this,ue)}}),Object.defineProperty(z,w,{enumerable:q.enumerable}),{getValue:function(){return W},setValue:function(ue){W=""+ue},stopTracking:function(){z._valueTracker=null,delete z[w]}}}}function We(z){z._valueTracker||(z._valueTracker=ye(z))}function je(z){if(!z)return!1;var w=z._valueTracker;if(!w)return!0;var q=w.getValue(),W="";return z&&(W=ze(z)?z.checked?"true":"false":z.value),z=W,z!==q?(w.setValue(z),!0):!1}function te(z){if(z=z||(typeof document<"u"?document:void 0),typeof z>"u")return null;try{return z.activeElement||z.body}catch{return z.body}}function Oe(z,w){var q=w.checked;return Z({},w,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:q??z._wrapperState.initialChecked})}function ie(z,w){var q=w.defaultValue==null?"":w.defaultValue,W=w.checked!=null?w.checked:w.defaultChecked;q=le(w.value!=null?w.value:q),z._wrapperState={initialChecked:W,initialValue:q,controlled:w.type==="checkbox"||w.type==="radio"?w.checked!=null:w.value!=null}}function he(z,w){w=w.checked,w!=null&&A(z,"checked",w,!1)}function ke(z,w){he(z,w);var q=le(w.value),W=w.type;if(q!=null)W==="number"?(q===0&&z.value===""||z.value!=q)&&(z.value=""+q):z.value!==""+q&&(z.value=""+q);else if(W==="submit"||W==="reset"){z.removeAttribute("value");return}w.hasOwnProperty("value")?ce(z,w.type,q):w.hasOwnProperty("defaultValue")&&ce(z,w.type,le(w.defaultValue)),w.checked==null&&w.defaultChecked!=null&&(z.defaultChecked=!!w.defaultChecked)}function Ce(z,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=""+z._wrapperState.initialValue,q||w===z.value||(z.value=w),z.defaultValue=w}q=z.name,q!==""&&(z.name=""),z.defaultChecked=!!z._wrapperState.initialChecked,q!==""&&(z.name=q)}function ce(z,w,q){(w!=="number"||te(z.ownerDocument)!==z)&&(q==null?z.defaultValue=""+z._wrapperState.initialValue:z.defaultValue!==""+q&&(z.defaultValue=""+q))}var B=Array.isArray;function $(z,w,q,W){if(z=z.options,w){w={};for(var D=0;D"+w.valueOf().toString()+"",w=gt.firstChild;z.firstChild;)z.removeChild(z.firstChild);for(;w.firstChild;)z.appendChild(w.firstChild)}});function se(z,w){if(w){var q=z.firstChild;if(q&&q===z.lastChild&&q.nodeType===3){q.nodeValue=w;return}}z.textContent=w}var V={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(V).forEach(function(z){Y.forEach(function(w){w=w+z.charAt(0).toUpperCase()+z.substring(1),V[w]=V[z]})});function pe(z,w,q){return w==null||typeof w=="boolean"||w===""?"":q||typeof w!="number"||w===0||V.hasOwnProperty(z)&&V[z]?(""+w).trim():w+"px"}function Se(z,w){z=z.style;for(var q in w)if(w.hasOwnProperty(q)){var W=q.indexOf("--")===0,D=pe(q,w[q],W);q==="float"&&(q="cssFloat"),W?z.setProperty(q,D):z[q]=D}}var fe=Z({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 ge(z,w){if(w){if(fe[z]&&(w.children!=null||w.dangerouslySetInnerHTML!=null))throw Error(n(137,z));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 Je(z,w){if(z.indexOf("-")===-1)return typeof w.is=="string";switch(z){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 lt=null;function At(z){return z=z.target||z.srcElement||window,z.correspondingUseElement&&(z=z.correspondingUseElement),z.nodeType===3?z.parentNode:z}var ut=null,tt=null,rn=null;function $n(z){if(z=Km(z)){if(typeof ut!="function")throw Error(n(280));var w=z.stateNode;w&&(w=ey(w),ut(z.stateNode,z.type,w))}}function Wo(z){tt?rn?rn.push(z):rn=[z]:tt=z}function gr(){if(tt){var z=tt,w=rn;if(rn=tt=null,$n(z),w)for(z=0;z>>=0,z===0?32:31-(HD(z)/BO|0)|0}var NO=64,LO=4194304;function Rm(z){switch(z&-z){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 z&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return z&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return z}}function PO(z,w){var q=z.pendingLanes;if(q===0)return 0;var W=0,D=z.suspendedLanes,G=z.pingedLanes,ue=q&268435455;if(ue!==0){var qe=ue&~D;qe!==0?W=Rm(qe):(G&=ue,G!==0&&(W=Rm(G)))}else ue=q&~D,ue!==0?W=Rm(ue):G!==0&&(W=Rm(G));if(W===0)return 0;if(w!==0&&w!==W&&!(w&D)&&(D=W&-W,G=w&-w,D>=G||D===16&&(G&4194240)!==0))return w;if(W&4&&(W|=q&16),w=z.entangledLanes,w!==0)for(z=z.entanglements,w&=W;0q;q++)w.push(z);return w}function Tm(z,w,q){z.pendingLanes|=w,w!==536870912&&(z.suspendedLanes=0,z.pingedLanes=0),z=z.eventTimes,w=31-Us(w),z[w]=q}function lxe(z,w){var q=z.pendingLanes&~w;z.pendingLanes=w,z.suspendedLanes=0,z.pingedLanes=0,z.expiredLanes&=w,z.mutableReadLanes&=w,z.entangledLanes&=w,w=z.entanglements;var W=z.eventTimes;for(z=z.expirationTimes;0=Im),cF=" ",lF=!1;function uF(z,w){switch(z){case"keyup":return Lxe.indexOf(w.keyCode)!==-1;case"keydown":return w.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dF(z){return z=z.detail,typeof z=="object"&&"data"in z?z.data:null}var f2=!1;function jxe(z,w){switch(z){case"compositionend":return dF(w);case"keypress":return w.which!==32?null:(lF=!0,cF);case"textInput":return z=w.data,z===cF&&lF?null:z;default:return null}}function Ixe(z,w){if(f2)return z==="compositionend"||!kk&&uF(z,w)?(z=nF(),$O=yk=cu=null,f2=!1,z):null;switch(z){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-z};z=W}e:{for(;q;){if(q.nextSibling){q=q.nextSibling;break e}q=q.parentNode}q=void 0}q=MF(q)}}function OF(z,w){return z&&w?z===w?!0:z&&z.nodeType===3?!1:w&&w.nodeType===3?OF(z,w.parentNode):"contains"in z?z.contains(w):z.compareDocumentPosition?!!(z.compareDocumentPosition(w)&16):!1:!1}function yF(){for(var z=window,w=te();w instanceof z.HTMLIFrameElement;){try{var q=typeof w.contentWindow.location.href=="string"}catch{q=!1}if(q)z=w.contentWindow;else break;w=te(z.document)}return w}function qk(z){var w=z&&z.nodeName&&z.nodeName.toLowerCase();return w&&(w==="input"&&(z.type==="text"||z.type==="search"||z.type==="tel"||z.type==="url"||z.type==="password")||w==="textarea"||z.contentEditable==="true")}function Kxe(z){var w=yF(),q=z.focusedElem,W=z.selectionRange;if(w!==q&&q&&q.ownerDocument&&OF(q.ownerDocument.documentElement,q)){if(W!==null&&qk(q)){if(w=W.start,z=W.end,z===void 0&&(z=w),"selectionStart"in q)q.selectionStart=w,q.selectionEnd=Math.min(z,q.value.length);else if(z=(w=q.ownerDocument||document)&&w.defaultView||window,z.getSelection){z=z.getSelection();var D=q.textContent.length,G=Math.min(W.start,D);W=W.end===void 0?G:Math.min(W.end,D),!z.extend&&G>W&&(D=W,W=G,G=D),D=zF(q,G);var ue=zF(q,W);D&&ue&&(z.rangeCount!==1||z.anchorNode!==D.node||z.anchorOffset!==D.offset||z.focusNode!==ue.node||z.focusOffset!==ue.offset)&&(w=w.createRange(),w.setStart(D.node,D.offset),z.removeAllRanges(),G>W?(z.addRange(w),z.extend(ue.node,ue.offset)):(w.setEnd(ue.node,ue.offset),z.addRange(w)))}}for(w=[],z=q;z=z.parentNode;)z.nodeType===1&&w.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q=document.documentMode,b2=null,Rk=null,Vm=null,Tk=!1;function AF(z,w,q){var W=q.window===q?q.document:q.nodeType===9?q:q.ownerDocument;Tk||b2==null||b2!==te(W)||(W=b2,"selectionStart"in W&&qk(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}),Vm&&$m(Vm,W)||(Vm=W,W=ZO(Rk,"onSelect"),0z2||(z.current=Vk[z2],Vk[z2]=null,z2--)}function Xo(z,w){z2++,Vk[z2]=z.current,z.current=w}var pu={},Q0=du(pu),I1=du(!1),bp=pu;function O2(z,w){var q=z.type.contextTypes;if(!q)return pu;var W=z.stateNode;if(W&&W.__reactInternalMemoizedUnmaskedChildContext===w)return W.__reactInternalMemoizedMaskedChildContext;var D={},G;for(G in q)D[G]=w[G];return W&&(z=z.stateNode,z.__reactInternalMemoizedUnmaskedChildContext=w,z.__reactInternalMemoizedMaskedChildContext=D),D}function D1(z){return z=z.childContextTypes,z!=null}function ty(){Jo(I1),Jo(Q0)}function LF(z,w,q){if(Q0.current!==pu)throw Error(n(168));Xo(Q0,w),Xo(I1,q)}function PF(z,w,q){var W=z.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,de(z)||"Unknown",D));return Z({},q,W)}function ny(z){return z=(z=z.stateNode)&&z.__reactInternalMemoizedMergedChildContext||pu,bp=Q0.current,Xo(Q0,z),Xo(I1,I1.current),!0}function jF(z,w,q){var W=z.stateNode;if(!W)throw Error(n(169));q?(z=PF(z,w,bp),W.__reactInternalMemoizedMergedChildContext=z,Jo(I1),Jo(Q0),Xo(Q0,z)):Jo(I1),Xo(I1,q)}var Lc=null,oy=!1,Hk=!1;function IF(z){Lc===null?Lc=[z]:Lc.push(z)}function awe(z){oy=!0,IF(z)}function fu(){if(!Hk&&Lc!==null){Hk=!0;var z=0,w=Co;try{var q=Lc;for(Co=1;z>=ue,D-=ue,Pc=1<<32-Us(w)+D|q<On?(b0=dn,dn=null):b0=dn.sibling;var bo=nt(Fe,dn,Ve[On],pt);if(bo===null){dn===null&&(dn=b0);break}z&&dn&&bo.alternate===null&&w(Fe,dn),Ie=G(bo,Ie,On),un===null?Gt=bo:un.sibling=bo,un=bo,dn=b0}if(On===Ve.length)return q(Fe,dn),ur&&mp(Fe,On),Gt;if(dn===null){for(;OnOn?(b0=dn,dn=null):b0=dn.sibling;var Au=nt(Fe,dn,bo.value,pt);if(Au===null){dn===null&&(dn=b0);break}z&&dn&&Au.alternate===null&&w(Fe,dn),Ie=G(Au,Ie,On),un===null?Gt=Au:un.sibling=Au,un=Au,dn=b0}if(bo.done)return q(Fe,dn),ur&&mp(Fe,On),Gt;if(dn===null){for(;!bo.done;On++,bo=Ve.next())bo=ct(Fe,bo.value,pt),bo!==null&&(Ie=G(bo,Ie,On),un===null?Gt=bo:un.sibling=bo,un=bo);return ur&&mp(Fe,On),Gt}for(dn=W(Fe,dn);!bo.done;On++,bo=Ve.next())bo=qt(dn,Fe,On,bo.value,pt),bo!==null&&(z&&bo.alternate!==null&&dn.delete(bo.key===null?On:bo.key),Ie=G(bo,Ie,On),un===null?Gt=bo:un.sibling=bo,un=bo);return z&&dn.forEach(function(Dwe){return w(Fe,Dwe)}),ur&&mp(Fe,On),Gt}function Wr(Fe,Ie,Ve,pt){if(typeof Ve=="object"&&Ve!==null&&Ve.type===S&&Ve.key===null&&(Ve=Ve.props.children),typeof Ve=="object"&&Ve!==null){switch(Ve.$$typeof){case y:e:{for(var Gt=Ve.key,un=Ie;un!==null;){if(un.key===Gt){if(Gt=Ve.type,Gt===S){if(un.tag===7){q(Fe,un.sibling),Ie=D(un,Ve.props.children),Ie.return=Fe,Fe=Ie;break e}}else if(un.elementType===Gt||typeof Gt=="object"&&Gt!==null&&Gt.$$typeof===j&&UF(Gt)===un.type){q(Fe,un.sibling),Ie=D(un,Ve.props),Ie.ref=Ym(Fe,un,Ve),Ie.return=Fe,Fe=Ie;break e}q(Fe,un);break}else w(Fe,un);un=un.sibling}Ve.type===S?(Ie=xp(Ve.props.children,Fe.mode,pt,Ve.key),Ie.return=Fe,Fe=Ie):(pt=Ry(Ve.type,Ve.key,Ve.props,null,Fe.mode,pt),pt.ref=Ym(Fe,Ie,Ve),pt.return=Fe,Fe=pt)}return ue(Fe);case k:e:{for(un=Ve.key;Ie!==null;){if(Ie.key===un)if(Ie.tag===4&&Ie.stateNode.containerInfo===Ve.containerInfo&&Ie.stateNode.implementation===Ve.implementation){q(Fe,Ie.sibling),Ie=D(Ie,Ve.children||[]),Ie.return=Fe,Fe=Ie;break e}else{q(Fe,Ie);break}else w(Fe,Ie);Ie=Ie.sibling}Ie=F6(Ve,Fe.mode,pt),Ie.return=Fe,Fe=Ie}return ue(Fe);case j:return un=Ve._init,Wr(Fe,Ie,un(Ve._payload),pt)}if(B(Ve))return Dt(Fe,Ie,Ve,pt);if(U(Ve))return Ht(Fe,Ie,Ve,pt);ay(Fe,Ve)}return typeof Ve=="string"&&Ve!==""||typeof Ve=="number"?(Ve=""+Ve,Ie!==null&&Ie.tag===6?(q(Fe,Ie.sibling),Ie=D(Ie,Ve),Ie.return=Fe,Fe=Ie):(q(Fe,Ie),Ie=D6(Ve,Fe.mode,pt),Ie.return=Fe,Fe=Ie),ue(Fe)):q(Fe,Ie)}return Wr}var x2=XF(!0),GF=XF(!1),cy=du(null),ly=null,w2=null,Zk=null;function Qk(){Zk=w2=ly=null}function Jk(z){var w=cy.current;Jo(cy),z._currentValue=w}function e6(z,w,q){for(;z!==null;){var W=z.alternate;if((z.childLanes&w)!==w?(z.childLanes|=w,W!==null&&(W.childLanes|=w)):W!==null&&(W.childLanes&w)!==w&&(W.childLanes|=w),z===q)break;z=z.return}}function _2(z,w){ly=z,Zk=w2=null,z=z.dependencies,z!==null&&z.firstContext!==null&&(z.lanes&w&&(F1=!0),z.firstContext=null)}function Ks(z){var w=z._currentValue;if(Zk!==z)if(z={context:z,memoizedValue:w,next:null},w2===null){if(ly===null)throw Error(n(308));w2=z,ly.dependencies={lanes:0,firstContext:z}}else w2=w2.next=z;return w}var gp=null;function t6(z){gp===null?gp=[z]:gp.push(z)}function KF(z,w,q,W){var D=w.interleaved;return D===null?(q.next=q,t6(w)):(q.next=D.next,D.next=q),w.interleaved=q,Ic(z,W)}function Ic(z,w){z.lanes|=w;var q=z.alternate;for(q!==null&&(q.lanes|=w),q=z,z=z.return;z!==null;)z.childLanes|=w,q=z.alternate,q!==null&&(q.childLanes|=w),q=z,z=z.return;return q.tag===3?q.stateNode:null}var bu=!1;function n6(z){z.updateQueue={baseState:z.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function YF(z,w){z=z.updateQueue,w.updateQueue===z&&(w.updateQueue={baseState:z.baseState,firstBaseUpdate:z.firstBaseUpdate,lastBaseUpdate:z.lastBaseUpdate,shared:z.shared,effects:z.effects})}function Dc(z,w){return{eventTime:z,lane:w,tag:0,payload:null,callback:null,next:null}}function hu(z,w,q){var W=z.updateQueue;if(W===null)return null;if(W=W.shared,co&2){var D=W.pending;return D===null?w.next=w:(w.next=D.next,D.next=w),W.pending=w,Ic(z,q)}return D=W.interleaved,D===null?(w.next=w,t6(W)):(w.next=D.next,D.next=w),W.interleaved=w,Ic(z,q)}function uy(z,w,q){if(w=w.updateQueue,w!==null&&(w=w.shared,(q&4194240)!==0)){var W=w.lanes;W&=z.pendingLanes,q|=W,w.lanes=q,mk(z,q)}}function ZF(z,w){var q=z.updateQueue,W=z.alternate;if(W!==null&&(W=W.updateQueue,q===W)){var D=null,G=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};G===null?D=G=ue:G=G.next=ue,q=q.next}while(q!==null);G===null?D=G=w:G=G.next=w}else D=G=w;q={baseState:W.baseState,firstBaseUpdate:D,lastBaseUpdate:G,shared:W.shared,effects:W.effects},z.updateQueue=q;return}z=q.lastBaseUpdate,z===null?q.firstBaseUpdate=w:z.next=w,q.lastBaseUpdate=w}function dy(z,w,q,W){var D=z.updateQueue;bu=!1;var G=D.firstBaseUpdate,ue=D.lastBaseUpdate,qe=D.shared.pending;if(qe!==null){D.shared.pending=null;var Ne=qe,Xe=Ne.next;Ne.next=null,ue===null?G=Xe:ue.next=Xe,ue=Ne;var rt=z.alternate;rt!==null&&(rt=rt.updateQueue,qe=rt.lastBaseUpdate,qe!==ue&&(qe===null?rt.firstBaseUpdate=Xe:qe.next=Xe,rt.lastBaseUpdate=Ne))}if(G!==null){var ct=D.baseState;ue=0,rt=Xe=Ne=null,qe=G;do{var nt=qe.lane,qt=qe.eventTime;if((W&nt)===nt){rt!==null&&(rt=rt.next={eventTime:qt,lane:0,tag:qe.tag,payload:qe.payload,callback:qe.callback,next:null});e:{var Dt=z,Ht=qe;switch(nt=w,qt=q,Ht.tag){case 1:if(Dt=Ht.payload,typeof Dt=="function"){ct=Dt.call(qt,ct,nt);break e}ct=Dt;break e;case 3:Dt.flags=Dt.flags&-65537|128;case 0:if(Dt=Ht.payload,nt=typeof Dt=="function"?Dt.call(qt,ct,nt):Dt,nt==null)break e;ct=Z({},ct,nt);break e;case 2:bu=!0}}qe.callback!==null&&qe.lane!==0&&(z.flags|=64,nt=D.effects,nt===null?D.effects=[qe]:nt.push(qe))}else qt={eventTime:qt,lane:nt,tag:qe.tag,payload:qe.payload,callback:qe.callback,next:null},rt===null?(Xe=rt=qt,Ne=ct):rt=rt.next=qt,ue|=nt;if(qe=qe.next,qe===null){if(qe=D.shared.pending,qe===null)break;nt=qe,qe=nt.next,nt.next=null,D.lastBaseUpdate=nt,D.shared.pending=null}}while(!0);if(rt===null&&(Ne=ct),D.baseState=Ne,D.firstBaseUpdate=Xe,D.lastBaseUpdate=rt,w=D.shared.interleaved,w!==null){D=w;do ue|=D.lane,D=D.next;while(D!==w)}else G===null&&(D.shared.lanes=0);Op|=ue,z.lanes=ue,z.memoizedState=ct}}function QF(z,w,q){if(z=w.effects,w.effects=null,z!==null)for(w=0;wq?q:4,z(!0);var W=a6.transition;a6.transition={};try{z(!1),w()}finally{Co=q,a6.transition=W}}function g$(){return Ys().memoizedState}function dwe(z,w,q){var W=zu(z);if(q={lane:W,action:q,hasEagerState:!1,eagerState:null,next:null},M$(z))z$(w,q);else if(q=KF(z,w,q,W),q!==null){var D=w1();Di(q,z,W,D),O$(q,w,W)}}function pwe(z,w,q){var W=zu(z),D={lane:W,action:q,hasEagerState:!1,eagerState:null,next:null};if(M$(z))z$(w,D);else{var G=z.alternate;if(z.lanes===0&&(G===null||G.lanes===0)&&(G=w.lastRenderedReducer,G!==null))try{var ue=w.lastRenderedState,qe=G(ue,q);if(D.hasEagerState=!0,D.eagerState=qe,Ni(qe,ue)){var Ne=w.interleaved;Ne===null?(D.next=D,t6(w)):(D.next=Ne.next,Ne.next=D),w.interleaved=D;return}}catch{}finally{}q=KF(z,w,D,W),q!==null&&(D=w1(),Di(q,z,W,D),O$(q,w,W))}}function M$(z){var w=z.alternate;return z===Or||w!==null&&w===Or}function z$(z,w){eg=by=!0;var q=z.pending;q===null?w.next=w:(w.next=q.next,q.next=w),z.pending=w}function O$(z,w,q){if(q&4194240){var W=w.lanes;W&=z.pendingLanes,q|=W,w.lanes=q,mk(z,q)}}var gy={readContext:Ks,useCallback:J0,useContext:J0,useEffect:J0,useImperativeHandle:J0,useInsertionEffect:J0,useLayoutEffect:J0,useMemo:J0,useReducer:J0,useRef:J0,useState:J0,useDebugValue:J0,useDeferredValue:J0,useTransition:J0,useMutableSource:J0,useSyncExternalStore:J0,useId:J0,unstable_isNewReconciler:!1},fwe={readContext:Ks,useCallback:function(z,w){return xa().memoizedState=[z,w===void 0?null:w],z},useContext:Ks,useEffect:l$,useImperativeHandle:function(z,w,q){return q=q!=null?q.concat([z]):null,hy(4194308,4,p$.bind(null,w,z),q)},useLayoutEffect:function(z,w){return hy(4194308,4,z,w)},useInsertionEffect:function(z,w){return hy(4,2,z,w)},useMemo:function(z,w){var q=xa();return w=w===void 0?null:w,z=z(),q.memoizedState=[z,w],z},useReducer:function(z,w,q){var W=xa();return w=q!==void 0?q(w):w,W.memoizedState=W.baseState=w,z={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:z,lastRenderedState:w},W.queue=z,z=z.dispatch=dwe.bind(null,Or,z),[W.memoizedState,z]},useRef:function(z){var w=xa();return z={current:z},w.memoizedState=z},useState:a$,useDebugValue:b6,useDeferredValue:function(z){return xa().memoizedState=z},useTransition:function(){var z=a$(!1),w=z[0];return z=uwe.bind(null,z[1]),xa().memoizedState=z,[w,z]},useMutableSource:function(){},useSyncExternalStore:function(z,w,q){var W=Or,D=xa();if(ur){if(q===void 0)throw Error(n(407));q=q()}else{if(q=w(),f0===null)throw Error(n(349));zp&30||n$(W,w,q)}D.memoizedState=q;var G={value:q,getSnapshot:w};return D.queue=G,l$(r$.bind(null,W,G,z),[z]),W.flags|=2048,og(9,o$.bind(null,W,G,q,w),void 0,null),q},useId:function(){var z=xa(),w=f0.identifierPrefix;if(ur){var q=jc,W=Pc;q=(W&~(1<<32-Us(W)-1)).toString(32)+q,w=":"+w+"R"+q,q=tg++,0<\/script>",z=z.removeChild(z.firstChild)):typeof W.is=="string"?z=ue.createElement(q,{is:W.is}):(z=ue.createElement(q),q==="select"&&(ue=z,W.multiple?ue.multiple=!0:W.size&&(ue.size=W.size))):z=ue.createElementNS(z,q),z[Aa]=w,z[Gm]=W,I$(z,w,!1,!1),w.stateNode=z;e:{switch(ue=Je(q,W),q){case"dialog":Qo("cancel",z),Qo("close",z),D=W;break;case"iframe":case"object":case"embed":Qo("load",z),D=W;break;case"video":case"audio":for(D=0;DR2&&(w.flags|=128,W=!0,rg(G,!1),w.lanes=4194304)}else{if(!W)if(z=py(ue),z!==null){if(w.flags|=128,W=!0,q=z.updateQueue,q!==null&&(w.updateQueue=q,w.flags|=4),rg(G,!0),G.tail===null&&G.tailMode==="hidden"&&!ue.alternate&&!ur)return e1(w),null}else 2*jn()-G.renderingStartTime>R2&&q!==1073741824&&(w.flags|=128,W=!0,rg(G,!1),w.lanes=4194304);G.isBackwards?(ue.sibling=w.child,w.child=ue):(q=G.last,q!==null?q.sibling=ue:w.child=ue,G.last=ue)}return G.tail!==null?(w=G.tail,G.rendering=w,G.tail=w.sibling,G.renderingStartTime=jn(),w.sibling=null,q=zr.current,Xo(zr,W?q&1|2:q&1),w):(e1(w),null);case 22:case 23:return P6(),W=w.memoizedState!==null,z!==null&&z.memoizedState!==null!==W&&(w.flags|=8192),W&&w.mode&1?_s&1073741824&&(e1(w),w.subtreeFlags&6&&(w.flags|=8192)):e1(w),null;case 24:return null;case 25:return null}throw Error(n(156,w.tag))}function ywe(z,w){switch(Xk(w),w.tag){case 1:return D1(w.type)&&ty(),z=w.flags,z&65536?(w.flags=z&-65537|128,w):null;case 3:return k2(),Jo(I1),Jo(Q0),i6(),z=w.flags,z&65536&&!(z&128)?(w.flags=z&-65537|128,w):null;case 5:return r6(w),null;case 13:if(Jo(zr),z=w.memoizedState,z!==null&&z.dehydrated!==null){if(w.alternate===null)throw Error(n(340));v2()}return z=w.flags,z&65536?(w.flags=z&-65537|128,w):null;case 19:return Jo(zr),null;case 4:return k2(),null;case 10:return Jk(w.type._context),null;case 22:case 23:return P6(),null;case 24:return null;default:return null}}var yy=!1,t1=!1,Awe=typeof WeakSet=="function"?WeakSet:Set,jt=null;function C2(z,w){var q=z.ref;if(q!==null)if(typeof q=="function")try{q(null)}catch(W){Sr(z,w,W)}else q.current=null}function _6(z,w,q){try{q()}catch(W){Sr(z,w,W)}}var $$=!1;function vwe(z,w){if(Pk=DO,z=yF(),qk(z)){if("selectionStart"in z)var q={start:z.selectionStart,end:z.selectionEnd};else e:{q=(q=z.ownerDocument)&&q.defaultView||window;var W=q.getSelection&&q.getSelection();if(W&&W.rangeCount!==0){q=W.anchorNode;var D=W.anchorOffset,G=W.focusNode;W=W.focusOffset;try{q.nodeType,G.nodeType}catch{q=null;break e}var ue=0,qe=-1,Ne=-1,Xe=0,rt=0,ct=z,nt=null;t:for(;;){for(var qt;ct!==q||D!==0&&ct.nodeType!==3||(qe=ue+D),ct!==G||W!==0&&ct.nodeType!==3||(Ne=ue+W),ct.nodeType===3&&(ue+=ct.nodeValue.length),(qt=ct.firstChild)!==null;)nt=ct,ct=qt;for(;;){if(ct===z)break t;if(nt===q&&++Xe===D&&(qe=ue),nt===G&&++rt===W&&(Ne=ue),(qt=ct.nextSibling)!==null)break;ct=nt,nt=ct.parentNode}ct=qt}q=qe===-1||Ne===-1?null:{start:qe,end:Ne}}else q=null}q=q||{start:0,end:0}}else q=null;for(jk={focusedElem:z,selectionRange:q},DO=!1,jt=w;jt!==null;)if(w=jt,z=w.child,(w.subtreeFlags&1028)!==0&&z!==null)z.return=w,jt=z;else for(;jt!==null;){w=jt;try{var Dt=w.alternate;if(w.flags&1024)switch(w.tag){case 0:case 11:case 15:break;case 1:if(Dt!==null){var Ht=Dt.memoizedProps,Wr=Dt.memoizedState,Fe=w.stateNode,Ie=Fe.getSnapshotBeforeUpdate(w.elementType===w.type?Ht:Pi(w.type,Ht),Wr);Fe.__reactInternalSnapshotBeforeUpdate=Ie}break;case 3:var Ve=w.stateNode.containerInfo;Ve.nodeType===1?Ve.textContent="":Ve.nodeType===9&&Ve.documentElement&&Ve.removeChild(Ve.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(pt){Sr(w,w.return,pt)}if(z=w.sibling,z!==null){z.return=w.return,jt=z;break}jt=w.return}return Dt=$$,$$=!1,Dt}function sg(z,w,q){var W=w.updateQueue;if(W=W!==null?W.lastEffect:null,W!==null){var D=W=W.next;do{if((D.tag&z)===z){var G=D.destroy;D.destroy=void 0,G!==void 0&&_6(w,q,G)}D=D.next}while(D!==W)}}function Ay(z,w){if(w=w.updateQueue,w=w!==null?w.lastEffect:null,w!==null){var q=w=w.next;do{if((q.tag&z)===z){var W=q.create;q.destroy=W()}q=q.next}while(q!==w)}}function k6(z){var w=z.ref;if(w!==null){var q=z.stateNode;switch(z.tag){case 5:z=q;break;default:z=q}typeof w=="function"?w(z):w.current=z}}function V$(z){var w=z.alternate;w!==null&&(z.alternate=null,V$(w)),z.child=null,z.deletions=null,z.sibling=null,z.tag===5&&(w=z.stateNode,w!==null&&(delete w[Aa],delete w[Gm],delete w[$k],delete w[swe],delete w[iwe])),z.stateNode=null,z.return=null,z.dependencies=null,z.memoizedProps=null,z.memoizedState=null,z.pendingProps=null,z.stateNode=null,z.updateQueue=null}function H$(z){return z.tag===5||z.tag===3||z.tag===4}function U$(z){e:for(;;){for(;z.sibling===null;){if(z.return===null||H$(z.return))return null;z=z.return}for(z.sibling.return=z.return,z=z.sibling;z.tag!==5&&z.tag!==6&&z.tag!==18;){if(z.flags&2||z.child===null||z.tag===4)continue e;z.child.return=z,z=z.child}if(!(z.flags&2))return z.stateNode}}function S6(z,w,q){var W=z.tag;if(W===5||W===6)z=z.stateNode,w?q.nodeType===8?q.parentNode.insertBefore(z,w):q.insertBefore(z,w):(q.nodeType===8?(w=q.parentNode,w.insertBefore(z,q)):(w=q,w.appendChild(z)),q=q._reactRootContainer,q!=null||w.onclick!==null||(w.onclick=JO));else if(W!==4&&(z=z.child,z!==null))for(S6(z,w,q),z=z.sibling;z!==null;)S6(z,w,q),z=z.sibling}function C6(z,w,q){var W=z.tag;if(W===5||W===6)z=z.stateNode,w?q.insertBefore(z,w):q.appendChild(z);else if(W!==4&&(z=z.child,z!==null))for(C6(z,w,q),z=z.sibling;z!==null;)C6(z,w,q),z=z.sibling}var T0=null,ji=!1;function mu(z,w,q){for(q=q.child;q!==null;)X$(z,w,q),q=q.sibling}function X$(z,w,q){if(v1&&typeof v1.onCommitFiberUnmount=="function")try{v1.onCommitFiberUnmount(pp,q)}catch{}switch(q.tag){case 5:t1||C2(q,w);case 6:var W=T0,D=ji;T0=null,mu(z,w,q),T0=W,ji=D,T0!==null&&(ji?(z=T0,q=q.stateNode,z.nodeType===8?z.parentNode.removeChild(q):z.removeChild(q)):T0.removeChild(q.stateNode));break;case 18:T0!==null&&(ji?(z=T0,q=q.stateNode,z.nodeType===8?Fk(z.parentNode,q):z.nodeType===1&&Fk(z,q),Lm(z)):Fk(T0,q.stateNode));break;case 4:W=T0,D=ji,T0=q.stateNode.containerInfo,ji=!0,mu(z,w,q),T0=W,ji=D;break;case 0:case 11:case 14:case 15:if(!t1&&(W=q.updateQueue,W!==null&&(W=W.lastEffect,W!==null))){D=W=W.next;do{var G=D,ue=G.destroy;G=G.tag,ue!==void 0&&(G&2||G&4)&&_6(q,w,ue),D=D.next}while(D!==W)}mu(z,w,q);break;case 1:if(!t1&&(C2(q,w),W=q.stateNode,typeof W.componentWillUnmount=="function"))try{W.props=q.memoizedProps,W.state=q.memoizedState,W.componentWillUnmount()}catch(qe){Sr(q,w,qe)}mu(z,w,q);break;case 21:mu(z,w,q);break;case 22:q.mode&1?(t1=(W=t1)||q.memoizedState!==null,mu(z,w,q),t1=W):mu(z,w,q);break;default:mu(z,w,q)}}function G$(z){var w=z.updateQueue;if(w!==null){z.updateQueue=null;var q=z.stateNode;q===null&&(q=z.stateNode=new Awe),w.forEach(function(W){var D=Twe.bind(null,z,W);q.has(W)||(q.add(W),W.then(D,D))})}}function Ii(z,w){var q=w.deletions;if(q!==null)for(var W=0;WD&&(D=ue),W&=~G}if(W=D,W=jn()-W,W=(120>W?120:480>W?480:1080>W?1080:1920>W?1920:3e3>W?3e3:4320>W?4320:1960*wwe(W/1960))-W,10z?16:z,Mu===null)var W=!1;else{if(z=Mu,Mu=null,ky=0,co&6)throw Error(n(331));var D=co;for(co|=4,jt=z.current;jt!==null;){var G=jt,ue=G.child;if(jt.flags&16){var qe=G.deletions;if(qe!==null){for(var Ne=0;Nejn()-T6?Ap(z,0):R6|=q),V1(z,w)}function aV(z,w){w===0&&(z.mode&1?(w=LO,LO<<=1,!(LO&130023424)&&(LO=4194304)):w=1);var q=w1();z=Ic(z,w),z!==null&&(Tm(z,w,q),V1(z,q))}function Rwe(z){var w=z.memoizedState,q=0;w!==null&&(q=w.retryLane),aV(z,q)}function Twe(z,w){var q=0;switch(z.tag){case 13:var W=z.stateNode,D=z.memoizedState;D!==null&&(q=D.retryLane);break;case 19:W=z.stateNode;break;default:throw Error(n(314))}W!==null&&W.delete(w),aV(z,q)}var cV;cV=function(z,w,q){if(z!==null)if(z.memoizedProps!==w.pendingProps||I1.current)F1=!0;else{if(!(z.lanes&q)&&!(w.flags&128))return F1=!1,zwe(z,w,q);F1=!!(z.flags&131072)}else F1=!1,ur&&w.flags&1048576&&DF(w,sy,w.index);switch(w.lanes=0,w.tag){case 2:var W=w.type;Oy(z,w),z=w.pendingProps;var D=O2(w,Q0.current);_2(w,q),D=l6(null,w,W,z,D,q);var G=u6();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,D1(W)?(G=!0,ny(w)):G=!1,w.memoizedState=D.state!==null&&D.state!==void 0?D.state:null,n6(w),D.updater=My,w.stateNode=D,D._reactInternals=w,m6(w,W,z,q),w=O6(null,w,W,!0,G,q)):(w.tag=0,ur&&G&&Uk(w),x1(null,w,D,q),w=w.child),w;case 16:W=w.elementType;e:{switch(Oy(z,w),z=w.pendingProps,D=W._init,W=D(W._payload),w.type=W,D=w.tag=Wwe(W),z=Pi(W,z),D){case 0:w=z6(null,w,W,z,q);break e;case 1:w=W$(null,w,W,z,q);break e;case 11:w=C$(null,w,W,z,q);break e;case 14:w=q$(null,w,W,Pi(W.type,z),q);break e}throw Error(n(306,W,""))}return w;case 0:return W=w.type,D=w.pendingProps,D=w.elementType===W?D:Pi(W,D),z6(z,w,W,D,q);case 1:return W=w.type,D=w.pendingProps,D=w.elementType===W?D:Pi(W,D),W$(z,w,W,D,q);case 3:e:{if(B$(w),z===null)throw Error(n(387));W=w.pendingProps,G=w.memoizedState,D=G.element,YF(z,w),dy(w,W,null,q);var ue=w.memoizedState;if(W=ue.element,G.isDehydrated)if(G={element:W,isDehydrated:!1,cache:ue.cache,pendingSuspenseBoundaries:ue.pendingSuspenseBoundaries,transitions:ue.transitions},w.updateQueue.baseState=G,w.memoizedState=G,w.flags&256){D=S2(Error(n(423)),w),w=N$(z,w,W,q,D);break e}else if(W!==D){D=S2(Error(n(424)),w),w=N$(z,w,W,q,D);break e}else for(ws=uu(w.stateNode.containerInfo.firstChild),xs=w,ur=!0,Li=null,q=GF(w,null,W,q),w.child=q;q;)q.flags=q.flags&-3|4096,q=q.sibling;else{if(v2(),W===D){w=Fc(z,w,q);break e}x1(z,w,W,q)}w=w.child}return w;case 5:return JF(w),z===null&&Kk(w),W=w.type,D=w.pendingProps,G=z!==null?z.memoizedProps:null,ue=D.children,Ik(W,D)?ue=null:G!==null&&Ik(W,G)&&(w.flags|=32),E$(z,w),x1(z,w,ue,q),w.child;case 6:return z===null&&Kk(w),null;case 13:return L$(z,w,q);case 4:return o6(w,w.stateNode.containerInfo),W=w.pendingProps,z===null?w.child=x2(w,null,W,q):x1(z,w,W,q),w.child;case 11:return W=w.type,D=w.pendingProps,D=w.elementType===W?D:Pi(W,D),C$(z,w,W,D,q);case 7:return x1(z,w,w.pendingProps,q),w.child;case 8:return x1(z,w,w.pendingProps.children,q),w.child;case 12:return x1(z,w,w.pendingProps.children,q),w.child;case 10:e:{if(W=w.type._context,D=w.pendingProps,G=w.memoizedProps,ue=D.value,Xo(cy,W._currentValue),W._currentValue=ue,G!==null)if(Ni(G.value,ue)){if(G.children===D.children&&!I1.current){w=Fc(z,w,q);break e}}else for(G=w.child,G!==null&&(G.return=w);G!==null;){var qe=G.dependencies;if(qe!==null){ue=G.child;for(var Ne=qe.firstContext;Ne!==null;){if(Ne.context===W){if(G.tag===1){Ne=Dc(-1,q&-q),Ne.tag=2;var Xe=G.updateQueue;if(Xe!==null){Xe=Xe.shared;var rt=Xe.pending;rt===null?Ne.next=Ne:(Ne.next=rt.next,rt.next=Ne),Xe.pending=Ne}}G.lanes|=q,Ne=G.alternate,Ne!==null&&(Ne.lanes|=q),e6(G.return,q,w),qe.lanes|=q;break}Ne=Ne.next}}else if(G.tag===10)ue=G.type===w.type?null:G.child;else if(G.tag===18){if(ue=G.return,ue===null)throw Error(n(341));ue.lanes|=q,qe=ue.alternate,qe!==null&&(qe.lanes|=q),e6(ue,q,w),ue=G.sibling}else ue=G.child;if(ue!==null)ue.return=G;else for(ue=G;ue!==null;){if(ue===w){ue=null;break}if(G=ue.sibling,G!==null){G.return=ue.return,ue=G;break}ue=ue.return}G=ue}x1(z,w,D.children,q),w=w.child}return w;case 9:return D=w.type,W=w.pendingProps.children,_2(w,q),D=Ks(D),W=W(D),w.flags|=1,x1(z,w,W,q),w.child;case 14:return W=w.type,D=Pi(W,w.pendingProps),D=Pi(W.type,D),q$(z,w,W,D,q);case 15:return R$(z,w,w.type,w.pendingProps,q);case 17:return W=w.type,D=w.pendingProps,D=w.elementType===W?D:Pi(W,D),Oy(z,w),w.tag=1,D1(W)?(z=!0,ny(w)):z=!1,_2(w,q),A$(w,W,D),m6(w,W,D,q),O6(null,w,W,!0,z,q);case 19:return j$(z,w,q);case 22:return T$(z,w,q)}throw Error(n(156,w.tag))};function lV(z,w){return up(z,w)}function Ewe(z,w,q,W){this.tag=z,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 Qs(z,w,q,W){return new Ewe(z,w,q,W)}function I6(z){return z=z.prototype,!(!z||!z.isReactComponent)}function Wwe(z){if(typeof z=="function")return I6(z)?1:0;if(z!=null){if(z=z.$$typeof,z===N)return 11;if(z===I)return 14}return 2}function yu(z,w){var q=z.alternate;return q===null?(q=Qs(z.tag,w,z.key,z.mode),q.elementType=z.elementType,q.type=z.type,q.stateNode=z.stateNode,q.alternate=z,z.alternate=q):(q.pendingProps=w,q.type=z.type,q.flags=0,q.subtreeFlags=0,q.deletions=null),q.flags=z.flags&14680064,q.childLanes=z.childLanes,q.lanes=z.lanes,q.child=z.child,q.memoizedProps=z.memoizedProps,q.memoizedState=z.memoizedState,q.updateQueue=z.updateQueue,w=z.dependencies,q.dependencies=w===null?null:{lanes:w.lanes,firstContext:w.firstContext},q.sibling=z.sibling,q.index=z.index,q.ref=z.ref,q}function Ry(z,w,q,W,D,G){var ue=2;if(W=z,typeof z=="function")I6(z)&&(ue=1);else if(typeof z=="string")ue=5;else e:switch(z){case S:return xp(q.children,D,G,w);case C:ue=8,D|=8;break;case R:return z=Qs(12,q,w,D|2),z.elementType=R,z.lanes=G,z;case L:return z=Qs(13,q,w,D),z.elementType=L,z.lanes=G,z;case P:return z=Qs(19,q,w,D),z.elementType=P,z.lanes=G,z;case H:return Ty(q,D,G,w);default:if(typeof z=="object"&&z!==null)switch(z.$$typeof){case T:ue=10;break e;case E:ue=9;break e;case N:ue=11;break e;case I:ue=14;break e;case j:ue=16,W=null;break e}throw Error(n(130,z==null?z:typeof z,""))}return w=Qs(ue,q,w,D),w.elementType=z,w.type=W,w.lanes=G,w}function xp(z,w,q,W){return z=Qs(7,z,W,w),z.lanes=q,z}function Ty(z,w,q,W){return z=Qs(22,z,W,w),z.elementType=H,z.lanes=q,z.stateNode={isHidden:!1},z}function D6(z,w,q){return z=Qs(6,z,null,w),z.lanes=q,z}function F6(z,w,q){return w=Qs(4,z.children!==null?z.children:[],z.key,w),w.lanes=q,w.stateNode={containerInfo:z.containerInfo,pendingChildren:null,implementation:z.implementation},w}function Bwe(z,w,q,W,D){this.tag=w,this.containerInfo=z,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hk(0),this.expirationTimes=hk(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hk(0),this.identifierPrefix=W,this.onRecoverableError=D,this.mutableSourceEagerHydrationData=null}function $6(z,w,q,W,D,G,ue,qe,Ne){return z=new Bwe(z,w,q,qe,Ne),w===1?(w=1,G===!0&&(w|=8)):w=0,G=Qs(3,null,null,w),z.current=G,G.stateNode=z,G.memoizedState={element:W,isDehydrated:q,cache:null,transitions:null,pendingSuspenseBoundaries:null},n6(G),z}function Nwe(z,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(),Z6.exports=Jwe(),Z6.exports}var cs=Loe(),jy={},xV;function e_e(){if(xV)return jy;xV=1;var e=Loe();return jy.createRoot=e.createRoot,jy.hydrateRoot=e.hydrateRoot,jy}var t_e=e_e();const n_e=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 wV(e){return Object.prototype.toString.call(e)==="[object Object]"}function Uz(e){var t,n;return wV(e)===!1?!1:(t=e.constructor,t===void 0?!0:(n=t.prototype,!(wV(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)))}var n8=function(e,t){return n8=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])},n8(e,t)};function o_e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n8(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Cr=function(){return Cr=Object.assign||function(t){for(var n,o=1,r=arguments.length;o0&&n>="0"&&n<="9"?"_"+n+o:""+n.toUpperCase()+o}function i4(e,t){return t===void 0&&(t={}),Z5(e,Cr({delimiter:"",transform:Poe},t))}function a_e(e,t){return t===0?e.toLowerCase():Poe(e,t)}function dB(e,t){return t===void 0&&(t={}),i4(e,Cr({transform:a_e},t))}function c_e(e){return e.charAt(0).toUpperCase()+e.substr(1)}function l_e(e){return c_e(e.toLowerCase())}function joe(e,t){return t===void 0&&(t={}),Z5(e,Cr({delimiter:" ",transform:l_e},t))}function u_e(e,t){return t===void 0&&(t={}),Z5(e,Cr({delimiter:"."},t))}function vi(e,t){return t===void 0&&(t={}),u_e(e,Cr({delimiter:"-"},t))}function d_e(e){return e.replace(/>/g,">")}const p_e=/[\u007F-\u009F "'>/="\uFDD0-\uFDEF]/;function Ioe(e){return e.replace(/&(?!([a-z0-9]+|#[0-9]+|#x[a-f0-9]+);)/gi,"&")}function f_e(e){return e.replace(/"/g,""")}function Doe(e){return e.replace(/{typeof o=="string"&&o.trim()!==""&&(n+=o)}),x.createElement("div",{dangerouslySetInnerHTML:{__html:n},...t})}const{Provider:h_e,Consumer:m_e}=x.createContext(void 0),g_e=x.forwardRef(()=>null),M_e=new Set(["string","boolean","number"]),z_e=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),O_e=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"]),y_e=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"]),A_e=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 $oe(e,t){return t.some(n=>e.indexOf(n)===0)}function v_e(e){return e==="key"||e==="children"}function x_e(e,t){switch(e){case"style":return q_e(t)}return t}const kV=["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),{}),SV=["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),{}),CV=["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 w_e(e){switch(e){case"htmlFor":return"for";case"className":return"class"}const t=e.toLowerCase();return SV[t]?SV[t]:kV[t]?vi(kV[t]):CV[t]?CV[t]:t}function __e(e){return e.startsWith("--")?e:$oe(e,["ms","O","Moz","Webkit"])?"-"+vi(e):vi(e)}function k_e(e,t){return typeof t=="number"&&t!==0&&!A_e.has(e)?t+"px":t}function d1(e,t,n={}){if(e==null||e===!1)return"";if(Array.isArray(e))return rM(e,t,n);switch(typeof e){case"string":return o8(e);case"number":return e.toString()}const{type:o,props:r}=e;switch(o){case x.StrictMode:case x.Fragment:return rM(r.children,t,n);case a0:const{children:s,...i}=r;return qV(Object.keys(i).length?"div":null,{...i,dangerouslySetInnerHTML:{__html:s}},t,n)}switch(typeof o){case"string":return qV(o,r,t,n);case"function":return o.prototype&&typeof o.prototype.render=="function"?S_e(o,r,t,n):d1(o(r,n),t,n)}switch(o&&o.$$typeof){case h_e.$$typeof:return rM(r.children,r.value,n);case m_e.$$typeof:return d1(r.children(t||o._currentValue),t,n);case g_e.$$typeof:return d1(o.render(r),t,n)}return""}function qV(e,t,n,o={}){let r="";if(e==="textarea"&&t.hasOwnProperty("value")){r=rM(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=rM(t.children,n,o));if(!e)return r;const s=C_e(t);return z_e.has(e)?"<"+e+s+"/>":"<"+e+s+">"+r+""}function S_e(e,t,n,o={}){const r=new e(t,o);return typeof r.getChildContext=="function"&&Object.assign(o,r.getChildContext()),d1(r.render(),n,o)}function rM(e,t,n={}){let o="";e=Array.isArray(e)?e:[e];for(let r=0;r=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)&&(!A||g.sign)?(M=A?"+":"-",p=p.toString().replace(t.sign,"")):M="",v=g.pad_char?g.pad_char==="0"?"0":g.pad_char.charAt(1):" ",_=g.width-(M+p).length,O=g.width&&_>0?v.repeat(_):"",f+=g.align?M+p+O:v==="0"?M+O+p:O+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)})()}(eS)),eS}var T_e=R_e();const E_e=Jr(T_e),W_e=js(console.error);function we(e,...t){try{return E_e.sprintf(e,...t)}catch(n){return n instanceof Error&&W_e(`sprintf error: + +`+n.toString()),e}}var r8,Voe,Pg,Hoe;r8={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1};Voe=["(","?"];Pg={")":["("],":":["?","?:"]};Hoe=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;function B_e(e){for(var t=[],n=[],o,r,s,i;o=e.match(Hoe);){for(r=o[0],s=e.substr(0,o.index).trim(),s&&t.push(s);i=n.pop();){if(Pg[r]){if(Pg[r][0]===i){r=Pg[r][1]||r;break}}else if(Voe.indexOf(i)>=0||r8[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 L_e(e,t){var n=[],o,r,s,i,c,l;for(o=0;o{const o=new pB({}),r=new Set,s=()=>{r.forEach(M=>M())},i=M=>(r.add(M),()=>r.delete(M)),c=(M="default")=>o.data[M],l=(M,y="default")=>{o.data[y]={...o.data[y],...M},o.data[y][""]={...EV[""],...o.data[y]?.[""]},delete o.pluralForms[y]},u=(M,y)=>{l(M,y),s()},d=(M,y="default")=>{o.data[y]={...o.data[y],...M,"":{...EV[""],...o.data[y]?.[""],...M?.[""]}},delete o.pluralForms[y],s()},p=(M,y)=>{o.data={},o.pluralForms={},u(M,y)},f=(M="default",y,k,S,C)=>(o.data[M]||l(void 0,M),o.dcnpgettext(M,y,k,S,C)),b=(M="default")=>M,h=(M,y)=>{let k=f(y,void 0,M);return n?(k=n.applyFilters("i18n.gettext",k,M,y),n.applyFilters("i18n.gettext_"+b(y),k,M,y)):k},g=(M,y,k)=>{let S=f(k,y,M);return n?(S=n.applyFilters("i18n.gettext_with_context",S,M,y,k),n.applyFilters("i18n.gettext_with_context_"+b(k),S,M,y,k)):S},O=(M,y,k,S)=>{let C=f(S,void 0,M,y,k);return n?(C=n.applyFilters("i18n.ngettext",C,M,y,k,S),n.applyFilters("i18n.ngettext_"+b(S),C,M,y,k,S)):C},v=(M,y,k,S,C)=>{let R=f(C,S,M,y,k);return n?(R=n.applyFilters("i18n.ngettext_with_context",R,M,y,k,S,C),n.applyFilters("i18n.ngettext_with_context_"+b(C),R,M,y,k,S,C)):R},_=()=>g("ltr","text direction")==="rtl",A=(M,y,k)=>{const S=y?y+""+M:M;let C=!!o.data?.[k??"default"]?.[S];return n&&(C=n.applyFilters("i18n.has_translation",C,M,y,k),C=n.applyFilters("i18n.has_translation_"+b(k),C,M,y,k)),C};if(n){const M=y=>{D_e.test(y)&&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:O,_nx:v,isRTL:_,hasTranslation:A}};function Uoe(e){return typeof e!="string"||e===""?(console.error("The namespace must be a non-empty string."),!1):/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)?!0:(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)}function fB(e){return typeof e!="string"||e===""?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)?!0:(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)}function WV(e,t){return function(o,r,s,i=10){const c=e[t];if(!fB(o)||!Uoe(r))return;if(typeof s!="function"){console.error("The hook callback must be a function.");return}if(typeof i!="number"){console.error("If specified, the hook priority must be a number.");return}const l={callback:s,priority:i,namespace:r};if(c[o]){const u=c[o].handlers;let d;for(d=u.length;d>0&&!(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 Iy(e,t,n=!1){return function(r,s){const i=e[t];if(!fB(r)||!n&&!Uoe(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 BV(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 Dy(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 PV(e,t){return function(o){const r=e[t];if(fB(o))return r[o]&&r[o].runs?r[o].runs:0}}class $_e{constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=WV(this,"actions"),this.addFilter=WV(this,"filters"),this.removeAction=Iy(this,"actions"),this.removeFilter=Iy(this,"filters"),this.hasAction=BV(this,"actions"),this.hasFilter=BV(this,"filters"),this.removeAllActions=Iy(this,"actions",!0),this.removeAllFilters=Iy(this,"filters",!0),this.doAction=Dy(this,"actions",!1,!1),this.doActionAsync=Dy(this,"actions",!1,!0),this.applyFilters=Dy(this,"filters",!0,!1),this.applyFiltersAsync=Dy(this,"filters",!0,!0),this.currentAction=NV(this,"actions"),this.currentFilter=NV(this,"filters"),this.doingAction=LV(this,"actions"),this.doingFilter=LV(this,"filters"),this.didAction=PV(this,"actions"),this.didFilter=PV(this,"filters")}}function Xoe(){return new $_e}const Goe=Xoe(),{addAction:a4,addFilter:Wn,removeAction:s8,removeFilter:i8,hasAction:Xfn,hasFilter:Koe,removeAllActions:Gfn,removeAllFilters:Kfn,doAction:bB,doActionAsync:V_e,applyFilters:br,applyFiltersAsync:H_e,currentAction:Yfn,currentFilter:Zfn,doingAction:Qfn,doingFilter:Jfn,didAction:e2n,didFilter:t2n,actions:n2n,filters:o2n}=Goe,Zr=F_e(void 0,void 0,Goe);Zr.getLocaleData.bind(Zr);Zr.setLocaleData.bind(Zr);Zr.resetLocaleData.bind(Zr);Zr.subscribe.bind(Zr);const m=Zr.__.bind(Zr),Pe=Zr._x.bind(Zr),Fn=Zr._n.bind(Zr);Zr._nx.bind(Zr);const It=Zr.isRTL.bind(Zr);Zr.hasTranslation.bind(Zr);function U_e(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 Yoe=(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})},X_e=e=>(t,n)=>Yoe(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 Ef(e){try{return new URL(e),!0}catch{return!1}}const G_e=/^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;function Zoe(e){return G_e.test(e)}const K_e=/^(tel:)?(\+)?\d{6,15}$/;function Y_e(e){return e=e.replace(/[-.() ]/g,""),K_e.test(e)}function J5(e){const t=/^([^\s:]+:)/.exec(e);if(t)return t[1]}function hB(e){return e?/^[a-z\-.\+]+[0-9]*:$/i.test(e):!1}function mB(e){const t=/^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(e);if(t)return t[1]}function Z_e(e){return e?/^[^\s#?]+$/.test(e):!1}function Fd(e){const t=/^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(e);if(t)return t[1]}function Q_e(e){return e?/^[^\s#?]+$/.test(e):!1}function gB(e){let t;try{t=new URL(e,"http://example.com").search.substring(1)}catch{}if(t)return t}function ex(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 J_e(e){return e?/^[^\s#?\/]+$/.test(e):!1}function eke(e){const t=Fd(e),n=gB(e);let o="/";return t&&(o+=t),n&&(o+=`?${n}`),o}function tke(e){const t=/^\S+?(#[^\s\?]*)/.exec(e);if(t)return t[1]}function a8(e){return e?/^#[^\s#?\/]*$/.test(e):!1}function qM(e){try{return decodeURIComponent(e)}catch{return e}}function nke(e,t,n){const o=t.length,r=o-1;for(let s=0;s{const[o,r=""]=n.split("=").filter(Boolean).map(qM);if(o){const s=o.replace(/\]/g,"").split("[");nke(t,s,r)}return t},Object.create(null))}function tn(e="",t){if(!t||!Object.keys(t).length)return e;let n=e;const o=e.indexOf("?");return o!==-1&&(t=Object.assign(tx(e),t),n=n.substr(0,o)),n+"?"+ex(t)}function c8(e,t){return tx(e)[t]}function jV(e,t){return c8(e,t)!==void 0}function c4(e,...t){const n=e.indexOf("?");if(n===-1)return e;const o=tx(e),r=e.substr(0,n);t.forEach(i=>delete o[i]);const s=ex(o);return s?r+"?"+s:r}const oke=/^(?:[a-z]+:|#|\?|\.|\/)/i;function Wf(e){return e&&(e=e.trim(),!oke.test(e)&&!Zoe(e)?"http://"+e:e)}function Xz(e){try{return decodeURI(e)}catch{return e}}function Gz(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 dg={exports:{}},IV;function rke(){if(IV)return dg.exports;IV=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 dg.exports=s,dg.exports.has=i,dg.exports.remove=s,dg.exports}var ske=rke();const xi=Jr(ske);function MB(e){return e?xi(e).replace(/[\s\./]+/g,"-").replace(/[^\p{L}\p{N}_-]+/gu,"").toLowerCase().replace(/-+/g,"-").replace(/(^-+)|(-+$)/g,""):""}function Bf(e){let t;if(e){try{t=new URL(e,"http://example.com").pathname.split("/").pop()}catch{}if(t)return t}}function DV(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 ike(e){const t=Object.fromEntries(Object.entries(e).map(([n,o])=>[DV(n),o]));return(n,o)=>{const{parse:r=!0}=n;let s=n.path;if(!s&&n.url){const{rest_route:l,...u}=tx(n.url);typeof l=="string"&&(s=tn(l,u))}if(typeof s!="string")return o(n);const i=n.method||"GET",c=DV(s);if(i==="GET"&&t[c]){const l=t[c];return delete t[c],FV(l,!!r)}else if(i==="OPTIONS"&&t[i]&&t[i][c]){const l=t[i][c];return delete t[i][c],FV(l,!!r)}return o(n)}}function FV(e,t){return Promise.resolve(t?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}const ake=({path:e,url:t,...n},o)=>({...n,url:t&&tn(t,o),path:e&&tn(e,o)}),$V=e=>e.json?e.json():Promise.reject(e),cke=e=>{if(!e)return{};const t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}},VV=e=>{const{next:t}=cke(e.headers.get("link"));return t},lke=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},Qoe=async(e,t)=>{if(e.parse===!1||!lke(e))return t(e);const n=await Rt({...ake(e,{per_page:100}),parse:!1}),o=await $V(n);if(!Array.isArray(o))return o;let r=VV(n);if(!r)return o;let s=[].concat(o);for(;r;){const i=await Rt({...e,path:void 0,url:r,parse:!1}),c=await $V(i);s=s.concat(c),r=VV(i)}return s},uke=new Set(["PATCH","PUT","DELETE"]),dke="GET",pke=(e,t)=>{const{method:n=dke}=e;return uke.has(n.toUpperCase())&&(e={...e,headers:{...e.headers,"X-HTTP-Method-Override":n,"Content-Type":"application/json"},method:"POST"}),t(e)},fke=(e,t)=>(typeof e.url=="string"&&!jV(e.url,"_locale")&&(e.url=tn(e.url,{_locale:"user"})),typeof e.path=="string"&&!jV(e.path,"_locale")&&(e.path=tn(e.path,{_locale:"user"})),t(e)),bke=(e,t=!0)=>t?e.status===204?null:e.json?e.json():Promise.reject(e):e,hke=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})},Joe=(e,t=!0)=>Promise.resolve(bke(e,t)).catch(n=>zB(n,t));function zB(e,t=!0){if(!t)throw e;return hke(e).then(n=>{const o={code:"unknown_error",message:m("An unknown error occurred.")};throw n||o})}function mke(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 gke=(e,t)=>{if(!mke(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)):zB(s,e.parse)}).then(s=>Joe(s,e.parse))},Mke=e=>(t,n)=>{if(typeof t.url=="string"){const o=c8(t.url,"wp_theme_preview");o===void 0?t.url=tn(t.url,{wp_theme_preview:e}):o===""&&(t.url=c4(t.url,"wp_theme_preview"))}if(typeof t.path=="string"){const o=c8(t.path,"wp_theme_preview");o===void 0?t.path=tn(t.path,{wp_theme_preview:e}):o===""&&(t.path=c4(t.path,"wp_theme_preview"))}return n(t)},zke={Accept:"application/json, */*;q=0.1"},Oke={credentials:"include"},ere=[fke,Yoe,pke,Qoe];function yke(e){ere.unshift(e)}const tre=e=>{if(e.status>=200&&e.status<300)return e;throw e},Ake=e=>{const{url:t,path:n,data:o,parse:r=!0,...s}=e;let{body:i,headers:c}=e;return c={...zke,...c},o&&(i=JSON.stringify(o),c["Content-Type"]="application/json"),window.fetch(t||n||window.location.href,{...Oke,...s,body:i,headers:c}).then(u=>Promise.resolve(u).then(tre).catch(d=>zB(d,r)).then(d=>Joe(d,r)),u=>{throw u&&u.name==="AbortError"?u:{code:"fetch_error",message:m("You are probably offline.")}})};let nre=Ake;function vke(e){nre=e}function Rt(e){return ere.reduceRight((n,o)=>r=>o(r,n),nre)(e).catch(n=>n.code!=="rest_cookie_invalid_nonce"?Promise.reject(n):window.fetch(Rt.nonceEndpoint).then(tre).then(o=>o.text()).then(o=>(Rt.nonceMiddleware.nonce=o,Rt(e))))}Rt.use=yke;Rt.setFetchHandler=vke;Rt.createNonceMiddleware=U_e;Rt.createPreloadingMiddleware=ike;Rt.createRootURLMiddleware=X_e;Rt.fetchAllMiddleware=Qoe;Rt.mediaUploadMiddleware=gke;Rt.createThemePreviewMiddleware=Mke;const HV=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 HV||(bB("deprecated",e,t,h),console.warn(h),HV[h]=!0)}function G1(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 xke=typeof Symbol=="function"&&Symbol.observable||"@@observable",UV=xke,tS=()=>Math.random().toString(36).substring(7).split("").join("."),wke={INIT:`@@redux/INIT${tS()}`,REPLACE:`@@redux/REPLACE${tS()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${tS()}`},XV=wke;function _ke(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 ore(e,t,n){if(typeof e!="function")throw new Error(G1(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(G1(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(G1(1));return n(ore)(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((O,v)=>{i.set(v,O)}))}function d(){if(l)throw new Error(G1(3));return r}function p(O){if(typeof O!="function")throw new Error(G1(4));if(l)throw new Error(G1(5));let v=!0;u();const _=c++;return i.set(_,O),function(){if(v){if(l)throw new Error(G1(6));v=!1,u(),i.delete(_),s=null}}}function f(O){if(!_ke(O))throw new Error(G1(7));if(typeof O.type>"u")throw new Error(G1(8));if(typeof O.type!="string")throw new Error(G1(17));if(l)throw new Error(G1(9));try{l=!0,r=o(r,O)}finally{l=!1}return(s=i).forEach(_=>{_()}),O}function b(O){if(typeof O!="function")throw new Error(G1(10));o=O,f({type:XV.REPLACE})}function h(){const O=p;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(G1(11));function _(){const M=v;M.next&&M.next(d())}return _(),{unsubscribe:O(_)}},[UV](){return this}}}return f({type:XV.INIT}),{dispatch:f,subscribe:p,getState:d,replaceReducer:b,[UV]:h}}function kke(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...o)=>t(n(...o)))}function Ske(...e){return t=>(n,o)=>{const r=t(n,o);let s=()=>{throw new Error(G1(15))};const i={getState:r.getState,dispatch:(l,...u)=>s(l,...u)},c=e.map(l=>l(i));return s=kke(...c)(r.dispatch),{...r,dispatch:s}}}var nS,GV;function Cke(){if(GV)return nS;GV=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 nS=s,nS}var qke=Cke();const Ta=Jr(qke);function Rke(e){return!!e&&typeof e[Symbol.iterator]=="function"&&typeof e.next=="function"}var oS={},Io={},Fy={},KV;function rre(){if(KV)return Fy;KV=1,Object.defineProperty(Fy,"__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 Fy.default=e,Fy}var YV;function sre(){if(YV)return Io;YV=1,Object.defineProperty(Io,"__esModule",{value:!0}),Io.createChannel=Io.subscribe=Io.cps=Io.apply=Io.call=Io.invoke=Io.delay=Io.race=Io.join=Io.fork=Io.error=Io.all=void 0;var e=rre(),t=n(e);function n(o){return o&&o.__esModule?o:{default:o}}return Io.all=function(r){return{type:t.default.all,value:r}},Io.error=function(r){return{type:t.default.error,error:r}},Io.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 Vy.default=r,Vy}var QV;function Tke(){if(QV)return U1;QV=1,Object.defineProperty(U1,"__esModule",{value:!0}),U1.iterator=U1.array=U1.object=U1.error=U1.any=void 0;var e=nx(),t=n(e);function n(l){return l&&l.__esModule?l:{default:l}}var o=U1.any=function(u,d,p,f){return f(u),!0},r=U1.error=function(u,d,p,f,b){return t.default.error(u)?(b(u.error),!0):!1},s=U1.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),O=0,v=!1,_=function(y,k){v||(h[y]=k,O++,O===g.length&&f(h))},A=function(y,k){v||(v=!0,b(k))};return g.map(function(M){p(u.value[M],function(y){return _(M,y)},function(y){return A(M,y)})}),!0},i=U1.array=function(u,d,p,f,b){if(!t.default.all(u)||!t.default.array(u.value))return!1;var h=[],g=0,O=!1,v=function(M,y){O||(h[M]=y,g++,g===u.value.length&&f(h))},_=function(M,y){O||(O=!0,b(y))};return u.value.map(function(A,M){p(A,function(y){return v(M,y)},function(y){return _(M,y)})}),!0},c=U1.iterator=function(u,d,p,f,b){return t.default.iterator(u)?(p(u,d,b),!0):!1};return U1.default=[r,c,i,s,o],U1}var JV;function Eke(){if(JV)return $y;JV=1,Object.defineProperty($y,"__esModule",{value:!0});var e=Tke(),t=r(e),n=nx(),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(!jke(c,s))return!1;const f=i(c);return ire(f)?f.then(d,p):d(f),!0}),o=(s,i)=>l8(s)?(t(s),i(),!0):!1;n.push(o);const r=Pke.create(n);return s=>new Promise((i,c)=>r(s,l=>{l8(l)&&t(l),i(l)},c))}function Dke(e={}){return t=>{const n=Ike(e,t.dispatch);return o=>r=>Rke(r)?n(r):o(r)}}function sr(e,t){return n=>{const o=e(n);return o.displayName=Fke(t,n),o}}const Fke=(e,t)=>{const n=t.displayName||t.name||"Component";return`${i4(e??"")}(${n})`},bs=(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 N=o,L=r;return o=void 0,r=void 0,u=E,i=e.apply(L,N),i}function h(E,N){c=setTimeout(E,N)}function g(){c!==void 0&&clearTimeout(c)}function O(E){return u=E,h(M,t),d?b(E):i}function v(E){return E-(l||0)}function _(E){const N=v(E),L=E-u,P=t-N;return p?Math.min(P,s-L):P}function A(E){const N=v(E),L=E-u;return l===void 0||N>=t||N<0||p&&L>=s}function M(){const E=Date.now();if(A(E))return k(E);h(M,_(E))}function y(){c=void 0}function k(E){return y(),f&&o?b(E):(o=r=void 0,i)}function S(){g(),u=0,y(),o=l=r=void 0}function C(){return R()?k(Date.now()):i}function R(){return c!==void 0}function T(...E){const N=Date.now(),L=A(N);if(o=E,r=this,l=N,L){if(!R())return O(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},OB=(e,t,n)=>{let o=!0,r=!0;return n&&(o="leading"in n?!!n.leading:o,r="trailing"in n?!!n.trailing:r),bs(e,t,{leading:o,trailing:r,maxWait:t})};function Db(){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 are=(e=!1)=>(...t)=>(...n)=>{const o=t.flat();return e&&o.reverse(),o.reduce((r,s)=>[s(...r)],n)[0]},Ip=are(),uo=are(!0);function yB(e){return sr(t=>n=>e(n)?a.jsx(t,{...n}):null,"ifCondition")}function cre(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=Hke(e);return t?`${t}-${o}`:o},[e,n,t])}const Uke=sr(e=>t=>{const n=Ot(e);return a.jsx(e,{...t,instanceId:n})},"instanceId"),Xke=sr(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 Gke(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 Kke(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 ox(e,{sequential:t=!1}={}){const n=e.querySelectorAll(Gke(t));return Array.from(n).filter(o=>{if(!lre(o))return!1;const{nodeName:r}=o;return r==="AREA"?Kke(o):!0})}const Yke=Object.freeze(Object.defineProperty({__proto__:null,find:ox},Symbol.toStringTag,{value:"Module"}));function u8(e){const t=e.getAttribute("tabindex");return t===null?0:parseInt(t,10)}function ure(e){return u8(e)!==-1}function Zke(){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 Qke(e,t){return{element:e,index:t}}function Jke(e){return e.element}function e6e(e,t){const n=u8(e.element),o=u8(t.element);return n===o?e.index-t.index:n-o}function AB(e){return e.filter(ure).map(Qke).sort(e6e).map(Jke).reduce(Zke(),[])}function t6e(e){return AB(ox(e))}function n6e(e){return AB(ox(e.ownerDocument.body)).reverse().find(t=>e.compareDocumentPosition(t)&e.DOCUMENT_POSITION_PRECEDING)}function o6e(e){return AB(ox(e.ownerDocument.body)).find(t=>e.compareDocumentPosition(t)&e.DOCUMENT_POSITION_FOLLOWING)}const r6e=Object.freeze(Object.defineProperty({__proto__:null,find:t6e,findNext:o6e,findPrevious:n6e,isTabbableIndex:ure},Symbol.toStringTag,{value:"Module"}));function fv(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 d8(e){const t=e.getSelection(),n=t.rangeCount?t.getRangeAt(0):null;return n?fv(n):null}function dre(e){e.defaultView;const t=e.defaultView.getSelection(),n=t.rangeCount?t.getRangeAt(0):null;return!!n&&!n.collapsed}function vB(e){return e?.nodeName==="INPUT"}function ld(e){const t=["button","checkbox","hidden","file","radio","image","range","reset","submit","number","email","time"];return vB(e)&&e.type&&!t.includes(e.type)||e.nodeName==="TEXTAREA"||e.contentEditable==="true"}function s6e(e){if(!vB(e)&&!ld(e))return!1;try{const{selectionStart:t,selectionEnd:n}=e;return t===null||t!==n}catch{return!0}}function i6e(e){return dre(e)||!!e.activeElement&&s6e(e.activeElement)}function a6e(e){return!!e.activeElement&&(vB(e.activeElement)||ld(e.activeElement)||dre(e))}function l4(e){return e.ownerDocument.defaultView,e.ownerDocument.defaultView.getComputedStyle(e)}function os(e,t="vertical"){if(e){if((t==="vertical"||t==="all")&&e.scrollHeight>e.clientHeight){const{overflowY:n}=l4(e);if(/(auto|scroll)/.test(n))return e}if((t==="horizontal"||t==="all")&&e.scrollWidth>e.clientWidth){const{overflowX:n}=l4(e);if(/(auto|scroll)/.test(n))return e}return e.ownerDocument===e.parentNode?e:os(e.parentNode,t)}}function rx(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"}function c6e(e){if(rx(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 sH(s,e,"firstChild")&&sH(i,e,"lastChild")&&c===0&&l===u}function sH(e,t,n){let o=t;do{if(e===o)return!0;o=o[n]}while(o);return!1}function pre(e){if(!e)return!1;const{tagName:t}=e;return rx(e)||t==="BUTTON"||t==="SELECT"}function xB(e){return l4(e).direction==="rtl"}function l6e(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 fre(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 u6e(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 bre(e,t,n,o){const r=o.style.zIndex,s=o.style.position,{position:i="static"}=l4(o);i==="static"&&(o.style.position="relative"),o.style.zIndex="10000";const c=u6e(e,t,n);return o.style.zIndex=r,o.style.position=s,c}function hre(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 mre(e,t,n=!1){if(rx(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=fre(s),u=s.isCollapsed;u||c.collapse(!l);const d=fv(c),p=fv(i);if(!d||!p)return!1;const f=l6e(i);if(!u&&f&&f>d.height&&l===t)return!1;const b=xB(e)?!t:t,h=e.getBoundingClientRect(),g=b?h.left+1:h.right-1,O=t?h.top+1:h.bottom-1,v=hre(e,t,()=>bre(o,g,O,e));if(!v)return!1;const _=fv(v);if(!_)return!1;const A=t?"top":"bottom",M=b?"left":"right",y=_[A]-p[A],k=_[M]-d[M],S=Math.abs(y)<=1,C=Math.abs(k)<=1;return n?S:S&&C}function rS(e,t){return mre(e,t)}function iH(e,t){return mre(e,t,!0)}function d6e(e,t,n){const{ownerDocument:o}=e,r=xB(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 bre(o,n,i,e)}function gre(e,t,n){if(!e)return;if(e.focus(),rx(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=hre(e,t,()=>d6e(e,t,n));if(!o)return;const{ownerDocument:r}=e,{defaultView:s}=r,i=s.getSelection();i.removeAllRanges(),i.addRange(o)}function Mre(e,t){return gre(e,t,void 0)}function p6e(e,t,n){return gre(e,t,n?.left)}function zre(e,t){t.parentNode,t.parentNode.insertBefore(e,t.nextSibling)}function cf(e){e.parentNode,e.parentNode.removeChild(e)}function f6e(e,t){e.parentNode,zre(t,e.parentNode),cf(e)}function sM(e){const t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}function aH(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 pg(e,t){t.parentNode,t.parentNode.insertBefore(e,t),e.appendChild(t)}function sx(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")cf(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 ls(e){e=sx(e);const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body.textContent||""}function u4(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(u4):!0;default:return!0}}const iM={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":{}},b6e=["#text","br"];Object.keys(iM).filter(e=>!b6e.includes(e)).forEach(e=>{const{[e]:t,...n}=iM;iM[e].children=n});const h6e={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"]}},Uy={...iM,...h6e};function ix(e){if(e!=="paste")return Uy;const{u:t,abbr:n,data:o,time:r,wbr:s,bdi:i,bdo:c,...l}={...Uy,ins:{children:Uy.ins.children},del:{children:Uy.del.children}};return l}function Ob(e){const t=e.nodeName.toLowerCase();return ix().hasOwnProperty(t)||t==="span"}function Ore(e){const t=e.nodeName.toLowerCase();return iM.hasOwnProperty(t)||t==="span"}function m6e(e){return!!e&&e.nodeType===e.ELEMENT_NODE}const g6e=()=>{};function jg(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(m6e(r)){const{attributes:i=[],classes:c=[],children:l,require:u=[],allowEmpty:d}=n[s];if(l&&!d&&u4(r)){cf(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):g6e);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(","))?(jg(r.childNodes,t,n,o),sM(r)):r.parentNode&&r.parentNode.nodeName==="BODY"&&Ob(r)?(jg(r.childNodes,t,n,o),Array.from(r.childNodes).some(p=>!Ob(p))&&sM(r)):jg(r.childNodes,t,l,o);else for(;r.firstChild;)cf(r.firstChild)}}}else jg(r.childNodes,t,n,o),o&&!Ob(r)&&r.nextElementSibling&&zre(t.createElement("br"),r),sM(r)})}function p8(e,t,n){const o=document.implementation.createHTMLDocument("");return o.body.innerHTML=e,jg(o.body.childNodes,o,t,n),o.body.innerHTML}function d4(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 Lr={focusable:Yke,tabbable:r6e};function mn(e,t){const n=x.useRef();return x.useCallback(o=>{o?n.current=e(o):n.current&&n.current()},t)}function wB(){return mn(e=>{function t(n){const{key:o,shiftKey:r,target:s}=n;if(o!=="Tab")return;const i=r?"findPrevious":"findNext",c=Lr.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 bv={exports:{}};/*! + * clipboard.js v2.0.11 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */var M6e=bv.exports,cH;function z6e(){return cH||(cH=1,function(e,t){(function(o,r){e.exports=r()})(M6e,function(){return function(){var n={686:function(s,i,c){c.d(i,{default:function(){return X}});var l=c(279),u=c.n(l),d=c(370),p=c.n(d),f=c(817),b=c.n(f);function h(Q){try{return document.execCommand(Q)}catch{return!1}}var g=function(ne){var ae=b()(ne);return h("cut"),ae},O=g;function v(Q){var ne=document.documentElement.getAttribute("dir")==="rtl",ae=document.createElement("textarea");ae.style.fontSize="12pt",ae.style.border="0",ae.style.padding="0",ae.style.margin="0",ae.style.position="absolute",ae.style[ne?"right":"left"]="-9999px";var be=window.pageYOffset||document.documentElement.scrollTop;return ae.style.top="".concat(be,"px"),ae.setAttribute("readonly",""),ae.value=Q,ae}var _=function(ne,ae){var be=v(ne);ae.container.appendChild(be);var re=b()(be);return h("copy"),be.remove(),re},A=function(ne){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},be="";return typeof ne=="string"?be=_(ne,ae):ne instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(ne?.type)?be=_(ne.value,ae):(be=b()(ne),h("copy")),be},M=A;function y(Q){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?y=function(ae){return typeof ae}:y=function(ae){return ae&&typeof Symbol=="function"&&ae.constructor===Symbol&&ae!==Symbol.prototype?"symbol":typeof ae},y(Q)}var k=function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=ne.action,be=ae===void 0?"copy":ae,re=ne.container,de=ne.target,le=ne.text;if(be!=="copy"&&be!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(de!==void 0)if(de&&y(de)==="object"&&de.nodeType===1){if(be==="copy"&&de.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(be==="cut"&&(de.hasAttribute("readonly")||de.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(le)return M(le,{container:re});if(de)return be==="cut"?O(de):M(de,{container:re})},S=k;function C(Q){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?C=function(ae){return typeof ae}:C=function(ae){return ae&&typeof Symbol=="function"&&ae.constructor===Symbol&&ae!==Symbol.prototype?"symbol":typeof ae},C(Q)}function R(Q,ne){if(!(Q instanceof ne))throw new TypeError("Cannot call a class as a function")}function T(Q,ne){for(var ae=0;ae"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(Q){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(ae){return ae.__proto__||Object.getPrototypeOf(ae)},F(Q)}function U(Q,ne){var ae="data-clipboard-".concat(Q);if(ne.hasAttribute(ae))return ne.getAttribute(ae)}var Z=function(Q){N(ae,Q);var ne=P(ae);function ae(be,re){var de;return R(this,ae),de=ne.call(this),de.resolveOptions(re),de.listenClick(be),de}return E(ae,[{key:"resolveOptions",value:function(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof re.action=="function"?re.action:this.defaultAction,this.target=typeof re.target=="function"?re.target:this.defaultTarget,this.text=typeof re.text=="function"?re.text:this.defaultText,this.container=C(re.container)==="object"?re.container:document.body}},{key:"listenClick",value:function(re){var de=this;this.listener=p()(re,"click",function(le){return de.onClick(le)})}},{key:"onClick",value:function(re){var de=re.delegateTarget||re.currentTarget,le=this.action(de)||"copy",ze=S({action:le,container:this.container,target:this.target(de),text:this.text(de)});this.emit(ze?"success":"error",{action:le,text:ze,trigger:de,clearSelection:function(){de&&de.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(re){return U("action",re)}},{key:"defaultTarget",value:function(re){var de=U("target",re);if(de)return document.querySelector(de)}},{key:"defaultText",value:function(re){return U("text",re)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(re){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return M(re,de)}},{key:"cut",value:function(re){return O(re)}},{key:"isSupported",value:function(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],de=typeof re=="string"?[re]:re,le=!!document.queryCommandSupported;return de.forEach(function(ze){le=le&&!!document.queryCommandSupported(ze)}),le}}]),ae}(u()),X=Z},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,O){var v=p.apply(this,arguments);return f.addEventListener(h,v,O),{destroy:function(){f.removeEventListener(h,v,O)}}}function d(f,b,h,g,O){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(v){return u(v,b,h,g,O)}))}function p(f,b,h,g){return function(O){O.delegateTarget=l(O.target,b),O.delegateTarget&&g.call(f,O)}}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,O){if(!h&&!g&&!O)throw new Error("Missing required arguments");if(!l.string(g))throw new TypeError("Second argument must be a String");if(!l.fn(O))throw new TypeError("Third argument must be a Function");if(l.node(h))return p(h,g,O);if(l.nodeList(h))return f(h,g,O);if(l.string(h))return b(h,g,O);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function p(h,g,O){return h.addEventListener(g,O),{destroy:function(){h.removeEventListener(g,O)}}}function f(h,g,O){return Array.prototype.forEach.call(h,function(v){v.addEventListener(g,O)}),{destroy:function(){Array.prototype.forEach.call(h,function(v){v.removeEventListener(g,O)})}}}function b(h,g,O){return u(document.body,h,g,O)}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 $d(e,t){const n=lH(e),o=lH(t);return mn(r=>{const s=new y6e(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 ic(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 ac=8,Fb=9,Kr=13,ud=27,_B=32,A6e=33,v6e=34,RM=35,yb=36,mi=37,Za=38,gi=39,S1=40,pl=46,x6e=121,Fi="alt",Na="ctrl",Dp="meta",$i="shift";function yre(e){return e.length<2?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)}function Kz(e,t){return Object.fromEntries(Object.entries(e).map(([n,o])=>[n,t(o)]))}const ax={primary:e=>e()?[Dp]:[Na],primaryShift:e=>e()?[$i,Dp]:[Na,$i],primaryAlt:e=>e()?[Fi,Dp]:[Na,Fi],secondary:e=>e()?[$i,Fi,Dp]:[Na,$i,Fi],access:e=>e()?[Na,Fi]:[$i,Fi],ctrl:()=>[Na],alt:()=>[Fi],ctrlShift:()=>[Na,$i],shift:()=>[$i],shiftAlt:()=>[$i,Fi],undefined:()=>[]},w6e=Kz(ax,e=>(t,n=ic)=>[...e(n),t.toLowerCase()].join("+")),Are=Kz(ax,e=>(t,n=ic)=>{const o=n(),r={[Fi]:o?"⌥":"Alt",[Na]:o?"⌃":"Ctrl",[Dp]:"⌘",[$i]: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,"+"]},[]),yre(t)]}),C1=Kz(Are,e=>(t,n=ic)=>e(t,n).join("")),vre=Kz(ax,e=>(t,n=ic)=>{const o=n(),r={[$i]:"Shift",[Dp]:o?"Command":"Control",[Na]:"Control",[Fi]:o?"Option":"Alt",",":m("Comma"),".":m("Period"),"`":m("Backtick"),"~":m("Tilde")};return[...e(n),t].map(s=>{var i;return yre((i=r[s])!==null&&i!==void 0?i:s)}).join(o?" ":" + ")});function _6e(e){return[Fi,Na,Dp,$i].filter(t=>e[`${t}Key`])}const Qa=Kz(ax,e=>(t,n,o=ic)=>{const r=e(o),s=_6e(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 cx(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=Lr.tabbable.find(r)[0];i&&n(i)},0),()=>{o.current&&clearTimeout(o.current)}}},[])}let Xy=null;function kB(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=Xy)!==null&&i!==void 0||(Xy=n.current);return}o.current?o.current():(n.current.isConnected?n.current:Xy)?.focus(),Xy=null}},[])}const k6e=["button","submit"];function S6e(e){if(!(e instanceof window.HTMLElement))return!1;switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return k6e.includes(e.type)}return!1}function xre(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:S6e(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 Gy(e,t){typeof e=="function"?e(t):e&&e.hasOwnProperty("current")&&(e.current=t)}function vn(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&&(Gy(l,null),Gy(i,t.current))}),r.current=e},e),x.useLayoutEffect(()=>{o.current=!1}),x.useCallback(i=>{Gy(t,i),o.current=!0,n.current=i!==null;const c=i?s.current:r.current;for(const l of c)Gy(l,i)},[])}function wre(e){const t=x.useRef(),{constrainTabbing:n=e.focusOnMount!==!1}=e;x.useEffect(()=>{t.current=e},Object.values(e));const o=wB(),r=cx(e.focusOnMount),s=kB(),i=xre(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===ud&&!u.defaultPrevented&&t.current?.onClose&&(u.preventDefault(),t.current.onClose())})},[]);return[vn([n?o:null,e.focusOnMount!==!1?s:null,e.focusOnMount!==!1?r:null,c]),{...i,tabIndex:-1}]}function SB({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=bs(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 ai(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 CB=typeof window<"u"?x.useLayoutEffect:x.useEffect;function _re({onDragStart:e,onDragMove:t,onDragEnd:n}){const[o,r]=x.useState(!1),s=x.useRef({onDragStart:e,onDragMove:t,onDragEnd:n});CB(()=>{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 uH=new Map;function C6e(e){if(!e)return null;let t=uH.get(e);return t||(typeof window<"u"&&typeof window.matchMedia=="function"?(t=window.matchMedia(e),uH.set(e,t),t):null)}function qB(e){const t=x.useMemo(()=>{const n=C6e(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 Tr(e){const t=x.useRef();return x.useEffect(()=>{t.current=e},[e]),t.current}const hs=()=>qB("(prefers-reduced-motion: reduce)");function q6e(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 dH=(e,t)=>{const n=e?.findIndex(({id:r})=>typeof r=="string"?r===t.id:ns(r,t.id)),o=[...e];return n!==-1?o[n]={id:t.id,changes:q6e(o[n].changes,t.changes)}:o.push(t),o};function R6e(){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=dH(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"&&!ns(u,d))).length;return{addRecord(i,c=!1){const l=!i||s(i);if(c){if(l)return;i.forEach(u=>{t=dH(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 pH={xhuge:1920,huge:1440,wide:1280,xlarge:1080,large:960,medium:782,small:600,mobile:480},T6e={">=":"min-width","<":"max-width"},E6e={">=":(e,t)=>t>=e,"<":(e,t)=>t=")=>{const n=x.useContext(kre),o=!n&&`(${T6e[t]}: ${pH[e]}px)`,r=qB(o||void 0);return n?E6e[t](pH[e],n):r};Zn.__experimentalWidthProvider=kre.Provider;function Sre(e,t={}){const n=ai(e),o=x.useRef(),r=x.useRef();return ai(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 W6e=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}},B6e={position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",opacity:0,overflow:"hidden",zIndex:-1};function N6e({onResize:e}){const t=Sre(n=>{const o=W6e(n.at(-1));e(o)});return a.jsx("div",{ref:t,style:B6e,"aria-hidden":"true"})}function L6e(e,t){return e.width===t.width&&e.height===t.height}const fH={width:null,height:null};function P6e(){const[e,t]=x.useState(fH),n=x.useRef(fH),o=x.useCallback(s=>{L6e(n.current,s)||(n.current=s,t(s))},[]);return[a.jsx(N6e,{onResize:o}),e]}function Ns(e,t={}){return e?Sre(e,t):P6e()}var sS={exports:{}},bH;function j6e(){return bH||(bH=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 s1!=null?s1: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,O=0,v={get didTimeout(){return!1},timeRemaining:function(){var N=p-(Date.now()-g);return N<0?0:N}},_=A(function(){p=22,b=66,f=0});function A(N){var L,P,I=99,j=function(){var H=Date.now()-P;H9?o=setTimeout(S,n):(n=0,S()))}function R(){var N,L,P,I=p>9?9:1;if(g=Date.now(),d=!1,o=null,u>2||g-n-50I;L++)N=l.shift(),O++,N&&N(v);l.length?C():u=0}function T(N){return h++,l.push(N),C(),h}function E(N){var L=N-1-O;l[L]&&(l[L]=null)}if(!s.requestIdleCallback||!s.cancelIdleCallback)s.requestIdleCallback=T,s.cancelIdleCallback=E,s.document&&document.addEventListener&&(s.addEventListener("scroll",y,!0),s.addEventListener("resize",y),document.addEventListener("focus",y,!0),document.addEventListener("mouseover",y,!0),["click","keypress","touchstart","mousedown"].forEach(function(N){document.addEventListener(N,y,{capture:!0,passive:!0})}),s.MutationObserver&&new MutationObserver(y).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}));else try{s.requestIdleCallback(function(){},{timeout:0})}catch{(function(L){var P,I;if(s.requestIdleCallback=function(j,H){return H&&typeof H.timeout=="number"?L(j,H.timeout):L(j)},s.IdleCallbackDeadline&&(P=IdleCallbackDeadline.prototype)){if(I=Object.getOwnPropertyDescriptor(P,"timeRemaining"),!I||!I.configurable||!I.get)return;Object.defineProperty(P,"timeRemaining",{value:function(){return I.get.call(this)},enumerable:!0,configurable:!0})}})(s.requestIdleCallback)}return{request:T,cancel:E}})}(sS)),sS.exports}j6e();function I6e(){return typeof window>"u"?e=>{setTimeout(()=>e(Date.now()),0)}:window.requestIdleCallback}const hH=I6e(),Cre=()=>{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}hH(n)};return{add:(c,l)=>{e.set(c,l),t||(t=!0,hH(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 D6e(e,t){const n=[];for(let o=0;o{let s=D6e(e,o);s.length{cs.flushSync(()=>{r(l=>[...l,...e.slice(c,c+n)])})});return()=>i.reset()},[e]),o}function F6e(e,t){if(e.length!==t.length)return!1;for(var n=0;nbs(e,t??0,n),[e,t,n]);return x.useEffect(()=>()=>o.cancel(),[o]),o}function Rre(e=""){const[t,n]=x.useState(e),[o,r]=x.useState(e),s=y1(r,250);return x.useEffect(()=>{s(t)},[t,s]),[t,n,o]}function f8(e,t,n){const o=qre(()=>OB(e,t??0,n),[e,t,n]);return x.useEffect(()=>()=>o.cancel(),[o]),o}function lx({dropZoneElement:e,isDisabled:t,onDrop:n,onDragStart:o,onDragEnter:r,onDragLeave:s,onDragEnd:i,onDragOver:c}){const l=ai(n),u=ai(o),d=ai(r),p=ai(s),f=ai(i),b=ai(c);return mn(h=>{if(t)return;const g=e??h;let O=!1;const{ownerDocument:v}=g;function _(R){const{defaultView:T}=v;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 A(R){O||(O=!0,v.addEventListener("dragend",C),v.addEventListener("mousemove",C),o&&u(R))}function M(R){R.preventDefault(),!g.contains(R.relatedTarget)&&r&&d(R)}function y(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){O&&(O=!1,v.removeEventListener("dragend",C),v.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",y),g.addEventListener("dragleave",k),v.addEventListener("dragenter",A),()=>{g.removeAttribute("data-is-drop-zone"),g.removeEventListener("drop",S),g.removeEventListener("dragenter",M),g.removeEventListener("dragover",y),g.removeEventListener("dragleave",k),v.removeEventListener("dragend",C),v.removeEventListener("mousemove",C),v.removeEventListener("dragenter",A)}},[t,e])}function Tre(){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 $6e=30;function V6e(e,t,n,o){var r,s;const i=(r=o?.initWindowSize)!==null&&r!==void 0?r:$6e,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=os(e.current),p=b=>{var h;if(!d)return;const g=Math.ceil(d.clientHeight/t),O=b?g:(h=o?.windowOverscan)!==null&&h!==void 0?h:g,v=Math.floor(d.scrollTop/t),_=Math.max(0,v-O),A=Math.min(n-1,v+g+O);u(M=>{const y={visibleItems:g,start:_,end:A,itemInView:k=>_<=k&&k<=A};return M.start!==y.start||M.end!==y.end||M.visibleItems!==y.visibleItems?y:M})};p(!0);const f=bs(()=>{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=os(e.current),p=f=>{switch(f.keyCode){case yb:return d?.scrollTo({top:0});case RM:return d?.scrollTo({top:n*t});case A6e:return d?.scrollTo({top:d.scrollTop-l.visibleItems*t});case v6e: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 Ere(e,t){const[n,o]=x.useMemo(()=>[r=>e.subscribe(t,r),()=>e.get(t)],[e,t]);return x.useSyncExternalStore(n,o,o)}function Wre(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 kt(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 iS(e){return e.isRegistryControl=!0,e}const H6e="@@data/SELECT",U6e="@@data/RESOLVE_SELECT",X6e="@@data/DISPATCH",G6e={[H6e]:iS(e=>({storeKey:t,selectorName:n,args:o})=>e.select(t)[n](...o)),[U6e]:iS(e=>({storeKey:t,selectorName:n,args:o})=>{const r=e.select(t)[n].hasResolver?"resolveSelect":"select";return e[r](t)[n](...o)}),[X6e]:iS(e=>({storeKey:t,actionName:n,args:o})=>e.dispatch(t)[n](...o))},K6e=["@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"],mH=[],Y6e=!globalThis.IS_WORDPRESS_CORE,A1=(e,t)=>{if(!K6e.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(!Y6e&&mH.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 mH.push(t),{lock:Z6e,unlock:Q6e}};function Z6e(e,t){if(!e)throw new Error("Cannot lock an undefined object.");const n=e;aM in n||(n[aM]={}),Bre.set(n[aM],t)}function Q6e(e){if(!e)throw new Error("Cannot unlock an undefined object.");const t=e;if(!(aM in t))throw new Error("Cannot unlock an object that was not locked before. ");return Bre.get(t[aM])}const Bre=new WeakMap,aM=Symbol("Private API ID"),{lock:Ig,unlock:E2}=A1("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"),J6e=()=>e=>t=>ire(t)?t.then(n=>{if(n)return e(n)}):e(t),eSe=(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 nSe=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 Ru(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 oSe=nSe("selectorName")((e=new Ta,t)=>{switch(t.type){case"START_RESOLUTION":{const n=new Ta(e);return n.set(Ru(t.args),{status:"resolving"}),n}case"FINISH_RESOLUTION":{const n=new Ta(e);return n.set(Ru(t.args),{status:"finished"}),n}case"FAIL_RESOLUTION":{const n=new Ta(e);return n.set(Ru(t.args),{status:"error",error:t.error}),n}case"START_RESOLUTIONS":{const n=new Ta(e);for(const o of t.args)n.set(Ru(o),{status:"resolving"});return n}case"FINISH_RESOLUTIONS":{const n=new Ta(e);for(const o of t.args)n.set(Ru(o),{status:"finished"});return n}case"FAIL_RESOLUTIONS":{const n=new Ta(e);return t.args.forEach((o,r)=>{const s={status:"error",error:void 0},i=t.errors[r];i&&(s.error=i),n.set(Ru(o),s)}),n}case"INVALIDATE_RESOLUTION":{const n=new Ta(e);return n.delete(Ru(t.args)),n}}return e}),rSe=(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 oSe(e,t)}return e};var aS={};function sSe(e){return[e]}function iSe(e){return!!e&&typeof e=="object"}function aSe(){var e={clear:function(){e.head=null}};return e}function gH(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 hSe=Lt(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]),mSe=Object.freeze(Object.defineProperty({__proto__:null,countSelectorsByStatus:hSe,getCachedResolvers:fSe,getIsResolving:cSe,getResolutionError:dSe,getResolutionState:Nf,hasFinishedResolution:lSe,hasResolutionFailed:uSe,hasResolvingSelectors:bSe,hasStartedResolution:Nre,isResolving:pSe},Symbol.toStringTag,{value:"Module"}));function Lre(e,t){return{type:"START_RESOLUTION",selectorName:e,args:t}}function Pre(e,t){return{type:"FINISH_RESOLUTION",selectorName:e,args:t}}function jre(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 MSe(e,t){return{type:"FINISH_RESOLUTIONS",selectorName:e,args:t}}function zSe(e,t,n){return{type:"FAIL_RESOLUTIONS",selectorName:e,args:t,errors:n}}function OSe(e,t){return{type:"INVALIDATE_RESOLUTION",selectorName:e,args:t}}function ySe(){return{type:"INVALIDATE_RESOLUTION_FOR_STORE"}}function ASe(e){return{type:"INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR",selectorName:e}}const vSe=Object.freeze(Object.defineProperty({__proto__:null,failResolution:jre,failResolutions:zSe,finishResolution:Pre,finishResolutions:MSe,invalidateResolution:OSe,invalidateResolutionForStore:ySe,invalidateResolutionForStoreSelector:ASe,startResolution:Lre,startResolutions:gSe},Symbol.toStringTag,{value:"Module"})),cS=e=>{const t=[...e];for(let n=t.length-1;n>=0;n--)t[n]===void 0&&t.splice(n,1);return t},$u=(e,t)=>Object.fromEntries(Object.entries(e??{}).map(([n,o])=>[n,t(o,n)])),xSe=(e,t)=>t instanceof Map?Object.fromEntries(t):t instanceof window.HTMLElement?null:t;function wSe(){const e={};return{isRunning(t,n){return e[t]&&e[t].get(cS(n))},clear(t,n){e[t]&&e[t].delete(cS(n))},markAsRunning(t,n){e[t]||(e[t]=new Ta),e[t].set(cS(n),!0)}}}function MH(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 q1(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=_Se(e,t,i,{registry:i,get dispatch(){return O},get select(){return S},get resolveSelect(){return N()}});Ig(d,r);const p=wSe();function f(j){return(...H)=>Promise.resolve(d.dispatch(j(...H)))}const b={...$u(vSe,f),...$u(t.actions,f)},h=MH(f),g=new Proxy(()=>{},{get:(j,H)=>{const F=n[H];return F?h.get(F,H):b[H]}}),O=new Proxy(g,{apply:(j,H,[F])=>d.dispatch(F)});Ig(b,g);const v=t.resolvers?CSe(t.resolvers):{};function _(j,H){j.isRegistrySelector&&(j.registry=i);const F=(...Z)=>{Z=b8(j,Z);const X=d.__unstableOriginalGetState();return j.isRegistrySelector&&(j.registry=i),j(X.root,...Z)};F.__unstableNormalizeArgs=j.__unstableNormalizeArgs;const U=v[H];return U?qSe(F,H,U,d,p):(F.hasResolver=!1,F)}function A(j){const H=(...F)=>{const U=d.__unstableOriginalGetState(),Z=F&&F[0],X=F&&F[1],Q=t?.selectors?.[Z];return Z&&Q&&(F[1]=b8(Q,X)),j(U.metadata,...F)};return H.hasResolver=!1,H}const M={...$u(mSe,A),...$u(t.selectors,_)},y=MH(_);for(const[j,H]of Object.entries(o))y.get(H,j);const k=new Proxy(()=>{},{get:(j,H)=>{const F=o[H];return F?y.get(F,H):M[H]}}),S=new Proxy(k,{apply:(j,H,[F])=>F(d.__unstableOriginalGetState())});Ig(M,k);const C=kSe(M,d),R=SSe(M,d),T=()=>M,E=()=>b,N=()=>C,L=()=>R;d.__unstableOriginalGetState=d.getState,d.getState=()=>d.__unstableOriginalGetState().root;const P=d&&(j=>(c.add(j),()=>c.delete(j)));let I=d.__unstableOriginalGetState();return d.subscribe(()=>{const j=d.__unstableOriginalGetState(),H=j!==I;if(I=j,H)for(const F of c)F()}),{reducer:l,store:d,actions:b,selectors:M,resolvers:v,getSelectors:T,getResolveSelectors:N,getSuspendSelectors:L,getActions:E,subscribe:P}}};return Ig(s,r),s}function _Se(e,t,n,o){const r={...t.controls,...G6e},s=$u(r,p=>p.isRegistryControl?p(n):p),i=[eSe(n,e),J6e,Dke(s),tSe(o)],c=[Ske(...i)];typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&c.push(window.__REDUX_DEVTOOLS_EXTENSION__({name:e,instanceId:e,serialize:{replacer:xSe}}));const{reducer:l,initialState:u}=t,d=Wre({metadata:rSe,root:l});return ore(d,{root:u},uo(c))}function kSe(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 $u(f,(b,h)=>b.hasResolver?(...g)=>new Promise((O,v)=>{const _=()=>e.hasFinishedResolution(h,g),A=S=>{if(e.hasResolutionFailed(h,g)){const R=e.getResolutionError(h,g);v(R)}else O(S)},M=()=>b.apply(null,g),y=M();if(_())return A(y);const k=t.subscribe(()=>{_()&&(k(),A(M()))})}):async(...g)=>b.apply(null,g))}function SSe(e,t){return $u(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 CSe(e){return $u(e,t=>t.fulfill?t:{...t,fulfill:t})}function qSe(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();Nre(u,t,c)||(r.markAsRunning(t,c),setTimeout(async()=>{r.clear(t,c),o.dispatch(Lre(t,c));try{const d=n.fulfill(...c);d&&await o.dispatch(d),o.dispatch(Pre(t,c))}catch(d){o.dispatch(jre(t,c,d))}},0))}const i=(...c)=>(c=b8(e,c),s(c),e(...c));return i.hasResolver=!0,i}function b8(e,t){return e.__unstableNormalizeArgs&&typeof e.__unstableNormalizeArgs=="function"&&t?.length?e.__unstableNormalizeArgs(t):t}const RSe={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 zH(){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 fg(e){return typeof e=="string"?e:e.name}function RB(e={},t=null){const n={},o=zH();let r=null;function s(){o.emit()}const i=(y,k)=>{if(!k)return o.subscribe(y);const S=fg(k),C=n[S];return C?C.subscribe(y):t?t.subscribe(y,k):o.subscribe(y)};function c(y){const k=fg(y);r?.add(k);const S=n[k];return S?S.getSelectors():t?.select(k)}function l(y,k){r=new Set;try{return y.call(this)}finally{k.current=Array.from(r),r=null}}function u(y){const k=fg(y);r?.add(k);const S=n[k];return S?S.getResolveSelectors():t&&t.resolveSelect(k)}function d(y){const k=fg(y);r?.add(k);const S=n[k];return S?S.getSuspendSelectors():t&&t.suspendSelect(k)}function p(y){const k=fg(y),S=n[k];return S?S.getActions():t&&t.dispatch(k)}function f(y){return Object.fromEntries(Object.entries(y).map(([k,S])=>typeof S!="function"?[k,S]:[k,function(){return _[k].apply(null,arguments)}]))}function b(y,k){if(n[y])return console.error('Store "'+y+'" is already registered.'),n[y];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=zH();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[y]=S,S.subscribe(s),t)try{E2(S.store).registerPrivateActions(E2(t).privateActionsOf(y)),E2(S.store).registerPrivateSelectors(E2(t).privateSelectorsOf(y))}catch{}return S}function h(y){b(y.name,()=>y.instantiate(_))}function g(y,k){Ze("wp.data.registerGenericStore",{since:"5.9",alternative:"wp.data.register( storeDescriptor )"}),b(y,()=>k)}function O(y,k){if(!k.reducer)throw new TypeError("Must specify store reducer");return b(y,()=>q1(y,k).instantiate(_)).store}function v(y){if(o.isPaused){y();return}o.pause(),Object.values(n).forEach(k=>k.emitter.pause());try{y()}finally{o.resume(),Object.values(n).forEach(k=>k.emitter.resume())}}let _={batch:v,stores:n,namespaces:n,subscribe:i,select:c,resolveSelect:u,suspendSelect:d,dispatch:p,use:A,register:h,registerGenericStore:g,registerStore:O,__unstableMarkListeningStores:l};function A(y,k){if(y)return _={..._,...y(_,k)},_}_.register(RSe);for(const[y,k]of Object.entries(e))_.register(q1(y,k));t&&t.subscribe(s);const M=f(_);return Ig(M,{privateActionsOf:y=>{try{return E2(n[y].store).privateActions}catch{return{}}},privateSelectorsOf:y=>{try{return E2(n[y].store).privateSelectors}catch{return{}}}}),M}const zc=RB();var lS,OH;function TSe(){if(OH)return lS;OH=1;var e=function(_){return t(_)&&!n(_)};function t(v){return!!v&&typeof v=="object"}function n(v){var _=Object.prototype.toString.call(v);return _==="[object RegExp]"||_==="[object Date]"||s(v)}var o=typeof Symbol=="function"&&Symbol.for,r=o?Symbol.for("react.element"):60103;function s(v){return v.$$typeof===r}function i(v){return Array.isArray(v)?[]:{}}function c(v,_){return _.clone!==!1&&_.isMergeableObject(v)?g(i(v),v,_):v}function l(v,_,A){return v.concat(_).map(function(M){return c(M,A)})}function u(v,_){if(!_.customMerge)return g;var A=_.customMerge(v);return typeof A=="function"?A:g}function d(v){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(v).filter(function(_){return Object.propertyIsEnumerable.call(v,_)}):[]}function p(v){return Object.keys(v).concat(d(v))}function f(v,_){try{return _ in v}catch{return!1}}function b(v,_){return f(v,_)&&!(Object.hasOwnProperty.call(v,_)&&Object.propertyIsEnumerable.call(v,_))}function h(v,_,A){var M={};return A.isMergeableObject(v)&&p(v).forEach(function(y){M[y]=c(v[y],A)}),p(_).forEach(function(y){b(v,y)||(f(v,y)&&A.isMergeableObject(_[y])?M[y]=u(y,A)(v[y],_[y],A):M[y]=c(_[y],A))}),M}function g(v,_,A){A=A||{},A.arrayMerge=A.arrayMerge||l,A.isMergeableObject=A.isMergeableObject||e,A.cloneUnlessOtherwiseSpecified=c;var M=Array.isArray(_),y=Array.isArray(v),k=M===y;return k?M?A.arrayMerge(v,_,A):h(v,_,A):c(_,A)}g.all=function(_,A){if(!Array.isArray(_))throw new Error("first argument should be an array");return _.reduce(function(M,y){return g(M,y,A)},{})};var O=g;return lS=O,lS}var ESe=TSe();const Ire=Jr(ESe),Dre=x.createContext(zc),{Consumer:s2n,Provider:Fre}=Dre;function Gn(){return x.useContext(Dre)}const $re=x.createContext(!1),{Consumer:i2n,Provider:ux}=$re;function WSe(){return x.useContext($re)}const uS=Cre();function BSe(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 NSe(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 O(_){if(i)for(const S of h)d.get(S)!==p(S)&&(i=!1);d.clear();const A=()=>{i=!1,_()},M=()=>{c?uS.add(o,A):A()},y=[];function k(S){y.push(e.subscribe(M,S))}for(const S of h)k(S);return g.add(k),()=>{g.delete(k);for(const S of y.values())S?.();uS.cancel(o)}}function v(_){for(const A of _)if(!h.includes(A)){h.push(A);for(const M of g)M(A)}}return{subscribe:O,updateStores:v}};return(b,h)=>{function g(){if(i&&b===r)return s;const v={current:null},_=e.__unstableMarkListeningStores(()=>b(n,e),v);if(globalThis.SCRIPT_DEBUG&&!u){const A=b(n,e);ns(_,A)||(BSe(_,A),u=!0)}if(l)l.updateStores(v.current);else{for(const A of v.current)d.set(A,p(A));l=f(v.current)}ns(s,_)||(s=_),r=b,i=!0}function O(){return g(),s}return c&&!h&&(i=!1,uS.cancel(o)),g(),c=h,{subscribe:l.subscribe,getValue:O}}}function LSe(e){return Gn().select(e)}function PSe(e,t,n){const o=Gn(),r=WSe(),s=x.useMemo(()=>NSe(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 K(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?LSe(e):PSe(!1,e,t)}const B1=e=>sr(t=>Vke(n=>{const r=K((s,i)=>e(s,n,i));return a.jsx(t,{...n,...r})}),"withSelect"),Ae=e=>{const{dispatch:t}=Gn();return e===void 0?t:t(e)},jSe=(e,t)=>{const n=Gn(),o=x.useRef(e);return CB(()=>{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])},Oc=e=>sr(t=>n=>{const r=jSe((s,i)=>e(s,n,i),[]);return a.jsx(t,{...n,...r})},"withDispatch");function er(e){return zc.dispatch(e)}function no(e){return zc.select(e)}const H0=Wre,ISe=zc.resolveSelect;zc.suspendSelect;const DSe=zc.subscribe;zc.registerGenericStore;const FSe=zc.registerStore;zc.use;const ki=zc.register;var dS,yH;function $Se(){return yH||(yH=1,dS=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}),dS}var VSe=$Se();const S0=Jr(VSe);function HSe(e,t){if(!e)return t;let n=!1;const o={};for(const r in t)S0(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 dd(e){return typeof e=="string"?e.split(","):Array.isArray(e)?e:null}const Vre=e=>t=>(n,o)=>n===void 0||e(o)?t(n,o):n,TB=e=>(...t)=>async({resolveSelect:n})=>{await n[e](...t)},AH=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}},Hre=e=>t=>(n,o)=>t(n,e(o));function USe(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 XSe(e,t){return(e.rawAttributes||[]).includes(t)}function dx(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 GSe(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 KSe(e){return/^\s*\d+\s*$/.test(e)}const cM=["create","read","update","delete"];function EB(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 px(e,t,n){return(typeof t=="object"?[e,t.kind,t.name,t.id]:[e,t,n]).filter(Boolean).join("/")}function Ure(e,t,n){return{type:"RECEIVE_ITEMS",items:Array.isArray(e)?e:[e],persistedEdits:t,meta:n}}function YSe(e,t,n,o=!1){return{type:"REMOVE_ITEMS",itemIds:Array.isArray(n)?n:[n],kind:e,name:t,invalidateCache:o}}function ZSe(e,t={},n,o){return{...Ure(e,n,o),query:t}}function QSe(e){const t={stableKey:"",page:1,perPage:10,fields:null,include:null,context:"default"},n=Object.keys(e).sort();for(let s=0;s{_=_?.[A]}),dx(g,v,_)}}else{if(!e.itemIsComplete[c]?.[b])return null;g=h}p.push(g)}return p}const Xre=Lt((e,t={})=>{let n=vH.get(e);if(n){const r=n.get(t);if(r!==void 0)return r}else n=new Ta,vH.set(e,n);const o=JSe(e,t);return n.set(t,o),o});function Gre(e,t={}){var n;const{stableKey:o,context:r}=Sh(t);return(n=e.queries?.[r]?.[o]?.meta?.totalItems)!==null&&n!==void 0?n:null}function eCe(e,t={}){var n;const{stableKey:o,context:r}=Sh(t);return(n=e.queries?.[r]?.[o]?.meta?.totalPages)!==null&&n!==void 0?n:null}function tCe(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 nCe=H0({formatTypes:tCe}),WB=Lt(e=>Object.values(e.formatTypes),e=>[e.formatTypes]);function oCe(e,t){return e.formatTypes[t]}function rCe(e,t){const n=WB(e);return n.find(({className:o,tagName:r})=>o===null&&t===r)||n.find(({className:o,tagName:r})=>o===null&&r==="*")}function sCe(e,t){return WB(e).find(({className:n})=>n===null?!1:` ${t} `.indexOf(` ${n} `)>=0)}const iCe=Object.freeze(Object.defineProperty({__proto__:null,getFormatType:oCe,getFormatTypeForBareElement:rCe,getFormatTypeForClassName:sCe,getFormatTypes:WB},Symbol.toStringTag,{value:"Module"}));function aCe(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function cCe(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}const lCe=Object.freeze(Object.defineProperty({__proto__:null,addFormatTypes:aCe,removeFormatTypes:cCe},Symbol.toStringTag,{value:"Module"})),uCe="core/rich-text",Ui=q1(uCe,{reducer:nCe,selectors:iCe,actions:lCe});ki(Ui);function p4(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];p4(i,l)&&(s[c]=l)}),t[o]=s}}),{...e,formats:t}}function xH(e,t,n){return e=e.slice(),e[t]=n,e}function yi(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]=xH(i[n],l,t),n--;for(o++;i[o]&&i[o][l]===c;)i[o]=xH(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 rl({implementation:e},t){return rl.body||(rl.body=e.createHTMLDocument("").body),rl.body.innerHTML=t,rl.body}const sl="",Kre="\uFEFF";function BB(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.lengthp4(p,f))||c.splice(d,1)}if(c.length===0)return t}return c||t}function Yre(e){return no(Ui).getFormatType(e)}function wH(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 Ky({type:e,tagName:t,attributes:n,unregisteredAttributes:o,object:r,boundaryClass:s,isEditableTree:i}){const c=Yre(e);let l={};if(s&&i&&(l["data-rich-text-format-boundary"]="true"),!c)return n&&(l={...n,...l}),{type:e,attributes:wH(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:wH(l,i)}}function dCe(e,t,n){do if(e[n]!==t[n])return!1;while(n--);return!0}function Zre({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:O,start:v,end:_}=e,A=h.length+1,M=n(),y=BB(e),k=y[y.length-1];let S,C;o(M,"");for(let R=0;R{if(L&&S&&dCe(N,S,I)){L=r(L);return}const{type:j,tagName:H,attributes:F,unregisteredAttributes:U}=P,Z=f&&P===k,X=s(L),Q=o(X,Ky({type:j,tagName:H,attributes:F,unregisteredAttributes:U,boundaryClass:Z,isEditableTree:f}));i(L)&&c(L).length===0&&l(L),L=o(Q,"")}),R===0&&(d&&v===0&&d(M,L),p&&_===0&&p(M,L)),T===sl){const P=g[R];if(!P)continue;const{type:I,attributes:j,innerHTML:H}=P,F=Yre(I);f&&I==="#comment"?(L=o(s(L),{type:"span",attributes:{contenteditable:"false","data-rich-text-comment":j["data-rich-text-comment"]}}),o(o(L,{type:"span"}),j["data-rich-text-comment"].trim())):!f&&I==="script"?(L=o(s(L),Ky({type:"script",isEditableTree:f})),o(L,{html:decodeURIComponent(j["data-rich-text-script"])})):F?.contentEditable===!1?(L=o(s(L),Ky({...P,isEditableTree:f,boundaryClass:v===R&&_===R+1})),H&&o(L,{html:H})):L=o(s(L),Ky({...P,object:!0,isEditableTree:f})),L=o(s(L),"")}else!t&&T===` +`?(L=o(s(L),{type:"br",attributes:f?{"data-rich-text-line-break":"true"}:void 0,object:!0}),L=o(s(L),"")):i(L)?u(L,T):L=o(s(L),T);d&&v===R+1&&d(M,L),p&&_===R+1&&p(M,L),E&&R===O.length&&(o(s(L),Kre),b&&O.length===0&&o(s(L),{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=N,C=T}return M}function x0({value:e,preserveWhiteSpace:t}){const n=Zre({value:e,preserveWhiteSpace:t,createEmpty:pCe,append:bCe,getLastChild:fCe,getParent:mCe,isText:gCe,getText:MCe,remove:zCe,appendText:hCe});return Qre(n.children)}function pCe(){return{}}function fCe({children:e}){return e&&e[e.length-1]}function bCe(e,t){return typeof t=="string"&&(t={text:t}),t.parent=e,e.children=e.children||[],e.children.push(t),t}function hCe(e,t){e.text+=t}function mCe({parent:e}){return e}function gCe({text:e}){return typeof e=="string"}function MCe({text:e}){return e}function zCe(e){const t=e.parent.children.indexOf(e);return t!==-1&&e.parent.children.splice(t,1),e}function OCe({type:e,attributes:t,object:n,children:o}){if(e==="#comment")return``;let r="";for(const s in t)Foe(s)&&(r+=` ${s}="${Q5(t[s])}"`);return n?`<${e}${r}>`:`<${e}${r}>${Qre(o)}`}function Qre(e=[]){return e.map(t=>t.html!==void 0?t.html:t.text===void 0?OCe(t):b_e(t.text)).join("")}function Gp({text:e}){return e.replace(sl,"")}function Lp(){return{formats:[],replacements:[],text:""}}function yCe({tagName:e,attributes:t}){let n;if(t&&t.class&&(n=no(Ui).getFormatTypeForClassName(t.class),n&&(t.class=` ${t.class} `.replace(` ${n.className} `," ").trim(),t.class||delete t.class)),n||(n=no(Ui).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 $o{#e;static empty(){return new $o}static fromPlainText(t){return new $o(Kn({text:t}))}static fromHTMLString(t){return new $o(Kn({html:t}))}static fromHTMLElement(t,n={}){const{preserveWhiteSpace:o=!1}=n,r=o?t:Jre(t),s=new $o(Kn({element:r}));return Object.defineProperty(s,"originalHTML",{value:t.innerHTML}),s}constructor(t=Lp()){this.#e=t}toPlainText(){return Gp(this.#e)}toHTMLString({preserveWhiteSpace:t}={}){return this.originalHTML||x0({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))$o.prototype.hasOwnProperty(e)||Object.defineProperty($o.prototype,e,{value(...t){return this.toHTMLString()[e](...t)}});function Kn({element:e,text:t,html:n,range:o,__unstableIsEditableTree:r}={}){return n instanceof $o?{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=rl(document,n)),typeof e!="object"?Lp():e0e({element:e,range:o,isEditableTree:r}))}function xu(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 ACe(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 Jre(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&&Jre(o,!1)}),n}const vCe="\r";function _H(e){return e.replace(new RegExp(`[${Kre}${sl}${vCe}]`,"gu"),"")}function e0e({element:e,range:t,isEditableTree:n}){const o=Lp();if(!e)return o;if(!e.hasChildNodes())return xu(o,e,t,Lp()),o;const r=e.childNodes.length;for(let i=0;in===t)}function _Ce({start:e,end:t,replacements:n,text:o}){if(!(e+1!==t||o[e]!==sl))return n[e]}function Vd({start:e,end:t}){if(!(e===void 0||t===void 0))return e===t}function h8({text:e}){return e.length===0}function kCe(e,t=""){return typeof t=="string"&&(t=Kn({text:t})),Ch(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 t0e(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(no(Ui).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=no(Ui).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=no(Ui).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 er(Ui).addFormatTypes(t),t}function Hd(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);)pS(i,n,t),n--;for(o++;i[o]?.find(l=>l===c);)pS(i,o,t),o++}}else for(let c=n;cc!==t)||[]})}function pS(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=Kn({text:t}));const c=n+t.text.length;return Ch({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 ea(e,t,n){return w0(e,Kn(),t,n)}function SCe({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}),Ch({formats:e,replacements:t,text:n,start:o,end:r})}function n0e(e,t,n,o){return w0(e,{formats:[,],replacements:[t],text:sl},n,o)}function $b(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 LB({formats:e,replacements:t,text:n,start:o,end:r},s){if(typeof s!="string")return CCe(...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 CCe({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 o0e(e,t){return e===t||e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}function m8(e,t,n){const o=e.parentNode;let r=0;for(;e=e.previousSibling;)r++;return n=[r,...n],o!==t&&(n=m8(o,t,n)),n}function kH(e,t){for(t=[...t];e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}function qCe(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 RCe(e,t){e.appendData(t)}function TCe({lastChild:e}){return e}function ECe({parentNode:e}){return e}function WCe(e){return e.nodeType===e.TEXT_NODE}function BCe({nodeValue:e}){return e}function NCe(e){return e.parentNode.removeChild(e)}function LCe({value:e,prepareEditableTree:t,isEditableTree:n=!0,placeholder:o,doc:r=document}){let s=[],i=[];return t&&(e={...e,formats:t(e)}),{body:Zre({value:e,createEmpty:()=>rl(r,""),append:qCe,getLastChild:TCe,getParent:ECe,isText:WCe,getText:BCe,remove:NCe,appendText:RCe,onStartIndex(u,d){s=m8(d,u,[d.nodeValue.length])},onEndIndex(u,d){i=m8(d,u,[d.nodeValue.length])},isEditableTree:n,placeholder:o}),selection:{startPath:s,endPath:i}}}function PCe({value:e,current:t,prepareEditableTree:n,__unstableDomOnly:o,placeholder:r}){const{body:s,selection:i}=LCe({value:e,prepareEditableTree:n,placeholder:r,doc:t.ownerDocument});r0e(s,t),e.start!==void 0&&!o&&jCe(i,t)}function r0e(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(o0e(d,u.getRangeAt(0)))return;u.removeAllRanges()}u.addRange(d),p!==c.activeElement&&p instanceof l.HTMLElement&&p.focus()}function ICe(e){if(!(typeof document>"u")){if(document.readyState==="complete"||document.readyState==="interactive")return void e();document.addEventListener("DOMContentLoaded",e)}}function SH(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 DCe(){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 FCe(){const e=document.getElementsByClassName("a11y-speak-region"),t=document.getElementById("a11y-speak-intro-text");for(let n=0;n]+>/g," "),CH===e&&(e+=" "),CH=e,e}function Yt(e,t){FCe(),e=$Ce(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 VCe(){const e=document.getElementById("a11y-speak-intro-text"),t=document.getElementById("a11y-speak-assertive"),n=document.getElementById("a11y-speak-polite");e===null&&DCe(),t===null&&SH("assertive"),n===null&&SH("polite")}ICe(VCe);function cc(e,t){return NB(e,t.type)?(t.title&&Yt(we(m("%s removed."),t.title),"assertive"),Hd(e,t.type)):(t.title&&Yt(we(m("%s applied."),t.title),"assertive"),yi(e,t))}function HCe(e){const t=no(Ui).getFormatType(e);if(!t){window.console.error(`Format ${e} is not registered.`);return}return er(Ui).removeFormatTypes(e),t}function UCe(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 XCe(e,t){return{contextElement:t,getBoundingClientRect(){return t.contains(e.startContainer)?e.getBoundingClientRect():t.getBoundingClientRect()}}}function fS(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=UCe(i,e,t,n);return c||XCe(i,e)}function Yz({editableContentElement:e,settings:t={}}){const{tagName:n,className:o,isActive:r}=t,[s,i]=x.useState(()=>fS(e,n,o)),c=Tr(r);return x.useLayoutEffect(()=>{if(!e)return;function l(){i(fS(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(fS(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 GCe="pre-wrap",KCe="1px";function YCe(){return x.useCallback(e=>{e&&(e.style.whiteSpace=GCe,e.style.minWidth=KCe)},[])}function ZCe({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 O=l.getElementById(g);O||(O=l.createElement("style"),O.id=g,l.head.appendChild(O)),O.innerHTML!==h&&(O.innerHTML=h)},[n,s]),t}const QCe=e=>t=>{function n(r){const{record:s}=e.current,{ownerDocument:i}=t;if(Vd(s.current)||!t.contains(i.activeElement))return;const c=$b(s.current),l=Gp(c),u=x0({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)}},JCe=()=>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)}},qH=[],eqe=e=>t=>{function n(o){const{keyCode:r,shiftKey:s,altKey:i,metaKey:c,ctrlKey:l}=o;if(s||i||c||l||r!==mi&&r!==gi)return;const{record:u,applyRecord:d,forceRender:p}=e.current,{text:f,formats:b,start:h,end:g,activeFormats:O=[]}=u.current,v=Vd(u.current),{ownerDocument:_}=t,{defaultView:A}=_,{direction:M}=A.getComputedStyle(t),y=M==="rtl"?gi:mi,k=o.keyCode===y;if(v&&O.length===0&&(h===0&&k||g===f.length&&!k)||!v)return;const S=b[h-1]||qH,C=b[h]||qH,R=k?S:C,T=O.every((j,H)=>j===R[H]);let E=O.length;if(T?E{t.removeEventListener("keydown",n)}},tqe=e=>t=>{function n(o){const{keyCode:r}=o,{createRecord:s,handleChange:i}=e.current;if(o.defaultPrevented||r!==pl&&r!==ac)return;const c=s(),{start:l,end:u,text:d}=c;l===0&&u!==0&&u===d.length&&(i(ea(c)),o.preventDefault())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}};function nqe({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(p4(l,i[u]))return i[u]}else if(c[u]&&p4(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 oqe=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),RH=[],s0e="data-rich-text-placeholder";function rqe(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(s0e)||t.collapseToStart()}const sqe=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||oqe.has(p))){b(f.current);return}const O=h(),{start:v,activeFormats:_=[]}=f.current,A=nqe({value:O,start:v,end:O.start,formats:_});g(A)}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:O}=f(),v=d.current;if(O!==v.text){s();return}if(h===v.start&&g===v.end){v.text.length===0&&h===0&&rqe(o);return}const _={...v,start:h,end:g,activeFormats:v._newActiveFormats,_newActiveFormats:void 0},A=BB(_,RH);_.activeFormats=A,d.current=_,p(_,{domOnly:!0}),b(h,g)}function c(){r=!0,n.removeEventListener("selectionchange",i),t.querySelector(`[${s0e}]`)?.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:RH},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)}},iqe=()=>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(),!o0e(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 aqe(){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 cqe=[QCe,JCe,eqe,tqe,sqe,iqe,aqe];function lqe(e){const t=x.useRef(e);x.useInsertionEffect(()=>{t.current=e});const n=x.useMemo(()=>cqe.map(o=>o(t)),[t]);return mn(o=>{const r=n.map(s=>s(o));return()=>{r.forEach(s=>s())}},[n])}function i0e({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=Gn(),[,h]=x.useReducer(()=>({})),g=x.useRef();function O(){const{ownerDocument:{defaultView:T}}=g.current,E=T.getSelection(),N=E.rangeCount>0?E.getRangeAt(0):null;return Kn({element:g.current,range:N,__unstableIsEditableTree:!0})}function v(T,{domOnly:E}={}){PCe({value:T,current:g.current,prepareEditableTree:f,__unstableDomOnly:E,placeholder:o})}const _=x.useRef(e),A=x.useRef();function M(){_.current=e,A.current=e,e instanceof $o||(A.current=e?$o.fromHTMLString(e,{preserveWhiteSpace:s}):$o.empty()),A.current={text:A.current.text,formats:A.current.formats,replacements:A.current.replacements},c&&(A.current.formats=Array(e.length),A.current.replacements=Array(e.length)),d&&(A.current.formats=d(A.current)),A.current.start=t,A.current.end=n}const y=x.useRef(!1);A.current?(t!==A.current.start||n!==A.current.end)&&(y.current=l,A.current={...A.current,start:t,end:n,activeFormats:void 0}):(y.current=l,M());function k(T){if(A.current=T,v(T),c)_.current=T.text;else{const I=p?p(T):T.formats;T={...T,formats:I},typeof e=="string"?_.current=x0({value:T,preserveWhiteSpace:s}):_.current=new $o(T)}const{start:E,end:N,formats:L,text:P}=A.current;b.batch(()=>{r(E,N),i(_.current,{__unstableFormats:L,__unstableText:P})}),h()}function S(){M(),v(A.current)}const C=x.useRef(!1);x.useLayoutEffect(()=>{C.current&&e!==_.current&&(S(),h())},[e]),x.useLayoutEffect(()=>{y.current&&(g.current.ownerDocument.activeElement!==g.current&&g.current.focus(),v(A.current),y.current=!1)},[y.current]);const R=vn([g,YCe(),ZCe({record:A}),lqe({record:A,handleChange:k,applyRecord:v,createRecord:O,isSelected:l,onSelectionChange:r,forceRender:h}),mn(()=>{S(),C.current=!0},[o,...u])]);return{value:A.current,getValue:()=>A.current,onChange:k,ref:R}}let Yy;const uqe=new Uint8Array(16);function dqe(){if(!Yy&&(Yy=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Yy))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Yy(uqe)}const W0=[];for(let e=0;e<256;++e)W0.push((e+256).toString(16).slice(1));function pqe(e,t=0){return W0[e[t+0]]+W0[e[t+1]]+W0[e[t+2]]+W0[e[t+3]]+"-"+W0[e[t+4]]+W0[e[t+5]]+"-"+W0[e[t+6]]+W0[e[t+7]]+"-"+W0[e[t+8]]+W0[e[t+9]]+"-"+W0[e[t+10]]+W0[e[t+11]]+W0[e[t+12]]+W0[e[t+13]]+W0[e[t+14]]+W0[e[t+15]]}const fqe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),TH={randomUUID:fqe};function ta(e,t,n){if(TH.randomUUID&&!t&&!e)return TH.randomUUID();e=e||{};const o=e.random||(e.rng||dqe)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,pqe(o)}let bS=null;function bqe(e,t){const n=[...e],o=[];for(;n.length;)o.push(n.splice(0,t));return o}async function hqe(e){bS===null&&(bS=(await Rt({path:"/batch/v1",method:"OPTIONS"})).endpoints[0].args.requests.maxItems);const t=[];for(const n of bqe(e,bS)){const o=await Rt({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 mqe(e=hqe){let t=0,n=[];const o=new gqe;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 gqe{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 D0="core",EH=globalThis||void 0||self,rs=()=>new Map,g8=e=>{const t=rs();return e.forEach((n,o)=>{t.set(o,n)}),t},m1=(e,t,n)=>{let o=e.get(t);return o===void 0&&e.set(t,o=n()),o},Mqe=(e,t)=>{const n=[];for(const[o,r]of e)n.push(t(r,o));return n},zqe=(e,t)=>{for(const[n,o]of e)if(t(o,n))return!0;return!1},pd=()=>new Set,hS=e=>e[e.length-1],Oqe=(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 xl((this._observers.get(t)||rs()).values()).forEach(o=>o(...n))}destroy(){this._observers=rs()}}class Zz{constructor(){this._observers=rs()}on(t,n){m1(this._observers,t,pd).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 xl((this._observers.get(t)||rs()).values()).forEach(o=>o(...n))}destroy(){this._observers=rs()}}const lc=Math.floor,hv=Math.abs,vqe=Math.log10,PB=(e,t)=>ee>t?e:t,a0e=e=>e!==0?e<0:1/e<0,WH=1,BH=2,mS=4,gS=8,TM=32,fl=64,Ts=128,fx=31,M8=63,Kp=127,xqe=2147483647,c0e=Number.MAX_SAFE_INTEGER,wqe=Number.isInteger||(e=>typeof e=="number"&&isFinite(e)&&lc(e)===e),_qe=String.fromCharCode,kqe=e=>e.toLowerCase(),Sqe=/^\s*/g,Cqe=e=>e.replace(Sqe,""),qqe=/([A-Z])/g,NH=(e,t)=>Cqe(e.replace(qqe,n=>`${t}${kqe(n)}`)),Rqe=e=>{const t=unescape(encodeURIComponent(e)),n=t.length,o=new Uint8Array(n);for(let r=0;rEM.encode(e),z8=EM?Tqe:Rqe;let lM=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});lM&&lM.decode(new Uint8Array).length===1&&(lM=null);class Qz{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const M0=()=>new Qz,Eqe=e=>{let t=e.cpos;for(let n=0;n{const t=new Uint8Array(Eqe(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},WM=h0,sn=(e,t)=>{for(;t>Kp;)h0(e,Ts|Kp&t),t=lc(t/128);h0(e,Kp&t)},jB=(e,t)=>{const n=a0e(t);for(n&&(t=-t),h0(e,(t>M8?Ts:0)|(n?fl:0)|M8&t),t=lc(t/64);t>0;)h0(e,(t>Kp?Ts:0)|Kp&t),t=lc(t/128)},O8=new Uint8Array(3e4),Bqe=O8.length/3,Nqe=(e,t)=>{if(t.length{const n=unescape(encodeURIComponent(t)),o=n.length;sn(e,o);for(let r=0;r{const n=e.cbuf.length,o=e.cpos,r=PB(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(Lf(n*2,s)),e.cbuf.set(t.subarray(r)),e.cpos=s)},qr=(e,t)=>{sn(e,t.byteLength),bx(e,t)},IB=(e,t)=>{Wqe(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},Pqe=(e,t)=>IB(e,4).setFloat32(0,t,!1),jqe=(e,t)=>IB(e,8).setFloat64(0,t,!1),Iqe=(e,t)=>IB(e,8).setBigInt64(0,t,!1),LH=new DataView(new ArrayBuffer(4)),Dqe=e=>(LH.setFloat32(0,e),LH.getFloat32(0)===e),Vb=(e,t)=>{switch(typeof t){case"string":h0(e,119),Ja(e,t);break;case"number":wqe(t)&&hv(t)<=xqe?(h0(e,125),jB(e,t)):Dqe(t)?(h0(e,124),Pqe(e,t)):(h0(e,123),jqe(e,t));break;case"bigint":h0(e,122),Iqe(e,t);break;case"object":if(t===null)h0(e,126);else if(yqe(t)){h0(e,117),sn(e,t.length);for(let n=0;n0&&sn(this,this.count-1),this.count=1,this.w(this,t),this.s=t)}}const jH=e=>{e.count>0&&(jB(e.encoder,e.count===1?e.s:-e.s),e.count>1&&sn(e.encoder,e.count-2))};class mv{constructor(){this.encoder=new Qz,this.s=0,this.count=0}write(t){this.s===t?this.count++:(jH(this),this.count=1,this.s=t)}toUint8Array(){return jH(this),yr(this.encoder)}}const IH=e=>{if(e.count>0){const t=e.diff*2+(e.count===1?0:1);jB(e.encoder,t),e.count>1&&sn(e.encoder,e.count-2)}};class MS{constructor(){this.encoder=new Qz,this.s=0,this.count=0,this.diff=0}write(t){this.diff===t-this.s?(this.s=t,this.count++):(IH(this),this.count=1,this.diff=t-this.s,this.s=t)}toUint8Array(){return IH(this),yr(this.encoder)}}class Fqe{constructor(){this.sarr=[],this.s="",this.lensE=new mv}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 Qz;return this.sarr.push(this.s),this.s="",Ja(t,this.sarr.join("")),bx(t,this.lensE.toUint8Array()),yr(t)}}const na=e=>new Error(e),ec=()=>{throw na("Method unimplemented")},uc=()=>{throw na("Unexpected case")},l0e=na("Unexpected end of array"),u0e=na("Integer out of Range");class hx{constructor(t){this.arr=t,this.pos=0}}const yc=e=>new hx(e),$qe=e=>e.pos!==e.arr.length,Vqe=(e,t)=>{const n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},m0=e=>Vqe(e,kn(e)),lf=e=>e.arr[e.pos++],kn=e=>{let t=0,n=1;const o=e.arr.length;for(;e.posc0e)throw u0e}throw l0e},DB=e=>{let t=e.arr[e.pos++],n=t&M8,o=64;const r=(t&fl)>0?-1:1;if(!(t&Ts))return r*n;const s=e.arr.length;for(;e.posc0e)throw u0e}throw l0e},Hqe=e=>{let t=kn(e);if(t===0)return"";{let n=String.fromCodePoint(lf(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(lf(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))}},Uqe=e=>lM.decode(m0(e)),bl=lM?Uqe:Hqe,FB=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},Xqe=e=>FB(e,4).getFloat32(0,!1),Gqe=e=>FB(e,8).getFloat64(0,!1),Kqe=e=>FB(e,8).getBigInt64(0,!1),Yqe=[e=>{},e=>null,DB,Xqe,Gqe,Kqe,e=>!1,e=>!0,bl,e=>{const t=kn(e),n={};for(let o=0;o{const t=kn(e),n=[];for(let o=0;oYqe[127-lf(e)](e);class DH extends hx{constructor(t,n){super(t),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),$qe(this)?this.count=kn(this)+1:this.count=-1),this.count--,this.s}}class gv extends hx{constructor(t){super(t),this.s=0,this.count=0}read(){if(this.count===0){this.s=DB(this);const t=a0e(this.s);this.count=1,t&&(this.s=-this.s,this.count=kn(this)+2)}return this.count--,this.s}}class zS extends hx{constructor(t){super(t),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const t=DB(this),n=t&1;this.diff=lc(t/2),this.count=1,n&&(this.count=kn(this)+2)}return this.s+=this.diff,this.count--,this.s}}class Zqe{constructor(t){this.decoder=new gv(t),this.str=bl(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 Qqe=crypto.getRandomValues.bind(crypto),Jqe=Math.random,d0e=()=>Qqe(new Uint32Array(1))[0],eRe="10000000-1000-4000-8000"+-1e11,p0e=()=>eRe.replace(/[018]/g,e=>(e^d0e()&15>>e/4).toString(16)),wl=Date.now,Ub=e=>new Promise(e);Promise.all.bind(Promise);const tRe=e=>Promise.reject(e),$B=e=>Promise.resolve(e);var f0e={},mx={};mx.byteLength=rRe;mx.toByteArray=iRe;mx.fromByteArray=lRe;var Ua=[],ri=[],nRe=typeof Uint8Array<"u"?Uint8Array:Array,OS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var W2=0,oRe=OS.length;W20)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 rRe(e){var t=b0e(e),n=t[0],o=t[1];return(n+o)*3/4-o}function sRe(e,t,n){return(t+n)*3/4-n}function iRe(e){var t,n=b0e(e),o=n[0],r=n[1],s=new nRe(sRe(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=ri[e.charCodeAt(l)]<<2|ri[e.charCodeAt(l+1)]>>4,s[i++]=t&255),r===1&&(t=ri[e.charCodeAt(l)]<<10|ri[e.charCodeAt(l+1)]<<4|ri[e.charCodeAt(l+2)]>>2,s[i++]=t>>8&255,s[i++]=t&255),s}function aRe(e){return Ua[e>>18&63]+Ua[e>>12&63]+Ua[e>>6&63]+Ua[e&63]}function cRe(e,t,n){for(var o,r=[],s=t;sc?c:i+s));return o===1?(t=e[n-1],r.push(Ua[t>>2]+Ua[t<<4&63]+"==")):o===2&&(t=(e[n-2]<<8)+e[n-1],r.push(Ua[t>>10]+Ua[t>>4&63]+Ua[t<<2&63]+"=")),r.join("")}var VB={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */VB.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)};VB.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=mx,n=VB,o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=d,e.SlowBuffer=y,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 se=new s(1),V={foo:function(){return 42}};return Object.setPrototypeOf(V,s.prototype),Object.setPrototypeOf(se,V),se.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(se){if(se>r)throw new RangeError('The value "'+se+'" is invalid for option "size"');const V=new s(se);return Object.setPrototypeOf(V,d.prototype),V}function d(se,V,Y){if(typeof se=="number"){if(typeof V=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(se)}return p(se,V,Y)}d.poolSize=8192;function p(se,V,Y){if(typeof se=="string")return g(se,V);if(i.isView(se))return v(se);if(se==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof se);if(De(se,i)||se&&De(se.buffer,i)||typeof c<"u"&&(De(se,c)||se&&De(se.buffer,c)))return _(se,V,Y);if(typeof se=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const pe=se.valueOf&&se.valueOf();if(pe!=null&&pe!==se)return d.from(pe,V,Y);const Se=A(se);if(Se)return Se;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof se[Symbol.toPrimitive]=="function")return d.from(se[Symbol.toPrimitive]("string"),V,Y);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof se)}d.from=function(se,V,Y){return p(se,V,Y)},Object.setPrototypeOf(d.prototype,s.prototype),Object.setPrototypeOf(d,s);function f(se){if(typeof se!="number")throw new TypeError('"size" argument must be of type number');if(se<0)throw new RangeError('The value "'+se+'" is invalid for option "size"')}function b(se,V,Y){return f(se),se<=0?u(se):V!==void 0?typeof Y=="string"?u(se).fill(V,Y):u(se).fill(V):u(se)}d.alloc=function(se,V,Y){return b(se,V,Y)};function h(se){return f(se),u(se<0?0:M(se)|0)}d.allocUnsafe=function(se){return h(se)},d.allocUnsafeSlow=function(se){return h(se)};function g(se,V){if((typeof V!="string"||V==="")&&(V="utf8"),!d.isEncoding(V))throw new TypeError("Unknown encoding: "+V);const Y=k(se,V)|0;let pe=u(Y);const Se=pe.write(se,V);return Se!==Y&&(pe=pe.slice(0,Se)),pe}function O(se){const V=se.length<0?0:M(se.length)|0,Y=u(V);for(let pe=0;pe=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return se|0}function y(se){return+se!=se&&(se=0),d.alloc(+se)}d.isBuffer=function(V){return V!=null&&V._isBuffer===!0&&V!==d.prototype},d.compare=function(V,Y){if(De(V,s)&&(V=d.from(V,V.offset,V.byteLength)),De(Y,s)&&(Y=d.from(Y,Y.offset,Y.byteLength)),!d.isBuffer(V)||!d.isBuffer(Y))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(V===Y)return 0;let pe=V.length,Se=Y.length;for(let fe=0,ge=Math.min(pe,Se);feSe.length?(d.isBuffer(ge)||(ge=d.from(ge)),ge.copy(Se,fe)):s.prototype.set.call(Se,ge,fe);else if(d.isBuffer(ge))ge.copy(Se,fe);else throw new TypeError('"list" argument must be an Array of Buffers');fe+=ge.length}return Se};function k(se,V){if(d.isBuffer(se))return se.length;if(i.isView(se)||De(se,i))return se.byteLength;if(typeof se!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof se);const Y=se.length,pe=arguments.length>2&&arguments[2]===!0;if(!pe&&Y===0)return 0;let Se=!1;for(;;)switch(V){case"ascii":case"latin1":case"binary":return Y;case"utf8":case"utf-8":return B(se).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y*2;case"hex":return Y>>>1;case"base64":return xe(se).length;default:if(Se)return pe?-1:B(se).length;V=(""+V).toLowerCase(),Se=!0}}d.byteLength=k;function S(se,V,Y){let pe=!1;if((V===void 0||V<0)&&(V=0),V>this.length||((Y===void 0||Y>this.length)&&(Y=this.length),Y<=0)||(Y>>>=0,V>>>=0,Y<=V))return"";for(se||(se="utf8");;)switch(se){case"hex":return Q(this,V,Y);case"utf8":case"utf-8":return H(this,V,Y);case"ascii":return Z(this,V,Y);case"latin1":case"binary":return X(this,V,Y);case"base64":return j(this,V,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,V,Y);default:if(pe)throw new TypeError("Unknown encoding: "+se);se=(se+"").toLowerCase(),pe=!0}}d.prototype._isBuffer=!0;function C(se,V,Y){const pe=se[V];se[V]=se[Y],se[Y]=pe}d.prototype.swap16=function(){const V=this.length;if(V%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Y=0;YY&&(V+=" ... "),""},o&&(d.prototype[o]=d.prototype.inspect),d.prototype.compare=function(V,Y,pe,Se,fe){if(De(V,s)&&(V=d.from(V,V.offset,V.byteLength)),!d.isBuffer(V))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof V);if(Y===void 0&&(Y=0),pe===void 0&&(pe=V?V.length:0),Se===void 0&&(Se=0),fe===void 0&&(fe=this.length),Y<0||pe>V.length||Se<0||fe>this.length)throw new RangeError("out of range index");if(Se>=fe&&Y>=pe)return 0;if(Se>=fe)return-1;if(Y>=pe)return 1;if(Y>>>=0,pe>>>=0,Se>>>=0,fe>>>=0,this===V)return 0;let ge=fe-Se,Je=pe-Y;const lt=Math.min(ge,Je),At=this.slice(Se,fe),ut=V.slice(Y,pe);for(let tt=0;tt2147483647?Y=2147483647:Y<-2147483648&&(Y=-2147483648),Y=+Y,ot(Y)&&(Y=Se?0:se.length-1),Y<0&&(Y=se.length+Y),Y>=se.length){if(Se)return-1;Y=se.length-1}else if(Y<0)if(Se)Y=0;else return-1;if(typeof V=="string"&&(V=d.from(V,pe)),d.isBuffer(V))return V.length===0?-1:T(se,V,Y,pe,Se);if(typeof V=="number")return V=V&255,typeof s.prototype.indexOf=="function"?Se?s.prototype.indexOf.call(se,V,Y):s.prototype.lastIndexOf.call(se,V,Y):T(se,[V],Y,pe,Se);throw new TypeError("val must be string, number or Buffer")}function T(se,V,Y,pe,Se){let fe=1,ge=se.length,Je=V.length;if(pe!==void 0&&(pe=String(pe).toLowerCase(),pe==="ucs2"||pe==="ucs-2"||pe==="utf16le"||pe==="utf-16le")){if(se.length<2||V.length<2)return-1;fe=2,ge/=2,Je/=2,Y/=2}function lt(ut,tt){return fe===1?ut[tt]:ut.readUInt16BE(tt*fe)}let At;if(Se){let ut=-1;for(At=Y;Atge&&(Y=ge-Je),At=Y;At>=0;At--){let ut=!0;for(let tt=0;ttSe&&(pe=Se)):pe=Se;const fe=V.length;pe>fe/2&&(pe=fe/2);let ge;for(ge=0;ge>>0,isFinite(pe)?(pe=pe>>>0,Se===void 0&&(Se="utf8")):(Se=pe,pe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const fe=this.length-Y;if((pe===void 0||pe>fe)&&(pe=fe),V.length>0&&(pe<0||Y<0)||Y>this.length)throw new RangeError("Attempt to write outside buffer bounds");Se||(Se="utf8");let ge=!1;for(;;)switch(Se){case"hex":return E(this,V,Y,pe);case"utf8":case"utf-8":return N(this,V,Y,pe);case"ascii":case"latin1":case"binary":return L(this,V,Y,pe);case"base64":return P(this,V,Y,pe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,V,Y,pe);default:if(ge)throw new TypeError("Unknown encoding: "+Se);Se=(""+Se).toLowerCase(),ge=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function j(se,V,Y){return V===0&&Y===se.length?t.fromByteArray(se):t.fromByteArray(se.slice(V,Y))}function H(se,V,Y){Y=Math.min(se.length,Y);const pe=[];let Se=V;for(;Se239?4:fe>223?3:fe>191?2:1;if(Se+Je<=Y){let lt,At,ut,tt;switch(Je){case 1:fe<128&&(ge=fe);break;case 2:lt=se[Se+1],(lt&192)===128&&(tt=(fe&31)<<6|lt&63,tt>127&&(ge=tt));break;case 3:lt=se[Se+1],At=se[Se+2],(lt&192)===128&&(At&192)===128&&(tt=(fe&15)<<12|(lt&63)<<6|At&63,tt>2047&&(tt<55296||tt>57343)&&(ge=tt));break;case 4:lt=se[Se+1],At=se[Se+2],ut=se[Se+3],(lt&192)===128&&(At&192)===128&&(ut&192)===128&&(tt=(fe&15)<<18|(lt&63)<<12|(At&63)<<6|ut&63,tt>65535&&tt<1114112&&(ge=tt))}}ge===null?(ge=65533,Je=1):ge>65535&&(ge-=65536,pe.push(ge>>>10&1023|55296),ge=56320|ge&1023),pe.push(ge),Se+=Je}return U(pe)}const F=4096;function U(se){const V=se.length;if(V<=F)return String.fromCharCode.apply(String,se);let Y="",pe=0;for(;pepe)&&(Y=pe);let Se="";for(let fe=V;fepe&&(V=pe),Y<0?(Y+=pe,Y<0&&(Y=0)):Y>pe&&(Y=pe),YY)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(V,Y,pe){V=V>>>0,Y=Y>>>0,pe||ae(V,Y,this.length);let Se=this[V],fe=1,ge=0;for(;++ge>>0,Y=Y>>>0,pe||ae(V,Y,this.length);let Se=this[V+--Y],fe=1;for(;Y>0&&(fe*=256);)Se+=this[V+--Y]*fe;return Se},d.prototype.readUint8=d.prototype.readUInt8=function(V,Y){return V=V>>>0,Y||ae(V,1,this.length),this[V]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(V,Y){return V=V>>>0,Y||ae(V,2,this.length),this[V]|this[V+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(V,Y){return V=V>>>0,Y||ae(V,2,this.length),this[V]<<8|this[V+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(V,Y){return V=V>>>0,Y||ae(V,4,this.length),(this[V]|this[V+1]<<8|this[V+2]<<16)+this[V+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(V,Y){return V=V>>>0,Y||ae(V,4,this.length),this[V]*16777216+(this[V+1]<<16|this[V+2]<<8|this[V+3])},d.prototype.readBigUInt64LE=gt(function(V){V=V>>>0,he(V,"offset");const Y=this[V],pe=this[V+7];(Y===void 0||pe===void 0)&&ke(V,this.length-8);const Se=Y+this[++V]*2**8+this[++V]*2**16+this[++V]*2**24,fe=this[++V]+this[++V]*2**8+this[++V]*2**16+pe*2**24;return BigInt(Se)+(BigInt(fe)<>>0,he(V,"offset");const Y=this[V],pe=this[V+7];(Y===void 0||pe===void 0)&&ke(V,this.length-8);const Se=Y*2**24+this[++V]*2**16+this[++V]*2**8+this[++V],fe=this[++V]*2**24+this[++V]*2**16+this[++V]*2**8+pe;return(BigInt(Se)<>>0,Y=Y>>>0,pe||ae(V,Y,this.length);let Se=this[V],fe=1,ge=0;for(;++ge=fe&&(Se-=Math.pow(2,8*Y)),Se},d.prototype.readIntBE=function(V,Y,pe){V=V>>>0,Y=Y>>>0,pe||ae(V,Y,this.length);let Se=Y,fe=1,ge=this[V+--Se];for(;Se>0&&(fe*=256);)ge+=this[V+--Se]*fe;return fe*=128,ge>=fe&&(ge-=Math.pow(2,8*Y)),ge},d.prototype.readInt8=function(V,Y){return V=V>>>0,Y||ae(V,1,this.length),this[V]&128?(255-this[V]+1)*-1:this[V]},d.prototype.readInt16LE=function(V,Y){V=V>>>0,Y||ae(V,2,this.length);const pe=this[V]|this[V+1]<<8;return pe&32768?pe|4294901760:pe},d.prototype.readInt16BE=function(V,Y){V=V>>>0,Y||ae(V,2,this.length);const pe=this[V+1]|this[V]<<8;return pe&32768?pe|4294901760:pe},d.prototype.readInt32LE=function(V,Y){return V=V>>>0,Y||ae(V,4,this.length),this[V]|this[V+1]<<8|this[V+2]<<16|this[V+3]<<24},d.prototype.readInt32BE=function(V,Y){return V=V>>>0,Y||ae(V,4,this.length),this[V]<<24|this[V+1]<<16|this[V+2]<<8|this[V+3]},d.prototype.readBigInt64LE=gt(function(V){V=V>>>0,he(V,"offset");const Y=this[V],pe=this[V+7];(Y===void 0||pe===void 0)&&ke(V,this.length-8);const Se=this[V+4]+this[V+5]*2**8+this[V+6]*2**16+(pe<<24);return(BigInt(Se)<>>0,he(V,"offset");const Y=this[V],pe=this[V+7];(Y===void 0||pe===void 0)&&ke(V,this.length-8);const Se=(Y<<24)+this[++V]*2**16+this[++V]*2**8+this[++V];return(BigInt(Se)<>>0,Y||ae(V,4,this.length),n.read(this,V,!0,23,4)},d.prototype.readFloatBE=function(V,Y){return V=V>>>0,Y||ae(V,4,this.length),n.read(this,V,!1,23,4)},d.prototype.readDoubleLE=function(V,Y){return V=V>>>0,Y||ae(V,8,this.length),n.read(this,V,!0,52,8)},d.prototype.readDoubleBE=function(V,Y){return V=V>>>0,Y||ae(V,8,this.length),n.read(this,V,!1,52,8)};function be(se,V,Y,pe,Se,fe){if(!d.isBuffer(se))throw new TypeError('"buffer" argument must be a Buffer instance');if(V>Se||Vse.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(V,Y,pe,Se){if(V=+V,Y=Y>>>0,pe=pe>>>0,!Se){const Je=Math.pow(2,8*pe)-1;be(this,V,Y,pe,Je,0)}let fe=1,ge=0;for(this[Y]=V&255;++ge>>0,pe=pe>>>0,!Se){const Je=Math.pow(2,8*pe)-1;be(this,V,Y,pe,Je,0)}let fe=pe-1,ge=1;for(this[Y+fe]=V&255;--fe>=0&&(ge*=256);)this[Y+fe]=V/ge&255;return Y+pe},d.prototype.writeUint8=d.prototype.writeUInt8=function(V,Y,pe){return V=+V,Y=Y>>>0,pe||be(this,V,Y,1,255,0),this[Y]=V&255,Y+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(V,Y,pe){return V=+V,Y=Y>>>0,pe||be(this,V,Y,2,65535,0),this[Y]=V&255,this[Y+1]=V>>>8,Y+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(V,Y,pe){return V=+V,Y=Y>>>0,pe||be(this,V,Y,2,65535,0),this[Y]=V>>>8,this[Y+1]=V&255,Y+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(V,Y,pe){return V=+V,Y=Y>>>0,pe||be(this,V,Y,4,4294967295,0),this[Y+3]=V>>>24,this[Y+2]=V>>>16,this[Y+1]=V>>>8,this[Y]=V&255,Y+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(V,Y,pe){return V=+V,Y=Y>>>0,pe||be(this,V,Y,4,4294967295,0),this[Y]=V>>>24,this[Y+1]=V>>>16,this[Y+2]=V>>>8,this[Y+3]=V&255,Y+4};function re(se,V,Y,pe,Se){ie(V,pe,Se,se,Y,7);let fe=Number(V&BigInt(4294967295));se[Y++]=fe,fe=fe>>8,se[Y++]=fe,fe=fe>>8,se[Y++]=fe,fe=fe>>8,se[Y++]=fe;let ge=Number(V>>BigInt(32)&BigInt(4294967295));return se[Y++]=ge,ge=ge>>8,se[Y++]=ge,ge=ge>>8,se[Y++]=ge,ge=ge>>8,se[Y++]=ge,Y}function de(se,V,Y,pe,Se){ie(V,pe,Se,se,Y,7);let fe=Number(V&BigInt(4294967295));se[Y+7]=fe,fe=fe>>8,se[Y+6]=fe,fe=fe>>8,se[Y+5]=fe,fe=fe>>8,se[Y+4]=fe;let ge=Number(V>>BigInt(32)&BigInt(4294967295));return se[Y+3]=ge,ge=ge>>8,se[Y+2]=ge,ge=ge>>8,se[Y+1]=ge,ge=ge>>8,se[Y]=ge,Y+8}d.prototype.writeBigUInt64LE=gt(function(V,Y=0){return re(this,V,Y,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=gt(function(V,Y=0){return de(this,V,Y,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(V,Y,pe,Se){if(V=+V,Y=Y>>>0,!Se){const lt=Math.pow(2,8*pe-1);be(this,V,Y,pe,lt-1,-lt)}let fe=0,ge=1,Je=0;for(this[Y]=V&255;++fe>0)-Je&255;return Y+pe},d.prototype.writeIntBE=function(V,Y,pe,Se){if(V=+V,Y=Y>>>0,!Se){const lt=Math.pow(2,8*pe-1);be(this,V,Y,pe,lt-1,-lt)}let fe=pe-1,ge=1,Je=0;for(this[Y+fe]=V&255;--fe>=0&&(ge*=256);)V<0&&Je===0&&this[Y+fe+1]!==0&&(Je=1),this[Y+fe]=(V/ge>>0)-Je&255;return Y+pe},d.prototype.writeInt8=function(V,Y,pe){return V=+V,Y=Y>>>0,pe||be(this,V,Y,1,127,-128),V<0&&(V=255+V+1),this[Y]=V&255,Y+1},d.prototype.writeInt16LE=function(V,Y,pe){return V=+V,Y=Y>>>0,pe||be(this,V,Y,2,32767,-32768),this[Y]=V&255,this[Y+1]=V>>>8,Y+2},d.prototype.writeInt16BE=function(V,Y,pe){return V=+V,Y=Y>>>0,pe||be(this,V,Y,2,32767,-32768),this[Y]=V>>>8,this[Y+1]=V&255,Y+2},d.prototype.writeInt32LE=function(V,Y,pe){return V=+V,Y=Y>>>0,pe||be(this,V,Y,4,2147483647,-2147483648),this[Y]=V&255,this[Y+1]=V>>>8,this[Y+2]=V>>>16,this[Y+3]=V>>>24,Y+4},d.prototype.writeInt32BE=function(V,Y,pe){return V=+V,Y=Y>>>0,pe||be(this,V,Y,4,2147483647,-2147483648),V<0&&(V=4294967295+V+1),this[Y]=V>>>24,this[Y+1]=V>>>16,this[Y+2]=V>>>8,this[Y+3]=V&255,Y+4},d.prototype.writeBigInt64LE=gt(function(V,Y=0){return re(this,V,Y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=gt(function(V,Y=0){return de(this,V,Y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function le(se,V,Y,pe,Se,fe){if(Y+pe>se.length)throw new RangeError("Index out of range");if(Y<0)throw new RangeError("Index out of range")}function ze(se,V,Y,pe,Se){return V=+V,Y=Y>>>0,Se||le(se,V,Y,4),n.write(se,V,Y,pe,23,4),Y+4}d.prototype.writeFloatLE=function(V,Y,pe){return ze(this,V,Y,!0,pe)},d.prototype.writeFloatBE=function(V,Y,pe){return ze(this,V,Y,!1,pe)};function ye(se,V,Y,pe,Se){return V=+V,Y=Y>>>0,Se||le(se,V,Y,8),n.write(se,V,Y,pe,52,8),Y+8}d.prototype.writeDoubleLE=function(V,Y,pe){return ye(this,V,Y,!0,pe)},d.prototype.writeDoubleBE=function(V,Y,pe){return ye(this,V,Y,!1,pe)},d.prototype.copy=function(V,Y,pe,Se){if(!d.isBuffer(V))throw new TypeError("argument should be a Buffer");if(pe||(pe=0),!Se&&Se!==0&&(Se=this.length),Y>=V.length&&(Y=V.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),V.length-Y>>0,pe=pe===void 0?this.length:pe>>>0,V||(V=0);let fe;if(typeof V=="number")for(fe=Y;fe2**32?Se=te(String(Y)):typeof Y=="bigint"&&(Se=String(Y),(Y>BigInt(2)**BigInt(32)||Y<-(BigInt(2)**BigInt(32)))&&(Se=te(Se)),Se+="n"),pe+=` It must be ${V}. Received ${Se}`,pe},RangeError);function te(se){let V="",Y=se.length;const pe=se[0]==="-"?1:0;for(;Y>=pe+4;Y-=3)V=`_${se.slice(Y-3,Y)}${V}`;return`${se.slice(0,Y)}${V}`}function Oe(se,V,Y){he(V,"offset"),(se[V]===void 0||se[V+Y]===void 0)&&ke(V,se.length-(Y+1))}function ie(se,V,Y,pe,Se,fe){if(se>Y||se= 0${ge} and < 2${ge} ** ${(fe+1)*8}${ge}`:Je=`>= -(2${ge} ** ${(fe+1)*8-1}${ge}) and < 2 ** ${(fe+1)*8-1}${ge}`,new We.ERR_OUT_OF_RANGE("value",Je,se)}Oe(pe,Se,fe)}function he(se,V){if(typeof se!="number")throw new We.ERR_INVALID_ARG_TYPE(V,"number",se)}function ke(se,V,Y){throw Math.floor(se)!==se?(he(se,Y),new We.ERR_OUT_OF_RANGE("offset","an integer",se)):V<0?new We.ERR_BUFFER_OUT_OF_BOUNDS:new We.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${V}`,se)}const Ce=/[^+/0-9A-Za-z-_]/g;function ce(se){if(se=se.split("=")[0],se=se.trim().replace(Ce,""),se.length<2)return"";for(;se.length%4!==0;)se=se+"=";return se}function B(se,V){V=V||1/0;let Y;const pe=se.length;let Se=null;const fe=[];for(let ge=0;ge55295&&Y<57344){if(!Se){if(Y>56319){(V-=3)>-1&&fe.push(239,191,189);continue}else if(ge+1===pe){(V-=3)>-1&&fe.push(239,191,189);continue}Se=Y;continue}if(Y<56320){(V-=3)>-1&&fe.push(239,191,189),Se=Y;continue}Y=(Se-55296<<10|Y-56320)+65536}else Se&&(V-=3)>-1&&fe.push(239,191,189);if(Se=null,Y<128){if((V-=1)<0)break;fe.push(Y)}else if(Y<2048){if((V-=2)<0)break;fe.push(Y>>6|192,Y&63|128)}else if(Y<65536){if((V-=3)<0)break;fe.push(Y>>12|224,Y>>6&63|128,Y&63|128)}else if(Y<1114112){if((V-=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 $(se){const V=[];for(let Y=0;Y>8,Se=Y%256,fe.push(Se),fe.push(pe);return fe}function xe(se){return t.toByteArray(ce(se))}function Ee(se,V,Y,pe){let Se;for(Se=0;Se=V.length||Se>=se.length);++Se)V[Se+Y]=se[Se];return Se}function De(se,V){return se instanceof V||se!=null&&se.constructor!=null&&se.constructor.name!=null&&se.constructor.name===V.name}function ot(se){return se!==se}const _t=function(){const se="0123456789abcdef",V=new Array(256);for(let Y=0;Y<16;++Y){const pe=Y*16;for(let Se=0;Se<16;++Se)V[pe+Se]=se[Y]+se[Se]}return V}();function gt(se){return typeof BigInt>"u"?St:se}function St(){throw new Error("BigInt not supported")}})(f0e);const Xb=f0e.Buffer;function uRe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var h0e={exports:{}},Dr=h0e.exports={},La,Pa;function y8(){throw new Error("setTimeout has not been defined")}function A8(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?La=setTimeout:La=y8}catch{La=y8}try{typeof clearTimeout=="function"?Pa=clearTimeout:Pa=A8}catch{Pa=A8}})();function m0e(e){if(La===setTimeout)return setTimeout(e,0);if((La===y8||!La)&&setTimeout)return La=setTimeout,setTimeout(e,0);try{return La(e,0)}catch{try{return La.call(null,e,0)}catch{return La.call(this,e,0)}}}function dRe(e){if(Pa===clearTimeout)return clearTimeout(e);if((Pa===A8||!Pa)&&clearTimeout)return Pa=clearTimeout,clearTimeout(e);try{return Pa(e)}catch{try{return Pa.call(null,e)}catch{return Pa.call(this,e)}}}var il=[],Ab=!1,Fp,Mv=-1;function pRe(){!Ab||!Fp||(Ab=!1,Fp.length?il=Fp.concat(il):Mv=-1,il.length&&g0e())}function g0e(){if(!Ab){var e=m0e(pRe);Ab=!0;for(var t=il.length;t;){for(Fp=il,il=[];++Mv1)for(var n=1;ne===void 0?null:e;class bRe{constructor(){this.map=new Map}setItem(t,n){this.map.set(t,n)}getItem(t){return this.map.get(t)}}let z0e=new bRe,HB=!0;try{typeof localStorage<"u"&&localStorage&&(z0e=localStorage,HB=!1)}catch{}const O0e=z0e,hRe=e=>HB||addEventListener("storage",e),mRe=e=>HB||removeEventListener("storage",e),gRe=Object.assign,y0e=Object.keys,MRe=(e,t)=>{for(const n in e)t(e[n],n)},$H=e=>y0e(e).length,VH=e=>y0e(e).length,zRe=e=>{for(const t in e)return!1;return!0},ORe=(e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0},A0e=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),yRe=(e,t)=>e===t||VH(e)===VH(t)&&ORe(e,(n,o)=>(n!==void 0||A0e(t,o))&&t[o]===n),ARe=Object.freeze,v0e=e=>{for(const t in e){const n=e[t];(typeof n=="object"||typeof n=="function")&&v0e(e[t])}return ARe(e)},UB=(e,t,n=0)=>{try{for(;n{},xRe=e=>e,wRe=(e,t)=>e===t,uM=(e,t)=>{if(e==null||t==null)return wRe(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 x0e={};const Gb=typeof pi<"u"&&pi.release&&/node|io\.js/.test(pi.release.name)&&Object.prototype.toString.call(typeof pi<"u"?pi:0)==="[object process]",w0e=typeof window<"u"&&typeof document<"u"&&!Gb;let _a;const kRe=()=>{if(_a===void 0)if(Gb){_a=rs();const e=pi.argv;let t=null;for(let n=0;n{if(e.length!==0){const[t,n]=e.split("=");_a.set(`--${NH(t,"-")}`,n),_a.set(`-${NH(t,"-")}`,n)}})):_a=rs();return _a},v8=e=>kRe().has(e),BM=e=>FH(Gb?x0e[e.toUpperCase().replaceAll("-","_")]:O0e.getItem(e)),_0e=e=>v8("--"+e)||BM(e)!==null;_0e("production");const SRe=Gb&&_Re(x0e.FORCE_COLOR,["true","1","2"]),CRe=SRe||!v8("--no-colors")&&!_0e("no-color")&&(!Gb||pi.stdout.isTTY)&&(!Gb||v8("--color")||BM("COLORTERM")!==null||(BM("TERM")||"").includes("color")),k0e=e=>new Uint8Array(e),qRe=(e,t,n)=>new Uint8Array(e,t,n),RRe=e=>new Uint8Array(e),TRe=e=>{let t="";for(let n=0;nXb.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),WRe=e=>{const t=atob(e),n=k0e(t.length);for(let o=0;o{const t=Xb.from(e,"base64");return qRe(t.buffer,t.byteOffset,t.byteLength)},S0e=w0e?TRe:ERe,XB=w0e?WRe:BRe,NRe=e=>{const t=k0e(e.byteLength);return t.set(e),t};class LRe{constructor(t,n){this.left=t,this.right=n}}const Vc=(e,t)=>new LRe(e,t);typeof DOMParser<"u"&&new DOMParser;const PRe=e=>Mqe(e,(t,n)=>`${n}:${t};`).join(""),jRe=JSON.stringify,Fl=Symbol,Mi=Fl(),uf=Fl(),C0e=Fl(),GB=Fl(),q0e=Fl(),R0e=Fl(),T0e=Fl(),gx=Fl(),Mx=Fl(),IRe=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=HH[yS],o=BM("log"),r=o!==null&&(o==="*"||o==="true"||new RegExp(o,"gi").test(t));return yS=(yS+1)%HH.length,t+=": ",r?(...s)=>{s.length===1&&s[0]?.constructor===Function&&(s=s[0]());const i=wl(),c=i-UH;UH=i,e(n,t,Mx,...s.map(l=>{switch(l!=null&&l.constructor===Uint8Array&&(l=Array.from(l)),typeof l){case"string":case"symbol":return l;default:return jRe(l)}}),n," +"+c+"ms")}:vRe},FRe={[Mi]:Vc("font-weight","bold"),[uf]:Vc("font-weight","normal"),[C0e]:Vc("color","blue"),[q0e]:Vc("color","green"),[GB]:Vc("color","grey"),[R0e]:Vc("color","red"),[T0e]:Vc("color","purple"),[gx]:Vc("color","orange"),[Mx]:Vc("color","black")},$Re=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[],o=rs();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(...E0e(e)),B0e.forEach(t=>t.print(e))},VRe=(...e)=>{console.warn(...E0e(e)),e.unshift(gx),B0e.forEach(t=>t.print(e))},B0e=pd(),HRe=e=>DRe(W0e,e),N0e=e=>({[Symbol.iterator](){return this},next:e}),URe=(e,t)=>N0e(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),AS=(e,t)=>N0e(()=>{const{done:n,value:o}=e.next();return{done:n,value:n?void 0:t(o)}});class KB{constructor(t,n){this.clock=t,this.len=n}}class Jz{constructor(){this.clients=new Map}}const L0e=(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=lc((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&&XRe(n,t.clock)!==null},YB=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=Lf(r.len,s.clock+s.len-r.clock):(o{const t=new Jz;for(let n=0;n{if(!t.clients.has(r)){const s=o.slice();for(let i=n+1;i{m1(e.clients,t,()=>[]).push(new KB(n,o))},KRe=()=>new Jz,YRe=e=>{const t=KRe();return e.clients.forEach((n,o)=>{const r=[];for(let s=0;s0&&t.clients.set(o,r)}),t},qh=(e,t)=>{sn(e.restEncoder,t.clients.size),xl(t.clients.entries()).sort((n,o)=>o[0]-n[0]).forEach(([n,o])=>{e.resetDsCurVal(),sn(e.restEncoder,n);const r=o.length;sn(e.restEncoder,r);for(let s=0;s{const t=new Jz,n=kn(e.restDecoder);for(let o=0;o0){const i=m1(t.clients,r,()=>[]);for(let c=0;c{const o=new Jz,r=kn(e.restDecoder);for(let s=0;s0){const s=new df;return sn(s.restEncoder,0),qh(s,o),s.toUint8Array()}return null},j0e=d0e;class Rh extends Aqe{constructor({guid:t=p0e(),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=j0e(),this.guid=t,this.collectionid=n,this.share=new Map,this.store=new K0e,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=Ub(u=>{this.on("load",()=>{this.isLoaded=!0,u(this)})});const l=()=>Ub(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&&Do(t.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(xl(this.subdocs).map(t=>t.guid))}transact(t,n=null){return Do(this,t,n)}get(t,n=F0){const o=m1(this.share,t,()=>{const s=new n;return s._integrate(this,null),s}),r=o.constructor;if(n!==F0&&r!==n)if(r===F0){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,xb)}getText(t=""){return this.get(t,Zb)}getMap(t=""){return this.get(t,Yb)}getXmlElement(t=""){return this.get(t,Qb)}getXmlFragment(t=""){return this.get(t,pf)}toJSON(){const t={};return this.share.forEach((n,o)=>{t[o]=n.toJSON()}),t}destroy(){this.isDestroyed=!0,xl(this.subdocs).forEach(n=>n.destroy());const t=this._item;if(t!==null){this._item=null;const n=t.content;n.doc=new Rh({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,Do(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 I0e{constructor(t){this.restDecoder=t}resetDsCurVal(){}readDsClock(){return kn(this.restDecoder)}readDsLen(){return kn(this.restDecoder)}}class D0e extends I0e{readLeftID(){return Yn(kn(this.restDecoder),kn(this.restDecoder))}readRightID(){return Yn(kn(this.restDecoder),kn(this.restDecoder))}readClient(){return kn(this.restDecoder)}readInfo(){return lf(this.restDecoder)}readString(){return bl(this.restDecoder)}readParentInfo(){return kn(this.restDecoder)===1}readTypeRef(){return kn(this.restDecoder)}readLen(){return kn(this.restDecoder)}readAny(){return Hb(this.restDecoder)}readBuf(){return NRe(m0(this.restDecoder))}readJSON(){return JSON.parse(bl(this.restDecoder))}readKey(){return bl(this.restDecoder)}}class ZRe{constructor(t){this.dsCurrVal=0,this.restDecoder=t}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=kn(this.restDecoder),this.dsCurrVal}readDsLen(){const t=kn(this.restDecoder)+1;return this.dsCurrVal+=t,t}}class Kb extends ZRe{constructor(t){super(t),this.keys=[],kn(t),this.keyClockDecoder=new zS(m0(t)),this.clientDecoder=new gv(m0(t)),this.leftClockDecoder=new zS(m0(t)),this.rightClockDecoder=new zS(m0(t)),this.infoDecoder=new DH(m0(t),lf),this.stringDecoder=new Zqe(m0(t)),this.parentInfoDecoder=new DH(m0(t),lf),this.typeRefDecoder=new gv(m0(t)),this.lenDecoder=new gv(m0(t))}readLeftID(){return new vb(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new vb(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 Hb(this.restDecoder)}readBuf(){return m0(this.restDecoder)}readJSON(){return Hb(this.restDecoder)}readKey(){const t=this.keyClockDecoder.read();if(t{o=Lf(o,t[0].id.clock);const r=dc(t,o);sn(e.restEncoder,t.length-r),e.writeClient(n),sn(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)=>{y0(t,s)>r&&o.set(s,r)}),zx(t).forEach((r,s)=>{n.has(s)||o.set(s,0)}),sn(e.restEncoder,o.size),xl(o.entries()).sort((r,s)=>s[0]-r[0]).forEach(([r,s])=>{QRe(e,t.clients.get(r),r,s)})},JRe=(e,t)=>{const n=rs(),o=kn(e.restDecoder);for(let r=0;r{const o=[];let r=xl(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 K0e,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(O=>O!==h)}o.length=0};for(;;){if(d.constructor!==bi){const h=m1(p,d.id.client,()=>y0(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 O=n.get(g)||{refs:[],i:0};if(O.refs.length===O.i)u(g,y0(t,g)),f();else{d=O.refs[O.i++];continue}}else(h===0||h0)d=o.pop();else if(i!==null&&i.i0){const b=new df;return QB(b,c,new Map),sn(b.restEncoder,0),{missing:l,update:b.toUint8Array()}}return null},tTe=(e,t)=>QB(e,t.doc.store,t.beforeState),nTe=(e,t,n,o=new Kb(e))=>Do(t,r=>{r.local=!1;let s=!1;const i=r.doc,c=i.store,l=JRe(o,i),u=eTe(r,c,l),d=c.pendingStructs;if(d){for(const[f,b]of d.missing)if(bb)&&d.missing.set(f,b)}d.update=b4([d.update,u.update])}}else c.pendingStructs=u;const p=XH(o,r,c);if(c.pendingDs){const f=new Kb(yc(c.pendingDs));kn(f.restDecoder);const b=XH(f,r,c);p&&b?c.pendingDs=b4([p,b]):c.pendingDs=p||b}else c.pendingDs=p;if(s){const f=c.pendingStructs.update;c.pendingStructs=null,V0e(r.doc,f)}},n,!1),V0e=(e,t,n,o=Kb)=>{const r=yc(t);nTe(r,e,n,new o(r))},H0e=(e,t,n)=>V0e(e,t,n,D0e),oTe=(e,t,n=new Map)=>{QB(e,t.store,n),qh(e,YRe(t.store))},rTe=(e,t=new Uint8Array([0]),n=new df)=>{const o=U0e(t);oTe(n,e,o);const r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(zTe(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===e3)return gTe(r.map((s,i)=>i===0?s:yTe(s)));if(n.constructor===df)return b4(r)}return r[0]},JB=(e,t)=>rTe(e,t,new e3),sTe=e=>{const t=new Map,n=kn(e.restDecoder);for(let o=0;osTe(new I0e(yc(e))),X0e=(e,t)=>(sn(e.restEncoder,t.size),xl(t.entries()).sort((n,o)=>o[0]-n[0]).forEach(([n,o])=>{sn(e.restEncoder,n),sn(e.restEncoder,o)}),e),iTe=(e,t)=>X0e(e,zx(t.store)),aTe=(e,t=new $0e)=>(e instanceof Map?X0e(t,e):iTe(t,e),t.toUint8Array()),cTe=e=>aTe(e,new F0e);class lTe{constructor(){this.l=[]}}const GH=()=>new lTe,KH=(e,t)=>e.l.push(t),YH=(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.")},G0e=(e,t,n)=>UB(e.l,[t,n]);class vb{constructor(t,n){this.client=t,this.clock=n}}const Zy=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,Yn=(e,t)=>new vb(e,t),uTe=e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw uc()},K2=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!P0e(t.ds,e.id),x8=(e,t)=>{const n=m1(e.meta,x8,pd),o=e.doc.store;n.has(t)||(t.sv.forEach((r,s)=>{r{}),n.add(t))};class K0e{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const zx=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},y0=(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},Y0e=(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 uc()}n.push(t)},dc=(e,t)=>{let n=0,o=e.length-1,r=e[o],s=r.id.clock;if(s===t)return o;let i=lc(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[dc(n,t.clock)]},vS=dTe,w8=(e,t,n)=>{const o=dc(t,n),r=t[o];return r.id.clock{const n=e.doc.store.clients.get(t.client);return n[w8(e,n,t.clock)]},ZH=(e,t,n)=>{const o=t.clients.get(n.client),r=dc(o,n.clock),s=o[r];return n.clock!==s.id.clock+s.length-1&&s.constructor!==fi&&o.splice(r+1,0,O4(e,s,n.clock-s.id.clock+1)),s},pTe=(e,t,n)=>{const o=e.clients.get(t.id.client);o[dc(o,t.id.clock)]=n},Z0e=(e,t,n,o,r)=>{if(o===0)return;const s=n+o;let i=w8(e,t,n),c;do c=t[i++],st.deleteSet.clients.size===0&&!zqe(t.afterState,(n,o)=>t.beforeState.get(o)!==n)?!1:(YB(t.deleteSet),tTe(e,t),qh(e,t.deleteSet),!0),JH=(e,t,n)=>{const o=t._item;(o===null||o.id.clock<(e.beforeState.get(o.id.client)||0)&&!o.deleted)&&m1(e.changed,t,pd).add(n)},zv=(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 a1&&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},bTe=(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=dc(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=PB(r.length-1,1+dc(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+zv(r,l)}})},Q0e=(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),G0e(u._dEH,l,n))})}),c.push(()=>o.emit("afterTransaction",[n,o])),UB(c,[]),n._needFormattingCleanup&&BTe(n)}finally{o.gc&&bTe(s,r,o.gcFilter),hTe(s,r),n.afterState.forEach((d,p)=>{const f=n.beforeState.get(p)||0;if(f!==d){const b=r.clients.get(p),h=Lf(dc(b,f),1);for(let g=b.length-1;g>=h;)g-=1+zv(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=dc(b,f);h+11||h>0&&zv(b,h)}if(!n.local&&n.afterState.get(o.clientID)!==n.beforeState.get(o.clientID)&&(W0e(gx,Mi,"[yjs] ",uf,R0e,"Changed the client-id because another client seems to be using it."),o.clientID=j0e()),o.emit("afterTransactionCleanup",[n,o]),o._observers.has("update")){const d=new e3;QH(d,n)&&o.emit("update",[d.toUint8Array(),n.origin,o,n])}if(o._observers.has("updateV2")){const d=new df;QH(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])):Q0e(e,t+1)}}},Do=(e,t,n=null,o=!0)=>{const r=e._transactionCleanups;let s=!1,i=null;e._transaction===null&&(s=!0,e._transaction=new fTe(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&&Q0e(r,0)}}return i};function*mTe(e){const t=kn(e.restDecoder);for(let n=0;nb4(e,D0e,e3),MTe=(e,t)=>{if(e.constructor===fi){const{client:n,clock:o}=e.id;return new fi(Yn(n,o+t),e.length-t)}else if(e.constructor===bi){const{client:n,clock:o}=e.id;return new bi(Yn(n,o+t),e.length-t)}else{const n=e,{client:o,clock:r}=n.id;return new a1(Yn(o,r+t),null,Yn(o,r+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},b4=(e,t=Kb,n=df)=>{if(e.length===1)return e[0];const o=e.map(d=>new t(yc(d)));let r=o.map(d=>new eN(d,!0)),s=null;const i=new n,c=new tN(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===bi?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)ju(c,s.struct,s.offset),s={struct:f,offset:0},d.next();else if(s.struct.id.clock+s.struct.length0&&(s.struct.constructor===bi?s.struct.length-=h:f=MTe(f,h)),s.struct.mergeWith(f)||(ju(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!==bi;f=d.next())ju(c,s.struct,s.offset),s={struct:f,offset:0}}s!==null&&(ju(c,s.struct,s.offset),s=null),nN(c);const l=o.map(d=>ZB(d)),u=GRe(l);return qh(i,u),i.toUint8Array()},zTe=(e,t,n=Kb,o=df)=>{const r=U0e(t),s=new o,i=new tN(s),c=new n(yc(e)),l=new eN(c,!1);for(;l.curr;){const d=l.curr,p=d.id.client,f=r.get(p)||0;if(l.curr.constructor===bi){l.next();continue}if(d.id.clock+d.length>f)for(ju(i,d,Lf(f-d.id.clock,0)),l.next();l.curr&&l.curr.id.client===p;)ju(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()}nN(i);const u=ZB(c);return qh(s,u),s.toUint8Array()},J0e=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:yr(e.encoder.restEncoder)}),e.encoder.restEncoder=M0(),e.written=0)},ju=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&J0e(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),sn(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},nN=e=>{J0e(e);const t=e.encoder.restEncoder;sn(t,e.clientStructs.length);for(let n=0;n{const r=new n(yc(e)),s=new eN(r,!1),i=new o,c=new tN(i);for(let u=s.curr;u!==null;u=s.next())ju(c,t(u),0);nN(c);const l=ZB(r);return qh(i,l),i.toUint8Array()},yTe=e=>OTe(e,xRe,Kb,e3),eU="You must not compute changes after the event-handler fired.";class Ox{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=ATe(this.currentTarget,this.target))}deletes(t){return P0e(this.transaction.deleteSet,t.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw na(eU);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=hS(l.content.getContent());else return;else l!==null&&this.deletes(l)?(i="update",c=hS(l.content.getContent())):(i="add",c=void 0)}else if(this.deletes(s))i="delete",c=hS(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 na(eU);const n=this.target,o=pd(),r=pd(),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 ATe=(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},p1=()=>{VRe("Invalid access: Add Yjs type to a document before reading data.")},e1e=80;let oN=0;class vTe{constructor(t,n){t.marker=!0,this.p=t,this.index=n,this.timestamp=oN++}}const xTe=e=>{e.timestamp=oN++},t1e=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=oN++},wTe=(e,t,n)=>{if(e.length>=e1e){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)=>hv(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&&hv(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=Lf(t,r.index+n))}},Ax=(e,t,n)=>{const o=e,r=t.changedParentTypes;for(;m1(r,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;G0e(o._eH,n,t)};class F0{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=GH(),this._dEH=GH(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,n){this.doc=t,this._item=n}_copy(){throw ec()}clone(){throw ec()}_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){KH(this._eH,t)}observeDeep(t){KH(this._dEH,t)}unobserve(t){YH(this._eH,t)}unobserveDeep(t){YH(this._dEH,t)}toJSON(){}}const n1e=(e,t,n)=>{e.doc??p1(),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},o1e=e=>{e.doc??p1();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??p1();o!==null;){if(o.countable&&!o.deleted){const r=o.content.getContent();for(let s=0;s{const n=[];return LM(e,(o,r)=>{n.push(t(o,r,e))}),n},_Te=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}}}},s1e=(e,t)=>{e.doc??p1();const n=yx(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 a1(Yn(i,y0(c,i)),r,r&&r.lastId,l,l&&l.id,t,null,new ff(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 a1(Yn(i,y0(c,i)),r,r&&r.lastId,l,l&&l.id,t,null,new t3(new Uint8Array(p))),r.integrate(e,0);break;case Rh:r=new a1(Yn(i,y0(c,i)),r,r&&r.lastId,l,l&&l.id,t,null,new n3(p)),r.integrate(e,0);break;default:if(p instanceof F0)r=new a1(Yn(i,y0(c,i)),r,r&&r.lastId,l,l&&l.id,t,null,new $l(p)),r.integrate(e,0);else throw new Error("Unexpected content type in insert operation")}}}),d()},i1e=()=>na("Length exceeded!"),a1e=(e,t,n,o)=>{if(n>t._length)throw i1e();if(n===0)return t._searchMarker&&NM(t._searchMarker,n,o.length),h4(e,t,null,o);const r=n,s=yx(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 h4(e,t,r,n)},c1e=(e,t,n,o)=>{if(o===0)return;const r=n,s=o,i=yx(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 i1e();t._searchMarker&&NM(t._searchMarker,r,-s+o)},m4=(e,t,n)=>{const o=t._map.get(n);o!==void 0&&o.delete(e)},rN=(e,t,n,o)=>{const r=t._map.get(n)||null,s=e.doc,i=s.clientID;let c;if(o==null)c=new ff([o]);else switch(o.constructor){case Number:case Object:case Boolean:case Array:case String:c=new ff([o]);break;case Uint8Array:c=new t3(o);break;case Rh:c=new n3(o);break;default:if(o instanceof F0)c=new $l(o);else throw new Error("Unexpected content type")}new a1(Yn(i,y0(s.store,i)),r,r&&r.lastId,null,null,t,n,c).integrate(e,0)},sN=(e,t)=>{e.doc??p1();const n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},l1e=e=>{const t={};return e.doc??p1(),e._map.forEach((n,o)=>{n.deleted||(t[o]=n.content.getContent()[n.length-1])}),t},u1e=(e,t)=>{e.doc??p1();const n=e._map.get(t);return n!==void 0&&!n.deleted},STe=(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&&K2(s,t)&&(n[r]=s.content.getContent()[s.length-1])}),n},Qy=e=>(e.doc??p1(),URe(e._map.entries(),t=>!t[1].deleted));class CTe extends Ox{}class xb extends F0{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){const n=new xb;return n.push(t),n}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new xb}clone(){const t=new xb;return t.insert(0,this.toArray().map(n=>n instanceof F0?n.clone():n)),t}get length(){return this.doc??p1(),this._length}_callObserver(t,n){super._callObserver(t,n),Ax(this,t,new CTe(this,t))}insert(t,n){this.doc!==null?Do(this.doc,o=>{a1e(o,this,t,n)}):this._prelimContent.splice(t,0,...n)}push(t){this.doc!==null?Do(this.doc,n=>{kTe(n,this,t)}):this._prelimContent.push(...t)}unshift(t){this.insert(0,t)}delete(t,n=1){this.doc!==null?Do(this.doc,o=>{c1e(o,this,t,n)}):this._prelimContent.splice(t,n)}get(t){return s1e(this,t)}toArray(){return o1e(this)}slice(t=0,n=this.length){return n1e(this,t,n)}toJSON(){return this.map(t=>t instanceof F0?t.toJSON():t)}map(t){return r1e(this,t)}forEach(t){LM(this,t)}[Symbol.iterator](){return _Te(this)}_write(t){t.writeTypeRef(e8e)}}const qTe=e=>new xb;class RTe extends Ox{constructor(t,n,o){super(t,n),this.keysChanged=o}}class Yb extends F0{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 Yb}clone(){const t=new Yb;return this.forEach((n,o)=>{t.set(o,n instanceof F0?n.clone():n)}),t}_callObserver(t,n){Ax(this,t,new RTe(this,t,n))}toJSON(){this.doc??p1();const t={};return this._map.forEach((n,o)=>{if(!n.deleted){const r=n.content.getContent()[n.length-1];t[o]=r instanceof F0?r.toJSON():r}}),t}get size(){return[...Qy(this)].length}keys(){return AS(Qy(this),t=>t[0])}values(){return AS(Qy(this),t=>t[1].content.getContent()[t[1].length-1])}entries(){return AS(Qy(this),t=>[t[0],t[1].content.getContent()[t[1].length-1]])}forEach(t){this.doc??p1(),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?Do(this.doc,n=>{m4(n,this,t)}):this._prelimContent.delete(t)}set(t,n){return this.doc!==null?Do(this.doc,o=>{rN(o,this,t,n)}):this._prelimContent.set(t,n),n}get(t){return sN(this,t)}has(t){return u1e(this,t)}clear(){this.doc!==null?Do(this.doc,t=>{this.forEach(function(n,o,r){m4(t,r,o)})}):this._prelimContent.clear()}_write(t){t.writeTypeRef(t8e)}}const TTe=e=>new Yb,Vu=(e,t)=>e===t||typeof e=="object"&&typeof t=="object"&&e&&t&&yRe(e,t);class _8{constructor(t,n,o,r){this.left=t,this.right=n,this.index=o,this.currentAttributes=r}forward(){switch(this.right===null&&uc(),this.right.content.constructor){case c0:this.right.deleted||Th(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 tU=(e,t,n)=>{for(;t.right!==null&&n>0;){switch(t.right.content.constructor){case c0:t.right.deleted||Th(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n{const r=new Map,s=o?yx(t,n):null;if(s){const i=new _8(s.p.left,s.p,s.index,r);return tU(e,i,n-s.index)}else{const i=new _8(null,t._start,0,r);return tU(e,i,n)}},d1e=(e,t,n,o)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===c0&&Vu(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 a1(Yn(s,y0(r.store,s)),l,l&&l.lastId,u,u&&u.id,t,null,new c0(c,i));d.integrate(e,0),n.right=d,n.forward()})},Th=(e,t)=>{const{key:n,value:o}=t;o===null?e.delete(n):e.set(n,o)},p1e=(e,t)=>{for(;e.right!==null;){if(!(e.right.deleted||e.right.content.constructor===c0&&Vu(t[e.right.content.key]??null,e.right.content.value)))break;e.forward()}},f1e=(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(!Vu(u,l)){i.set(c,u);const{left:d,right:p}=n;n.right=new a1(Yn(s,y0(r.store,s)),d,d&&d.lastId,p,p&&p.id,t,null,new c0(c,l)),n.right.integrate(e,0),n.forward()}}return i},xS=(e,t,n,o,r)=>{n.currentAttributes.forEach((f,b)=>{r[b]===void 0&&(r[b]=null)});const s=e.doc,i=s.clientID;p1e(n,r);const c=f1e(e,t,n,r),l=o.constructor===String?new pc(o):o instanceof F0?new $l(o):new Pf(o);let{left:u,right:d,index:p}=n;t._searchMarker&&NM(t._searchMarker,n.index,l.getLength()),d=new a1(Yn(i,y0(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(),d1e(e,t,n,c)},nU=(e,t,n,o,r)=>{const s=e.doc,i=s.clientID;p1e(n,r);const c=f1e(e,t,n,r);e:for(;n.right!==null&&(o>0||c.size>0&&(n.right.deleted||n.right.content.constructor===c0));){if(!n.right.deleted)switch(n.right.content.constructor){case c0:{const{key:l,value:u}=n.right.content,d=r[l];if(d!==void 0){if(Vu(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 a1(Yn(i,y0(s.store,i)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new pc(l)),n.right.integrate(e,0),n.forward()}d1e(e,t,n,c)},b1e=(e,t,n,o,r)=>{let s=t;const i=rs();for(;s&&(!s.countable||s.deleted);){if(!s.deleted&&s.content.constructor===c0){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 c0:{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&&Th(r,u);break}}}t=t.right}return c},ETe=(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===c0){const o=t.content.key;n.has(o)?t.delete(e):n.add(o)}t=t.left}},WTe=e=>{let t=0;return Do(e.doc,n=>{let o=e._start,r=e._start,s=rs();const i=g8(s);for(;r;){if(r.deleted===!1)switch(r.content.constructor){case c0:Th(i,r.content);break;default:t+=b1e(n,o,r,s,i),s=g8(i),o=r;break}r=r.right}}),t},BTe=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&&Z0e(e,n.store.clients.get(o),s,r,i=>{!i.deleted&&i.content.constructor===c0&&i.constructor!==fi&&t.add(i.parent)})}Do(n,o=>{L0e(e,e.deleteSet,r=>{if(r instanceof fi||!r.parent._hasFormatting||t.has(r.parent))return;const s=r.parent;r.content.constructor===c0?t.add(s):ETe(o,r)});for(const r of t)WTe(r)})},oU=(e,t,n)=>{const o=n,r=g8(t.currentAttributes),s=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case $l:case Pf:case pc: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=[];Do(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},zRe(l)||(b.attributes=gRe({},l))),d=0;break}b&&n.push(b),c=null}};for(;i!==null;){switch(i.content.constructor){case $l:case Pf: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 pc: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 c0:{const{key:b,value:h}=i.content;if(this.adds(i)){if(!this.deletes(i)){const g=r.get(b)??null;Vu(g,h)?h!==null&&i.delete(o):(c==="retain"&&f(),Vu(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;Vu(g,h)||(c==="retain"&&f(),l[b]=g)}else if(!i.deleted){s.set(b,h);const g=l[b];g!==void 0&&(Vu(g,h)?g!==null&&i.delete(o):(c==="retain"&&f(),h===null?delete l[b]:l[b]=h))}i.deleted||(c==="insert"&&f(),Th(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 Zb extends F0{constructor(t){super(),this._pending=t!==void 0?[()=>this.insert(0,t)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??p1(),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 Zb}clone(){const t=new Zb;return t.applyDelta(this.toDelta()),t}_callObserver(t,n){super._callObserver(t,n);const o=new NTe(this,t,n);Ax(this,t,o),!t.local&&this._hasFormatting&&(t._needFormattingCleanup=!0)}toString(){this.doc??p1();let t="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===pc&&(t+=n.content.str),n=n.right;return t}toJSON(){return this.toString()}applyDelta(t,{sanitize:n=!0}={}){this.doc!==null?Do(this.doc,o=>{const r=new _8(null,this._start,0,new Map);for(let s=0;s0)&&xS(o,this,r,c,i.attributes||{})}else i.retain!==void 0?nU(o,this,r,i.retain,i.attributes||{}):i.delete!==void 0&&oU(o,r,i.delete)}}):this._pending.push(()=>this.applyDelta(t))}toDelta(t,n,o){this.doc??p1();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(K2(l,t)||n!==void 0&&K2(l,n))switch(l.content.constructor){case pc:{const p=s.get("ychange");t!==void 0&&!K2(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&&!K2(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 $l:case Pf:{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 c0:K2(l,t)&&(u(),Th(s,l.content));break}l=l.right}u()};return t||n?Do(i,p=>{t&&x8(p,t),n&&x8(p,n),d()},"cleanup"):d(),r}insert(t,n,o){if(n.length<=0)return;const r=this.doc;r!==null?Do(r,s=>{const i=Jy(s,this,t,!o);o||(o={},i.currentAttributes.forEach((c,l)=>{o[l]=c})),xS(s,this,i,n,o)}):this._pending.push(()=>this.insert(t,n,o))}insertEmbed(t,n,o){const r=this.doc;r!==null?Do(r,s=>{const i=Jy(s,this,t,!o);xS(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?Do(o,r=>{oU(r,Jy(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?Do(r,s=>{const i=Jy(s,this,t,!1);i.right!==null&&nU(s,this,i,n,o)}):this._pending.push(()=>this.format(t,n,o))}removeAttribute(t){this.doc!==null?Do(this.doc,n=>{m4(n,this,t)}):this._pending.push(()=>this.removeAttribute(t))}setAttribute(t,n){this.doc!==null?Do(this.doc,o=>{rN(o,this,t,n)}):this._pending.push(()=>this.setAttribute(t,n))}getAttribute(t){return sN(this,t)}getAttributes(){return l1e(this)}_write(t){t.writeTypeRef(n8e)}}const LTe=e=>new Zb;class wS{constructor(t,n=()=>!0){this._filter=n,this._root=t,this._currentNode=t._start,this._firstCall=!0,t.doc??p1()}[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===Qb||n.constructor===pf)&&n._start!==null)t=n._start;else for(;t!==null;)if(t.right!==null){t=t.right;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 pf extends F0{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 pf}clone(){const t=new pf;return t.insert(0,this.toArray().map(n=>n instanceof F0?n.clone():n)),t}get length(){return this.doc??p1(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(t){return new wS(this,t)}querySelector(t){t=t.toUpperCase();const o=new wS(this,r=>r.nodeName&&r.nodeName.toUpperCase()===t).next();return o.done?null:o.value}querySelectorAll(t){return t=t.toUpperCase(),xl(new wS(this,n=>n.nodeName&&n.nodeName.toUpperCase()===t))}_callObserver(t,n){Ax(this,t,new ITe(this,n,t))}toString(){return r1e(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),LM(this,s=>{r.insertBefore(s.toDOM(t,n,o),null)}),r}insert(t,n){this.doc!==null?Do(this.doc,o=>{a1e(o,this,t,n)}):this._prelimContent.splice(t,0,...n)}insertAfter(t,n){if(this.doc!==null)Do(this.doc,o=>{const r=t&&t instanceof F0?t._item:t;h4(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 na("Reference item not found");o.splice(r,0,...n)}}delete(t,n=1){this.doc!==null?Do(this.doc,o=>{c1e(o,this,t,n)}):this._prelimContent.splice(t,n)}toArray(){return o1e(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return s1e(this,t)}slice(t=0,n=this.length){return n1e(this,t,n)}forEach(t){LM(this,t)}_write(t){t.writeTypeRef(r8e)}}const PTe=e=>new pf;class Qb extends pf{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 Qb(this.nodeName)}clone(){const t=new Qb(this.nodeName),n=this.getAttributes();return MRe(n,(o,r)=>{typeof o=="string"&&t.setAttribute(r,o)}),t.insert(0,this.toArray().map(o=>o instanceof F0?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?Do(this.doc,n=>{m4(n,this,t)}):this._prelimAttrs.delete(t)}setAttribute(t,n){this.doc!==null?Do(this.doc,o=>{rN(o,this,t,n)}):this._prelimAttrs.set(t,n)}getAttribute(t){return sN(this,t)}hasAttribute(t){return u1e(this,t)}getAttributes(t){return t?STe(this,t):l1e(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 LM(this,i=>{r.appendChild(i.toDOM(t,n,o))}),o!==void 0&&o._createAssociation(r,this),r}_write(t){t.writeTypeRef(o8e),t.writeKey(this.nodeName)}}const jTe=e=>new Qb(e.readKey());class ITe extends Ox{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 g4 extends Yb{constructor(t){super(),this.hookName=t}_copy(){return new g4(this.hookName)}clone(){const t=new g4(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(s8e),t.writeKey(this.hookName)}}const DTe=e=>new g4(e.readKey());class M4 extends Zb{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 M4}clone(){const t=new M4;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(i8e)}}const FTe=e=>new M4;class iN{constructor(t,n){this.id=t,this.length=n}get deleted(){throw ec()}mergeWith(t){return!1}write(t,n,o){throw ec()}integrate(t,n){throw ec()}}const $Te=0;class fi extends iN{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),Y0e(t.doc.store,this)}write(t,n){t.writeInfo($Te),t.writeLen(this.length-n)}getMissing(t,n){return null}}class t3{constructor(t){this.content=t}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new t3(this.content)}splice(t){throw ec()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeBuf(this.content)}getRef(){return 3}}const VTe=e=>new t3(e.readBuf());class PM{constructor(t){this.len=t}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new PM(this.len)}splice(t){const n=new PM(this.len-t);return this.len=t,n}mergeWith(t){return this.len+=t.len,!0}integrate(t,n){f4(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 HTe=e=>new PM(e.readLen()),h1e=(e,t)=>new Rh({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class n3{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 n3(h1e(this.doc.guid,this.opts))}splice(t){throw ec()}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 UTe=e=>new n3(h1e(e.readString(),e.readAny()));class Pf{constructor(t){this.embed=t}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new Pf(this.embed)}splice(t){throw ec()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeJSON(this.embed)}getRef(){return 5}}const XTe=e=>new Pf(e.readJSON());class c0{constructor(t,n){this.key=t,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new c0(this.key,this.value)}splice(t){throw ec()}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 GTe=e=>new c0(e.readKey(),e.readJSON());class z4{constructor(t){this.arr=t}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new z4(this.arr)}splice(t){const n=new z4(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 QTe=e=>new pc(e.readString()),JTe=[qTe,TTe,LTe,jTe,PTe,DTe,FTe],e8e=0,t8e=1,n8e=2,o8e=3,r8e=4,s8e=5,i8e=6;class $l{constructor(t){this.type=t}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new $l(this.type._copy())}splice(t){throw ec()}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 a8e=e=>new $l(JTe[e.readTypeRef()](e)),O4=(e,t,n)=>{const{client:o,clock:r}=t.id,s=new a1(Yn(o,r+n),t,Yn(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=Yn(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 a1=class k8 extends iN{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()?BH:0}set marker(t){(this.info&gS)>0!==t&&(this.info^=gS)}get marker(){return(this.info&gS)>0}get keep(){return(this.info&WH)>0}set keep(t){this.keep!==t&&(this.info^=WH)}get countable(){return(this.info&BH)>0}get deleted(){return(this.info&mS)>0}set deleted(t){this.deleted!==t&&(this.info^=mS)}markDeleted(){this.info|=mS}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=y0(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=y0(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===vb&&this.id.client!==this.parent.client&&this.parent.clock>=y0(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=ZH(t,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=fd(t,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===fi||this.right&&this.right.constructor===fi)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===k8&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===k8&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===vb){const o=vS(n,this.parent);o.constructor===fi?this.parent=null:this.parent=o.content.type}return null}integrate(t,n){if(n>0&&(this.id.clock+=n,this.left=ZH(t,t.doc.store,Yn(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),Zy(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(),f4(t.deleteSet,this.id.client,this.id.clock,this.length),JH(t,n,this.parentSub),this.content.delete(t)}}gc(t,n){if(!this.deleted)throw uc();this.content.gc(t),n?pTe(t,this,new fi(this.id,this.length)):this.content=new PM(this.length)}write(t,n){const o=n>0?Yn(this.id.client,this.id.clock+n-1):this.origin,r=this.rightOrigin,s=this.parentSub,i=this.content.getRef()&fx|(o===null?0:Ts)|(r===null?0:fl)|(s===null?0:TM);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=uTe(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===vb?(t.writeParentInfo(!1),t.writeLeftID(c)):uc();s!==null&&t.writeString(s)}this.content.write(t,n)}};const m1e=(e,t)=>c8e[t&fx](e),c8e=[()=>{uc()},HTe,KTe,VTe,QTe,XTe,GTe,a8e,ZTe,UTe,()=>{uc()}],l8e=10;class bi extends iN{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,n){uc()}write(t,n){t.writeInfo(l8e),sn(t.restEncoder,this.length-n)}getMissing(t,n){return null}}const g1e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof EH<"u"?EH:{},M1e="__ $YJS$ __";g1e[M1e]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");g1e[M1e]=!0;const jf=e=>Ub((t,n)=>{e.onerror=o=>n(new Error(o.target.error)),e.onsuccess=o=>t(o.target.result)}),u8e=(e,t)=>Ub((n,o)=>{const r=indexedDB.open(e);r.onupgradeneeded=s=>t(s.target.result),r.onerror=s=>o(na(s.target.error)),r.onsuccess=s=>{const i=s.target.result;i.onversionchange=()=>{i.close()},n(i)}}),d8e=e=>jf(indexedDB.deleteDatabase(e)),p8e=(e,t)=>t.forEach(n=>e.createObjectStore.apply(e,n)),Dg=(e,t,n="readwrite")=>{const o=e.transaction(t,n);return t.map(r=>O8e(o,r))},z1e=(e,t)=>jf(e.count(t)),f8e=(e,t)=>jf(e.get(t)),O1e=(e,t)=>jf(e.delete(t)),b8e=(e,t,n)=>jf(e.put(t,n)),S8=(e,t)=>jf(e.add(t)),h8e=(e,t,n)=>jf(e.getAll(t,n)),m8e=(e,t,n)=>{let o=null;return z8e(e,t,r=>(o=r,!1),n).then(()=>o)},g8e=(e,t=null)=>m8e(e,t,"prev"),M8e=(e,t)=>Ub((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()}}),z8e=(e,t,n,o="next")=>M8e(e.openKeyCursor(t,o),r=>n(r.key)),O8e=(e,t)=>e.objectStore(t),y8e=(e,t)=>IDBKeyRange.upperBound(e,t),A8e=(e,t)=>IDBKeyRange.lowerBound(e,t),_S="custom",y1e="updates",A1e=500,v1e=(e,t=()=>{},n=()=>{})=>{const[o]=Dg(e.db,[y1e]);return h8e(o,A8e(e._dbref,!1)).then(r=>{e._destroyed||(t(o),Do(e.doc,()=>{r.forEach(s=>H0e(e.doc,s))},e,!1),n(o))}).then(()=>g8e(o).then(r=>{e._dbref=r+1})).then(()=>z1e(o).then(r=>{e._dbsize=r})).then(()=>o)},v8e=(e,t=!0)=>v1e(e).then(n=>{(t||e._dbsize>=A1e)&&S8(n,JB(e.doc)).then(()=>O1e(n,y8e(e._dbref,!0))).then(()=>z1e(n).then(o=>{e._dbsize=o}))});class x8e extends Zz{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=u8e(t,o=>p8e(o,[["updates",{autoIncrement:!0}],["custom"]])),this.whenSynced=Ub(o=>this.on("synced",()=>o(this))),this._db.then(o=>{this.db=o,v1e(this,i=>S8(i,JB(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]=Dg(this.db,[y1e]);S8(s,o),++this._dbsize>=A1e&&(this._storeTimeoutId!==null&&clearTimeout(this._storeTimeoutId),this._storeTimeoutId=setTimeout(()=>{v8e(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(()=>{d8e(this.name)})}get(t){return this._db.then(n=>{const[o]=Dg(n,[_S],"readonly");return f8e(o,t)})}set(t,n){return this._db.then(o=>{const[r]=Dg(o,[_S]);return b8e(r,n,t)})}del(t){return this._db.then(n=>{const[o]=Dg(n,[_S]);return O1e(o,t)})}}function w8e(e,t,n){const o=`${t}-${e}`,r=new x8e(o,n);return new Promise(s=>{r.on("synced",()=>{s(()=>r.destroy())})})}const _8e=1200,k8e=2500,y4=3e4,C8=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,y4/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(C8,PB(vqe(e.unsuccessfulReconnects+1)*_8e,k8e),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,y4/2)}}};class S8e extends Zz{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&&y4n.key===t&&this.onmessage!==null&&this.onmessage({data:XB(n.newValue||"")}),hRe(this._onChange)}postMessage(t){O0e.setItem(this.room,S0e(RRe(t)))}close(){mRe(this._onChange)}}const q8e=typeof BroadcastChannel>"u"?C8e:BroadcastChannel,aN=e=>m1(x1e,e,()=>{const t=pd(),n=new q8e(e);return n.onmessage=o=>t.forEach(r=>r(o.data,"broadcastchannel")),{bc:n,subs:t}}),R8e=(e,t)=>(aN(e).subs.add(t),t),T8e=(e,t)=>{const n=aN(e),o=n.subs.delete(t);return o&&n.subs.size===0&&(n.bc.close(),x1e.delete(e)),o},E8e=(e,t,n=null)=>{const o=aN(e);o.bc.postMessage(t),o.subs.forEach(r=>r(t,n))},W8e=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}};function eA(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 kS={exports:{}},rU;function B8e(){return rU||(rU=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 eA=="function"&&eA;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 O=c[f]={exports:{}};i[f][0].call(O.exports,function(v){var _=i[f][1][v];return u(_||v)},O,O.exports,s,i,c,l)}return c[f].exports}for(var d=typeof eA=="function"&&eA,p=0;p>16,T[E++]=255&y>>8,T[E++]=255&y;return R===2&&(y=g[M.charCodeAt(k)]<<2|g[M.charCodeAt(k+1)]>>4,T[E++]=255&y),R===1&&(y=g[M.charCodeAt(k)]<<10|g[M.charCodeAt(k+1)]<<4|g[M.charCodeAt(k+2)]>>2,T[E++]=255&y>>8,T[E++]=255&y),T}function p(M){return h[63&M>>18]+h[63&M>>12]+h[63&M>>6]+h[63&M]}function f(M,y,k){for(var S,C=[],R=y;RE?E:T+R));return S===1?(y=M[k-1],C.push(h[y>>2]+h[63&y<<4]+"==")):S===2&&(y=(M[k-2]<<8)+M[k-1],C.push(h[y>>10]+h[63&y>>4]+h[63&y<<2]+"=")),C.join("")}c.byteLength=function(M){var y=l(M),k=y[0],S=y[1];return 3*(k+S)/4-S},c.toByteArray=d,c.fromByteArray=b;for(var h=[],g=[],O=typeof Uint8Array>"u"?Array:Uint8Array,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_=0,A=v.length;_B)throw new RangeError('The value "'+B+'" is invalid for option "size"')}function h(B,$,ee){return b(B),0>=B||$===void 0?d(B):typeof ee=="string"?d(B).fill($,ee):d(B).fill($)}function g(B){return b(B),d(0>B?0:0|M(B))}function O(B,$){if((typeof $!="string"||$==="")&&($="utf8"),!p.isEncoding($))throw new TypeError("Unknown encoding: "+$);var ee=0|y(B,$),xe=d(ee),Ee=xe.write(B,$);return Ee!==ee&&(xe=xe.slice(0,Ee)),xe}function v(B){for(var $=0>B.length?0:0|M(B.length),ee=d($),xe=0;xe<$;xe+=1)ee[xe]=255&B[xe];return ee}function _(B,$,ee){if(0>$||B.byteLength<$)throw new RangeError('"offset" is outside of buffer bounds');if(B.byteLength<$+(ee||0))throw new RangeError('"length" is outside of buffer bounds');var xe;return xe=$===void 0&&ee===void 0?new Uint8Array(B):ee===void 0?new Uint8Array(B,$):new Uint8Array(B,$,ee),xe.__proto__=p.prototype,xe}function A(B){if(p.isBuffer(B)){var $=0|M(B.length),ee=d($);return ee.length===0||B.copy(ee,0,0,$),ee}return B.length===void 0?B.type==="Buffer"&&Array.isArray(B.data)?v(B.data):void 0:typeof B.length!="number"||he(B.length)?d(0):v(B)}function M(B){if(B>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|B}function y(B,$){if(p.isBuffer(B))return B.length;if(ArrayBuffer.isView(B)||ie(B,ArrayBuffer))return B.byteLength;if(typeof B!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof B);var ee=B.length,xe=2>>1;case"base64":return te(B).length;default:if(Ee)return xe?-1:ye(B).length;$=(""+$).toLowerCase(),Ee=!0}}function k(B,$,ee){var xe=!1;if(($===void 0||0>$)&&($=0),$>this.length||((ee===void 0||ee>this.length)&&(ee=this.length),0>=ee)||(ee>>>=0,$>>>=0,ee<=$))return"";for(B||(B="utf8");;)switch(B){case"hex":return X(this,$,ee);case"utf8":case"utf-8":return H(this,$,ee);case"ascii":return U(this,$,ee);case"latin1":case"binary":return Z(this,$,ee);case"base64":return j(this,$,ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q(this,$,ee);default:if(xe)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),xe=!0}}function S(B,$,ee){var xe=B[$];B[$]=B[ee],B[ee]=xe}function C(B,$,ee,xe,Ee){if(B.length===0)return-1;if(typeof ee=="string"?(xe=ee,ee=0):2147483647ee&&(ee=-2147483648),ee=+ee,he(ee)&&(ee=Ee?0:B.length-1),0>ee&&(ee=B.length+ee),ee>=B.length){if(Ee)return-1;ee=B.length-1}else if(0>ee)if(Ee)ee=0;else return-1;if(typeof $=="string"&&($=p.from($,xe)),p.isBuffer($))return $.length===0?-1:R(B,$,ee,xe,Ee);if(typeof $=="number")return $&=255,typeof Uint8Array.prototype.indexOf=="function"?Ee?Uint8Array.prototype.indexOf.call(B,$,ee):Uint8Array.prototype.lastIndexOf.call(B,$,ee):R(B,[$],ee,xe,Ee);throw new TypeError("val must be string, number or Buffer")}function R(B,$,ee,xe,Ee){function De(pe,Se){return ot===1?pe[Se]:pe.readUInt16BE(Se*ot)}var ot=1,_t=B.length,gt=$.length;if(xe!==void 0&&(xe=(xe+"").toLowerCase(),xe==="ucs2"||xe==="ucs-2"||xe==="utf16le"||xe==="utf-16le")){if(2>B.length||2>$.length)return-1;ot=2,_t/=2,gt/=2,ee/=2}var St;if(Ee){var se=-1;for(St=ee;St<_t;St++)if(De(B,St)!==De($,se===-1?0:St-se))se!==-1&&(St-=St-se),se=-1;else if(se===-1&&(se=St),St-se+1===gt)return se*ot}else for(ee+gt>_t&&(ee=_t-gt),St=ee;0<=St;St--){for(var V=!0,Y=0;YEe&&(xe=Ee)):xe=Ee;var De=$.length;xe>De/2&&(xe=De/2);for(var ot,_t=0;_tDe&&(ot=De):_t===2?(gt=B[Ee+1],(192>)==128&&(V=(31&De)<<6|63>,127V||57343V&&(ot=V)))}ot===null?(ot=65533,_t=1):65535>>10),ot=56320|1023&ot),xe.push(ot),Ee+=_t}return F(xe)}function F(B){var $=B.length;if($<=4096)return l.apply(String,B);for(var ee="",xe=0;xe<$;)ee+=l.apply(String,B.slice(xe,xe+=4096));return ee}function U(B,$,ee){var xe="";ee=u(B.length,ee);for(var Ee=$;Ee$)&&($=0),(!ee||0>ee||ee>xe)&&(ee=xe);for(var Ee="",De=$;DeB)throw new RangeError("offset is not uint");if(B+$>ee)throw new RangeError("Trying to access beyond buffer length")}function ae(B,$,ee,xe,Ee,De){if(!p.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if($>Ee||$B.length)throw new RangeError("Index out of range")}function be(B,$,ee,xe){if(ee+xe>B.length)throw new RangeError("Index out of range");if(0>ee)throw new RangeError("Index out of range")}function re(B,$,ee,xe,Ee){return $=+$,ee>>>=0,Ee||be(B,$,ee,4),Ce.write(B,$,ee,xe,23,4),ee+4}function de(B,$,ee,xe,Ee){return $=+$,ee>>>=0,Ee||be(B,$,ee,8),Ce.write(B,$,ee,xe,52,8),ee+8}function le(B){if(B=B.split("=")[0],B=B.trim().replace(ce,""),2>B.length)return"";for(;B.length%4!=0;)B+="=";return B}function ze(B){return 16>B?"0"+B.toString(16):B.toString(16)}function ye(B,$){$=$||1/0;for(var ee,xe=B.length,Ee=null,De=[],ot=0;otee){if(!Ee){if(56319ee){-1<($-=3)&&De.push(239,191,189),Ee=ee;continue}ee=(Ee-55296<<10|ee-56320)+65536}else Ee&&-1<($-=3)&&De.push(239,191,189);if(Ee=null,128>ee){if(0>($-=1))break;De.push(ee)}else if(2048>ee){if(0>($-=2))break;De.push(192|ee>>6,128|63&ee)}else if(65536>ee){if(0>($-=3))break;De.push(224|ee>>12,128|63&ee>>6,128|63&ee)}else if(1114112>ee){if(0>($-=4))break;De.push(240|ee>>18,128|63&ee>>12,128|63&ee>>6,128|63&ee)}else throw new Error("Invalid code point")}return De}function We(B){for(var $=[],ee=0;ee($-=2));++ot)ee=B.charCodeAt(ot),xe=ee>>8,Ee=ee%256,De.push(Ee),De.push(xe);return De}function te(B){return ke.toByteArray(le(B))}function Oe(B,$,ee,xe){for(var Ee=0;Ee=$.length||Ee>=B.length);++Ee)$[Ee+ee]=B[Ee];return Ee}function ie(B,$){return B instanceof $||B!=null&&B.constructor!=null&&B.constructor.name!=null&&B.constructor.name===$.name}function he(B){return B!==B}var ke=s("base64-js"),Ce=s("ieee754");c.Buffer=p,c.SlowBuffer=function(B){return+B!=B&&(B=0),p.alloc(+B)},c.INSPECT_MAX_BYTES=50,c.kMaxLength=2147483647,p.TYPED_ARRAY_SUPPORT=function(){try{var B=new Uint8Array(1);return B.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},B.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(B,$,ee){return f(B,$,ee)},p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array,p.alloc=function(B,$,ee){return h(B,$,ee)},p.allocUnsafe=function(B){return g(B)},p.allocUnsafeSlow=function(B){return g(B)},p.isBuffer=function(B){return B!=null&&B._isBuffer===!0&&B!==p.prototype},p.compare=function(B,$){if(ie(B,Uint8Array)&&(B=p.from(B,B.offset,B.byteLength)),ie($,Uint8Array)&&($=p.from($,$.offset,$.byteLength)),!p.isBuffer(B)||!p.isBuffer($))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(B===$)return 0;for(var ee=B.length,xe=$.length,Ee=0,De=u(ee,xe);Ee$&&(B+=" ... "),""},p.prototype.compare=function(B,$,ee,xe,Ee){if(ie(B,Uint8Array)&&(B=p.from(B,B.offset,B.byteLength)),!p.isBuffer(B))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof B);if($===void 0&&($=0),ee===void 0&&(ee=B?B.length:0),xe===void 0&&(xe=0),Ee===void 0&&(Ee=this.length),0>$||ee>B.length||0>xe||Ee>this.length)throw new RangeError("out of range index");if(xe>=Ee&&$>=ee)return 0;if(xe>=Ee)return-1;if($>=ee)return 1;if($>>>=0,ee>>>=0,xe>>>=0,Ee>>>=0,this===B)return 0;for(var De=Ee-xe,ot=ee-$,_t=u(De,ot),gt=this.slice(xe,Ee),St=B.slice($,ee),se=0;se<_t;++se)if(gt[se]!==St[se]){De=gt[se],ot=St[se];break}return De>>=0,isFinite(ee)?(ee>>>=0,xe===void 0&&(xe="utf8")):(xe=ee,ee=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Ee=this.length-$;if((ee===void 0||ee>Ee)&&(ee=Ee),0ee||0>$)||$>this.length)throw new RangeError("Attempt to write outside buffer bounds");xe||(xe="utf8");for(var De=!1;;)switch(xe){case"hex":return T(this,B,$,ee);case"utf8":case"utf-8":return E(this,B,$,ee);case"ascii":return N(this,B,$,ee);case"latin1":case"binary":return L(this,B,$,ee);case"base64":return P(this,B,$,ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,B,$,ee);default:if(De)throw new TypeError("Unknown encoding: "+xe);xe=(""+xe).toLowerCase(),De=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},p.prototype.slice=function(B,$){var ee=this.length;B=~~B,$=$===void 0?ee:~~$,0>B?(B+=ee,0>B&&(B=0)):B>ee&&(B=ee),0>$?($+=ee,0>$&&($=0)):$>ee&&($=ee),$>>=0,$>>>=0,ee||ne(B,$,this.length);for(var xe=this[B],Ee=1,De=0;++De<$&&(Ee*=256);)xe+=this[B+De]*Ee;return xe},p.prototype.readUIntBE=function(B,$,ee){B>>>=0,$>>>=0,ee||ne(B,$,this.length);for(var xe=this[B+--$],Ee=1;0<$&&(Ee*=256);)xe+=this[B+--$]*Ee;return xe},p.prototype.readUInt8=function(B,$){return B>>>=0,$||ne(B,1,this.length),this[B]},p.prototype.readUInt16LE=function(B,$){return B>>>=0,$||ne(B,2,this.length),this[B]|this[B+1]<<8},p.prototype.readUInt16BE=function(B,$){return B>>>=0,$||ne(B,2,this.length),this[B]<<8|this[B+1]},p.prototype.readUInt32LE=function(B,$){return B>>>=0,$||ne(B,4,this.length),(this[B]|this[B+1]<<8|this[B+2]<<16)+16777216*this[B+3]},p.prototype.readUInt32BE=function(B,$){return B>>>=0,$||ne(B,4,this.length),16777216*this[B]+(this[B+1]<<16|this[B+2]<<8|this[B+3])},p.prototype.readIntLE=function(B,$,ee){B>>>=0,$>>>=0,ee||ne(B,$,this.length);for(var xe=this[B],Ee=1,De=0;++De<$&&(Ee*=256);)xe+=this[B+De]*Ee;return Ee*=128,xe>=Ee&&(xe-=r(2,8*$)),xe},p.prototype.readIntBE=function(B,$,ee){B>>>=0,$>>>=0,ee||ne(B,$,this.length);for(var xe=$,Ee=1,De=this[B+--xe];0=Ee&&(De-=r(2,8*$)),De},p.prototype.readInt8=function(B,$){return B>>>=0,$||ne(B,1,this.length),128&this[B]?-1*(255-this[B]+1):this[B]},p.prototype.readInt16LE=function(B,$){B>>>=0,$||ne(B,2,this.length);var ee=this[B]|this[B+1]<<8;return 32768&ee?4294901760|ee:ee},p.prototype.readInt16BE=function(B,$){B>>>=0,$||ne(B,2,this.length);var ee=this[B+1]|this[B]<<8;return 32768&ee?4294901760|ee:ee},p.prototype.readInt32LE=function(B,$){return B>>>=0,$||ne(B,4,this.length),this[B]|this[B+1]<<8|this[B+2]<<16|this[B+3]<<24},p.prototype.readInt32BE=function(B,$){return B>>>=0,$||ne(B,4,this.length),this[B]<<24|this[B+1]<<16|this[B+2]<<8|this[B+3]},p.prototype.readFloatLE=function(B,$){return B>>>=0,$||ne(B,4,this.length),Ce.read(this,B,!0,23,4)},p.prototype.readFloatBE=function(B,$){return B>>>=0,$||ne(B,4,this.length),Ce.read(this,B,!1,23,4)},p.prototype.readDoubleLE=function(B,$){return B>>>=0,$||ne(B,8,this.length),Ce.read(this,B,!0,52,8)},p.prototype.readDoubleBE=function(B,$){return B>>>=0,$||ne(B,8,this.length),Ce.read(this,B,!1,52,8)},p.prototype.writeUIntLE=function(B,$,ee,xe){if(B=+B,$>>>=0,ee>>>=0,!xe){var Ee=r(2,8*ee)-1;ae(this,B,$,ee,Ee,0)}var De=1,ot=0;for(this[$]=255&B;++ot>>=0,ee>>>=0,!xe){var Ee=r(2,8*ee)-1;ae(this,B,$,ee,Ee,0)}var De=ee-1,ot=1;for(this[$+De]=255&B;0<=--De&&(ot*=256);)this[$+De]=255&B/ot;return $+ee},p.prototype.writeUInt8=function(B,$,ee){return B=+B,$>>>=0,ee||ae(this,B,$,1,255,0),this[$]=255&B,$+1},p.prototype.writeUInt16LE=function(B,$,ee){return B=+B,$>>>=0,ee||ae(this,B,$,2,65535,0),this[$]=255&B,this[$+1]=B>>>8,$+2},p.prototype.writeUInt16BE=function(B,$,ee){return B=+B,$>>>=0,ee||ae(this,B,$,2,65535,0),this[$]=B>>>8,this[$+1]=255&B,$+2},p.prototype.writeUInt32LE=function(B,$,ee){return B=+B,$>>>=0,ee||ae(this,B,$,4,4294967295,0),this[$+3]=B>>>24,this[$+2]=B>>>16,this[$+1]=B>>>8,this[$]=255&B,$+4},p.prototype.writeUInt32BE=function(B,$,ee){return B=+B,$>>>=0,ee||ae(this,B,$,4,4294967295,0),this[$]=B>>>24,this[$+1]=B>>>16,this[$+2]=B>>>8,this[$+3]=255&B,$+4},p.prototype.writeIntLE=function(B,$,ee,xe){if(B=+B,$>>>=0,!xe){var Ee=r(2,8*ee-1);ae(this,B,$,ee,Ee-1,-Ee)}var De=0,ot=1,_t=0;for(this[$]=255&B;++DeB&&_t===0&&this[$+De-1]!==0&&(_t=1),this[$+De]=255&(B/ot>>0)-_t;return $+ee},p.prototype.writeIntBE=function(B,$,ee,xe){if(B=+B,$>>>=0,!xe){var Ee=r(2,8*ee-1);ae(this,B,$,ee,Ee-1,-Ee)}var De=ee-1,ot=1,_t=0;for(this[$+De]=255&B;0<=--De&&(ot*=256);)0>B&&_t===0&&this[$+De+1]!==0&&(_t=1),this[$+De]=255&(B/ot>>0)-_t;return $+ee},p.prototype.writeInt8=function(B,$,ee){return B=+B,$>>>=0,ee||ae(this,B,$,1,127,-128),0>B&&(B=255+B+1),this[$]=255&B,$+1},p.prototype.writeInt16LE=function(B,$,ee){return B=+B,$>>>=0,ee||ae(this,B,$,2,32767,-32768),this[$]=255&B,this[$+1]=B>>>8,$+2},p.prototype.writeInt16BE=function(B,$,ee){return B=+B,$>>>=0,ee||ae(this,B,$,2,32767,-32768),this[$]=B>>>8,this[$+1]=255&B,$+2},p.prototype.writeInt32LE=function(B,$,ee){return B=+B,$>>>=0,ee||ae(this,B,$,4,2147483647,-2147483648),this[$]=255&B,this[$+1]=B>>>8,this[$+2]=B>>>16,this[$+3]=B>>>24,$+4},p.prototype.writeInt32BE=function(B,$,ee){return B=+B,$>>>=0,ee||ae(this,B,$,4,2147483647,-2147483648),0>B&&(B=4294967295+B+1),this[$]=B>>>24,this[$+1]=B>>>16,this[$+2]=B>>>8,this[$+3]=255&B,$+4},p.prototype.writeFloatLE=function(B,$,ee){return re(this,B,$,!0,ee)},p.prototype.writeFloatBE=function(B,$,ee){return re(this,B,$,!1,ee)},p.prototype.writeDoubleLE=function(B,$,ee){return de(this,B,$,!0,ee)},p.prototype.writeDoubleBE=function(B,$,ee){return de(this,B,$,!1,ee)},p.prototype.copy=function(B,$,ee,xe){if(!p.isBuffer(B))throw new TypeError("argument should be a Buffer");if(ee||(ee=0),xe||xe===0||(xe=this.length),$>=B.length&&($=B.length),$||($=0),0$)throw new RangeError("targetStart out of bounds");if(0>ee||ee>=this.length)throw new RangeError("Index out of range");if(0>xe)throw new RangeError("sourceEnd out of bounds");xe>this.length&&(xe=this.length),B.length-$Ee||xe==="latin1")&&(B=Ee)}}else typeof B=="number"&&(B&=255);if(0>$||this.length<$||this.length>>=0,ee=ee===void 0?this.length:ee>>>0,B||(B=0);var De;if(typeof B=="number")for(De=$;De{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 O=f,v=+new Date,_=v-(b||v);O.diff=_,O.prev=b,O.curr=v,b=v,g[0]=l.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let A=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,(y,k)=>{if(y==="%%")return"%";A++;const S=l.formatters[k];if(typeof S=="function"){const C=g[A];y=S.call(O,C),g.splice(A,1),A--}return y}),l.formatArgs.call(O,g),(O.log||l.log).apply(O,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;bP&&!j.warned){j.warned=!0;var H=new Error("Possible EventEmitter memory leak detected. "+j.length+" "+(E+" listeners added. Use emitter.setMaxListeners() to increase limit"));H.name="MaxListenersExceededWarning",H.emitter=T,H.type=E,H.count=j.length,c(H)}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,N){var L={fired:!1,wrapFn:void 0,target:T,type:E,listener:N},P=f.bind(L);return P.listener=N,L.wrapFn=P,P}function h(T,E,N){var L=T._events;if(L===void 0)return[];var P=L[E];return P===void 0?[]:typeof P=="function"?N?[P.listener||P]:[P]:N?_(P):O(P,P.length)}function g(T){var E=this._events;if(E!==void 0){var N=E[T];if(typeof N=="function")return 1;if(N!==void 0)return N.length}return 0}function O(T,E){for(var N=Array(E),L=0;LT||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=[],N=1;NP)return this;P===0?N.shift():v(N,P),N.length===1&&(L[T]=N[0]),L.removeListener!==void 0&&this.emit("removeListener",T,j||E)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(T){var E,N,L;if(N=this._events,N===void 0)return this;if(N.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):N[T]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete N[T]),this;if(arguments.length===0){var P,I=Object.keys(N);for(L=0;L"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,O=(1<>1,_=-7,A=d?f-1:0,M=d?-1:1,y=l[u+A];for(A+=M,b=y&(1<<-_)-1,y>>=-_,_+=g;0<_;b=256*b+l[u+A],A+=M,_-=8);for(h=b&(1<<-_)-1,b>>=-_,_+=p;0<_;h=256*h+l[u+A],A+=M,_-=8);if(b===0)b=1-v;else{if(b===O)return h?NaN:(y?-1:1)*(1/0);h+=r(2,p),b-=v}return(y?-1:1)*h*r(2,b-p)},c.write=function(l,u,d,p,f,b){var h,g,O,v=Math.LN2,_=Math.log,A=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)/v),1>u*(O=r(2,-h))&&(h--,O*=2),u+=1<=h+y?k/O:k*r(2,1-y),2<=u*O&&(h++,O/=2),h+y>=M?(g=0,h=M):1<=h+y?(g=(u*O-1)*r(2,f),h+=y):(g=u*r(2,y-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 s1>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:s1)},{}],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:s1)},{_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,O){function v(A,M,y){return typeof g=="string"?g:g(A,M,y)}O||(O=Error);var _=function(A){function M(y,k,S){return A.call(this,v(y,k,S))||this}return c(M,A),M}(O);_.prototype.name=O.name,_.prototype.code=h,b[h]=_}function u(h,g){if(Array.isArray(h)){var O=h.length;return h=h.map(function(v){return v+""}),2h.length)&&(O=h.length),h.substring(O-g.length,O)===g}function f(h,g,O){return typeof O!="number"&&(O=0),!(O+g.length>h.length)&&h.indexOf(g,O)!==-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,O){var v;typeof g=="string"&&d(g,"not ")?(v="must not be",g=g.replace(/^not /,"")):v="must be";var _;if(p(h," argument"))_="The ".concat(h," ").concat(v," ").concat(u(g,"type"));else{var A=f(h,".")?"property":"argument";_='The "'.concat(h,'" ').concat(A," ").concat(v," ").concat(u(g,"type"))}return _+=". Received type ".concat(typeof O),_},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(v){return this instanceof l?(f.call(this,v),b.call(this,v),this.allowHalfOpen=!0,void(v&&(v.readable===!1&&(this.readable=!1),v.writable===!1&&(this.writable=!1),v.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",u))))):new l(v)}function u(){this._writableState.ended||c.nextTick(d,this)}function d(v){v.end()}var p=Object.keys||function(v){var _=[];for(var A in v)_.push(A);return _};i.exports=l;var f=s("./_stream_readable"),b=s("./_stream_writable");s("inherits")(l,f);for(var h,g=p(b.prototype),O=0;O>>1,ce|=ce>>>2,ce|=ce>>>4,ce|=ce>>>8,ce|=ce>>>16,ce++),ce}function _(ce,B){return 0>=ce||B.length===0&&B.ended?0:B.objectMode?1:ce===ce?(ce>B.highWaterMark&&(B.highWaterMark=v(ce)),ce<=B.length?ce:B.ended?B.length:(B.needReadable=!0,0)):B.flowing&&B.length?B.buffer.head.data.length:B.length}function A(ce,B){if(U("onEofChunk"),!B.ended){if(B.decoder){var $=B.decoder.end();$&&$.length&&(B.buffer.push($),B.length+=B.objectMode?1:$.length)}B.ended=!0,B.sync?M(ce):(B.needReadable=!1,!B.emittedReadable&&(B.emittedReadable=!0,y(ce)))}}function M(ce){var B=ce._readableState;U("emitReadable",B.needReadable,B.emittedReadable),B.needReadable=!1,B.emittedReadable||(U("emitReadable",B.flowing),B.emittedReadable=!0,c.nextTick(y,ce))}function y(ce){var B=ce._readableState;U("emitReadable_",B.destroyed,B.length,B.ended),!B.destroyed&&(B.length||B.ended)&&(ce.emit("readable"),B.emittedReadable=!1),B.needReadable=!B.flowing&&!B.ended&&B.length<=B.highWaterMark,L(ce)}function k(ce,B){B.readingMore||(B.readingMore=!0,c.nextTick(S,ce,B))}function S(ce,B){for(;!B.reading&&!B.ended&&(B.length=B.length?($=B.decoder?B.buffer.join(""):B.buffer.length===1?B.buffer.first():B.buffer.concat(B.length),B.buffer.clear()):$=B.buffer.consume(ce,B.decoder),$}function I(ce){var B=ce._readableState;U("endReadable",B.endEmitted),B.endEmitted||(B.ended=!0,c.nextTick(j,B,ce))}function j(ce,B){if(U("endReadableNT",ce.endEmitted,ce.length),!ce.endEmitted&&ce.length===0&&(ce.endEmitted=!0,B.readable=!1,B.emit("end"),ce.autoDestroy)){var $=B._writableState;(!$||$.autoDestroy&&$.finished)&&B.destroy()}}function H(ce,B){for(var $=0,ee=ce.length;$=B.highWaterMark)||B.ended))return U("read: emitReadable",B.length,B.ended),B.length===0&&B.ended?I(this):M(this),null;if(ce=_(ce,B),ce===0&&B.ended)return B.length===0&&I(this),null;var ee=B.needReadable;U("need readable",ee),(B.length===0||B.length-ce"u"?typeof self>"u"?typeof window>"u"?{}:window:self:s1)},{"../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(v,_){var A=this._transformState;A.transforming=!1;var M=A.writecb;if(M===null)return this.emit("error",new b);A.writechunk=null,A.writecb=null,_!=null&&this.push(_),M(v);var y=this._readableState;y.reading=!1,(y.needReadable||y.length"u"?typeof self>"u"?typeof window>"u"?{}:window:self:s1)},{"../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[y].read();T!==null&&(C[A]=null,C[g]=null,C[O]=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"),O=Symbol("lastReject"),v=Symbol("error"),_=Symbol("ended"),A=Symbol("lastPromise"),M=Symbol("handlePromise"),y=Symbol("stream"),k=Object.getPrototypeOf(function(){}),S=Object.setPrototypeOf((b={get stream(){return this[y]},next:function(){var C=this,R=this[v];if(R!==null)return Promise.reject(R);if(this[_])return Promise.resolve(u(void 0,!0));if(this[y].destroyed)return new Promise(function(L,P){c.nextTick(function(){C[v]?P(C[v]):L(u(void 0,!0))})});var T,E=this[A];if(E)T=new Promise(f(E,this));else{var N=this[y].read();if(N!==null)return Promise.resolve(u(N,!1));T=new Promise(this[M])}return this[A]=T,T}},l(b,Symbol.asyncIterator,function(){return this}),l(b,"return",function(){var C=this;return new Promise(function(R,T){C[y].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,y,{value:C,writable:!0}),l(R,g,{value:null,writable:!0}),l(R,O,{value:null,writable:!0}),l(R,v,{value:null,writable:!0}),l(R,_,{value:C._readableState.endEmitted,writable:!0}),l(R,M,{value:function(E,N){var L=T[y].read();L?(T[A]=null,T[g]=null,T[O]=null,E(u(L,!1))):(T[g]=E,T[O]=N)},writable:!0}),R));return T[A]=null,h(C,function(E){if(E&&E.code!=="ERR_STREAM_PREMATURE_CLOSE"){var N=T[O];return N!==null&&(T[A]=null,T[g]=null,T[O]=null,N(E)),void(T[v]=E)}var L=T[g];L!==null&&(T[A]=null,T[g]=null,T[O]=null,L(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(A,M){var y=Object.keys(A);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(A);M&&(k=k.filter(function(S){return Object.getOwnPropertyDescriptor(A,S).enumerable})),y.push.apply(y,k)}return y}function l(A){for(var M,y=1;y>>0),k=this.head,S=0;k;)b(k.data,y,S),S+=k.data.length,k=k.next;return y}},{key:"consume",value:function(M,y){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=y.next?y.next:this.tail=null):(this.head=y,y.data=C.slice(R));break}++k}return this.length-=k,S}},{key:"_getBuffer",value:function(M){var y=g.allocUnsafe(M),k=this.head,S=1;for(k.data.copy(y),M-=k.data.length;k=k.next;){var C=k.data,R=M>C.length?C.length:M;if(C.copy(y,y.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,y}},{key:_,value:function(M,y){return v(this,l({},y,{depth:0,customInspect:!1}))}}]),A}()},{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(O){!f&&O?b._writableState?b._writableState.errorEmitted?c.nextTick(u,b):(b._writableState.errorEmitted=!0,c.nextTick(l,b,O)):c.nextTick(l,b,O):f?(c.nextTick(u,b),f(O)):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),O=0;OA.length)throw new O("streams");var k,S=A.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"&&(y.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=O,C=4;break;case"utf8":this.fillLast=h,C=4;break;case"base64":this.text=v,this.end=_,C=3;break;default:return this.write=A,void(this.end=M)}this.lastNeed=0,this.lastTotal=0,this.lastChar=y.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 O(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 v(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 A(S){return S.toString(this.encoding)}function M(S){return S&&S.length?this.write(S):""}var y=s("safe-buffer").Buffer,k=y.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:s1)},{}],"/":[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"),O=65536;class v extends f.Duplex{constructor(A){if(A=Object.assign({allowHalfOpen:!1},A),super(A),this._id=p(4).toString("hex").slice(0,7),this._debug("new peer %o",A),this.channelName=A.initiator?A.channelName||p(20).toString("hex"):null,this.initiator=A.initiator||!1,this.channelConfig=A.channelConfig||v.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},v.config,A.config),this.offerOptions=A.offerOptions||{},this.answerOptions=A.answerOptions||{},this.sdpTransform=A.sdpTransform||(M=>M),this.streams=A.streams||(A.stream?[A.stream]:[]),this.trickle=A.trickle===void 0||A.trickle,this.allowHalfTrickle=A.allowHalfTrickle!==void 0&&A.allowHalfTrickle,this.iceCompleteTimeout=A.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=A.wrtc&&typeof A.wrtc=="object"?A.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(A){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if(typeof A=="string")try{A=JSON.parse(A)}catch{A={}}this._debug("signal()"),A.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),A.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(A.transceiverRequest.kind,A.transceiverRequest.init)),A.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(A.candidate):this._pendingCandidates.push(A.candidate)),A.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(A)).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"))}),A.sdp||A.candidate||A.renegotiate||A.transceiverRequest||this.destroy(h(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(A){const M=new this._wrtc.RTCIceCandidate(A);this._pc.addIceCandidate(M).catch(y=>{!M.address||M.address.endsWith(".local")?l("Ignoring unsupported ICE candidate."):this.destroy(h(y,"ERR_ADD_ICE_CANDIDATE"))})}send(A){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(A)}}addTransceiver(A,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(A,M),this._needsNegotiation()}catch(y){this.destroy(h(y,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:A,init:M}})}}addStream(A){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),A.getTracks().forEach(M=>{this.addTrack(M,A)})}}addTrack(A,M){if(this.destroying)return;if(this.destroyed)throw h(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const y=this._senderMap.get(A)||new Map;let k=y.get(M);if(!k)k=this._pc.addTrack(A,M),y.set(M,k),this._senderMap.set(A,y),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(A,M,y){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(A),S=k?k.get(y):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(A,M){if(this.destroying)return;if(this.destroyed)throw h(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const y=this._senderMap.get(A),k=y?y.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(A){if(!this.destroying){if(this.destroyed)throw h(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),A.getTracks().forEach(M=>{this.removeTrack(M,A)})}}_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(A){this._destroy(A,()=>{})}_destroy(A,M){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",A&&(A.message||A)),b(()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",A&&(A.message||A)),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,A&&this.emit("error",A),this.emit("close"),M()}))}_setupData(A){if(!A.channel)return this.destroy(h(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=A.channel,this._channel.binaryType="arraybuffer",typeof this._channel.bufferedAmountLowThreshold=="number"&&(this._channel.bufferedAmountLowThreshold=O),this.channelName=this._channel.label,this._channel.onmessage=y=>{this._onChannelMessage(y)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=y=>{const k=y.error instanceof Error?y.error:new Error(`Datachannel error: ${y.message} ${y.filename}:${y.lineno}:${y.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(A,M,y){if(this.destroyed)return y(h(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(A)}catch(k){return this.destroy(h(k,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>O?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=y):y(null)}else this._debug("write before connect"),this._chunk=A,this._cb=y}_onFinish(){if(!this.destroyed){const A=()=>{setTimeout(()=>this.destroy(),1e3)};this._connected?A():this.once("connect",A)}}_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(A=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(A.sdp=c(A.sdp)),A.sdp=this.sdpTransform(A.sdp);const M=()=>{if(!this.destroyed){const y=this._pc.localDescription||A;this._debug("signal"),this.emit("signal",{type:y.type,sdp:y.sdp})}};this._pc.setLocalDescription(A).then(()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?M():this.once("_iceComplete",M))}).catch(y=>{this.destroy(h(y,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(A=>{this.destroy(h(A,"ERR_CREATE_OFFER"))})}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach(A=>{A.mid||!A.sender.track||A.requested||(A.requested=!0,this.addTransceiver(A.sender.track.kind))})}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then(A=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(A.sdp=c(A.sdp)),A.sdp=this.sdpTransform(A.sdp);const M=()=>{if(!this.destroyed){const y=this._pc.localDescription||A;this._debug("signal"),this.emit("signal",{type:y.type,sdp:y.sdp}),this.initiator||this._requestMissingTransceivers()}};this._pc.setLocalDescription(A).then(()=>{this.destroyed||(this.trickle||this._iceComplete?M():this.once("_iceComplete",M))}).catch(y=>{this.destroy(h(y,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(A=>{this.destroy(h(A,"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 A=this._pc.iceConnectionState,M=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",A,M),this.emit("iceStateChange",A,M),(A==="connected"||A==="completed")&&(this._pcReady=!0,this._maybeReady()),A==="failed"&&this.destroy(h(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),A==="closed"&&this.destroy(h(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(A){const M=y=>(Object.prototype.toString.call(y.values)==="[object Array]"&&y.values.forEach(k=>{Object.assign(y,k)}),y);this._pc.getStats.length===0||this._isReactNativeWebrtc?this._pc.getStats().then(y=>{const k=[];y.forEach(S=>{k.push(M(S))}),A(null,k)},y=>A(y)):0{if(this.destroyed)return;const k=[];y.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))}),A(null,k)},y=>A(y)):A(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 A=()=>{this.destroyed||this.getStats((M,y)=>{if(this.destroyed)return;M&&(y=[]);const k={},S={},C={};let R=!1;y.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 N=S[E.localCandidateId];N&&(N.ip||N.address)?(this.localAddress=N.ip||N.address,this.localPort=+N.port):N&&N.ipAddress?(this.localAddress=N.ipAddress,this.localPort=+N.portNumber):typeof E.googLocalAddress=="string"&&(N=E.googLocalAddress.split(":"),this.localAddress=N[0],this.localPort=+N[1]),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let L=k[E.remoteCandidateId];L&&(L.ip||L.address)?(this.remoteAddress=L.ip||L.address,this.remotePort=+L.port):L&&L.ipAddress?(this.remoteAddress=L.ipAddress,this.remotePort=+L.portNumber):typeof E.googRemoteAddress=="string"&&(L=E.googRemoteAddress.split(":"),this.remoteAddress=L[0],this.remotePort=+L[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(y.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(A,100);if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(N){return this.destroy(h(N,"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")})};A()}_onInterval(){this._cb&&this._channel&&!(this._channel.bufferedAmount>O)&&this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||(this._pc.signalingState==="stable"&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach(A=>{this._pc.removeTrack(A),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(A){this.destroyed||(A.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:A.candidate.candidate,sdpMLineIndex:A.candidate.sdpMLineIndex,sdpMid:A.candidate.sdpMid}}):!A.candidate&&!this._iceComplete&&(this._iceComplete=!0,this.emit("_iceComplete")),A.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(A){if(this.destroyed)return;let M=A.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 A=this._cb;this._cb=null,A(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(A){this.destroyed||A.streams.forEach(M=>{this._debug("on track"),this.emit("track",A.track,M),this._remoteTracks.push({track:A.track,stream:M}),this._remoteStreams.some(y=>y.id===M.id)||(this._remoteStreams.push(M),b(()=>{this._debug("on stream"),this.emit("stream",M)}))})}_debug(){const A=[].slice.call(arguments);A[0]="["+this._id+"] "+A[0],u.apply(null,A)}}v.WEBRTC_SUPPORT=!!d(),v.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},v.channelConfig={},i.exports=v},{buffer:3,debug:4,"err-code":6,"get-browser-rtc":8,"queue-microtask":13,randombytes:14,"readable-stream":29}]},{},[])("/")})}(kS)),kS.exports}var N8e=B8e();const L8e=Jr(N8e),cN=0,lN=1,w1e=2,_1e=(e,t)=>{sn(e,cN);const n=cTe(t);qr(e,n)},k1e=(e,t,n)=>{sn(e,lN),qr(e,JB(t,n))},P8e=(e,t,n)=>k1e(t,n,m0(e)),S1e=(e,t,n)=>{try{H0e(t,m0(e),n)}catch(o){console.error("Caught error while handling a Yjs update",o)}},j8e=(e,t)=>{sn(e,w1e),qr(e,t)},I8e=S1e,D8e=(e,t,n,o)=>{const r=kn(e);switch(r){case cN:P8e(e,t,n);break;case lN:S1e(e,n,o);break;case w1e:I8e(e,n,o);break;default:throw new Error("Unknown message type")}return r},SS=3e4;class F8e extends Zz{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&&SS/2<=n-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const o=[];this.meta.forEach((r,s)=>{s!==this.clientID&&SS<=n-r.lastUpdated&&this.states.has(s)&&o.push(s)}),o.length>0&&q8(this,o,"timeout")},lc(SS/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),uM(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 q8=(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]))},A4=(e,t,n=e.states)=>{const o=t.length,r=M0();sn(r,o);for(let s=0;s{const o=yc(t),r=wl(),s=[],i=[],c=[],l=[],u=kn(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])},V8e=(e,t)=>{const n=z8(e).buffer,o=z8(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"]))},C1e=(e,t)=>{if(!t)return $B(e);const n=crypto.getRandomValues(new Uint8Array(12));return crypto.subtle.encrypt({name:"AES-GCM",iv:n},t,e).then(o=>{const r=M0();return Ja(r,"AES-GCM"),qr(r,n),qr(r,new Uint8Array(o)),yr(r)})},H8e=(e,t)=>{const n=M0();return Vb(n,e),C1e(yr(n),t)},q1e=(e,t)=>{if(!t)return $B(e);const n=yc(e);bl(n)!=="AES-GCM"&&tRe(na("Unknown encryption algorithm"));const r=m0(n),s=m0(n);return crypto.subtle.decrypt({name:"AES-GCM",iv:r},t,s).then(i=>new Uint8Array(i))},R1e=(e,t)=>q1e(e,t).then(n=>Hb(yc(new Uint8Array(n)))),A0=HRe("y-webrtc"),wb=0,T1e=3,jM=1,uN=4,IM=new Map,tc=new Map,E1e=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}]),A0("synced ",Mi,e.name,uf," with all peers"))},W1e=(e,t,n)=>{const o=yc(t),r=M0(),s=kn(o);if(e===void 0)return null;const i=e.awareness,c=e.doc;let l=!1;switch(s){case wb:{sn(r,wb);const u=D8e(o,r,c,e);u===lN&&!e.synced&&n(),u===cN&&(l=!0);break}case T1e:sn(r,jM),qr(r,A4(i,Array.from(i.getStates().keys()))),l=!0;break;case jM:$8e(i,m0(o),e);break;case uN:{const u=lf(o)===1,d=bl(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)}]),B1e(e)}break}default:return console.error("Unable to compute message"),r}return l?r:null},U8e=(e,t)=>{const n=e.room;return A0("received message from ",Mi,e.remotePeerId,GB," (",n.name,")",uf,Mx),W1e(n,t,()=>{e.synced=!0,A0("synced ",Mi,n.name,uf," with ",Mi,e.remotePeerId),E1e(n)})},CS=(e,t)=>{A0("send message to ",Mi,e.remotePeerId,uf,GB," (",e.room.name,")",Mx);try{e.peer.send(yr(t))}catch{}},X8e=(e,t)=>{A0("broadcast message in ",Mi,e.name,uf),e.webrtcConns.forEach(n=>{try{n.peer.send(t)}catch{}})};class v4{constructor(t,n,o,r){A0("establishing connection to ",Mi,o),this.room=r,this.remotePeerId=o,this.glareToken=void 0,this.closed=!1,this.connected=!1,this.synced=!1,this.peer=new L8e({initiator:n,...r.provider.peerOpts}),this.peer.on("signal",s=>{this.glareToken===void 0&&(this.glareToken=Date.now()+Math.random()),vx(t,r,{to:o,from:r.peerId,type:"signal",token:this.glareToken,signal:s})}),this.peer.on("connect",()=>{A0("connected to ",Mi,o),this.connected=!0;const i=r.provider.doc,c=r.awareness,l=M0();sn(l,wb),_1e(l,i),CS(this,l);const u=c.getStates();if(u.size>0){const d=M0();sn(d,jM),qr(d,A4(c,Array.from(u.keys()))),CS(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)}])),E1e(r),this.peer.destroy(),A0("closed connection to ",Mi,o),R8(r)}),this.peer.on("error",s=>{A0("Error in connection to ",Mi,o,": ",s),R8(r)}),this.peer.on("data",s=>{const i=U8e(this,s);i!==null&&CS(this,i)})}destroy(){this.peer.destroy()}}const Bu=(e,t)=>C1e(t,e.key).then(n=>e.mux(()=>E8e(e.name,n))),sU=(e,t)=>{e.bcconnected&&Bu(e,t),X8e(e,t)},R8=e=>{IM.forEach(t=>{t.connected&&(t.send({type:"subscribe",topics:[e.name]}),e.webrtcConns.size{if(e.provider.filterBcConns){const t=M0();sn(t,uN),WM(t,1),Ja(t,e.peerId),Bu(e,yr(t))}};class G8e{constructor(t,n,o,r){this.peerId=p0e(),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=W8e(),this.bcconnected=!1,this._bcSubscriber=s=>q1e(new Uint8Array(s),r).then(i=>this.mux(()=>{const c=W1e(this,i,()=>{});c&&Bu(this,yr(c))})),this._docUpdateHandler=(s,i)=>{const c=M0();sn(c,wb),j8e(c,s),sU(this,yr(c))},this._awarenessUpdateHandler=({added:s,updated:i,removed:c},l)=>{const u=s.concat(i).concat(c),d=M0();sn(d,jM),qr(d,A4(this.awareness,u)),sU(this,yr(d))},this._beforeUnloadHandler=()=>{q8(this.awareness,[t.clientID],"window unload"),tc.forEach(s=>{s.disconnect()})},typeof window<"u"?window.addEventListener("beforeunload",this._beforeUnloadHandler):typeof pi<"u"&&pi.on("exit",this._beforeUnloadHandler)}connect(){this.doc.on("update",this._docUpdateHandler),this.awareness.on("update",this._awarenessUpdateHandler),R8(this);const t=this.name;R8e(t,this._bcSubscriber),this.bcconnected=!0,B1e(this);const n=M0();sn(n,wb),_1e(n,this.doc),Bu(this,yr(n));const o=M0();sn(o,wb),k1e(o,this.doc),Bu(this,yr(o));const r=M0();sn(r,T1e),Bu(this,yr(r));const s=M0();sn(s,jM),qr(s,A4(this.awareness,[this.doc.clientID])),Bu(this,yr(s))}disconnect(){IM.forEach(n=>{n.connected&&n.send({type:"unsubscribe",topics:[this.name]})}),q8(this.awareness,[this.doc.clientID],"disconnect");const t=M0();sn(t,uN),WM(t,0),Ja(t,this.peerId),Bu(this,yr(t)),T8e(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 pi<"u"&&pi.off("exit",this._beforeUnloadHandler)}}const K8e=(e,t,n,o)=>{if(tc.has(n))throw na(`A Yjs Doc connected to room "${n}" already exists!`);const r=new G8e(e,t,n,o);return tc.set(n,r),r},vx=(e,t,n)=>{t.key?H8e(n,t.key).then(o=>{e.send({type:"publish",topic:t.name,data:S0e(o)})}):e.send({type:"publish",topic:t.name,data:n})};class N1e extends S8e{constructor(t){super(t),this.providers=new Set,this.on("connect",()=>{A0(`connected (${t})`);const n=Array.from(tc.keys());this.send({type:"subscribe",topics:n}),tc.forEach(o=>vx(this,o,{type:"announce",from:o.peerId}))}),this.on("message",n=>{switch(n.type){case"publish":{const o=n.topic,r=tc.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 v4(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){A0("offer rejected: ",i.from);return}d.glareToken=void 0}}if(i.signal.type==="answer"){A0("offer answered by: ",i.from);const d=c.get(i.from);d.glareToken=void 0}i.to===l&&(m1(c,i.from,()=>new v4(this,!1,i.from,r)).peer.signal(i.signal),u());break}};r.key?typeof n.data=="string"&&R1e(XB(n.data),r.key).then(s):s(n.data)}}}),this.on("disconnect",()=>A0(`disconnect (${t})`))}}class Y8e extends Zz{constructor(t,n,{signaling:o=["wss://y-webrtc-eu.fly.dev"],password:r=null,awareness:s=new F8e(n),maxConns:i=20+lc(Jqe()*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?V8e(r,t):$B(null),this.room=null,this.key.then(u=>{this.room=K8e(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=m1(IM,t,()=>new N1e(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(),IM.delete(t.url))}),this.room&&this.room.disconnect()}destroy(){this.doc.off("destroy",this.destroy),this.key.then(()=>{this.room.destroy(),tc.delete(this.roomName)}),super.destroy()}}function Z8e(e,t){e.on("connect",()=>{A0(`connected (${t})`);const n=Array.from(tc.keys());e.send({type:"subscribe",topics:n}),tc.forEach(o=>vx(e,o,{type:"announce",from:o.peerId}))}),e.on("message",n=>{switch(n.type){case"publish":{const o=n.topic,r=tc.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 v4(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){A0("offer rejected: ",i.from);return}d.glareToken=void 0}}if(i.signal.type==="answer"){A0("offer answered by: ",i.from);const d=c.get(i.from);d&&(d.glareToken=void 0)}i.to===l&&(m1(c,i.from,()=>new v4(e,!1,i.from,r)).peer.signal(i.signal),u());break}};r.key?typeof n.data=="string"&&R1e(XB(n.data),r.key).then(s):s(n.data)}}}),e.on("disconnect",()=>A0(`disconnect (${t})`))}function iU(e){if(e.shouldConnect&&e.ws===null){const t=Math.floor(1e5+Math.random()*9e5),n=e.url,o=new window.EventSource(tn(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,x4/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(()=>{A0("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,x4/2))}}}const x4=3e4;class Q8e extends Zz{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&&x4{const n=m1(IM,t,t.startsWith("ws://")||t.startsWith("wss://")?()=>new N1e(t):()=>new Q8e(t));this.signalingConns.push(n),n.providers.add(this)}),this.room&&this.room.connect()}}function eEe({signaling:e,password:t}){return function(n,o,r){const s=`${o}-${n}`;return new J8e(s,r,{signaling:e,password:t}),Promise.resolve(()=>!0)}}const tEe=(e,t)=>{const n={},o={},r={};function s(u,d){n[u]=d}async function i(u,d,p){const f=new Rh;r[u]=r[u]||{},r[u][d]=f;const b=()=>{const O=n[u].fromCRDTDoc(f);p(O)};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(O=>{f.transact(()=>{n[u].applyChangesToDoc(f,O)})}),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 qS;function DM(){return qS||(qS=tEe(w8e,eEe({signaling:[window?.wp?.ajax?.settings?.url],password:window?.__experimentalCollaborativeEditingSecret}))),qS}function nEe(e,t){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(t)?t:[t],queryID:e}}function oEe(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function L1e(e){return{type:"ADD_ENTITIES",entities:e}}function rEe(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=ZSe(n,o,s,i):c=Ure(n,s,i),{...c,kind:e,name:t,invalidateCache:r}}function sEe(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function iEe(e){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:e}}function aEe(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:e,globalStyles:t}}function cEe(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:e,variations:t}}function lEe(){return Ze("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function uEe(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 dEe(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}const P1e=(e,t,n,o,{__unstableFetch:r=Rt,throwOnError:s=!1}={})=>async({dispatch:i})=>{const l=(await i(Ac(e,t))).find(f=>f.kind===e&&f.name===t);let u,d=!1;if(!l)return;const p=await i.__unstableAcquireStoreLock(D0,["entities","records",e,t,n],{exclusive:!0});try{i({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:n});let f=!1;try{let b=`${l.baseURL}/${n}`;o&&(b=tn(b,o)),d=await r({path:b,method:"DELETE"}),await i(YSe(e,t,n,!0))}catch(b){f=!0,u=b}if(i({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:n,error:u}),f&&s)throw u;return d}finally{i.__unstableReleaseStoreLock(p)}},pEe=(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],O=l[b]?{...g,...o[b]}:o[b];return f[b]=S0(h,O)?void 0:O,f},{})};if(window.__experimentalEnableSync&&c.syncConfig){if(globalThis.IS_GUTENBERG_PLUGIN){const f=c.getSyncObjectId(n);DM().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})},fEe=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().undo();n&&t({type:"UNDO",record:n})},bEe=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().redo();n&&t({type:"REDO",record:n})},hEe=()=>({select:e})=>{e.getUndoManager().addRecord()},j1e=(e,t,n,{isAutosave:o=!1,__unstableFetch:r=Rt,throwOnError:s=!1}={})=>async({select:i,resolveSelect:c,dispatch:l})=>{const d=(await l(Ac(e,t))).find(h=>h.kind===e&&h.name===t);if(!d)return;const p=d.key||U0,f=n[p],b=await l.__unstableAcquireStoreLock(D0,["entities","records",e,t,f||ta()],{exclusive:!0});try{for(const[v,_]of Object.entries(n))if(typeof _=="function"){const A=_(i.getEditedEntityRecord(e,t,f));l.editEntityRecord(e,t,f,{[v]:A},{undoIgnore:!0}),n[v]=A}l({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:f,isAutosave:o});let h,g,O=!1;try{const v=`${d.baseURL}${f?"/"+f:""}`,_=i.getRawEntityRecord(e,t,f);if(o){const A=i.getCurrentUser(),M=A?A.id:void 0,y=await c.getAutosave(_.type,_.id,M);let k={..._,...y,...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:`${v}/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 A=n;d.__unstablePrePersist&&(A={...A,...d.__unstablePrePersist(_,A)}),h=await r({path:v,method:f?"PUT":"POST",data:A}),l.receiveEntityRecords(e,t,h,void 0,!0,A)}}catch(v){O=!0,g=v}if(l({type:"SAVE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:f,error:g,isAutosave:o}),O&&s)throw g;return h}finally{l.__unstableReleaseStoreLock(b)}},mEe=e=>async({dispatch:t})=>{const n=mqe(),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},gEe=(e,t,n,o)=>async({select:r,dispatch:s})=>{if(!r.hasEditsForEntityRecord(e,t,n))return;const c=(await s(Ac(e,t))).find(p=>p.kind===e&&p.name===t);if(!c)return;const l=c.key||U0,u=r.getEntityRecordNonTransientEdits(e,t,n),d={[l]:n,...u};return await s.saveEntityRecord(e,t,d,o)},MEe=(e,t,n,o,r)=>async({select:s,dispatch:i})=>{if(!s.hasEditsForEntityRecord(e,t,n))return;const c=s.getEntityRecordNonTransientEdits(e,t,n),l={};for(const f of o)dx(l,f,GSe(c,f));const p=(await i(Ac(e,t))).find(f=>f.kind===e&&f.name===t)?.key||U0;return n&&(l[p]=n),await i.saveEntityRecord(e,t,l,r)};function zEe(e){return Ze("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),I1e("create/media",e)}function I1e(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function OEe(e){return{type:"RECEIVE_USER_PERMISSIONS",permissions:e}}function yEe(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:Array.isArray(t)?t:[t]}}function AEe(e){return{type:"RECEIVE_NAVIGATION_FALLBACK_ID",fallbackId:e}}function vEe(e,t){return{type:"RECEIVE_DEFAULT_TEMPLATE",query:e,templateId:t}}const xEe=(e,t,n,o,r,s=!1,i)=>async({dispatch:c})=>{const u=(await c(Ac(e,t))).find(p=>p.kind===e&&p.name===t),d=u&&u?.revisionKey?u.revisionKey:U0;c({type:"RECEIVE_ITEM_REVISIONS",key:d,items:Array.isArray(o)?o:[o],recordKey:n,meta:i,query:r,kind:e,name:t,invalidateCache:s})},wEe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalBatch:mEe,__experimentalReceiveCurrentGlobalStylesId:iEe,__experimentalReceiveThemeBaseGlobalStyles:aEe,__experimentalReceiveThemeGlobalStyleVariations:cEe,__experimentalSaveSpecifiedEntityEdits:MEe,__unstableCreateUndoLevel:hEe,addEntities:L1e,deleteEntityRecord:P1e,editEntityRecord:pEe,receiveAutosaves:yEe,receiveCurrentTheme:sEe,receiveCurrentUser:oEe,receiveDefaultTemplateId:vEe,receiveEmbedPreview:dEe,receiveEntityRecords:rEe,receiveNavigationFallbackId:AEe,receiveRevisions:xEe,receiveThemeGlobalStyleRevisions:uEe,receiveThemeSupports:lEe,receiveUploadPermissions:zEe,receiveUserPermission:I1e,receiveUserPermissions:OEe,receiveUserQuery:nEe,redo:bEe,saveEditedEntityRecord:gEe,saveEntityRecord:j1e,undo:fEe},Symbol.toStringTag,{value:"Module"})),U0="id",_Ee=["title","excerpt","content"],D1e=[{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"].join(",")},plural:"__unstableBases",syncConfig:{fetch:async()=>Rt({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=>Rt({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:e=>e?.title?.rendered||e?.title,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"}],F1e=[{kind:"postType",loadEntities:CEe},{kind:"taxonomy",loadEntities:qEe},{kind:"root",name:"site",plural:"sites",loadEntities:REe}],kEe=(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},RS=new WeakMap;function SEe(e){const t={...e};for(const[n,o]of Object.entries(e))o instanceof $o&&(t[n]=o.valueOf());return t}function $1e(e){return e.map(t=>{const{innerBlocks:n,attributes:o,...r}=t;return{...r,attributes:SEe(o),innerBlocks:$1e(n)}})}async function CEe(){const e=await Rt({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:_Ee,getTitle:i=>{var c;return i?.title?.rendered||i?.title||(r?joe((c=i.slug)!==null&&c!==void 0?c:""):String(i.id))},__unstablePrePersist:r?void 0:kEe,__unstable_rest_base:n.rest_base,syncConfig:{fetch:async i=>Rt({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"&&(RS.has(d)||RS.set(d,$1e(d)),d=RS.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":U0}})}async function qEe(){const e=await Rt({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 REe(){var e;const t={label:m("Site"),name:"site",kind:"root",baseURL:"/wp/v2/settings",syncConfig:{fetch:async()=>Rt({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 Rt({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 Jb=(e,t,n="get")=>{const o=e==="root"?"":i4(e),r=i4(t);return`${n}${o}${r}`};function aU(e){e.forEach(({syncObjectType:t,syncConfig:n})=>{DM().register(t,n);const o={...n};delete o.fetch,DM().register(t+"--edit",o)})}const Ac=(e,t)=>async({select:n,dispatch:o})=>{let r=n.getEntitiesConfig(e);const s=!!n.getEntityConfig(e,t);if(r?.length>0&&s)return window.__experimentalEnableSync&&globalThis.IS_GUTENBERG_PLUGIN&&aU(r),r;const i=F1e.find(c=>!t||!c.name?c.kind===e:c.kind===e&&c.name===t);return i?(r=await i.loadEntities(),window.__experimentalEnableSync&&globalThis.IS_GUTENBERG_PLUGIN&&aU(r),o(L1e(r)),r):[]};function V1e(e){const{query:t}=e;return t?Sh(t).context:"default"}function TEe(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 EEe(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=V1e(t),o=t.key||U0;return{...e,[n]:{...e[n],...t.items.reduce((r,s)=>{const i=s?.[o];return r[i]=HSe(e?.[n]?.[i],s),r},{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map(([n,o])=>[n,H1e(o,t.itemIds)]))}return e}function WEe(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=V1e(t),{query:o,key:r=U0}=t,s=o?Sh(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,H1e(o,t.itemIds)]))}return e}const BEe=uo([Vre(e=>"query"in e),Hre(e=>e.query?{...e,...Sh(e.query)}:e),AH("context"),AH("stableKey")])((e={},t)=>{const{type:n,page:o,perPage:r,key:s=U0}=t;return n!=="RECEIVE_ITEMS"?e:{itemIds:TEe(e?.itemIds||[],t.items.map(i=>i?.[s]).filter(Boolean),o,r),meta:t.meta}}),NEe=(e={},t)=>{switch(t.type){case"RECEIVE_ITEMS":return BEe(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}},cU=H0({items:EEe,itemIsComplete:WEe,queries:NEe});function LEe(e={},t){switch(t.type){case"RECEIVE_TERMS":return{...e,[t.taxonomy]:t.terms}}return e}function PEe(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 jEe(e={},t){switch(t.type){case"RECEIVE_CURRENT_USER":return t.currentUser}return e}function IEe(e=[],t){switch(t.type){case"RECEIVE_TAXONOMIES":return t.taxonomies}return e}function DEe(e=void 0,t){switch(t.type){case"RECEIVE_CURRENT_THEME":return t.currentTheme.stylesheet}return e}function FEe(e=void 0,t){switch(t.type){case"RECEIVE_CURRENT_GLOBAL_STYLES_ID":return t.id}return e}function $Ee(e={},t){switch(t.type){case"RECEIVE_THEME_GLOBAL_STYLES":return{...e,[t.stylesheet]:t.globalStyles}}return e}function VEe(e={},t){switch(t.type){case"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS":return{...e,[t.stylesheet]:t.variations}}return e}const HEe=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 UEe(e){return uo([HEe,Vre(t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind),Hre(t=>({key:e.key||U0,...t}))])(H0({queriedData:cU,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!S0(u[f],(b=c[f]?.raw)!==null&&b!==void 0?b:c[f])&&(!n.persistedEdits||!S0(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=cU(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 XEe(e=D1e,t){switch(t.type){case"ADD_ENTITIES":return[...e,...t.entities]}return e}const GEe=(e={},t)=>{const n=XEe(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=H0(Object.entries(s).reduce((i,[c,l])=>{const u=H0(l.reduce((d,p)=>({...d,[p.name]:UEe(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 KEe(e=R6e()){return e}function YEe(e={},t){switch(t.type){case"EDIT_ENTITY_RECORD":case"UNDO":case"REDO":return{}}return e}function ZEe(e={},t){switch(t.type){case"RECEIVE_EMBED_PREVIEW":const{url:n,preview:o}=t;return{...e,[n]:o}}return e}function QEe(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 JEe(e={},t){switch(t.type){case"RECEIVE_AUTOSAVES":const{postId:n,autosaves:o}=t;return{...e,[n]:o}}return e}function eWe(e=[],t){switch(t.type){case"RECEIVE_BLOCK_PATTERNS":return t.patterns}return e}function tWe(e=[],t){switch(t.type){case"RECEIVE_BLOCK_PATTERN_CATEGORIES":return t.categories}return e}function nWe(e=[],t){switch(t.type){case"RECEIVE_USER_PATTERN_CATEGORIES":return t.patternCategories}return e}function oWe(e=null,t){switch(t.type){case"RECEIVE_NAVIGATION_FALLBACK_ID":return t.fallbackId}return e}function rWe(e={},t){switch(t.type){case"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS":return{...e,[t.currentId]:t.revisions}}return e}function sWe(e={},t){switch(t.type){case"RECEIVE_DEFAULT_TEMPLATE":return{...e,[JSON.stringify(t.query)]:t.templateId}}return e}function iWe(e={},t){switch(t.type){case"RECEIVE_REGISTERED_POST_META":return{...e,[t.postType]:t.registeredPostMeta}}return e}const aWe=H0({terms:LEe,users:PEe,currentTheme:DEe,currentGlobalStylesId:FEe,currentUser:jEe,themeGlobalStyleVariations:VEe,themeBaseGlobalStyles:$Ee,themeGlobalStyleRevisions:rWe,taxonomies:IEe,entities:GEe,editsReference:YEe,undoManager:KEe,embedPreviews:ZEe,userPermissions:QEe,autosaves:JEe,blockPatterns:eWe,blockPatternCategories:tWe,userPatternCategories:nWe,navigationFallbackId:oWe,defaultTemplates:sWe,registeredPostMeta:iWe}),cWe={},lWe=kt(e=>(t,n)=>e(D0).isResolving("getEmbedPreview",[n]));function uWe(e,t){Ze("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const n=tn("/wp/v2/users/?who=authors&per_page=100",t);return U1e(e,n)}function dWe(e){return e.currentUser}const U1e=Lt((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 pWe(e,t){return Ze("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),X1e(e,t)}const X1e=Lt((e,t)=>e.entities.config.filter(n=>n.kind===t),(e,t)=>e.entities.config);function fWe(e,t,n){return Ze("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),Eh(e,t,n)}function Eh(e,t,n){return e.entities.config?.find(o=>o.kind===t&&o.name===n)}const If=Lt((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=dd(r._fields))!==null&&u!==void 0?u:[];for(let f=0;f{h=h?.[g]}),dx(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]]});If.__unstableNormalizeArgs=e=>{const t=[...e],n=t?.[2];return t[2]=KSe(n)?Number(n):n,t};function bWe(e,t,n,o){return If(e,t,n,o)}const G1e=Lt((e,t,n,o)=>{const r=If(e,t,n,o);return r&&Object.keys(r).reduce((s,i)=>{if(XSe(Eh(e,t,n),i)){var c;s[i]=(c=r[i]?.raw)!==null&&c!==void 0?c:r[i]}else s[i]=r[i];return 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 hWe(e,t,n,o){return Array.isArray(xx(e,t,n,o))}const xx=(e,t,n,o)=>{const r=e.entities.records?.[t]?.[n]?.queriedData;return r?Xre(r,o):null},mWe=(e,t,n,o)=>{const r=e.entities.records?.[t]?.[n]?.queriedData;return r?Gre(r,o):null},gWe=(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=Gre(r,o);return s&&(o.per_page?Math.ceil(s/o.per_page):eCe(r,o))},MWe=Lt(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=>If(e,o,r,i)&&Y1e(e,o,r,i));if(s.length){const i=Eh(e,o,r);s.forEach(c=>{const l=wx(e,o,r,c);n.push({key:l?l[i.key||U0]:void 0,title:i?.getTitle?.(l)||"",name:r,kind:o})})}})}),n},e=>[e.entities.records]),zWe=Lt(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=>pN(e,o,r,i));if(s.length){const i=Eh(e,o,r);s.forEach(c=>{const l=wx(e,o,r,c);n.push({key:l?l[i.key||U0]:void 0,title:i?.getTitle?.(l)||"",name:r,kind:o})})}})}),n},e=>[e.entities.records]);function dN(e,t,n,o){return e.entities.records?.[t]?.[n]?.edits?.[o]}const K1e=Lt((e,t,n,o)=>{const{transientEdits:r}=Eh(e,t,n)||{},s=dN(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 Y1e(e,t,n,o){return pN(e,t,n,o)||Object.keys(K1e(e,t,n,o)).length>0}const wx=Lt((e,t,n,o)=>{const r=G1e(e,t,n,o),s=dN(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 OWe(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 pN(e,t,n,o){var r;return(r=e.entities.records?.[t]?.[n]?.saving?.[o]?.pending)!==null&&r!==void 0?r:!1}function yWe(e,t,n,o){var r;return(r=e.entities.records?.[t]?.[n]?.deleting?.[o]?.pending)!==null&&r!==void 0?r:!1}function AWe(e,t,n,o){return e.entities.records?.[t]?.[n]?.saving?.[o]?.error}function vWe(e,t,n,o){return e.entities.records?.[t]?.[n]?.deleting?.[o]?.error}function xWe(e){Ze("select( 'core' ).getUndoEdit()",{since:"6.3"})}function wWe(e){Ze("select( 'core' ).getRedoEdit()",{since:"6.3"})}function _We(e){return e.undoManager.hasUndo()}function kWe(e){return e.undoManager.hasRedo()}function _x(e){return e.currentTheme?If(e,"root","theme",e.currentTheme):null}function Z1e(e){return e.currentGlobalStylesId}function SWe(e){var t;return(t=_x(e)?.theme_supports)!==null&&t!==void 0?t:cWe}function CWe(e,t){return e.embedPreviews[t]}function qWe(e,t){const n=e.embedPreviews[t],o=''+t+"";return n?n.html===o:!1}function Q1e(e,t,n,o){if(typeof n=="object"&&(!n.kind||!n.name))return!1;const s=px(t,n,o);return e.userPermissions[s]}function RWe(e,t,n,o){return Ze("wp.data.select( 'core' ).canUserEditEntityRecord()",{since:"6.7",alternative:"wp.data.select( 'core' ).canUser( 'update', { kind, name, id } )"}),Q1e(e,"update",{kind:t,name:n,id:o})}function TWe(e,t,n){return e.autosaves[n]}function EWe(e,t,n,o){return o===void 0?void 0:e.autosaves[n]?.find(s=>s.author===o)}const WWe=kt(e=>(t,n,o)=>e(D0).hasFinishedResolution("getAutosaves",[n,o]));function BWe(e){return e.editsReference}function NWe(e,t){const n=xx(e,"postType","wp_template",{"find-template":t});return n?.length?wx(e,"postType","wp_template",n[0].id):null}function LWe(e){const t=_x(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}function PWe(e){const t=_x(e);return t?e.themeGlobalStyleVariations[t.stylesheet]:null}function jWe(e){return e.blockPatterns}function IWe(e){return e.blockPatternCategories}function DWe(e){return e.userPatternCategories}function FWe(e){Ze("select( 'core' ).getCurrentThemeGlobalStylesRevisions()",{since:"6.5.0",alternative:"select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )"});const t=Z1e(e);return t?e.themeGlobalStyleRevisions[t]:null}function $We(e,t){return e.defaultTemplates[JSON.stringify(t)]}const VWe=(e,t,n,o,r)=>{const s=e.entities.records?.[t]?.[n]?.revisions?.[o];return s?Xre(s,r):null},HWe=Lt((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=dd(s._fields))!==null&&d!==void 0?d:[];for(let b=0;b{g=g?.[O]}),dx(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]]}),UWe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalGetCurrentGlobalStylesId:Z1e,__experimentalGetCurrentThemeBaseGlobalStyles:LWe,__experimentalGetCurrentThemeGlobalStylesVariations:PWe,__experimentalGetDirtyEntityRecords:MWe,__experimentalGetEntitiesBeingSaved:zWe,__experimentalGetEntityRecordNoResolver:bWe,__experimentalGetTemplateForLink:NWe,canUser:Q1e,canUserEditEntityRecord:RWe,getAuthors:uWe,getAutosave:EWe,getAutosaves:TWe,getBlockPatternCategories:IWe,getBlockPatterns:jWe,getCurrentTheme:_x,getCurrentThemeGlobalStylesRevisions:FWe,getCurrentUser:dWe,getDefaultTemplateId:$We,getEditedEntityRecord:wx,getEmbedPreview:CWe,getEntitiesByKind:pWe,getEntitiesConfig:X1e,getEntity:fWe,getEntityConfig:Eh,getEntityRecord:If,getEntityRecordEdits:dN,getEntityRecordNonTransientEdits:K1e,getEntityRecords:xx,getEntityRecordsTotalItems:mWe,getEntityRecordsTotalPages:gWe,getLastEntityDeleteError:vWe,getLastEntitySaveError:AWe,getRawEntityRecord:G1e,getRedoEdit:wWe,getReferenceByDistinctEdits:BWe,getRevision:HWe,getRevisions:VWe,getThemeSupports:SWe,getUndoEdit:xWe,getUserPatternCategories:DWe,getUserQueryResults:U1e,hasEditsForEntityRecord:Y1e,hasEntityRecords:hWe,hasFetchedAutosaves:WWe,hasRedo:kWe,hasUndo:_We,isAutosavingEntityRecord:OWe,isDeletingEntityRecord:yWe,isPreviewEmbedFallback:qWe,isRequestingEmbedPreview:lWe,isSavingEntityRecord:pN},Symbol.toStringTag,{value:"Module"}));function XWe(e){return e.undoManager}function GWe(e){return e.navigationFallbackId}const KWe=kt(e=>Lt((t,n)=>e(D0).getBlockPatterns().filter(({postTypes:o})=>!o||Array.isArray(o)&&o.includes(n)),()=>[e(D0).getBlockPatterns()])),J1e=kt(e=>Lt((t,n,o,r)=>(Array.isArray(r)?r:[r]).map(i=>({delete:e(D0).canUser("delete",{kind:n,name:o,id:i}),update:e(D0).canUser("update",{kind:n,name:o,id:i})})),t=>[t.userPermissions]));function YWe(e,t,n,o){return J1e(e,t,n,o)[0]}function ZWe(e,t){var n;return(n=e.registeredPostMeta?.[t])!==null&&n!==void 0?n:{}}const QWe=Object.freeze(Object.defineProperty({__proto__:null,getBlockPatternsForPostType:KWe,getEntityRecordPermissions:YWe,getEntityRecordsPermissions:J1e,getNavigationFallbackId:GWe,getRegisteredPostMeta:ZWe,getUndoManager:XWe},Symbol.toStringTag,{value:"Module"}));function JWe(e,t){return{type:"RECEIVE_REGISTERED_POST_META",postType:e,registeredPostMeta:t}}const eBe=Object.freeze(Object.defineProperty({__proto__:null,receiveRegisteredPostMeta:JWe},Symbol.toStringTag,{value:"Module"}));let B2;function Vt(e){if(typeof e!="string"||e.indexOf("&")===-1)return e;B2===void 0&&(document.implementation&&document.implementation.createHTMLDocument?B2=document.implementation.createHTMLDocument("").createElement("textarea"):B2=document.createElement("textarea")),B2.innerHTML=e;const t=B2.textContent;return B2.innerHTML="",t}async function tBe(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(Rt({path:tn("/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:Vt(b.title||"")||m("(no title)"),type:b.subtype||b.type,kind:"post-type"}))).catch(()=>[])),(!r||r==="term")&&u.push(Rt({path:tn("/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:Vt(b.title||"")||m("(no title)"),type:b.subtype||b.type,kind:"taxonomy"}))).catch(()=>[])),!l&&(!r||r==="post-format")&&u.push(Rt({path:tn("/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:Vt(b.title||"")||m("(no title)"),type:b.subtype||b.type,kind:"taxonomy"}))).catch(()=>[])),(!r||r==="attachment")&&u.push(Rt({path:tn("/wp/v2/media",{search:e,page:i,per_page:c})}).then(f=>f.map(b=>({id:b.id,url:b.source_url,title:Vt(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=nBe(p,e),p=p.slice(0,c),p}function nBe(e,t){const n=lU(t),o={};for(const r of e)if(r.title){const s=lU(r.title),i=s.filter(c=>n.some(l=>c.includes(l)));o[r.id]=i.length/s.length}else o[r.id]=0;return e.sort((r,s)=>o[s.id]-o[r.id])}function lU(e){return e.toLowerCase().match(/[\p{L}\p{N}]+/gu)||[]}const TS=new Map,oBe=async(e,t={})=>{const n="/wp-block-editor/v1/url-details",o={url:Wf(e)};if(!Ef(e))return Promise.reject(`${e} is not a valid URL.`);const r=J5(e);return!r||!hB(r)||!r.startsWith("http")||!/^https?:\/\/[^\/\s]/i.test(e)?Promise.reject(`${e} does not have a valid protocol. URLs must be "http" based`):TS.has(e)?TS.get(e):Rt({path:tn(n,o),...t}).then(s=>(TS.set(e,s),s))};async function rBe(){const e=await Rt({path:"/wp/v2/block-patterns/patterns"});return e?e.map(t=>Object.fromEntries(Object.entries(t).map(([n,o])=>[dB(n),o]))):[]}const sBe=e=>async({dispatch:t})=>{const n=tn("/wp/v2/users/?who=authors&per_page=100",e),o=await Rt({path:n});t.receiveUserQuery(n,o)},iBe=()=>async({dispatch:e})=>{const t=await Rt({path:"/wp/v2/users/me"});e.receiveCurrentUser(t)},ese=(e,t,n="",o)=>async({select:r,dispatch:s,registry:i})=>{const l=(await s(Ac(e,t))).find(d=>d.name===t&&d.kind===e);if(!l)return;const u=await s.__unstableAcquireStoreLock(D0,["entities","records",e,t,n],{exclusive:!1});try{if(window.__experimentalEnableSync&&l.syncConfig&&!o){if(globalThis.IS_GUTENBERG_PLUGIN){const d=l.getSyncObjectId(n);await DM().bootstrap(l.syncObjectType,d,p=>{s.receiveEntityRecords(e,t,p,o)}),await DM().bootstrap(l.syncObjectType+"--edit",d,p=>{s({type:"EDIT_ENTITY_RECORD",kind:e,name:t,recordId:n,edits:p,meta:{undo:void 0}})})}}else{o!==void 0&&o._fields&&(o={...o,_fields:[...new Set([...dd(o._fields)||[],l.key||U0])].join()});const d=tn(l.baseURL+(n?"/"+n:""),{...l.baseURLParams,...o});if(o!==void 0&&o._fields&&(o={...o,include:[n]},r.hasEntityRecords(e,t,o)))return;const p=await Rt({path:d,parse:!1}),f=await p.json(),b=EB(p.headers?.get("allow")),h=[],g={};for(const O of cM)g[px(O,{kind:e,name:t,id:n})]=b[O],h.push([O,{kind:e,name:t,id:n}]);i.batch(()=>{s.receiveEntityRecords(e,t,f,o),s.receiveUserPermissions(g),s.finishResolutions("canUser",h)})}}finally{s.__unstableReleaseStoreLock(u)}},aBe=TB("getEntityRecord"),cBe=TB("getEntityRecord"),w4=(e,t,n={})=>async({dispatch:o,registry:r})=>{const i=(await o(Ac(e,t))).find(l=>l.name===t&&l.kind===e);if(!i)return;const c=await o.__unstableAcquireStoreLock(D0,["entities","records",e,t],{exclusive:!1});try{n._fields&&(n={...n,_fields:[...new Set([...dd(n._fields)||[],i.key||U0])].join()});const l=tn(i.baseURL,{...i.baseURLParams,...n});let u,d;if(i.supportsPagination&&n.per_page!==-1){const p=await Rt({path:l,parse:!1});u=Object.values(await p.json()),d={totalItems:parseInt(p.headers.get("X-WP-Total")),totalPages:parseInt(p.headers.get("X-WP-TotalPages"))}}else u=Object.values(await Rt({path:l})),d={totalItems:u.length,totalPages:1};n._fields&&(u=u.map(p=>(n._fields.split(",").forEach(f=>{p.hasOwnProperty(f)||(p[f]=void 0)}),p))),r.batch(()=>{if(o.receiveEntityRecords(e,t,u,n,!1,void 0,d),!n?._fields&&!n.context){const p=i.key||U0,f=u.filter(O=>O?.[p]).map(O=>[e,t,O[p]]),b=u.filter(O=>O?.[p]).map(O=>({id:O[p],permissions:EB(O?._links?.self?.[0].targetHints.allow)})),h=[],g={};for(const O of b)for(const v of cM)h.push([v,{kind:e,name:t,id:O.id}]),g[px(v,{kind:e,name:t,id:O.id})]=O.permissions[v];o.receiveUserPermissions(g),o.finishResolutions("getEntityRecord",f),o.finishResolutions("canUser",h)}o.__unstableReleaseStoreLock(c)})}catch{o.__unstableReleaseStoreLock(c)}};w4.shouldInvalidate=(e,t,n)=>(e.type==="RECEIVE_ITEMS"||e.type==="REMOVE_ITEMS")&&e.invalidateCache&&t===e.kind&&n===e.name;const lBe=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("root","theme",{status:"active"});e.receiveCurrentTheme(n[0])},uBe=TB("getCurrentTheme"),dBe=e=>async({dispatch:t})=>{try{const n=await Rt({path:tn("/oembed/1.0/proxy",{url:e})});t.receiveEmbedPreview(e,n)}catch{t.receiveEmbedPreview(e,!1)}},tse=(e,t,n)=>async({dispatch:o,registry:r})=>{if(!cM.includes(e))throw new Error(`'${e}' is not a valid action.`);let s=null;if(typeof t=="object"){if(!t.kind||!t.name)throw new Error("The entity resource object is not valid.");const d=(await o(Ac(t.kind,t.name))).find(p=>p.name===t.name&&p.kind===t.kind);if(!d)return;s=d.baseURL+(t.id?"/"+t.id:"")}else s=`/wp/v2/${t}`+(n?"/"+n:"");const{hasStartedResolution:i}=r.select(D0);for(const u of cM){if(u===e)continue;if(i("canUser",[u,t,n]))return}let c;try{c=await Rt({path:s,method:"OPTIONS",parse:!1})}catch{return}const l=EB(c.headers?.get("allow"));r.batch(()=>{for(const u of cM){const d=px(u,t,n);o.receiveUserPermission(d,l[u]),u!==e&&o.finishResolution("canUser",[u,t,n])}})},pBe=(e,t,n)=>async({dispatch:o})=>{await o(tse("update",{kind:e,name:t,id:n}))},fBe=(e,t)=>async({dispatch:n,resolveSelect:o})=>{const{rest_base:r,rest_namespace:s="wp/v2"}=await o.getPostType(e),i=await Rt({path:`/${s}/${r}/${t}/autosaves?context=edit`});i&&i.length&&n.receiveAutosaves(t,i)},bBe=(e,t)=>async({resolveSelect:n})=>{await n.getAutosaves(e,t)},nse=e=>async({dispatch:t,resolveSelect:n})=>{let o;try{o=await Rt({url:tn(e,{"_wp-find-template":!0})}).then(({data:s})=>s)}catch{}if(!o)return;const r=await n.getEntityRecord("postType","wp_template",o.id);r&&t.receiveEntityRecords("postType","wp_template",[r],{"find-template":e})};nse.shouldInvalidate=e=>(e.type==="RECEIVE_ITEMS"||e.type==="REMOVE_ITEMS")&&e.invalidateCache&&e.kind==="postType"&&e.name==="wp_template";const hBe=()=>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)},mBe=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),o=await Rt({path:`/wp/v2/global-styles/themes/${n.stylesheet}?context=view`});t.__experimentalReceiveThemeBaseGlobalStyles(n.stylesheet,o)},gBe=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),o=await Rt({path:`/wp/v2/global-styles/themes/${n.stylesheet}/variations?context=view`});t.__experimentalReceiveThemeGlobalStyleVariations(n.stylesheet,o)},ose=()=>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 Rt({url:r}))?.map(c=>Object.fromEntries(Object.entries(c).map(([l,u])=>[dB(l),u])));t.receiveThemeGlobalStyleRevisions(n,i)}};ose.shouldInvalidate=e=>e.type==="SAVE_ENTITY_RECORD_FINISH"&&e.kind==="root"&&!e.error&&e.name==="globalStyles";const MBe=()=>async({dispatch:e})=>{const t=await rBe();e({type:"RECEIVE_BLOCK_PATTERNS",patterns:t})},zBe=()=>async({dispatch:e})=>{const t=await Rt({path:"/wp/v2/block-patterns/categories"});e({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:t})},OBe=()=>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:Vt(r.name),name:r.slug}))||[];e({type:"RECEIVE_USER_PATTERN_CATEGORIES",patternCategories:o})},yBe=()=>async({dispatch:e,select:t,registry:n})=>{const o=await Rt({path:tn("/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])})},ABe=e=>async({dispatch:t})=>{const n=await Rt({path:tn("/wp/v2/templates/lookup",e)});n?.id&&t.receiveDefaultTemplateId(e,n.id)},rse=(e,t,n,o={})=>async({dispatch:r,registry:s})=>{const c=(await r(Ac(e,t))).find(b=>b.name===t&&b.kind===e);if(!c)return;o._fields&&(o={...o,_fields:[...new Set([...dd(o._fields)||[],c.revisionKey||U0])].join()});const l=tn(c.getRevisionsUrl(n),o);let u,d;const p={},f=c.supportsPagination&&o.per_page!==-1;try{d=await Rt({path:l,parse:!f})}catch{return}d&&(f?(u=Object.values(await d.json()),p.totalItems=parseInt(d.headers.get("X-WP-Total"))):u=Object.values(d),o._fields&&(u=u.map(b=>(o._fields.split(",").forEach(h=>{b.hasOwnProperty(h)||(b[h]=void 0)}),b))),s.batch(()=>{if(r.receiveRevisions(e,t,n,u,o,!1,p),!o?._fields&&!o.context){const b=c.key||U0,h=u.filter(g=>g[b]).map(g=>[e,t,n,g[b]]);r.finishResolutions("getRevision",h)}}))};rse.shouldInvalidate=(e,t,n,o)=>e.type==="SAVE_ENTITY_RECORD_FINISH"&&n===e.name&&t===e.kind&&!e.error&&o===e.recordId;const vBe=(e,t,n,o,r)=>async({dispatch:s})=>{const c=(await s(Ac(e,t))).find(d=>d.name===t&&d.kind===e);if(!c)return;r!==void 0&&r._fields&&(r={...r,_fields:[...new Set([...dd(r._fields)||[],c.revisionKey||U0])].join()});const l=tn(c.getRevisionsUrl(n,o),r);let u;try{u=await Rt({path:l})}catch{return}u&&s.receiveRevisions(e,t,n,u,r)},xBe=e=>async({dispatch:t,resolveSelect:n})=>{let o;try{const{rest_namespace:r="wp/v2",rest_base:s}=await n.getPostType(e)||{};o=await Rt({path:`${r}/${s}/?context=edit`,method:"OPTIONS"})}catch{return}o&&t.receiveRegisteredPostMeta(e,o?.schema?.properties?.meta?.properties)},wBe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalGetCurrentGlobalStylesId:hBe,__experimentalGetCurrentThemeBaseGlobalStyles:mBe,__experimentalGetCurrentThemeGlobalStylesVariations:gBe,__experimentalGetTemplateForLink:nse,canUser:tse,canUserEditEntityRecord:pBe,getAuthors:sBe,getAutosave:bBe,getAutosaves:fBe,getBlockPatternCategories:zBe,getBlockPatterns:MBe,getCurrentTheme:lBe,getCurrentThemeGlobalStylesRevisions:ose,getCurrentUser:iBe,getDefaultTemplateId:ABe,getEditedEntityRecord:cBe,getEmbedPreview:dBe,getEntityRecord:ese,getEntityRecords:w4,getNavigationFallbackId:yBe,getRawEntityRecord:aBe,getRegisteredPostMeta:xBe,getRevision:vBe,getRevisions:rse,getThemeSupports:uBe,getUserPatternCategories:OBe},Symbol.toStringTag,{value:"Module"}));function uU(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 T8(e,t){let n=e;for(const o of t){const r=n.children[o];if(!r)return null;n=r}return n}function*_Be(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*kBe(e){const t=Object.values(e.children);for(;t.length;){const n=t.pop();yield n,t.push(...Object.values(n.children))}}function dU({exclusive:e},t){return!!(e&&t.length||!e&&t.filter(n=>n.exclusive).length)}const SBe={requests:[],tree:{locks:[],children:{}}};function tA(e=SBe,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=uU(e.tree,i),l=T8(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=uU(e.tree,o),s=T8(r,o);return s.locks=s.locks.filter(i=>i!==n),{...e,tree:r}}}return e}function CBe(e){return e.requests}function qBe(e,t,n,{exclusive:o}){const r=[t,...n],s=e.tree;for(const c of _Be(s,r))if(dU({exclusive:o},c.locks))return!1;const i=T8(s,r);if(!i)return!0;for(const c of kBe(i))if(dU({exclusive:o},c.locks))return!1;return!0}function RBe(){let e=tA(void 0,{type:"@@INIT"});function t(){for(const r of CBe(e)){const{store:s,path:i,exclusive:c,notifyAcquired:l}=r;if(qBe(e,s,i,{exclusive:c})){const u={store:s,path:i,exclusive:c};e=tA(e,{type:"GRANT_LOCK_REQUEST",lock:u,request:r}),l(u)}}}function n(r,s,i){return new Promise(c=>{e=tA(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:r,path:s,exclusive:i,notifyAcquired:c}}),t()})}function o(r){e=tA(e,{type:"RELEASE_LOCK",lock:r}),t()}return{acquire:n,release:o}}function TBe(){const e=RBe();function t(o,r,{exclusive:s}){return()=>e.acquire(o,r,s)}function n(o){return()=>e.release(o)}return{__unstableAcquireStoreLock:t,__unstableReleaseStoreLock:n}}const{lock:c2n,unlock:fN}=A1("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"),E8=x.createContext({});function W8({kind:e,type:t,id:n,children:o}){const r=x.useContext(E8),s=x.useMemo(()=>({...r,[e]:{...r?.[e],[t]:n}}),[r,e,t,n]);return a.jsx(E8.Provider,{value:s,children:o})}let Z1=function(e){return e.Idle="IDLE",e.Resolving="RESOLVING",e.Error="ERROR",e.Success="SUCCESS",e}({});const EBe=["getIsResolving","hasStartedResolution","hasFinishedResolution","isResolving","getCachedResolvers"];function bN(e,t){return K((n,o)=>e(s=>WBe(n(s)),o),t)}const WBe=js(e=>{const t={};for(const n in e)EBe.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=Z1.Resolving;break;case"finished":i=Z1.Success;break;case"error":i=Z1.Error;break;case void 0:i=Z1.Idle;break}return{data:r,status:i,isResolving:i===Z1.Resolving,hasStarted:i!==Z1.Idle,hasResolved:i===Z1.Success||i===Z1.Error}}});return t}),pU={};function sse(e,t,n,o={enabled:!0}){const{editEntityRecord:r,saveEditedEntityRecord:s}=Ae(ve),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}=K(f=>o.enabled?{editedRecord:f(ve).getEditedEntityRecord(e,t,n),hasEdits:f(ve).hasEditsForEntityRecord(e,t,n),edits:f(ve).getEntityRecordNonTransientEdits(e,t,n)}:{editedRecord:pU,hasEdits:!1,edits:pU},[e,t,n,o.enabled]),{data:d,...p}=bN(f=>o.enabled?f(ve).getEntityRecord(e,t,n):{data:null},[e,t,n,o.enabled]);return{record:d,editedRecord:c,hasEdits:l,edits:u,...p,...i}}const BBe=[];function Yp(e,t,n={},o={enabled:!0}){const r=tn("",n),{data:s,...i}=bN(u=>o.enabled?u(ve).getEntityRecords(e,t,n):{data:BBe},[e,t,r,o.enabled]),{totalItems:c,totalPages:l}=K(u=>o.enabled?{totalItems:u(ve).getEntityRecordsTotalItems(e,t,n),totalPages:u(ve).getEntityRecordsTotalPages(e,t,n)}:{totalItems:null,totalPages:null},[e,t,r,o.enabled]);return{records:s,totalItems:c,totalPages:l,...i}}const fU=new Set;function NBe(){return globalThis.SCRIPT_DEBUG===!0}function An(e){if(NBe()&&!fU.has(e)){console.warn(e);try{throw Error(e)}catch{}fU.add(e)}}function ise(e,t){const n=typeof e=="object",o=n?JSON.stringify(e):e;return n&&typeof t<"u"&&globalThis.SCRIPT_DEBUG===!0&&An("When 'resource' is an entity object, passing 'id' as a separate argument isn't supported."),bN(r=>{const s=n?!!e.id:!!t,{canUser:i}=r(ve),c=i("create",n?{kind:e.kind,name:e.name}:e);if(!s){const h=i("read",e),g=c.isResolving||h.isResolving,O=c.hasResolved&&h.hasResolved;let v=Z1.Idle;return g?v=Z1.Resolving:O&&(v=Z1.Success),{status:v,isResolving:g,hasResolved:O,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=Z1.Idle;return p?b=Z1.Resolving:f&&(b=Z1.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 LBe={grad:.9,turn:360,rad:360/(2*Math.PI)},Hc=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},g0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},zi=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},ase=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},bU=function(e){return{r:zi(e.r,0,255),g:zi(e.g,0,255),b:zi(e.b,0,255),a:zi(e.a)}},ES=function(e){return{r:g0(e.r),g:g0(e.g),b:g0(e.b),a:g0(e.a,3)}},PBe=/^#([0-9a-f]{3,8})$/i,nA=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},cse=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}},lse=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}},hU=function(e){return{h:ase(e.h),s:zi(e.s,0,100),l:zi(e.l,0,100),a:zi(e.a)}},mU=function(e){return{h:g0(e.h),s:g0(e.s),l:g0(e.l),a:g0(e.a,3)}},gU=function(e){return lse((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},dM=function(e){return{h:(t=cse(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},jBe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,IBe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,DBe=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,FBe=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,B8={string:[[function(e){var t=PBe.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?g0(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?g0(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=DBe.exec(e)||FBe.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:bU({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=jBe.exec(e)||IBe.exec(e);if(!t)return null;var n,o,r=hU({h:(n=t[1],o=t[2],o===void 0&&(o="deg"),Number(n)*(LBe[o]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return gU(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 Hc(t)&&Hc(n)&&Hc(o)?bU({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(!Hc(t)||!Hc(n)||!Hc(o))return null;var i=hU({h:Number(t),s:Number(n),l:Number(o),a:Number(s)});return gU(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,s=r===void 0?1:r;if(!Hc(t)||!Hc(n)||!Hc(o))return null;var i=function(c){return{h:ase(c.h),s:zi(c.s,0,100),v:zi(c.v,0,100),a:zi(c.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(s)});return lse(i)},"hsv"]]},MU=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=ES(this.rgba),n=t.r,o=t.g,r=t.b,i=(s=t.a)<1?nA(g0(255*s)):"","#"+nA(n)+nA(o)+nA(r)+i;var t,n,o,r,s,i},e.prototype.toRgb=function(){return ES(this.rgba)},e.prototype.toRgbString=function(){return t=ES(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 mU(dM(this.rgba))},e.prototype.toHslString=function(){return t=mU(dM(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=cse(this.rgba),{h:g0(t.h),s:g0(t.s),v:g0(t.v),a:g0(t.a,3)};var t},e.prototype.invert=function(){return cn({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),cn(WS(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),cn(WS(this.rgba,-t))},e.prototype.grayscale=function(){return cn(WS(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),cn(zU(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),cn(zU(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"?cn({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):g0(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=dM(this.rgba);return typeof t=="number"?cn({h:t,s:n.s,l:n.l,a:n.a}):g0(n.h)},e.prototype.isEqual=function(t){return this.toHex()===cn(t).toHex()},e}(),cn=function(e){return e instanceof N8?e:new N8(e)},OU=[],Is=function(e){e.forEach(function(t){OU.indexOf(t)<0&&(t(N8,B8),OU.push(t))})};function Ds(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",L8=["attributes","supports","save","migrate","isEligible","apiVersion"],Rp={"--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"},VBe={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"dimensions.aspectRatios":!0,"typography.fontSizes":!0,"spacing.spacingSizes":!0},{lock:HBe,unlock:bf}=A1("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"),yU={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 _4(e){return e!==null&&typeof e=="object"}function UBe({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(yU).forEach(r=>{o[r]&&(o[r]=P8(yU[r],o[r],e))}),o}function XBe(e,t){const n=_4(e)?e.name:e;if(typeof n!="string"){globalThis.SCRIPT_DEBUG===!0&&An("Block names must be strings.");return}if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(n)){globalThis.SCRIPT_DEBUG===!0&&An("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(no(zt).getBlockType(n)){globalThis.SCRIPT_DEBUG===!0&&An('Block "'+n+'" is already registered.');return}const{addBootstrappedBlockType:o,addUnprocessedBlockType:r}=bf(er(zt));if(_4(e)){const s=UBe(e);o(n,s)}return r(n,t),no(zt).getBlockType(n)}function P8(e,t,n){return typeof e=="string"&&typeof t=="string"?Pe(t,e,n):Array.isArray(e)&&e.length&&Array.isArray(t)?t.map(o=>P8(e[0],o,n)):_4(e)&&Object.entries(e).length&&_4(t)?Object.keys(t).reduce((o,r)=>e[r]?(o[r]=P8(e[r],t[r],n),o):(o[r]=t[r],o),{}):t}function GBe(e){const t=no(zt).getBlockType(e);if(!t){globalThis.SCRIPT_DEBUG===!0&&An('Block "'+e+'" is not registered.');return}return er(zt).removeBlockTypes(e),t}function KBe(e){er(zt).setFreeformFallbackBlockName(e)}function bd(){return no(zt).getFreeformFallbackBlockName()}function dse(){return no(zt).getGroupingBlockName()}function YBe(e){er(zt).setUnregisteredFallbackBlockName(e)}function o3(){return no(zt).getUnregisteredFallbackBlockName()}function ZBe(e){er(zt).setDefaultBlockName(e)}function QBe(e){er(zt).setGroupingBlockName(e)}function hr(){return no(zt).getDefaultBlockName()}function ln(e){return no(zt)?.getBlockType(e)}function R1(){return no(zt).getBlockTypes()}function wn(e,t,n){return no(zt).getBlockSupport(e,t,n)}function Et(e,t,n){return no(zt).hasBlockSupport(e,t,n)}function Ud(e){return e?.name==="core/block"}function Wh(e){return e?.name==="core/template-part"}const kx=(e,t)=>no(zt).getBlockVariations(e,t),AU=e=>{const{name:t,label:n,usesContext:o,getValues:r,setValues:s,canUserEditValue:i,getFieldsList:c}=e,l=bf(no(zt)).getBlockBindingsSource(t),u=["label","usesContext"];for(const d in l)if(!u.includes(d)&&l[d]){globalThis.SCRIPT_DEBUG===!0&&An('Block bindings source "'+t+'" is already registered.');return}if(!t){globalThis.SCRIPT_DEBUG===!0&&An("Block bindings source must contain a name.");return}if(typeof t!="string"){globalThis.SCRIPT_DEBUG===!0&&An("Block bindings source name must be a string.");return}if(/[A-Z]+/.test(t)){globalThis.SCRIPT_DEBUG===!0&&An("Block bindings source name must not contain uppercase characters.");return}if(!/^[a-z0-9/-]+$/.test(t)){globalThis.SCRIPT_DEBUG===!0&&An("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&&An("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&&An("Block bindings source must contain a label.");return}if(n&&typeof n!="string"){globalThis.SCRIPT_DEBUG===!0&&An("Block bindings source label must be a string.");return}if(n&&l?.label&&n!==l?.label&&globalThis.SCRIPT_DEBUG===!0&&An('Block bindings "'+t+'" source label was overriden.'),o&&!Array.isArray(o)){globalThis.SCRIPT_DEBUG===!0&&An("Block bindings source usesContext must be an array.");return}if(r&&typeof r!="function"){globalThis.SCRIPT_DEBUG===!0&&An("Block bindings source getValues must be a function.");return}if(s&&typeof s!="function"){globalThis.SCRIPT_DEBUG===!0&&An("Block bindings source setValues must be a function.");return}if(i&&typeof i!="function"){globalThis.SCRIPT_DEBUG===!0&&An("Block bindings source canUserEditValue must be a function.");return}if(c&&typeof c!="function"){globalThis.SCRIPT_DEBUG===!0&&An("Block bindings source getFieldsList must be a function.");return}return bf(er(zt)).addBlockBindingsSource(e)};function hl(e){return bf(no(zt)).getBlockBindingsSource(e)}function pse(){return bf(no(zt)).getAllBlockBindingsSources()}Is([Ds,Df]);const vU=["#191e23","#f8f9f9"];function fse(e,t){return e.hasOwnProperty("default")?t===e.default:e.type==="rich-text"?!t?.length:t===void 0}function Zp(e){var t;return Object.entries((t=ln(e.name)?.attributes)!==null&&t!==void 0?t:{}).every(([n,o])=>{const r=e.attributes[n];return fse(o,r)})}function _l(e){return e.name===hr()&&Zp(e)}function JBe(e){const t=gse(e.name,"content");return t.length===0?Zp(e):t.every(n=>{const o=ln(e.name)?.attributes[n],r=e.attributes[n];return fse(o,r)})}function bse(e){return!!e&&(typeof e=="string"||x.isValidElement(e)||typeof e=="function"||e instanceof x.Component)}function eNe(e){if(e=e||use,bse(e))return{src:e};if("background"in e){const t=cn(e.background),n=r=>t.contrast(r),o=Math.max(...vU.map(n));return{...e,foreground:e.foreground?e.foreground:vU.find(r=>n(r)===o),shadowColor:t.alpha(.3).toRgbString()}}return e}function r3(e){return typeof e=="string"?ln(e):e}function hse(e,t,n="visual"){const{__experimentalLabel:o,title:r}=e,s=o&&o(t,{context:n});return s?s.toPlainText?s.toPlainText():ls(s):r}function mse(e){if(e.default!==void 0)return e.default;if(e.type==="rich-text")return new $o}function hN(e,t){const n=ln(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 $o?o[r]=i:typeof i=="string"&&(o[r]=$o.fromHTMLString(i)):s.type==="string"&&i instanceof $o?o[r]=i.toHTMLString():o[r]=i;else{const c=mse(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 gse(e,t){const n=ln(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 Ff(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>!t.includes(n)))}const tNe=[{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 mN(e){return e.reduce((t,n)=>({...t,[n.name]:n}),{})}function k4(e){return e.reduce((t,n)=>(t.some(o=>o.name===n.name)||t.push(n),t),[])}function nNe(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])=>[dB(i),c])),s.name=n),s?{...e,[n]:s}:e;case"REMOVE_BLOCK_TYPES":return Ff(e,t.names)}return e}function oNe(e={},t){switch(t.type){case"ADD_UNPROCESSED_BLOCK_TYPE":return{...e,[t.name]:t.blockType};case"REMOVE_BLOCK_TYPES":return Ff(e,t.names)}return e}function rNe(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...mN(t.blockTypes)};case"REMOVE_BLOCK_TYPES":return Ff(e,t.names)}return e}function sNe(e={},t){var n;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(mN(t.blockTypes)).map(([r,s])=>{var i,c;return[r,k4([...((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]=k4([...(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 iNe(e={},t){var n,o;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(mN(t.blockTypes)).map(([r,s])=>{var i,c;return[r,k4([...((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]:k4([...(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 Sx(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 aNe=Sx("SET_DEFAULT_BLOCK_NAME"),cNe=Sx("SET_FREEFORM_FALLBACK_BLOCK_NAME"),lNe=Sx("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),uNe=Sx("SET_GROUPING_BLOCK_NAME");function dNe(e=tNe,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 pNe(e={},t){switch(t.type){case"ADD_BLOCK_COLLECTION":return{...e,[t.namespace]:{title:t.title,icon:t.icon}};case"REMOVE_BLOCK_COLLECTION":return Ff(e,t.namespace)}return e}function fNe(e=[],t=[]){const n=Array.from(new Set(e.concat(t)));return n.length>0?n:void 0}function bNe(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:fNe(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 Ff(e,t.name)}return e}const hNe=H0({bootstrappedBlockTypes:nNe,unprocessedBlockTypes:oNe,blockTypes:rNe,blockStyles:sNe,blockVariations:iNe,defaultBlockName:aNe,freeformFallbackBlockName:cNe,unregisteredFallbackBlockName:lNe,groupingBlockName:uNe,categories:dNe,collections:pNe,blockBindingsSources:bNe}),FM=(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 xU(e){return typeof e=="object"&&e.constructor===Object&&e!==null}function Mse(e,t){return xU(e)&&xU(t)?Object.entries(t).every(([n,o])=>Mse(e?.[n],o)):e===t}const mNe=["background","backgroundColor","color","linkColor","captionColor","buttonColor","headingColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","padding","contentSize","wideSize","blockGap","textDecoration","textTransform","letterSpacing"];function wU(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 gNe=Lt((e,t,n)=>{if(!t)return wU(mNe,t,n);const o=s3(e,t);if(!o)return[];const r=[];return o?.supports?.spacing?.blockGap&&r.push("blockGap"),o?.supports?.shadow&&r.push("shadow"),Object.keys(Rp).forEach(s=>{if(Rp[s].support){if(Rp[s].requiresOptOut&&Rp[s].support[0]in o.supports&&FM(o.supports,Rp[s].support)!==!1){r.push(s);return}FM(o.supports,Rp[s].support,!1)&&r.push(s)}}),wU(r,t,n)},(e,t)=>[e.blockTypes[t]]);function MNe(e,t){return e.bootstrappedBlockTypes[t]}function zNe(e){return e.unprocessedBlockTypes}function ONe(e){return e.blockBindingsSources}function yNe(e,t){return e.blockBindingsSources[t]}const zse=(e,t)=>{const n=s3(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},ANe=Object.freeze(Object.defineProperty({__proto__:null,getAllBlockBindingsSources:ONe,getBlockBindingsSource:yNe,getBootstrappedBlockType:MNe,getSupportedStyles:gNe,getUnprocessedBlockTypes:zNe,hasContentRoleAttribute:zse},Symbol.toStringTag,{value:"Module"})),Ose=(e,t)=>typeof t=="string"?s3(e,t):t,yse=Lt(e=>Object.values(e.blockTypes),e=>[e.blockTypes]);function s3(e,t){return e.blockTypes[t]}function vNe(e,t){return e.blockStyles[t]}const gN=Lt((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 xNe(e,t,n,o){const r=gN(e,t,o);if(!r)return r;const s=s3(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=FM(u.attributes,b);if(h===void 0)return!1;let g=FM(n,b);return g instanceof $o&&(g=g.toHTMLString()),Mse(g,h)})&&p>l&&(c=u,l=p)}else if(u.isActive?.(n,u.attributes))return c||u;return c}function wNe(e,t,n){const o=gN(e,t,n);return[...o].reverse().find(({isDefault:s})=>!!s)||o[0]}function _Ne(e){return e.categories}function kNe(e){return e.collections}function SNe(e){return e.defaultBlockName}function CNe(e){return e.freeformFallbackBlockName}function qNe(e){return e.unregisteredFallbackBlockName}function RNe(e){return e.groupingBlockName}const MN=Lt((e,t)=>yse(e).filter(n=>n.parent?.includes(t)).map(({name:n})=>n),e=>[e.blockTypes]),Ase=(e,t,n,o)=>{const r=Ose(e,t);return r?.supports?FM(r.supports,n,o):o};function vse(e,t,n,o){return!!Ase(e,t,n,o)}function _U(e){return xi(e??"").toLowerCase().trim()}function TNe(e,t,n=""){const o=Ose(e,t),r=_U(n),s=i=>_U(i).includes(r);return s(o.title)||o.keywords?.some(s)||s(o.category)||typeof o.description=="string"&&s(o.description)}const ENe=(e,t)=>MN(e,t).length>0,WNe=(e,t)=>MN(e,t).some(n=>vse(e,n,"inserter",!0)),BNe=(...e)=>(Ze("__experimentalHasContentRoleAttribute",{since:"6.7",version:"6.8",hint:"This is a private selector."}),zse(...e)),NNe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalHasContentRoleAttribute:BNe,getActiveBlockVariation:xNe,getBlockStyles:vNe,getBlockSupport:Ase,getBlockType:s3,getBlockTypes:yse,getBlockVariations:gN,getCategories:_Ne,getChildBlockNames:MN,getCollections:kNe,getDefaultBlockName:SNe,getDefaultBlockVariation:wNe,getFreeformFallbackBlockName:CNe,getGroupingBlockName:RNe,getUnregisteredFallbackBlockName:qNe,hasBlockSupport:vse,hasChildBlocks:ENe,hasChildBlocksWithInserterSupport:WNe,isMatchingSearchTerm:TNe},Symbol.toStringTag,{value:"Module"}));var PS={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 kU;function LNe(){if(kU)return wo;kU=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(O){if(typeof O=="object"&&O!==null){var v=O.$$typeof;switch(v){case e:switch(O=O.type,O){case n:case r:case o:case u:case d:return O;default:switch(O=O&&O.$$typeof,O){case c:case i:case l:case f:case p:case s:return O;default:return v}}case t:return v}}}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(O){return g(O)===i},wo.isContextProvider=function(O){return g(O)===s},wo.isElement=function(O){return typeof O=="object"&&O!==null&&O.$$typeof===e},wo.isForwardRef=function(O){return g(O)===l},wo.isFragment=function(O){return g(O)===n},wo.isLazy=function(O){return g(O)===f},wo.isMemo=function(O){return g(O)===p},wo.isPortal=function(O){return g(O)===t},wo.isProfiler=function(O){return g(O)===r},wo.isStrictMode=function(O){return g(O)===o},wo.isSuspense=function(O){return g(O)===u},wo.isSuspenseList=function(O){return g(O)===d},wo.isValidElementType=function(O){return typeof O=="string"||typeof O=="function"||O===n||O===r||O===o||O===u||O===d||O===b||typeof O=="object"&&O!==null&&(O.$$typeof===f||O.$$typeof===p||O.$$typeof===s||O.$$typeof===i||O.$$typeof===l||O.$$typeof===h||O.getModuleId!==void 0)},wo.typeOf=g,wo}var SU;function PNe(){return SU||(SU=1,PS.exports=LNe()),PS.exports}var jNe=PNe();const CU={common:"text",formatting:"text",layout:"design"};function INe(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 xse=(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:INe(Array.isArray(o?.variations)?o.variations:[],Array.isArray(t?.variations)?t.variations:[])},s=br("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(br("blocks.registerBlockType",{...Ff(r,L8),...i},r.name,i)).filter(([c])=>L8.includes(c))))),!Uz(s)){globalThis.SCRIPT_DEBUG===!0&&An("Block settings must be a valid object.");return}if(typeof s.save!="function"){globalThis.SCRIPT_DEBUG===!0&&An('The "save" property must be a valid function.');return}if("edit"in s&&!jNe.isValidElementType(s.edit)){globalThis.SCRIPT_DEBUG===!0&&An('The "edit" property must be a valid component.');return}if(CU.hasOwnProperty(s.category)&&(s.category=CU[s.category]),"category"in s&&!n.getCategories().some(({slug:i})=>i===s.category)&&(globalThis.SCRIPT_DEBUG===!0&&An('The block "'+e+'" is registered with an invalid category "'+s.category+'".'),delete s.category),!("title"in s)||s.title===""){globalThis.SCRIPT_DEBUG===!0&&An('The block "'+e+'" must have a title.');return}if(typeof s.title!="string"){globalThis.SCRIPT_DEBUG===!0&&An("Block titles must be strings.");return}if(s.icon=eNe(s.icon),!bse(s.icon.src)){globalThis.SCRIPT_DEBUG===!0&&An("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}return s};function DNe(e){return{type:"ADD_BLOCK_TYPES",blockTypes:Array.isArray(e)?e:[e]}}function wse(){return({dispatch:e,select:t})=>{const n=[];for(const[o,r]of Object.entries(t.getUnprocessedBlockTypes())){const s=e(xse(o,r));s&&n.push(s)}n.length&&e.addBlockTypes(n)}}function FNe(){return Ze('wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters',{since:"6.4",alternative:"reapplyBlockFilters"}),wse()}function $Ne(e){return{type:"REMOVE_BLOCK_TYPES",names:Array.isArray(e)?e:[e]}}function VNe(e,t){return{type:"ADD_BLOCK_STYLES",styles:Array.isArray(t)?t:[t],blockNames:Array.isArray(e)?e:[e]}}function HNe(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:Array.isArray(t)?t:[t],blockName:e}}function UNe(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:Array.isArray(t)?t:[t],blockName:e}}function XNe(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:Array.isArray(t)?t:[t],blockName:e}}function GNe(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function KNe(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function YNe(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function ZNe(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function QNe(e){return{type:"SET_CATEGORIES",categories:e}}function JNe(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function eLe(e,t,n){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:n}}function tLe(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}const nLe=Object.freeze(Object.defineProperty({__proto__:null,__experimentalReapplyBlockFilters:FNe,addBlockCollection:eLe,addBlockStyles:VNe,addBlockTypes:DNe,addBlockVariations:UNe,reapplyBlockTypeFilters:wse,removeBlockCollection:tLe,removeBlockStyles:HNe,removeBlockTypes:$Ne,removeBlockVariations:XNe,setCategories:QNe,setDefaultBlockName:GNe,setFreeformFallbackBlockName:KNe,setGroupingBlockName:ZNe,setUnregisteredFallbackBlockName:YNe,updateCategory:JNe},Symbol.toStringTag,{value:"Module"}));function oLe(e,t){return{type:"ADD_BOOTSTRAPPED_BLOCK_TYPE",name:e,blockType:t}}function rLe(e,t){return({dispatch:n})=>{n({type:"ADD_UNPROCESSED_BLOCK_TYPE",name:e,blockType:t});const o=n(xse(e,t));o&&n.addBlockTypes(o)}}function sLe(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 iLe(e){return{type:"REMOVE_BLOCK_BINDINGS_SOURCE",name:e}}const aLe=Object.freeze(Object.defineProperty({__proto__:null,addBlockBindingsSource:sLe,addBootstrappedBlockType:oLe,addUnprocessedBlockType:rLe,removeBlockBindingsSource:iLe},Symbol.toStringTag,{value:"Module"})),cLe="core/blocks",zt=q1(cLe,{reducer:hNe,selectors:NNe,actions:nLe});ki(zt);bf(zt).registerPrivateSelectors(ANe);bf(zt).registerPrivateActions(aLe);function Te(e,t={},n=[]){const o=hN(e,t);return{clientId:ta(),name:e,isValid:!0,attributes:o,innerBlocks:n}}function hd(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,hd(s))})}function _se(e,t={},n){const o=ta(),r=hN(e.name,{...e.attributes,...t});return{...e,clientId:o,attributes:r,innerBlocks:n||e.innerBlocks.map(s=>_se(s))}}function Ho(e,t={},n){const o=ta();return{...e,clientId:o,attributes:{...e.attributes,...t},innerBlocks:n||e.innerBlocks.map(r=>Ho(r))}}const kse=(e,t,n)=>{if(!n.length)return!1;const o=n.length>1,r=n[0].name;if(!(_b(e)||!o||e.isMultiBlock)||!_b(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||_b(e))||!o&&t==="from"&&qU(c.name)&&qU(e.blockName)||!j8(e,n))},lLe=e=>e.length?R1().filter(o=>{const r=_i("from",o.name);return!!fc(r,s=>kse(s,"from",e))}):[],uLe=e=>{if(!e.length)return[];const t=e[0],n=ln(t.name);return(n?_i("to",n.name):[]).filter(i=>i&&kse(i,"to",e)).map(i=>i.blocks).flat().map(ln)},_b=e=>e&&e.type==="block"&&Array.isArray(e.blocks)&&e.blocks.includes("*"),qU=e=>e===dse();function Sse(e){if(!e.length)return[];const t=lLe(e),n=uLe(e);return[...new Set([...t,...n])]}function fc(e,t){const n=Xoe();for(let o=0;os||r,r.priority)}return n.applyFilters("transform",null)}function _i(e,t){if(t===void 0)return R1().map(({name:c})=>_i(e,c)).flat();const n=r3(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:_b(c)?!0:c.blocks.every(l=>r.supportedMobileTransforms.includes(l))):r[e]).map(c=>({...c,blockName:o,usingMobileTransformations:s}))}function j8(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 Pr(e,t){const n=Array.isArray(e)?e:[e],o=n.length>1,r=n[0],s=r.name,i=_i("from",t),c=_i("to",s),l=fc(c,f=>f.type==="block"&&(_b(f)||f.blocks.indexOf(t)!==-1)&&(!o||f.isMultiBlock)&&j8(f,n))||fc(i,f=>f.type==="block"&&(_b(f)||f.blocks.indexOf(s)!==-1)&&(!o||f.isMultiBlock)&&j8(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=>!ln(f.name)))||!u.some(f=>f.name===t)?null:u.map((f,b,h)=>br("blocks.switchToBlockType.transformedBlock",f,e,b,h))}const zN=(e,t)=>{try{var n;return Te(e,t.attributes,((n=t.innerBlocks)!==null&&n!==void 0?n:[]).map(o=>zN(o.name,o)))}catch{return Te("core/missing",{originalName:e,originalContent:"",originalUndelimitedContent:""})}};let nc,Ia,hf,Hu;const Cse=/)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function Ov(e,t,n,o,r){return{blockName:e,attrs:t,innerBlocks:n,innerHTML:o,innerContent:r}}function ON(e){return Ov(null,{},[],e,[e])}function dLe(e,t,n,o,r){return{block:e,tokenStart:t,tokenLength:n,prevOffset:o||t+n,leadingHtmlStart:r}}const qse=e=>{nc=e,Ia=0,hf=[],Hu=[],Cse.lastIndex=0;do;while(pLe());return hf};function pLe(){const e=Hu.length,t=bLe(),[n,o,r,s,i]=t,c=s>Ia?Ia:null;switch(n){case"no-more-tokens":if(e===0)return jS(),!1;if(e===1)return IS(),!1;for(;0{const o="(<("+("(?=!--|!\\[CDATA\\[)((?=!-)"+"!(?:-(?!->)[^\\-]*)*(?:-->)?"+"|"+"!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?"+")")+"|[^>]*>?))";return new RegExp(o)})();function mLe(e){const t=[];let n=e,o;for(;o=n.match(hLe);){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 gLe(e,t){const n=mLe(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=gLe(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 Tse(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 $M(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:$M(s[c++],t)).join(` +`).replace(/\n+/g,` +`).trim();return n?Bse(o,r,l):l}function S4(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return br("blocks.getBlockDefaultClassName",t,e)}function yN(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return br("blocks.getBlockMenuDefaultClassName",t,e)}const I8={},Ese={};function C4(e={}){const{blockType:t,attributes:n}=I8;return C4.skipFilters?e:br("blocks.getSaveContent.extraProps",{...e},t,n)}function MLe(e={}){const{innerBlocks:t}=Ese;if(!Array.isArray(t))return{...e,children:t};const n=ms(t,{isInnerBlocks:!0});return{...e,children:a.jsx(a0,{children:n})}}function Wse(e,t,n=[]){const o=r3(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)}I8.blockType=o,I8.attributes=t,Ese.innerBlocks=n;let s=r({attributes:t,innerBlocks:n});if(s!==null&&typeof s=="object"&&Koe("blocks.getSaveContent.extraProps")&&!(o.apiVersion>1)){const i=br("blocks.getSaveContent.extraProps",{...s.props},o,t);ns(i,s.props)||(s=x.cloneElement(s,i))}return br("blocks.getSaveElement",s,o,t)}function $f(e,t,n){const o=r3(e);return d1(Wse(o,t,n))}function zLe(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 OLe(e){return JSON.stringify(e).replace(/--/g,"\\u002d\\u002d").replace(//g,"\\u003e").replace(/&/g,"\\u0026").replace(/\\"/g,"\\u0022")}function Cx(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=$f(e.name,e.attributes,e.innerBlocks)}catch{}return t}function Bse(e,t,n){const o=t&&Object.entries(t).length?OLe(t)+" ":"",r=e?.startsWith("core/")?e.slice(5):e;return n?` +`+n+` +`:``}function yLe(e,{isInnerBlocks:t=!1}={}){if(!e.isValid&&e.__unstableBlockSource)return $M(e.__unstableBlockSource);const n=e.name,o=Cx(e);if(n===o3()||!t&&n===bd())return o;const r=ln(n);if(!r)return o;const s=zLe(r,e.attributes);return Bse(n,s,o)}function Vl(e){e.length===1&&_l(e[0])&&(e=[]);let t=ms(e);return e.length===1&&e[0].name===bd()&&e[0].name==="core/freeform"&&(t=Tse(t)),t}function ms(e,t){return(Array.isArray(e)?e:[e]).map(o=>yLe(o,t)).join(` + +`)}var ALe=/[\t\n\f ]/,vLe=/[A-Za-z]/,xLe=/\r\n?/g;function n1(e){return ALe.test(e)}function TU(e){return vLe.test(e)}function wLe(e){return e.replace(xLe,` +`)}var _Le=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===":"||TU(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();n1(r)&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var r=this.consume();n1(r)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(r.toLowerCase()))},doctypeName:function(){var r=this.consume();n1(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(!n1(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();n1(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();n1(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();n1(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();n1(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();n1(r)?this.transitionTo("beforeAttributeName"):r==="/"?this.transitionTo("selfClosingStartTag"):r===">"?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(r)},endTagName:function(){var r=this.consume();n1(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(n1(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();n1(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(n1(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();n1(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();n1(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();n1(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===":"||TU(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+=wLe(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}(),kLe=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 _Le(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 SLe(){const e=[],t=Bh();return{error(...n){e.push({log:t.error,args:n})},warning(...n){e.push({log:t.warning,args:n})},getItems(){return e}}}const CLe=e=>e,qLe=/[\t\n\r\v\f ]+/g,RLe=/^[\t\n\r\v\f ]*$/,TLe=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,Nse=["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"],ELe=["autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],WLe=[...Nse,...ELe],EU=[CLe,ILe],BLe=/^[\da-z]+$/i,NLe=/^#\d+$/,LLe=/^#x[\da-f]+$/i;function PLe(e){return BLe.test(e)||NLe.test(e)||LLe.test(e)}class jLe{parse(t){if(PLe(t))return Vt("&"+t+";")}}function AN(e){return e.trim().split(qLe)}function ILe(e){return AN(e).join(" ")}function DLe(e){return e.attributes.filter(t=>{const[n,o]=t;return o||n.indexOf("data-")===0||WLe.includes(n)})}function WU(e,t,n=Bh()){let o=e.chars,r=t.chars;for(let s=0;s{const[o,...r]=n.split(":"),s=r.join(":");return[o.trim(),$Le(s.trim())]});return Object.fromEntries(t)}const HLe={class:(e,t)=>{const[n,o]=[e,t].map(AN),r=n.filter(i=>!o.includes(i)),s=o.filter(i=>!n.includes(i));return r.length===0&&s.length===0},style:(e,t)=>S0(...[e,t].map(VLe)),...Object.fromEntries(Nse.map(e=>[e,()=>!0]))};function ULe(e,t,n=Bh()){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):ULe(...[e,t].map(DLe),n),Chars:WU,Comment:WU};function bg(e){let t;for(;t=e.shift();)if(t.type!=="Chars"||!RLe.test(t.chars))return t}function GLe(e,t=Bh()){try{return new kLe(new jLe).tokenize(e)}catch{t.warning("Malformed HTML detected: %s",e)}return null}function BU(e,t){return e.selfClosing?!!(t&&t.tagName===e.tagName&&t.type==="EndTag"):!1}function KLe(e,t,n=Bh()){if(e===t)return!0;const[o,r]=[e,t].map(c=>GLe(c,n));if(!o||!r)return!1;let s,i;for(;s=bg(o);){if(i=bg(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=XLe[s.type];if(c&&!c(s,i,n))return!1;BU(s,r[0])?bg(r):BU(i,o[0])&&bg(o)}return(i=bg(r))?(n.warning("Expected %o, instead saw end of content.",i),!1):!0}function VM(e,t=e.name){if(e.name===bd()||e.name===o3())return[!0,[]];const o=SLe(),r=r3(t);let s;try{s=$f(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=KLe(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 Lse(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 YLe(e,t){for(var n=t.split("."),o;o=n.shift();){if(!(o in e))return;e=e[o]}return e}var ZLe=function(){var e;return function(){return e||(e=document.implementation.createHTMLDocument("")),e}}();function vN(e,t){if(t){if(typeof e=="string"){var n=ZLe();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]=vN(e,s),o},{})}}function xN(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 YLe(s,n)}}function QLe(e,t){var n,o;return arguments.length===1?(n=e,o=void 0):(n=t,o=e),function(r){var s=xN(o,"attributes")(r);if(s&&Object.prototype.hasOwnProperty.call(s,n))return s[n].value}}function JLe(e){return xN(e,"textContent")}function e7e(e,t){return function(n){var o=n.querySelectorAll(e);return[].map.call(o,function(r){return vN(r,t)})}}function t7e(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 n7e(...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?wN(n.childNodes):[]}}const D8={concat:n7e,getChildrenArray:t7e,fromDOM:wN,toHTML:o7e,matcher:Pse};function r7e(e){const t={};for(let n=0;n{let n=t;e&&(n=t.querySelector(e));try{return jse(n)}catch{return null}}}function i7e(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?$o.fromHTMLElement(o,{preserveWhiteSpace:t}):$o.empty()},c7e=e=>t=>e(t)!==void 0;function l7e(e,t){switch(t){case"rich-text":return e instanceof $o;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 u7e(e,t){return t.some(n=>l7e(e,n))}function d7e(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=_N(n,t);break}return(!p7e(s,t.type)||!f7e(s,t.enum))&&(s=void 0),s===void 0&&(s=mse(t)),s}function p7e(e,t){return t===void 0||u7e(e,Array.isArray(t)?t:[t])}function f7e(e,t){return!Array.isArray(t)||t.includes(e)}const Ise=js(e=>{switch(e.source){case"attribute":{let n=QLe(e.selector,e.attribute);return e.type==="boolean"&&(n=c7e(n)),n}case"html":return i7e(e.selector,e.multiline);case"text":return JLe(e.selector);case"rich-text":return a7e(e.selector,e.__unstablePreserveWhiteSpace);case"children":return Pse(e.selector);case"node":return s7e(e.selector);case"query":const t=Object.fromEntries(Object.entries(e.query).map(([n,o])=>[n,Ise(o)]));return e7e(e.selector,t);case"tag":{const n=xN(e.selector,"nodeName");return o=>n(o)?.toLowerCase()}default:console.error(`Unknown source type "${e.source}"`)}});function Dse(e){return vN(e,t=>t)}function _N(e,t){return Ise(t)(Dse(e))}function kl(e,t,n={}){var o;const r=Dse(t),s=r3(e),i=Object.fromEntries(Object.entries((o=s.attributes)!==null&&o!==void 0?o:{}).map(([c,l])=>[c,d7e(c,l,r,n,t)]));return br("blocks.getBlockAttributes",i,s,t,n)}const b7e={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function NU(e){const t=_N(`

${e}
`,b7e);return t?t.trim().split(/\s+/):[]}function h7e(e,t,n){if(!Et(t,"customClassName",!0))return e;const o={...e},{className:r,...s}=o,i=$f(t,s),c=NU(i),u=NU(n).filter(d=>!c.includes(d));return u.length?o.className=u.join(" "):i&&delete o.className,o}function q4(e,t){const n=h7e(e.attributes,t,e.originalContent);return{...e,attributes:n}}function m7e(){return!1}function g7e(e,t,n){const o=t.attrs,{deprecated:r}=n;if(!r||!r.length)return e;for(let s=0;sFse(d,t)).filter(d=>!!d),i=Te(n.blockName,kl(o,n.innerHTML,n.attrs),s);i.originalContent=n.innerHTML;const c=y7e(i,o),{validationIssues:l}=c,u=g7e(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,$f(o,u.attributes),u.originalContent),console.groupEnd()):!c.isValid&&!u.isValid&&l.forEach(({log:d,args:p})=>d(...p)),u}function nr(e,t){return qse(e).reduce((n,o)=>{const r=Fse(o,t);return r&&n.push(r),n},[])}function $se(){return _i("from").filter(({type:e})=>e==="raw").map(e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)})}function Vse(e,t){const n=document.implementation.createHTMLDocument("");return n.body.innerHTML=e,Array.from(n.body.children).flatMap(o=>{const r=fc($se(),({isMatch:c})=>c(o));if(!r)return s0.isNative?nr(`${o.outerHTML}`):Te("core/html",kl("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,kl(i,o.outerHTML))})}function qx(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?u4(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"?u4(i)&&!t.raw?r.removeChild(i):s.appendChild(i):Ob(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 Hse(e,t){if(e.nodeType!==e.COMMENT_NODE||e.nodeValue!=="nextpage"&&e.nodeValue.indexOf("more")!==0)return;const n=A7e(e,t);if(!e.parentNode||e.parentNode.nodeName!=="P")f6e(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)),cf(e.parentNode)}}function A7e(e,t){if(e.nodeValue==="nextpage")return x7e(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,cf(o);break}return v7e(n,r,t)}function v7e(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 x7e(e){const t=e.createElement("wp-block");return t.dataset.block="core/nextpage",t}function LU(e){return e.nodeName==="OL"||e.nodeName==="UL"}function w7e(e){return Array.from(e.childNodes).map(({nodeValue:t=""})=>t).join("")}function Use(e){if(!LU(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(w7e(o))){const r=o,s=r.previousElementSibling,i=r.parentNode;s&&(s.appendChild(t),i.removeChild(r))}if(o&&LU(o)){const r=e.previousElementSibling;r?r.appendChild(e):sM(e)}}function Xse(e){return t=>{t.nodeName==="BLOCKQUOTE"&&(t.innerHTML=qx(t.innerHTML,e))}}function _7e(e,t){var n;const o=e.nodeName.toLowerCase();return o==="figcaption"||Ore(e)?!1:o in((n=t?.figure?.children)!==null&&n!==void 0?n:{})}function k7e(e,t){var n;return e.nodeName.toLowerCase()in((n=t?.figure?.children?.a?.children)!==null&&n!==void 0?n:{})}function DS(e,t=e){const n=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(n,t),n.appendChild(e)}function Gse(e,t,n){if(!_7e(e,n))return;let o=e;const r=e.parentNode;k7e(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())&&DS(o,s):DS(o,s):DS(o)}function kN(e,t,n=0){const o=HM(e);o.lastIndex=n;const r=o.exec(t);if(!r)return;if(r[1]==="["&&r[7]==="]")return kN(e,t,o.lastIndex);const s={index:r.index,content:r[0],shortcode:SN(r)};return r[1]&&(s.content=s.content.slice(1),s.index++),r[7]&&(s.content=s.content.slice(0,-1)),s}function S7e(e,t,n){return t.replace(HM(e),function(o,r,s,i,c,l,u,d){if(r==="["&&d==="]")return o;const p=n(SN(arguments));return p||p===""?r+p+d:o})}function C7e(e){return new CN(e).string()}function HM(e){return new RegExp("\\[(\\[?)("+e+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}const PU=js(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 SN(e){let t;return e[4]?t="self-closing":e[6]?t="closed":t="single",new CN({tag:e[2],attrs:e[3],type:t,content:e[5]})}const CN=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=PU(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:kN,replace:S7e,string:C7e,regexp:HM,attrs:PU,fromMatch:SN});Object.assign(CN.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 jU=e=>Array.isArray(e)?e:[e],IU=/(\n|

)\s*$/,DU=/^\s*(\n|<\/p>)/;function ob(e,t=0,n=[]){const o=_i("from"),r=fc(o,u=>n.indexOf(u.blockName)===-1&&u.type==="shortcode"&&jU(u.tag).some(d=>HM(d).test(e)));if(!r)return[e];const i=jU(r.tag).find(u=>HM(u).test(e));let c;const l=t;if(c=kN(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("<")&&!(IU.test(u)&&DU.test(d)))return ob(e,t);if(r.isMatch&&!r.isMatch(c.shortcode.attrs))return ob(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,q4(f,ln(f.name))));else{const f=Object.fromEntries(Object.entries(r.attributes).filter(([,O])=>O.shortcode).map(([O,v])=>[O,v.shortcode(c.shortcode.attrs,c)])),b=ln(r.blockName);if(!b)return[e];const h={...b,attributes:r.attributes};let g=Te(r.blockName,kl(h,c.shortcode.content,f));g.originalContent=c.shortcode.content,g=q4(g,h),p=[g]}return[...ob(u.replace(IU,"")),...p,...ob(d.replace(DU,""))]}return[e]}function q7e(e,t){const o={phrasingContentSchema:ix(t),isPaste:t==="paste"},r=e.map(({isMatch:l,blockName:u,schema:d})=>{const p=Et(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 Kse(e){return q7e($se(),e)}function R7e(e){return!/<(?!br[ />])/i.test(e)}function Yse(e,t,n,o){Array.from(e).forEach(r=>{Yse(r.childNodes,t,n,o),t.forEach(s=>{n.contains(r)&&s(r,n,o)})})}function Qp(e,t=[],n){const o=document.implementation.createHTMLDocument("");return o.body.innerHTML=e,Yse(o.body.childNodes,t,o,n),o.body.innerHTML}function R4(e,t){const n=e[`${t}Sibling`];if(n&&Ob(n))return n;const{parentNode:o}=e;if(!(!o||!Ob(o)))return R4(o,t)}function Zse(e){e.nodeType===e.COMMENT_NODE&&cf(e)}function T7e(e,t){if(Ore(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 Qse(e,t){return e.every(n=>T7e(n,t)&&Qse(Array.from(n.children),t))}function E7e(e){return e.nodeName==="BR"&&e.previousSibling&&e.previousSibling.nodeName==="BR"}function W7e(e,t){const n=document.implementation.createHTMLDocument("");n.body.innerHTML=e;const o=Array.from(n.body.children);return!o.some(E7e)&&Qse(o,t)}function Jse(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")&&pg(t.createElement("strong"),e),o==="italic"&&pg(t.createElement("em"),e),(r==="line-through"||s.includes("line-through"))&&pg(t.createElement("s"),e),i==="super"?pg(t.createElement("sup"),e):i==="sub"&&pg(t.createElement("sub"),e)}else e.nodeName==="B"?e=aH(e,"strong"):e.nodeName==="I"?e=aH(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 eie(e){e.nodeName!=="SCRIPT"&&e.nodeName!=="NOSCRIPT"&&e.nodeName!=="TEMPLATE"&&e.nodeName!=="STYLE"||e.parentNode.removeChild(e)}function tie(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 FS(e){return e.nodeName==="OL"||e.nodeName==="UL"}function B7e(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||!FS(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=Qp(e.innerHTML,[tie]);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,FS(c)&&(c=c.lastChild||c);FS(c)||(c=c.appendChild(t.createElement(s))),c.appendChild(i),e.parentNode.removeChild(e)}const T4={};function qs(e){const t=window.URL.createObjectURL(e);return T4[t]=e,t}function nie(e){return T4[e]}function oie(e){return nie(e)?.type.split("/")[0]}function F8(e){T4[e]&&window.URL.revokeObjectURL(e),delete T4[e]}function Er(e){return!e||!e.indexOf?!1:e.indexOf("blob:")===0}function FU(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 N7e(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 k={};for(var S in y)y.hasOwnProperty(S)&&(k[S]=y[S].defaultValue);return k}function n(){var M=t(!0),y={};for(var k in M)M.hasOwnProperty(k)&&(y[k]=!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 k in y)y.hasOwnProperty(k)&&(i[k]=y[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,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 k=u(y,M);if(k.valid)s[M]=y;else throw Error(k.error)}},o.getAllExtensions=function(){return s},o.removeExtension=function(M){delete s[M]},o.resetExtensions=function(){s={}};function u(M,y){var k=y?"Error in "+y+" 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,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 k=0;k").replace(/&/g,"&")};var p=function(M,y,k,S){var C=S||"",R=C.indexOf("g")>-1,T=new RegExp(y+"|"+k,"g"+C.replace(/g/g,"")),E=new RegExp(y,C.replace(/g/g,"")),N=[],L,P,I,j,H;do for(L=0;I=T.exec(M);)if(E.test(I[0]))L++||(P=T.lastIndex,j=P-I[0].length);else if(L&&!--L){H=I.index+I[0].length;var F={left:{start:j,end:P},match:{start:P,end:I.index},right:{start:I.index,end:H},wholeMatch:{start:j,end:H}};if(N.push(F),!R)return N}while(L&&(T.lastIndex=P));return N};o.helper.matchRecursiveRegExp=function(M,y,k,S){for(var C=p(M,y,k,S),R=[],T=0;T0){var L=[];T[0].wholeMatch.start!==0&&L.push(M.slice(0,T[0].wholeMatch.start));for(var P=0;P=0?S+(k||0):S},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(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=y[Math.floor(Math.random()*2)](k);else{var S=Math.random();k=S>.9?y[2](k):S>.45?y[1](k):y[0](k)}return k}),M},o.helper.padEnd=function(y,k,S){return k=k>>0,S=String(S||" "),y.length>k?String(y):(k=k-y.length,k>S.length&&(S+=S.repeat(k/S.length)),String(y)+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 y={},k=[],S=[],C={},R=c,T={parsed:{},raw:"",format:""};E();function E(){M=M||{};for(var j in i)i.hasOwnProperty(j)&&(y[j]=i[j]);if(typeof M=="object")for(var H in M)M.hasOwnProperty(H)&&(y[H]=M[H]);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,N)}function N(j,H){if(H=H||null,o.helper.isString(j))if(j=o.helper.stdExtName(j),H=j,o.extensions[j]){console.warn("DEPRECATION WARNING: "+j+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),L(o.extensions[j],j);return}else if(!o.helper.isUndefined(s[j]))j=s[j];else throw Error('Extension "'+j+'" could not be loaded. It was either not found or is not a valid extension.');typeof j=="function"&&(j=j()),o.helper.isArray(j)||(j=[j]);var F=u(j,H);if(!F.valid)throw Error(F.error);for(var U=0;U[ \t]+¨NBSP;<"),!H)if(window&&window.document)H=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=H.createElement("div");F.innerHTML=j;var U={preList:ae(F)};ne(F);for(var Z=F.childNodes,X="",Q=0;Q'}else de.push(re[le].innerHTML),re[le].innerHTML="",re[le].setAttribute("prenum",le.toString());return de}return X},this.setOption=function(j,H){y[j]=H},this.getOption=function(j){return y[j]},this.getOptions=function(){return y},this.addExtension=function(j,H){H=H||null,N(j,H)},this.useExtension=function(j){N(j)},this.setFlavor=function(j){if(!l.hasOwnProperty(j))throw Error(j+" flavor was not found");var H=l[j];R=j;for(var F in H)H.hasOwnProperty(F)&&(y[F]=H[F])},this.getFlavor=function(){return R},this.removeExtension=function(j){o.helper.isArray(j)||(j=[j]);for(var H=0;H? ?(['"].*['"])?\)$/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])||(P=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),y.ghMentions&&(M=M.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi,function(C,R,T,E,N){if(T==="\\")return R+E;if(!o.helper.isString(y.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var L=y.ghMentionsLink.replace(/\{u}/g,N),P="";return y.openLinksInNewWindow&&(P=' rel="noopener noreferrer" target="¨E95Eblank"'),R+'"+E+""})),M=k.converter._dispatch("anchors.after",M,y,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,O=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,v=function(M){return function(y,k,S,C,R,T,E){S=S.replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback);var N=S,L="",P="",I=k||"",j=E||"";return/^www\./i.test(S)&&(S=S.replace(/^www\./i,"http://www.")),M.excludeTrailingPunctuationFromURLs&&T&&(L=T),M.openLinksInNewWindow&&(P=' rel="noopener noreferrer" target="¨E95Eblank"'),I+'"+N+""+L+j}},_=function(M,y){return function(k,S,C){var R="mailto:";return S=S||"",C=o.subParser("unescapeSpecialChars")(C,M,y),M.encodeEmails?(R=o.helper.encodeEmailAddress(R+C),C=o.helper.encodeEmailAddress(C)):R=R+C,S+''+C+""}};o.subParser("autoLinks",function(M,y,k){return M=k.converter._dispatch("autoLinks.before",M,y,k),M=M.replace(h,v(y)),M=M.replace(O,_(y,k)),M=k.converter._dispatch("autoLinks.after",M,y,k),M}),o.subParser("simplifiedAutoLinks",function(M,y,k){return y.simplifiedAutoLink&&(M=k.converter._dispatch("simplifiedAutoLinks.before",M,y,k),y.excludeTrailingPunctuationFromURLs?M=M.replace(b,v(y)):M=M.replace(f,v(y)),M=M.replace(g,_(y,k)),M=k.converter._dispatch("simplifiedAutoLinks.after",M,y,k)),M}),o.subParser("blockGamut",function(M,y,k){return M=k.converter._dispatch("blockGamut.before",M,y,k),M=o.subParser("blockQuotes")(M,y,k),M=o.subParser("headers")(M,y,k),M=o.subParser("horizontalRule")(M,y,k),M=o.subParser("lists")(M,y,k),M=o.subParser("codeBlocks")(M,y,k),M=o.subParser("tables")(M,y,k),M=o.subParser("hashHTMLBlocks")(M,y,k),M=o.subParser("paragraphs")(M,y,k),M=k.converter._dispatch("blockGamut.after",M,y,k),M}),o.subParser("blockQuotes",function(M,y,k){M=k.converter._dispatch("blockQuotes.before",M,y,k),M=M+` + +`;var S=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return y.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,y,k),C=o.subParser("blockGamut")(C,y,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+` +
`,y,k)}),M=k.converter._dispatch("blockQuotes.after",M,y,k),M}),o.subParser("codeBlocks",function(M,y,k){M=k.converter._dispatch("codeBlocks.before",M,y,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,N=T,L=` +`;return E=o.subParser("outdent")(E,y,k),E=o.subParser("encodeCode")(E,y,k),E=o.subParser("detab")(E,y,k),E=E.replace(/^\n+/g,""),E=E.replace(/\n+$/g,""),y.omitExtraWLInCodeBlocks&&(L=""),E="
"+E+L+"
",o.subParser("hashBlock")(E,y,k)+N}),M=M.replace(/¨0/,""),M=k.converter._dispatch("codeBlocks.after",M,y,k),M}),o.subParser("codeSpans",function(M,y,k){return M=k.converter._dispatch("codeSpans.before",M,y,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,y,k),E=C+""+E+"",E=o.subParser("hashHTMLSpans")(E,y,k),E}),M=k.converter._dispatch("codeSpans.after",M,y,k),M}),o.subParser("completeHTMLDocument",function(M,y,k){if(!y.completeHTMLDocument)return M;M=k.converter._dispatch("completeHTMLDocument.before",M,y,k);var S="html",C=` +`,R="",T=` +`,E="",N="";typeof k.metadata.parsed.doctype<"u"&&(C=" +`,S=k.metadata.parsed.doctype.toString().toLowerCase(),(S==="html"||S==="html5")&&(T=''));for(var L in k.metadata.parsed)if(k.metadata.parsed.hasOwnProperty(L))switch(L.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[L]+'"',N+=' +`;break;default:N+=' +`}return M=C+" + +`+R+T+N+` + +`+M.trim()+` + +`,M=k.converter._dispatch("completeHTMLDocument.after",M,y,k),M}),o.subParser("detab",function(M,y,k){return M=k.converter._dispatch("detab.before",M,y,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,y,k),M}),o.subParser("encodeBackslashEscapes",function(M,y,k){return M=k.converter._dispatch("encodeBackslashEscapes.before",M,y,k),M=M.replace(/\\(\\)/g,o.helper.escapeCharactersCallback),M=M.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,o.helper.escapeCharactersCallback),M=k.converter._dispatch("encodeBackslashEscapes.after",M,y,k),M}),o.subParser("encodeCode",function(M,y,k){return M=k.converter._dispatch("encodeCode.before",M,y,k),M=M.replace(/&/g,"&").replace(//g,">").replace(/([*_{}\[\]\\=~-])/g,o.helper.escapeCharactersCallback),M=k.converter._dispatch("encodeCode.after",M,y,k),M}),o.subParser("escapeSpecialCharsWithinTagAttributes",function(M,y,k){M=k.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",M,y,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,y,k),M}),o.subParser("githubCodeBlocks",function(M,y,k){return y.ghCodeBlocks?(M=k.converter._dispatch("githubCodeBlocks.before",M,y,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=y.omitExtraWLInCodeBlocks?"":` +`;return T=o.subParser("encodeCode")(T,y,k),T=o.subParser("detab")(T,y,k),T=T.replace(/^\n+/g,""),T=T.replace(/\n+$/g,""),T="
"+T+E+"
",T=o.subParser("hashBlock")(T,y,k),` + +¨G`+(k.ghCodeBlocks.push({text:S,codeblock:T})-1)+`G + +`}),M=M.replace(/¨0/,""),k.converter._dispatch("githubCodeBlocks.after",M,y,k)):M}),o.subParser("hashBlock",function(M,y,k){return M=k.converter._dispatch("hashBlock.before",M,y,k),M=M.replace(/(^\n+|\n+$)/g,""),M=` + +¨K`+(k.gHtmlBlocks.push(M)-1)+`K + +`,M=k.converter._dispatch("hashBlock.after",M,y,k),M}),o.subParser("hashCodeTags",function(M,y,k){M=k.converter._dispatch("hashCodeTags.before",M,y,k);var S=function(C,R,T,E){var N=T+o.subParser("encodeCode")(R,y,k)+E;return"¨C"+(k.gHtmlSpans.push(N)-1)+"C"};return M=o.helper.replaceRecursiveRegExp(M,S,"]*>","","gim"),M=k.converter._dispatch("hashCodeTags.after",M,y,k),M}),o.subParser("hashElement",function(M,y,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,y,k){M=k.converter._dispatch("hashHTMLBlocks.before",M,y,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(j,H,F,U){var Z=j;return F.search(/\bmarkdown\b/)!==-1&&(Z=F+k.converter.makeHtml(H)+U),` + +¨K`+(k.gHtmlBlocks.push(Z)-1)+`K + +`};y.backslashEscapesHTMLTags&&(M=M.replace(/\\<(\/?[^>]+?)>/g,function(j,H){return"<"+H+">"}));for(var R=0;R]*>)","im"),N="<"+S[R]+"\\b[^>]*>",L="";(T=o.helper.regexIndexOf(M,E))!==-1;){var P=o.helper.splitAtIndex(M,T),I=o.helper.replaceRecursiveRegExp(P[1],C,N,L,"im");if(I===P[1])break;M=P[0].concat(I)}return M=M.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,o.subParser("hashElement")(M,y,k)),M=o.helper.replaceRecursiveRegExp(M,function(j){return` + +¨K`+(k.gHtmlBlocks.push(j)-1)+`K + +`},"^ {0,3}","gm"),M=M.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,o.subParser("hashElement")(M,y,k)),M=k.converter._dispatch("hashHTMLBlocks.after",M,y,k),M}),o.subParser("hashHTMLSpans",function(M,y,k){M=k.converter._dispatch("hashHTMLSpans.before",M,y,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,y,k),M}),o.subParser("unhashHTMLSpans",function(M,y,k){M=k.converter._dispatch("unhashHTMLSpans.before",M,y,k);for(var S=0;S]*>\\s*]*>","^ {0,3}\\s*
","gim"),M=k.converter._dispatch("hashPreCodeTags.after",M,y,k),M}),o.subParser("headers",function(M,y,k){M=k.converter._dispatch("headers.before",M,y,k);var S=isNaN(parseInt(y.headerLevelStart))?1:parseInt(y.headerLevelStart),C=y.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,R=y.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;M=M.replace(C,function(N,L){var P=o.subParser("spanGamut")(L,y,k),I=y.noHeaderId?"":' id="'+E(L)+'"',j=S,H=""+P+"";return o.subParser("hashBlock")(H,y,k)}),M=M.replace(R,function(N,L){var P=o.subParser("spanGamut")(L,y,k),I=y.noHeaderId?"":' id="'+E(L)+'"',j=S+1,H=""+P+"";return o.subParser("hashBlock")(H,y,k)});var T=y.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;M=M.replace(T,function(N,L,P){var I=P;y.customizedHeaderId&&(I=P.replace(/\s?\{([^{]+?)}\s*$/,""));var j=o.subParser("spanGamut")(I,y,k),H=y.noHeaderId?"":' id="'+E(P)+'"',F=S-1+L.length,U=""+j+"";return o.subParser("hashBlock")(U,y,k)});function E(N){var L,P;if(y.customizedHeaderId){var I=N.match(/\{([^{]+?)}\s*$/);I&&I[1]&&(N=I[1])}return L=N,o.helper.isString(y.prefixHeaderId)?P=y.prefixHeaderId:y.prefixHeaderId===!0?P="section-":P="",y.rawPrefixHeaderId||(L=P+L),y.ghCompatibleHeaderId?L=L.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():y.rawHeaderId?L=L.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():L=L.replace(/[^\w]/g,"").toLowerCase(),y.rawPrefixHeaderId&&(L=P+L),k.hashLinkCounts[L]?L=L+"-"+k.hashLinkCounts[L]++:k.hashLinkCounts[L]=1,L}return M=k.converter._dispatch("headers.after",M,y,k),M}),o.subParser("horizontalRule",function(M,y,k){M=k.converter._dispatch("horizontalRule.before",M,y,k);var S=o.subParser("hashBlock")("
",y,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,y,k),M}),o.subParser("images",function(M,y,k){M=k.converter._dispatch("images.before",M,y,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 N(P,I,j,H,F,U,Z,X){return H=H.replace(/\s/g,""),L(P,I,j,H,F,U,Z,X)}function L(P,I,j,H,F,U,Z,X){var Q=k.gUrls,ne=k.gTitles,ae=k.gDimensions;if(j=j.toLowerCase(),X||(X=""),P.search(/\(? ?(['"].*['"])?\)$/m)>-1)H="";else if(H===""||H===null)if((j===""||j===null)&&(j=I.toLowerCase().replace(/ ?\n/g," ")),H="#"+j,!o.helper.isUndefined(Q[j]))H=Q[j],o.helper.isUndefined(ne[j])||(X=ne[j]),o.helper.isUndefined(ae[j])||(F=ae[j].width,U=ae[j].height);else return P;I=I.replace(/"/g,""").replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback),H=H.replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback);var be=''+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})),y.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,y,k),M}),o.subParser("lists",function(M,y,k){function S(T,E){k.gListLevel++,T=T.replace(/\n{2,}$/,` +`),T+="¨0";var N=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,L=/\n[ \t]*\n(?!¨0)/.test(T);return y.disableForced4SpacesIndentedSublists&&(N=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),T=T.replace(N,function(P,I,j,H,F,U,Z){Z=Z&&Z.trim()!=="";var X=o.subParser("outdent")(F,y,k),Q="";return U&&y.tasklists&&(Q=' class="task-list-item" style="list-style-type: none;"',X=X.replace(/^[ \t]*\[(x|X| )?]/m,function(){var ne='-1?(X=o.subParser("githubCodeBlocks")(X,y,k),X=o.subParser("blockGamut")(X,y,k)):(X=o.subParser("lists")(X,y,k),X=X.replace(/\n$/,""),X=o.subParser("hashHTMLBlocks")(X,y,k),X=X.replace(/\n\n+/g,` + +`),L?X=o.subParser("paragraphs")(X,y,k):X=o.subParser("spanGamut")(X,y,k)),X=X.replace("¨A",""),X=""+X+` +`,X}),T=T.replace(/¨0/g,""),k.gListLevel--,E&&(T=T.replace(/\s+$/,"")),T}function C(T,E){if(E==="ol"){var N=T.match(/^ *(\d+)\./);if(N&&N[1]!=="1")return' start="'+N[1]+'"'}return""}function R(T,E,N){var L=y.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,P=y.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,I=E==="ul"?L:P,j="";if(T.search(I)!==-1)(function F(U){var Z=U.search(I),X=C(T,E);Z!==-1?(j+=` + +<`+E+X+`> +`+S(U.slice(0,Z),!!N)+" +`,E=E==="ul"?"ol":"ul",I=E==="ul"?L:P,F(U.slice(Z))):j+=` + +<`+E+X+`> +`+S(U,!!N)+" +`})(T);else{var H=C(T,E);j=` + +<`+E+H+`> +`+S(T,!!N)+" +`}return j}return M=k.converter._dispatch("lists.before",M,y,k),M+="¨0",k.gListLevel?M=M.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(T,E,N){var L=N.search(/[*+-]/g)>-1?"ul":"ol";return R(E,L,!0)}):M=M.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(T,E,N,L){var P=L.search(/[*+-]/g)>-1?"ul":"ol";return R(N,P,!1)}),M=M.replace(/¨0/,""),M=k.converter._dispatch("lists.after",M,y,k),M}),o.subParser("metadata",function(M,y,k){if(!y.metadata)return M;M=k.converter._dispatch("metadata.before",M,y,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,y,k),M}),o.subParser("outdent",function(M,y,k){return M=k.converter._dispatch("outdent.before",M,y,k),M=M.replace(/^(\t|[ ]{1,4})/gm,"¨0"),M=M.replace(/¨0/g,""),M=k.converter._dispatch("outdent.after",M,y,k),M}),o.subParser("paragraphs",function(M,y,k){M=k.converter._dispatch("paragraphs.before",M,y,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,y,k),E=E.replace(/^([ \t]*)/g,"

"),E+="

",C.push(E))}for(R=C.length,T=0;T]*>\s*]*>/.test(L)&&(P=!0)}C[T]=L}return M=C.join(` +`),M=M.replace(/^\n+/g,""),M=M.replace(/\n+$/g,""),k.converter._dispatch("paragraphs.after",M,y,k)}),o.subParser("runExtension",function(M,y,k,S){if(M.filter)y=M.filter(y,S.converter,k);else if(M.regex){var C=M.regex;C instanceof RegExp||(C=new RegExp(C,"g")),y=y.replace(C,M.replace)}return y}),o.subParser("spanGamut",function(M,y,k){return M=k.converter._dispatch("spanGamut.before",M,y,k),M=o.subParser("codeSpans")(M,y,k),M=o.subParser("escapeSpecialCharsWithinTagAttributes")(M,y,k),M=o.subParser("encodeBackslashEscapes")(M,y,k),M=o.subParser("images")(M,y,k),M=o.subParser("anchors")(M,y,k),M=o.subParser("autoLinks")(M,y,k),M=o.subParser("simplifiedAutoLinks")(M,y,k),M=o.subParser("emoji")(M,y,k),M=o.subParser("underline")(M,y,k),M=o.subParser("italicsAndBold")(M,y,k),M=o.subParser("strikethrough")(M,y,k),M=o.subParser("ellipsis")(M,y,k),M=o.subParser("hashHTMLSpans")(M,y,k),M=o.subParser("encodeAmpsAndAngles")(M,y,k),y.simpleLineBreaks?/\n\n¨K/.test(M)||(M=M.replace(/\n+/g,`
+`)):M=M.replace(/ +\n/g,`
+`),M=k.converter._dispatch("spanGamut.after",M,y,k),M}),o.subParser("strikethrough",function(M,y,k){function S(C){return y.simplifiedAutoLink&&(C=o.subParser("simplifiedAutoLinks")(C,y,k)),""+C+""}return y.strikethrough&&(M=k.converter._dispatch("strikethrough.before",M,y,k),M=M.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(C,R){return S(R)}),M=k.converter._dispatch("strikethrough.after",M,y,k)),M}),o.subParser("stripLinkDefinitions",function(M,y,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,N,L,P,I,j){return E=E.toLowerCase(),N.match(/^data:.+?\/.+?;base64,/)?k.gUrls[E]=N.replace(/\s/g,""):k.gUrls[E]=o.subParser("encodeAmpsAndAngles")(N,y,k),I?I+j:(j&&(k.gTitles[E]=j.replace(/"|'/g,""")),y.parseImgDimensions&&L&&P&&(k.gDimensions[E]={width:L,height:P}),"")};return M=M.replace(C,R),M=M.replace(S,R),M=M.replace(/¨0/,""),M}),o.subParser("tables",function(M,y,k){if(!y.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(P){return/^:[ \t]*--*$/.test(P)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(P)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(P)?' style="text-align:center;"':""}function T(P,I){var j="";return P=P.trim(),(y.tablesHeaderId||y.tableHeaderId)&&(j=' id="'+P.replace(/ /g,"_").toLowerCase()+'"'),P=o.subParser("spanGamut")(P,y,k),""+P+` +`}function E(P,I){var j=o.subParser("spanGamut")(P,y,k);return""+j+` +`}function N(P,I){for(var j=` + + +`,H=P.length,F=0;F + + +`,F=0;F +`;for(var U=0;U +`}return j+=` +
+`,j}function L(P){var I,j=P.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,y,k)),M}),o.subParser("unescapeSpecialChars",function(M,y,k){return M=k.converter._dispatch("unescapeSpecialChars.before",M,y,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,y,k),M}),o.subParser("makeMarkdown.blockquote",function(M,y){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,y){var k=M.getAttribute("language"),S=M.getAttribute("precodenum");return"```"+k+` +`+y.preList[S]+"\n```"}),o.subParser("makeMarkdown.codeSpan",function(M){return"`"+M.innerHTML+"`"}),o.subParser("makeMarkdown.emphasis",function(M,y){var k="";if(M.hasChildNodes()){k+="*";for(var S=M.childNodes,C=S.length,R=0;R",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 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,y,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 N="";k==="ol"?N=T.toString()+". ":N="- ",S+=N+o.subParser("makeMarkdown.listItem")(C[E],y),++T}return S+=` + +`,S.trim()}),o.subParser("makeMarkdown.listItem",function(M,y){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,y,1)+` + +`);break;case"h2":k||(S=o.subParser("makeMarkdown.header")(M,y,2)+` + +`);break;case"h3":k||(S=o.subParser("makeMarkdown.header")(M,y,3)+` + +`);break;case"h4":k||(S=o.subParser("makeMarkdown.header")(M,y,4)+` + +`);break;case"h5":k||(S=o.subParser("makeMarkdown.header")(M,y,5)+` + +`);break;case"h6":k||(S=o.subParser("makeMarkdown.header")(M,y,6)+` + +`);break;case"p":k||(S=o.subParser("makeMarkdown.paragraph")(M,y)+` + +`);break;case"blockquote":k||(S=o.subParser("makeMarkdown.blockquote")(M,y)+` + +`);break;case"hr":k||(S=o.subParser("makeMarkdown.hr")(M,y)+` + +`);break;case"ol":k||(S=o.subParser("makeMarkdown.list")(M,y,"ol")+` + +`);break;case"ul":k||(S=o.subParser("makeMarkdown.list")(M,y,"ul")+` + +`);break;case"precode":k||(S=o.subParser("makeMarkdown.codeBlock")(M,y)+` + +`);break;case"pre":k||(S=o.subParser("makeMarkdown.pre")(M,y)+` + +`);break;case"table":k||(S=o.subParser("makeMarkdown.table")(M,y)+` + +`);break;case"code":S=o.subParser("makeMarkdown.codeSpan")(M,y);break;case"em":case"i":S=o.subParser("makeMarkdown.emphasis")(M,y);break;case"strong":case"b":S=o.subParser("makeMarkdown.strong")(M,y);break;case"del":S=o.subParser("makeMarkdown.strikethrough")(M,y);break;case"a":S=o.subParser("makeMarkdown.links")(M,y);break;case"img":S=o.subParser("makeMarkdown.image")(M,y);break;default:S=M.outerHTML+` + +`}return S}),o.subParser("makeMarkdown.paragraph",function(M,y){var k="";if(M.hasChildNodes())for(var S=M.childNodes,C=S.length,R=0;R"+y.preList[k]+""}),o.subParser("makeMarkdown.strikethrough",function(M,y){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=U)}for(T=0;T/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(P7e)}(yv)),yv.exports}var I7e=j7e();const D7e=Jr(I7e),F7e=new D7e.Converter({noHeaderId:!0,tables:!0,literalMidWordUnderscores:!0,omitExtraWLInCodeBlocks:!0,simpleLineBreaks:!0,strikethrough:!0});function $7e(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,(t,n,o,r)=>`${n} +${o} +${r}`)}function V7e(e){return e.replace(/(^|\n)•( +)/g,"$1*$2")}function H7e(e){return F7e.makeHtml($7e(V7e(e)))}function U7e(e){if(e.nodeName==="IFRAME"){const t=e.ownerDocument.createTextNode(e.src);e.parentNode.replaceChild(t,e)}}function rie(e){!e.id||e.id.indexOf("docs-internal-guid-")!==0||(e.tagName==="B"?sM(e):e.removeAttribute("id"))}function X7e(e){return e===" "||e==="\r"||e===` +`||e===" "}function sie(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=R4(e,"previous");(!o||o.nodeName==="BR"||o.textContent.slice(-1)===" ")&&(n=n.slice(1))}if(n[n.length-1]===" "){const o=R4(e,"next");(!o||o.nodeName==="BR"||o.nodeType===o.TEXT_NODE&&X7e(o.textContent[0]))&&(n=n.slice(0,-1))}n?e.data=n:e.parentNode.removeChild(e)}function iie(e){e.nodeName==="BR"&&(R4(e,"next")||e.parentNode.removeChild(e))}function G7e(e){e.nodeName==="P"&&(e.hasChildNodes()||e.parentNode.removeChild(e))}function K7e(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 aie=(...e)=>window?.console?.log?.(...e);function VU(e){return e=Qp(e,[eie,rie,tie,Jse,Zse]),e=p8(e,ix("paste"),{inline:!0}),e=Qp(e,[sie,iie]),aie(`Processed inline HTML: + +`,e),e}function Vf({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 D4t(e){const t="";return e.startsWith(t)?e.slice(t.length):e}function uj({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}catch{return}n=I4t(n),n=D4t(n);const o=d4(e);return o.length&&!F4t(o,n)?{files:o}:{html:n,plainText:t,files:[]}}function F4t(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 She=Symbol("requiresWrapperOnCopy");function Che(e,t,n){let o=t;const[r]=t;if(r&&n.select(zt).getBlockType(r.name)[She]){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=ms(o);e.clipboardData.setData("text/plain",V4t(s)),e.clipboardData.setData("text/html",s)}function $4t(e,t){const{plainText:n,html:o,files:r}=uj(e);let s=[];if(r.length){const i=_i("from");s=r.reduce((c,l)=>{const u=fc(i,d=>d.type==="files"&&d.isMatch([l]));return u&&c.push(u.transform([l])),c},[]).flat()}else s=Vf({HTML:o,plainText:n,mode:"BLOCKS",canUserUseUnfilteredHTML:t});return s}function V4t(e){return e=e.replace(/
/g,` +`),ls(e).trim().replace(/\n\n+/g,` + +`)}function H4t(){const e=Gn(),{getBlocksByClientId:t,getSelectedBlockClientIds:n,hasMultiSelection:o,getSettings:r,getBlockName:s,__unstableIsFullySelected:i,__unstableIsSelectionCollapsed:c,__unstableIsSelectionMergeable:l,__unstableGetSelectedBlocksWithPartialSelection:u,canInsertBlockType:d,getBlockRootClientId:p}=K(J),{flashBlock:f,removeBlocks:b,replaceBlocks:h,__unstableDeleteSelection:g,__unstableExpandSelection:O,__unstableSplitSelection:v}=Ae(J),_=lj();return mn(A=>{function M(y){if(y.defaultPrevented)return;const k=n();if(k.length===0)return;if(!o()){const{target:E}=y,{ownerDocument:N}=E;if(y.type==="copy"||y.type==="cut"?i6e(N):a6e(N)&&!N.activeElement.isContentEditable)return}const{activeElement:S}=y.target.ownerDocument;if(!A.contains(S))return;const C=l(),R=c()||i(),T=!R&&!C;if(y.type==="copy"||y.type==="cut")if(y.preventDefault(),k.length===1&&f(k[0]),T)O();else{_(y.type,k);let E;if(R)E=t(k);else{const[N,L]=u(),P=t(k.slice(1,k.length-1));E=[N,...P,L]}Che(y,E,e)}if(y.type==="cut")R&&!T?b(k):(y.target.ownerDocument.activeElement.contentEditable=!1,g());else if(y.type==="paste"){const{__experimentalCanUserUseUnfilteredHTML:E}=r();if(y.clipboardData.getData("rich-text")==="true")return;const{plainText:L,html:P,files:I}=uj(y),j=i();let H=[];if(I.length){const X=_i("from");H=I.reduce((Q,ne)=>{const ae=fc(X,be=>be.type==="files"&&be.isMatch([ne]));return ae&&Q.push(ae.transform([ne])),Q},[]).flat()}else H=Vf({HTML:P,plainText:L,mode:j?"BLOCKS":"AUTO",canUserUseUnfilteredHTML:E});if(typeof H=="string")return;if(j){h(k,H,H.length-1,-1),y.preventDefault();return}if(!o()&&!Et(s(k[0]),"splitting",!1)&&!y.__deprecatedOnSplit)return;const[F]=k,U=p(F),Z=[];for(const X of H)if(d(X.name,U))Z.push(X);else{const Q=s(U),ne=X.name!==Q?Pr(X,Q):[X];if(!ne)return;for(const ae of ne)for(const be of ae.innerBlocks)Z.push(be)}v(Z),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 qhe(){const[e,t,n]=C4t(),o=K(r=>r(J).hasMultiSelection(),[]);return[e,vn([t,H4t(),j4t(),E4t(),L4t(),P4t(),S4t(),T4t(),R4t(),mn(r=>{if(r.tabIndex=0,!!o)return r.classList.add("has-multi-selection"),r.setAttribute("aria-label",m("Multiple selected blocks")),()=>{r.classList.remove("has-multi-selection"),r.removeAttribute("aria-label")}},[o])]),n]}function U4t({children:e,...t},n){const[o,r,s]=qhe();return a.jsxs(a.Fragment,{children:[o,a.jsx("div",{...t,ref:vn([r,n]),className:oe(t.className,"block-editor-writing-flow"),children:e}),s]})}const X4t=x.forwardRef(U4t);let NA=null;function G4t(){return NA||(NA=Array.from(document.styleSheets).reduce((e,t)=>{try{t.cssRules}catch{return e}const{ownerNode:n,cssRules:o}=t;if(n===null||!o||["wp-reset-editor-styles-css","wp-reset-editor-styles-rtl-css"].includes(n.id)||!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},[]),NA)}function Rhe(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 K4t(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];Rhe(c,d,n)},o.addEventListener(i,s[i]);return()=>{for(const i of r)o.removeEventListener(i,s[i])}})}function Y4t({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}=K(de=>{const{getSettings:le}=de(J),ze=le();return{resolvedAssets:ze.__unstableResolvedAssets,isPreviewMode:ze.__unstableIsPreviewMode}},[]),{styles:p="",scripts:f=""}=u,[b,h]=x.useState(),g=x.useRef(),[O,v]=x.useState([]),_=cj(),[A,M,y]=qhe(),[k,{height:S}]=Ns(),[C,{width:R}]=Ns(),T=mn(de=>{de._load=()=>{h(de.contentDocument)};let le;function ze(We){We.preventDefault()}function ye(){const{contentDocument:We,ownerDocument:je}=de,{documentElement:te}=We;le=We,te.classList.add("block-editor-iframe__html"),_(te),v(Array.from(je.body.classList).filter(Oe=>Oe.startsWith("admin-color-")||Oe.startsWith("post-type-")||Oe==="wp-embed-responsive")),We.dir=je.dir;for(const Oe of G4t())We.getElementById(Oe.id)||(We.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));le.addEventListener("dragover",ze,!1),le.addEventListener("drop",ze,!1)}return de.addEventListener("load",ye),()=>{delete de._load,de.removeEventListener("load",ye),le?.removeEventListener("dragover",ze),le?.removeEventListener("drop",ze)}},[]),[E,N]=x.useState(),L=mn(de=>{const le=de.ownerDocument.defaultView;N(le.innerHeight);const ze=()=>{N(le.innerHeight)};return le.addEventListener("resize",ze),()=>{le.removeEventListener("resize",ze)}},[]),[P,I]=x.useState(),j=mn(de=>{const le=de.ownerDocument.defaultView;I(le.innerWidth);const ze=()=>{I(le.innerWidth)};return le.addEventListener("resize",ze),()=>{le.removeEventListener("resize",ze)}},[]),H=o!==1;x.useEffect(()=>{H||(g.current=R)},[R,H]);const F=SB({isDisabled:!s}),U=vn([K4t(b),e,_,M,F,H?L:null]),Z=` + + + + - + +
diff --git a/ios/Sources/GutenbergKit/Gutenberg/remote.html b/ios/Sources/GutenbergKit/Gutenberg/remote.html index eb414073..552466d8 100644 --- a/ios/Sources/GutenbergKit/Gutenberg/remote.html +++ b/ios/Sources/GutenbergKit/Gutenberg/remote.html @@ -7,7 +7,7 @@ content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> Gutenberg - + From eb878ba188c3da10340a228c5a69f2dd2a2963e8 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 27 Jan 2025 16:58:08 -0500 Subject: [PATCH 09/10] refactor: Improve editor exception type safety --- .../GutenbergKit/Sources/EditorViewController.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ios/Sources/GutenbergKit/Sources/EditorViewController.swift b/ios/Sources/GutenbergKit/Sources/EditorViewController.swift index e901a738..c8d54da1 100644 --- a/ios/Sources/GutenbergKit/Sources/EditorViewController.swift +++ b/ios/Sources/GutenbergKit/Sources/EditorViewController.swift @@ -310,10 +310,11 @@ public final class EditorViewController: UIViewController, GutenbergEditorContro self.state.hasRedo = body.hasRedo delegate?.editor(self, didUpdateHistoryState: state) case .onEditorExceptionLogged: - let editorError = GutenbergJSException(from: message.body as! [AnyHashable : Any]) - if let editorError = editorError { - delegate?.editor(self, didLogException: editorError) + guard let exception = message.body as? [String: Any], + let editorException = GutenbergJSException(from: exception) else { + return } + delegate?.editor(self, didLogException: editorException) case .showBlockPicker: showBlockInserter() case .openMediaLibrary: From 7c72b11fd9c4dba754706b4e79325f59b37ea3b6 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 27 Jan 2025 16:58:28 -0500 Subject: [PATCH 10/10] refactor: Rename "error" to "exception" The latter better describes these "handled" errors. --- ios/Sources/GutenbergKit/Sources/EditorJSMessage.swift | 4 ++-- .../GutenbergKit/Sources/EditorViewControllerDelegate.swift | 2 +- src/components/editor/index.jsx | 4 ++-- ...-host-error-logging.js => use-host-exception-logging.js} | 2 +- src/utils/bridge.js | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) rename src/components/editor/{use-host-error-logging.js => use-host-exception-logging.js} (92%) diff --git a/ios/Sources/GutenbergKit/Sources/EditorJSMessage.swift b/ios/Sources/GutenbergKit/Sources/EditorJSMessage.swift index 0c70579a..d20d1212 100644 --- a/ios/Sources/GutenbergKit/Sources/EditorJSMessage.swift +++ b/ios/Sources/GutenbergKit/Sources/EditorJSMessage.swift @@ -29,11 +29,11 @@ struct EditorJSMessage { case onEditorContentChanged /// The editor history (undo, redo) changed. case onEditorHistoryChanged - /// The editor logged an error + /// The editor logged an exception. case onEditorExceptionLogged /// The user tapped the inserter button. case showBlockPicker - /// User requested the Media Library + /// User requested the Media Library. case openMediaLibrary } diff --git a/ios/Sources/GutenbergKit/Sources/EditorViewControllerDelegate.swift b/ios/Sources/GutenbergKit/Sources/EditorViewControllerDelegate.swift index 674a4a75..8f03a7a1 100644 --- a/ios/Sources/GutenbergKit/Sources/EditorViewControllerDelegate.swift +++ b/ios/Sources/GutenbergKit/Sources/EditorViewControllerDelegate.swift @@ -27,7 +27,7 @@ public protocol EditorViewControllerDelegate: AnyObject { /// Notifies the client about new history state. func editor(_ viewController: EditorViewController, didUpdateHistoryState state: EditorState) - /// Notifies the client about an error that occurred during the editor + /// Notifies the client about an exception that occurred during the editor func editor(_ viewController: EditorViewController, didLogException error: GutenbergJSException) func editor(_ viewController: EditorViewController, didRequestMediaFromSiteMediaLibrary config: OpenMediaLibraryAction) diff --git a/src/components/editor/index.jsx b/src/components/editor/index.jsx index 582d33cb..c1192cf0 100644 --- a/src/components/editor/index.jsx +++ b/src/components/editor/index.jsx @@ -14,7 +14,7 @@ import EditorLoadNotice from '../editor-load-notice'; import './style.scss'; import { useSyncHistoryControls } from './use-sync-history-controls'; import { useHostBridge } from './use-host-bridge'; -import { useHostErrorLogging } from './use-host-error-logging'; +import { useHostExceptionLogging } from './use-host-exception-logging'; import { useEditorSetup } from './use-editor-setup'; import { useMediaUpload } from './use-media-upload'; import { useGBKitSettings } from './use-gbkit-settings'; @@ -41,7 +41,7 @@ const { ExperimentalBlockEditorProvider: BlockEditorProvider } = unlock( export default function Editor({ post, children }) { useSyncHistoryControls(); useHostBridge(post); - useHostErrorLogging(); + useHostExceptionLogging(); useEditorSetup(post); useMediaUpload(); diff --git a/src/components/editor/use-host-error-logging.js b/src/components/editor/use-host-exception-logging.js similarity index 92% rename from src/components/editor/use-host-error-logging.js rename to src/components/editor/use-host-exception-logging.js index 5652eb57..4e11c310 100644 --- a/src/components/editor/use-host-error-logging.js +++ b/src/components/editor/use-host-exception-logging.js @@ -9,7 +9,7 @@ import { addAction, removeAction } from '@wordpress/hooks'; */ import { logException } from '../../utils/bridge'; -export function useHostErrorLogging() { +export function useHostExceptionLogging() { useEffect(() => { addAction( 'editor.ErrorBoundary.errorLogged', diff --git a/src/utils/bridge.js b/src/utils/bridge.js index 1fd1e331..bd62a053 100644 --- a/src/utils/bridge.js +++ b/src/utils/bridge.js @@ -183,7 +183,7 @@ export function getPost() { /** * Logs an error to the host app. * - * @param {Error} error The error object to be logged. + * @param {Error} exception The exception object to be logged. * @param {Object} [options] Additional options. * @param {Object} [options.context] Additional context to be logged. * @param {Object} [options.tags] Additional tags to be logged. @@ -193,7 +193,7 @@ export function getPost() { * @return {void} */ export function logException( - error, + exception, { context, tags, isHandled, handledBy } = { context: {}, tags: {}, @@ -202,7 +202,7 @@ export function logException( } ) { const parsedException = { - ...parseException(error, { context, tags }), + ...parseException(exception, { context, tags }), isHandled, handledBy, };