From 552acb5db0335f13e40be85bad03ddcb3044b3bd Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 27 Oct 2023 18:12:14 +0200 Subject: [PATCH] Support class names in editor. --- backend/i18n/frontend_en.json | 2 + backend/i18n/frontend_fr.json | 2 + backend/i18n/frontend_it.json | 2 + backend/i18n/frontend_nl.json | 2 + backend/i18n/frontend_pt.json | 2 + backend/i18n/frontend_zh.json | 2 + backend/i18n/source/frontend_en.json | 2 + .../Schemas/StringFieldProperties.cs | 2 + .../Models/Fields/StringFieldPropertiesDto.cs | 5 + .../Config/IdentityServerServices.cs | 14 + .../Squidex/wwwroot/editor/squidex-editor.css | 2 +- .../Squidex/wwwroot/editor/squidex-editor.js | 250 +++++++++--------- frontend/src/app/declarations.d.ts | 3 + .../shared/forms/field-editor.component.html | 2 + .../fields/types/string-ui.component.html | 12 + .../fields/types/string-ui.component.ts | 4 + .../components/forms/rich-editor.component.ts | 6 +- .../src/app/shared/services/schemas.types.ts | 1 + .../src/app/shared/state/schemas.forms.ts | 1 + 19 files changed, 196 insertions(+), 120 deletions(-) diff --git a/backend/i18n/frontend_en.json b/backend/i18n/frontend_en.json index 7fab77ed4a..0f002690e8 100644 --- a/backend/i18n/frontend_en.json +++ b/backend/i18n/frontend_en.json @@ -921,6 +921,8 @@ "schemas.fieldTypes.string.characters": "Characters", "schemas.fieldTypes.string.charactersMax": "Max Characters", "schemas.fieldTypes.string.charactersMin": "Min Characters", + "schemas.fieldTypes.string.classNames": "Class Names", + "schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.", "schemas.fieldTypes.string.contentType": "Content Type", "schemas.fieldTypes.string.description": "Titles, names, paragraphs.", "schemas.fieldTypes.string.folderId": "Asset folder", diff --git a/backend/i18n/frontend_fr.json b/backend/i18n/frontend_fr.json index 2f9cdd0380..c8411c57d6 100644 --- a/backend/i18n/frontend_fr.json +++ b/backend/i18n/frontend_fr.json @@ -921,6 +921,8 @@ "schemas.fieldTypes.string.characters": "Personnages", "schemas.fieldTypes.string.charactersMax": "Caractères maximum", "schemas.fieldTypes.string.charactersMin": "Caractères minimum", + "schemas.fieldTypes.string.classNames": "Class Names", + "schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.", "schemas.fieldTypes.string.contentType": "Type de contenu", "schemas.fieldTypes.string.description": "Titres, noms, paragraphes.", "schemas.fieldTypes.string.folderId": "Dossier d'actifs", diff --git a/backend/i18n/frontend_it.json b/backend/i18n/frontend_it.json index 179ed7e6ff..233a4352ca 100644 --- a/backend/i18n/frontend_it.json +++ b/backend/i18n/frontend_it.json @@ -921,6 +921,8 @@ "schemas.fieldTypes.string.characters": "Caratteri", "schemas.fieldTypes.string.charactersMax": "Max numero di Caratteri", "schemas.fieldTypes.string.charactersMin": "Min numero di Caratteri", + "schemas.fieldTypes.string.classNames": "Class Names", + "schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.", "schemas.fieldTypes.string.contentType": "Content Type", "schemas.fieldTypes.string.description": "Titoli, nomi, paragrafi.", "schemas.fieldTypes.string.folderId": "Asset folder", diff --git a/backend/i18n/frontend_nl.json b/backend/i18n/frontend_nl.json index 9150864401..0a15099fcd 100644 --- a/backend/i18n/frontend_nl.json +++ b/backend/i18n/frontend_nl.json @@ -921,6 +921,8 @@ "schemas.fieldTypes.string.characters": "Karakters", "schemas.fieldTypes.string.charactersMax": "Max. karakters", "schemas.fieldTypes.string.charactersMin": "Min. karakters", + "schemas.fieldTypes.string.classNames": "Class Names", + "schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.", "schemas.fieldTypes.string.contentType": "Inhoudstype", "schemas.fieldTypes.string.description": "Titels, namen, alinea's.", "schemas.fieldTypes.string.folderId": "Documenten map", diff --git a/backend/i18n/frontend_pt.json b/backend/i18n/frontend_pt.json index d65e2eb7f0..559412548f 100644 --- a/backend/i18n/frontend_pt.json +++ b/backend/i18n/frontend_pt.json @@ -921,6 +921,8 @@ "schemas.fieldTypes.string.characters": "Personagens", "schemas.fieldTypes.string.charactersMax": "Personagens Max", "schemas.fieldTypes.string.charactersMin": "Personagens de Min", + "schemas.fieldTypes.string.classNames": "Class Names", + "schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.", "schemas.fieldTypes.string.contentType": "Tipo de Conteúdo", "schemas.fieldTypes.string.description": "Títulos, nomes, parágrafos.", "schemas.fieldTypes.string.folderId": "Pasta de ativos", diff --git a/backend/i18n/frontend_zh.json b/backend/i18n/frontend_zh.json index 8c7278a1c1..6816f8f032 100644 --- a/backend/i18n/frontend_zh.json +++ b/backend/i18n/frontend_zh.json @@ -921,6 +921,8 @@ "schemas.fieldTypes.string.characters": "字符", "schemas.fieldTypes.string.charactersMax": "最大字符数", "schemas.fieldTypes.string.charactersMin": "最小字符数", + "schemas.fieldTypes.string.classNames": "Class Names", + "schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.", "schemas.fieldTypes.string.contentType": "内容类型", "schemas.fieldTypes.string.description": "标题、名称、段落。", "schemas.fieldTypes.string.folderId": "资源文件夹", diff --git a/backend/i18n/source/frontend_en.json b/backend/i18n/source/frontend_en.json index 7fab77ed4a..0f002690e8 100644 --- a/backend/i18n/source/frontend_en.json +++ b/backend/i18n/source/frontend_en.json @@ -921,6 +921,8 @@ "schemas.fieldTypes.string.characters": "Characters", "schemas.fieldTypes.string.charactersMax": "Max Characters", "schemas.fieldTypes.string.charactersMin": "Min Characters", + "schemas.fieldTypes.string.classNames": "Class Names", + "schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.", "schemas.fieldTypes.string.contentType": "Content Type", "schemas.fieldTypes.string.description": "Titles, names, paragraphs.", "schemas.fieldTypes.string.folderId": "Asset folder", diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/StringFieldProperties.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/StringFieldProperties.cs index 11448b2541..817af70baf 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/StringFieldProperties.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/StringFieldProperties.cs @@ -14,6 +14,8 @@ public sealed record StringFieldProperties : FieldProperties { public ReadonlyList? AllowedValues { get; init; } + public ReadonlyList? ClassNames { get; set; } + public LocalizedValue DefaultValues { get; init; } public string? DefaultValue { get; init; } diff --git a/backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/Fields/StringFieldPropertiesDto.cs b/backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/Fields/StringFieldPropertiesDto.cs index 3da6a0f4f1..7de5d52a1f 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/Fields/StringFieldPropertiesDto.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/Fields/StringFieldPropertiesDto.cs @@ -71,6 +71,11 @@ public sealed class StringFieldPropertiesDto : FieldPropertiesDto /// public int? MaxWords { get; set; } + /// + /// The class names for the editor. + /// + public ReadonlyList? ClassNames { get; set; } + /// /// The allowed values for the field value. /// diff --git a/backend/src/Squidex/Areas/IdentityServer/Config/IdentityServerServices.cs b/backend/src/Squidex/Areas/IdentityServer/Config/IdentityServerServices.cs index c25e7736e1..79d356fa39 100644 --- a/backend/src/Squidex/Areas/IdentityServer/Config/IdentityServerServices.cs +++ b/backend/src/Squidex/Areas/IdentityServer/Config/IdentityServerServices.cs @@ -81,6 +81,12 @@ public static void AddSquidexIdentityServer(this IServiceCollection services) }) .AddServer(builder => { + builder.AddEventHandler(builder => + { + builder.UseSingletonHandler() + .SetOrder(int.MinValue); + }); + builder.AddEventHandler(builder => { builder.UseSingletonHandler() @@ -171,3 +177,11 @@ private static void SetEndpoint(this List endpointUris, Uri uri) endpointUris.Add(uri); } } + +public sealed class TestHandler : IOpenIddictServerHandler +{ + public ValueTask HandleAsync(ValidateTokenRequestContext context) + { + return default; + } +} diff --git a/backend/src/Squidex/wwwroot/editor/squidex-editor.css b/backend/src/Squidex/wwwroot/editor/squidex-editor.css index e54155e927..f1bd3efb45 100644 --- a/backend/src/Squidex/wwwroot/editor/squidex-editor.css +++ b/backend/src/Squidex/wwwroot/editor/squidex-editor.css @@ -1 +1 @@ -.remirror-theme{width:100%}.remirror-theme{position:relative}.remirror-theme *{box-sizing:border-box}.remirror-editor{min-height:300px!important;max-height:500px}.MuiStack-root{padding:5px}.MuiStack-root>.MuiBox-root{margin-right:5px}.MuiBox-root>.MuiButtonBase-root{border-color:#dedfe3!important;border-radius:0}.MuiBox-root>.MuiButtonBase-root{border-left-width:0}.MuiBox-root>.MuiBox-root:first-child>.MuiButtonBase-root{border-left-width:1px}.MuiButtonBase-root.Mui-selected:hover{background-color:#3284f4!important}.remirror-editor-wrapper{padding-top:0!important}.custom-icon path{fill:#0000008a}.remirror-theme div.ProseMirror{border:1px solid #dedfe3!important;border-radius:0!important;box-shadow:none!important}.MuiTooltip-popper>div{background-color:#1a2129;border-radius:0;font-size:85%;font-weight:400;padding:.5rem}.squidex-editor-disabled{pointer-events:none}.squidex-editor-menu{border:1px solid #dedfe3;border-bottom:0}.squidex-editor-counter{border:1px solid #dedfe3;border-top:0;font-size:85%;font-weight:400;opacity:.8;padding:4px 10px 4px 4px;text-align:right}.squidex-editor-image-view{border:1px solid #dedfe3;border-radius:0;display:inline-block;margin-top:15px;margin-bottom:15px;overflow:hidden}.squidex-editor-image-view .squidex-editor-button{bottom:10px;left:10px;position:absolute}.squidex-editor-image-element{display:block;max-width:400px;max-height:400px}.squidex-editor-image-info{left:10px;top:10px;position:absolute;background-color:#3284f4;color:#fff;font-size:85%;font-weight:400;padding:2px 6px}.squidex-editor-content-link{align-items:center;border-radius:2px;border:1px solid #dedfe3;padding:10px;display:flex;flex-direction:row;flex-wrap:nowrap;margin-top:10px;margin-bottom:10px}.squidex-editor-content-schema{display:block;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;min-width:0;width:auto;border-right:1px solid #c2c4cc;color:#8b8f9d;flex-shrink:0;padding-left:10px;padding-right:10px;width:200px}.squidex-editor-content-name{display:block;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;min-width:0;width:auto;padding-left:10px;padding-right:0}.squidex-editor-html{margin-bottom:10px;margin-top:10px;position:relative}.squidex-editor-html-label{left:6px;top:0;position:absolute;color:#8b8f9d;font-size:85%;font-weight:400}.squidex-editor-html textarea{font-family:monospace;padding:30px 20px 20px}.squidex-editor-button{background-color:#fff;border-radius:0;border:1px solid #dedfe3;bottom:10px;font-size:85%;font-weight:400;line-height:1;padding:6px 12px}.squidex-editor-button:hover{background-color:#f5f5f5}.squidex-editor-input{border:1px solid #dedfe3;border-radius:0;box-sizing:border-box;height:30px;margin-left:0;margin-right:5px;outline:none;padding:6px 12px}.squidex-editor-input:active{border-color:#3284f4}.squidex-editor-floating{border:1px solid #dedfe3}.squidex-editor-floating .MuiBox-root{margin-right:0!important}.squidex-editor-floating .MuiButtonBase-root{height:30px}.squidex-editor-modal-wrapper,.squidex-editor-modal-backdrop{bottom:0;left:0;right:0;top:0;position:absolute}.squidex-editor-modal-backdrop{background-color:#00000003}.squidex-editor-modal-window{left:50%;top:50%;background-color:#fff;border:1px solid #dedfe3;border-radius:0;box-sizing:border-box;margin-top:-50px;margin-left:-150px;position:absolute;width:350px}.squidex-editor-modal-body{display:flex;flex-direction:row;flex-grow:1;padding-top:0!important}.squidex-editor-modal-body,.squidex-editor-modal-title{padding:15px}.squidex-editor-modal-title{font-size:85%}.squidex-editor-modal-window input{flex-grow:1} +.remirror-theme{width:100%}.remirror-theme{position:relative}.remirror-theme *{box-sizing:border-box}.remirror-editor{min-height:300px!important;max-height:500px}.MuiStack-root>.MuiBox-root{margin-right:5px}.MuiBox-root>.MuiButtonBase-root{border-color:#dedfe3!important;border-radius:0}.MuiBox-root>.MuiButtonBase-root{border-left-width:0!important}.MuiBox-root>.MuiBox-root:first-child>.MuiButtonBase-root{border-left-width:1px!important}.MuiStack-root>.MuiBox-root>.MuiButtonBase-root:first-child{border-left-width:1px!important}.MuiButtonBase-root.Mui-selected:hover{background-color:#3284f4!important}.remirror-editor-wrapper{padding-top:0!important}.custom-icon path{fill:#0000008a}.remirror-theme div.ProseMirror{border:1px solid #dedfe3!important;border-radius:0!important;box-shadow:none!important}.MuiTooltip-popper>div{background-color:#1a2129;border-radius:0;font-size:85%;font-weight:400;padding:.5rem}.MuiMenu-paper{transform:none!important}.squidex-editor-disabled{pointer-events:none}.squidex-editor-menu{border:1px solid #dedfe3;border-bottom:0;padding:5px}.squidex-editor-counter{border:1px solid #dedfe3;border-top:0;font-size:85%;font-weight:400;opacity:.8;padding:4px 10px 4px 4px;text-align:right}.squidex-editor-image-view{border:1px solid #dedfe3;border-radius:0;display:inline-block;margin-top:15px;margin-bottom:15px;overflow:hidden}.squidex-editor-image-view .squidex-editor-button{bottom:10px;left:10px;position:absolute}.squidex-editor-image-element{display:block;max-width:400px;max-height:400px}.squidex-editor-image-info{left:10px;top:10px;position:absolute;background-color:#3284f4;color:#fff;font-size:85%;font-weight:400;padding:2px 6px}.squidex-editor-content-link{align-items:center;border-radius:2px;border:1px solid #dedfe3;padding:10px;display:flex;flex-direction:row;flex-wrap:nowrap;margin-top:10px;margin-bottom:10px}.squidex-editor-content-schema{display:block;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;min-width:0;width:auto;border-right:1px solid #c2c4cc;color:#8b8f9d;flex-shrink:0;padding-left:10px;padding-right:10px;width:200px}.squidex-editor-content-name{display:block;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;min-width:0;width:auto;padding-left:10px;padding-right:0}.squidex-editor-html{margin-bottom:10px;margin-top:10px;position:relative}.squidex-editor-html-label{left:6px;top:0;position:absolute;color:#8b8f9d;font-size:85%;font-weight:400}.squidex-editor-html textarea{font-family:monospace;padding:30px 20px 20px}.squidex-editor-button{background-color:#fff;border-radius:0;border:1px solid #dedfe3;bottom:10px;font-size:85%;font-weight:400;line-height:1;padding:6px 12px}.squidex-editor-button:hover{background-color:#f5f5f5}.squidex-editor-input{border:1px solid #dedfe3;border-radius:0;box-sizing:border-box;height:30px;margin-left:0;margin-right:5px;outline:none;padding:6px 12px}.squidex-editor-input:active{border-color:#3284f4}.squidex-editor-floating{border:1px solid #dedfe3}.squidex-editor-floating .MuiBox-root{margin-right:0!important}.squidex-editor-floating .MuiButtonBase-root{height:30px}.squidex-editor-modal-wrapper,.squidex-editor-modal-backdrop{bottom:0;left:0;right:0;top:0;position:absolute}.squidex-editor-modal-backdrop{background-color:#00000003}.squidex-editor-modal-window{left:50%;top:50%;background-color:#fff;border:0;border-radius:.25rem;box-sizing:border-box;box-shadow:0 3px 16px #0003;margin-top:-50px;margin-left:-150px;position:absolute;width:350px}.squidex-editor-modal-body{display:flex;flex-direction:row;flex-grow:1;padding-top:0!important}.squidex-editor-modal-body,.squidex-editor-modal-title{padding:15px}.squidex-editor-modal-title{font-size:85%}.squidex-editor-modal-window input{flex-grow:1}.b:before{content:"";font-family:monospace;font-size:90%}.b:after{content:"";font-family:monospace;font-size:90%} diff --git a/backend/src/Squidex/wwwroot/editor/squidex-editor.js b/backend/src/Squidex/wwwroot/editor/squidex-editor.js index 14ea1cc922..aec7c0e7e0 100644 --- a/backend/src/Squidex/wwwroot/editor/squidex-editor.js +++ b/backend/src/Squidex/wwwroot/editor/squidex-editor.js @@ -1,4 +1,4 @@ -var ZO=Object.defineProperty;var e_=(e,t,r)=>t in e?ZO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var gc=(e,t,r)=>(e_(e,typeof t!="symbol"?t+"":t,r),r);function t_(e,t){for(var r=0;rn[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}})();var Ru=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ln(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var S4={exports:{}},Mh={},E4={exports:{}},we={};/** +var s_=Object.defineProperty;var a_=(e,t,r)=>t in e?s_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var vc=(e,t,r)=>(a_(e,typeof t!="symbol"?t+"":t,r),r);function l_(e,t){for(var r=0;rn[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}})();var Pu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var T4={exports:{}},_h={},O4={exports:{}},we={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var ZO=Object.defineProperty;var e_=(e,t,r)=>t in e?ZO(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Td=Symbol.for("react.element"),r_=Symbol.for("react.portal"),n_=Symbol.for("react.fragment"),o_=Symbol.for("react.strict_mode"),i_=Symbol.for("react.profiler"),s_=Symbol.for("react.provider"),a_=Symbol.for("react.context"),l_=Symbol.for("react.forward_ref"),c_=Symbol.for("react.suspense"),u_=Symbol.for("react.memo"),d_=Symbol.for("react.lazy"),Fx=Symbol.iterator;function f_(e){return e===null||typeof e!="object"?null:(e=Fx&&e[Fx]||e["@@iterator"],typeof e=="function"?e:null)}var C4={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M4=Object.assign,T4={};function ec(e,t,r){this.props=e,this.context=t,this.refs=T4,this.updater=r||C4}ec.prototype.isReactComponent={};ec.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};ec.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function O4(){}O4.prototype=ec.prototype;function hv(e,t,r){this.props=e,this.context=t,this.refs=T4,this.updater=r||C4}var mv=hv.prototype=new O4;mv.constructor=hv;M4(mv,ec.prototype);mv.isPureReactComponent=!0;var Vx=Array.isArray,_4=Object.prototype.hasOwnProperty,gv={current:null},A4={key:!0,ref:!0,__self:!0,__source:!0};function N4(e,t,r){var n,o={},i=null,s=null;if(t!=null)for(n in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)_4.call(t,n)&&!A4.hasOwnProperty(n)&&(o[n]=t[n]);var a=arguments.length-2;if(a===1)o.children=r;else if(1t in e?ZO(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var v_=S,y_=Symbol.for("react.element"),b_=Symbol.for("react.fragment"),x_=Object.prototype.hasOwnProperty,k_=v_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,w_={key:!0,ref:!0,__self:!0,__source:!0};function R4(e,t,r){var n,o={},i=null,s=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(n in t)x_.call(t,n)&&!w_.hasOwnProperty(n)&&(o[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)o[n]===void 0&&(o[n]=t[n]);return{$$typeof:y_,type:e,key:i,ref:s,props:o,_owner:k_.current}}Mh.Fragment=b_;Mh.jsx=R4;Mh.jsxs=R4;S4.exports=Mh;var O=S4.exports,y1={exports:{}};(function(e,t){var r=typeof Reflect<"u"?Reflect.construct:void 0,n=Object.defineProperty,o=Error.captureStackTrace;o===void 0&&(o=function(c){var u=new Error;n(c,"stack",{configurable:!0,get:function(){var f=u.stack;return n(this,"stack",{configurable:!0,value:f,writable:!0}),f},set:function(f){n(c,"stack",{configurable:!0,value:f,writable:!0})}})});function i(l){l!==void 0&&n(this,"message",{configurable:!0,value:l,writable:!0});var c=this.constructor.name;c!==void 0&&c!==this.name&&n(this,"name",{configurable:!0,value:c,writable:!0}),o(this,this.constructor)}i.prototype=Object.create(Error.prototype,{constructor:{configurable:!0,value:i,writable:!0}});var s=function(){function l(u,d){return n(u,"name",{configurable:!0,value:d})}try{var c=function(){};if(l(c,"foo"),c.name==="foo")return l}catch{}}();function a(l,c){if(c==null||c===Error)c=i;else if(typeof c!="function")throw new TypeError("super_ should be a function");var u;if(typeof l=="string")u=l,l=r!==void 0?function(){return r(c,arguments,this.constructor)}:function(){c.apply(this,arguments)},s!==void 0&&(s(l,u),u=void 0);else if(typeof l!="function")throw new TypeError("constructor should be either a string or a function");l.super_=l.super=c;var d={constructor:{configurable:!0,value:l,writable:!0}};return u!==void 0&&(d.name={configurable:!0,value:u,writable:!0}),l.prototype=Object.create(c.prototype,d),l}t=e.exports=a,t.BaseError=i})(y1,y1.exports);var P4=y1.exports,Ux="ProseMirror-selectednode",yv="",zi="\0",Wx="__state_override__",S_={LastNodeCompatible:"lastNodeCompatible",FormattingMark:"formattingMark",FormattingNode:"formattingNode",NodeCursor:"nodeCursor",FontStyle:"fontStyle",Link:"link",Color:"color",Alignment:"alignment",Indentation:"indentation",Behavior:"behavior",Code:"code",InlineNode:"inline",ListContainerNode:"listContainer",ListItemNode:"listItemNode",Block:"block",BlockNode:"block",TextBlock:"textBlock",ExcludeInputRules:"excludeFromInputRules",PreventExits:"preventsExits",Media:"media"},oe=S_,ti=Symbol.for("__remirror__"),$t=(e=>(e.PlainExtension="RemirrorPlainExtension",e.NodeExtension="RemirrorNodeExtension",e.MarkExtension="RemirrorMarkExtension",e.PlainExtensionConstructor="RemirrorPlainExtensionConstructor",e.NodeExtensionConstructor="RemirrorNodeExtensionConstructor",e.MarkExtensionConstructor="RemirrorMarkExtensionConstructor",e.Manager="RemirrorManager",e.Preset="RemirrorPreset",e.PresetConstructor="RemirrorPresetConstructor",e))($t||{}),Ae=(e=>(e[e.Critical=1e6]="Critical",e[e.Highest=1e5]="Highest",e[e.High=1e4]="High",e[e.Medium=1e3]="Medium",e[e.Default=100]="Default",e[e.Low=10]="Low",e[e.Lowest=0]="Lowest",e))(Ae||{}),Nr=(e=>(e[e.None=0]="None",e[e.Create=1]="Create",e[e.EditorView=2]="EditorView",e[e.Runtime=3]="Runtime",e[e.Destroy=4]="Destroy",e))(Nr||{}),D=(e=>(e.Undo="_|undo|_",e.Redo="_|redo|_",e.Bold="_|bold|_",e.Italic="_|italic|_",e.Underline="_|underline|_",e.Strike="_|strike|_",e.Code="_|code|_",e.Paragraph="_|paragraph|_",e.H1="_|h1|_",e.H2="_|h2|_",e.H3="_|h3|_",e.H4="_|h4|_",e.H5="_|h5|_",e.H6="_|h6|_",e.TaskList="_|task|_",e.BulletList="_|bullet|_",e.OrderedList="_|number|_",e.Quote="_|quote|_",e.Divider="_|divider|_",e.Codeblock="_|codeblock|_",e.ClearFormatting="_|clear|_",e.Superscript="_|sup|_",e.Subscript="_|sub|_",e.LeftAlignment="_|left-align|_",e.CenterAlignment="_|center-align|_",e.RightAlignment="_|right-align|_",e.JustifyAlignment="_|justify-align|_",e.InsertLink="_|link|_",e.Find="_|find|_",e.FindBackwards="_|find-backwards|_",e.FindReplace="_|find-replace|_",e.AddFootnote="_|footnote|_",e.AddComment="_|comment|_",e.ContextMenu="_|context-menu|_",e.IncreaseFontSize="_|inc-font-size|_",e.DecreaseFontSize="_|dec-font-size|_",e.IncreaseIndent="_|indent|_",e.DecreaseIndent="_|dedent|_",e.Shortcuts="_|shortcuts|_",e.Copy="_|copy|_",e.Cut="_|cut|_",e.Paste="_|paste|_",e.PastePlain="_|paste-plain|_",e.SelectAll="_|select-all|_",e.Format="_|format|_",e))(D||{}),H=(e=>(e.PROD="RMR0000",e.UNKNOWN="RMR0001",e.INVALID_COMMAND_ARGUMENTS="RMR0002",e.CUSTOM="RMR0003",e.CORE_HELPERS="RMR0004",e.MUTATION="RMR0005",e.INTERNAL="RMR0006",e.MISSING_REQUIRED_EXTENSION="RMR0007",e.MANAGER_PHASE_ERROR="RMR0008",e.INVALID_GET_EXTENSION="RMR0010",e.INVALID_MANAGER_ARGUMENTS="RMR0011",e.SCHEMA="RMR0012",e.HELPERS_CALLED_IN_OUTER_SCOPE="RMR0013",e.INVALID_MANAGER_EXTENSION="RMR0014",e.DUPLICATE_COMMAND_NAMES="RMR0016",e.DUPLICATE_HELPER_NAMES="RMR0017",e.NON_CHAINABLE_COMMAND="RMR0018",e.INVALID_EXTENSION="RMR0019",e.INVALID_CONTENT="RMR0021",e.INVALID_NAME="RMR0050",e.EXTENSION="RMR0100",e.EXTENSION_SPEC="RMR0101",e.EXTENSION_EXTRA_ATTRIBUTES="RMR0102",e.INVALID_SET_EXTENSION_OPTIONS="RMR0103",e.REACT_PROVIDER_CONTEXT="RMR0200",e.REACT_GET_ROOT_PROPS="RMR0201",e.REACT_EDITOR_VIEW="RMR0202",e.REACT_CONTROLLED="RMR0203",e.REACT_NODE_VIEW="RMR0204",e.REACT_GET_CONTEXT="RMR0205",e.REACT_COMPONENTS="RMR0206",e.REACT_HOOKS="RMR0207",e.I18N_CONTEXT="RMR0300",e))(H||{}),E_=function(t){return C_(t)&&!M_(t)};function C_(e){return!!e&&typeof e=="object"}function M_(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||__(e)}var T_=typeof Symbol=="function"&&Symbol.for,O_=T_?Symbol.for("react.element"):60103;function __(e){return e.$$typeof===O_}function A_(e){return Array.isArray(e)?[]:{}}function Pu(e,t){return t.clone!==!1&&t.isMergeableObject(e)?El(A_(e),e,t):e}function N_(e,t,r){return e.concat(t).map(function(n){return Pu(n,r)})}function R_(e,t){if(!t.customMerge)return El;var r=t.customMerge(e);return typeof r=="function"?r:El}function P_(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Kx(e){return Object.keys(e).concat(P_(e))}function z4(e,t){try{return t in e}catch{return!1}}function z_(e,t){return z4(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function L_(e,t,r){var n={};return r.isMergeableObject(e)&&Kx(e).forEach(function(o){n[o]=Pu(e[o],r)}),Kx(t).forEach(function(o){z_(e,o)||(z4(e,o)&&r.isMergeableObject(t[o])?n[o]=R_(o,r)(e[o],t[o],r):n[o]=Pu(t[o],r))}),n}function El(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||N_,r.isMergeableObject=r.isMergeableObject||E_,r.cloneUnlessOtherwiseSpecified=Pu;var n=Array.isArray(t),o=Array.isArray(e),i=n===o;return i?n?r.arrayMerge(e,t,r):L_(e,t,r):Pu(t,r)}El.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,o){return El(n,o,r)},{})};var I_=El,D_=I_;const $_=Ln(D_);var H_=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r};const B_=Ln(H_);/*! + */var E_=S,C_=Symbol.for("react.element"),M_=Symbol.for("react.fragment"),T_=Object.prototype.hasOwnProperty,O_=E_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,__={key:!0,ref:!0,__self:!0,__source:!0};function I4(e,t,r){var n,o={},i=null,s=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(n in t)T_.call(t,n)&&!__.hasOwnProperty(n)&&(o[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)o[n]===void 0&&(o[n]=t[n]);return{$$typeof:C_,type:e,key:i,ref:s,props:o,_owner:O_.current}}_h.Fragment=M_;_h.jsx=I4;_h.jsxs=I4;T4.exports=_h;var O=T4.exports,k1={exports:{}};(function(e,t){var r=typeof Reflect<"u"?Reflect.construct:void 0,n=Object.defineProperty,o=Error.captureStackTrace;o===void 0&&(o=function(c){var u=new Error;n(c,"stack",{configurable:!0,get:function(){var f=u.stack;return n(this,"stack",{configurable:!0,value:f,writable:!0}),f},set:function(f){n(c,"stack",{configurable:!0,value:f,writable:!0})}})});function i(l){l!==void 0&&n(this,"message",{configurable:!0,value:l,writable:!0});var c=this.constructor.name;c!==void 0&&c!==this.name&&n(this,"name",{configurable:!0,value:c,writable:!0}),o(this,this.constructor)}i.prototype=Object.create(Error.prototype,{constructor:{configurable:!0,value:i,writable:!0}});var s=function(){function l(u,d){return n(u,"name",{configurable:!0,value:d})}try{var c=function(){};if(l(c,"foo"),c.name==="foo")return l}catch{}}();function a(l,c){if(c==null||c===Error)c=i;else if(typeof c!="function")throw new TypeError("super_ should be a function");var u;if(typeof l=="string")u=l,l=r!==void 0?function(){return r(c,arguments,this.constructor)}:function(){c.apply(this,arguments)},s!==void 0&&(s(l,u),u=void 0);else if(typeof l!="function")throw new TypeError("constructor should be either a string or a function");l.super_=l.super=c;var d={constructor:{configurable:!0,value:l,writable:!0}};return u!==void 0&&(d.name={configurable:!0,value:u,writable:!0}),l.prototype=Object.create(c.prototype,d),l}t=e.exports=a,t.BaseError=i})(k1,k1.exports);var D4=k1.exports,qx="ProseMirror-selectednode",kv="",zi="\0",Gx="__state_override__",A_={LastNodeCompatible:"lastNodeCompatible",FormattingMark:"formattingMark",FormattingNode:"formattingNode",NodeCursor:"nodeCursor",FontStyle:"fontStyle",Link:"link",Color:"color",Alignment:"alignment",Indentation:"indentation",Behavior:"behavior",Code:"code",InlineNode:"inline",ListContainerNode:"listContainer",ListItemNode:"listItemNode",Block:"block",BlockNode:"block",TextBlock:"textBlock",ExcludeInputRules:"excludeFromInputRules",PreventExits:"preventsExits",Media:"media"},oe=A_,ti=Symbol.for("__remirror__"),$t=(e=>(e.PlainExtension="RemirrorPlainExtension",e.NodeExtension="RemirrorNodeExtension",e.MarkExtension="RemirrorMarkExtension",e.PlainExtensionConstructor="RemirrorPlainExtensionConstructor",e.NodeExtensionConstructor="RemirrorNodeExtensionConstructor",e.MarkExtensionConstructor="RemirrorMarkExtensionConstructor",e.Manager="RemirrorManager",e.Preset="RemirrorPreset",e.PresetConstructor="RemirrorPresetConstructor",e))($t||{}),Ae=(e=>(e[e.Critical=1e6]="Critical",e[e.Highest=1e5]="Highest",e[e.High=1e4]="High",e[e.Medium=1e3]="Medium",e[e.Default=100]="Default",e[e.Low=10]="Low",e[e.Lowest=0]="Lowest",e))(Ae||{}),Nr=(e=>(e[e.None=0]="None",e[e.Create=1]="Create",e[e.EditorView=2]="EditorView",e[e.Runtime=3]="Runtime",e[e.Destroy=4]="Destroy",e))(Nr||{}),D=(e=>(e.Undo="_|undo|_",e.Redo="_|redo|_",e.Bold="_|bold|_",e.Italic="_|italic|_",e.Underline="_|underline|_",e.Strike="_|strike|_",e.Code="_|code|_",e.Paragraph="_|paragraph|_",e.H1="_|h1|_",e.H2="_|h2|_",e.H3="_|h3|_",e.H4="_|h4|_",e.H5="_|h5|_",e.H6="_|h6|_",e.TaskList="_|task|_",e.BulletList="_|bullet|_",e.OrderedList="_|number|_",e.Quote="_|quote|_",e.Divider="_|divider|_",e.Codeblock="_|codeblock|_",e.ClearFormatting="_|clear|_",e.Superscript="_|sup|_",e.Subscript="_|sub|_",e.LeftAlignment="_|left-align|_",e.CenterAlignment="_|center-align|_",e.RightAlignment="_|right-align|_",e.JustifyAlignment="_|justify-align|_",e.InsertLink="_|link|_",e.Find="_|find|_",e.FindBackwards="_|find-backwards|_",e.FindReplace="_|find-replace|_",e.AddFootnote="_|footnote|_",e.AddComment="_|comment|_",e.ContextMenu="_|context-menu|_",e.IncreaseFontSize="_|inc-font-size|_",e.DecreaseFontSize="_|dec-font-size|_",e.IncreaseIndent="_|indent|_",e.DecreaseIndent="_|dedent|_",e.Shortcuts="_|shortcuts|_",e.Copy="_|copy|_",e.Cut="_|cut|_",e.Paste="_|paste|_",e.PastePlain="_|paste-plain|_",e.SelectAll="_|select-all|_",e.Format="_|format|_",e))(D||{}),H=(e=>(e.PROD="RMR0000",e.UNKNOWN="RMR0001",e.INVALID_COMMAND_ARGUMENTS="RMR0002",e.CUSTOM="RMR0003",e.CORE_HELPERS="RMR0004",e.MUTATION="RMR0005",e.INTERNAL="RMR0006",e.MISSING_REQUIRED_EXTENSION="RMR0007",e.MANAGER_PHASE_ERROR="RMR0008",e.INVALID_GET_EXTENSION="RMR0010",e.INVALID_MANAGER_ARGUMENTS="RMR0011",e.SCHEMA="RMR0012",e.HELPERS_CALLED_IN_OUTER_SCOPE="RMR0013",e.INVALID_MANAGER_EXTENSION="RMR0014",e.DUPLICATE_COMMAND_NAMES="RMR0016",e.DUPLICATE_HELPER_NAMES="RMR0017",e.NON_CHAINABLE_COMMAND="RMR0018",e.INVALID_EXTENSION="RMR0019",e.INVALID_CONTENT="RMR0021",e.INVALID_NAME="RMR0050",e.EXTENSION="RMR0100",e.EXTENSION_SPEC="RMR0101",e.EXTENSION_EXTRA_ATTRIBUTES="RMR0102",e.INVALID_SET_EXTENSION_OPTIONS="RMR0103",e.REACT_PROVIDER_CONTEXT="RMR0200",e.REACT_GET_ROOT_PROPS="RMR0201",e.REACT_EDITOR_VIEW="RMR0202",e.REACT_CONTROLLED="RMR0203",e.REACT_NODE_VIEW="RMR0204",e.REACT_GET_CONTEXT="RMR0205",e.REACT_COMPONENTS="RMR0206",e.REACT_HOOKS="RMR0207",e.I18N_CONTEXT="RMR0300",e))(H||{}),N_=function(t){return R_(t)&&!P_(t)};function R_(e){return!!e&&typeof e=="object"}function P_(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||I_(e)}var z_=typeof Symbol=="function"&&Symbol.for,L_=z_?Symbol.for("react.element"):60103;function I_(e){return e.$$typeof===L_}function D_(e){return Array.isArray(e)?[]:{}}function zu(e,t){return t.clone!==!1&&t.isMergeableObject(e)?El(D_(e),e,t):e}function $_(e,t,r){return e.concat(t).map(function(n){return zu(n,r)})}function H_(e,t){if(!t.customMerge)return El;var r=t.customMerge(e);return typeof r=="function"?r:El}function B_(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Yx(e){return Object.keys(e).concat(B_(e))}function $4(e,t){try{return t in e}catch{return!1}}function F_(e,t){return $4(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function V_(e,t,r){var n={};return r.isMergeableObject(e)&&Yx(e).forEach(function(o){n[o]=zu(e[o],r)}),Yx(t).forEach(function(o){F_(e,o)||($4(e,o)&&r.isMergeableObject(t[o])?n[o]=H_(o,r)(e[o],t[o],r):n[o]=zu(t[o],r))}),n}function El(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||$_,r.isMergeableObject=r.isMergeableObject||N_,r.cloneUnlessOtherwiseSpecified=zu;var n=Array.isArray(t),o=Array.isArray(e),i=n===o;return i?n?r.arrayMerge(e,t,r):V_(e,t,r):zu(t,r)}El.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,o){return El(n,o,r)},{})};var j_=El,U_=j_;const W_=Dn(U_);var K_=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r};const q_=Dn(K_);/*! * isobject * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */var L4=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1};/*! + */var H4=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1};/*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */var F_=L4;function qx(e){return F_(e)===!0&&Object.prototype.toString.call(e)==="[object Object]"}var V_=function(t){var r,n;return!(qx(t)===!1||(r=t.constructor,typeof r!="function")||(n=r.prototype,qx(n)===!1)||n.hasOwnProperty("isPrototypeOf")===!1)};/*! + */var G_=H4;function Jx(e){return G_(e)===!0&&Object.prototype.toString.call(e)==="[object Object]"}var Y_=function(t){var r,n;return!(Jx(t)===!1||(r=t.constructor,typeof r!="function")||(n=r.prototype,Jx(n)===!1)||n.hasOwnProperty("isPrototypeOf")===!1)};/*! * is-extendable * * Copyright (c) 2015-2017, Jon Schlinkert. * Released under the MIT License. - */var j_=V_,U_=function(t){return j_(t)||typeof t=="function"||Array.isArray(t)};/*! + */var J_=Y_,X_=function(t){return J_(t)||typeof t=="function"||Array.isArray(t)};/*! * object.omit * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */var W_=U_,K_=function(t,r,n){if(!W_(t))return{};typeof r=="function"&&(n=r,r=[]),typeof r=="string"&&(r=[r]);for(var o=typeof n=="function",i=Object.keys(t),s={},a=0;a * * Copyright (c) 2014-2015 Jon Schlinkert, contributors. * Licensed under the MIT License - */var q_=L4,G_=function(t,r){if(!q_(t)&&typeof t!="function")return{};var n={};if(typeof r=="string")return r in t&&(n[r]=t[r]),n;for(var o=r.length,i=-1;++i{let d=l.prefixes[u]||"",f=c;return r===!1&&(n&&(f=f.normalize("NFD").replace(new RegExp(`[^a-zA-ZØßø0-9${n.join("")}]`,"g"),"")),n||(f=f.normalize("NFD").replace(/[^a-zA-ZØßø0-9]/g,""),d="")),n&&(d=d.replace(new RegExp(`[^${n.join("")}]`,"g"),"")),u===0?d+f:!d&&!f?"":s&&!d&&o.match(/\s/)?" "+f:(d||o)+f}).filter(Boolean)}function X_(e){const t=e.matchAll(I4).next().value,r=t?t.index:0;return e.slice(0,r+1).toUpperCase()+e.slice(r+1).toLowerCase()}function $4(e,t){return D4(e,t).reduce((r,n)=>r+X_(n),"")}function Gx(e,t){return D4(e,{...t,prefix:"-"}).join("").toLowerCase()}function x1(e,t,r,n){var o,i=!1,s=0;function a(){o&&clearTimeout(o)}function l(){a(),i=!0}typeof t!="boolean"&&(n=r,r=t,t=void 0);function c(){for(var u=arguments.length,d=new Array(u),f=0;fe?m():t!==!0&&(o=setTimeout(n?b:m,n===void 0?e-h:e))}return c.cancel=l,c}function H4(e,t,r){return r===void 0?x1(e,t,!1):x1(e,r,t!==!1)}function it(e,t,r){const n=e[t];return B4(!Oh(n),r),n}function B4(e,t){if(!e)throw new Q_(t)}var Q_=class extends P4.BaseError{constructor(){super(...arguments),this.name="AssertionError"}};function At(e){return Object.entries(e)}function zu(e){return Object.keys(e)}function Th(e){return Object.values(e)}function dr(e,t,r){return e.includes(t,r)}function ee(e){return Object.assign(Object.create(null),e)}function F4(e){return Object.prototype.toString.call(e)}function V4(e){return F4(e).slice(8,-1)}function Od(e,t){return r=>typeof r!==e?!1:t?t(r):!0}function xv(e){return t=>V4(t)===e}var Oh=Od("undefined"),ne=Od("string"),Jt=Od("number",e=>!Number.isNaN(e)),_e=Od("function");function Z_(e){return e===null}function k1(e){return e===!0||e===!1}function hs(e){if(V4(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})}function eA(e){return e==null||/^[bns]/.test(typeof e)}function Zi(e){return Z_(e)||Oh(e)}function Zt(e){return!Zi(e)&&(_e(e)||Od("object")(e))}var tA=xv("RegExp");function rA(e){return xv("Map")(e)}function nA(e){return xv("Set")(e)}function hp(e){return Zt(e)&&!rA(e)&&!nA(e)&&Object.keys(e).length===0}var ct=Array.isArray;function Mo(e){return ct(e)&&e.length===0}function Yx(e){return ct(e)&&e.length>0}function oA(e){return e.charAt(0).toUpperCase()+e.slice(1)}function xa(e,t,r=n=>!!n){t.lastIndex=0;const n=[],o=t.flags;let i;o.includes("g")||(t=new RegExp(t.source,`g${o}`));do i=t.exec(e),i&&n.push(i);while(r(i));return t.lastIndex=0,n}function mp(){const e=Date.now(),t=mp.last||e;return mp.last=e>t?e:t+1}mp.last=0;function Cl(e=""){return`${e}${mp().toString(36)}`}function j4(e){return bv(e,t=>!Oh(t))}function iA(e){if(!hs(e))throw new Error("An invalid value was passed into this clone utility. Expected a plain object");return{...e}}var U4=B_;function Ml(e,t=!1){const r=t?[...e].reverse():e,n=new Set(r);return t?[...n].reverse():[...n]}function W4(e){const t=[];for(const r of e){const n=ct(r)?W4(r):[r];t.push(...n)}return t}function K4(){}function q4(...e){return $_.all(e,{isMergeableObject:hs})}function _d({min:e,max:t,value:r}){return rt?t:r}function G4(e){return e[e.length-1]}function ra(e,t){return[...e].map((r,n)=>({value:r,index:n})).sort((r,n)=>t(r.value,n.value)||r.index-n.index).map(({value:r})=>r)}function sA(e,t,r){try{if(ne(t)&&t in e)return e[t];ct(t)&&(t=`['${t.join("']['")}']`);let n=e;return t.replace(/\[\s*(["'])(.*?)\1\s*]|^\s*(\w+)\s*(?=\.|\[|$)|\.\s*(\w*)\s*(?=\.|\[|$)|\[\s*(-?\d+)\s*]/g,(o,i,s,a,l,c)=>(n=n[s||a||l||c],"")),n===void 0?r:n}catch{return r}}function aA(e,t){const r=iA(t);let n=r;for(const[o,i]of e.entries()){const s=o>=e.length-1;let a=n[i];if(s){if(ct(n)){const l=Number.parseInt(i.toString(),10);Jt(l)&&n.splice(l,1)}else Reflect.deleteProperty(n,i);return r}if(eA(a))return r;a=ct(a)?[...a]:{...a},n[i]=a,n=a}return r}function lA(e){return t=>sA(t,e)}function Y4(e,t,r=!1){const n=[],o=new Set,i=_e(t)?t:lA(t),s=r?[...e].reverse():e;for(const a of s){const l=i(a);o.has(l)||(o.add(l),n.push(a))}return r?n.reverse():n}function kv(e,t){const r=ct(e)?e[0]:e;return Jt(t)?r<=t?Array.from({length:t+1-r},(n,o)=>o+r):Array.from({length:r+1-t},(n,o)=>-1*o+r):Array.from({length:Math.abs(r)},(n,o)=>(r<0?-1:1)*o)}function Jx(e,...t){const r=t.filter(Jt);return e>=Math.min(...r)&&e<=Math.max(...r)}function J4(e){return _e(e)?e():e}var X4="https://remirror.io/docs/errors",cA={[H.UNKNOWN]:"An error occurred but we're not quite sure why. 🧐",[H.INVALID_COMMAND_ARGUMENTS]:"The arguments passed to the command method were invalid.",[H.CUSTOM]:"This is a custom error, possibly thrown by an external library.",[H.CORE_HELPERS]:"An error occurred in a function called from the `@remirror/core-helpers` library.",[H.MUTATION]:"Mutation of immutable value detected.",[H.INTERNAL]:"This is an error which should not occur and is internal to the remirror codebase.",[H.MISSING_REQUIRED_EXTENSION]:"Your editor is missing a required extension.",[H.MANAGER_PHASE_ERROR]:"This occurs when accessing a method or property before it is available.",[H.INVALID_GET_EXTENSION]:"The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.",[H.INVALID_MANAGER_ARGUMENTS]:"Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.",[H.SCHEMA]:"There is a problem with the schema or you are trying to access a node / mark that doesn't exists.",[H.HELPERS_CALLED_IN_OUTER_SCOPE]:"The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).",[H.INVALID_MANAGER_EXTENSION]:"You requested an invalid extension from the manager.",[H.DUPLICATE_COMMAND_NAMES]:"Command method names must be unique within the editor.",[H.DUPLICATE_HELPER_NAMES]:"Helper method names must be unique within the editor.",[H.NON_CHAINABLE_COMMAND]:"Attempted to chain a non chainable command.",[H.INVALID_EXTENSION]:"The provided extension is invalid.",[H.INVALID_CONTENT]:"The content provided to the editor is not supported.",[H.INVALID_NAME]:"An invalid name was used for the extension.",[H.EXTENSION]:"An error occurred within an extension. More details should be made available.",[H.EXTENSION_SPEC]:"The spec was defined without calling the `defaults`, `parse` or `dom` methods.",[H.EXTENSION_EXTRA_ATTRIBUTES]:"Extra attributes must either be a string or an object.",[H.INVALID_SET_EXTENSION_OPTIONS]:"A call to `extension.setOptions` was made with invalid keys.",[H.REACT_PROVIDER_CONTEXT]:"`useRemirrorContext` was called outside of the `remirror` context. It can only be used within an active remirror context created by the ``.",[H.REACT_GET_ROOT_PROPS]:"`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.",[H.REACT_EDITOR_VIEW]:"A problem occurred adding the editor view to the dom.",[H.REACT_CONTROLLED]:"There is a problem with your controlled editor setup.",[H.REACT_NODE_VIEW]:"Something went wrong with your custom ReactNodeView Component.",[H.REACT_GET_CONTEXT]:"You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.",[H.REACT_COMPONENTS]:"An error occurred within a remirror component.",[H.REACT_HOOKS]:"An error occurred within a remirror hook.",[H.I18N_CONTEXT]:"You called `useI18n()` outside of an `I18nProvider` context."};function uA(e){return ne(e)&&dr(Th(H),e)}function dA(e,t){const r=cA[e],n=r?`${r} + */var eA=H4,tA=function(t,r){if(!eA(t)&&typeof t!="function")return{};var n={};if(typeof r=="string")return r in t&&(n[r]=t[r]),n;for(var o=r.length,i=-1;++i{let d=l.prefixes[u]||"",f=c;return r===!1&&(n&&(f=f.normalize("NFD").replace(new RegExp(`[^a-zA-ZØßø0-9${n.join("")}]`,"g"),"")),n||(f=f.normalize("NFD").replace(/[^a-zA-ZØßø0-9]/g,""),d="")),n&&(d=d.replace(new RegExp(`[^${n.join("")}]`,"g"),"")),u===0?d+f:!d&&!f?"":s&&!d&&o.match(/\s/)?" "+f:(d||o)+f}).filter(Boolean)}function oA(e){const t=e.matchAll(B4).next().value,r=t?t.index:0;return e.slice(0,r+1).toUpperCase()+e.slice(r+1).toLowerCase()}function V4(e,t){return F4(e,t).reduce((r,n)=>r+oA(n),"")}function Xx(e,t){return F4(e,{...t,prefix:"-"}).join("").toLowerCase()}function S1(e,t,r,n){var o,i=!1,s=0;function a(){o&&clearTimeout(o)}function l(){a(),i=!0}typeof t!="boolean"&&(n=r,r=t,t=void 0);function c(){for(var u=arguments.length,d=new Array(u),f=0;fe?m():t!==!0&&(o=setTimeout(n?b:m,n===void 0?e-h:e))}return c.cancel=l,c}function j4(e,t,r){return r===void 0?S1(e,t,!1):S1(e,r,t!==!1)}function it(e,t,r){const n=e[t];return U4(!Nh(n),r),n}function U4(e,t){if(!e)throw new iA(t)}var iA=class extends D4.BaseError{constructor(){super(...arguments),this.name="AssertionError"}};function At(e){return Object.entries(e)}function Lu(e){return Object.keys(e)}function Ah(e){return Object.values(e)}function fr(e,t,r){return e.includes(t,r)}function ee(e){return Object.assign(Object.create(null),e)}function W4(e){return Object.prototype.toString.call(e)}function K4(e){return W4(e).slice(8,-1)}function _d(e,t){return r=>typeof r!==e?!1:t?t(r):!0}function Sv(e){return t=>K4(t)===e}var Nh=_d("undefined"),ne=_d("string"),Jt=_d("number",e=>!Number.isNaN(e)),_e=_d("function");function sA(e){return e===null}function E1(e){return e===!0||e===!1}function hs(e){if(K4(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})}function aA(e){return e==null||/^[bns]/.test(typeof e)}function Zi(e){return sA(e)||Nh(e)}function Zt(e){return!Zi(e)&&(_e(e)||_d("object")(e))}var lA=Sv("RegExp");function cA(e){return Sv("Map")(e)}function uA(e){return Sv("Set")(e)}function gp(e){return Zt(e)&&!cA(e)&&!uA(e)&&Object.keys(e).length===0}var ct=Array.isArray;function Mo(e){return ct(e)&&e.length===0}function Qx(e){return ct(e)&&e.length>0}function dA(e){return e.charAt(0).toUpperCase()+e.slice(1)}function xa(e,t,r=n=>!!n){t.lastIndex=0;const n=[],o=t.flags;let i;o.includes("g")||(t=new RegExp(t.source,`g${o}`));do i=t.exec(e),i&&n.push(i);while(r(i));return t.lastIndex=0,n}function vp(){const e=Date.now(),t=vp.last||e;return vp.last=e>t?e:t+1}vp.last=0;function Cl(e=""){return`${e}${vp().toString(36)}`}function q4(e){return wv(e,t=>!Nh(t))}function fA(e){if(!hs(e))throw new Error("An invalid value was passed into this clone utility. Expected a plain object");return{...e}}var G4=q_;function Ml(e,t=!1){const r=t?[...e].reverse():e,n=new Set(r);return t?[...n].reverse():[...n]}function Y4(e){const t=[];for(const r of e){const n=ct(r)?Y4(r):[r];t.push(...n)}return t}function J4(){}function X4(...e){return W_.all(e,{isMergeableObject:hs})}function Ad({min:e,max:t,value:r}){return rt?t:r}function Q4(e){return e[e.length-1]}function ra(e,t){return[...e].map((r,n)=>({value:r,index:n})).sort((r,n)=>t(r.value,n.value)||r.index-n.index).map(({value:r})=>r)}function pA(e,t,r){try{if(ne(t)&&t in e)return e[t];ct(t)&&(t=`['${t.join("']['")}']`);let n=e;return t.replace(/\[\s*(["'])(.*?)\1\s*]|^\s*(\w+)\s*(?=\.|\[|$)|\.\s*(\w*)\s*(?=\.|\[|$)|\[\s*(-?\d+)\s*]/g,(o,i,s,a,l,c)=>(n=n[s||a||l||c],"")),n===void 0?r:n}catch{return r}}function hA(e,t){const r=fA(t);let n=r;for(const[o,i]of e.entries()){const s=o>=e.length-1;let a=n[i];if(s){if(ct(n)){const l=Number.parseInt(i.toString(),10);Jt(l)&&n.splice(l,1)}else Reflect.deleteProperty(n,i);return r}if(aA(a))return r;a=ct(a)?[...a]:{...a},n[i]=a,n=a}return r}function mA(e){return t=>pA(t,e)}function Z4(e,t,r=!1){const n=[],o=new Set,i=_e(t)?t:mA(t),s=r?[...e].reverse():e;for(const a of s){const l=i(a);o.has(l)||(o.add(l),n.push(a))}return r?n.reverse():n}function Ev(e,t){const r=ct(e)?e[0]:e;return Jt(t)?r<=t?Array.from({length:t+1-r},(n,o)=>o+r):Array.from({length:r+1-t},(n,o)=>-1*o+r):Array.from({length:Math.abs(r)},(n,o)=>(r<0?-1:1)*o)}function Zx(e,...t){const r=t.filter(Jt);return e>=Math.min(...r)&&e<=Math.max(...r)}function eE(e){return _e(e)?e():e}var tE="https://remirror.io/docs/errors",gA={[H.UNKNOWN]:"An error occurred but we're not quite sure why. 🧐",[H.INVALID_COMMAND_ARGUMENTS]:"The arguments passed to the command method were invalid.",[H.CUSTOM]:"This is a custom error, possibly thrown by an external library.",[H.CORE_HELPERS]:"An error occurred in a function called from the `@remirror/core-helpers` library.",[H.MUTATION]:"Mutation of immutable value detected.",[H.INTERNAL]:"This is an error which should not occur and is internal to the remirror codebase.",[H.MISSING_REQUIRED_EXTENSION]:"Your editor is missing a required extension.",[H.MANAGER_PHASE_ERROR]:"This occurs when accessing a method or property before it is available.",[H.INVALID_GET_EXTENSION]:"The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.",[H.INVALID_MANAGER_ARGUMENTS]:"Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.",[H.SCHEMA]:"There is a problem with the schema or you are trying to access a node / mark that doesn't exists.",[H.HELPERS_CALLED_IN_OUTER_SCOPE]:"The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).",[H.INVALID_MANAGER_EXTENSION]:"You requested an invalid extension from the manager.",[H.DUPLICATE_COMMAND_NAMES]:"Command method names must be unique within the editor.",[H.DUPLICATE_HELPER_NAMES]:"Helper method names must be unique within the editor.",[H.NON_CHAINABLE_COMMAND]:"Attempted to chain a non chainable command.",[H.INVALID_EXTENSION]:"The provided extension is invalid.",[H.INVALID_CONTENT]:"The content provided to the editor is not supported.",[H.INVALID_NAME]:"An invalid name was used for the extension.",[H.EXTENSION]:"An error occurred within an extension. More details should be made available.",[H.EXTENSION_SPEC]:"The spec was defined without calling the `defaults`, `parse` or `dom` methods.",[H.EXTENSION_EXTRA_ATTRIBUTES]:"Extra attributes must either be a string or an object.",[H.INVALID_SET_EXTENSION_OPTIONS]:"A call to `extension.setOptions` was made with invalid keys.",[H.REACT_PROVIDER_CONTEXT]:"`useRemirrorContext` was called outside of the `remirror` context. It can only be used within an active remirror context created by the ``.",[H.REACT_GET_ROOT_PROPS]:"`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.",[H.REACT_EDITOR_VIEW]:"A problem occurred adding the editor view to the dom.",[H.REACT_CONTROLLED]:"There is a problem with your controlled editor setup.",[H.REACT_NODE_VIEW]:"Something went wrong with your custom ReactNodeView Component.",[H.REACT_GET_CONTEXT]:"You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.",[H.REACT_COMPONENTS]:"An error occurred within a remirror component.",[H.REACT_HOOKS]:"An error occurred within a remirror hook.",[H.I18N_CONTEXT]:"You called `useI18n()` outside of an `I18nProvider` context."};function vA(e){return ne(e)&&fr(Ah(H),e)}function yA(e,t){const r=gA[e],n=r?`${r} `:"",o=t?`${t} -`:"";return`${n}${o}For more information visit ${X4}#${e.toLowerCase()}`}var Q4=class extends P4.BaseError{constructor({code:e,message:t,disableLogging:r=!1}={}){const n=uA(e)?e:H.CUSTOM;super(dA(n,t)),this.errorCode=n,this.url=`${X4}#${n.toLowerCase()}`,r||console.error(this.message)}static create(e={}){return new Q4(e)}};function te(e,t){if(!e)throw Q4.create(t)}function _h(e){if(typeof e!="object"||e===null)return e;const t=Symbol.toStringTag in e&&e[Symbol.toStringTag]==="Module"?e.default??e:e;return t&&typeof e=="object"&&"__esModule"in t&&t.__esModule&&t.default!==void 0?t.default:t}function Hs(e,t={}){return e}function Kt(e){this.content=e}Kt.prototype={constructor:Kt,find:function(e){for(var t=0;t>1}};Kt.from=function(e){if(e instanceof Kt)return e;var t=[];if(e)for(var r in e)t.push(r,e[r]);return new Kt(t)};function Z4(e,t,r){for(let n=0;;n++){if(n==e.childCount||n==t.childCount)return e.childCount==t.childCount?null:r;let o=e.child(n),i=t.child(n);if(o==i){r+=o.nodeSize;continue}if(!o.sameMarkup(i))return r;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)r++;return r}if(o.content.size||i.content.size){let s=Z4(o.content,i.content,r+1);if(s!=null)return s}r+=o.nodeSize}}function eE(e,t,r,n){for(let o=e.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:r,b:n};let s=e.child(--o),a=t.child(--i),l=s.nodeSize;if(s==a){r-=l,n-=l;continue}if(!s.sameMarkup(a))return{a:r,b:n};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;ct&&n(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,r-u),n,o+u)}a=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,r,n,o){let i="",s=!0;return this.nodesBetween(t,r,(a,l)=>{a.isText?(i+=a.text.slice(Math.max(t,l)-l,r-l),s=!n):a.isLeaf?(o?i+=typeof o=="function"?o(a):o:a.type.spec.leafText&&(i+=a.type.spec.leafText(a)),s=!n):!s&&a.isBlock&&(i+=n,s=!0)},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let r=this.lastChild,n=t.firstChild,o=this.content.slice(),i=0;for(r.isText&&r.sameMarkup(n)&&(o[o.length-1]=r.withText(r.text+n.text),i=1);it)for(let i=0,s=0;st&&((sr)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,r-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,r-s-1))),n.push(a),o+=a.nodeSize),s=l}return new R(n,o)}cutByIndex(t,r){return t==r?R.empty:t==0&&r==this.content.length?this:new R(this.content.slice(t,r))}replaceChild(t,r){let n=this.content[t];if(n==r)return this;let o=this.content.slice(),i=this.size+r.nodeSize-n.nodeSize;return o[t]=r,new R(o,i)}addToStart(t){return new R([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new R(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let r=0;rthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,o=0;;n++){let i=this.child(n),s=o+i.nodeSize;if(s>=t)return s==t||r>0?ef(n+1,s):ef(n,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,r){if(!r)return R.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new R(r.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return R.empty;let r,n=0;for(let o=0;othis.type.rank&&(r||(r=t.slice(0,o)),r.push(this),n=!0),r&&r.push(i)}}return r||(r=t.slice()),n||r.push(this),r}removeFromSet(t){for(let r=0;rn.type.rank-o.type.rank),r}}Te.none=[];class vp extends Error{}class K{constructor(t,r,n){this.content=t,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,r){let n=rE(this.content,t+this.openStart,r);return n&&new K(n,this.openStart,this.openEnd)}removeBetween(t,r){return new K(tE(this.content,t+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,r){if(!r)return K.empty;let n=r.openStart||0,o=r.openEnd||0;if(typeof n!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new K(R.fromJSON(t,r.content),n,o)}static maxOpen(t,r=!0){let n=0,o=0;for(let i=t.firstChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=t.lastChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.lastChild)o++;return new K(t,n,o)}}K.empty=new K(R.empty,0,0);function tE(e,t,r){let{index:n,offset:o}=e.findIndex(t),i=e.maybeChild(n),{index:s,offset:a}=e.findIndex(r);if(o==t||i.isText){if(a!=r&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(r))}if(n!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(n,i.copy(tE(i.content,t-o-1,r-o-1)))}function rE(e,t,r,n){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return n&&!n.canReplace(o,o,r)?null:e.cut(0,t).append(r).append(e.cut(t));let a=rE(s.content,t-i-1,r);return a&&e.replaceChild(o,s.copy(a))}function fA(e,t,r){if(r.openStart>e.depth)throw new vp("Inserted content deeper than insertion position");if(e.depth-r.openStart!=t.depth-r.openEnd)throw new vp("Inconsistent open depths");return nE(e,t,r,0)}function nE(e,t,r,n){let o=e.index(n),i=e.node(n);if(o==t.index(n)&&n=0&&e.isText&&e.sameMarkup(t[r])?t[r]=e.withText(t[r].text+e.text):t.push(e)}function hu(e,t,r,n){let o=(t||e).node(r),i=0,s=t?t.index(r):o.childCount;e&&(i=e.index(r),e.depth>r?i++:e.textOffset&&(Gs(e.nodeAfter,n),i++));for(let a=i;ao&&w1(e,t,o+1),s=n.depth>o&&w1(r,n,o+1),a=[];return hu(null,e,o,a),i&&s&&t.index(o)==r.index(o)?(oE(i,s),Gs(Ys(i,iE(e,t,r,n,o+1)),a)):(i&&Gs(Ys(i,yp(e,t,o+1)),a),hu(t,r,o,a),s&&Gs(Ys(s,yp(r,n,o+1)),a)),hu(n,null,o,a),new R(a)}function yp(e,t,r){let n=[];if(hu(null,e,r,n),e.depth>r){let o=w1(e,t,r+1);Gs(Ys(o,yp(e,t,r+1)),n)}return hu(t,null,r,n),new R(n)}function pA(e,t){let r=t.depth-e.openStart,o=t.node(r).copy(e.content);for(let i=r-1;i>=0;i--)o=t.node(i).copy(R.from(o));return{start:o.resolveNoCache(e.openStart+r),end:o.resolveNoCache(o.content.size-e.openEnd-r)}}class Tl{constructor(t,r,n){this.pos=t,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,r=this.index(this.depth);if(r==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],o=t.child(r);return n?t.child(r).cut(n):o}get nodeBefore(){let t=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(t).cut(0,r):t==0?null:this.parent.child(t-1)}posAtIndex(t,r){r=this.resolveDepth(r);let n=this.path[r*3],o=r==0?0:this.path[r*3-1]+1;for(let i=0;i0;r--)if(this.start(r)<=t&&this.end(r)>=t)return r;return 0}blockRange(t=this,r){if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!r||r(this.node(n))))return new na(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&r<=t.content.size))throw new RangeError("Position "+r+" out of range");let n=[],o=0,i=r;for(let s=t;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(n.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new Tl(r,n,i)}static resolveCached(t,r){for(let o=0;ot&&this.nodesBetween(t,r,i=>(n.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),sE(this.marks,t)}contentMatchAt(t){let r=this.type.contentMatch.matchFragment(this.content,0,t);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(t,r,n=R.empty,o=0,i=n.childCount){let s=this.contentMatchAt(t).matchFragment(n,o,i),a=s&&s.matchFragment(this.content,r);if(!a||!a.validEnd)return!1;for(let l=o;lr.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let t={type:this.type.name};for(let r in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(r=>r.toJSON())),t}static fromJSON(t,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(t.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(r.text,n)}let o=R.fromJSON(t,r.content);return t.nodeType(r.type).create(r.attrs,o,n)}};Bi.prototype.text=void 0;class bp extends Bi{constructor(t,r,n,o){if(super(t,r,null,o),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):sE(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,r){return this.text.slice(t,r)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new bp(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new bp(this.type,this.attrs,t,this.marks)}cut(t=0,r=this.text.length){return t==0&&r==this.text.length?this:this.withText(this.text.slice(t,r))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function sE(e,t){for(let r=e.length-1;r>=0;r--)t=e[r].type.name+"("+t+")";return t}class oa{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,r){let n=new gA(t,r);if(n.next==null)return oa.empty;let o=aE(n);n.next&&n.err("Unexpected trailing text");let i=SA(wA(o));return EA(i,n),i}matchType(t){for(let r=0;rc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function r(n){t.push(n);for(let o=0;o{let i=o+(n.validEnd?"*":" ")+" ";for(let s=0;s"+t.indexOf(n.next[s].next);return i}).join(` -`)}}oa.empty=new oa(!0);class gA{constructor(t,r){this.string=t,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function aE(e){let t=[];do t.push(vA(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function vA(e){let t=[];do t.push(yA(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function yA(e){let t=kA(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=bA(e,t);else break;return t}function Xx(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function bA(e,t){let r=Xx(e),n=r;return e.eat(",")&&(e.next!="}"?n=Xx(e):n=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:t}}function xA(e,t){let r=e.nodeTypes,n=r[t];if(n)return[n];let o=[];for(let i in r){let s=r[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function kA(e){if(e.eat("(")){let t=aE(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=xA(e,e.next).map(r=>(e.inline==null?e.inline=r.isInline:e.inline!=r.isInline&&e.err("Mixing inline and block content"),{type:"name",value:r}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function wA(e){let t=[[]];return o(i(e,0),r()),t;function r(){return t.push([])-1}function n(s,a,l){let c={term:l,to:a};return t[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=r())}else if(s.type=="star"){let l=r();return n(a,l),o(i(s.expr,l),l),[n(l)]}else if(s.type=="plus"){let l=r();return o(i(s.expr,a),l),o(i(s.expr,l),l),[n(l)]}else{if(s.type=="opt")return[n(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c{e[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=t[n.join(",")]=new oa(n.indexOf(e.length-1)>-1);for(let s=0;s-1}allowsMarks(t){if(this.markSet==null)return!0;for(let r=0;rn[i]=new fE(i,r,s));let o=r.spec.topNode||"doc";if(!n[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};class CA{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Ad{constructor(t,r,n,o){this.name=t,this.rank=r,this.schema=n,this.spec=o,this.attrs=dE(o.attrs),this.excluded=null;let i=cE(this.attrs);this.instance=i?new Te(this,i):null}create(t=null){return!t&&this.instance?this.instance:new Te(this,uE(this.attrs,t))}static compile(t,r){let n=Object.create(null),o=0;return t.forEach((i,s)=>n[i]=new Ad(i,o++,r,s)),n}removeFromSet(t){for(var r=0;r-1}}let MA=class{constructor(t){this.cached=Object.create(null);let r=this.spec={};for(let o in t)r[o]=t[o];r.nodes=Kt.from(t.nodes),r.marks=Kt.from(t.marks||{}),this.nodes=E1.compile(this.spec.nodes,this),this.marks=Ad.compile(this.spec.marks,this);let n=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[s]||(n[s]=oa.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?Zx(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:Zx(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,r=null,n,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof E1){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(r,n,o)}text(t,r){let n=this.nodes.text;return new bp(n,n.defaultAttrs,t,Te.setFrom(r))}mark(t,r){return typeof t=="string"&&(t=this.marks[t]),t.create(r)}nodeFromJSON(t){return Bi.fromJSON(this,t)}markFromJSON(t){return Te.fromJSON(this,t)}nodeType(t){let r=this.nodes[t];if(!r)throw new RangeError("Unknown node type: "+t);return r}};function Zx(e,t){let r=[];for(let n=0;n-1)&&r.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[n]+"'")}return r}let wv=class C1{constructor(t,r){this.schema=t,this.rules=r,this.tags=[],this.styles=[],r.forEach(n=>{n.tag?this.tags.push(n):n.style&&this.styles.push(n)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let o=t.nodes[n.node];return o.contentMatch.matchType(o)})}parse(t,r={}){let n=new tk(this,r,!1);return n.addAll(t,r.from,r.to),n.finish()}parseSlice(t,r={}){let n=new tk(this,r,!0);return n.addAll(t,r.from,r.to),K.maxOpen(n.finish())}matchTag(t,r,n){for(let o=n?this.tags.indexOf(n)+1:0;ot.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=r))){if(s.getAttrs){let l=s.getAttrs(r);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(t){let r=[];function n(o){let i=o.priority==null?50:o.priority,s=0;for(;s{n(s=rk(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in t.nodes){let i=t.nodes[o].spec.parseDOM;i&&i.forEach(s=>{n(s=rk(s)),s.node||s.ignore||s.mark||(s.node=o)})}return r}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new C1(t,C1.schemaRules(t)))}};const pE={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},TA={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},hE={ol:!0,ul:!0},xp=1,kp=2,mu=4;function ek(e,t,r){return t!=null?(t?xp:0)|(t==="full"?kp:0):e&&e.whitespace=="pre"?xp|kp:r&~mu}class tf{constructor(t,r,n,o,i,s,a){this.type=t,this.attrs=r,this.marks=n,this.pendingMarks=o,this.solid=i,this.options=a,this.content=[],this.activeMarks=Te.none,this.stashMarks=[],this.match=s||(a&mu?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(R.from(t));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,o;return(o=n.findWrapping(t.type))?(this.match=n,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&xp)){let n=this.content[this.content.length-1],o;if(n&&n.isText&&(o=/[ \t\r\n\u000c]+$/.exec(n.text))){let i=n;n.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let r=R.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(R.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}popFromStashMark(t){for(let r=this.stashMarks.length-1;r>=0;r--)if(t.eq(this.stashMarks[r]))return this.stashMarks.splice(r,1)[0]}applyPending(t){for(let r=0,n=this.pendingMarks;rthis.addAll(t)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(t,()=>{this.addElementByRule(t,i,i.consuming===!1?o:void 0)})}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(` -`))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let r=Te.none,n=Te.none;for(let o=0;o{s.clearMark(a)&&(n=a.addToSet(n))}):r=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(r),s.consuming===!1)i=s;else break}return[r,n]}addElementByRule(t,r,n){let o,i,s;r.node?(i=this.parser.schema.nodes[r.node],i.isLeaf?this.insertNode(i.create(r.attrs))||this.leafFallback(t):o=this.enter(i,r.attrs||null,r.preserveWhitespace)):(s=this.parser.schema.marks[r.mark].create(r.attrs),this.addPendingMark(s));let a=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(r.getContent)this.findInside(t),r.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=t;typeof r.contentElement=="string"?l=t.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(t):r.contentElement&&(l=r.contentElement),this.findAround(t,l,!0),this.addAll(l)}o&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(t,r,n){let o=r||0;for(let i=r?t.childNodes[r]:t.firstChild,s=n==null?null:t.childNodes[n];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i);this.findAtPoint(t,o)}findPlace(t){let r,n;for(let o=this.open;o>=0;o--){let i=this.nodes[o],s=i.findWrapping(t);if(s&&(!r||r.length>s.length)&&(r=s,n=i,!s.length)||i.solid)break}if(!r)return!1;this.sync(n);for(let o=0;othis.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let r=this.open;r>=0;r--)if(this.nodes[r]==t)return this.open=r,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let o=n.length-1;o>=0;o--)t+=n[o].nodeSize;r&&t++}return t}findAtPoint(t,r){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let r=t.split("/"),n=this.options.context,o=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=r[a];if(c==""){if(a==r.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:n&&l>=i?n.node(l-i).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return s(r.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let r=t.depth;r>=0;r--){let n=t.node(r).contentMatchAt(t.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}addPendingMark(t){let r=RA(t,this.top.pendingMarks);r&&this.top.stashMarks.push(r),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,r){for(let n=this.open;n>=0;n--){let o=this.nodes[n];if(o.pendingMarks.lastIndexOf(t)>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);let s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==r)break}}}function OA(e){for(let t=e.firstChild,r=null;t;t=t.nextSibling){let n=t.nodeType==1?t.nodeName.toLowerCase():null;n&&hE.hasOwnProperty(n)&&r?(r.appendChild(t),t=r):n=="li"?r=t:n&&(r=null)}}function _A(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function AA(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,r,n=[];for(;r=t.exec(e);)n.push(r[1],r[2].trim());return n}function rk(e){let t={};for(let r in e)t[r]=e[r];return t}function NA(e,t){let r=t.schema.nodes;for(let n in r){let o=r[n];if(!o.allowsMarkType(e))continue;let i=[],s=a=>{i.push(a);for(let l=0;l{if(i.length||s.marks.length){let a=0,l=0;for(;a=0;o--){let i=this.serializeMark(t.marks[o],t.isInline,r);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,r,n={}){let o=this.marks[t.type.name];return o&&sn.renderSpec(og(n),o(t,r))}static renderSpec(t,r,n=null){if(typeof r=="string")return{dom:t.createTextNode(r)};if(r.nodeType!=null)return{dom:r};if(r.dom&&r.dom.nodeType!=null)return r;let o=r[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s,a=n?t.createElementNS(n,o):t.createElement(o),l=r[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;uc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:f,contentDOM:p}=sn.renderSpec(t,d,n);if(a.appendChild(f),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:a,contentDOM:s}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new sn(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let r=nk(t.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(t){return nk(t.marks)}}function nk(e){let t={};for(let r in e){let n=e[r].spec.toDOM;n&&(t[r]=n)}return t}function og(e){return e.document||window.document}const mE=65535,gE=Math.pow(2,16);function PA(e,t){return e+t*gE}function ok(e){return e&mE}function zA(e){return(e-(e&mE))/gE}const vE=1,yE=2,zf=4,bE=8;class M1{constructor(t,r,n){this.pos=t,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&bE)>0}get deletedBefore(){return(this.delInfo&(vE|zf))>0}get deletedAfter(){return(this.delInfo&(yE|zf))>0}get deletedAcross(){return(this.delInfo&zf)>0}}class rn{constructor(t,r=!1){if(this.ranges=t,this.inverted=r,!t.length&&rn.empty)return rn.empty}recover(t){let r=0,n=ok(t);if(!this.inverted)for(let o=0;ot)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(t<=d){let f=c?t==l?-1:t==d?1:r:r,p=l+o+(f<0?0:u);if(n)return p;let h=t==(r<0?l:d)?null:PA(a/3,t-l),m=t==l?yE:t==d?vE:zf;return(r<0?t!=l:t!=d)&&(m|=bE),new M1(p,m,h)}o+=u-c}return n?t+o:new M1(t+o,0,null)}touches(t,r){let n=0,o=ok(r),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;at)break;let c=this.ranges[a+i],u=l+c;if(t<=u&&a==o*3)return!0;n+=this.ranges[a+s]-c}return!1}forEach(t){let r=this.inverted?2:1,n=this.inverted?1:2;for(let o=0,i=0;o=0;r--){let o=t.getMirror(r);this.appendMap(t.maps[r].invert(),o!=null&&o>r?n-o-1:void 0)}}invert(){let t=new ul;return t.appendMappingInverted(this),t}map(t,r=1){if(this.mirror)return this._map(t,r,!0);for(let n=this.from;ni&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),r.openStart,r.openEnd);return yt.fromReplace(t,this.from,this.to,i)}invert(){return new eo(this.from,this.to,this.mark)}map(t){let r=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new Ko(r.pos,n.pos,this.mark)}merge(t){return t instanceof Ko&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ko(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ko(r.from,r.to,t.markFromJSON(r.mark))}}Rt.jsonID("addMark",Ko);class eo extends Rt{constructor(t,r,n){super(),this.from=t,this.to=r,this.mark=n}apply(t){let r=t.slice(this.from,this.to),n=new K(Sv(r.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),r.openStart,r.openEnd);return yt.fromReplace(t,this.from,this.to,n)}invert(){return new Ko(this.from,this.to,this.mark)}map(t){let r=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new eo(r.pos,n.pos,this.mark)}merge(t){return t instanceof eo&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new eo(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new eo(r.from,r.to,t.markFromJSON(r.mark))}}Rt.jsonID("removeMark",eo);class Li extends Rt{constructor(t,r){super(),this.pos=t,this.mark=r}apply(t){let r=t.nodeAt(this.pos);if(!r)return yt.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return yt.fromReplace(t,this.pos,this.pos+1,new K(R.from(n),0,r.isLeaf?0:1))}invert(t){let r=t.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let o=0;on.pos?null:new bt(r.pos,n.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new bt(r.from,r.to,r.gapFrom,r.gapTo,K.fromJSON(t,r.slice),r.insert,!!r.structure)}}Rt.jsonID("replaceAround",bt);function T1(e,t,r){let n=e.resolve(t),o=r-t,i=n.depth;for(;o>0&&i>0&&n.indexAfter(i)==n.node(i).childCount;)i--,o--;if(o>0){let s=n.node(i).maybeChild(n.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function LA(e,t,r,n){let o=[],i=[],s,a;e.doc.nodesBetween(t,r,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!n.isInSet(d)&&u.type.allowsMarkType(n.type)){let f=Math.max(c,t),p=Math.min(c+l.nodeSize,r),h=n.addToSet(d);for(let m=0;me.step(l)),i.forEach(l=>e.step(l))}function IA(e,t,r,n){let o=[],i=0;e.doc.nodesBetween(t,r,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(n instanceof Ad){let c=s.marks,u;for(;u=n.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else n?n.isInSet(s.marks)&&(l=[n]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,r);for(let u=0;ue.step(new eo(s.from,s.to,s.style)))}function DA(e,t,r,n=r.contentMatch){let o=e.doc.nodeAt(t),i=[],s=t+1;for(let a=0;a=0;a--)e.step(i[a])}function $A(e,t,r){return(t==0||e.canReplace(t,e.childCount))&&(r==e.childCount||e.canReplace(0,r))}function tc(e){let r=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let o=e.$from.node(n),i=e.$from.index(n),s=e.$to.indexAfter(n);if(nr;h--)m||n.index(h)>0?(m=!0,u=R.from(n.node(h).copy(u)),d++):l--;let f=R.empty,p=0;for(let h=i,m=!1;h>r;h--)m||o.after(h+1)=0;s--){if(n.size){let a=r[s].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=R.from(r[s].type.create(r[s].attrs,n))}let o=t.start,i=t.end;e.step(new bt(o,i,o,i,new K(n,0,0),r.length,!0))}function jA(e,t,r,n,o){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,r,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(n,o)&&UA(e.doc,e.mapping.slice(i).map(a),n)){e.clearIncompatible(e.mapping.slice(i).map(a,1),n);let l=e.mapping.slice(i),c=l.map(a,1),u=l.map(a+s.nodeSize,1);return e.step(new bt(c,u,c+1,u-1,new K(R.from(n.create(o,null,s.marks)),0,0),1,!0)),!1}})}function UA(e,t,r){let n=e.resolve(t),o=n.index();return n.parent.canReplaceWith(o,o+1,r)}function WA(e,t,r,n,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");r||(r=i.type);let s=r.create(n,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!r.validContent(i.content))throw new RangeError("Invalid content for node type "+r.name);e.step(new bt(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new K(R.from(s),0,0),1,!0))}function dl(e,t,r=1,n){let o=e.resolve(t),i=o.depth-r,s=n&&n[n.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=r-2;c>i;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=n&&n[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=n&&n[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let a=o.indexAfter(i),l=n&&n[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function KA(e,t,r=1,n){let o=e.doc.resolve(t),i=R.empty,s=R.empty;for(let a=o.depth,l=o.depth-r,c=r-1;a>l;a--,c--){i=R.from(o.node(a).copy(i));let u=n&&n[c];s=R.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}e.step(new Dt(t,t,new K(i.append(s),r,r),!0))}function Nd(e,t){let r=e.resolve(t),n=r.index();return qA(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function qA(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function GA(e,t,r){let n=new Dt(t-r,t+r,K.empty,!0);e.step(n)}function xE(e,t,r){let n=e.resolve(t);if(n.parent.canReplaceWith(n.index(),n.index(),r))return t;if(n.parentOffset==0)for(let o=n.depth-1;o>=0;o--){let i=n.index(o);if(n.node(o).canReplaceWith(i,i,r))return n.before(o+1);if(i>0)return null}if(n.parentOffset==n.parent.content.size)for(let o=n.depth-1;o>=0;o--){let i=n.indexAfter(o);if(n.node(o).canReplaceWith(i,i,r))return n.after(o+1);if(i=0;s--){let a=s==n.depth?0:n.pos<=(n.start(s+1)+n.end(s+1))/2?-1:1,l=n.index(s)+(a>0?1:0),c=n.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?n.pos:a<0?n.before(s+1):n.after(s+1)}return null}function Cv(e,t,r=t,n=K.empty){if(t==r&&!n.size)return null;let o=e.resolve(t),i=e.resolve(r);return kE(o,i,n)?new Dt(t,r,n):new JA(o,i,n).fit()}function kE(e,t,r){return!r.openStart&&!r.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),r.content)}class JA{constructor(t,r,n){this.$from=t,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=R.empty;for(let o=0;o<=t.depth;o++){let i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=R.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,o=this.close(t<0?this.$to:n.doc.resolve(t));if(!o)return null;let i=this.placed,s=n.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new K(i,s,a);return t>-1?new bt(n.pos,t,this.$to.pos,this.$to.end(),l,r):l.size||n.pos!=this.$to.pos?new Dt(n.pos,o.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,o=this.unplaced.openEnd;n1&&(o=0),i.type.spec.isolating&&o<=n){t=n;break}r=i.content}for(let r=1;r<=2;r++)for(let n=r==1?t:this.unplaced.openStart;n>=0;n--){let o,i=null;n?(i=sg(this.unplaced.content,n-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(r==1&&(s?c.matchType(s.type)||(d=c.fillBefore(R.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:a,parent:i,inject:d};if(r==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:n,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:t,openStart:r,openEnd:n}=this.unplaced,o=sg(t,r);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new K(t,r+1,Math.max(n,o.size+r>=t.size-n?r+1:0)),!0)}dropNode(){let{content:t,openStart:r,openEnd:n}=this.unplaced,o=sg(t,r);if(o.childCount<=1&&r>0){let i=t.size-r<=r+o.size;this.unplaced=new K(Pc(t,r-1,1),r-1,i?r-1:n)}else this.unplaced=new K(Pc(t,r,1),r,n)}placeNodes({sliceDepth:t,frontierDepth:r,parent:n,inject:o,wrap:i}){for(;this.depth>r;)this.closeFrontierNode();if(i)for(let m=0;m1||l==0||m.content.size)&&(d=b,u.push(wE(m.mark(f.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?p:-1)))}let h=c==a.childCount;h||(p=-1),this.placed=zc(this.placed,r,R.from(u)),this.frontier[r].match=d,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,b=a;m1&&o==this.$to.end(--n);)++o;return o}findCloseLevel(t){e:for(let r=Math.min(this.depth,t.depth);r>=0;r--){let{match:n,type:o}=this.frontier[r],i=r=0;a--){let{match:l,type:c}=this.frontier[a],u=ag(t,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:r,fit:s,move:i?t.doc.resolve(t.after(r+1)):t}}}}close(t){let r=this.findCloseLevel(t);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=zc(this.placed,r.depth,r.fit)),t=r.move;for(let n=r.depth+1;n<=t.depth;n++){let o=t.node(n),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(n));this.openFrontierNode(o.type,o.attrs,i)}return t}openFrontierNode(t,r=null,n){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=zc(this.placed,this.depth,R.from(t.create(r,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(R.empty,!0);r.childCount&&(this.placed=zc(this.placed,this.frontier.length,r))}}function Pc(e,t,r){return t==0?e.cutByIndex(r,e.childCount):e.replaceChild(0,e.firstChild.copy(Pc(e.firstChild.content,t-1,r)))}function zc(e,t,r){return t==0?e.append(r):e.replaceChild(e.childCount-1,e.lastChild.copy(zc(e.lastChild.content,t-1,r)))}function sg(e,t){for(let r=0;r1&&(n=n.replaceChild(0,wE(n.firstChild,t-1,n.childCount==1?r-1:0))),t>0&&(n=e.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(e.type.contentMatch.matchFragment(n).fillBefore(R.empty,!0)))),e.copy(n)}function ag(e,t,r,n,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!r.compatibleContent(i.type))return null;let a=n.fillBefore(i.content,!0,s);return a&&!XA(r,i.content,s)?a:null}function XA(e,t,r){for(let n=r;n0;f--,p--){let h=o.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=n.openStart;for(let f=n.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==n.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=QA(p.type);if(h&&!p.sameMarkup(o.node(Math.abs(a)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=n.openStart;f>=0;f--){let p=(f+u+1)%(n.openStart+1),h=c[p];if(h)for(let m=0;m=0&&(e.replace(t,r,n),!(e.steps.length>d));f--){let p=s[f];p<0||(t=o.before(p),r=i.after(p))}}function SE(e,t,r,n,o){if(tn){let i=o.contentMatchAt(0),s=i.fillBefore(e).append(e);e=s.append(i.matchFragment(s).fillBefore(R.empty,!0))}return e}function eN(e,t,r,n){if(!n.isInline&&t==r&&e.doc.resolve(t).parent.content.size){let o=xE(e.doc,t,n.type);o!=null&&(t=r=o)}e.replaceRange(t,r,new K(R.from(n),0,0))}function tN(e,t,r){let n=e.doc.resolve(t),o=e.doc.resolve(r),i=EE(n,o);for(let s=0;s0&&(l||n.node(a-1).canReplace(n.index(a-1),o.indexAfter(a-1))))return e.delete(n.before(a),o.after(a))}for(let s=1;s<=n.depth&&s<=o.depth;s++)if(t-n.start(s)==n.depth-s&&r>n.end(s)&&o.end(s)-r!=o.depth-s)return e.delete(n.before(s),r);e.delete(t,r)}function EE(e,t){let r=[],n=Math.min(e.depth,t.depth);for(let o=n;o>=0;o--){let i=e.start(o);if(it.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(i==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==i-1)&&r.push(o)}return r}class fl extends Rt{constructor(t,r,n){super(),this.pos=t,this.attr=r,this.value=n}apply(t){let r=t.nodeAt(this.pos);if(!r)return yt.fail("No node at attribute step's position");let n=Object.create(null);for(let i in r.attrs)n[i]=r.attrs[i];n[this.attr]=this.value;let o=r.type.create(n,null,r.marks);return yt.fromReplace(t,this.pos,this.pos+1,new K(R.from(o),0,r.isLeaf?0:1))}getMap(){return rn.empty}invert(t){return new fl(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let r=t.mapResult(this.pos,1);return r.deletedAfter?null:new fl(r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new fl(r.pos,r.attr,r.value)}}Rt.jsonID("attr",fl);class Lu extends Rt{constructor(t,r){super(),this.attr=t,this.value=r}apply(t){let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let n=t.type.create(r,t.content,t.marks);return yt.ok(n)}getMap(){return rn.empty}invert(t){return new Lu(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Lu(r.attr,r.value)}}Rt.jsonID("docAttr",Lu);let _l=class extends Error{};_l=function e(t){let r=Error.call(this,t);return r.__proto__=e.prototype,r};_l.prototype=Object.create(Error.prototype);_l.prototype.constructor=_l;_l.prototype.name="TransformError";class rN{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new ul}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let r=this.maybeStep(t);if(r.failed)throw new _l(r.failed);return this}maybeStep(t){let r=t.apply(this.doc);return r.failed||this.addStep(t,r.doc),r}get docChanged(){return this.steps.length>0}addStep(t,r){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=r}replace(t,r=t,n=K.empty){let o=Cv(this.doc,t,r,n);return o&&this.step(o),this}replaceWith(t,r,n){return this.replace(t,r,new K(R.from(n),0,0))}delete(t,r){return this.replace(t,r,K.empty)}insert(t,r){return this.replaceWith(t,t,r)}replaceRange(t,r,n){return ZA(this,t,r,n),this}replaceRangeWith(t,r,n){return eN(this,t,r,n),this}deleteRange(t,r){return tN(this,t,r),this}lift(t,r){return HA(this,t,r),this}join(t,r=1){return GA(this,t,r),this}wrap(t,r){return VA(this,t,r),this}setBlockType(t,r=t,n,o=null){return jA(this,t,r,n,o),this}setNodeMarkup(t,r,n=null,o){return WA(this,t,r,n,o),this}setNodeAttribute(t,r,n){return this.step(new fl(t,r,n)),this}setDocAttribute(t,r){return this.step(new Lu(t,r)),this}addNodeMark(t,r){return this.step(new Li(t,r)),this}removeNodeMark(t,r){if(!(r instanceof Te)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(r=r.isInSet(n.marks),!r)return this}return this.step(new Ol(t,r)),this}split(t,r=1,n){return KA(this,t,r,n),this}addMark(t,r,n){return LA(this,t,r,n),this}removeMark(t,r,n){return IA(this,t,r,n),this}clearIncompatible(t,r,n){return DA(this,t,r,n),this}}const lg=Object.create(null);class be{constructor(t,r,n){this.$anchor=t,this.$head=r,this.ranges=n||[new nN(t.min(r),t.max(r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let r=0;r=0;i--){let s=r<0?Fa(t.node(0),t.node(i),t.before(i+1),t.index(i),r,n):Fa(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,r,n);if(s)return s}return null}static near(t,r=1){return this.findFrom(t,r)||this.findFrom(t,-r)||new xr(t.node(0))}static atStart(t){return Fa(t,t,0,0,1)||new xr(t)}static atEnd(t){return Fa(t,t,t.content.size,t.childCount,-1)||new xr(t)}static fromJSON(t,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=lg[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(t,r)}static jsonID(t,r){if(t in lg)throw new RangeError("Duplicate use of selection JSON ID "+t);return lg[t]=r,r.prototype.jsonID=t,r}getBookmark(){return le.between(this.$anchor,this.$head).getBookmark()}}be.prototype.visible=!0;class nN{constructor(t,r){this.$from=t,this.$to=r}}let sk=!1;function ak(e){!sk&&!e.parent.inlineContent&&(sk=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class le extends be{constructor(t,r=t){ak(t),ak(r),super(t,r)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,r){let n=t.resolve(r.map(this.head));if(!n.parent.inlineContent)return be.near(n);let o=t.resolve(r.map(this.anchor));return new le(o.parent.inlineContent?o:n,n)}replace(t,r=K.empty){if(super.replace(t,r),r==K.empty){let n=this.$from.marksAcross(this.$to);n&&t.ensureMarks(n)}}eq(t){return t instanceof le&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Ah(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new le(t.resolve(r.anchor),t.resolve(r.head))}static create(t,r,n=r){let o=t.resolve(r);return new this(o,n==r?o:t.resolve(n))}static between(t,r,n){let o=t.pos-r.pos;if((!n||o)&&(n=o>=0?1:-1),!r.parent.inlineContent){let i=be.findFrom(r,n,!0)||be.findFrom(r,-n,!0);if(i)r=i.$head;else return be.near(r,n)}return t.parent.inlineContent||(o==0?t=r:(t=(be.findFrom(t,-n,!0)||be.findFrom(t,n,!0)).$anchor,t.pos0?0:1);o>0?s=0;s+=o){let a=t.child(s);if(a.isAtom){if(!i&&ce.isSelectable(a))return ce.create(e,r-(o<0?a.nodeSize:0))}else{let l=Fa(e,a,r+o,o<0?a.childCount:0,o,i);if(l)return l}r+=a.nodeSize*o}return null}function lk(e,t,r){let n=e.steps.length-1;if(n{s==null&&(s=u)}),e.setSelection(be.near(e.doc.resolve(s),r))}const ck=1,rf=2,uk=4;class iN extends rN{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=rf,this}ensureMarks(t){return Te.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&rf)>0}addStep(t,r){super.addStep(t,r),this.updated=this.updated&~rf,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,r=!0){let n=this.selection;return r&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Te.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,r,n){let o=this.doc.type.schema;if(r==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(n==null&&(n=r),n=n??r,!t)return this.deleteRange(r,n);let i=this.storedMarks;if(!i){let s=this.doc.resolve(r);i=n==r?s.marks():s.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(r,n,o.text(t,i)),this.selection.empty||this.setSelection(be.near(this.selection.$to)),this}}setMeta(t,r){return this.meta[typeof t=="string"?t:t.key]=r,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=uk,this}get scrolledIntoView(){return(this.updated&uk)>0}}function dk(e,t){return!t||!e?e:e.bind(t)}class Lc{constructor(t,r,n){this.name=t,this.init=dk(r.init,n),this.apply=dk(r.apply,n)}}const sN=[new Lc("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Lc("selection",{init(e,t){return e.selection||be.atStart(t.doc)},apply(e){return e.selection}}),new Lc("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,r,n){return n.selection.$cursor?e.storedMarks:null}}),new Lc("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class cg{constructor(t,r){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=sN.slice(),r&&r.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new Lc(n.key,n.spec.state,n))})}}class Bs{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,r=-1){for(let n=0;nn.toJSON())),t&&typeof t=="object")for(let n in t){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[n],i=o.spec.state;i&&i.toJSON&&(r[n]=i.toJSON.call(o,this[o.key]))}return r}static fromJSON(t,r,n){if(!r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new cg(t.schema,t.plugins),i=new Bs(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Bi.fromJSON(t.schema,r.doc);else if(s.name=="selection")i.selection=be.fromJSON(i.doc,r.selection);else if(s.name=="storedMarks")r.storedMarks&&(i.storedMarks=r.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let a in n){let l=n[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(r,a)){i[s.name]=c.fromJSON.call(l,t,r[a],i);return}}i[s.name]=s.init(t,i)}}),i}}function CE(e,t,r){for(let n in e){let o=e[n];o instanceof Function?o=o.bind(t):n=="handleDOMEvents"&&(o=CE(o,t,{})),r[n]=o}return r}class Ro{constructor(t){this.spec=t,this.props={},t.props&&CE(t.props,this,this.props),this.key=t.key?t.key.key:ME("plugin")}getState(t){return t[this.key]}}const ug=Object.create(null);function ME(e){return e in ug?e+"$"+ ++ug[e]:(ug[e]=0,e+"$")}class ka{constructor(t="key"){this.key=ME(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}var aN=/[A-Z]/g,lN=/^ms-/,dg={};function cN(e){return"-"+e.toLowerCase()}function uN(e){if(dg.hasOwnProperty(e))return dg[e];var t=e.replace(aN,cN);return dg[e]=lN.test(t)?"-"+t:t}function dN(e){return uN(e)}function fN(e,t){return dN(e)+":"+t}function pN(e){var t="";for(var r in e){var n=e[r];typeof n!="string"&&typeof n!="number"||(t&&(t+=";"),t+=fN(r,n))}return t}function hN(){return typeof document<"u"?document:null}var TE=hN;function OE(e,t){if(typeof e!="string")return[e];var r=[e];typeof t=="string"||Array.isArray(t)?t={brackets:t}:t||(t={});var n=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],o=t.escape||"___",i=!!t.flat;n.forEach(function(l){var c=new RegExp(["\\",l[0],"[^\\",l[0],"\\",l[1],"]*\\",l[1]].join("")),u=[];function d(f,p,h){var m=r.push(f.slice(l[0].length,-l[1].length))-1;return u.push(m),o+m+o}r.forEach(function(f,p){for(var h,m=0;f!=h;)if(h=f,f=f.replace(c,d),m++>1e4)throw Error("References have circular dependency. Please, check them.");r[p]=f}),u=u.reverse(),r=r.map(function(f){return u.forEach(function(p){f=f.replace(new RegExp("(\\"+o+p+"\\"+o+")","g"),l[0]+"$1"+l[1])}),f})});var s=new RegExp("\\"+o+"([0-9]+)\\"+o);function a(l,c,u){for(var d=[],f,p=0;f=s.exec(l);){if(p++>1e4)throw Error("Circular references in parenthesis");d.push(l.slice(0,f.index)),d.push(a(c[f[1]],c)),l=l.slice(f.index+f[0].length)}return d.push(l),d}return i?r:a(r[0],r)}function _E(e,t){if(t&&t.flat){var r=t&&t.escape||"___",n=e[0],o;if(!n)return"";for(var i=new RegExp("\\"+r+"([0-9]+)\\"+r),s=0;n!=o;){if(s++>1e4)throw Error("Circular references in "+e);o=n,n=n.replace(i,a)}return n}return e.reduce(function l(c,u){return Array.isArray(u)&&(u=u.reduce(l,"")),c+u},"");function a(l,c){if(e[c]==null)throw Error("Reference "+c+"is undefined");return e[c]}}function Tv(e,t){return Array.isArray(e)?_E(e,t):OE(e,t)}Tv.parse=OE;Tv.stringify=_E;var mN=Tv;const gN=Ln(mN),vN={id:"extension.command.copy.label",message:"Copy",comment:"Label for copy command."},yN={id:"extension.command.copy.description",message:"Copy the selected text",comment:"Description for copy command."},bN={id:"extension.command.cut.label",message:"Cut",comment:"Label for cut command."},xN={id:"extension.command.cut.description",message:"Cut the selected text",comment:"Description for cut command."},kN={id:"extension.command.paste.label",message:"Paste",comment:"Label for paste command."},wN={id:"extension.command.paste.description",message:"Paste content into the editor",comment:"Description for paste command."},SN={id:"extension.command.select-all.label",message:"Select all",comment:"Label for select all command."},EN={id:"extension.command.select-all.description",message:"Select all content within the editor",comment:"Description for select all command."};var es=Object.freeze({__proto__:null,COPY_DESCRIPTION:yN,COPY_LABEL:vN,CUT_DESCRIPTION:xN,CUT_LABEL:bN,PASTE_DESCRIPTION:wN,PASTE_LABEL:kN,SELECT_ALL_DESCRIPTION:EN,SELECT_ALL_LABEL:SN});const CN={id:"keyboard.shortcut.escape",message:"Enter",comment:"Label for escape key in shortcuts."},MN={id:"keyboard.shortcut.command",message:"Command",comment:"Label for command key in shortcuts."},TN={id:"keyboard.shortcut.control",message:"Control",comment:"Label for control key in shortcuts."},ON={id:"keyboard.shortcut.enter",message:"Enter",comment:"Label for enter key in shortcuts."},_N={id:"keyboard.shortcut.shift",message:"Shift",comment:"Label for shift key in shortcuts."},AN={id:"keyboard.shortcut.alt",message:"Alt",comment:"Label for alt key in shortcuts."},NN={id:"keyboard.shortcut.capsLock",message:"Caps Lock",comment:"Label for caps lock key in shortcuts."},RN={id:"keyboard.shortcut.backspace",message:"Backspace",comment:"Label for backspace key in shortcuts."},PN={id:"keyboard.shortcut.tab",message:"Tab",comment:"Label for tab key in shortcuts."},zN={id:"keyboard.shortcut.space",message:"Space",comment:"Label for space key in shortcuts."},LN={id:"keyboard.shortcut.delete",message:"Delete",comment:"Label for delete key in shortcuts."},IN={id:"keyboard.shortcut.pageUp",message:"Page Up",comment:"Label for page up key in shortcuts."},DN={id:"keyboard.shortcut.pageDown",message:"Page Down",comment:"Label for page down key in shortcuts."},$N={id:"keyboard.shortcut.home",message:"Home",comment:"Label for home key in shortcuts."},HN={id:"keyboard.shortcut.end",message:"End",comment:"Label for end key in shortcuts."},BN={id:"keyboard.shortcut.arrowLeft",message:"Arrow Left",comment:"Label for arrow left key in shortcuts."},FN={id:"keyboard.shortcut.arrowRight",message:"Arrow Right",comment:"Label for arrow right key in shortcuts."},VN={id:"keyboard.shortcut.arrowUp",message:"Arrow Up",comment:"Label for arrow up key in shortcuts."},jN={id:"keyboard.shortcut.arrowDown",message:"Arrow Down",comment:"Label for arrowDown key in shortcuts."};var Mt=Object.freeze({__proto__:null,ALT_KEY:AN,ARROW_DOWN_KEY:jN,ARROW_LEFT_KEY:BN,ARROW_RIGHT_KEY:FN,ARROW_UP_KEY:VN,BACKSPACE_KEY:RN,CAPS_LOCK_KEY:NN,COMMAND_KEY:MN,CONTROL_KEY:TN,DELETE_KEY:LN,END_KEY:HN,ENTER_KEY:ON,ESCAPE_KEY:CN,HOME_KEY:$N,PAGE_DOWN_KEY:DN,PAGE_UP_KEY:IN,SHIFT_KEY:_N,SPACE_KEY:zN,TAB_KEY:PN});const UN={id:"extension.command.toggle-blockquote.label",message:"Blockquote",comment:"Label for blockquote formatting command."},WN={id:"extension.command.toggle-blockquote.description",message:"Add blockquote formatting to the selected text",comment:"Description for blockquote formatting command."};var fk=Object.freeze({__proto__:null,DESCRIPTION:WN,LABEL:UN});const KN={id:"extension.command.toggle-bold.label",message:"Bold",comment:"Label for bold formatting command."},qN={id:"extension.command.toggle-bold.description",message:"Add bold formatting to the selected text",comment:"Description for bold formatting command."};var pk=Object.freeze({__proto__:null,DESCRIPTION:qN,LABEL:KN});const GN={id:"extension.command.toggle-code-block.label",message:"Codeblock",comment:"Label for the code block command."},YN={id:"extension.command.toggle-code-block.description",message:"Add a code block",comment:"Description for the code block command."};var JN=Object.freeze({__proto__:null,DESCRIPTION:YN,LABEL:GN});const XN={id:"extension.command.toggle-code.label",message:"Code",comment:"Label for the inline code formatting."},QN={id:"extension.command.toggle-code.description",message:"Add inline code formatting to the selected text",comment:"Description for the inline code formatting command."};var ZN=Object.freeze({__proto__:null,DESCRIPTION:QN,LABEL:XN});const eR={id:"extension.command.set-font-size.label",message:"Font size",comment:"Label for adding a font size."},tR={id:"extension.command.set-font-size.description",message:"Set the font size for the selected text.",comment:"Description for adding a font size."},rR={id:"extension.command.increase-font-size.label",message:"Increase",comment:"Label for increasing the font size."},nR={id:"extension.command.increase-font-size.description",message:"Increase the font size",comment:"Description for increasing the font size."},oR={id:"extension.command.decrease-font-size.label",message:"Decrease",comment:"Label for decreasing the font size."},iR={id:"extension.command.decrease-font-size.description",message:"Decrease the font size.",comment:"Description for decreasing the font size."};var Al=Object.freeze({__proto__:null,DECREASE_DESCRIPTION:iR,DECREASE_LABEL:oR,INCREASE_DESCRIPTION:nR,INCREASE_LABEL:rR,SET_DESCRIPTION:tR,SET_LABEL:eR});const sR={id:"extension.command.toggle-heading.label",message:`{level, select, 1 {Heading 1} +`:"";return`${n}${o}For more information visit ${tE}#${e.toLowerCase()}`}var rE=class extends D4.BaseError{constructor({code:e,message:t,disableLogging:r=!1}={}){const n=vA(e)?e:H.CUSTOM;super(yA(n,t)),this.errorCode=n,this.url=`${tE}#${n.toLowerCase()}`,r||console.error(this.message)}static create(e={}){return new rE(e)}};function te(e,t){if(!e)throw rE.create(t)}function Rh(e){if(typeof e!="object"||e===null)return e;const t=Symbol.toStringTag in e&&e[Symbol.toStringTag]==="Module"?e.default??e:e;return t&&typeof e=="object"&&"__esModule"in t&&t.__esModule&&t.default!==void 0?t.default:t}function Hs(e,t={}){return e}function Kt(e){this.content=e}Kt.prototype={constructor:Kt,find:function(e){for(var t=0;t>1}};Kt.from=function(e){if(e instanceof Kt)return e;var t=[];if(e)for(var r in e)t.push(r,e[r]);return new Kt(t)};function nE(e,t,r){for(let n=0;;n++){if(n==e.childCount||n==t.childCount)return e.childCount==t.childCount?null:r;let o=e.child(n),i=t.child(n);if(o==i){r+=o.nodeSize;continue}if(!o.sameMarkup(i))return r;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)r++;return r}if(o.content.size||i.content.size){let s=nE(o.content,i.content,r+1);if(s!=null)return s}r+=o.nodeSize}}function oE(e,t,r,n){for(let o=e.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:r,b:n};let s=e.child(--o),a=t.child(--i),l=s.nodeSize;if(s==a){r-=l,n-=l;continue}if(!s.sameMarkup(a))return{a:r,b:n};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;ct&&n(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,r-u),n,o+u)}a=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,r,n,o){let i="",s=!0;return this.nodesBetween(t,r,(a,l)=>{a.isText?(i+=a.text.slice(Math.max(t,l)-l,r-l),s=!n):a.isLeaf?(o?i+=typeof o=="function"?o(a):o:a.type.spec.leafText&&(i+=a.type.spec.leafText(a)),s=!n):!s&&a.isBlock&&(i+=n,s=!0)},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let r=this.lastChild,n=t.firstChild,o=this.content.slice(),i=0;for(r.isText&&r.sameMarkup(n)&&(o[o.length-1]=r.withText(r.text+n.text),i=1);it)for(let i=0,s=0;st&&((sr)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,r-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,r-s-1))),n.push(a),o+=a.nodeSize),s=l}return new R(n,o)}cutByIndex(t,r){return t==r?R.empty:t==0&&r==this.content.length?this:new R(this.content.slice(t,r))}replaceChild(t,r){let n=this.content[t];if(n==r)return this;let o=this.content.slice(),i=this.size+r.nodeSize-n.nodeSize;return o[t]=r,new R(o,i)}addToStart(t){return new R([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new R(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let r=0;rthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,o=0;;n++){let i=this.child(n),s=o+i.nodeSize;if(s>=t)return s==t||r>0?rf(n+1,s):rf(n,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,r){if(!r)return R.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new R(r.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return R.empty;let r,n=0;for(let o=0;othis.type.rank&&(r||(r=t.slice(0,o)),r.push(this),n=!0),r&&r.push(i)}}return r||(r=t.slice()),n||r.push(this),r}removeFromSet(t){for(let r=0;rn.type.rank-o.type.rank),r}}Te.none=[];class bp extends Error{}class K{constructor(t,r,n){this.content=t,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,r){let n=sE(this.content,t+this.openStart,r);return n&&new K(n,this.openStart,this.openEnd)}removeBetween(t,r){return new K(iE(this.content,t+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,r){if(!r)return K.empty;let n=r.openStart||0,o=r.openEnd||0;if(typeof n!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new K(R.fromJSON(t,r.content),n,o)}static maxOpen(t,r=!0){let n=0,o=0;for(let i=t.firstChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=t.lastChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.lastChild)o++;return new K(t,n,o)}}K.empty=new K(R.empty,0,0);function iE(e,t,r){let{index:n,offset:o}=e.findIndex(t),i=e.maybeChild(n),{index:s,offset:a}=e.findIndex(r);if(o==t||i.isText){if(a!=r&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(r))}if(n!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(n,i.copy(iE(i.content,t-o-1,r-o-1)))}function sE(e,t,r,n){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return n&&!n.canReplace(o,o,r)?null:e.cut(0,t).append(r).append(e.cut(t));let a=sE(s.content,t-i-1,r);return a&&e.replaceChild(o,s.copy(a))}function bA(e,t,r){if(r.openStart>e.depth)throw new bp("Inserted content deeper than insertion position");if(e.depth-r.openStart!=t.depth-r.openEnd)throw new bp("Inconsistent open depths");return aE(e,t,r,0)}function aE(e,t,r,n){let o=e.index(n),i=e.node(n);if(o==t.index(n)&&n=0&&e.isText&&e.sameMarkup(t[r])?t[r]=e.withText(t[r].text+e.text):t.push(e)}function mu(e,t,r,n){let o=(t||e).node(r),i=0,s=t?t.index(r):o.childCount;e&&(i=e.index(r),e.depth>r?i++:e.textOffset&&(Gs(e.nodeAfter,n),i++));for(let a=i;ao&&C1(e,t,o+1),s=n.depth>o&&C1(r,n,o+1),a=[];return mu(null,e,o,a),i&&s&&t.index(o)==r.index(o)?(lE(i,s),Gs(Ys(i,cE(e,t,r,n,o+1)),a)):(i&&Gs(Ys(i,xp(e,t,o+1)),a),mu(t,r,o,a),s&&Gs(Ys(s,xp(r,n,o+1)),a)),mu(n,null,o,a),new R(a)}function xp(e,t,r){let n=[];if(mu(null,e,r,n),e.depth>r){let o=C1(e,t,r+1);Gs(Ys(o,xp(e,t,r+1)),n)}return mu(t,null,r,n),new R(n)}function xA(e,t){let r=t.depth-e.openStart,o=t.node(r).copy(e.content);for(let i=r-1;i>=0;i--)o=t.node(i).copy(R.from(o));return{start:o.resolveNoCache(e.openStart+r),end:o.resolveNoCache(o.content.size-e.openEnd-r)}}class Tl{constructor(t,r,n){this.pos=t,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,r=this.index(this.depth);if(r==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],o=t.child(r);return n?t.child(r).cut(n):o}get nodeBefore(){let t=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(t).cut(0,r):t==0?null:this.parent.child(t-1)}posAtIndex(t,r){r=this.resolveDepth(r);let n=this.path[r*3],o=r==0?0:this.path[r*3-1]+1;for(let i=0;i0;r--)if(this.start(r)<=t&&this.end(r)>=t)return r;return 0}blockRange(t=this,r){if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!r||r(this.node(n))))return new na(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&r<=t.content.size))throw new RangeError("Position "+r+" out of range");let n=[],o=0,i=r;for(let s=t;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(n.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new Tl(r,n,i)}static resolveCached(t,r){for(let o=0;ot&&this.nodesBetween(t,r,i=>(n.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),uE(this.marks,t)}contentMatchAt(t){let r=this.type.contentMatch.matchFragment(this.content,0,t);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(t,r,n=R.empty,o=0,i=n.childCount){let s=this.contentMatchAt(t).matchFragment(n,o,i),a=s&&s.matchFragment(this.content,r);if(!a||!a.validEnd)return!1;for(let l=o;lr.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let t={type:this.type.name};for(let r in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(r=>r.toJSON())),t}static fromJSON(t,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(t.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(r.text,n)}let o=R.fromJSON(t,r.content);return t.nodeType(r.type).create(r.attrs,o,n)}};Bi.prototype.text=void 0;class kp extends Bi{constructor(t,r,n,o){if(super(t,r,null,o),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):uE(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,r){return this.text.slice(t,r)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new kp(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new kp(this.type,this.attrs,t,this.marks)}cut(t=0,r=this.text.length){return t==0&&r==this.text.length?this:this.withText(this.text.slice(t,r))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function uE(e,t){for(let r=e.length-1;r>=0;r--)t=e[r].type.name+"("+t+")";return t}class oa{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,r){let n=new SA(t,r);if(n.next==null)return oa.empty;let o=dE(n);n.next&&n.err("Unexpected trailing text");let i=AA(_A(o));return NA(i,n),i}matchType(t){for(let r=0;rc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function r(n){t.push(n);for(let o=0;o{let i=o+(n.validEnd?"*":" ")+" ";for(let s=0;s"+t.indexOf(n.next[s].next);return i}).join(` +`)}}oa.empty=new oa(!0);class SA{constructor(t,r){this.string=t,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function dE(e){let t=[];do t.push(EA(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function EA(e){let t=[];do t.push(CA(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function CA(e){let t=OA(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=MA(e,t);else break;return t}function ek(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function MA(e,t){let r=ek(e),n=r;return e.eat(",")&&(e.next!="}"?n=ek(e):n=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:t}}function TA(e,t){let r=e.nodeTypes,n=r[t];if(n)return[n];let o=[];for(let i in r){let s=r[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function OA(e){if(e.eat("(")){let t=dE(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=TA(e,e.next).map(r=>(e.inline==null?e.inline=r.isInline:e.inline!=r.isInline&&e.err("Mixing inline and block content"),{type:"name",value:r}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function _A(e){let t=[[]];return o(i(e,0),r()),t;function r(){return t.push([])-1}function n(s,a,l){let c={term:l,to:a};return t[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=r())}else if(s.type=="star"){let l=r();return n(a,l),o(i(s.expr,l),l),[n(l)]}else if(s.type=="plus"){let l=r();return o(i(s.expr,a),l),o(i(s.expr,l),l),[n(l)]}else{if(s.type=="opt")return[n(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c{e[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=t[n.join(",")]=new oa(n.indexOf(e.length-1)>-1);for(let s=0;s-1}allowsMarks(t){if(this.markSet==null)return!0;for(let r=0;rn[i]=new gE(i,r,s));let o=r.spec.topNode||"doc";if(!n[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};class RA{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Nd{constructor(t,r,n,o){this.name=t,this.rank=r,this.schema=n,this.spec=o,this.attrs=mE(o.attrs),this.excluded=null;let i=pE(this.attrs);this.instance=i?new Te(this,i):null}create(t=null){return!t&&this.instance?this.instance:new Te(this,hE(this.attrs,t))}static compile(t,r){let n=Object.create(null),o=0;return t.forEach((i,s)=>n[i]=new Nd(i,o++,r,s)),n}removeFromSet(t){for(var r=0;r-1}}let PA=class{constructor(t){this.cached=Object.create(null);let r=this.spec={};for(let o in t)r[o]=t[o];r.nodes=Kt.from(t.nodes),r.marks=Kt.from(t.marks||{}),this.nodes=T1.compile(this.spec.nodes,this),this.marks=Nd.compile(this.spec.marks,this);let n=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[s]||(n[s]=oa.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?rk(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:rk(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,r=null,n,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof T1){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(r,n,o)}text(t,r){let n=this.nodes.text;return new kp(n,n.defaultAttrs,t,Te.setFrom(r))}mark(t,r){return typeof t=="string"&&(t=this.marks[t]),t.create(r)}nodeFromJSON(t){return Bi.fromJSON(this,t)}markFromJSON(t){return Te.fromJSON(this,t)}nodeType(t){let r=this.nodes[t];if(!r)throw new RangeError("Unknown node type: "+t);return r}};function rk(e,t){let r=[];for(let n=0;n-1)&&r.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[n]+"'")}return r}let Cv=class O1{constructor(t,r){this.schema=t,this.rules=r,this.tags=[],this.styles=[],r.forEach(n=>{n.tag?this.tags.push(n):n.style&&this.styles.push(n)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let o=t.nodes[n.node];return o.contentMatch.matchType(o)})}parse(t,r={}){let n=new ok(this,r,!1);return n.addAll(t,r.from,r.to),n.finish()}parseSlice(t,r={}){let n=new ok(this,r,!0);return n.addAll(t,r.from,r.to),K.maxOpen(n.finish())}matchTag(t,r,n){for(let o=n?this.tags.indexOf(n)+1:0;ot.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=r))){if(s.getAttrs){let l=s.getAttrs(r);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(t){let r=[];function n(o){let i=o.priority==null?50:o.priority,s=0;for(;s{n(s=ik(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in t.nodes){let i=t.nodes[o].spec.parseDOM;i&&i.forEach(s=>{n(s=ik(s)),s.node||s.ignore||s.mark||(s.node=o)})}return r}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new O1(t,O1.schemaRules(t)))}};const vE={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},zA={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},yE={ol:!0,ul:!0},wp=1,Sp=2,gu=4;function nk(e,t,r){return t!=null?(t?wp:0)|(t==="full"?Sp:0):e&&e.whitespace=="pre"?wp|Sp:r&~gu}class nf{constructor(t,r,n,o,i,s,a){this.type=t,this.attrs=r,this.marks=n,this.pendingMarks=o,this.solid=i,this.options=a,this.content=[],this.activeMarks=Te.none,this.stashMarks=[],this.match=s||(a&gu?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(R.from(t));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,o;return(o=n.findWrapping(t.type))?(this.match=n,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&wp)){let n=this.content[this.content.length-1],o;if(n&&n.isText&&(o=/[ \t\r\n\u000c]+$/.exec(n.text))){let i=n;n.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let r=R.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(R.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}popFromStashMark(t){for(let r=this.stashMarks.length-1;r>=0;r--)if(t.eq(this.stashMarks[r]))return this.stashMarks.splice(r,1)[0]}applyPending(t){for(let r=0,n=this.pendingMarks;rthis.addAll(t)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(t,()=>{this.addElementByRule(t,i,i.consuming===!1?o:void 0)})}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(` +`))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let r=Te.none,n=Te.none;for(let o=0;o{s.clearMark(a)&&(n=a.addToSet(n))}):r=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(r),s.consuming===!1)i=s;else break}return[r,n]}addElementByRule(t,r,n){let o,i,s;r.node?(i=this.parser.schema.nodes[r.node],i.isLeaf?this.insertNode(i.create(r.attrs))||this.leafFallback(t):o=this.enter(i,r.attrs||null,r.preserveWhitespace)):(s=this.parser.schema.marks[r.mark].create(r.attrs),this.addPendingMark(s));let a=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(r.getContent)this.findInside(t),r.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=t;typeof r.contentElement=="string"?l=t.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(t):r.contentElement&&(l=r.contentElement),this.findAround(t,l,!0),this.addAll(l)}o&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(t,r,n){let o=r||0;for(let i=r?t.childNodes[r]:t.firstChild,s=n==null?null:t.childNodes[n];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i);this.findAtPoint(t,o)}findPlace(t){let r,n;for(let o=this.open;o>=0;o--){let i=this.nodes[o],s=i.findWrapping(t);if(s&&(!r||r.length>s.length)&&(r=s,n=i,!s.length)||i.solid)break}if(!r)return!1;this.sync(n);for(let o=0;othis.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let r=this.open;r>=0;r--)if(this.nodes[r]==t)return this.open=r,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let o=n.length-1;o>=0;o--)t+=n[o].nodeSize;r&&t++}return t}findAtPoint(t,r){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let r=t.split("/"),n=this.options.context,o=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=r[a];if(c==""){if(a==r.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:n&&l>=i?n.node(l-i).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return s(r.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let r=t.depth;r>=0;r--){let n=t.node(r).contentMatchAt(t.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}addPendingMark(t){let r=HA(t,this.top.pendingMarks);r&&this.top.stashMarks.push(r),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,r){for(let n=this.open;n>=0;n--){let o=this.nodes[n];if(o.pendingMarks.lastIndexOf(t)>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);let s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==r)break}}}function LA(e){for(let t=e.firstChild,r=null;t;t=t.nextSibling){let n=t.nodeType==1?t.nodeName.toLowerCase():null;n&&yE.hasOwnProperty(n)&&r?(r.appendChild(t),t=r):n=="li"?r=t:n&&(r=null)}}function IA(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function DA(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,r,n=[];for(;r=t.exec(e);)n.push(r[1],r[2].trim());return n}function ik(e){let t={};for(let r in e)t[r]=e[r];return t}function $A(e,t){let r=t.schema.nodes;for(let n in r){let o=r[n];if(!o.allowsMarkType(e))continue;let i=[],s=a=>{i.push(a);for(let l=0;l{if(i.length||s.marks.length){let a=0,l=0;for(;a=0;o--){let i=this.serializeMark(t.marks[o],t.isInline,r);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,r,n={}){let o=this.marks[t.type.name];return o&&an.renderSpec(ag(n),o(t,r))}static renderSpec(t,r,n=null){if(typeof r=="string")return{dom:t.createTextNode(r)};if(r.nodeType!=null)return{dom:r};if(r.dom&&r.dom.nodeType!=null)return r;let o=r[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s,a=n?t.createElementNS(n,o):t.createElement(o),l=r[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;uc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:f,contentDOM:p}=an.renderSpec(t,d,n);if(a.appendChild(f),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:a,contentDOM:s}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new an(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let r=sk(t.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(t){return sk(t.marks)}}function sk(e){let t={};for(let r in e){let n=e[r].spec.toDOM;n&&(t[r]=n)}return t}function ag(e){return e.document||window.document}const bE=65535,xE=Math.pow(2,16);function BA(e,t){return e+t*xE}function ak(e){return e&bE}function FA(e){return(e-(e&bE))/xE}const kE=1,wE=2,If=4,SE=8;class _1{constructor(t,r,n){this.pos=t,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&SE)>0}get deletedBefore(){return(this.delInfo&(kE|If))>0}get deletedAfter(){return(this.delInfo&(wE|If))>0}get deletedAcross(){return(this.delInfo&If)>0}}class nn{constructor(t,r=!1){if(this.ranges=t,this.inverted=r,!t.length&&nn.empty)return nn.empty}recover(t){let r=0,n=ak(t);if(!this.inverted)for(let o=0;ot)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(t<=d){let f=c?t==l?-1:t==d?1:r:r,p=l+o+(f<0?0:u);if(n)return p;let h=t==(r<0?l:d)?null:BA(a/3,t-l),m=t==l?wE:t==d?kE:If;return(r<0?t!=l:t!=d)&&(m|=SE),new _1(p,m,h)}o+=u-c}return n?t+o:new _1(t+o,0,null)}touches(t,r){let n=0,o=ak(r),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;at)break;let c=this.ranges[a+i],u=l+c;if(t<=u&&a==o*3)return!0;n+=this.ranges[a+s]-c}return!1}forEach(t){let r=this.inverted?2:1,n=this.inverted?1:2;for(let o=0,i=0;o=0;r--){let o=t.getMirror(r);this.appendMap(t.maps[r].invert(),o!=null&&o>r?n-o-1:void 0)}}invert(){let t=new ul;return t.appendMappingInverted(this),t}map(t,r=1){if(this.mirror)return this._map(t,r,!0);for(let n=this.from;ni&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),r.openStart,r.openEnd);return yt.fromReplace(t,this.from,this.to,i)}invert(){return new eo(this.from,this.to,this.mark)}map(t){let r=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new Ko(r.pos,n.pos,this.mark)}merge(t){return t instanceof Ko&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ko(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ko(r.from,r.to,t.markFromJSON(r.mark))}}Rt.jsonID("addMark",Ko);class eo extends Rt{constructor(t,r,n){super(),this.from=t,this.to=r,this.mark=n}apply(t){let r=t.slice(this.from,this.to),n=new K(Mv(r.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),r.openStart,r.openEnd);return yt.fromReplace(t,this.from,this.to,n)}invert(){return new Ko(this.from,this.to,this.mark)}map(t){let r=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new eo(r.pos,n.pos,this.mark)}merge(t){return t instanceof eo&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new eo(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new eo(r.from,r.to,t.markFromJSON(r.mark))}}Rt.jsonID("removeMark",eo);class Li extends Rt{constructor(t,r){super(),this.pos=t,this.mark=r}apply(t){let r=t.nodeAt(this.pos);if(!r)return yt.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return yt.fromReplace(t,this.pos,this.pos+1,new K(R.from(n),0,r.isLeaf?0:1))}invert(t){let r=t.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let o=0;on.pos?null:new bt(r.pos,n.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new bt(r.from,r.to,r.gapFrom,r.gapTo,K.fromJSON(t,r.slice),r.insert,!!r.structure)}}Rt.jsonID("replaceAround",bt);function A1(e,t,r){let n=e.resolve(t),o=r-t,i=n.depth;for(;o>0&&i>0&&n.indexAfter(i)==n.node(i).childCount;)i--,o--;if(o>0){let s=n.node(i).maybeChild(n.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function VA(e,t,r,n){let o=[],i=[],s,a;e.doc.nodesBetween(t,r,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!n.isInSet(d)&&u.type.allowsMarkType(n.type)){let f=Math.max(c,t),p=Math.min(c+l.nodeSize,r),h=n.addToSet(d);for(let m=0;me.step(l)),i.forEach(l=>e.step(l))}function jA(e,t,r,n){let o=[],i=0;e.doc.nodesBetween(t,r,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(n instanceof Nd){let c=s.marks,u;for(;u=n.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else n?n.isInSet(s.marks)&&(l=[n]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,r);for(let u=0;ue.step(new eo(s.from,s.to,s.style)))}function UA(e,t,r,n=r.contentMatch){let o=e.doc.nodeAt(t),i=[],s=t+1;for(let a=0;a=0;a--)e.step(i[a])}function WA(e,t,r){return(t==0||e.canReplace(t,e.childCount))&&(r==e.childCount||e.canReplace(0,r))}function rc(e){let r=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let o=e.$from.node(n),i=e.$from.index(n),s=e.$to.indexAfter(n);if(nr;h--)m||n.index(h)>0?(m=!0,u=R.from(n.node(h).copy(u)),d++):l--;let f=R.empty,p=0;for(let h=i,m=!1;h>r;h--)m||o.after(h+1)=0;s--){if(n.size){let a=r[s].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=R.from(r[s].type.create(r[s].attrs,n))}let o=t.start,i=t.end;e.step(new bt(o,i,o,i,new K(n,0,0),r.length,!0))}function JA(e,t,r,n,o){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,r,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(n,o)&&XA(e.doc,e.mapping.slice(i).map(a),n)){e.clearIncompatible(e.mapping.slice(i).map(a,1),n);let l=e.mapping.slice(i),c=l.map(a,1),u=l.map(a+s.nodeSize,1);return e.step(new bt(c,u,c+1,u-1,new K(R.from(n.create(o,null,s.marks)),0,0),1,!0)),!1}})}function XA(e,t,r){let n=e.resolve(t),o=n.index();return n.parent.canReplaceWith(o,o+1,r)}function QA(e,t,r,n,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");r||(r=i.type);let s=r.create(n,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!r.validContent(i.content))throw new RangeError("Invalid content for node type "+r.name);e.step(new bt(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new K(R.from(s),0,0),1,!0))}function dl(e,t,r=1,n){let o=e.resolve(t),i=o.depth-r,s=n&&n[n.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=r-2;c>i;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=n&&n[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=n&&n[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let a=o.indexAfter(i),l=n&&n[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function ZA(e,t,r=1,n){let o=e.doc.resolve(t),i=R.empty,s=R.empty;for(let a=o.depth,l=o.depth-r,c=r-1;a>l;a--,c--){i=R.from(o.node(a).copy(i));let u=n&&n[c];s=R.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}e.step(new Dt(t,t,new K(i.append(s),r,r),!0))}function Rd(e,t){let r=e.resolve(t),n=r.index();return eN(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function eN(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function tN(e,t,r){let n=new Dt(t-r,t+r,K.empty,!0);e.step(n)}function EE(e,t,r){let n=e.resolve(t);if(n.parent.canReplaceWith(n.index(),n.index(),r))return t;if(n.parentOffset==0)for(let o=n.depth-1;o>=0;o--){let i=n.index(o);if(n.node(o).canReplaceWith(i,i,r))return n.before(o+1);if(i>0)return null}if(n.parentOffset==n.parent.content.size)for(let o=n.depth-1;o>=0;o--){let i=n.indexAfter(o);if(n.node(o).canReplaceWith(i,i,r))return n.after(o+1);if(i=0;s--){let a=s==n.depth?0:n.pos<=(n.start(s+1)+n.end(s+1))/2?-1:1,l=n.index(s)+(a>0?1:0),c=n.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?n.pos:a<0?n.before(s+1):n.after(s+1)}return null}function Ov(e,t,r=t,n=K.empty){if(t==r&&!n.size)return null;let o=e.resolve(t),i=e.resolve(r);return CE(o,i,n)?new Dt(t,r,n):new nN(o,i,n).fit()}function CE(e,t,r){return!r.openStart&&!r.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),r.content)}class nN{constructor(t,r,n){this.$from=t,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=R.empty;for(let o=0;o<=t.depth;o++){let i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=R.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,o=this.close(t<0?this.$to:n.doc.resolve(t));if(!o)return null;let i=this.placed,s=n.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new K(i,s,a);return t>-1?new bt(n.pos,t,this.$to.pos,this.$to.end(),l,r):l.size||n.pos!=this.$to.pos?new Dt(n.pos,o.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,o=this.unplaced.openEnd;n1&&(o=0),i.type.spec.isolating&&o<=n){t=n;break}r=i.content}for(let r=1;r<=2;r++)for(let n=r==1?t:this.unplaced.openStart;n>=0;n--){let o,i=null;n?(i=cg(this.unplaced.content,n-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(r==1&&(s?c.matchType(s.type)||(d=c.fillBefore(R.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:a,parent:i,inject:d};if(r==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:n,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:t,openStart:r,openEnd:n}=this.unplaced,o=cg(t,r);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new K(t,r+1,Math.max(n,o.size+r>=t.size-n?r+1:0)),!0)}dropNode(){let{content:t,openStart:r,openEnd:n}=this.unplaced,o=cg(t,r);if(o.childCount<=1&&r>0){let i=t.size-r<=r+o.size;this.unplaced=new K(zc(t,r-1,1),r-1,i?r-1:n)}else this.unplaced=new K(zc(t,r,1),r,n)}placeNodes({sliceDepth:t,frontierDepth:r,parent:n,inject:o,wrap:i}){for(;this.depth>r;)this.closeFrontierNode();if(i)for(let m=0;m1||l==0||m.content.size)&&(d=b,u.push(ME(m.mark(f.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?p:-1)))}let h=c==a.childCount;h||(p=-1),this.placed=Lc(this.placed,r,R.from(u)),this.frontier[r].match=d,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,b=a;m1&&o==this.$to.end(--n);)++o;return o}findCloseLevel(t){e:for(let r=Math.min(this.depth,t.depth);r>=0;r--){let{match:n,type:o}=this.frontier[r],i=r=0;a--){let{match:l,type:c}=this.frontier[a],u=ug(t,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:r,fit:s,move:i?t.doc.resolve(t.after(r+1)):t}}}}close(t){let r=this.findCloseLevel(t);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=Lc(this.placed,r.depth,r.fit)),t=r.move;for(let n=r.depth+1;n<=t.depth;n++){let o=t.node(n),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(n));this.openFrontierNode(o.type,o.attrs,i)}return t}openFrontierNode(t,r=null,n){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=Lc(this.placed,this.depth,R.from(t.create(r,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(R.empty,!0);r.childCount&&(this.placed=Lc(this.placed,this.frontier.length,r))}}function zc(e,t,r){return t==0?e.cutByIndex(r,e.childCount):e.replaceChild(0,e.firstChild.copy(zc(e.firstChild.content,t-1,r)))}function Lc(e,t,r){return t==0?e.append(r):e.replaceChild(e.childCount-1,e.lastChild.copy(Lc(e.lastChild.content,t-1,r)))}function cg(e,t){for(let r=0;r1&&(n=n.replaceChild(0,ME(n.firstChild,t-1,n.childCount==1?r-1:0))),t>0&&(n=e.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(e.type.contentMatch.matchFragment(n).fillBefore(R.empty,!0)))),e.copy(n)}function ug(e,t,r,n,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!r.compatibleContent(i.type))return null;let a=n.fillBefore(i.content,!0,s);return a&&!oN(r,i.content,s)?a:null}function oN(e,t,r){for(let n=r;n0;f--,p--){let h=o.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=n.openStart;for(let f=n.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==n.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=iN(p.type);if(h&&!p.sameMarkup(o.node(Math.abs(a)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=n.openStart;f>=0;f--){let p=(f+u+1)%(n.openStart+1),h=c[p];if(h)for(let m=0;m=0&&(e.replace(t,r,n),!(e.steps.length>d));f--){let p=s[f];p<0||(t=o.before(p),r=i.after(p))}}function TE(e,t,r,n,o){if(tn){let i=o.contentMatchAt(0),s=i.fillBefore(e).append(e);e=s.append(i.matchFragment(s).fillBefore(R.empty,!0))}return e}function aN(e,t,r,n){if(!n.isInline&&t==r&&e.doc.resolve(t).parent.content.size){let o=EE(e.doc,t,n.type);o!=null&&(t=r=o)}e.replaceRange(t,r,new K(R.from(n),0,0))}function lN(e,t,r){let n=e.doc.resolve(t),o=e.doc.resolve(r),i=OE(n,o);for(let s=0;s0&&(l||n.node(a-1).canReplace(n.index(a-1),o.indexAfter(a-1))))return e.delete(n.before(a),o.after(a))}for(let s=1;s<=n.depth&&s<=o.depth;s++)if(t-n.start(s)==n.depth-s&&r>n.end(s)&&o.end(s)-r!=o.depth-s)return e.delete(n.before(s),r);e.delete(t,r)}function OE(e,t){let r=[],n=Math.min(e.depth,t.depth);for(let o=n;o>=0;o--){let i=e.start(o);if(it.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(i==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==i-1)&&r.push(o)}return r}class fl extends Rt{constructor(t,r,n){super(),this.pos=t,this.attr=r,this.value=n}apply(t){let r=t.nodeAt(this.pos);if(!r)return yt.fail("No node at attribute step's position");let n=Object.create(null);for(let i in r.attrs)n[i]=r.attrs[i];n[this.attr]=this.value;let o=r.type.create(n,null,r.marks);return yt.fromReplace(t,this.pos,this.pos+1,new K(R.from(o),0,r.isLeaf?0:1))}getMap(){return nn.empty}invert(t){return new fl(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let r=t.mapResult(this.pos,1);return r.deletedAfter?null:new fl(r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new fl(r.pos,r.attr,r.value)}}Rt.jsonID("attr",fl);class Iu extends Rt{constructor(t,r){super(),this.attr=t,this.value=r}apply(t){let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let n=t.type.create(r,t.content,t.marks);return yt.ok(n)}getMap(){return nn.empty}invert(t){return new Iu(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Iu(r.attr,r.value)}}Rt.jsonID("docAttr",Iu);let _l=class extends Error{};_l=function e(t){let r=Error.call(this,t);return r.__proto__=e.prototype,r};_l.prototype=Object.create(Error.prototype);_l.prototype.constructor=_l;_l.prototype.name="TransformError";class cN{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new ul}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let r=this.maybeStep(t);if(r.failed)throw new _l(r.failed);return this}maybeStep(t){let r=t.apply(this.doc);return r.failed||this.addStep(t,r.doc),r}get docChanged(){return this.steps.length>0}addStep(t,r){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=r}replace(t,r=t,n=K.empty){let o=Ov(this.doc,t,r,n);return o&&this.step(o),this}replaceWith(t,r,n){return this.replace(t,r,new K(R.from(n),0,0))}delete(t,r){return this.replace(t,r,K.empty)}insert(t,r){return this.replaceWith(t,t,r)}replaceRange(t,r,n){return sN(this,t,r,n),this}replaceRangeWith(t,r,n){return aN(this,t,r,n),this}deleteRange(t,r){return lN(this,t,r),this}lift(t,r){return KA(this,t,r),this}join(t,r=1){return tN(this,t,r),this}wrap(t,r){return YA(this,t,r),this}setBlockType(t,r=t,n,o=null){return JA(this,t,r,n,o),this}setNodeMarkup(t,r,n=null,o){return QA(this,t,r,n,o),this}setNodeAttribute(t,r,n){return this.step(new fl(t,r,n)),this}setDocAttribute(t,r){return this.step(new Iu(t,r)),this}addNodeMark(t,r){return this.step(new Li(t,r)),this}removeNodeMark(t,r){if(!(r instanceof Te)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(r=r.isInSet(n.marks),!r)return this}return this.step(new Ol(t,r)),this}split(t,r=1,n){return ZA(this,t,r,n),this}addMark(t,r,n){return VA(this,t,r,n),this}removeMark(t,r,n){return jA(this,t,r,n),this}clearIncompatible(t,r,n){return UA(this,t,r,n),this}}const dg=Object.create(null);class be{constructor(t,r,n){this.$anchor=t,this.$head=r,this.ranges=n||[new uN(t.min(r),t.max(r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let r=0;r=0;i--){let s=r<0?Fa(t.node(0),t.node(i),t.before(i+1),t.index(i),r,n):Fa(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,r,n);if(s)return s}return null}static near(t,r=1){return this.findFrom(t,r)||this.findFrom(t,-r)||new kr(t.node(0))}static atStart(t){return Fa(t,t,0,0,1)||new kr(t)}static atEnd(t){return Fa(t,t,t.content.size,t.childCount,-1)||new kr(t)}static fromJSON(t,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=dg[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(t,r)}static jsonID(t,r){if(t in dg)throw new RangeError("Duplicate use of selection JSON ID "+t);return dg[t]=r,r.prototype.jsonID=t,r}getBookmark(){return le.between(this.$anchor,this.$head).getBookmark()}}be.prototype.visible=!0;class uN{constructor(t,r){this.$from=t,this.$to=r}}let ck=!1;function uk(e){!ck&&!e.parent.inlineContent&&(ck=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class le extends be{constructor(t,r=t){uk(t),uk(r),super(t,r)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,r){let n=t.resolve(r.map(this.head));if(!n.parent.inlineContent)return be.near(n);let o=t.resolve(r.map(this.anchor));return new le(o.parent.inlineContent?o:n,n)}replace(t,r=K.empty){if(super.replace(t,r),r==K.empty){let n=this.$from.marksAcross(this.$to);n&&t.ensureMarks(n)}}eq(t){return t instanceof le&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Ph(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new le(t.resolve(r.anchor),t.resolve(r.head))}static create(t,r,n=r){let o=t.resolve(r);return new this(o,n==r?o:t.resolve(n))}static between(t,r,n){let o=t.pos-r.pos;if((!n||o)&&(n=o>=0?1:-1),!r.parent.inlineContent){let i=be.findFrom(r,n,!0)||be.findFrom(r,-n,!0);if(i)r=i.$head;else return be.near(r,n)}return t.parent.inlineContent||(o==0?t=r:(t=(be.findFrom(t,-n,!0)||be.findFrom(t,n,!0)).$anchor,t.pos0?0:1);o>0?s=0;s+=o){let a=t.child(s);if(a.isAtom){if(!i&&ce.isSelectable(a))return ce.create(e,r-(o<0?a.nodeSize:0))}else{let l=Fa(e,a,r+o,o<0?a.childCount:0,o,i);if(l)return l}r+=a.nodeSize*o}return null}function dk(e,t,r){let n=e.steps.length-1;if(n{s==null&&(s=u)}),e.setSelection(be.near(e.doc.resolve(s),r))}const fk=1,of=2,pk=4;class fN extends cN{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=of,this}ensureMarks(t){return Te.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&of)>0}addStep(t,r){super.addStep(t,r),this.updated=this.updated&~of,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,r=!0){let n=this.selection;return r&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Te.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,r,n){let o=this.doc.type.schema;if(r==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(n==null&&(n=r),n=n??r,!t)return this.deleteRange(r,n);let i=this.storedMarks;if(!i){let s=this.doc.resolve(r);i=n==r?s.marks():s.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(r,n,o.text(t,i)),this.selection.empty||this.setSelection(be.near(this.selection.$to)),this}}setMeta(t,r){return this.meta[typeof t=="string"?t:t.key]=r,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=pk,this}get scrolledIntoView(){return(this.updated&pk)>0}}function hk(e,t){return!t||!e?e:e.bind(t)}class Ic{constructor(t,r,n){this.name=t,this.init=hk(r.init,n),this.apply=hk(r.apply,n)}}const pN=[new Ic("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Ic("selection",{init(e,t){return e.selection||be.atStart(t.doc)},apply(e){return e.selection}}),new Ic("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,r,n){return n.selection.$cursor?e.storedMarks:null}}),new Ic("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class fg{constructor(t,r){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=pN.slice(),r&&r.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new Ic(n.key,n.spec.state,n))})}}class Bs{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,r=-1){for(let n=0;nn.toJSON())),t&&typeof t=="object")for(let n in t){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[n],i=o.spec.state;i&&i.toJSON&&(r[n]=i.toJSON.call(o,this[o.key]))}return r}static fromJSON(t,r,n){if(!r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new fg(t.schema,t.plugins),i=new Bs(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Bi.fromJSON(t.schema,r.doc);else if(s.name=="selection")i.selection=be.fromJSON(i.doc,r.selection);else if(s.name=="storedMarks")r.storedMarks&&(i.storedMarks=r.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let a in n){let l=n[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(r,a)){i[s.name]=c.fromJSON.call(l,t,r[a],i);return}}i[s.name]=s.init(t,i)}}),i}}function _E(e,t,r){for(let n in e){let o=e[n];o instanceof Function?o=o.bind(t):n=="handleDOMEvents"&&(o=_E(o,t,{})),r[n]=o}return r}class Ro{constructor(t){this.spec=t,this.props={},t.props&&_E(t.props,this,this.props),this.key=t.key?t.key.key:AE("plugin")}getState(t){return t[this.key]}}const pg=Object.create(null);function AE(e){return e in pg?e+"$"+ ++pg[e]:(pg[e]=0,e+"$")}class ka{constructor(t="key"){this.key=AE(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}var hN=/[A-Z]/g,mN=/^ms-/,hg={};function gN(e){return"-"+e.toLowerCase()}function vN(e){if(hg.hasOwnProperty(e))return hg[e];var t=e.replace(hN,gN);return hg[e]=mN.test(t)?"-"+t:t}function yN(e){return vN(e)}function bN(e,t){return yN(e)+":"+t}function xN(e){var t="";for(var r in e){var n=e[r];typeof n!="string"&&typeof n!="number"||(t&&(t+=";"),t+=bN(r,n))}return t}function kN(){return typeof document<"u"?document:null}var NE=kN;function RE(e,t){if(typeof e!="string")return[e];var r=[e];typeof t=="string"||Array.isArray(t)?t={brackets:t}:t||(t={});var n=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],o=t.escape||"___",i=!!t.flat;n.forEach(function(l){var c=new RegExp(["\\",l[0],"[^\\",l[0],"\\",l[1],"]*\\",l[1]].join("")),u=[];function d(f,p,h){var m=r.push(f.slice(l[0].length,-l[1].length))-1;return u.push(m),o+m+o}r.forEach(function(f,p){for(var h,m=0;f!=h;)if(h=f,f=f.replace(c,d),m++>1e4)throw Error("References have circular dependency. Please, check them.");r[p]=f}),u=u.reverse(),r=r.map(function(f){return u.forEach(function(p){f=f.replace(new RegExp("(\\"+o+p+"\\"+o+")","g"),l[0]+"$1"+l[1])}),f})});var s=new RegExp("\\"+o+"([0-9]+)\\"+o);function a(l,c,u){for(var d=[],f,p=0;f=s.exec(l);){if(p++>1e4)throw Error("Circular references in parenthesis");d.push(l.slice(0,f.index)),d.push(a(c[f[1]],c)),l=l.slice(f.index+f[0].length)}return d.push(l),d}return i?r:a(r[0],r)}function PE(e,t){if(t&&t.flat){var r=t&&t.escape||"___",n=e[0],o;if(!n)return"";for(var i=new RegExp("\\"+r+"([0-9]+)\\"+r),s=0;n!=o;){if(s++>1e4)throw Error("Circular references in "+e);o=n,n=n.replace(i,a)}return n}return e.reduce(function l(c,u){return Array.isArray(u)&&(u=u.reduce(l,"")),c+u},"");function a(l,c){if(e[c]==null)throw Error("Reference "+c+"is undefined");return e[c]}}function Av(e,t){return Array.isArray(e)?PE(e,t):RE(e,t)}Av.parse=RE;Av.stringify=PE;var wN=Av;const SN=Dn(wN),EN={id:"extension.command.copy.label",message:"Copy",comment:"Label for copy command."},CN={id:"extension.command.copy.description",message:"Copy the selected text",comment:"Description for copy command."},MN={id:"extension.command.cut.label",message:"Cut",comment:"Label for cut command."},TN={id:"extension.command.cut.description",message:"Cut the selected text",comment:"Description for cut command."},ON={id:"extension.command.paste.label",message:"Paste",comment:"Label for paste command."},_N={id:"extension.command.paste.description",message:"Paste content into the editor",comment:"Description for paste command."},AN={id:"extension.command.select-all.label",message:"Select all",comment:"Label for select all command."},NN={id:"extension.command.select-all.description",message:"Select all content within the editor",comment:"Description for select all command."};var es=Object.freeze({__proto__:null,COPY_DESCRIPTION:CN,COPY_LABEL:EN,CUT_DESCRIPTION:TN,CUT_LABEL:MN,PASTE_DESCRIPTION:_N,PASTE_LABEL:ON,SELECT_ALL_DESCRIPTION:NN,SELECT_ALL_LABEL:AN});const RN={id:"keyboard.shortcut.escape",message:"Enter",comment:"Label for escape key in shortcuts."},PN={id:"keyboard.shortcut.command",message:"Command",comment:"Label for command key in shortcuts."},zN={id:"keyboard.shortcut.control",message:"Control",comment:"Label for control key in shortcuts."},LN={id:"keyboard.shortcut.enter",message:"Enter",comment:"Label for enter key in shortcuts."},IN={id:"keyboard.shortcut.shift",message:"Shift",comment:"Label for shift key in shortcuts."},DN={id:"keyboard.shortcut.alt",message:"Alt",comment:"Label for alt key in shortcuts."},$N={id:"keyboard.shortcut.capsLock",message:"Caps Lock",comment:"Label for caps lock key in shortcuts."},HN={id:"keyboard.shortcut.backspace",message:"Backspace",comment:"Label for backspace key in shortcuts."},BN={id:"keyboard.shortcut.tab",message:"Tab",comment:"Label for tab key in shortcuts."},FN={id:"keyboard.shortcut.space",message:"Space",comment:"Label for space key in shortcuts."},VN={id:"keyboard.shortcut.delete",message:"Delete",comment:"Label for delete key in shortcuts."},jN={id:"keyboard.shortcut.pageUp",message:"Page Up",comment:"Label for page up key in shortcuts."},UN={id:"keyboard.shortcut.pageDown",message:"Page Down",comment:"Label for page down key in shortcuts."},WN={id:"keyboard.shortcut.home",message:"Home",comment:"Label for home key in shortcuts."},KN={id:"keyboard.shortcut.end",message:"End",comment:"Label for end key in shortcuts."},qN={id:"keyboard.shortcut.arrowLeft",message:"Arrow Left",comment:"Label for arrow left key in shortcuts."},GN={id:"keyboard.shortcut.arrowRight",message:"Arrow Right",comment:"Label for arrow right key in shortcuts."},YN={id:"keyboard.shortcut.arrowUp",message:"Arrow Up",comment:"Label for arrow up key in shortcuts."},JN={id:"keyboard.shortcut.arrowDown",message:"Arrow Down",comment:"Label for arrowDown key in shortcuts."};var Mt=Object.freeze({__proto__:null,ALT_KEY:DN,ARROW_DOWN_KEY:JN,ARROW_LEFT_KEY:qN,ARROW_RIGHT_KEY:GN,ARROW_UP_KEY:YN,BACKSPACE_KEY:HN,CAPS_LOCK_KEY:$N,COMMAND_KEY:PN,CONTROL_KEY:zN,DELETE_KEY:VN,END_KEY:KN,ENTER_KEY:LN,ESCAPE_KEY:RN,HOME_KEY:WN,PAGE_DOWN_KEY:UN,PAGE_UP_KEY:jN,SHIFT_KEY:IN,SPACE_KEY:FN,TAB_KEY:BN});const XN={id:"extension.command.toggle-blockquote.label",message:"Blockquote",comment:"Label for blockquote formatting command."},QN={id:"extension.command.toggle-blockquote.description",message:"Add blockquote formatting to the selected text",comment:"Description for blockquote formatting command."};var mk=Object.freeze({__proto__:null,DESCRIPTION:QN,LABEL:XN});const ZN={id:"extension.command.toggle-bold.label",message:"Bold",comment:"Label for bold formatting command."},eR={id:"extension.command.toggle-bold.description",message:"Add bold formatting to the selected text",comment:"Description for bold formatting command."};var gk=Object.freeze({__proto__:null,DESCRIPTION:eR,LABEL:ZN});const tR={id:"extension.command.toggle-code-block.label",message:"Codeblock",comment:"Label for the code block command."},rR={id:"extension.command.toggle-code-block.description",message:"Add a code block",comment:"Description for the code block command."};var nR=Object.freeze({__proto__:null,DESCRIPTION:rR,LABEL:tR});const oR={id:"extension.command.toggle-code.label",message:"Code",comment:"Label for the inline code formatting."},iR={id:"extension.command.toggle-code.description",message:"Add inline code formatting to the selected text",comment:"Description for the inline code formatting command."};var sR=Object.freeze({__proto__:null,DESCRIPTION:iR,LABEL:oR});const aR={id:"extension.command.set-font-size.label",message:"Font size",comment:"Label for adding a font size."},lR={id:"extension.command.set-font-size.description",message:"Set the font size for the selected text.",comment:"Description for adding a font size."},cR={id:"extension.command.increase-font-size.label",message:"Increase",comment:"Label for increasing the font size."},uR={id:"extension.command.increase-font-size.description",message:"Increase the font size",comment:"Description for increasing the font size."},dR={id:"extension.command.decrease-font-size.label",message:"Decrease",comment:"Label for decreasing the font size."},fR={id:"extension.command.decrease-font-size.description",message:"Decrease the font size.",comment:"Description for decreasing the font size."};var Al=Object.freeze({__proto__:null,DECREASE_DESCRIPTION:fR,DECREASE_LABEL:dR,INCREASE_DESCRIPTION:uR,INCREASE_LABEL:cR,SET_DESCRIPTION:lR,SET_LABEL:aR});const pR={id:"extension.command.toggle-heading.label",message:`{level, select, 1 {Heading 1} 2 {Heading 2} 3 {Heading 3} 4 {Heading 4} 5 {Heading 5} 6 {Heading 6} -other {Heading}}`,comment:"Label for heading command with support for levels."};var aR=Object.freeze({__proto__:null,LABEL:sR});const lR={id:"extension.command.undo.label",message:"Undo",comment:"Label for undo."},cR={id:"extension.command.undo.description",message:"Undo the most recent action",comment:"Description for undo."},uR={id:"extension.command.redo.label",message:"Redo",comment:"Label for redo."},dR={id:"extension.command.redo.description",message:"Redo the most recent action",comment:"Description for redo."};var wp=Object.freeze({__proto__:null,REDO_DESCRIPTION:dR,REDO_LABEL:uR,UNDO_DESCRIPTION:cR,UNDO_LABEL:lR});const fR={id:"extension.command.insert-horizontal-rule.label",message:"Divider",comment:"Label for inserting a horizontal rule (divider) command."},pR={id:"extension.command.insert-horizontal-rule.description",message:"Separate content with a diving horizontal line",comment:"Description for inserting a horizontal rule (divider) command."};var hk=Object.freeze({__proto__:null,DESCRIPTION:pR,LABEL:fR});const hR={id:"extension.command.toggle-italic.label",message:"Italic",comment:"Label for italic formatting command."},mR={id:"extension.command.toggle-italic.description",message:"Italicize the selected text",comment:"Description for italic formatting command."};var mk=Object.freeze({__proto__:null,DESCRIPTION:mR,LABEL:hR});const gR={id:"extension.command.toggle-ordered-list.label",message:"Ordered list",comment:"Label for inserting an ordered list into the editor."},vR={id:"extension.command.toggle-bullet-list.description",message:"Bulleted list",comment:"Description for inserting a bullet list into the editor."},yR={id:"extension.command.toggle-task-list.description",message:"Tasked list",comment:"Description for inserting a task list into the editor."};var Ov=Object.freeze({__proto__:null,BULLET_LIST_LABEL:vR,ORDERED_LIST_LABEL:gR,TASK_LIST_LABEL:yR});const bR={id:"extension.command.increase-indent.label",message:"Increase indentation",comment:"Label for increasing the indentation level."},xR={id:"extension.command.decrease-indent.label",message:"Decrease indentation",comment:"Label for decreasing the indentation level of the current node block."},kR={id:"extension.command.center-align.label",message:"Center align",comment:"Center align the text in the current node."},wR={id:"extension.command.justify-align.label",message:"Justify",comment:"Justify the alignment of the selected nodes."},SR={id:"extension.command.right-align.label",message:"Right align",comment:"Right align the selected nodes."},ER={id:"extension.command.left-align.label",message:"Left align",comment:"Left align the selected nodes."};var rc=Object.freeze({__proto__:null,CENTER_ALIGN_LABEL:kR,DECREASE_INDENT_LABEL:xR,INCREASE_INDENT_LABEL:bR,JUSTIFY_ALIGN_LABEL:wR,LEFT_ALIGN_LABEL:ER,RIGHT_ALIGN_LABEL:SR});const CR={id:"extension.command.insert-paragraph.label",message:"Insert Paragraph",comment:"Label for inserting a paragraph."},MR={id:"extension.command.insert-paragraph.description",message:"Insert a new paragraph",comment:"Description for inserting a paragraph."},TR={id:"extension.command.convert-paragraph.label",message:"Convert Paragraph",comment:"Label for converting the current node into a paragraph."},OR={id:"extension.command.convert-paragraph.description",message:"Convert current block into a paragraph block.",comment:"Description for converting a paragraph."};var Sp=Object.freeze({__proto__:null,CONVERT_DESCRIPTION:OR,CONVERT_LABEL:TR,INSERT_DESCRIPTION:MR,INSERT_LABEL:CR});const _R={id:"extension.command.toggle-strike.label",message:"Strikethrough",comment:"Label for strike formatting command."},AR={id:"extension.command.toggle-strike.description",message:"Strikethrough the selected text",comment:"Description for strike formatting command."};var gk=Object.freeze({__proto__:null,DESCRIPTION:AR,LABEL:_R});const NR={id:"extension.command.toggle-underline.label",message:"Underline",comment:"Label for underline formatting command."},RR={id:"extension.command.toggle-underline.description",message:"Underline the selected text",comment:"Description for underline formatting command."};var vk=Object.freeze({__proto__:null,DESCRIPTION:RR,LABEL:NR});class wa{constructor(t,r){this.match=t,this.match=t,this.handler=typeof r=="string"?PR(r):r}}function PR(e){return function(t,r,n,o){let i=e;if(r[1]){let s=r[0].lastIndexOf(r[1]);i+=r[0].slice(s+r[1].length),n+=s;let a=n-o;a>0&&(i=r[0].slice(s-a,s)+i,n=o)}return t.tr.insertText(i,n,o)}}const zR=500;function LR({rules:e}){let t=new Ro({state:{init(){return null},apply(r,n){let o=r.getMeta(this);return o||(r.selectionSet||r.docChanged?null:n)}},props:{handleTextInput(r,n,o,i){return yk(r,n,o,i,e,t)},handleDOMEvents:{compositionend:r=>{setTimeout(()=>{let{$cursor:n}=r.state.selection;n&&yk(r,n.pos,n.pos,"",e,t)})}}},isInputRules:!0});return t}function yk(e,t,r,n,o,i){if(e.composing)return!1;let s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;let l=a.parent.textBetween(Math.max(0,a.parentOffset-zR),a.parentOffset,null,"")+n;for(let c=0;c{let r=e.plugins;for(let n=0;n=0;l--)s.step(a.steps[l].invert(a.docs[l]));if(i.text){let l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,l))}else s.delete(i.from,i.to);t(s)}return!0}}return!1};function Nh(e,t,r=null,n){return new wa(e,(o,i,s,a)=>{let l=r instanceof Function?r(i):r,c=o.tr.delete(s,a),u=c.doc.resolve(s),d=u.blockRange(),f=d&&Ev(d,t,l);if(!f)return null;c.wrap(d,f);let p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==t&&Nd(c.doc,s-1)&&(!n||n(i,p))&&c.join(s-1),c})}function DR(e,t,r=null){return new wa(e,(n,o,i,s)=>{let a=n.doc.resolve(i),l=r instanceof Function?r(o):r;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t)?n.tr.delete(i,s).setBlockType(i,i,t,l):null})}const yr=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Iu=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let bk=null;const Fo=function(e,t,r){let n=bk||(bk=document.createRange());return n.setEnd(e,r??e.nodeValue.length),n.setStart(e,t||0),n},ia=function(e,t,r,n){return r&&(xk(e,t,r,n,-1)||xk(e,t,r,n,1))},$R=/^(img|br|input|textarea|hr)$/i;function xk(e,t,r,n,o){for(;;){if(e==r&&t==n)return!0;if(t==(o<0?0:yo(e))){let i=e.parentNode;if(!i||i.nodeType!=1||_v(e)||$R.test(e.nodeName)||e.contentEditable=="false")return!1;t=yr(e)+(o<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(o<0?-1:0)],e.contentEditable=="false")return!1;t=o<0?yo(e):0}else return!1}}function yo(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function HR(e,t,r){for(let n=t==0,o=t==yo(e);n||o;){if(e==r)return!0;let i=yr(e);if(e=e.parentNode,!e)return!1;n=n&&i==0,o=o&&i==yo(e)}}function _v(e){let t;for(let r=e;r&&!(t=r.pmViewDesc);r=r.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Rh=function(e){return e.focusNode&&ia(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function $s(e,t){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=e,r.key=r.code=t,r}function BR(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function FR(e,t,r){if(e.caretPositionFromPoint)try{let n=e.caretPositionFromPoint(t,r);if(n)return{node:n.offsetNode,offset:n.offset}}catch{}if(e.caretRangeFromPoint){let n=e.caretRangeFromPoint(t,r);if(n)return{node:n.startContainer,offset:n.startOffset}}}const To=typeof navigator<"u"?navigator:null,kk=typeof document<"u"?document:null,ms=To&&To.userAgent||"",O1=/Edge\/(\d+)/.exec(ms),AE=/MSIE \d/.exec(ms),_1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ms),Ir=!!(AE||_1||O1),Fi=AE?document.documentMode:_1?+_1[1]:O1?+O1[1]:0,oo=!Ir&&/gecko\/(\d+)/i.test(ms);oo&&+(/Firefox\/(\d+)/.exec(ms)||[0,0])[1];const A1=!Ir&&/Chrome\/(\d+)/.exec(ms),ur=!!A1,VR=A1?+A1[1]:0,wr=!Ir&&!!To&&/Apple Computer/.test(To.vendor),Nl=wr&&(/Mobile\/\w+/.test(ms)||!!To&&To.maxTouchPoints>2),kn=Nl||(To?/Mac/.test(To.platform):!1),jR=To?/Win/.test(To.platform):!1,Yn=/Android \d/.test(ms),Rd=!!kk&&"webkitFontSmoothing"in kk.documentElement.style,UR=Rd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function WR(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Lo(e,t){return typeof e=="number"?e:e[t]}function KR(e){let t=e.getBoundingClientRect(),r=t.width/e.offsetWidth||1,n=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*r,top:t.top,bottom:t.top+e.clientHeight*n}}function wk(e,t,r){let n=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=r||e.dom;s;s=Iu(s)){if(s.nodeType!=1)continue;let a=s,l=a==i.body,c=l?WR(i):KR(a),u=0,d=0;if(t.topc.bottom-Lo(n,"bottom")&&(d=t.bottom-t.top>c.bottom-c.top?t.top+Lo(o,"top")-c.top:t.bottom-c.bottom+Lo(o,"bottom")),t.leftc.right-Lo(n,"right")&&(u=t.right-c.right+Lo(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let h=a.scrollLeft-f,m=a.scrollTop-p;t={left:t.left-h,top:t.top-m,right:t.right-h,bottom:t.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function qR(e){let t=e.dom.getBoundingClientRect(),r=Math.max(0,t.top),n,o;for(let i=(t.left+t.right)/2,s=r+1;s=r-20){n=a,o=l.top;break}}return{refDOM:n,refTop:o,stack:NE(e.dom)}}function NE(e){let t=[],r=e.ownerDocument;for(let n=e;n&&(t.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),e!=r);n=Iu(n));return t}function GR({refDOM:e,refTop:t,stack:r}){let n=e?e.getBoundingClientRect().top:0;RE(r,n==0?0:n-t)}function RE(e,t){for(let r=0;r=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let m=h.left>t.left?h.left-t.left:h.right=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!l&&h.left<=t.left&&h.right>=t.left&&(l=u,c={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!r&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(i=d+1)}}return!r&&l&&(r=l,o=c,n=0),r&&r.nodeType==3?JR(r,o):!r||n&&r.nodeType==1?{node:e,offset:i}:PE(r,o)}function JR(e,t){let r=e.nodeValue.length,n=document.createRange();for(let o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function Av(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function XR(e,t){let r=e.parentNode;return r&&/^li$/i.test(r.nodeName)&&t.left(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(n,o,i)}function ZR(e,t,r,n){let o=-1;for(let i=t,s=!1;i!=e.dom;){let a=e.docView.nearestDesc(i,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!s||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!s&&(s=!0,l.left>n.left||l.top>n.top?o=a.posBefore:(l.right-1?o:e.docView.posFromDOM(t,r,-1)}function zE(e,t,r){let n=e.childNodes.length;if(n&&r.topt.top&&o++}let c;Rd&&o&&n.nodeType==1&&(c=n.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=t.top&&o--,n==e.dom&&o==n.childNodes.length-1&&n.lastChild.nodeType==1&&t.top>n.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(o==0||n.nodeType!=1||n.childNodes[o-1].nodeName!="BR")&&(a=ZR(e,n,o,t))}a==null&&(a=QR(e,s,t));let l=e.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Sk(e){return e.top=0&&o==n.nodeValue.length?(l--,u=1):r<0?l--:c++,vc(ki(Fo(n,l,c),u),u<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&o&&(r<0||o==yo(n))){let l=n.childNodes[o-1];if(l.nodeType==1)return fg(l.getBoundingClientRect(),!1)}if(i==null&&o=0)}if(i==null&&o&&(r<0||o==yo(n))){let l=n.childNodes[o-1],c=l.nodeType==3?Fo(l,yo(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return vc(ki(c,1),!1)}if(i==null&&o=0)}function vc(e,t){if(e.width==0)return e;let r=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:r,right:r}}function fg(e,t){if(e.height==0)return e;let r=t?e.top:e.bottom;return{top:r,bottom:r,left:e.left,right:e.right}}function IE(e,t,r){let n=e.state,o=e.root.activeElement;n!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return r()}finally{n!=t&&e.updateState(n),o!=e.dom&&o&&o.focus()}}function rP(e,t,r){let n=t.selection,o=r=="up"?n.$from:n.$to;return IE(e,t,()=>{let{node:i}=e.docView.domFromPos(o.pos,r=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=LE(e,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Fo(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(r=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const nP=/[\u0590-\u08ac]/;function oP(e,t,r){let{$head:n}=t.selection;if(!n.parent.isTextblock)return!1;let o=n.parentOffset,i=!o,s=o==n.parent.content.size,a=e.domSelection();return!nP.test(n.parent.textContent)||!a.modify?r=="left"||r=="backward"?i:s:IE(e,t,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=e.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",r,"character");let p=n.depth?e.docView.domAfterPos(n.before()):e.dom,{focusNode:h,focusOffset:m}=e.domSelectionRange(),b=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==m;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),b})}let Ek=null,Ck=null,Mk=!1;function iP(e,t,r){return Ek==t&&Ck==r?Mk:(Ek=t,Ck=r,Mk=r=="up"||r=="down"?rP(e,t,r):oP(e,t,r))}const Tn=0,Tk=1,Fs=2,Oo=3;class Pd{constructor(t,r,n,o){this.parent=t,this.children=r,this.dom=n,this.contentDOM=o,this.dirty=Tn,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,r,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let r=0;ryr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&r==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??n>0?this.posAtEnd:this.posAtStart}nearestDesc(t,r=!1){for(let n=!0,o=t;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!r||i.node))if(n&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))n=!1;else return i}}getDesc(t){let r=t.pmViewDesc;for(let n=r;n;n=n.parent)if(n==this)return r}posFromDOM(t,r,n){for(let o=t;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(t,r,n)}return-1}descAt(t){for(let r=0,n=0;rt||s instanceof $E){o=t-i;break}i=a}if(o)return this.children[n].domFromPos(o-this.children[n].border,r);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof DE&&i.side>=0;n--);if(r<=0){let i,s=!0;for(;i=n?this.children[n-1]:null,!(!i||i.dom.parentNode==this.contentDOM);n--,s=!1);return i&&r&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,r):{node:this.contentDOM,offset:i?yr(i.dom)+1:0}}else{let i,s=!0;for(;i=n=u&&r<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,r,u);t=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=yr(f.dom)+1;break}t-=f.size}o==-1&&(o=0)}if(o>-1&&(c>r||a==this.children.length-1)){r=c;for(let u=a+1;up&&sr){let p=a;a=l,l=p}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,r){for(let n=0,o=0;o=n:tn){let a=n+i.border,l=s-i.border;if(t>=a&&r<=l){this.dirty=t==n||r==s?Fs:Tk,t==a&&r==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Oo:i.markDirty(t-a,r-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Fs:Oo}n=s}this.dirty=Fs}markParentsDirty(){let t=1;for(let r=this.parent;r;r=r.parent,t++){let n=t==1?Fs:Tk;r.dirty{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!r.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=r,this.widget=r,i=this}matchesWidget(t){return this.dirty==Tn&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let r=this.widget.spec.stopEvent;return r?r(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class sP extends Pd{constructor(t,r,n,o){super(t,[],r,null),this.textDOM=n,this.text=o}get size(){return this.text.length}localPosFromDOM(t,r){return t!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class sa extends Pd{constructor(t,r,n,o){super(t,[],n,o),this.mark=r}static create(t,r,n,o){let i=o.nodeViews[r.type.name],s=i&&i(r,o,n);return(!s||!s.dom)&&(s=sn.renderSpec(document,r.type.spec.toDOM(r,n))),new sa(t,r,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Oo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Oo&&this.mark.eq(t)}markDirty(t,r){if(super.markDirty(t,r),this.dirty!=Tn){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty0&&(i=P1(i,0,t,n));for(let a=0;a{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},n,o),u=c&&c.dom,d=c&&c.contentDOM;if(r.isText){if(!u)u=document.createTextNode(r.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=sn.renderSpec(document,r.type.spec.toDOM(r)));!d&&!r.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),r.type.spec.draggable&&(u.draggable=!0));let f=u;return u=FE(u,n,r),c?l=new aP(t,r,n,o,u,d||null,f,c,i,s+1):r.isText?new Ph(t,r,n,o,u,f,i):new Vi(t,r,n,o,u,d||null,f,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let n=this.children[r];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>R.empty)}return t}matchesNode(t,r,n){return this.dirty==Tn&&t.eq(this.node)&&R1(r,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,r){let n=this.node.inlineContent,o=r,i=t.composing?this.localCompositionInfo(t,r):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new cP(this,s&&s.node,t);fP(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,n,t):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Te.none:this.node.child(u).marks,n,t),l.placeWidget(c,t,o)},(c,u,d,f)=>{l.syncToMarks(c.marks,n,t);let p;l.findNodeMatch(c,u,d,f)||a&&t.state.selection.from>o&&t.state.selection.to-1&&l.updateNodeAt(c,u,d,p,t)||l.updateNextNode(c,u,d,t,f,o)||l.addNode(c,u,d,t,o),o+=c.nodeSize}),l.syncToMarks([],n,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Fs)&&(s&&this.protectLocalComposition(t,s),HE(this.contentDOM,this.children,t),Nl&&pP(this.dom))}localCompositionInfo(t,r){let{from:n,to:o}=t.state.selection;if(!(t.state.selection instanceof le)||nr+this.node.content.size)return null;let i=t.domSelectionRange(),s=hP(i.focusNode,i.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=mP(this.node.content,a,n-r,o-r);return l<0?null:{node:s,pos:l,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:r,pos:n,text:o}){if(this.getDesc(r))return;let i=r;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new sP(this,i,r,o);t.input.compositionNodes.push(s),this.children=P1(this.children,n,n+o.length,t,s)}update(t,r,n,o){return this.dirty==Oo||!t.sameMarkup(this.node)?!1:(this.updateInner(t,r,n,o),!0)}updateInner(t,r,n,o){this.updateOuterDeco(r),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=Tn}updateOuterDeco(t){if(R1(t,this.outerDeco))return;let r=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=BE(this.dom,this.nodeDOM,N1(this.outerDeco,this.node,r),N1(t,this.node,r)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Ok(e,t,r,n,o){FE(n,t,e);let i=new Vi(void 0,e,t,r,n,n,n,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Ph extends Vi{constructor(t,r,n,o,i,s,a){super(t,r,n,o,i,null,s,a,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,r,n,o){return this.dirty==Oo||this.dirty!=Tn&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(r),(this.dirty!=Tn||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=Tn,!0)}inParent(){let t=this.parent.contentDOM;for(let r=this.nodeDOM;r;r=r.parentNode)if(r==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,r,n){return t==this.nodeDOM?this.posAtStart+Math.min(r,this.node.text.length):super.localPosFromDOM(t,r,n)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,r,n){let o=this.node.cut(t,r),i=document.createTextNode(o.text);return new Ph(this.parent,o,this.outerDeco,this.innerDeco,i,i,n)}markDirty(t,r){super.markDirty(t,r),this.dom!=this.nodeDOM&&(t==0||r==this.nodeDOM.nodeValue.length)&&(this.dirty=Oo)}get domAtom(){return!1}}class $E extends Pd{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Tn&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class aP extends Vi{constructor(t,r,n,o,i,s,a,l,c,u){super(t,r,n,o,i,s,a,c,u),this.spec=l}update(t,r,n,o){if(this.dirty==Oo)return!1;if(this.spec.update){let i=this.spec.update(t,r,n);return i&&this.updateInner(t,r,n,o),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,r,n,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,r,n,o){this.spec.setSelection?this.spec.setSelection(t,r,n):super.setSelection(t,r,n,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function HE(e,t,r){let n=e.firstChild,o=!1;for(let i=0;i>1,s=Math.min(i,t.length);for(;o-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=sa.create(this.top,t[i],r,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(t,r,n,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(t,r,n))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(n){let c=r.children[n-1];if(c instanceof sa)r=c,n=c.children.length;else{a=c,n--;break}}else{if(r==t)break e;n=r.parent.children.indexOf(r),r=r.parent}let l=a.node;if(l){if(l!=e.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function dP(e,t){return e.type.side-t.type.side}function fP(e,t,r,n){let o=t.locals(e),i=0;if(o.length==0){for(let c=0;ci;)a.push(o[s++]);let h=i+f.nodeSize;if(f.isText){let b=h;s!b.inline):a.slice();n(f,m,t.forChild(i,f),p),i=h}}function pP(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function hP(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=yo(e)}else if(e.nodeType==1&&t=r){if(i>=n&&l.slice(n-t.length-a,n-a)==t)return n-t.length;let c=a=0&&c+t.length+a>=r)return a+c;if(r==n&&l.length>=n+t.length-a&&l.slice(n-a,n-a+t.length)==t)return n}}return-1}function P1(e,t,r,n,o){let i=[];for(let s=0,a=0;s=r||u<=t?i.push(l):(cr&&i.push(l.slice(r-c,l.size,n)))}return i}function Nv(e,t=null){let r=e.domSelectionRange(),n=e.state.doc;if(!r.focusNode)return null;let o=e.docView.nearestDesc(r.focusNode),i=o&&o.size==0,s=e.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(s<0)return null;let a=n.resolve(s),l,c;if(Rh(r)){for(l=a;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&ce.isSelectable(u)&&o.parent&&!(u.isInline&&HR(r.focusNode,r.focusOffset,o.dom))){let d=o.posBefore;c=new ce(s==d?a:n.resolve(d))}}else{let u=e.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(u<0)return null;l=n.resolve(u)}if(!c){let u=t=="pointer"||e.state.selection.head{(r.anchorNode!=n||r.anchorOffset!=o)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!VE(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function vP(e){let t=e.domSelection(),r=document.createRange(),n=e.cursorWrapper.dom,o=n.nodeName=="IMG";o?r.setEnd(n.parentNode,yr(n)+1):r.setEnd(n,0),r.collapse(!1),t.removeAllRanges(),t.addRange(r),!o&&!e.state.selection.visible&&Ir&&Fi<=11&&(n.disabled=!0,n.disabled=!1)}function jE(e,t){if(t instanceof ce){let r=e.docView.descAt(t.from);r!=e.lastSelectedViewDesc&&(Pk(e),r&&r.selectNode(),e.lastSelectedViewDesc=r)}else Pk(e)}function Pk(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Rv(e,t,r,n){return e.someProp("createSelectionBetween",o=>o(e,t,r))||le.between(t,r,n)}function zk(e){return e.editable&&!e.hasFocus()?!1:UE(e)}function UE(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function yP(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),r=e.domSelectionRange();return ia(t.node,t.offset,r.anchorNode,r.anchorOffset)}function z1(e,t){let{$anchor:r,$head:n}=e.selection,o=t>0?r.max(n):r.min(n),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&be.findFrom(i,t)}function Ti(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Lk(e,t,r){let n=e.state.selection;if(n instanceof le)if(r.indexOf("s")>-1){let{$head:o}=n,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=e.state.doc.resolve(o.pos+i.nodeSize*(t<0?-1:1));return Ti(e,new le(n.$anchor,s))}else if(n.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let o=z1(e.state,t);return o&&o instanceof ce?Ti(e,o):!1}else if(!(kn&&r.indexOf("m")>-1)){let o=n.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=t<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?ce.isSelectable(i)?Ti(e,new ce(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):Rd?Ti(e,new le(e.state.doc.resolve(t<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(n instanceof ce&&n.node.isInline)return Ti(e,new le(t>0?n.$to:n.$from));{let o=z1(e.state,t);return o?Ti(e,o):!1}}}function Ep(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function vu(e,t){let r=e.pmViewDesc;return r&&r.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function Aa(e,t){return t<0?bP(e):xP(e)}function bP(e){let t=e.domSelectionRange(),r=t.focusNode,n=t.focusOffset;if(!r)return;let o,i,s=!1;for(oo&&r.nodeType==1&&n0){if(r.nodeType!=1)break;{let a=r.childNodes[n-1];if(vu(a,-1))o=r,i=--n;else if(a.nodeType==3)r=a,n=r.nodeValue.length;else break}}else{if(WE(r))break;{let a=r.previousSibling;for(;a&&vu(a,-1);)o=r.parentNode,i=yr(a),a=a.previousSibling;if(a)r=a,n=Ep(r);else{if(r=r.parentNode,r==e.dom)break;n=0}}}s?L1(e,r,n):o&&L1(e,o,i)}function xP(e){let t=e.domSelectionRange(),r=t.focusNode,n=t.focusOffset;if(!r)return;let o=Ep(r),i,s;for(;;)if(n{e.state==o&&Qo(e)},50)}function Ik(e,t){let r=e.state.doc.resolve(t);if(!(ur||jR)&&r.parent.inlineContent){let o=e.coordsAtPos(t);if(t>r.start()){let i=e.coordsAtPos(t-1),s=(i.top+i.bottom)/2;if(s>o.top&&s1)return i.lefto.top&&s1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function Dk(e,t,r){let n=e.state.selection;if(n instanceof le&&!n.empty||r.indexOf("s")>-1||kn&&r.indexOf("m")>-1)return!1;let{$from:o,$to:i}=n;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=z1(e.state,t);if(s&&s instanceof ce)return Ti(e,s)}if(!o.parent.inlineContent){let s=t<0?o:i,a=n instanceof xr?be.near(s,t):be.findFrom(s,t);return a?Ti(e,a):!1}return!1}function $k(e,t){if(!(e.state.selection instanceof le))return!0;let{$head:r,$anchor:n,empty:o}=e.state.selection;if(!r.sameParent(n))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(i&&!i.isText){let s=e.state.tr;return t<0?s.delete(r.pos-i.nodeSize,r.pos):s.delete(r.pos,r.pos+i.nodeSize),e.dispatch(s),!0}return!1}function Hk(e,t,r){e.domObserver.stop(),t.contentEditable=r,e.domObserver.start()}function SP(e){if(!wr||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:r}=e.domSelectionRange();if(t&&t.nodeType==1&&r==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let n=t.firstChild;Hk(e,n,"true"),setTimeout(()=>Hk(e,n,"false"),20)}return!1}function EP(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function CP(e,t){let r=t.keyCode,n=EP(t);if(r==8||kn&&r==72&&n=="c")return $k(e,-1)||Aa(e,-1);if(r==46&&!t.shiftKey||kn&&r==68&&n=="c")return $k(e,1)||Aa(e,1);if(r==13||r==27)return!0;if(r==37||kn&&r==66&&n=="c"){let o=r==37?Ik(e,e.state.selection.from)=="ltr"?-1:1:-1;return Lk(e,o,n)||Aa(e,o)}else if(r==39||kn&&r==70&&n=="c"){let o=r==39?Ik(e,e.state.selection.from)=="ltr"?1:-1:1;return Lk(e,o,n)||Aa(e,o)}else{if(r==38||kn&&r==80&&n=="c")return Dk(e,-1,n)||Aa(e,-1);if(r==40||kn&&r==78&&n=="c")return SP(e)||Dk(e,1,n)||Aa(e,1);if(n==(kn?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function KE(e,t){e.someProp("transformCopied",p=>{t=p(t,e)});let r=[],{content:n,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&n.childCount==1&&n.firstChild.childCount==1;){o--,i--;let p=n.firstChild;r.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),n=p.content}let s=e.someProp("clipboardSerializer")||sn.fromSchema(e.state.schema),a=QE(),l=a.createElement("div");l.appendChild(s.serializeFragment(n,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=XE[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=a.createElement(u[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(r)}`);let f=e.someProp("clipboardTextSerializer",p=>p(t,e))||t.content.textBetween(0,t.content.size,` +other {Heading}}`,comment:"Label for heading command with support for levels."};var hR=Object.freeze({__proto__:null,LABEL:pR});const mR={id:"extension.command.undo.label",message:"Undo",comment:"Label for undo."},gR={id:"extension.command.undo.description",message:"Undo the most recent action",comment:"Description for undo."},vR={id:"extension.command.redo.label",message:"Redo",comment:"Label for redo."},yR={id:"extension.command.redo.description",message:"Redo the most recent action",comment:"Description for redo."};var Ep=Object.freeze({__proto__:null,REDO_DESCRIPTION:yR,REDO_LABEL:vR,UNDO_DESCRIPTION:gR,UNDO_LABEL:mR});const bR={id:"extension.command.insert-horizontal-rule.label",message:"Divider",comment:"Label for inserting a horizontal rule (divider) command."},xR={id:"extension.command.insert-horizontal-rule.description",message:"Separate content with a diving horizontal line",comment:"Description for inserting a horizontal rule (divider) command."};var vk=Object.freeze({__proto__:null,DESCRIPTION:xR,LABEL:bR});const kR={id:"extension.command.toggle-italic.label",message:"Italic",comment:"Label for italic formatting command."},wR={id:"extension.command.toggle-italic.description",message:"Italicize the selected text",comment:"Description for italic formatting command."};var yk=Object.freeze({__proto__:null,DESCRIPTION:wR,LABEL:kR});const SR={id:"extension.command.toggle-ordered-list.label",message:"Ordered list",comment:"Label for inserting an ordered list into the editor."},ER={id:"extension.command.toggle-bullet-list.description",message:"Bulleted list",comment:"Description for inserting a bullet list into the editor."},CR={id:"extension.command.toggle-task-list.description",message:"Tasked list",comment:"Description for inserting a task list into the editor."};var Nv=Object.freeze({__proto__:null,BULLET_LIST_LABEL:ER,ORDERED_LIST_LABEL:SR,TASK_LIST_LABEL:CR});const MR={id:"extension.command.increase-indent.label",message:"Increase indentation",comment:"Label for increasing the indentation level."},TR={id:"extension.command.decrease-indent.label",message:"Decrease indentation",comment:"Label for decreasing the indentation level of the current node block."},OR={id:"extension.command.center-align.label",message:"Center align",comment:"Center align the text in the current node."},_R={id:"extension.command.justify-align.label",message:"Justify",comment:"Justify the alignment of the selected nodes."},AR={id:"extension.command.right-align.label",message:"Right align",comment:"Right align the selected nodes."},NR={id:"extension.command.left-align.label",message:"Left align",comment:"Left align the selected nodes."};var nc=Object.freeze({__proto__:null,CENTER_ALIGN_LABEL:OR,DECREASE_INDENT_LABEL:TR,INCREASE_INDENT_LABEL:MR,JUSTIFY_ALIGN_LABEL:_R,LEFT_ALIGN_LABEL:NR,RIGHT_ALIGN_LABEL:AR});const RR={id:"extension.command.insert-paragraph.label",message:"Insert Paragraph",comment:"Label for inserting a paragraph."},PR={id:"extension.command.insert-paragraph.description",message:"Insert a new paragraph",comment:"Description for inserting a paragraph."},zR={id:"extension.command.convert-paragraph.label",message:"Convert Paragraph",comment:"Label for converting the current node into a paragraph."},LR={id:"extension.command.convert-paragraph.description",message:"Convert current block into a paragraph block.",comment:"Description for converting a paragraph."};var Cp=Object.freeze({__proto__:null,CONVERT_DESCRIPTION:LR,CONVERT_LABEL:zR,INSERT_DESCRIPTION:PR,INSERT_LABEL:RR});const IR={id:"extension.command.toggle-strike.label",message:"Strikethrough",comment:"Label for strike formatting command."},DR={id:"extension.command.toggle-strike.description",message:"Strikethrough the selected text",comment:"Description for strike formatting command."};var bk=Object.freeze({__proto__:null,DESCRIPTION:DR,LABEL:IR});const $R={id:"extension.command.toggle-underline.label",message:"Underline",comment:"Label for underline formatting command."},HR={id:"extension.command.toggle-underline.description",message:"Underline the selected text",comment:"Description for underline formatting command."};var xk=Object.freeze({__proto__:null,DESCRIPTION:HR,LABEL:$R});class wa{constructor(t,r){this.match=t,this.match=t,this.handler=typeof r=="string"?BR(r):r}}function BR(e){return function(t,r,n,o){let i=e;if(r[1]){let s=r[0].lastIndexOf(r[1]);i+=r[0].slice(s+r[1].length),n+=s;let a=n-o;a>0&&(i=r[0].slice(s-a,s)+i,n=o)}return t.tr.insertText(i,n,o)}}const FR=500;function VR({rules:e}){let t=new Ro({state:{init(){return null},apply(r,n){let o=r.getMeta(this);return o||(r.selectionSet||r.docChanged?null:n)}},props:{handleTextInput(r,n,o,i){return kk(r,n,o,i,e,t)},handleDOMEvents:{compositionend:r=>{setTimeout(()=>{let{$cursor:n}=r.state.selection;n&&kk(r,n.pos,n.pos,"",e,t)})}}},isInputRules:!0});return t}function kk(e,t,r,n,o,i){if(e.composing)return!1;let s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;let l=a.parent.textBetween(Math.max(0,a.parentOffset-FR),a.parentOffset,null,"")+n;for(let c=0;c{let r=e.plugins;for(let n=0;n=0;l--)s.step(a.steps[l].invert(a.docs[l]));if(i.text){let l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,l))}else s.delete(i.from,i.to);t(s)}return!0}}return!1};function zh(e,t,r=null,n){return new wa(e,(o,i,s,a)=>{let l=r instanceof Function?r(i):r,c=o.tr.delete(s,a),u=c.doc.resolve(s),d=u.blockRange(),f=d&&Tv(d,t,l);if(!f)return null;c.wrap(d,f);let p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==t&&Rd(c.doc,s-1)&&(!n||n(i,p))&&c.join(s-1),c})}function UR(e,t,r=null){return new wa(e,(n,o,i,s)=>{let a=n.doc.resolve(i),l=r instanceof Function?r(o):r;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t)?n.tr.delete(i,s).setBlockType(i,i,t,l):null})}const br=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Du=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let wk=null;const Fo=function(e,t,r){let n=wk||(wk=document.createRange());return n.setEnd(e,r??e.nodeValue.length),n.setStart(e,t||0),n},ia=function(e,t,r,n){return r&&(Sk(e,t,r,n,-1)||Sk(e,t,r,n,1))},WR=/^(img|br|input|textarea|hr)$/i;function Sk(e,t,r,n,o){for(;;){if(e==r&&t==n)return!0;if(t==(o<0?0:yo(e))){let i=e.parentNode;if(!i||i.nodeType!=1||Rv(e)||WR.test(e.nodeName)||e.contentEditable=="false")return!1;t=br(e)+(o<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(o<0?-1:0)],e.contentEditable=="false")return!1;t=o<0?yo(e):0}else return!1}}function yo(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function KR(e,t,r){for(let n=t==0,o=t==yo(e);n||o;){if(e==r)return!0;let i=br(e);if(e=e.parentNode,!e)return!1;n=n&&i==0,o=o&&i==yo(e)}}function Rv(e){let t;for(let r=e;r&&!(t=r.pmViewDesc);r=r.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Lh=function(e){return e.focusNode&&ia(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function $s(e,t){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=e,r.key=r.code=t,r}function qR(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function GR(e,t,r){if(e.caretPositionFromPoint)try{let n=e.caretPositionFromPoint(t,r);if(n)return{node:n.offsetNode,offset:n.offset}}catch{}if(e.caretRangeFromPoint){let n=e.caretRangeFromPoint(t,r);if(n)return{node:n.startContainer,offset:n.startOffset}}}const To=typeof navigator<"u"?navigator:null,Ek=typeof document<"u"?document:null,ms=To&&To.userAgent||"",N1=/Edge\/(\d+)/.exec(ms),zE=/MSIE \d/.exec(ms),R1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ms),Ir=!!(zE||R1||N1),Fi=zE?document.documentMode:R1?+R1[1]:N1?+N1[1]:0,oo=!Ir&&/gecko\/(\d+)/i.test(ms);oo&&+(/Firefox\/(\d+)/.exec(ms)||[0,0])[1];const P1=!Ir&&/Chrome\/(\d+)/.exec(ms),dr=!!P1,YR=P1?+P1[1]:0,Sr=!Ir&&!!To&&/Apple Computer/.test(To.vendor),Nl=Sr&&(/Mobile\/\w+/.test(ms)||!!To&&To.maxTouchPoints>2),wn=Nl||(To?/Mac/.test(To.platform):!1),JR=To?/Win/.test(To.platform):!1,Jn=/Android \d/.test(ms),Pd=!!Ek&&"webkitFontSmoothing"in Ek.documentElement.style,XR=Pd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function QR(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Lo(e,t){return typeof e=="number"?e:e[t]}function ZR(e){let t=e.getBoundingClientRect(),r=t.width/e.offsetWidth||1,n=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*r,top:t.top,bottom:t.top+e.clientHeight*n}}function Ck(e,t,r){let n=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=r||e.dom;s;s=Du(s)){if(s.nodeType!=1)continue;let a=s,l=a==i.body,c=l?QR(i):ZR(a),u=0,d=0;if(t.topc.bottom-Lo(n,"bottom")&&(d=t.bottom-t.top>c.bottom-c.top?t.top+Lo(o,"top")-c.top:t.bottom-c.bottom+Lo(o,"bottom")),t.leftc.right-Lo(n,"right")&&(u=t.right-c.right+Lo(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let h=a.scrollLeft-f,m=a.scrollTop-p;t={left:t.left-h,top:t.top-m,right:t.right-h,bottom:t.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function eP(e){let t=e.dom.getBoundingClientRect(),r=Math.max(0,t.top),n,o;for(let i=(t.left+t.right)/2,s=r+1;s=r-20){n=a,o=l.top;break}}return{refDOM:n,refTop:o,stack:LE(e.dom)}}function LE(e){let t=[],r=e.ownerDocument;for(let n=e;n&&(t.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),e!=r);n=Du(n));return t}function tP({refDOM:e,refTop:t,stack:r}){let n=e?e.getBoundingClientRect().top:0;IE(r,n==0?0:n-t)}function IE(e,t){for(let r=0;r=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let m=h.left>t.left?h.left-t.left:h.right=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!l&&h.left<=t.left&&h.right>=t.left&&(l=u,c={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!r&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(i=d+1)}}return!r&&l&&(r=l,o=c,n=0),r&&r.nodeType==3?nP(r,o):!r||n&&r.nodeType==1?{node:e,offset:i}:DE(r,o)}function nP(e,t){let r=e.nodeValue.length,n=document.createRange();for(let o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function Pv(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function oP(e,t){let r=e.parentNode;return r&&/^li$/i.test(r.nodeName)&&t.left(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(n,o,i)}function sP(e,t,r,n){let o=-1;for(let i=t,s=!1;i!=e.dom;){let a=e.docView.nearestDesc(i,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!s||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!s&&(s=!0,l.left>n.left||l.top>n.top?o=a.posBefore:(l.right-1?o:e.docView.posFromDOM(t,r,-1)}function $E(e,t,r){let n=e.childNodes.length;if(n&&r.topt.top&&o++}let c;Pd&&o&&n.nodeType==1&&(c=n.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=t.top&&o--,n==e.dom&&o==n.childNodes.length-1&&n.lastChild.nodeType==1&&t.top>n.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(o==0||n.nodeType!=1||n.childNodes[o-1].nodeName!="BR")&&(a=sP(e,n,o,t))}a==null&&(a=iP(e,s,t));let l=e.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Mk(e){return e.top=0&&o==n.nodeValue.length?(l--,u=1):r<0?l--:c++,yc(ki(Fo(n,l,c),u),u<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&o&&(r<0||o==yo(n))){let l=n.childNodes[o-1];if(l.nodeType==1)return mg(l.getBoundingClientRect(),!1)}if(i==null&&o=0)}if(i==null&&o&&(r<0||o==yo(n))){let l=n.childNodes[o-1],c=l.nodeType==3?Fo(l,yo(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return yc(ki(c,1),!1)}if(i==null&&o=0)}function yc(e,t){if(e.width==0)return e;let r=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:r,right:r}}function mg(e,t){if(e.height==0)return e;let r=t?e.top:e.bottom;return{top:r,bottom:r,left:e.left,right:e.right}}function BE(e,t,r){let n=e.state,o=e.root.activeElement;n!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return r()}finally{n!=t&&e.updateState(n),o!=e.dom&&o&&o.focus()}}function cP(e,t,r){let n=t.selection,o=r=="up"?n.$from:n.$to;return BE(e,t,()=>{let{node:i}=e.docView.domFromPos(o.pos,r=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=HE(e,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Fo(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(r=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const uP=/[\u0590-\u08ac]/;function dP(e,t,r){let{$head:n}=t.selection;if(!n.parent.isTextblock)return!1;let o=n.parentOffset,i=!o,s=o==n.parent.content.size,a=e.domSelection();return!uP.test(n.parent.textContent)||!a.modify?r=="left"||r=="backward"?i:s:BE(e,t,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=e.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",r,"character");let p=n.depth?e.docView.domAfterPos(n.before()):e.dom,{focusNode:h,focusOffset:m}=e.domSelectionRange(),b=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==m;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),b})}let Tk=null,Ok=null,_k=!1;function fP(e,t,r){return Tk==t&&Ok==r?_k:(Tk=t,Ok=r,_k=r=="up"||r=="down"?cP(e,t,r):dP(e,t,r))}const _n=0,Ak=1,Fs=2,Oo=3;class zd{constructor(t,r,n,o){this.parent=t,this.children=r,this.dom=n,this.contentDOM=o,this.dirty=_n,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,r,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let r=0;rbr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&r==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??n>0?this.posAtEnd:this.posAtStart}nearestDesc(t,r=!1){for(let n=!0,o=t;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!r||i.node))if(n&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))n=!1;else return i}}getDesc(t){let r=t.pmViewDesc;for(let n=r;n;n=n.parent)if(n==this)return r}posFromDOM(t,r,n){for(let o=t;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(t,r,n)}return-1}descAt(t){for(let r=0,n=0;rt||s instanceof VE){o=t-i;break}i=a}if(o)return this.children[n].domFromPos(o-this.children[n].border,r);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof FE&&i.side>=0;n--);if(r<=0){let i,s=!0;for(;i=n?this.children[n-1]:null,!(!i||i.dom.parentNode==this.contentDOM);n--,s=!1);return i&&r&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,r):{node:this.contentDOM,offset:i?br(i.dom)+1:0}}else{let i,s=!0;for(;i=n=u&&r<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,r,u);t=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=br(f.dom)+1;break}t-=f.size}o==-1&&(o=0)}if(o>-1&&(c>r||a==this.children.length-1)){r=c;for(let u=a+1;up&&sr){let p=a;a=l,l=p}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,r){for(let n=0,o=0;o=n:tn){let a=n+i.border,l=s-i.border;if(t>=a&&r<=l){this.dirty=t==n||r==s?Fs:Ak,t==a&&r==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Oo:i.markDirty(t-a,r-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Fs:Oo}n=s}this.dirty=Fs}markParentsDirty(){let t=1;for(let r=this.parent;r;r=r.parent,t++){let n=t==1?Fs:Ak;r.dirty{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!r.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=r,this.widget=r,i=this}matchesWidget(t){return this.dirty==_n&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let r=this.widget.spec.stopEvent;return r?r(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class pP extends zd{constructor(t,r,n,o){super(t,[],r,null),this.textDOM=n,this.text=o}get size(){return this.text.length}localPosFromDOM(t,r){return t!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class sa extends zd{constructor(t,r,n,o){super(t,[],n,o),this.mark=r}static create(t,r,n,o){let i=o.nodeViews[r.type.name],s=i&&i(r,o,n);return(!s||!s.dom)&&(s=an.renderSpec(document,r.type.spec.toDOM(r,n))),new sa(t,r,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Oo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Oo&&this.mark.eq(t)}markDirty(t,r){if(super.markDirty(t,r),this.dirty!=_n){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty0&&(i=I1(i,0,t,n));for(let a=0;a{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},n,o),u=c&&c.dom,d=c&&c.contentDOM;if(r.isText){if(!u)u=document.createTextNode(r.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=an.renderSpec(document,r.type.spec.toDOM(r)));!d&&!r.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),r.type.spec.draggable&&(u.draggable=!0));let f=u;return u=WE(u,n,r),c?l=new hP(t,r,n,o,u,d||null,f,c,i,s+1):r.isText?new Ih(t,r,n,o,u,f,i):new Vi(t,r,n,o,u,d||null,f,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let n=this.children[r];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>R.empty)}return t}matchesNode(t,r,n){return this.dirty==_n&&t.eq(this.node)&&L1(r,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,r){let n=this.node.inlineContent,o=r,i=t.composing?this.localCompositionInfo(t,r):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new gP(this,s&&s.node,t);bP(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,n,t):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Te.none:this.node.child(u).marks,n,t),l.placeWidget(c,t,o)},(c,u,d,f)=>{l.syncToMarks(c.marks,n,t);let p;l.findNodeMatch(c,u,d,f)||a&&t.state.selection.from>o&&t.state.selection.to-1&&l.updateNodeAt(c,u,d,p,t)||l.updateNextNode(c,u,d,t,f,o)||l.addNode(c,u,d,t,o),o+=c.nodeSize}),l.syncToMarks([],n,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Fs)&&(s&&this.protectLocalComposition(t,s),jE(this.contentDOM,this.children,t),Nl&&xP(this.dom))}localCompositionInfo(t,r){let{from:n,to:o}=t.state.selection;if(!(t.state.selection instanceof le)||nr+this.node.content.size)return null;let i=t.domSelectionRange(),s=kP(i.focusNode,i.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=wP(this.node.content,a,n-r,o-r);return l<0?null:{node:s,pos:l,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:r,pos:n,text:o}){if(this.getDesc(r))return;let i=r;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new pP(this,i,r,o);t.input.compositionNodes.push(s),this.children=I1(this.children,n,n+o.length,t,s)}update(t,r,n,o){return this.dirty==Oo||!t.sameMarkup(this.node)?!1:(this.updateInner(t,r,n,o),!0)}updateInner(t,r,n,o){this.updateOuterDeco(r),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=_n}updateOuterDeco(t){if(L1(t,this.outerDeco))return;let r=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=UE(this.dom,this.nodeDOM,z1(this.outerDeco,this.node,r),z1(t,this.node,r)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Nk(e,t,r,n,o){WE(n,t,e);let i=new Vi(void 0,e,t,r,n,n,n,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Ih extends Vi{constructor(t,r,n,o,i,s,a){super(t,r,n,o,i,null,s,a,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,r,n,o){return this.dirty==Oo||this.dirty!=_n&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(r),(this.dirty!=_n||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=_n,!0)}inParent(){let t=this.parent.contentDOM;for(let r=this.nodeDOM;r;r=r.parentNode)if(r==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,r,n){return t==this.nodeDOM?this.posAtStart+Math.min(r,this.node.text.length):super.localPosFromDOM(t,r,n)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,r,n){let o=this.node.cut(t,r),i=document.createTextNode(o.text);return new Ih(this.parent,o,this.outerDeco,this.innerDeco,i,i,n)}markDirty(t,r){super.markDirty(t,r),this.dom!=this.nodeDOM&&(t==0||r==this.nodeDOM.nodeValue.length)&&(this.dirty=Oo)}get domAtom(){return!1}}class VE extends zd{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==_n&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class hP extends Vi{constructor(t,r,n,o,i,s,a,l,c,u){super(t,r,n,o,i,s,a,c,u),this.spec=l}update(t,r,n,o){if(this.dirty==Oo)return!1;if(this.spec.update){let i=this.spec.update(t,r,n);return i&&this.updateInner(t,r,n,o),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,r,n,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,r,n,o){this.spec.setSelection?this.spec.setSelection(t,r,n):super.setSelection(t,r,n,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function jE(e,t,r){let n=e.firstChild,o=!1;for(let i=0;i>1,s=Math.min(i,t.length);for(;o-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=sa.create(this.top,t[i],r,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(t,r,n,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(t,r,n))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(n){let c=r.children[n-1];if(c instanceof sa)r=c,n=c.children.length;else{a=c,n--;break}}else{if(r==t)break e;n=r.parent.children.indexOf(r),r=r.parent}let l=a.node;if(l){if(l!=e.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function yP(e,t){return e.type.side-t.type.side}function bP(e,t,r,n){let o=t.locals(e),i=0;if(o.length==0){for(let c=0;ci;)a.push(o[s++]);let h=i+f.nodeSize;if(f.isText){let b=h;s!b.inline):a.slice();n(f,m,t.forChild(i,f),p),i=h}}function xP(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function kP(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=yo(e)}else if(e.nodeType==1&&t=r){if(i>=n&&l.slice(n-t.length-a,n-a)==t)return n-t.length;let c=a=0&&c+t.length+a>=r)return a+c;if(r==n&&l.length>=n+t.length-a&&l.slice(n-a,n-a+t.length)==t)return n}}return-1}function I1(e,t,r,n,o){let i=[];for(let s=0,a=0;s=r||u<=t?i.push(l):(cr&&i.push(l.slice(r-c,l.size,n)))}return i}function zv(e,t=null){let r=e.domSelectionRange(),n=e.state.doc;if(!r.focusNode)return null;let o=e.docView.nearestDesc(r.focusNode),i=o&&o.size==0,s=e.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(s<0)return null;let a=n.resolve(s),l,c;if(Lh(r)){for(l=a;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&ce.isSelectable(u)&&o.parent&&!(u.isInline&&KR(r.focusNode,r.focusOffset,o.dom))){let d=o.posBefore;c=new ce(s==d?a:n.resolve(d))}}else{let u=e.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(u<0)return null;l=n.resolve(u)}if(!c){let u=t=="pointer"||e.state.selection.head{(r.anchorNode!=n||r.anchorOffset!=o)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!KE(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function EP(e){let t=e.domSelection(),r=document.createRange(),n=e.cursorWrapper.dom,o=n.nodeName=="IMG";o?r.setEnd(n.parentNode,br(n)+1):r.setEnd(n,0),r.collapse(!1),t.removeAllRanges(),t.addRange(r),!o&&!e.state.selection.visible&&Ir&&Fi<=11&&(n.disabled=!0,n.disabled=!1)}function qE(e,t){if(t instanceof ce){let r=e.docView.descAt(t.from);r!=e.lastSelectedViewDesc&&(Ik(e),r&&r.selectNode(),e.lastSelectedViewDesc=r)}else Ik(e)}function Ik(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Lv(e,t,r,n){return e.someProp("createSelectionBetween",o=>o(e,t,r))||le.between(t,r,n)}function Dk(e){return e.editable&&!e.hasFocus()?!1:GE(e)}function GE(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function CP(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),r=e.domSelectionRange();return ia(t.node,t.offset,r.anchorNode,r.anchorOffset)}function D1(e,t){let{$anchor:r,$head:n}=e.selection,o=t>0?r.max(n):r.min(n),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&be.findFrom(i,t)}function Ti(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function $k(e,t,r){let n=e.state.selection;if(n instanceof le)if(r.indexOf("s")>-1){let{$head:o}=n,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=e.state.doc.resolve(o.pos+i.nodeSize*(t<0?-1:1));return Ti(e,new le(n.$anchor,s))}else if(n.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let o=D1(e.state,t);return o&&o instanceof ce?Ti(e,o):!1}else if(!(wn&&r.indexOf("m")>-1)){let o=n.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=t<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?ce.isSelectable(i)?Ti(e,new ce(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):Pd?Ti(e,new le(e.state.doc.resolve(t<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(n instanceof ce&&n.node.isInline)return Ti(e,new le(t>0?n.$to:n.$from));{let o=D1(e.state,t);return o?Ti(e,o):!1}}}function Mp(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function yu(e,t){let r=e.pmViewDesc;return r&&r.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function Aa(e,t){return t<0?MP(e):TP(e)}function MP(e){let t=e.domSelectionRange(),r=t.focusNode,n=t.focusOffset;if(!r)return;let o,i,s=!1;for(oo&&r.nodeType==1&&n0){if(r.nodeType!=1)break;{let a=r.childNodes[n-1];if(yu(a,-1))o=r,i=--n;else if(a.nodeType==3)r=a,n=r.nodeValue.length;else break}}else{if(YE(r))break;{let a=r.previousSibling;for(;a&&yu(a,-1);)o=r.parentNode,i=br(a),a=a.previousSibling;if(a)r=a,n=Mp(r);else{if(r=r.parentNode,r==e.dom)break;n=0}}}s?$1(e,r,n):o&&$1(e,o,i)}function TP(e){let t=e.domSelectionRange(),r=t.focusNode,n=t.focusOffset;if(!r)return;let o=Mp(r),i,s;for(;;)if(n{e.state==o&&Qo(e)},50)}function Hk(e,t){let r=e.state.doc.resolve(t);if(!(dr||JR)&&r.parent.inlineContent){let o=e.coordsAtPos(t);if(t>r.start()){let i=e.coordsAtPos(t-1),s=(i.top+i.bottom)/2;if(s>o.top&&s1)return i.lefto.top&&s1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function Bk(e,t,r){let n=e.state.selection;if(n instanceof le&&!n.empty||r.indexOf("s")>-1||wn&&r.indexOf("m")>-1)return!1;let{$from:o,$to:i}=n;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=D1(e.state,t);if(s&&s instanceof ce)return Ti(e,s)}if(!o.parent.inlineContent){let s=t<0?o:i,a=n instanceof kr?be.near(s,t):be.findFrom(s,t);return a?Ti(e,a):!1}return!1}function Fk(e,t){if(!(e.state.selection instanceof le))return!0;let{$head:r,$anchor:n,empty:o}=e.state.selection;if(!r.sameParent(n))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(i&&!i.isText){let s=e.state.tr;return t<0?s.delete(r.pos-i.nodeSize,r.pos):s.delete(r.pos,r.pos+i.nodeSize),e.dispatch(s),!0}return!1}function Vk(e,t,r){e.domObserver.stop(),t.contentEditable=r,e.domObserver.start()}function AP(e){if(!Sr||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:r}=e.domSelectionRange();if(t&&t.nodeType==1&&r==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let n=t.firstChild;Vk(e,n,"true"),setTimeout(()=>Vk(e,n,"false"),20)}return!1}function NP(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function RP(e,t){let r=t.keyCode,n=NP(t);if(r==8||wn&&r==72&&n=="c")return Fk(e,-1)||Aa(e,-1);if(r==46&&!t.shiftKey||wn&&r==68&&n=="c")return Fk(e,1)||Aa(e,1);if(r==13||r==27)return!0;if(r==37||wn&&r==66&&n=="c"){let o=r==37?Hk(e,e.state.selection.from)=="ltr"?-1:1:-1;return $k(e,o,n)||Aa(e,o)}else if(r==39||wn&&r==70&&n=="c"){let o=r==39?Hk(e,e.state.selection.from)=="ltr"?1:-1:1;return $k(e,o,n)||Aa(e,o)}else{if(r==38||wn&&r==80&&n=="c")return Bk(e,-1,n)||Aa(e,-1);if(r==40||wn&&r==78&&n=="c")return AP(e)||Bk(e,1,n)||Aa(e,1);if(n==(wn?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function JE(e,t){e.someProp("transformCopied",p=>{t=p(t,e)});let r=[],{content:n,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&n.childCount==1&&n.firstChild.childCount==1;){o--,i--;let p=n.firstChild;r.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),n=p.content}let s=e.someProp("clipboardSerializer")||an.fromSchema(e.state.schema),a=rC(),l=a.createElement("div");l.appendChild(s.serializeFragment(n,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=tC[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=a.createElement(u[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(r)}`);let f=e.someProp("clipboardTextSerializer",p=>p(t,e))||t.content.textBetween(0,t.content.size,` -`);return{dom:l,text:f}}function qE(e,t,r,n,o){let i=o.parent.type.spec.code,s,a;if(!r&&!t)return null;let l=t&&(n||i||!r);if(l){if(e.someProp("transformPastedText",f=>{t=f(t,i||n,e)}),i)return t?new K(R.from(e.state.schema.text(t.replace(/\r\n?/g,` -`))),0,0):K.empty;let d=e.someProp("clipboardTextParser",f=>f(t,o,n,e));if(d)a=d;else{let f=o.marks(),{schema:p}=e.state,h=sn.fromSchema(p);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(m=>{let b=s.appendChild(document.createElement("p"));m&&b.appendChild(h.serializeNode(p.text(m,f)))})}}else e.someProp("transformPastedHTML",d=>{r=d(r,e)}),s=OP(r),Rd&&_P(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||wv.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!MP.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=AP(Bk(a,+u[1],+u[2]),u[4]);else if(a=K.maxOpen(TP(a.content,o),!0),a.openStart||a.openEnd){let d=0,f=0;for(let p=a.content.firstChild;d{a=d(a,e)}),a}const MP=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function TP(e,t){if(e.childCount<2)return e;for(let r=t.depth;r>=0;r--){let o=t.node(r).contentMatchAt(t.index(r)),i,s=[];if(e.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&YE(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=JE(s[s.length-1],i.length));let u=GE(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return R.from(s)}return e}function GE(e,t,r=0){for(let n=t.length-1;n>=r;n--)e=t[n].create(null,R.from(e));return e}function YE(e,t,r,n,o){if(o1&&(i=0),o=r&&(a=t<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(R.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Bk(e,t,r){return t]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let r=QE().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(e),o;if((o=n&&XE[n[1].toLowerCase()])&&(e=o.map(i=>"<"+i+">").join("")+e+o.map(i=>"").reverse().join("")),r.innerHTML=e,o)for(let i=0;i=0;a-=2){let l=r.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;o=R.from(l.create(n[a+1],o)),i++,s++}return new K(o,i,s)}const Sr={},Er={},NP={touchstart:!0,touchmove:!0};class RP{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function PP(e){for(let t in Sr){let r=Sr[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=n=>{LP(e,n)&&!Pv(e,n)&&(e.editable||!(n.type in Er))&&r(e,n)},NP[t]?{passive:!0}:void 0)}wr&&e.dom.addEventListener("input",()=>null),D1(e)}function Ii(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function zP(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function D1(e){e.someProp("handleDOMEvents",t=>{for(let r in t)e.input.eventHandlers[r]||e.dom.addEventListener(r,e.input.eventHandlers[r]=n=>Pv(e,n))})}function Pv(e,t){return e.someProp("handleDOMEvents",r=>{let n=r[t.type];return n?n(e,t)||t.defaultPrevented:!1})}function LP(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let r=t.target;r!=e.dom;r=r.parentNode)if(!r||r.nodeType==11||r.pmViewDesc&&r.pmViewDesc.stopEvent(t))return!1;return!0}function IP(e,t){!Pv(e,t)&&Sr[t.type]&&(e.editable||!(t.type in Er))&&Sr[t.type](e,t)}Er.keydown=(e,t)=>{let r=t;if(e.input.shiftKey=r.keyCode==16||r.shiftKey,!e5(e,r)&&(e.input.lastKeyCode=r.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Yn&&ur&&r.keyCode==13)))if(r.keyCode!=229&&e.domObserver.forceFlush(),Nl&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();e.input.lastIOSEnter=n,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==n&&(e.someProp("handleKeyDown",o=>o(e,$s(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",n=>n(e,r))||CP(e,r)?r.preventDefault():Ii(e,"key")};Er.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Er.keypress=(e,t)=>{let r=t;if(e5(e,r)||!r.charCode||r.ctrlKey&&!r.altKey||kn&&r.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,r))){r.preventDefault();return}let n=e.state.selection;if(!(n instanceof le)||!n.$from.sameParent(n.$to)){let o=String.fromCharCode(r.charCode);!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",i=>i(e,n.$from.pos,n.$to.pos,o))&&e.dispatch(e.state.tr.insertText(o).scrollIntoView()),r.preventDefault()}};function zh(e){return{left:e.clientX,top:e.clientY}}function DP(e,t){let r=t.x-e.clientX,n=t.y-e.clientY;return r*r+n*n<100}function zv(e,t,r,n,o){if(n==-1)return!1;let i=e.state.doc.resolve(n);for(let s=i.depth+1;s>0;s--)if(e.someProp(t,a=>s>i.depth?a(e,r,i.nodeAfter,i.before(s),o,!0):a(e,r,i.node(s),i.before(s),o,!1)))return!0;return!1}function pl(e,t,r){e.focused||e.focus();let n=e.state.tr.setSelection(t);r=="pointer"&&n.setMeta("pointer",!0),e.dispatch(n)}function $P(e,t){if(t==-1)return!1;let r=e.state.doc.resolve(t),n=r.nodeAfter;return n&&n.isAtom&&ce.isSelectable(n)?(pl(e,new ce(r),"pointer"),!0):!1}function HP(e,t){if(t==-1)return!1;let r=e.state.selection,n,o;r instanceof ce&&(n=r.node);let i=e.state.doc.resolve(t);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(ce.isSelectable(a)){n&&r.$from.depth>0&&s>=r.$from.depth&&i.before(r.$from.depth+1)==r.$from.pos?o=i.before(r.$from.depth):o=i.before(s);break}}return o!=null?(pl(e,ce.create(e.state.doc,o),"pointer"),!0):!1}function BP(e,t,r,n,o){return zv(e,"handleClickOn",t,r,n)||e.someProp("handleClick",i=>i(e,t,n))||(o?HP(e,r):$P(e,r))}function FP(e,t,r,n){return zv(e,"handleDoubleClickOn",t,r,n)||e.someProp("handleDoubleClick",o=>o(e,t,n))}function VP(e,t,r,n){return zv(e,"handleTripleClickOn",t,r,n)||e.someProp("handleTripleClick",o=>o(e,t,n))||jP(e,r,n)}function jP(e,t,r){if(r.button!=0)return!1;let n=e.state.doc;if(t==-1)return n.inlineContent?(pl(e,le.create(n,0,n.content.size),"pointer"),!0):!1;let o=n.resolve(t);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)pl(e,le.create(n,a+1,a+1+s.content.size),"pointer");else if(ce.isSelectable(s))pl(e,ce.create(n,a),"pointer");else continue;return!0}}function Lv(e){return Cp(e)}const ZE=kn?"metaKey":"ctrlKey";Sr.mousedown=(e,t)=>{let r=t;e.input.shiftKey=r.shiftKey;let n=Lv(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&DP(r,e.input.lastClick)&&!r[ZE]&&(e.input.lastClick.type=="singleClick"?i="doubleClick":e.input.lastClick.type=="doubleClick"&&(i="tripleClick")),e.input.lastClick={time:o,x:r.clientX,y:r.clientY,type:i};let s=e.posAtCoords(zh(r));s&&(i=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new UP(e,s,r,!!n)):(i=="doubleClick"?FP:VP)(e,s.pos,s.inside,r)?r.preventDefault():Ii(e,"pointer"))};class UP{constructor(t,r,n,o){this.view=t,this.pos=r,this.event=n,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[ZE],this.allowDefault=n.shiftKey;let i,s;if(r.inside>-1)i=t.state.doc.nodeAt(r.inside),s=r.inside;else{let u=t.state.doc.resolve(r.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:n.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=t.state;(n.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof ce&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&oo&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ii(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Qo(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(zh(t))),this.updateAllowDefault(t),this.allowDefault||!r?Ii(this.view,"pointer"):BP(this.view,r.pos,r.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||wr&&this.mightDrag&&!this.mightDrag.node.isAtom||ur&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(pl(this.view,be.near(this.view.state.doc.resolve(r.pos)),"pointer"),t.preventDefault()):Ii(this.view,"pointer")}move(t){this.updateAllowDefault(t),Ii(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}Sr.touchstart=e=>{e.input.lastTouch=Date.now(),Lv(e),Ii(e,"pointer")};Sr.touchmove=e=>{e.input.lastTouch=Date.now(),Ii(e,"pointer")};Sr.contextmenu=e=>Lv(e);function e5(e,t){return e.composing?!0:wr&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const WP=Yn?5e3:-1;Er.compositionstart=Er.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,r=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||r.marks(),Cp(e,!0),e.markCursor=null;else if(Cp(e),oo&&t.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=e.domSelectionRange();for(let o=n.focusNode,i=n.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){e.domSelection().collapse(s,s.nodeValue.length);break}else o=s,i=-1}}e.input.composing=!0}t5(e,WP)};Er.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,t5(e,20))};function t5(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Cp(e),t))}function r5(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=KP());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function KP(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Cp(e,t=!1){if(!(Yn&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),r5(e),t||e.docView&&e.docView.dirty){let r=Nv(e);return r&&!r.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(r)):e.updateState(e.state),!0}return!1}}function qP(e,t){if(!e.dom.parentNode)return;let r=e.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(t),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),n.removeAllRanges(),n.addRange(o),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),e.focus()},50)}const Rl=Ir&&Fi<15||Nl&&UR<604;Sr.copy=Er.cut=(e,t)=>{let r=t,n=e.state.selection,o=r.type=="cut";if(n.empty)return;let i=Rl?null:r.clipboardData,s=n.content(),{dom:a,text:l}=KE(e,s);i?(r.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):qP(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function GP(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function YP(e,t){if(!e.dom.parentNode)return;let r=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,n=e.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let o=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),n.parentNode&&n.parentNode.removeChild(n),r?Du(e,n.value,null,o,t):Du(e,n.textContent,n.innerHTML,o,t)},50)}function Du(e,t,r,n,o){let i=qE(e,t,r,n,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,o,i||K.empty)))return!0;if(!i)return!1;let s=GP(i),a=s?e.state.tr.replaceSelectionWith(s,n):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Er.paste=(e,t)=>{let r=t;if(e.composing&&!Yn)return;let n=Rl?null:r.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;n&&Du(e,n.getData("text/plain"),n.getData("text/html"),o,r)?r.preventDefault():YP(e,r)};class JP{constructor(t,r){this.slice=t,this.move=r}}const n5=kn?"altKey":"ctrlKey";Sr.dragstart=(e,t)=>{let r=t,n=e.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(zh(r));if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof ce?o.to-1:o.to))){if(n&&n.mightDrag)e.dispatch(e.state.tr.setSelection(ce.create(e.state.doc,n.mightDrag.pos)));else if(r.target&&r.target.nodeType==1){let c=e.docView.nearestDesc(r.target,!0);c&&c.node.type.spec.draggable&&c!=e.docView&&e.dispatch(e.state.tr.setSelection(ce.create(e.state.doc,c.posBefore)))}}let s=e.state.selection.content(),{dom:a,text:l}=KE(e,s);r.dataTransfer.clearData(),r.dataTransfer.setData(Rl?"Text":"text/html",a.innerHTML),r.dataTransfer.effectAllowed="copyMove",Rl||r.dataTransfer.setData("text/plain",l),e.dragging=new JP(s,!r[n5])};Sr.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Er.dragover=Er.dragenter=(e,t)=>t.preventDefault();Er.drop=(e,t)=>{let r=t,n=e.dragging;if(e.dragging=null,!r.dataTransfer)return;let o=e.posAtCoords(zh(r));if(!o)return;let i=e.state.doc.resolve(o.pos),s=n&&n.slice;s?e.someProp("transformPasted",h=>{s=h(s,e)}):s=qE(e,r.dataTransfer.getData(Rl?"Text":"text/plain"),Rl?null:r.dataTransfer.getData("text/html"),!1,i);let a=!!(n&&!r[n5]);if(e.someProp("handleDrop",h=>h(e,r,s||K.empty,a))){r.preventDefault();return}if(!s)return;r.preventDefault();let l=s?YA(e.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=e.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&ce.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new ce(p));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,b,v,g)=>h=g),c.setSelection(Rv(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))};Sr.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Qo(e)},20))};Sr.blur=(e,t)=>{let r=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),r.relatedTarget&&e.dom.contains(r.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Sr.beforeinput=(e,t)=>{if(ur&&Yn&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:n}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=n||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,$s(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in Er)Sr[e]=Er[e];function $u(e,t){if(e==t)return!0;for(let r in e)if(e[r]!==t[r])return!1;for(let r in t)if(!(r in e))return!1;return!0}class Mp{constructor(t,r){this.toDOM=t,this.spec=r||Js,this.side=this.spec.side||0}map(t,r,n,o){let{pos:i,deleted:s}=t.mapResult(r.from+o,this.side<0?-1:1);return s?null:new Ge(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof Mp&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&$u(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class ji{constructor(t,r){this.attrs=t,this.spec=r||Js}map(t,r,n,o){let i=t.map(r.from+o,this.spec.inclusiveStart?-1:1)-n,s=t.map(r.to+o,this.spec.inclusiveEnd?1:-1)-n;return i>=s?null:new Ge(i,s,this)}valid(t,r){return r.from=t&&(!i||i(a.spec))&&n.push(a.copy(a.from+o,a.to+o))}for(let s=0;st){let a=this.children[s]+1;this.children[s+2].findInner(t-a,r-a,n,o+a,i)}}map(t,r,n){return this==ar||t.maps.length==0?this:this.mapInner(t,r,0,0,n||Js)}mapInner(t,r,n,o,i){let s;for(let a=0;a{let c=l+n,u;if(u=i5(r,a,c)){for(o||(o=this.children.slice());ia&&d.to=t){this.children[a]==t&&(n=this.children[a+2]);break}let i=t+1,s=i+r.content.size;for(let a=0;ai&&l.type instanceof ji){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;co.map(t,r,Js));return Ni.from(n)}forChild(t,r){if(r.isLeaf)return Ee.empty;let n=[];for(let o=0;or instanceof Ee)?t:t.reduce((r,n)=>r.concat(n instanceof Ee?n:n.members),[]))}}}function XP(e,t,r,n,o,i,s){let a=e.slice();for(let c=0,u=i;c{let b=m-h-(p-f);for(let v=0;vg+u-d)continue;let y=a[v]+u-d;p>=y?a[v+1]=f<=y?-2:-1:h>=o&&b&&(a[v]+=b,a[v+1]+=b)}d+=b}),u=r.maps[c].map(u,-1)}let l=!1;for(let c=0;c=n.content.size){l=!0;continue}let f=r.map(e[c+1]+i,-1),p=f-o,{index:h,offset:m}=n.content.findIndex(d),b=n.maybeChild(h);if(b&&m==d&&m+b.nodeSize==p){let v=a[c+2].mapInner(r,b,u+1,e[c]+i+1,s);v!=ar?(a[c]=d,a[c+1]=p,a[c+2]=v):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=QP(a,e,t,r,o,i,s),u=Tp(c,n,0,s);t=u.local;for(let d=0;dr&&s.to{let c=i5(e,a,l+r);if(c){i=!0;let u=Tp(c,a,r+l+1,n);u!=ar&&o.push(l,l+a.nodeSize,u)}});let s=o5(i?s5(e):e,-r).sort(Xs);for(let a=0;a0;)t++;e.splice(t,0,r)}function hg(e){let t=[];return e.someProp("decorations",r=>{let n=r(e.state);n&&n!=ar&&t.push(n)}),e.cursorWrapper&&t.push(Ee.create(e.state.doc,[e.cursorWrapper.deco])),Ni.from(t)}const ZP={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},e6=Ir&&Fi<=11;class t6{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class r6{constructor(t,r){this.view=t,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new t6,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let o=0;oo.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),e6&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,ZP)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let r=0;rthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(zk(this.view)){if(this.suppressingSelectionUpdates)return Qo(this.view);if(Ir&&Fi<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&ia(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let r=new Set,n;for(let i=t.focusNode;i;i=Iu(i))r.add(i);for(let i=t.anchorNode;i;i=Iu(i))if(r.has(i)){n=i;break}let o=n&&this.view.docView.nearestDesc(n);if(o&&o.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&zk(t)&&!this.ignoreSelectionChange(n),i=-1,s=-1,a=!1,l=[];if(t.editable)for(let u=0;u1){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||o)&&(i>-1&&(t.docView.markDirty(i,s),n6(t)),this.handleDOMChange(i,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||Qo(t),this.currentSelection.set(n))}registerMutation(t,r){if(r.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(n==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!n||n.ignoreMutation(t))return null;if(t.type=="childList"){for(let u=0;uo;b--){let v=n.childNodes[b-1],g=v.pmViewDesc;if(v.nodeName=="BR"&&!g){i=b;break}if(!g||g.size)break}let d=e.state.doc,f=e.someProp("domParser")||wv.fromSchema(e.state.schema),p=d.resolve(s),h=null,m=f.parse(n,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:i,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:s6,context:p});if(c&&c[0].pos!=null){let b=c[0].pos,v=c[1]&&c[1].pos;v==null&&(v=b),h={anchor:b+s,head:v+s}}return{doc:m,sel:h,from:s,to:a}}function s6(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(wr&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||wr&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const a6=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function l6(e,t,r,n,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let C=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,T=Nv(e,C);if(T&&!e.state.selection.eq(T)){if(ur&&Yn&&e.input.lastKeyCode===13&&Date.now()-100F(e,$s(13,"Enter"))))return;let N=e.state.tr.setSelection(T);C=="pointer"?N.setMeta("pointer",!0):C=="key"&&N.scrollIntoView(),i&&N.setMeta("composition",i),e.dispatch(N)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(r);t=s.before(a+1),r=e.state.doc.resolve(r).after(a+1);let l=e.state.selection,c=i6(e,t,r),u=e.state.doc,d=u.slice(c.from,c.to),f,p;e.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Yn)&&o.some(C=>C.nodeType==1&&!a6.test(C.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",C=>C(e,$s(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!h)if(n&&l instanceof le&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let C=Wk(e,e.state.doc,c.sel);if(C&&!C.eq(e.state.selection)){let T=e.state.tr.setSelection(C);i&&T.setMeta("composition",i),e.dispatch(T)}}return}if(ur&&e.cursorWrapper&&c.sel&&c.sel.anchor==e.cursorWrapper.deco.from&&c.sel.head==c.sel.anchor){let C=h.endB-h.start;c.sel={anchor:c.sel.anchor+C,head:c.sel.anchor+C}}e.input.domChangeCount++,e.state.selection.frome.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=c.from?h.start=e.state.selection.from:h.endA=e.state.selection.to-2&&e.state.selection.to<=c.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),Ir&&Fi<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),b=c.doc.resolveNoCache(h.endB-c.from),v=u.resolve(h.start),g=m.sameParent(b)&&m.parent.inlineContent&&v.end()>=h.endA,y;if((Nl&&e.input.lastIOSEnter>Date.now()-225&&(!g||o.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!g&&m.posC(e,$s(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>h.start&&u6(u,h.start,h.endA,m,b)&&e.someProp("handleKeyDown",C=>C(e,$s(8,"Backspace")))){Yn&&ur&&e.domObserver.suppressSelectionUpdates();return}ur&&Yn&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),Yn&&!g&&m.start()!=b.start()&&b.parentOffset==0&&m.depth==b.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,b=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{e.someProp("handleKeyDown",function(C){return C(e,$s(13,"Enter"))})},20));let x=h.start,k=h.endA,w,E,M;if(g){if(m.pos==b.pos)Ir&&Fi<=11&&m.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Qo(e),20)),w=e.state.tr.delete(x,k),E=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(M=c6(m.parent.content.cut(m.parentOffset,b.parentOffset),v.parent.content.cut(v.parentOffset,h.endA-v.start()))))w=e.state.tr,M.type=="add"?w.addMark(x,k,M.mark):w.removeMark(x,k,M.mark);else if(m.parent.child(m.index()).isText&&m.index()==b.index()-(b.textOffset?0:1)){let C=m.parent.textBetween(m.parentOffset,b.parentOffset);if(e.someProp("handleTextInput",T=>T(e,x,k,C)))return;w=e.state.tr.insertText(C,x,k)}}if(w||(w=e.state.tr.replace(x,k,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let C=Wk(e,w.doc,c.sel);C&&!(ur&&Yn&&e.composing&&C.empty&&(h.start!=h.endB||e.input.lastAndroidDeletet.content.size?null:Rv(e,t.resolve(r.anchor),t.resolve(r.head))}function c6(e,t){let r=e.firstChild.marks,n=t.firstChild.marks,o=r,i=n,s,a,l;for(let u=0;uu.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;ur||mg(s,!0,!1)0&&(t||e.indexAfter(n)==e.node(n).childCount);)n--,o++,t=!1;if(r){let i=e.node(n).maybeChild(e.indexAfter(n));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function d6(e,t,r,n,o){let i=e.findDiffStart(t,r);if(i==null)return null;let{a:s,b:a}=e.findDiffEnd(t,r+e.size,r+t.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));n-=s+l-i}if(s=s?i-n:0;i-=l,a=i+(a-s),s=i}else if(a=a?i-n:0;i-=l,s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}class f6{constructor(t,r){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new RP,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(Jk),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Gk(this),qk(this),this.nodeViews=Yk(this),this.docView=Ok(this.state.doc,Kk(this),hg(this),this.dom,this),this.domObserver=new r6(this,(n,o,i,s)=>l6(this,n,o,i,s)),this.domObserver.start(),PP(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let r in t)this._props[r]=t[r];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&D1(this);let r=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Jk),this.directPlugins=t.plugins),this.updateStateInner(t.state,r)}setProps(t){let r={};for(let n in this._props)r[n]=this._props[n];r.state=this.state;for(let n in t)r[n]=t[n];this.update(r)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,r){let n=this.state,o=!1,i=!1;t.storedMarks&&this.composing&&(r5(this),i=!0),this.state=t;let s=n.plugins!=t.plugins||this._props.plugins!=r.plugins;if(s||this._props.plugins!=r.plugins||this._props.nodeViews!=r.nodeViews){let f=Yk(this);h6(f,this.nodeViews)&&(this.nodeViews=f,o=!0)}(s||r.handleDOMEvents!=this._props.handleDOMEvents)&&D1(this),this.editable=Gk(this),qk(this);let a=hg(this),l=Kk(this),c=n.plugins!=t.plugins&&!n.doc.eq(t.doc)?"reset":t.scrollToSelection>n.scrollToSelection?"to selection":"preserve",u=o||!this.docView.matchesNode(t.doc,l,a);(u||!t.selection.eq(n.selection))&&(i=!0);let d=c=="preserve"&&i&&this.dom.style.overflowAnchor==null&&qR(this);if(i){this.domObserver.stop();let f=u&&(Ir||ur)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&p6(n.selection,t.selection);if(u){let p=ur?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(t.doc,l,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Ok(t.doc,l,a,this.dom,this)),p&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&yP(this))?Qo(this,f):(jE(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&GR(d)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",r=>r(this)))if(this.state.selection instanceof ce){let r=this.docView.domAfterPos(this.state.selection.from);r.nodeType==1&&wk(this,r.getBoundingClientRect(),t)}else wk(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let r=0;rr.ownerDocument.getSelection()),this._root=r}return t||document}updateRoot(){this._root=null}posAtCoords(t){return eP(this,t)}coordsAtPos(t,r=1){return LE(this,t,r)}domAtPos(t,r=0){return this.docView.domFromPos(t,r)}nodeDOM(t){let r=this.docView.descAt(t);return r?r.nodeDOM:null}posAtDOM(t,r,n=-1){let o=this.docView.posFromDOM(t,r,n);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,r){return iP(this,r||this.state,t)}pasteHTML(t,r){return Du(this,"",t,!1,r||new ClipboardEvent("paste"))}pasteText(t,r){return Du(this,t,null,!0,r||new ClipboardEvent("paste"))}destroy(){this.docView&&(zP(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],hg(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(t){return IP(this,t)}dispatch(t){let r=this._props.dispatchTransaction;r?r.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return wr&&this.root.nodeType===11&&BR(this.dom.ownerDocument)==this.dom?o6(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Kk(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",r=>{if(typeof r=="function"&&(r=r(e.state)),r)for(let n in r)n=="class"?t.class+=" "+r[n]:n=="style"?t.style=(t.style?t.style+";":"")+r[n]:!t[n]&&n!="contenteditable"&&n!="nodeName"&&(t[n]=String(r[n]))}),t.translate||(t.translate="no"),[Ge.node(0,e.state.doc.content.size,t)]}function qk(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Ge.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Gk(e){return!e.someProp("editable",t=>t(e.state)===!1)}function p6(e,t){let r=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(r)!=t.$anchor.start(r)}function Yk(e){let t=Object.create(null);function r(n){for(let o in n)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=n[o])}return e.someProp("nodeViews",r),e.someProp("markViews",r),t}function h6(e,t){let r=0,n=0;for(let o in e){if(e[o]!=t[o])return!0;r++}for(let o in t)n++;return r!=n}function Jk(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var m6=e=>{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};const g6=Ln(m6);var a5=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},ge=(e,t,r)=>(a5(e,t,"read from private field"),r?r.call(e):t.get(e)),Io=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},qe=(e,t,r,n)=>(a5(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function v6(e){return!!(e.prev&&e.next&&e.prev.text.full!==e.next.text.full)}function y6(e){return!!(e.prev&&e.next&&e.prev.range.cursor!==e.next.range.cursor)}function b6(e){return!!(!e.prev&&e.next)}function x6(e){return!!(e.prev&&!e.next)}function k6(e){return!!(e.prev&&e.next&&e.prev.range.from!==e.next.range.from)}function w6(e){return e==="invalid-exit-split"}var S6=["jump-backward-exit","jump-forward-exit"],E6=["jump-backward-change","jump-forward-change"];function C6(e){var t,r;return dr(S6,(t=e.exit)==null?void 0:t.exitReason)||dr(E6,(r=e.change)==null?void 0:r.changeReason)}function Xk(e){return!!(e&&e.query.full.length>=e.suggester.matchOffset)}function Qk(e){return Zt(e)&&e instanceof le}function Pr(e){const{match:t,changeReason:r,exitReason:n}=e;return{...t,changeReason:r,exitReason:n}}function M6(e,t){const{invalidPrefixCharacters:r,validPrefixCharacters:n}=t;return r?!new RegExp(H1(r)).test(e):new RegExp(H1(n)).test(e)}function T6(e){const{text:t,regexp:r,$pos:n,suggester:o}=e,i=n.start();let s;return xa(t,r).forEach(a=>{const l=a.input.slice(Math.max(0,a.index-1),a.index);if(M6(l,o)){const c=a.index+i,u=a[0],d=a[1];if(!ne(u)||!ne(d))return;const f=c+u.length,p=Math.min(f,n.pos),h=p-c;c=n.pos&&(s={range:{from:c,to:f,cursor:p},match:a,query:{partial:u.slice(d.length,h),full:u.slice(d.length)},text:{partial:u.slice(0,h),full:u},textAfter:n.doc.textBetween(f,n.end(),zi,zi),textBefore:n.doc.textBetween(i,c,zi,zi),suggester:o})}}),s}function l5(e){const{$pos:t,suggester:r}=e,{char:n,name:o,startOfLine:i,supportedCharacters:s,matchOffset:a,multiline:l,caseInsensitive:c,unicode:u}=r,d=I6({char:n,matchOffset:a,startOfLine:i,supportedCharacters:s,multiline:l,caseInsensitive:c,unicode:u}),f=t.doc.textBetween(t.before(),t.end(),zi,zi);return T6({suggester:r,text:f,regexp:d,$pos:t,char:n,name:o})}function c5(e){const{state:t,match:r}=e;try{return l5({$pos:t.doc.resolve(r.range.cursor),suggester:r.suggester})}catch{return}}function u5(e){const{prev:t,next:r,state:n}=e;return!r&&t.range.from>=n.doc.nodeSize?{exit:Pr({match:t,exitReason:"delete"})}:!r||!t.query.partial?{exit:Pr({match:t,exitReason:"invalid-exit-split"})}:t.range.to===r.range.cursor?{exit:Pr({match:r,exitReason:"exit-end"})}:t.query.partial?{exit:Pr({match:r,exitReason:"exit-split"})}:{}}function O6(e){const{prev:t,next:r,state:n}=e,o=ee(),i=c5({state:n,match:t}),{exit:s}=i&&i.query.full!==t.query.full?u5({prev:t,next:i,state:n}):o;return t.range.from=t.range.to)?{exit:Pr({match:t,exitReason:"selection-outside"})}:n.pos>t.range.to?{exit:Pr({match:t,exitReason:"move-end"})}:n.pos<=t.range.from?{exit:Pr({match:t,exitReason:"move-start"})}:{}}function A6(e){const{prev:t,next:r,state:n,$pos:o}=e,i=ee();if(!t&&!r)return i;const s={prev:t,next:r};return k6(s)?O6({prev:s.prev,next:s.next,state:n}):b6(s)?{change:Pr({match:s.next,changeReason:"start"})}:x6(s)?_6({$pos:o,match:s.prev,state:n}):v6(s)?{change:Pr({match:s.next,changeReason:"change-character"})}:y6(s)?{change:Pr({match:s.next,changeReason:n.selection.empty?"move":"selection-inside"})}:i}function Zk(e,t){for(let r=e.depth;r>0;r--){const n=e.node(r);if(t.includes(n.type.name))return!0}return!1}function $1(e,t){const{$from:r,$to:n}=e;return d5(e,t)?!0:kv(r.pos,n.pos).some(o=>N6(r.doc.resolve(o),t))}function d5(e,t){const{$from:r,$to:n}=e,o=new Set((r.marksAcross(n)??[]).map(i=>i.type.name));return t.some(i=>o.has(i))}function N6(e,t){const r=new Set(e.marks().map(n=>n.type.name));return t.some(n=>r.has(n))}function R6(e,t){const{$cursor:r}=t,{validMarks:n,validNodes:o,invalidMarks:i,invalidNodes:s}=e;return!n&&!o&&Mo(i)&&Mo(s)?!0:!(n&&!d5(t,n)||o&&!Zk(r,o)||!n&&$1(t,i)||!o&&Zk(r,s))}function e2(e){const{suggesters:t,$pos:r,selectionEmpty:n}=e;for(const o of t)if(!(o.emptySelectionsOnly&&!n))try{const i=l5({suggester:o,$pos:r});if(!i)continue;const s={$from:r.doc.resolve(i.range.from),$to:r.doc.resolve(i.range.to),$cursor:r};if(R6(o,s)&&o.isValidPosition(s,i))return i}catch{}}function H1(e){return tA(e)?e.source:e}function P6(e){return e?"^":""}function z6(e,t){return`(?:${H1(e)}){${t},}`}function L6(e){return ne(e)?new RegExp(g6(e)):e}function I6(e){const{char:t,matchOffset:r,startOfLine:n,supportedCharacters:o,captureChar:i=!0,caseInsensitive:s=!1,multiline:a=!1,unicode:l=!1}=e,c=`g${a?"m":""}${s?"i":""}${l?"u":""}`;let u=L6(t).source;return i&&(u=`(${u})`),new RegExp(`${P6(n)}${u}${z6(o,r)}`,c)}var D6={appendTransaction:!1,priority:50,ignoredTag:"span",matchOffset:0,disableDecorations:!1,startOfLine:!1,suggestClassName:"suggest",suggestTag:"span",supportedCharacters:/\w+/,validPrefixCharacters:/^[\s\0]?$/,invalidPrefixCharacters:null,ignoredClassName:null,invalidMarks:[],invalidNodes:[],validMarks:null,validNodes:null,isValidPosition:()=>!0,checkNextValidSelection:null,emptySelectionsOnly:!1,caseInsensitive:!1,multiline:!1,unicode:!1,captureChar:!0},f5="__ignore_prosemirror_suggest_update__",Lf,Ic,zt,wi,ja,po,Ot,Si,Ua,p5=class{constructor(e){Io(this,Lf,!1),Io(this,Ic,!1),Io(this,zt,void 0),Io(this,wi,void 0),Io(this,ja,void 0),Io(this,po,ee()),Io(this,Ot,Ee.empty),Io(this,Si,!1),Io(this,Ua,!1),this.setMarkRemoved=()=>{qe(this,Si,!0)},this.findNextTextSelection=r=>{const n=r.$from.doc,o=Math.min(n.nodeSize-2,r.to+1),i=n.resolve(o),s=be.findFrom(i,1,!0);if(Qk(s))return s},this.ignoreNextExit=()=>{qe(this,Ic,!0)},this.addIgnored=({from:r,name:n,specific:o=!1})=>{const i=ge(this,zt).find(u=>u.name===n);if(!i)throw new Error(`No suggester exists for the name provided: ${n}`);const s=ne(i.char)?i.char.length:1,a=r+s,l=i.ignoredClassName?{class:i.ignoredClassName}:{},c=Ge.inline(r,a,{nodeName:i.ignoredTag,...l},{name:n,specific:o,char:i.char});qe(this,Ot,ge(this,Ot).add(this.view.state.doc,[c]))},this.removeIgnored=({from:r,name:n})=>{const o=ge(this,zt).find(a=>a.name===n);if(!o)throw new Error(`No suggester exists for the name provided: ${n}`);const i=ne(o.char)?o.char.length:1,s=ge(this,Ot).find(r,r+i)[0];!s||s.spec.name!==n||qe(this,Ot,ge(this,Ot).remove([s]))},this.clearIgnored=r=>{if(!r){qe(this,Ot,Ee.empty);return}const o=ge(this,Ot).find().filter(({spec:i})=>i.name===r);qe(this,Ot,ge(this,Ot).remove(o))},this.findMatchAtPosition=(r,n)=>{const o=n?ge(this,zt).filter(i=>i.name===n):ge(this,zt);return e2({suggesters:o,$pos:r,docChanged:!1,selectionEmpty:!0})},this.setLastChangeFromAppend=()=>{qe(this,Ua,!0)};const t=t2();qe(this,zt,e.map(t)),qe(this,zt,ra(ge(this,zt),(r,n)=>n.priority-r.priority))}static create(e){return new p5(e)}get decorationSet(){return ge(this,Ot)}get removed(){return ge(this,Si)}get match(){return ge(this,wi)?ge(this,wi):ge(this,ja)&&ge(this,po).exit?ge(this,ja):void 0}init(e){return this.view=e,this}createProps(e){const{name:t,char:r}=e.suggester;return{view:this.view,addIgnored:this.addIgnored,clearIgnored:this.clearIgnored,ignoreNextExit:this.ignoreNextExit,setMarkRemoved:this.setMarkRemoved,name:t,char:r,...e}}shouldRunExit(){return ge(this,Ic)?(qe(this,Ic,!1),!1):!0}updateWithNextSelection(e){var t,r,n;const o=this.findNextTextSelection(e.selection);if(o)for(const i of ge(this,zt)){const s=(t=ge(this,po).change)==null?void 0:t.suggester.name,a=(r=ge(this,po).exit)==null?void 0:r.suggester.name;(n=i.checkNextValidSelection)==null||n.call(i,o.$from,e,{change:s,exit:a})}}changeHandler(e,t){const{change:r,exit:n}=ge(this,po),o=this.match;if(!r&&!n||!Xk(o))return;const i=t===(n==null?void 0:n.suggester.appendTransaction)&&this.shouldRunExit(),s=t===(r==null?void 0:r.suggester.appendTransaction);if(!(!i&&!s)){if(r&&n&&C6({change:r,exit:n})){const a=this.createProps(n),l=this.createProps(r),c=n.range.from{const a=ne(s.char)?s.char.length:1;return i-o!==a});qe(this,Ot,t.remove(n))}shouldIgnoreMatch({range:e,suggester:{name:t}}){return ge(this,Ot).find().some(({spec:o,from:i})=>i!==e.from?!1:o.specific?o.name===t:!0)}resetState(){qe(this,po,ee()),qe(this,wi,void 0),qe(this,Si,!1),qe(this,Ua,!1)}updateReasons(e){const{$pos:t,state:r}=e,n=ge(this,Lf),o=ge(this,zt),i=r.selection.empty,s=Qk(r.selection)?e2({suggesters:o,$pos:t,docChanged:n,selectionEmpty:i}):void 0;qe(this,wi,s&&this.shouldIgnoreMatch(s)?void 0:s),qe(this,po,A6({next:ge(this,wi),prev:ge(this,ja),state:r,$pos:t}))}addSuggester(e){const t=ge(this,zt).find(n=>n.name===e.name),r=t2();if(t)qe(this,zt,ge(this,zt).map(n=>n===t?r(e):n));else{const n=[...ge(this,zt),r(e)];qe(this,zt,ra(n,(o,i)=>i.priority-o.priority))}return()=>this.removeSuggester(e.name)}removeSuggester(e){const t=ne(e)?e:e.name;qe(this,zt,ge(this,zt).filter(r=>r.name!==t)),this.clearIgnored(t)}toJSON(){return this.match}apply(e){const{exit:t,change:r}=ge(this,po);if(ge(this,Ua)&&(qe(this,Ua,!1),!(t!=null&&t.suggester.appendTransaction)&&!(r!=null&&r.suggester.appendTransaction)))return this;const{tr:n,state:o}=e,i=n.docChanged||n.selectionSet;return n.getMeta(f5)||!i&&!ge(this,Si)?this:(qe(this,Lf,n.docChanged),this.mapIgnoredDecorations(n),t&&this.resetState(),qe(this,ja,ge(this,wi)),this.updateReasons({$pos:n.selection.$from,state:o}),this)}createDecorations(e){const t=this.match;if(!Xk(t))return ge(this,Ot);const{disableDecorations:r}=t.suggester;if(_e(r)?r(e,t):r)return ge(this,Ot);const{range:o,suggester:i}=t,{name:s,suggestTag:a,suggestClassName:l}=i,{from:c,to:u}=o;return this.shouldIgnoreMatch(t)?ge(this,Ot):ge(this,Ot).add(e.doc,[Ge.inline(c,u,{nodeName:a,class:s?`${l} suggest-${s}`:l},{name:s})])}},$6=p5;Lf=new WeakMap;Ic=new WeakMap;zt=new WeakMap;wi=new WeakMap;ja=new WeakMap;po=new WeakMap;Ot=new WeakMap;Si=new WeakMap;Ua=new WeakMap;function t2(){const e=new Set;return t=>{if(e.has(t.name))throw new Error(`A suggester already exists with the name '${t.name}'. The name provided must be unique.`);const r={...D6,...t};return e.add(t.name),r}}var h5=new ka("suggest");function $v(e){return h5.getState(e)}function r2(e,t){return $v(e).addSuggester(t)}function n2(e){e.setMeta(f5,!0)}function H6(e,t){return $v(e).removeSuggester(t)}function B6(...e){const t=$6.create(e);return new Ro({key:h5,view:r=>(t.init(r),{update:n=>t.changeHandler(n.state.tr,!1)}),state:{init:()=>t,apply:(r,n,o,i)=>t.apply({tr:r,state:i})},appendTransaction:(r,n,o)=>{const i=o.tr;return t.updateWithNextSelection(i),t.changeHandler(i,!0),i.docChanged||i.steps.length>0||i.selectionSet||i.storedMarksSet?(t.setLastChangeFromAppend(),i):null},props:{decorations:r=>t.createDecorations(r)}})}function Hv(e,t){const r=Object.getPrototypeOf(t);let n=e.selection,o=e.doc,i=e.storedMarks;const s=ee();for(const[a,l]of Object.entries(t))s[a]={value:l};return Object.create(r,{...s,storedMarks:{get(){return i}},selection:{get(){return n}},doc:{get(){return o}},tr:{get(){return n=e.selection,o=e.doc,i=e.storedMarks,e}}})}function yu(e){return({state:t,dispatch:r,view:n,tr:o})=>e(Hv(o,t),r,n)}function o2(e){return t=>{var r;return te(t.dispatch===void 0||t.dispatch===((r=t.view)==null?void 0:r.dispatch),{code:H.NON_CHAINABLE_COMMAND}),e(t)}}function F6(...e){return({state:t,dispatch:r,view:n,tr:o,...i})=>{for(const s of e)if(s({state:t,dispatch:r,view:n,tr:o,...i}))return!0;return!1}}var nn={get isBrowser(){return!!(typeof window<"u"&&typeof window.document<"u"&&window.navigator&&window.navigator.userAgent)},get isJSDOM(){return nn.isBrowser&&window.navigator.userAgent.includes("jsdom")},get isNode(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null},get isIos(){return nn.isBrowser&&/iPod|iPhone|iPad/.test(navigator.platform)},get isMac(){return nn.isBrowser&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)},get isApple(){return nn.isNode?process.platform==="darwin":nn.isBrowser?/Mac|iPod|iPhone|iPad/.test(window.navigator.platform):!1},get isDevelopment(){return!1},get isTest(){return!1},get isProduction(){return!0}};function xn(e,t){var r;const n=O5(e);return((r=n==null?void 0:n.getComputedStyle(e))==null?void 0:r.getPropertyValue(t))??""}function sr(e,t){return Object.assign(e.style,t)}var V6=["px","rem","em","in","q","mm","cm","pt","pc","vh","vw","vmin","vmax"],j6=/[\d-.]+(\w+)$/;function If(e="0"){const t=e||"0",r=Number.parseFloat(t),n=t.match(j6),o=((n==null?void 0:n[1])??"px").toLowerCase();return[r,dr(V6,o)?o:"px"]}var Sn=96,hl=25.4,m5=72,g5=6;function Pl(e){if(Je(e))return xn(e,"font-size")||Pl(e.parentElement);const t=O5(e);return t?xn(t.document.documentElement,"font-size"):""}function U6(e){const t=A5(e),r=t.document.documentElement||t.document.body;return(n,o)=>{switch(o){case"rem":return n*Qs(Pl(r));case"em":return n*Qs(Pl(e),e==null?void 0:e.parentElement);case"in":return n*Sn;case"q":return n*Sn/hl/4;case"mm":return n*Sn/hl;case"cm":return n*Sn*10/hl;case"pt":return n*Sn/m5;case"pc":return n*Sn/g5;case"vh":return(n*t.innerHeight||r.clientWidth)/100;case"vw":return(n*t.innerWidth||r.clientHeight)/100;case"vmin":return n*Math.min(t.innerWidth||r.clientWidth,t.innerHeight||r.clientHeight)/100;case"vmax":return n*Math.max(t.innerWidth||r.clientWidth,t.innerHeight||r.clientHeight)/100;default:return n}}}var Df=/^([a-z]+)\((.+)\)$/i;function v5(e,t){if(!Df.test(e))return Number.NaN;const r=gN(e,{brackets:["()"],escape:"_",flat:!0});if(!r||r.length===0)return Number.NaN;function n(i){return i.replace(/_(\d+)_/g,(s,a)=>{const l=Number.parseFloat(a);return r[l]??""})}const o=Zo(r,0);for(const i of xa(o,Df)){const s=Zo(i,1),c=n(Zo(i,2)).split(/\s*,\s*/).map(u=>{if(Df.test(u)){const d=n(u);return v5(d,t)}return y5(u,t)});switch(s){case"min":return Math.min(...c);case"max":return Math.max(...c);case"clamp":{const[u,d,f]=c;if(Jt(u)&&Jt(d)&&Jt(f))return _d({min:u,max:f,value:d});break}case"calc":return Number.NaN;default:return Number.NaN}}return Number.NaN}function y5(e,t){const[r,n]=If(e);return t(r,n)}function Qs(e,t){const r=U6(t);return Df.test(e)?v5(e.toLowerCase(),r):y5(e,r)}function gg(e,t,r){const n=A5(r),o=n.document.documentElement||n.document.body,i=Qs(e,r);switch(t){case"px":return i;case"rem":return i/Qs(Pl(o));case"em":return i*Qs(Pl(r),r==null?void 0:r.parentElement);case"in":return i/Sn;case"q":return i/Sn*hl*4;case"mm":return i/Sn*hl;case"cm":return i/Sn/10*hl;case"pt":return i/Sn*m5;case"pc":return i/Sn*g5;case"vh":return i/(n.innerHeight||o.clientWidth)*100;case"vw":return i/(n.innerWidth||o.clientHeight)*100;case"vmin":return i/Math.min(n.innerWidth||o.clientWidth,n.innerHeight||o.clientHeight)*100;case"vmax":return i/Math.max(n.innerWidth||o.clientWidth,n.innerHeight||o.clientHeight)*100;default:return i}}function Op(e){return Zt(e)&&Jt(e.nodeType)&&ne(e.nodeName)}function Je(e){return Op(e)&&e.nodeType===1}function W6(e){return Op(e)&&e.nodeType===3}function Lh(e){const{types:t,node:r}=e;if(!r)return!1;const n=o=>o===r.type||o===r.type.name;return ct(t)?t.some(n):n(t)}function K6(e,t){const{tr:r}=t;return e.forEach(n=>{n.steps.forEach(o=>{r.step(o)})}),r}function q6({pos:e,tr:t}){const r=t.doc.nodeAt(e);return r&&t.delete(e,e+r.nodeSize),t}function G6({pos:e,tr:t,content:r}){const n=t.doc.nodeAt(e);return n&&t.replaceWith(e,e+n.nodeSize,r),t}function zd(e){const{predicate:t,selection:r}=e,n=k5(r)?r.selection.$from:Vv(r)?r.$from:r;for(let o=n.depth;o>0;o--){const i=n.node(o),s=o>0?n.before(o):0,a=n.start(o),l=s+i.nodeSize;if(t(i,s))return{pos:s,depth:o,node:i,start:a,end:l}}}function Y6(e){const{depth:t}=e,r=t>0?e.before(t):0,n=e.node(t),o=e.start(t),i=r+n.nodeSize;return{pos:r,start:o,node:n,end:i,depth:t}}function J6(e){const t=zd({predicate:()=>!0,selection:e});return te(t,{message:"No parent node found for the selection provided."}),t}function ts(e){const{types:t,selection:r}=e;return zd({predicate:n=>Lh({types:t,node:n}),selection:r})}function X6(e){const{types:t,selection:r}=e;if(!(!Id(r)||!Lh({types:t,node:r.node})))return{pos:r.$from.pos,depth:r.$from.depth,start:r.$from.start(),end:r.$from.pos+r.node.nodeSize,node:r.node}}function Bv(e){return Vv(e)?e.empty:e.selection.empty}function Q6(e){return e.docChanged||e.selectionSet}function b5(e){return!!Hu(e)}function Hu(e){const{state:t,type:r,attrs:n}=e,{selection:o,doc:i}=t,s=ne(r)?i.type.schema.nodes[r]:r;te(s,{code:H.SCHEMA,message:`No node exists for ${r}`});const a=X6({selection:o,types:r})??zd({predicate:l=>l.type===s,selection:o});return!n||hp(n)||!a||a.node.hasMarkup(s,{...a.node.attrs,...n})?a:void 0}function _p(...e){return t=>{if(!Yx(e))return!1;const[r,...n]=e;let o=!1;const i=(...l)=>()=>{if(!Yx(l))return!1;o=!0;const[,...c]=l;return _p(...l)({...t,next:i(...c)})},s=i(...n),a=r({...t,next:s});return o||a?a:s()}}function Z6(e,t){const r=new Map,n=ee();for(const o of e)for(const[i,s]of At(o)){const l=[...r.get(i)??[],s],c=_p(...l);r.set(i,l),n[i]=t(c)}return n}function ez(e){return Z6(e,t=>(r,n,o)=>t({state:r,dispatch:n,view:o,tr:r.tr,next:()=>!1}))}function Fv(e,t){const r=e.attrs??{};return Object.entries(t).every(([n,o])=>r[n]===o)}function tz(e){return S5(e,[Ko,bt,Dt,eo])}function nc(e){return Zt(e)}function oc(e,t){return ct(t)?dr(t,e[ti]):t===e[ti]}function rz(e){return Zt(e)&&e instanceof E1}function nz(e,t){return ne(e)?it(t.nodes,e):e}function x5(e){return Zt(e)&&e instanceof Ad}function oz(e,t){return ne(e)?it(t.marks,e):e}function Ld(e){return Zt(e)&&e instanceof Bi}function iz(e){return Zt(e)&&e instanceof R}function sz(e){return Zt(e)&&e instanceof Te}function k5(e){return Zt(e)&&e instanceof Bs}function gs(e){return Zt(e)&&e instanceof le}function az(e){return Zt(e)&&e instanceof xr}function Vv(e){return Zt(e)&&e instanceof be}function lz(e){return Zt(e)&&e instanceof Tl}function i2(e){const{trState:t,from:r,to:n,type:o,attrs:i={}}=e,{doc:s}=t,a=oz(o,s.type.schema);if(Object.keys(i).length===0)return s.rangeHasMark(r,n,a);let l=!1;return n>r&&s.nodesBetween(r,n,c=>l?!1:(l=(c.marks??[]).some(d=>d.type!==a?!1:Fv(d,i)),!l)),l}function Id(e){return Zt(e)&&e instanceof ce}function Ap(e){const{trState:t,type:r,attrs:n={},from:o,to:i}=e,{selection:s,doc:a,storedMarks:l}=t,c=ne(r)?a.type.schema.marks[r]:r;if(te(c,{code:H.SCHEMA,message:`Mark type: ${r} does not exist on the current schema.`}),o&&i)try{return Math.max(o,i)d.type!==r?!1:Fv(d,n??{})):i2({...e,from:s.from,to:s.to})}function jv(e,t={}){const r=cz(e.type.schema);if(!r)return!1;const{ignoreAttributes:n,ignoreDocAttributes:o}=t;return n?w5(r,e):o?r.content.eq(e.content):r.eq(e)}function w5(e,t){if(e===t)return!0;const r=e.type===t.type&&Te.sameSet(e.marks,t.marks);function n(){if(e.content===t.content)return!0;if(e.content.size!==t.content.size)return!1;const o=[],i=[];e.content.forEach(s=>o.push(s)),t.content.forEach(s=>i.push(s));for(const[s,a]of o.entries()){const l=i[s];if(!l||!w5(a,l))return!1}return!0}return r&&n()}function cz(e){var t;return((t=e.nodes.doc)==null?void 0:t.createAndFill())??void 0}function Ih(e){for(const t of Object.values(e.nodes))if(t.name!=="doc"&&(t.isBlock||t.isTextblock))return t;te(!1,{code:H.SCHEMA,message:"No default block node found for the provided schema."})}function uz(e){return e.type===Ih(e.type.schema)}function Dh(e){return!!e&&e.type.isBlock&&!e.textContent&&!e.childCount}function _o(e,t,r){const n=e.parent.childAfter(e.parentOffset);if(!n.node)return;const o=ne(t)?t:t.name,i=n.node.marks.find(({type:d})=>d.name===o);let s=e.index(),a=e.start()+n.offset,l=s+1,c=a+n.node.nodeSize;if(!i)return r&&c0&&i.isInSet(e.parent.child(s-1).marks);)s-=1,a-=e.parent.child(s).nodeSize;for(;l{t=f(t,i||n,e)}),i)return t?new K(R.from(e.state.schema.text(t.replace(/\r\n?/g,` +`))),0,0):K.empty;let d=e.someProp("clipboardTextParser",f=>f(t,o,n,e));if(d)a=d;else{let f=o.marks(),{schema:p}=e.state,h=an.fromSchema(p);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(m=>{let b=s.appendChild(document.createElement("p"));m&&b.appendChild(h.serializeNode(p.text(m,f)))})}}else e.someProp("transformPastedHTML",d=>{r=d(r,e)}),s=LP(r),Pd&&IP(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||Cv.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!PP.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=DP(jk(a,+u[1],+u[2]),u[4]);else if(a=K.maxOpen(zP(a.content,o),!0),a.openStart||a.openEnd){let d=0,f=0;for(let p=a.content.firstChild;d{a=d(a,e)}),a}const PP=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function zP(e,t){if(e.childCount<2)return e;for(let r=t.depth;r>=0;r--){let o=t.node(r).contentMatchAt(t.index(r)),i,s=[];if(e.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&ZE(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=eC(s[s.length-1],i.length));let u=QE(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return R.from(s)}return e}function QE(e,t,r=0){for(let n=t.length-1;n>=r;n--)e=t[n].create(null,R.from(e));return e}function ZE(e,t,r,n,o){if(o1&&(i=0),o=r&&(a=t<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(R.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function jk(e,t,r){return t]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let r=rC().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(e),o;if((o=n&&tC[n[1].toLowerCase()])&&(e=o.map(i=>"<"+i+">").join("")+e+o.map(i=>"").reverse().join("")),r.innerHTML=e,o)for(let i=0;i=0;a-=2){let l=r.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;o=R.from(l.create(n[a+1],o)),i++,s++}return new K(o,i,s)}const Er={},Cr={},$P={touchstart:!0,touchmove:!0};class HP{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function BP(e){for(let t in Er){let r=Er[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=n=>{VP(e,n)&&!Iv(e,n)&&(e.editable||!(n.type in Cr))&&r(e,n)},$P[t]?{passive:!0}:void 0)}Sr&&e.dom.addEventListener("input",()=>null),B1(e)}function Ii(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function FP(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function B1(e){e.someProp("handleDOMEvents",t=>{for(let r in t)e.input.eventHandlers[r]||e.dom.addEventListener(r,e.input.eventHandlers[r]=n=>Iv(e,n))})}function Iv(e,t){return e.someProp("handleDOMEvents",r=>{let n=r[t.type];return n?n(e,t)||t.defaultPrevented:!1})}function VP(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let r=t.target;r!=e.dom;r=r.parentNode)if(!r||r.nodeType==11||r.pmViewDesc&&r.pmViewDesc.stopEvent(t))return!1;return!0}function jP(e,t){!Iv(e,t)&&Er[t.type]&&(e.editable||!(t.type in Cr))&&Er[t.type](e,t)}Cr.keydown=(e,t)=>{let r=t;if(e.input.shiftKey=r.keyCode==16||r.shiftKey,!oC(e,r)&&(e.input.lastKeyCode=r.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Jn&&dr&&r.keyCode==13)))if(r.keyCode!=229&&e.domObserver.forceFlush(),Nl&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();e.input.lastIOSEnter=n,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==n&&(e.someProp("handleKeyDown",o=>o(e,$s(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",n=>n(e,r))||RP(e,r)?r.preventDefault():Ii(e,"key")};Cr.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Cr.keypress=(e,t)=>{let r=t;if(oC(e,r)||!r.charCode||r.ctrlKey&&!r.altKey||wn&&r.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,r))){r.preventDefault();return}let n=e.state.selection;if(!(n instanceof le)||!n.$from.sameParent(n.$to)){let o=String.fromCharCode(r.charCode);!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",i=>i(e,n.$from.pos,n.$to.pos,o))&&e.dispatch(e.state.tr.insertText(o).scrollIntoView()),r.preventDefault()}};function Dh(e){return{left:e.clientX,top:e.clientY}}function UP(e,t){let r=t.x-e.clientX,n=t.y-e.clientY;return r*r+n*n<100}function Dv(e,t,r,n,o){if(n==-1)return!1;let i=e.state.doc.resolve(n);for(let s=i.depth+1;s>0;s--)if(e.someProp(t,a=>s>i.depth?a(e,r,i.nodeAfter,i.before(s),o,!0):a(e,r,i.node(s),i.before(s),o,!1)))return!0;return!1}function pl(e,t,r){e.focused||e.focus();let n=e.state.tr.setSelection(t);r=="pointer"&&n.setMeta("pointer",!0),e.dispatch(n)}function WP(e,t){if(t==-1)return!1;let r=e.state.doc.resolve(t),n=r.nodeAfter;return n&&n.isAtom&&ce.isSelectable(n)?(pl(e,new ce(r),"pointer"),!0):!1}function KP(e,t){if(t==-1)return!1;let r=e.state.selection,n,o;r instanceof ce&&(n=r.node);let i=e.state.doc.resolve(t);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(ce.isSelectable(a)){n&&r.$from.depth>0&&s>=r.$from.depth&&i.before(r.$from.depth+1)==r.$from.pos?o=i.before(r.$from.depth):o=i.before(s);break}}return o!=null?(pl(e,ce.create(e.state.doc,o),"pointer"),!0):!1}function qP(e,t,r,n,o){return Dv(e,"handleClickOn",t,r,n)||e.someProp("handleClick",i=>i(e,t,n))||(o?KP(e,r):WP(e,r))}function GP(e,t,r,n){return Dv(e,"handleDoubleClickOn",t,r,n)||e.someProp("handleDoubleClick",o=>o(e,t,n))}function YP(e,t,r,n){return Dv(e,"handleTripleClickOn",t,r,n)||e.someProp("handleTripleClick",o=>o(e,t,n))||JP(e,r,n)}function JP(e,t,r){if(r.button!=0)return!1;let n=e.state.doc;if(t==-1)return n.inlineContent?(pl(e,le.create(n,0,n.content.size),"pointer"),!0):!1;let o=n.resolve(t);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)pl(e,le.create(n,a+1,a+1+s.content.size),"pointer");else if(ce.isSelectable(s))pl(e,ce.create(n,a),"pointer");else continue;return!0}}function $v(e){return Tp(e)}const nC=wn?"metaKey":"ctrlKey";Er.mousedown=(e,t)=>{let r=t;e.input.shiftKey=r.shiftKey;let n=$v(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&UP(r,e.input.lastClick)&&!r[nC]&&(e.input.lastClick.type=="singleClick"?i="doubleClick":e.input.lastClick.type=="doubleClick"&&(i="tripleClick")),e.input.lastClick={time:o,x:r.clientX,y:r.clientY,type:i};let s=e.posAtCoords(Dh(r));s&&(i=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new XP(e,s,r,!!n)):(i=="doubleClick"?GP:YP)(e,s.pos,s.inside,r)?r.preventDefault():Ii(e,"pointer"))};class XP{constructor(t,r,n,o){this.view=t,this.pos=r,this.event=n,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[nC],this.allowDefault=n.shiftKey;let i,s;if(r.inside>-1)i=t.state.doc.nodeAt(r.inside),s=r.inside;else{let u=t.state.doc.resolve(r.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:n.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=t.state;(n.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof ce&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&oo&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ii(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Qo(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(Dh(t))),this.updateAllowDefault(t),this.allowDefault||!r?Ii(this.view,"pointer"):qP(this.view,r.pos,r.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Sr&&this.mightDrag&&!this.mightDrag.node.isAtom||dr&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(pl(this.view,be.near(this.view.state.doc.resolve(r.pos)),"pointer"),t.preventDefault()):Ii(this.view,"pointer")}move(t){this.updateAllowDefault(t),Ii(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}Er.touchstart=e=>{e.input.lastTouch=Date.now(),$v(e),Ii(e,"pointer")};Er.touchmove=e=>{e.input.lastTouch=Date.now(),Ii(e,"pointer")};Er.contextmenu=e=>$v(e);function oC(e,t){return e.composing?!0:Sr&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const QP=Jn?5e3:-1;Cr.compositionstart=Cr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,r=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||r.marks(),Tp(e,!0),e.markCursor=null;else if(Tp(e),oo&&t.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=e.domSelectionRange();for(let o=n.focusNode,i=n.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){e.domSelection().collapse(s,s.nodeValue.length);break}else o=s,i=-1}}e.input.composing=!0}iC(e,QP)};Cr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,iC(e,20))};function iC(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Tp(e),t))}function sC(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=ZP());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function ZP(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Tp(e,t=!1){if(!(Jn&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),sC(e),t||e.docView&&e.docView.dirty){let r=zv(e);return r&&!r.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(r)):e.updateState(e.state),!0}return!1}}function e6(e,t){if(!e.dom.parentNode)return;let r=e.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(t),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),n.removeAllRanges(),n.addRange(o),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),e.focus()},50)}const Rl=Ir&&Fi<15||Nl&&XR<604;Er.copy=Cr.cut=(e,t)=>{let r=t,n=e.state.selection,o=r.type=="cut";if(n.empty)return;let i=Rl?null:r.clipboardData,s=n.content(),{dom:a,text:l}=JE(e,s);i?(r.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):e6(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function t6(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function r6(e,t){if(!e.dom.parentNode)return;let r=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,n=e.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let o=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),n.parentNode&&n.parentNode.removeChild(n),r?$u(e,n.value,null,o,t):$u(e,n.textContent,n.innerHTML,o,t)},50)}function $u(e,t,r,n,o){let i=XE(e,t,r,n,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,o,i||K.empty)))return!0;if(!i)return!1;let s=t6(i),a=s?e.state.tr.replaceSelectionWith(s,n):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Cr.paste=(e,t)=>{let r=t;if(e.composing&&!Jn)return;let n=Rl?null:r.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;n&&$u(e,n.getData("text/plain"),n.getData("text/html"),o,r)?r.preventDefault():r6(e,r)};class n6{constructor(t,r){this.slice=t,this.move=r}}const aC=wn?"altKey":"ctrlKey";Er.dragstart=(e,t)=>{let r=t,n=e.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(Dh(r));if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof ce?o.to-1:o.to))){if(n&&n.mightDrag)e.dispatch(e.state.tr.setSelection(ce.create(e.state.doc,n.mightDrag.pos)));else if(r.target&&r.target.nodeType==1){let c=e.docView.nearestDesc(r.target,!0);c&&c.node.type.spec.draggable&&c!=e.docView&&e.dispatch(e.state.tr.setSelection(ce.create(e.state.doc,c.posBefore)))}}let s=e.state.selection.content(),{dom:a,text:l}=JE(e,s);r.dataTransfer.clearData(),r.dataTransfer.setData(Rl?"Text":"text/html",a.innerHTML),r.dataTransfer.effectAllowed="copyMove",Rl||r.dataTransfer.setData("text/plain",l),e.dragging=new n6(s,!r[aC])};Er.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Cr.dragover=Cr.dragenter=(e,t)=>t.preventDefault();Cr.drop=(e,t)=>{let r=t,n=e.dragging;if(e.dragging=null,!r.dataTransfer)return;let o=e.posAtCoords(Dh(r));if(!o)return;let i=e.state.doc.resolve(o.pos),s=n&&n.slice;s?e.someProp("transformPasted",h=>{s=h(s,e)}):s=XE(e,r.dataTransfer.getData(Rl?"Text":"text/plain"),Rl?null:r.dataTransfer.getData("text/html"),!1,i);let a=!!(n&&!r[aC]);if(e.someProp("handleDrop",h=>h(e,r,s||K.empty,a))){r.preventDefault();return}if(!s)return;r.preventDefault();let l=s?rN(e.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=e.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&ce.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new ce(p));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,b,v,g)=>h=g),c.setSelection(Lv(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))};Er.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Qo(e)},20))};Er.blur=(e,t)=>{let r=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),r.relatedTarget&&e.dom.contains(r.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Er.beforeinput=(e,t)=>{if(dr&&Jn&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:n}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=n||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,$s(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in Cr)Er[e]=Cr[e];function Hu(e,t){if(e==t)return!0;for(let r in e)if(e[r]!==t[r])return!1;for(let r in t)if(!(r in e))return!1;return!0}class Op{constructor(t,r){this.toDOM=t,this.spec=r||Js,this.side=this.spec.side||0}map(t,r,n,o){let{pos:i,deleted:s}=t.mapResult(r.from+o,this.side<0?-1:1);return s?null:new Ge(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof Op&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Hu(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class ji{constructor(t,r){this.attrs=t,this.spec=r||Js}map(t,r,n,o){let i=t.map(r.from+o,this.spec.inclusiveStart?-1:1)-n,s=t.map(r.to+o,this.spec.inclusiveEnd?1:-1)-n;return i>=s?null:new Ge(i,s,this)}valid(t,r){return r.from=t&&(!i||i(a.spec))&&n.push(a.copy(a.from+o,a.to+o))}for(let s=0;st){let a=this.children[s]+1;this.children[s+2].findInner(t-a,r-a,n,o+a,i)}}map(t,r,n){return this==lr||t.maps.length==0?this:this.mapInner(t,r,0,0,n||Js)}mapInner(t,r,n,o,i){let s;for(let a=0;a{let c=l+n,u;if(u=cC(r,a,c)){for(o||(o=this.children.slice());ia&&d.to=t){this.children[a]==t&&(n=this.children[a+2]);break}let i=t+1,s=i+r.content.size;for(let a=0;ai&&l.type instanceof ji){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;co.map(t,r,Js));return Ni.from(n)}forChild(t,r){if(r.isLeaf)return Ee.empty;let n=[];for(let o=0;or instanceof Ee)?t:t.reduce((r,n)=>r.concat(n instanceof Ee?n:n.members),[]))}}}function o6(e,t,r,n,o,i,s){let a=e.slice();for(let c=0,u=i;c{let b=m-h-(p-f);for(let v=0;vg+u-d)continue;let y=a[v]+u-d;p>=y?a[v+1]=f<=y?-2:-1:h>=o&&b&&(a[v]+=b,a[v+1]+=b)}d+=b}),u=r.maps[c].map(u,-1)}let l=!1;for(let c=0;c=n.content.size){l=!0;continue}let f=r.map(e[c+1]+i,-1),p=f-o,{index:h,offset:m}=n.content.findIndex(d),b=n.maybeChild(h);if(b&&m==d&&m+b.nodeSize==p){let v=a[c+2].mapInner(r,b,u+1,e[c]+i+1,s);v!=lr?(a[c]=d,a[c+1]=p,a[c+2]=v):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=i6(a,e,t,r,o,i,s),u=_p(c,n,0,s);t=u.local;for(let d=0;dr&&s.to{let c=cC(e,a,l+r);if(c){i=!0;let u=_p(c,a,r+l+1,n);u!=lr&&o.push(l,l+a.nodeSize,u)}});let s=lC(i?uC(e):e,-r).sort(Xs);for(let a=0;a0;)t++;e.splice(t,0,r)}function vg(e){let t=[];return e.someProp("decorations",r=>{let n=r(e.state);n&&n!=lr&&t.push(n)}),e.cursorWrapper&&t.push(Ee.create(e.state.doc,[e.cursorWrapper.deco])),Ni.from(t)}const s6={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},a6=Ir&&Fi<=11;class l6{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class c6{constructor(t,r){this.view=t,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new l6,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let o=0;oo.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),a6&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,s6)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let r=0;rthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Dk(this.view)){if(this.suppressingSelectionUpdates)return Qo(this.view);if(Ir&&Fi<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&ia(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let r=new Set,n;for(let i=t.focusNode;i;i=Du(i))r.add(i);for(let i=t.anchorNode;i;i=Du(i))if(r.has(i)){n=i;break}let o=n&&this.view.docView.nearestDesc(n);if(o&&o.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Dk(t)&&!this.ignoreSelectionChange(n),i=-1,s=-1,a=!1,l=[];if(t.editable)for(let u=0;u1){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||o)&&(i>-1&&(t.docView.markDirty(i,s),u6(t)),this.handleDOMChange(i,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||Qo(t),this.currentSelection.set(n))}registerMutation(t,r){if(r.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(n==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!n||n.ignoreMutation(t))return null;if(t.type=="childList"){for(let u=0;uo;b--){let v=n.childNodes[b-1],g=v.pmViewDesc;if(v.nodeName=="BR"&&!g){i=b;break}if(!g||g.size)break}let d=e.state.doc,f=e.someProp("domParser")||Cv.fromSchema(e.state.schema),p=d.resolve(s),h=null,m=f.parse(n,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:i,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:p6,context:p});if(c&&c[0].pos!=null){let b=c[0].pos,v=c[1]&&c[1].pos;v==null&&(v=b),h={anchor:b+s,head:v+s}}return{doc:m,sel:h,from:s,to:a}}function p6(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(Sr&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||Sr&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const h6=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function m6(e,t,r,n,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let C=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,M=zv(e,C);if(M&&!e.state.selection.eq(M)){if(dr&&Jn&&e.input.lastKeyCode===13&&Date.now()-100F(e,$s(13,"Enter"))))return;let N=e.state.tr.setSelection(M);C=="pointer"?N.setMeta("pointer",!0):C=="key"&&N.scrollIntoView(),i&&N.setMeta("composition",i),e.dispatch(N)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(r);t=s.before(a+1),r=e.state.doc.resolve(r).after(a+1);let l=e.state.selection,c=f6(e,t,r),u=e.state.doc,d=u.slice(c.from,c.to),f,p;e.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Jn)&&o.some(C=>C.nodeType==1&&!h6.test(C.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",C=>C(e,$s(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!h)if(n&&l instanceof le&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let C=Gk(e,e.state.doc,c.sel);if(C&&!C.eq(e.state.selection)){let M=e.state.tr.setSelection(C);i&&M.setMeta("composition",i),e.dispatch(M)}}return}if(dr&&e.cursorWrapper&&c.sel&&c.sel.anchor==e.cursorWrapper.deco.from&&c.sel.head==c.sel.anchor){let C=h.endB-h.start;c.sel={anchor:c.sel.anchor+C,head:c.sel.anchor+C}}e.input.domChangeCount++,e.state.selection.frome.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=c.from?h.start=e.state.selection.from:h.endA=e.state.selection.to-2&&e.state.selection.to<=c.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),Ir&&Fi<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),b=c.doc.resolveNoCache(h.endB-c.from),v=u.resolve(h.start),g=m.sameParent(b)&&m.parent.inlineContent&&v.end()>=h.endA,y;if((Nl&&e.input.lastIOSEnter>Date.now()-225&&(!g||o.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!g&&m.posC(e,$s(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>h.start&&v6(u,h.start,h.endA,m,b)&&e.someProp("handleKeyDown",C=>C(e,$s(8,"Backspace")))){Jn&&dr&&e.domObserver.suppressSelectionUpdates();return}dr&&Jn&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),Jn&&!g&&m.start()!=b.start()&&b.parentOffset==0&&m.depth==b.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,b=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{e.someProp("handleKeyDown",function(C){return C(e,$s(13,"Enter"))})},20));let x=h.start,k=h.endA,w,E,T;if(g){if(m.pos==b.pos)Ir&&Fi<=11&&m.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Qo(e),20)),w=e.state.tr.delete(x,k),E=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(T=g6(m.parent.content.cut(m.parentOffset,b.parentOffset),v.parent.content.cut(v.parentOffset,h.endA-v.start()))))w=e.state.tr,T.type=="add"?w.addMark(x,k,T.mark):w.removeMark(x,k,T.mark);else if(m.parent.child(m.index()).isText&&m.index()==b.index()-(b.textOffset?0:1)){let C=m.parent.textBetween(m.parentOffset,b.parentOffset);if(e.someProp("handleTextInput",M=>M(e,x,k,C)))return;w=e.state.tr.insertText(C,x,k)}}if(w||(w=e.state.tr.replace(x,k,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let C=Gk(e,w.doc,c.sel);C&&!(dr&&Jn&&e.composing&&C.empty&&(h.start!=h.endB||e.input.lastAndroidDeletet.content.size?null:Lv(e,t.resolve(r.anchor),t.resolve(r.head))}function g6(e,t){let r=e.firstChild.marks,n=t.firstChild.marks,o=r,i=n,s,a,l;for(let u=0;uu.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;ur||yg(s,!0,!1)0&&(t||e.indexAfter(n)==e.node(n).childCount);)n--,o++,t=!1;if(r){let i=e.node(n).maybeChild(e.indexAfter(n));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function y6(e,t,r,n,o){let i=e.findDiffStart(t,r);if(i==null)return null;let{a:s,b:a}=e.findDiffEnd(t,r+e.size,r+t.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));n-=s+l-i}if(s=s?i-n:0;i-=l,a=i+(a-s),s=i}else if(a=a?i-n:0;i-=l,s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}class b6{constructor(t,r){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new HP,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(Zk),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Xk(this),Jk(this),this.nodeViews=Qk(this),this.docView=Nk(this.state.doc,Yk(this),vg(this),this.dom,this),this.domObserver=new c6(this,(n,o,i,s)=>m6(this,n,o,i,s)),this.domObserver.start(),BP(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let r in t)this._props[r]=t[r];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&B1(this);let r=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Zk),this.directPlugins=t.plugins),this.updateStateInner(t.state,r)}setProps(t){let r={};for(let n in this._props)r[n]=this._props[n];r.state=this.state;for(let n in t)r[n]=t[n];this.update(r)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,r){let n=this.state,o=!1,i=!1;t.storedMarks&&this.composing&&(sC(this),i=!0),this.state=t;let s=n.plugins!=t.plugins||this._props.plugins!=r.plugins;if(s||this._props.plugins!=r.plugins||this._props.nodeViews!=r.nodeViews){let f=Qk(this);k6(f,this.nodeViews)&&(this.nodeViews=f,o=!0)}(s||r.handleDOMEvents!=this._props.handleDOMEvents)&&B1(this),this.editable=Xk(this),Jk(this);let a=vg(this),l=Yk(this),c=n.plugins!=t.plugins&&!n.doc.eq(t.doc)?"reset":t.scrollToSelection>n.scrollToSelection?"to selection":"preserve",u=o||!this.docView.matchesNode(t.doc,l,a);(u||!t.selection.eq(n.selection))&&(i=!0);let d=c=="preserve"&&i&&this.dom.style.overflowAnchor==null&&eP(this);if(i){this.domObserver.stop();let f=u&&(Ir||dr)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&x6(n.selection,t.selection);if(u){let p=dr?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(t.doc,l,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Nk(t.doc,l,a,this.dom,this)),p&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&CP(this))?Qo(this,f):(qE(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&tP(d)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",r=>r(this)))if(this.state.selection instanceof ce){let r=this.docView.domAfterPos(this.state.selection.from);r.nodeType==1&&Ck(this,r.getBoundingClientRect(),t)}else Ck(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let r=0;rr.ownerDocument.getSelection()),this._root=r}return t||document}updateRoot(){this._root=null}posAtCoords(t){return aP(this,t)}coordsAtPos(t,r=1){return HE(this,t,r)}domAtPos(t,r=0){return this.docView.domFromPos(t,r)}nodeDOM(t){let r=this.docView.descAt(t);return r?r.nodeDOM:null}posAtDOM(t,r,n=-1){let o=this.docView.posFromDOM(t,r,n);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,r){return fP(this,r||this.state,t)}pasteHTML(t,r){return $u(this,"",t,!1,r||new ClipboardEvent("paste"))}pasteText(t,r){return $u(this,t,null,!0,r||new ClipboardEvent("paste"))}destroy(){this.docView&&(FP(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],vg(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(t){return jP(this,t)}dispatch(t){let r=this._props.dispatchTransaction;r?r.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return Sr&&this.root.nodeType===11&&qR(this.dom.ownerDocument)==this.dom?d6(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Yk(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",r=>{if(typeof r=="function"&&(r=r(e.state)),r)for(let n in r)n=="class"?t.class+=" "+r[n]:n=="style"?t.style=(t.style?t.style+";":"")+r[n]:!t[n]&&n!="contenteditable"&&n!="nodeName"&&(t[n]=String(r[n]))}),t.translate||(t.translate="no"),[Ge.node(0,e.state.doc.content.size,t)]}function Jk(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Ge.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Xk(e){return!e.someProp("editable",t=>t(e.state)===!1)}function x6(e,t){let r=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(r)!=t.$anchor.start(r)}function Qk(e){let t=Object.create(null);function r(n){for(let o in n)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=n[o])}return e.someProp("nodeViews",r),e.someProp("markViews",r),t}function k6(e,t){let r=0,n=0;for(let o in e){if(e[o]!=t[o])return!0;r++}for(let o in t)n++;return r!=n}function Zk(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var w6=e=>{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};const S6=Dn(w6);var dC=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},ge=(e,t,r)=>(dC(e,t,"read from private field"),r?r.call(e):t.get(e)),Io=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},qe=(e,t,r,n)=>(dC(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function E6(e){return!!(e.prev&&e.next&&e.prev.text.full!==e.next.text.full)}function C6(e){return!!(e.prev&&e.next&&e.prev.range.cursor!==e.next.range.cursor)}function M6(e){return!!(!e.prev&&e.next)}function T6(e){return!!(e.prev&&!e.next)}function O6(e){return!!(e.prev&&e.next&&e.prev.range.from!==e.next.range.from)}function _6(e){return e==="invalid-exit-split"}var A6=["jump-backward-exit","jump-forward-exit"],N6=["jump-backward-change","jump-forward-change"];function R6(e){var t,r;return fr(A6,(t=e.exit)==null?void 0:t.exitReason)||fr(N6,(r=e.change)==null?void 0:r.changeReason)}function e2(e){return!!(e&&e.query.full.length>=e.suggester.matchOffset)}function t2(e){return Zt(e)&&e instanceof le}function Pr(e){const{match:t,changeReason:r,exitReason:n}=e;return{...t,changeReason:r,exitReason:n}}function P6(e,t){const{invalidPrefixCharacters:r,validPrefixCharacters:n}=t;return r?!new RegExp(V1(r)).test(e):new RegExp(V1(n)).test(e)}function z6(e){const{text:t,regexp:r,$pos:n,suggester:o}=e,i=n.start();let s;return xa(t,r).forEach(a=>{const l=a.input.slice(Math.max(0,a.index-1),a.index);if(P6(l,o)){const c=a.index+i,u=a[0],d=a[1];if(!ne(u)||!ne(d))return;const f=c+u.length,p=Math.min(f,n.pos),h=p-c;c=n.pos&&(s={range:{from:c,to:f,cursor:p},match:a,query:{partial:u.slice(d.length,h),full:u.slice(d.length)},text:{partial:u.slice(0,h),full:u},textAfter:n.doc.textBetween(f,n.end(),zi,zi),textBefore:n.doc.textBetween(i,c,zi,zi),suggester:o})}}),s}function fC(e){const{$pos:t,suggester:r}=e,{char:n,name:o,startOfLine:i,supportedCharacters:s,matchOffset:a,multiline:l,caseInsensitive:c,unicode:u}=r,d=j6({char:n,matchOffset:a,startOfLine:i,supportedCharacters:s,multiline:l,caseInsensitive:c,unicode:u}),f=t.doc.textBetween(t.before(),t.end(),zi,zi);return z6({suggester:r,text:f,regexp:d,$pos:t,char:n,name:o})}function pC(e){const{state:t,match:r}=e;try{return fC({$pos:t.doc.resolve(r.range.cursor),suggester:r.suggester})}catch{return}}function hC(e){const{prev:t,next:r,state:n}=e;return!r&&t.range.from>=n.doc.nodeSize?{exit:Pr({match:t,exitReason:"delete"})}:!r||!t.query.partial?{exit:Pr({match:t,exitReason:"invalid-exit-split"})}:t.range.to===r.range.cursor?{exit:Pr({match:r,exitReason:"exit-end"})}:t.query.partial?{exit:Pr({match:r,exitReason:"exit-split"})}:{}}function L6(e){const{prev:t,next:r,state:n}=e,o=ee(),i=pC({state:n,match:t}),{exit:s}=i&&i.query.full!==t.query.full?hC({prev:t,next:i,state:n}):o;return t.range.from=t.range.to)?{exit:Pr({match:t,exitReason:"selection-outside"})}:n.pos>t.range.to?{exit:Pr({match:t,exitReason:"move-end"})}:n.pos<=t.range.from?{exit:Pr({match:t,exitReason:"move-start"})}:{}}function D6(e){const{prev:t,next:r,state:n,$pos:o}=e,i=ee();if(!t&&!r)return i;const s={prev:t,next:r};return O6(s)?L6({prev:s.prev,next:s.next,state:n}):M6(s)?{change:Pr({match:s.next,changeReason:"start"})}:T6(s)?I6({$pos:o,match:s.prev,state:n}):E6(s)?{change:Pr({match:s.next,changeReason:"change-character"})}:C6(s)?{change:Pr({match:s.next,changeReason:n.selection.empty?"move":"selection-inside"})}:i}function r2(e,t){for(let r=e.depth;r>0;r--){const n=e.node(r);if(t.includes(n.type.name))return!0}return!1}function F1(e,t){const{$from:r,$to:n}=e;return mC(e,t)?!0:Ev(r.pos,n.pos).some(o=>$6(r.doc.resolve(o),t))}function mC(e,t){const{$from:r,$to:n}=e,o=new Set((r.marksAcross(n)??[]).map(i=>i.type.name));return t.some(i=>o.has(i))}function $6(e,t){const r=new Set(e.marks().map(n=>n.type.name));return t.some(n=>r.has(n))}function H6(e,t){const{$cursor:r}=t,{validMarks:n,validNodes:o,invalidMarks:i,invalidNodes:s}=e;return!n&&!o&&Mo(i)&&Mo(s)?!0:!(n&&!mC(t,n)||o&&!r2(r,o)||!n&&F1(t,i)||!o&&r2(r,s))}function n2(e){const{suggesters:t,$pos:r,selectionEmpty:n}=e;for(const o of t)if(!(o.emptySelectionsOnly&&!n))try{const i=fC({suggester:o,$pos:r});if(!i)continue;const s={$from:r.doc.resolve(i.range.from),$to:r.doc.resolve(i.range.to),$cursor:r};if(H6(o,s)&&o.isValidPosition(s,i))return i}catch{}}function V1(e){return lA(e)?e.source:e}function B6(e){return e?"^":""}function F6(e,t){return`(?:${V1(e)}){${t},}`}function V6(e){return ne(e)?new RegExp(S6(e)):e}function j6(e){const{char:t,matchOffset:r,startOfLine:n,supportedCharacters:o,captureChar:i=!0,caseInsensitive:s=!1,multiline:a=!1,unicode:l=!1}=e,c=`g${a?"m":""}${s?"i":""}${l?"u":""}`;let u=V6(t).source;return i&&(u=`(${u})`),new RegExp(`${B6(n)}${u}${F6(o,r)}`,c)}var U6={appendTransaction:!1,priority:50,ignoredTag:"span",matchOffset:0,disableDecorations:!1,startOfLine:!1,suggestClassName:"suggest",suggestTag:"span",supportedCharacters:/\w+/,validPrefixCharacters:/^[\s\0]?$/,invalidPrefixCharacters:null,ignoredClassName:null,invalidMarks:[],invalidNodes:[],validMarks:null,validNodes:null,isValidPosition:()=>!0,checkNextValidSelection:null,emptySelectionsOnly:!1,caseInsensitive:!1,multiline:!1,unicode:!1,captureChar:!0},gC="__ignore_prosemirror_suggest_update__",Df,Dc,zt,wi,ja,po,Ot,Si,Ua,vC=class{constructor(e){Io(this,Df,!1),Io(this,Dc,!1),Io(this,zt,void 0),Io(this,wi,void 0),Io(this,ja,void 0),Io(this,po,ee()),Io(this,Ot,Ee.empty),Io(this,Si,!1),Io(this,Ua,!1),this.setMarkRemoved=()=>{qe(this,Si,!0)},this.findNextTextSelection=r=>{const n=r.$from.doc,o=Math.min(n.nodeSize-2,r.to+1),i=n.resolve(o),s=be.findFrom(i,1,!0);if(t2(s))return s},this.ignoreNextExit=()=>{qe(this,Dc,!0)},this.addIgnored=({from:r,name:n,specific:o=!1})=>{const i=ge(this,zt).find(u=>u.name===n);if(!i)throw new Error(`No suggester exists for the name provided: ${n}`);const s=ne(i.char)?i.char.length:1,a=r+s,l=i.ignoredClassName?{class:i.ignoredClassName}:{},c=Ge.inline(r,a,{nodeName:i.ignoredTag,...l},{name:n,specific:o,char:i.char});qe(this,Ot,ge(this,Ot).add(this.view.state.doc,[c]))},this.removeIgnored=({from:r,name:n})=>{const o=ge(this,zt).find(a=>a.name===n);if(!o)throw new Error(`No suggester exists for the name provided: ${n}`);const i=ne(o.char)?o.char.length:1,s=ge(this,Ot).find(r,r+i)[0];!s||s.spec.name!==n||qe(this,Ot,ge(this,Ot).remove([s]))},this.clearIgnored=r=>{if(!r){qe(this,Ot,Ee.empty);return}const o=ge(this,Ot).find().filter(({spec:i})=>i.name===r);qe(this,Ot,ge(this,Ot).remove(o))},this.findMatchAtPosition=(r,n)=>{const o=n?ge(this,zt).filter(i=>i.name===n):ge(this,zt);return n2({suggesters:o,$pos:r,docChanged:!1,selectionEmpty:!0})},this.setLastChangeFromAppend=()=>{qe(this,Ua,!0)};const t=o2();qe(this,zt,e.map(t)),qe(this,zt,ra(ge(this,zt),(r,n)=>n.priority-r.priority))}static create(e){return new vC(e)}get decorationSet(){return ge(this,Ot)}get removed(){return ge(this,Si)}get match(){return ge(this,wi)?ge(this,wi):ge(this,ja)&&ge(this,po).exit?ge(this,ja):void 0}init(e){return this.view=e,this}createProps(e){const{name:t,char:r}=e.suggester;return{view:this.view,addIgnored:this.addIgnored,clearIgnored:this.clearIgnored,ignoreNextExit:this.ignoreNextExit,setMarkRemoved:this.setMarkRemoved,name:t,char:r,...e}}shouldRunExit(){return ge(this,Dc)?(qe(this,Dc,!1),!1):!0}updateWithNextSelection(e){var t,r,n;const o=this.findNextTextSelection(e.selection);if(o)for(const i of ge(this,zt)){const s=(t=ge(this,po).change)==null?void 0:t.suggester.name,a=(r=ge(this,po).exit)==null?void 0:r.suggester.name;(n=i.checkNextValidSelection)==null||n.call(i,o.$from,e,{change:s,exit:a})}}changeHandler(e,t){const{change:r,exit:n}=ge(this,po),o=this.match;if(!r&&!n||!e2(o))return;const i=t===(n==null?void 0:n.suggester.appendTransaction)&&this.shouldRunExit(),s=t===(r==null?void 0:r.suggester.appendTransaction);if(!(!i&&!s)){if(r&&n&&R6({change:r,exit:n})){const a=this.createProps(n),l=this.createProps(r),c=n.range.from{const a=ne(s.char)?s.char.length:1;return i-o!==a});qe(this,Ot,t.remove(n))}shouldIgnoreMatch({range:e,suggester:{name:t}}){return ge(this,Ot).find().some(({spec:o,from:i})=>i!==e.from?!1:o.specific?o.name===t:!0)}resetState(){qe(this,po,ee()),qe(this,wi,void 0),qe(this,Si,!1),qe(this,Ua,!1)}updateReasons(e){const{$pos:t,state:r}=e,n=ge(this,Df),o=ge(this,zt),i=r.selection.empty,s=t2(r.selection)?n2({suggesters:o,$pos:t,docChanged:n,selectionEmpty:i}):void 0;qe(this,wi,s&&this.shouldIgnoreMatch(s)?void 0:s),qe(this,po,D6({next:ge(this,wi),prev:ge(this,ja),state:r,$pos:t}))}addSuggester(e){const t=ge(this,zt).find(n=>n.name===e.name),r=o2();if(t)qe(this,zt,ge(this,zt).map(n=>n===t?r(e):n));else{const n=[...ge(this,zt),r(e)];qe(this,zt,ra(n,(o,i)=>i.priority-o.priority))}return()=>this.removeSuggester(e.name)}removeSuggester(e){const t=ne(e)?e:e.name;qe(this,zt,ge(this,zt).filter(r=>r.name!==t)),this.clearIgnored(t)}toJSON(){return this.match}apply(e){const{exit:t,change:r}=ge(this,po);if(ge(this,Ua)&&(qe(this,Ua,!1),!(t!=null&&t.suggester.appendTransaction)&&!(r!=null&&r.suggester.appendTransaction)))return this;const{tr:n,state:o}=e,i=n.docChanged||n.selectionSet;return n.getMeta(gC)||!i&&!ge(this,Si)?this:(qe(this,Df,n.docChanged),this.mapIgnoredDecorations(n),t&&this.resetState(),qe(this,ja,ge(this,wi)),this.updateReasons({$pos:n.selection.$from,state:o}),this)}createDecorations(e){const t=this.match;if(!e2(t))return ge(this,Ot);const{disableDecorations:r}=t.suggester;if(_e(r)?r(e,t):r)return ge(this,Ot);const{range:o,suggester:i}=t,{name:s,suggestTag:a,suggestClassName:l}=i,{from:c,to:u}=o;return this.shouldIgnoreMatch(t)?ge(this,Ot):ge(this,Ot).add(e.doc,[Ge.inline(c,u,{nodeName:a,class:s?`${l} suggest-${s}`:l},{name:s})])}},W6=vC;Df=new WeakMap;Dc=new WeakMap;zt=new WeakMap;wi=new WeakMap;ja=new WeakMap;po=new WeakMap;Ot=new WeakMap;Si=new WeakMap;Ua=new WeakMap;function o2(){const e=new Set;return t=>{if(e.has(t.name))throw new Error(`A suggester already exists with the name '${t.name}'. The name provided must be unique.`);const r={...U6,...t};return e.add(t.name),r}}var yC=new ka("suggest");function Fv(e){return yC.getState(e)}function i2(e,t){return Fv(e).addSuggester(t)}function s2(e){e.setMeta(gC,!0)}function K6(e,t){return Fv(e).removeSuggester(t)}function q6(...e){const t=W6.create(e);return new Ro({key:yC,view:r=>(t.init(r),{update:n=>t.changeHandler(n.state.tr,!1)}),state:{init:()=>t,apply:(r,n,o,i)=>t.apply({tr:r,state:i})},appendTransaction:(r,n,o)=>{const i=o.tr;return t.updateWithNextSelection(i),t.changeHandler(i,!0),i.docChanged||i.steps.length>0||i.selectionSet||i.storedMarksSet?(t.setLastChangeFromAppend(),i):null},props:{decorations:r=>t.createDecorations(r)}})}function Vv(e,t){const r=Object.getPrototypeOf(t);let n=e.selection,o=e.doc,i=e.storedMarks;const s=ee();for(const[a,l]of Object.entries(t))s[a]={value:l};return Object.create(r,{...s,storedMarks:{get(){return i}},selection:{get(){return n}},doc:{get(){return o}},tr:{get(){return n=e.selection,o=e.doc,i=e.storedMarks,e}}})}function bu(e){return({state:t,dispatch:r,view:n,tr:o})=>e(Vv(o,t),r,n)}function a2(e){return t=>{var r;return te(t.dispatch===void 0||t.dispatch===((r=t.view)==null?void 0:r.dispatch),{code:H.NON_CHAINABLE_COMMAND}),e(t)}}function G6(...e){return({state:t,dispatch:r,view:n,tr:o,...i})=>{for(const s of e)if(s({state:t,dispatch:r,view:n,tr:o,...i}))return!0;return!1}}var on={get isBrowser(){return!!(typeof window<"u"&&typeof window.document<"u"&&window.navigator&&window.navigator.userAgent)},get isJSDOM(){return on.isBrowser&&window.navigator.userAgent.includes("jsdom")},get isNode(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null},get isIos(){return on.isBrowser&&/iPod|iPhone|iPad/.test(navigator.platform)},get isMac(){return on.isBrowser&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)},get isApple(){return on.isNode?process.platform==="darwin":on.isBrowser?/Mac|iPod|iPhone|iPad/.test(window.navigator.platform):!1},get isDevelopment(){return!1},get isTest(){return!1},get isProduction(){return!0}};function kn(e,t){var r;const n=RC(e);return((r=n==null?void 0:n.getComputedStyle(e))==null?void 0:r.getPropertyValue(t))??""}function ar(e,t){return Object.assign(e.style,t)}var Y6=["px","rem","em","in","q","mm","cm","pt","pc","vh","vw","vmin","vmax"],J6=/[\d-.]+(\w+)$/;function $f(e="0"){const t=e||"0",r=Number.parseFloat(t),n=t.match(J6),o=((n==null?void 0:n[1])??"px").toLowerCase();return[r,fr(Y6,o)?o:"px"]}var Cn=96,hl=25.4,bC=72,xC=6;function Pl(e){if(Je(e))return kn(e,"font-size")||Pl(e.parentElement);const t=RC(e);return t?kn(t.document.documentElement,"font-size"):""}function X6(e){const t=zC(e),r=t.document.documentElement||t.document.body;return(n,o)=>{switch(o){case"rem":return n*Qs(Pl(r));case"em":return n*Qs(Pl(e),e==null?void 0:e.parentElement);case"in":return n*Cn;case"q":return n*Cn/hl/4;case"mm":return n*Cn/hl;case"cm":return n*Cn*10/hl;case"pt":return n*Cn/bC;case"pc":return n*Cn/xC;case"vh":return(n*t.innerHeight||r.clientWidth)/100;case"vw":return(n*t.innerWidth||r.clientHeight)/100;case"vmin":return n*Math.min(t.innerWidth||r.clientWidth,t.innerHeight||r.clientHeight)/100;case"vmax":return n*Math.max(t.innerWidth||r.clientWidth,t.innerHeight||r.clientHeight)/100;default:return n}}}var Hf=/^([a-z]+)\((.+)\)$/i;function kC(e,t){if(!Hf.test(e))return Number.NaN;const r=SN(e,{brackets:["()"],escape:"_",flat:!0});if(!r||r.length===0)return Number.NaN;function n(i){return i.replace(/_(\d+)_/g,(s,a)=>{const l=Number.parseFloat(a);return r[l]??""})}const o=Zo(r,0);for(const i of xa(o,Hf)){const s=Zo(i,1),c=n(Zo(i,2)).split(/\s*,\s*/).map(u=>{if(Hf.test(u)){const d=n(u);return kC(d,t)}return wC(u,t)});switch(s){case"min":return Math.min(...c);case"max":return Math.max(...c);case"clamp":{const[u,d,f]=c;if(Jt(u)&&Jt(d)&&Jt(f))return Ad({min:u,max:f,value:d});break}case"calc":return Number.NaN;default:return Number.NaN}}return Number.NaN}function wC(e,t){const[r,n]=$f(e);return t(r,n)}function Qs(e,t){const r=X6(t);return Hf.test(e)?kC(e.toLowerCase(),r):wC(e,r)}function bg(e,t,r){const n=zC(r),o=n.document.documentElement||n.document.body,i=Qs(e,r);switch(t){case"px":return i;case"rem":return i/Qs(Pl(o));case"em":return i*Qs(Pl(r),r==null?void 0:r.parentElement);case"in":return i/Cn;case"q":return i/Cn*hl*4;case"mm":return i/Cn*hl;case"cm":return i/Cn/10*hl;case"pt":return i/Cn*bC;case"pc":return i/Cn*xC;case"vh":return i/(n.innerHeight||o.clientWidth)*100;case"vw":return i/(n.innerWidth||o.clientHeight)*100;case"vmin":return i/Math.min(n.innerWidth||o.clientWidth,n.innerHeight||o.clientHeight)*100;case"vmax":return i/Math.max(n.innerWidth||o.clientWidth,n.innerHeight||o.clientHeight)*100;default:return i}}function Ap(e){return Zt(e)&&Jt(e.nodeType)&&ne(e.nodeName)}function Je(e){return Ap(e)&&e.nodeType===1}function Q6(e){return Ap(e)&&e.nodeType===3}function $h(e){const{types:t,node:r}=e;if(!r)return!1;const n=o=>o===r.type||o===r.type.name;return ct(t)?t.some(n):n(t)}function Z6(e,t){const{tr:r}=t;return e.forEach(n=>{n.steps.forEach(o=>{r.step(o)})}),r}function ez({pos:e,tr:t}){const r=t.doc.nodeAt(e);return r&&t.delete(e,e+r.nodeSize),t}function tz({pos:e,tr:t,content:r}){const n=t.doc.nodeAt(e);return n&&t.replaceWith(e,e+n.nodeSize,r),t}function Ld(e){const{predicate:t,selection:r}=e,n=CC(r)?r.selection.$from:Wv(r)?r.$from:r;for(let o=n.depth;o>0;o--){const i=n.node(o),s=o>0?n.before(o):0,a=n.start(o),l=s+i.nodeSize;if(t(i,s))return{pos:s,depth:o,node:i,start:a,end:l}}}function rz(e){const{depth:t}=e,r=t>0?e.before(t):0,n=e.node(t),o=e.start(t),i=r+n.nodeSize;return{pos:r,start:o,node:n,end:i,depth:t}}function nz(e){const t=Ld({predicate:()=>!0,selection:e});return te(t,{message:"No parent node found for the selection provided."}),t}function ts(e){const{types:t,selection:r}=e;return Ld({predicate:n=>$h({types:t,node:n}),selection:r})}function oz(e){const{types:t,selection:r}=e;if(!(!Dd(r)||!$h({types:t,node:r.node})))return{pos:r.$from.pos,depth:r.$from.depth,start:r.$from.start(),end:r.$from.pos+r.node.nodeSize,node:r.node}}function jv(e){return Wv(e)?e.empty:e.selection.empty}function iz(e){return e.docChanged||e.selectionSet}function SC(e){return!!Bu(e)}function Bu(e){const{state:t,type:r,attrs:n}=e,{selection:o,doc:i}=t,s=ne(r)?i.type.schema.nodes[r]:r;te(s,{code:H.SCHEMA,message:`No node exists for ${r}`});const a=oz({selection:o,types:r})??Ld({predicate:l=>l.type===s,selection:o});return!n||gp(n)||!a||a.node.hasMarkup(s,{...a.node.attrs,...n})?a:void 0}function Np(...e){return t=>{if(!Qx(e))return!1;const[r,...n]=e;let o=!1;const i=(...l)=>()=>{if(!Qx(l))return!1;o=!0;const[,...c]=l;return Np(...l)({...t,next:i(...c)})},s=i(...n),a=r({...t,next:s});return o||a?a:s()}}function sz(e,t){const r=new Map,n=ee();for(const o of e)for(const[i,s]of At(o)){const l=[...r.get(i)??[],s],c=Np(...l);r.set(i,l),n[i]=t(c)}return n}function az(e){return sz(e,t=>(r,n,o)=>t({state:r,dispatch:n,view:o,tr:r.tr,next:()=>!1}))}function Uv(e,t){const r=e.attrs??{};return Object.entries(t).every(([n,o])=>r[n]===o)}function lz(e){return TC(e,[Ko,bt,Dt,eo])}function oc(e){return Zt(e)}function ic(e,t){return ct(t)?fr(t,e[ti]):t===e[ti]}function cz(e){return Zt(e)&&e instanceof T1}function uz(e,t){return ne(e)?it(t.nodes,e):e}function EC(e){return Zt(e)&&e instanceof Nd}function dz(e,t){return ne(e)?it(t.marks,e):e}function Id(e){return Zt(e)&&e instanceof Bi}function fz(e){return Zt(e)&&e instanceof R}function pz(e){return Zt(e)&&e instanceof Te}function CC(e){return Zt(e)&&e instanceof Bs}function gs(e){return Zt(e)&&e instanceof le}function hz(e){return Zt(e)&&e instanceof kr}function Wv(e){return Zt(e)&&e instanceof be}function mz(e){return Zt(e)&&e instanceof Tl}function l2(e){const{trState:t,from:r,to:n,type:o,attrs:i={}}=e,{doc:s}=t,a=dz(o,s.type.schema);if(Object.keys(i).length===0)return s.rangeHasMark(r,n,a);let l=!1;return n>r&&s.nodesBetween(r,n,c=>l?!1:(l=(c.marks??[]).some(d=>d.type!==a?!1:Uv(d,i)),!l)),l}function Dd(e){return Zt(e)&&e instanceof ce}function Rp(e){const{trState:t,type:r,attrs:n={},from:o,to:i}=e,{selection:s,doc:a,storedMarks:l}=t,c=ne(r)?a.type.schema.marks[r]:r;if(te(c,{code:H.SCHEMA,message:`Mark type: ${r} does not exist on the current schema.`}),o&&i)try{return Math.max(o,i)d.type!==r?!1:Uv(d,n??{})):l2({...e,from:s.from,to:s.to})}function Kv(e,t={}){const r=gz(e.type.schema);if(!r)return!1;const{ignoreAttributes:n,ignoreDocAttributes:o}=t;return n?MC(r,e):o?r.content.eq(e.content):r.eq(e)}function MC(e,t){if(e===t)return!0;const r=e.type===t.type&&Te.sameSet(e.marks,t.marks);function n(){if(e.content===t.content)return!0;if(e.content.size!==t.content.size)return!1;const o=[],i=[];e.content.forEach(s=>o.push(s)),t.content.forEach(s=>i.push(s));for(const[s,a]of o.entries()){const l=i[s];if(!l||!MC(a,l))return!1}return!0}return r&&n()}function gz(e){var t;return((t=e.nodes.doc)==null?void 0:t.createAndFill())??void 0}function Hh(e){for(const t of Object.values(e.nodes))if(t.name!=="doc"&&(t.isBlock||t.isTextblock))return t;te(!1,{code:H.SCHEMA,message:"No default block node found for the provided schema."})}function vz(e){return e.type===Hh(e.type.schema)}function Bh(e){return!!e&&e.type.isBlock&&!e.textContent&&!e.childCount}function _o(e,t,r){const n=e.parent.childAfter(e.parentOffset);if(!n.node)return;const o=ne(t)?t:t.name,i=n.node.marks.find(({type:d})=>d.name===o);let s=e.index(),a=e.start()+n.offset,l=s+1,c=a+n.node.nodeSize;if(!i)return r&&c0&&i.isInSet(e.parent.child(s-1).marks);)s-=1,a-=e.parent.child(s).nodeSize;for(;le instanceof r)}function fz(e){return Y4(e,({from:r,to:n,prevFrom:o,prevTo:i})=>`${r}_${n}_${o}_${i}`).filter((r,n,o)=>!o.some((i,s)=>n===s?!1:r.prevFrom>=i.prevFrom&&r.prevTo<=i.prevTo&&r.from>=i.from&&r.to<=i.to))}function E5(e,t=[]){const r=[],{steps:n,mapping:o}=e,i=o.invert();n.forEach((a,l)=>{if(!S5(a,t))return;const c=[],u=a.getMap(),d=o.slice(l);if(u.ranges.length===0&&tz(a)){const{from:f,to:p}=a;c.push({from:f,to:p})}else u.forEach((f,p)=>{c.push({from:f,to:p})});c.forEach(f=>{const p=d.map(f.from,-1),h=d.map(f.to);r.push({from:p,to:h,prevFrom:i.map(p,-1),prevTo:i.map(h)})})});const s=ra(r,(a,l)=>a.from-l.from);return fz(s)}function pz(e,t){const r=[],n=E5(e,t);for(const o of n)try{const i=e.doc.resolve(o.from),s=e.doc.resolve(o.to),a=i.blockRange(s);a&&r.push(a)}catch{}return r}function hz(e){var t;return((t=e.content.firstChild)==null?void 0:t.textContent)??""}function mz(e,t){if(!gs(e.selection))return;let{from:r,to:n}=e.selection;const o=(s,a)=>hz(le.between(e.doc.resolve(s),e.doc.resolve(a)).content());for(let s=o(r-1,r);s&&!t.test(s);r--,s=o(r-1,r));for(let s=o(n,n+1);s&&!t.test(s);n++,s=o(n,n+1));if(r===n)return;const i=e.doc.textBetween(r,n,yv,` +`);return{from:a,to:c,text:u,mark:i}}function yz(e,t){const r=[],{$from:n,$to:o}=e;let i=n;for(;;){const s=_o(i,t,o);if(!s)return r;if(r.push(s),s.toe instanceof r)}function bz(e){return Z4(e,({from:r,to:n,prevFrom:o,prevTo:i})=>`${r}_${n}_${o}_${i}`).filter((r,n,o)=>!o.some((i,s)=>n===s?!1:r.prevFrom>=i.prevFrom&&r.prevTo<=i.prevTo&&r.from>=i.from&&r.to<=i.to))}function OC(e,t=[]){const r=[],{steps:n,mapping:o}=e,i=o.invert();n.forEach((a,l)=>{if(!TC(a,t))return;const c=[],u=a.getMap(),d=o.slice(l);if(u.ranges.length===0&&lz(a)){const{from:f,to:p}=a;c.push({from:f,to:p})}else u.forEach((f,p)=>{c.push({from:f,to:p})});c.forEach(f=>{const p=d.map(f.from,-1),h=d.map(f.to);r.push({from:p,to:h,prevFrom:i.map(p,-1),prevTo:i.map(h)})})});const s=ra(r,(a,l)=>a.from-l.from);return bz(s)}function xz(e,t){const r=[],n=OC(e,t);for(const o of n)try{const i=e.doc.resolve(o.from),s=e.doc.resolve(o.to),a=i.blockRange(s);a&&r.push(a)}catch{}return r}function kz(e){var t;return((t=e.content.firstChild)==null?void 0:t.textContent)??""}function wz(e,t){if(!gs(e.selection))return;let{from:r,to:n}=e.selection;const o=(s,a)=>kz(le.between(e.doc.resolve(s),e.doc.resolve(a)).content());for(let s=o(r-1,r);s&&!t.test(s);r--,s=o(r-1,r));for(let s=o(n,n+1);s&&!t.test(s);n++,s=o(n,n+1));if(r===n)return;const i=e.doc.textBetween(r,n,kv,` -`);return{from:r,to:n,text:i}}function C5(e){return mz(e,/\W/)}function Zo(e,t=0){const r=ct(e)?e[t]:e;return B4(ne(r),`No match string found for match ${e}`),r??""}function gz(e){return gs(e)?e.$cursor:void 0}function vz(e,t){return Ld(e)?t?e.type===t.nodes.doc:e.type.name==="doc":!1}function yz(e){return Zt(e)&&Jt(e.anchor)&&Jt(e.head)}function jr(e,t){const r=t.nodeSize-2,n=0;let o;const i=l=>_d({min:n,max:r,value:l});if(Vv(e))return e;if(e==="all")return new xr(t);if(e==="start"?o=n:e==="end"?o=r:lz(e)?o=e.pos:o=e,Jt(o))return o=i(o),le.near(t.resolve(o));if(yz(o)){const l=i(o.anchor),c=i(o.head);return le.between(t.resolve(l),t.resolve(c))}const s=i(o.from),a=i(o.to);return le.between(t.resolve(s),t.resolve(a))}var bz=3;function M5(e){const{content:t,schema:r,document:n,stringHandler:o,onError:i,attempts:s=0}=e,a=i&&s<=bz||s===0;if(te(a,{code:H.INVALID_CONTENT,message:"The invalid content has been called recursively more than ${MAX_ATTEMPTS} times. The content is invalid and the error handler has not been able to recover properly."}),ne(t))return te(o,{code:H.INVALID_CONTENT,message:`The string '${t}' was added to the editor, but no \`stringHandler\` was added. Please provide a valid string handler which transforms your content to a \`ProsemirrorNode\` to prevent this error.`}),o({document:n,content:t,schema:r});if(k5(t))return t.doc;if(Ld(t))return t;try{return r.nodeFromJSON(t)}catch(l){const c=Ez({schema:r,error:l,json:t}),u=i==null?void 0:i(c);return te(u,{code:H.INVALID_CONTENT,message:`An error occurred when processing the content. Please provide an \`onError\` handler to process the invalid content: ${JSON.stringify(c.invalidContent,null,2)}`}),M5({...e,content:u,attempts:s+1})}}function $h(){const e=TE();if(e)return e;throw new Error(`Unable to retrieve the document from the global scope. +`);return{from:r,to:n,text:i}}function _C(e){return wz(e,/\W/)}function Zo(e,t=0){const r=ct(e)?e[t]:e;return U4(ne(r),`No match string found for match ${e}`),r??""}function Sz(e){return gs(e)?e.$cursor:void 0}function Ez(e,t){return Id(e)?t?e.type===t.nodes.doc:e.type.name==="doc":!1}function Cz(e){return Zt(e)&&Jt(e.anchor)&&Jt(e.head)}function jr(e,t){const r=t.nodeSize-2,n=0;let o;const i=l=>Ad({min:n,max:r,value:l});if(Wv(e))return e;if(e==="all")return new kr(t);if(e==="start"?o=n:e==="end"?o=r:mz(e)?o=e.pos:o=e,Jt(o))return o=i(o),le.near(t.resolve(o));if(Cz(o)){const l=i(o.anchor),c=i(o.head);return le.between(t.resolve(l),t.resolve(c))}const s=i(o.from),a=i(o.to);return le.between(t.resolve(s),t.resolve(a))}var Mz=3;function AC(e){const{content:t,schema:r,document:n,stringHandler:o,onError:i,attempts:s=0}=e,a=i&&s<=Mz||s===0;if(te(a,{code:H.INVALID_CONTENT,message:"The invalid content has been called recursively more than ${MAX_ATTEMPTS} times. The content is invalid and the error handler has not been able to recover properly."}),ne(t))return te(o,{code:H.INVALID_CONTENT,message:`The string '${t}' was added to the editor, but no \`stringHandler\` was added. Please provide a valid string handler which transforms your content to a \`ProsemirrorNode\` to prevent this error.`}),o({document:n,content:t,schema:r});if(CC(t))return t.doc;if(Id(t))return t;try{return r.nodeFromJSON(t)}catch(l){const c=Nz({schema:r,error:l,json:t}),u=i==null?void 0:i(c);return te(u,{code:H.INVALID_CONTENT,message:`An error occurred when processing the content. Please provide an \`onError\` handler to process the invalid content: ${JSON.stringify(c.invalidContent,null,2)}`}),AC({...e,content:u,attempts:s+1})}}function Fh(){const e=NE();if(e)return e;throw new Error(`Unable to retrieve the document from the global scope. It seems that you are running Remirror in a non-browser environment. Remirror need browser APIs to work. If you are using Jest (or other testing frameworks), make sure that you are using the JSDOM environment (https://jestjs.io/docs/29.0/configuration#testenvironment-string). If you are using Next.js (or other server-side rendering frameworks), please use dynamic import with \`ssr: false\` to load the editor component without rendering it on the server (https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr). -If you are using Node.js, you can install JSDOM and Remirror will try to use it automatically, or you can create a fake document and pass it to Remirror`)}function T5(e){var t;return(e==null?void 0:e.defaultView)??(typeof window<"u"?window:void 0)??((t=TE())==null?void 0:t.defaultView)}function O5(e){return T5(e==null?void 0:e.ownerDocument)}function _5(e){const t=T5(e)??$h().defaultView;if(t)return t;throw new Error("Unable to retrieve the window from the global scope")}function A5(e){return _5(e==null?void 0:e.ownerDocument)}function xz(e,t=$h()){const r=vz(e,e.type.schema)?e.content:R.from(e);return sn.fromSchema(e.type.schema).serializeFragment(r,{document:t})}function kz(e,t){return new(_5(t)).DOMParser().parseFromString(`${e}`,"text/html").body}function wz(e,t=$h()){const r=t.createElement("div");return r.append(xz(e,t)),r.innerHTML}function B1(e){const{content:t,schema:r,document:n,fragment:o=!1,...i}=e,s=kz(t,n),a=wv.fromSchema(r);return o?a.parseSlice(s,{...s2,...i}).content:a.parse(s,{...s2,...i})}var s2={preserveWhitespace:!1};function Dd(e,t){const r=zu(t.defaults());return bv({...e},r)}function Uv(e,t){let r="";t&&(r=`${t.trim()}`);const n=pN(e);if(!n)return r;const o=(r.endsWith(";")," ");return`${r}${o}${n}`}var Sz={remove(e,t){let r=e;for(const n of t)n.invalidParentNode||(r=aA(n.path,r));return r}};function Ez({json:e,schema:t,...r}){const n=new Set(zu(t.marks)),o=new Set(zu(t.nodes)),i=N5({json:e,path:[],validNodes:o,validMarks:n});return{json:e,invalidContent:i,transformers:Sz,...r}}function N5(e){const{json:t,validMarks:r,validNodes:n,path:o=[]}=e,i={validMarks:r,validNodes:n},s=[],{type:a,marks:l,content:c}=t;let{invalidParentMark:u=!1,invalidParentNode:d=!1}=e;if(l){const f=[];for(const[p,h]of l.entries()){const m=ne(h)?h:h.type;r.has(m)||(f.unshift({name:m,path:[...o,"marks",`${p}`],type:"mark",invalidParentMark:u,invalidParentNode:d}),u=!0)}s.push(...f)}if(n.has(a)||(s.push({name:a,type:"node",path:o,invalidParentMark:u,invalidParentNode:d}),d=!0),c){const f=[];for(const[p,h]of c.entries())f.unshift(...N5({...i,json:h,path:[...o,"content",`${p}`],invalidParentMark:u,invalidParentNode:d}));s.unshift(...f)}return s}function Cz(e){return!!(gs(e)&&e.$cursor&&e.$cursor.parentOffset>=e.$cursor.parent.content.size)}function F1(e){return!!(gs(e)&&e.$cursor&&e.$cursor.parentOffset<=0)}function a2(e){const t=be.atStart(e.$anchor.doc);return!!(F1(e)&&t.anchor===e.anchor)}function Mz(e){return({dispatch:t,tr:r})=>{const{type:n,attrs:o=ee(),appendText:i,range:s}=e,a=s?le.between(r.doc.resolve(s.from),r.doc.resolve(s.to)):r.selection,{$from:l,from:c,to:u}=a;let d=l.depth===0?r.doc.type.allowsMarkType(n):!1;return r.doc.nodesBetween(c,u,f=>{if(d)return!1;if(f.inlineContent&&f.type.allowsMarkType(n)){d=!0;return}}),d?(t==null||t(r.addMark(c,u,n.create(o))&&i?r.insertText(i):r),!0):!1}}function Tz({tr:e,dispatch:t}){const{$from:r,$to:n}=e.selection,o=r.blockRange(n),i=o&&tc(o);return!Jt(i)||!o?!1:(t==null||t(e.lift(o,i).scrollIntoView()),!0)}function R5(e,t={},r){return function(n){const{tr:o,dispatch:i,state:s}=n,a=ne(e)?it(s.schema.nodes,e):e,{from:l,to:c}=jr(r??o.selection,o.doc),u=o.doc.resolve(l),d=o.doc.resolve(c),f=u.blockRange(d),p=f&&Ev(f,a,t);return!p||!f?!1:(i==null||i(o.wrap(f,p).scrollIntoView()),!0)}}function P5(e,t={},r){return n=>{const{tr:o,state:i}=n,s=ne(e)?it(i.schema.nodes,e):e;return Hu({state:o,type:s,attrs:t})?Tz(n):R5(e,t,r)(n)}}function Bu(e,t,r,n=!0){return function(o){const{tr:i,dispatch:s,state:a}=o,l=ne(e)?it(a.schema.nodes,e):e,{from:c,to:u}=jr(r??i.selection,i.doc);let d=!1,f;return i.doc.nodesBetween(c,u,(p,h)=>{if(d)return!1;if(!p.isTextblock||p.hasMarkup(l,t))return;if(p.type===l){d=!0,f=p.attrs;return}const m=i.doc.resolve(h),b=m.index();d=m.parent.canReplaceWith(b,b+1,l),d&&(f=m.parent.attrs)}),d?(s==null||s(i.setBlockType(c,u,l,{...n?f:{},...t}).scrollIntoView()),!0):!1}}function Wv(e){return t=>{const{tr:r,state:n}=t,{type:o,attrs:i,preserveAttrs:s=!0}=e,a=Hu({state:r,type:o,attrs:i}),l=e.toggleType??Ih(n.schema);if(a)return Bu(l,{...s?a.node.attrs:{},...i})(t);const c=Hu({state:r,type:l,attrs:i});return Bu(o,{...s?c==null?void 0:c.node.attrs:{},...i})(t)}}function Oz(e=0){const t=navigator.userAgent.match(/Chrom(e|ium)\/(\d+)\./);return t?Number.parseInt(it(t,2),10)>=e:!1}function _z(e,t){let{head:r,empty:n,anchor:o}=e;for(const i of t.steps)r=i.getMap().map(r);n?t.setSelection(le.near(t.doc.resolve(r))):t.setSelection(le.between(t.doc.resolve(o),t.doc.resolve(r)))}function Az(e){const{attrs:t={},appendText:r="",content:n="",keepSelection:o=!1,range:i}=e;return({state:s,tr:a,dispatch:l})=>{var c;const u=s.schema,d=jr(e.selection??i??a.selection,a.doc),f=d.$from.index(),{from:p,to:h,$from:m}=d,b=ne(e.type)?u.nodes[e.type]??u.marks[e.type]:e.type;if(te(ne(e.type)?b:!0,{code:H.SCHEMA,message:`Schema contains no marks or nodes with name ${b}`}),rz(b)){if(!m.parent.canReplaceWith(f,f,b))return!1;a.replaceWith(p,h,b.create(t,n?u.text(n):void 0))}else te(n,{message:"`replaceText` cannot be called without content when using a mark type"}),a.replaceWith(p,h,u.text(n,x5(b)?[b.create(t)]:void 0));return r&&a.insertText(r),o&&_z(s.selection,a),l&&(Oz(60)&&((c=document.getSelection())==null||c.empty()),l(a)),!0}}function z5(e,t){const r=e.parent.childAfter(e.parentOffset);if(!r.node)return;const{marks:n,nodeSize:o}=r.node;if(n[0])return n[0].type;const s=e.start()+r.offset+o;return z5(e.doc.resolve(s+1))}function L5(e){return({dispatch:t,tr:r,state:n})=>{const{type:o,expand:i=!0,range:s}=e,a=jr(e.selection??s??r.selection,r.doc);let{from:l,to:c,$from:u,$to:d}=a;const f=ne(o)?n.schema.marks[o]:o;f!==null&&te(f,{code:H.SCHEMA,message:`Mark type: ${o} does not exist on the current schema.`});const p=f??z5(u);if(!p)return!1;const h=_o(u,p,d);return i&&h&&(l=Math.max(0,Math.min(l,h.from)),c=Math.min(Math.max(c,h.to),r.doc.nodeSize-2)),t==null||t(r.removeMark(l,Jt(c)?c:l,x5(f)?f:void 0)),!0}}function Nz(e){const t=["command","cmd","meta"];return nn.isMac&&t.push("mod"),t.includes(e)}function Rz(e){const t=["control","ctrl"];return nn.isMac||t.push("mod"),t.includes(e)}function Pz(e){const t=[];for(let r of e.split("-")){if(r=r.toLowerCase(),Nz(r)){t.push({type:"modifier",symbol:"⌘",key:"command",i18n:Mt.COMMAND_KEY});continue}if(Rz(r)){t.push({type:"modifier",symbol:"⌃",key:"control",i18n:Mt.CONTROL_KEY});continue}switch(r){case"shift":t.push({type:"modifier",symbol:"⇧",key:r,i18n:Mt.SHIFT_KEY});continue;case"alt":t.push({type:"modifier",symbol:"⌥",key:r,i18n:Mt.ALT_KEY});continue;case` -`:case"\r":case"enter":t.push({type:"named",symbol:"↵",key:r,i18n:Mt.ENTER_KEY});continue;case"backspace":t.push({type:"named",symbol:"⌫",key:r,i18n:Mt.BACKSPACE_KEY});continue;case"delete":t.push({type:"named",symbol:"⌦",key:r,i18n:Mt.DELETE_KEY});continue;case"escape":t.push({type:"named",symbol:"␛",key:r,i18n:Mt.ESCAPE_KEY});continue;case"tab":t.push({type:"named",symbol:"⇥",key:r,i18n:Mt.TAB_KEY});continue;case"capslock":t.push({type:"named",symbol:"⇪",key:r,i18n:Mt.CAPS_LOCK_KEY});continue;case"space":t.push({type:"named",symbol:"␣",key:r,i18n:Mt.SPACE_KEY});continue;case"pageup":t.push({type:"named",symbol:"⤒",key:r,i18n:Mt.PAGE_UP_KEY});continue;case"pagedown":t.push({type:"named",symbol:"⤓",key:r,i18n:Mt.PAGE_DOWN_KEY});continue;case"home":t.push({type:"named",key:r,i18n:Mt.HOME_KEY});continue;case"end":t.push({type:"named",key:r,i18n:Mt.END_KEY});continue;case"arrowleft":t.push({type:"named",symbol:"←",key:r,i18n:Mt.ARROW_LEFT_KEY});continue;case"arrowright":t.push({type:"named",symbol:"→",key:r,i18n:Mt.ARROW_RIGHT_KEY});continue;case"arrowup":t.push({type:"named",symbol:"→",key:r,i18n:Mt.ARROW_UP_KEY});continue;case"arrowdown":t.push({type:"named",symbol:"↓",key:r,i18n:Mt.ARROW_DOWN_KEY});continue;default:t.push({type:"char",key:r});continue}}return t}function zz(e){const{node:t,predicate:r,descend:n=!0,action:o}=e;te(Ld(t),{code:H.INTERNAL,message:'Invalid "node" parameter passed to "findChildren".'}),te(_e(r),{code:H.INTERNAL,message:'Invalid "predicate" parameter passed to "findChildren".'});const i=[];return t.descendants((s,a)=>{const l={node:s,pos:a};return r(l)&&(i.push(l),o==null||o(l)),n}),i}function Lz(e){const{type:t,...r}=e;return zz({...r,predicate:n=>n.node.type===t})}function Iz(e,t={}){const{descend:r=!1,predicate:n,StepTypes:o}=t,i=pz(e,o),s=[];for(const a of i){const{start:l,end:c}=a;e.doc.nodesBetween(l,c,(u,d)=>(((n==null?void 0:n(u,d,a))??!0)&&s.push({node:u,pos:d}),r))}return s}function Fu(e){const{regexp:t,type:r,getAttributes:n,ignoreWhitespace:o=!1,beforeDispatch:i,updateCaptured:s,shouldSkip:a,invalidMarks:l}=e;let c;const u=new wa(t,(d,f,p,h)=>{const{tr:m,schema:b}=d;c||(c=ne(r)?b.marks[r]:r,te(c,{code:H.SCHEMA,message:`Mark type: ${r} does not exist on the current schema.`}));let v=f[1],g=f[0];const y=D5({captureGroup:v,fullMatch:g,end:h,start:p,rule:u,state:d,ignoreWhitespace:o,invalidMarks:l,shouldSkip:a,updateCaptured:s});if(!y)return null;({start:p,end:h,captureGroup:v,fullMatch:g}=y);const x=_e(n)?n(f):n;let k=h,w=[];if(v){const E=g.search(/\S/),M=p+g.indexOf(v),C=M+v.length;w=m.storedMarks??[],Cp&&m.delete(p+E,M),k=p+E+v.length}return m.addMark(p,k,c.create(x)),m.setStoredMarks(w),i==null||i({tr:m,match:f,start:p,end:h}),m});return u}function I5(e){const{regexp:t,type:r,getAttributes:n,beforeDispatch:o,shouldSkip:i,ignoreWhitespace:s=!1,updateCaptured:a,invalidMarks:l}=e,c=new wa(t,(u,d,f,p)=>{const h=_e(n)?n(d):n,{tr:m,schema:b}=u,v=ne(r)?b.nodes[r]:r;let g=d[1],y=d[0];const x=D5({captureGroup:g,fullMatch:y,end:p,start:f,rule:c,state:u,ignoreWhitespace:s,invalidMarks:l,shouldSkip:i,updateCaptured:a});if(!x)return null;({start:f,end:p,captureGroup:g,fullMatch:y}=x),te(v,{code:H.SCHEMA,message:`No node exists for ${r} in the schema.`});const k=v.createAndFill(h);return k&&(m.replaceRangeWith(v.isBlock?m.doc.resolve(f).before():f,p,k),o==null||o({tr:m,match:[y,g??""],start:f,end:p})),m});return c}function D5({captureGroup:e,fullMatch:t,end:r,start:n,rule:o,ignoreWhitespace:i,shouldSkip:s,updateCaptured:a,state:l,invalidMarks:c}){var u;if(t==null)return null;const d=(a==null?void 0:a({captureGroup:e,fullMatch:t,start:n,end:r}))??{};e=d.captureGroup??e,t=d.fullMatch??t,n=d.start??n,r=d.end??r;const f=l.doc.resolve(n),p=l.doc.resolve(r);return c&&$1({$from:f,$to:p},c)||o.invalidMarks&&$1({$from:f,$to:p},o.invalidMarks)||i&&(e==null?void 0:e.trim())===""||s!=null&&s({state:l,captureGroup:e,fullMatch:t,start:n,end:r,ruleType:"mark"})||(u=o.shouldSkip)!=null&&u.call(o,{state:l,captureGroup:e,fullMatch:t,start:n,end:r,ruleType:"mark"})?null:{captureGroup:e,end:r,fullMatch:t,start:n}}var Dz=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),r={},n=[];t.forEach(i=>{(i?i.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");r[l]=a}else n.push(a)})});const o=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&o.push(r[i]);return o.push(...n),o.join(" ")},$z=Dz;const $5=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Hz(e,t){let{$cursor:r}=e.selection;return!r||(t?!t.endOfTextblock("backward",e):r.parentOffset>0)?null:r}const H5=(e,t,r)=>{let n=Hz(e,r);if(!n)return!1;let o=B5(n);if(!o){let s=n.blockRange(),a=s&&tc(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&j5(e,o,t))return!0;if(n.parent.content.size==0&&(zl(i,"end")||ce.isSelectable(i))){let s=Cv(e.doc,n.before(),n.after(),K.empty);if(s&&s.slice.size{let{$head:n,empty:o}=e.selection,i=n;if(!o)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",e):n.parentOffset>0)return!1;i=B5(n)}let s=i&&i.nodeBefore;return!s||!ce.isSelectable(s)?!1:(t&&t(e.tr.setSelection(ce.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function B5(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Fz(e,t){let{$cursor:r}=e.selection;return!r||(t?!t.endOfTextblock("forward",e):r.parentOffset{let n=Fz(e,r);if(!n)return!1;let o=F5(n);if(!o)return!1;let i=o.nodeAfter;if(j5(e,o,t))return!0;if(n.parent.content.size==0&&(zl(i,"start")||ce.isSelectable(i))){let s=Cv(e.doc,n.before(),n.after(),K.empty);if(s&&s.slice.size{let{$head:n,empty:o}=e.selection,i=n;if(!o)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",e):n.parentOffset=0;t--){let r=e.node(t);if(e.index(t)+1{let{$head:r,$anchor:n}=e.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(t&&t(e.tr.insertText(` -`).scrollIntoView()),!0)};function Kv(e){for(let t=0;t{let{$head:r,$anchor:n}=e.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let o=r.node(-1),i=r.indexAfter(-1),s=Kv(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let a=r.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection(be.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},Wz=(e,t)=>{let r=e.selection,{$from:n,$to:o}=r;if(r instanceof xr||n.parent.inlineContent||o.parent.inlineContent)return!1;let i=Kv(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let s=(!n.parentOffset&&o.index(){let{$cursor:r}=e.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let i=r.before();if(dl(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let n=r.blockRange(),o=n&&tc(n);return o==null?!1:(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)};function qz(e){return(t,r)=>{let{$from:n,$to:o}=t.selection;if(t.selection instanceof ce&&t.selection.node.isBlock)return!n.parentOffset||!dl(t.doc,n.pos)?!1:(r&&r(t.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(r){let i=o.parentOffset==o.parent.content.size,s=t.tr;(t.selection instanceof le||t.selection instanceof xr)&&s.deleteSelection();let a=n.depth==0?null:Kv(n.node(-1).contentMatchAt(n.indexAfter(-1))),l=e&&e(o.parent,i),c=l?[l]:i&&a?[{type:a}]:void 0,u=dl(s.doc,s.mapping.map(n.pos),1,c);if(!c&&!u&&dl(s.doc,s.mapping.map(n.pos),1,a?[{type:a}]:void 0)&&(a&&(c=[{type:a}]),u=!0),u&&(s.split(s.mapping.map(n.pos),1,c),!i&&!n.parentOffset&&n.parent.type!=a)){let d=s.mapping.map(n.before()),f=s.doc.resolve(d);a&&n.node(-1).canReplaceWith(f.index(),f.index()+1,a)&&s.setNodeMarkup(s.mapping.map(n.before()),a)}r(s.scrollIntoView())}return!0}}const Gz=qz(),Yz=(e,t)=>{let{$from:r,to:n}=e.selection,o,i=r.sharedDepth(n);return i==0?!1:(o=r.before(i),t&&t(e.tr.setSelection(ce.create(e.doc,o))),!0)},Jz=(e,t)=>(t&&t(e.tr.setSelection(new xr(e.doc))),!0);function Xz(e,t,r){let n=t.nodeBefore,o=t.nodeAfter,i=t.index();return!n||!o||!n.type.compatibleContent(o.type)?!1:!n.content.size&&t.parent.canReplace(i-1,i)?(r&&r(e.tr.delete(t.pos-n.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||Nd(e.doc,t.pos))?!1:(r&&r(e.tr.clearIncompatible(t.pos,n.type,n.contentMatchAt(n.childCount)).join(t.pos).scrollIntoView()),!0)}function j5(e,t,r){let n=t.nodeBefore,o=t.nodeAfter,i,s;if(n.type.spec.isolating||o.type.spec.isolating)return!1;if(Xz(e,t,r))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(i=(s=n.contentMatchAt(n.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(r){let d=t.pos+o.nodeSize,f=R.empty;for(let m=i.length-1;m>=0;m--)f=R.from(i[m].create(null,f));f=R.from(n.copy(f));let p=e.tr.step(new bt(t.pos-1,d,t.pos,d,new K(f,1,0),i.length,!0)),h=d+2*i.length;Nd(p.doc,h)&&p.join(h),r(p.scrollIntoView())}return!0}let l=be.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),u=c&&tc(c);if(u!=null&&u>=t.depth)return r&&r(e.tr.lift(c,u).scrollIntoView()),!0;if(a&&zl(o,"start",!0)&&zl(n,"end")){let d=n,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let p=o,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(d.canReplace(d.childCount,d.childCount,p.content)){if(r){let m=R.empty;for(let v=f.length-1;v>=0;v--)m=R.from(f[v].copy(m));let b=e.tr.step(new bt(t.pos-f.length,t.pos+o.nodeSize,t.pos+h,t.pos+o.nodeSize-h,new K(m,f.length,0),0,!0));r(b.scrollIntoView())}return!0}}return!1}function U5(e){return function(t,r){let n=t.selection,o=e<0?n.$from:n.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(r&&r(t.tr.setSelection(le.create(t.doc,e<0?o.start(i):o.end(i)))),!0):!1}}const Qz=U5(-1),Zz=U5(1);function eL(e,t,r){for(let n=0;n{if(s)return!1;s=a.inlineContent&&a.type.allowsMarkType(r)}),s)return!0}return!1}function tL(e,t=null){return function(r,n){let{empty:o,$cursor:i,ranges:s}=r.selection;if(o&&!i||!eL(r.doc,s,e))return!1;if(n)if(i)e.isInSet(r.storedMarks||i.marks())?n(r.tr.removeStoredMark(e)):n(r.tr.addStoredMark(e.create(t)));else{let a=!1,l=r.tr;for(let c=0;!a&&c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},nL=typeof navigator<"u"&&/Mac/.test(navigator.platform),oL=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Yt=0;Yt<10;Yt++)rs[48+Yt]=rs[96+Yt]=String(Yt);for(var Yt=1;Yt<=24;Yt++)rs[Yt+111]="F"+Yt;for(var Yt=65;Yt<=90;Yt++)rs[Yt]=String.fromCharCode(Yt+32),Np[Yt]=String.fromCharCode(Yt);for(var bg in rs)Np.hasOwnProperty(bg)||(Np[bg]=rs[bg]);function iL(e){var t=nL&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||oL&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",r=!t&&e.key||(e.shiftKey?Np:rs)[e.keyCode]||e.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}const sL=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function aL(e){let t=e.split(/-(?!$)/),r=t[t.length-1];r=="Space"&&(r=" ");let n,o,i,s;for(let a=0;a127)&&(i=rs[n.keyCode])&&i!=o){let a=t[xg(i,n)];if(a&&a(r.state,r.dispatch,r))return!0}}return!1}}function cL(e){const t=ra(e,(i,s)=>(s.priority??Ae.Low)-(i.priority??Ae.Low)),r=[],n=[];for(const i of t)gL(i)?r.push(i):n.push(i);let o;return new Ro({key:uL,view:i=>(o=i,{}),props:{transformPasted:i=>{var s,a,l;const c=o.state.selection.$from,u=c.node().type.name,d=new Set(c.marks().map(f=>f.type.name));for(const f of r){if((s=f.ignoredNodes)!=null&&s.includes(u)||(a=f.ignoredMarks)!=null&&a.some(g=>d.has(g)))continue;const p=((l=i.content.firstChild)==null?void 0:l.textContent)??"",h=!o.state.selection.empty&&i.content.childCount===1&&p,m=xa(p,f.regexp)[0];if(h&&m&&f.type==="mark"&&f.replaceSelection){const{from:g,to:y}=o.state.selection,x=o.state.doc.slice(g,y),k=x.content.textBetween(0,x.content.size);if(typeof f.replaceSelection!="boolean"?f.replaceSelection(k):f.replaceSelection){const w=[],{getAttributes:E,markType:M}=f,C=_e(E)?E(m,!0):E,T=M.create(C);return x.content.forEach(N=>{if(N.isText){const F=T.addToSet(N.marks);w.push(N.mark(F))}}),K.maxOpen(R.fromArray(w))}}const{nodes:b,transformed:v}=hL(i.content,f,o.state.schema);v&&(i=f.type==="node"&&f.nodeType.isBlock?new K(R.fromArray(b),0,0):new K(R.fromArray(b),i.openStart,i.openEnd))}return xL(i)},handleDOMEvents:{paste:(i,s)=>{var a,l;const c=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{clipboardData:u}=c;if(!u)return!1;const d=[...u.items].map(p=>p.getAsFile()).filter(p=>!!p);if(d.length===0)return!1;const{selection:f}=i.state;for(const{fileHandler:p,regexp:h}of n){const m=h?d.filter(b=>h.test(b.type)):d;if(m.length!==0&&p({event:c,files:m,selection:f,view:i,type:"paste"}))return c.preventDefault(),!0}return!1},drop:(i,s)=>{var a,l,c;const u=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{dataTransfer:d,clientX:f,clientY:p}=u;if(!d)return!1;const h=bL(u);if(h.length===0)return!1;const m=((c=i.posAtCoords({left:f,top:p}))==null?void 0:c.pos)??i.state.selection.anchor;for(const{fileHandler:b,regexp:v}of n){const g=v?h.filter(y=>v.test(y.type)):h;if(g.length!==0&&b({event:u,files:g,pos:m,view:i,type:"drop"}))return u.preventDefault(),!0}return!1}}}})}var uL=new ka("pasteRule");function kg(e,t){return function r(n){const{fragment:o,rule:i,nodes:s}=n,{regexp:a,ignoreWhitespace:l,ignoredMarks:c,ignoredNodes:u}=i;let d=!1;return o.forEach(f=>{if(u!=null&&u.includes(f.type.name)||vL(f)){s.push(f);return}if(!f.isText){const m=r({fragment:f.content,rule:i,nodes:[]});d||(d=m.transformed);const b=R.fromArray(m.nodes);f.type.validContent(b)?s.push(f.copy(b)):s.push(...m.nodes);return}if(f.marks.some(m=>yL(m)||(c==null?void 0:c.includes(m.type.name)))){s.push(f);return}const p=f.text??"";let h=0;for(const m of xa(p,a)){const b=m[1],v=m[0];if(l&&(b==null?void 0:b.trim())===""||!v)return;const g=m.index,y=g+v.length;g>h&&s.push(f.cut(h,g));let x=f.cut(g,y);if(v&&b){const k=v.search(/\S/),w=g+v.indexOf(b),E=w+b.length;k&&s.push(f.cut(g,g+k)),x=f.cut(w,E)}e({nodes:s,rule:i,textNode:x,match:m,schema:t}),d=!0,h=y}p&&h0?[...n.files]:(r=n.items)!=null&&r.length?[...n.items].map(o=>o.getAsFile()).filter(o=>!!o):[]:[]}function xL(e){const t=K.maxOpen(e.content);return t.openStart({events:{},emit(e,...t){(this.events[e]||[]).forEach(r=>r(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(r=>r!==t)}});var kL=Object.defineProperty,wL=Object.getOwnPropertyDescriptor,Z=(e,t,r,n)=>{for(var o=n>1?void 0:n?wL(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&kL(t,r,o),o},K5=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},G=(e,t,r)=>(K5(e,t,"read from private field"),r?r.call(e):t.get(e)),kt=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Lt=(e,t,r,n)=>(K5(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function SL(e,t){return e===t}function c2(e){const{previousOptions:t,update:r,equals:n=SL}=e,o=Hs({...t,...r}),i=ee(),s=zu(t);for(const l of s){const c=t[l],u=o[l];if(n(c,u)){i[l]={changed:!1};continue}i[l]={changed:!0,previousValue:c,value:u}}const a=l=>{const c=ee();for(const u of l){const d=i[u];d!=null&&d.changed&&(c[u]=d.value)}return c};return{changes:Hs(i),options:o,pickChanged:a}}var EL={[H.DUPLICATE_HELPER_NAMES]:"helper method",[H.DUPLICATE_COMMAND_NAMES]:"command method"};function q5(e){const{name:t,set:r,code:n}=e,o=EL[n];te(!r.has(t),{code:n,message:`There is a naming conflict for the name: ${t} used in this '${o}'. Please rename or remove from the editor to avoid runtime errors.`}),r.add(t)}function Vu(...e){return Ml($z(...e).split(" ")).join(" ")}var u2="__IGNORE__",CL="__ALL__",ic=class{constructor(e,...[t]){this["~O"]={},this._mappedHandlers=ee(),this.populateMappedHandlers(),this._options=this._initialOptions=q4(e,this.constructor.defaultOptions,t??ee(),this.createDefaultHandlerOptions()),this._dynamicKeys=this.getDynamicKeys(),this.init()}get options(){return this._options}get dynamicKeys(){return this._dynamicKeys}get initialOptions(){return this._initialOptions}init(){}getDynamicKeys(){const e=[],{customHandlerKeys:t,handlerKeys:r,staticKeys:n}=this.constructor;for(const o of zu(this._options))n.includes(o)||r.includes(o)||t.includes(o)||e.push(o);return e}ensureAllKeysAreDynamic(e){}setOptions(e){var t;const r=this.getDynamicOptions();this.ensureAllKeysAreDynamic(e);const{changes:n,options:o,pickChanged:i}=c2({previousOptions:r,update:e});this.updateDynamicOptions(o),(t=this.onSetOptions)==null||t.call(this,{reason:"set",changes:n,options:o,pickChanged:i,initialOptions:this._initialOptions})}resetOptions(){var e;const t=this.getDynamicOptions(),{changes:r,options:n,pickChanged:o}=c2({previousOptions:t,update:this._initialOptions});this.updateDynamicOptions(n),(e=this.onSetOptions)==null||e.call(this,{reason:"reset",options:n,changes:r,pickChanged:o,initialOptions:this._initialOptions})}getDynamicOptions(){return bv(this._options,[...this.constructor.customHandlerKeys,...this.constructor.handlerKeys])}updateDynamicOptions(e){this._options={...this._options,...e}}populateMappedHandlers(){for(const e of this.constructor.handlerKeys)this._mappedHandlers[e]=[]}createDefaultHandlerOptions(){const e=ee();for(const t of this.constructor.handlerKeys)e[t]=(...r)=>{var n;const{handlerKeyOptions:o}=this.constructor,i=(n=o[t])==null?void 0:n.reducer;let s=i==null?void 0:i.getDefault(...r);for(const[,a]of this._mappedHandlers[t]){const l=a(...r);if(s=i?i.accumulator(s,l,...r):l,ML(o,s,t))return s}return s};return e}addHandler(e,t,r=Ae.Default){return this._mappedHandlers[e].push([r,t]),this.sortHandlers(e),()=>this._mappedHandlers[e]=this._mappedHandlers[e].filter(([,n])=>n!==t)}hasHandlers(e){return(this._mappedHandlers[e]??[]).length>0}sortHandlers(e){this._mappedHandlers[e]=ra(this._mappedHandlers[e],([t],[r])=>r-t)}addCustomHandler(e,t){var r;return((r=this.onAddCustomHandler)==null?void 0:r.call(this,{[e]:t}))??K4}};ic.defaultOptions={};ic.staticKeys=[];ic.handlerKeys=[];ic.handlerKeyOptions={};ic.customHandlerKeys=[];function ML(e,t,r){const{[CL]:n}=e,o=e[r];return!n&&!o?!1:!!(o&&o.earlyReturnValue!==u2&&(_e(o.earlyReturnValue)?o.earlyReturnValue(t)===!0:t===o.earlyReturnValue)||n&&n.earlyReturnValue!==u2&&(_e(n.earlyReturnValue)?n.earlyReturnValue(t)===!0:t===n.earlyReturnValue))}var Fh=class extends ic{constructor(...e){super(TL,...e),this["~E"]={},this._extensions=Y4(this.createExtensions(),t=>t.constructor),this.extensionMap=new Map;for(const t of this._extensions)this.extensionMap.set(t.constructor,t)}get priority(){return this.priorityOverride??this.options.priority??this.constructor.defaultPriority}get constructorName(){return`${$4(this.name)}Extension`}get store(){return te(this._store,{code:H.MANAGER_PHASE_ERROR,message:"An error occurred while attempting to access the 'extension.store' when the Manager has not yet set created the lifecycle methods."}),Hs(this._store,{requireKeys:!0})}get extensions(){return this._extensions}replaceChildExtension(e,t){this.extensionMap.has(e)&&(this.extensionMap.set(e,t),this._extensions=this.extensions.map(r=>t.constructor===e?t:r))}createExtensions(){return[]}getExtension(e){const t=this.extensionMap.get(e);return te(t,{code:H.INVALID_GET_EXTENSION,message:`'${e.name}' does not exist within the preset: '${this.name}'`}),t}isOfType(e){return this.constructor===e}setStore(e){this._store||(this._store=e)}clone(...e){return new this.constructor(...e)}setPriority(e){this.priorityOverride=e}};Fh.defaultPriority=Ae.Default;var Ve=class extends Fh{static get[ti](){return $t.PlainExtensionConstructor}get[ti](){return $t.PlainExtension}},li=class extends Fh{static get[ti](){return $t.MarkExtensionConstructor}get[ti](){return $t.MarkExtension}get type(){return it(this.store.schema.marks,this.name)}constructor(...e){super(...e)}};li.disableExtraAttributes=!1;var er=class extends Fh{static get[ti](){return $t.NodeExtensionConstructor}get[ti](){return $t.NodeExtension}get type(){return it(this.store.schema.nodes,this.name)}constructor(...e){super(...e)}};er.disableExtraAttributes=!1;var TL={priority:void 0,extraAttributes:{},disableExtraAttributes:!1,exclude:{}};function G5(e){return nc(e)&&oc(e,[$t.PlainExtension,$t.MarkExtension,$t.NodeExtension])}function OL(e){return nc(e)&&oc(e,[$t.PlainExtensionConstructor,$t.MarkExtensionConstructor,$t.NodeExtensionConstructor])}function Y5(e){return nc(e)&&oc(e,$t.PlainExtension)}function $d(e){return nc(e)&&oc(e,$t.NodeExtension)}function Vh(e){return nc(e)&&oc(e,$t.MarkExtension)}function me(e){return t=>{const{defaultOptions:r,customHandlerKeys:n,handlerKeys:o,staticKeys:i,defaultPriority:s,handlerKeyOptions:a,...l}=e,c=t;r&&(c.defaultOptions=r),s&&(c.defaultPriority=s),a&&(c.handlerKeyOptions=a),c.staticKeys=i??[],c.handlerKeys=o??[],c.customHandlerKeys=n??[];for(const[u,d]of Object.entries(l))c[u]||(c[u]=d);return c}}var _L=class extends Ve{constructor(){super(...arguments),this.attributeList=[],this.attributeObject=ee(),this.updateAttributes=(e=!0)=>{this.transformAttributes(),e&&this.store.commands.forceUpdate("attributes")}}get name(){return"attributes"}onCreate(){this.transformAttributes(),this.store.setExtensionStore("updateAttributes",this.updateAttributes)}transformAttributes(){var e,t,r;if(this.attributeObject=ee(),(e=this.store.managerSettings.exclude)!=null&&e.attributes){this.store.setStoreKey("attributes",this.attributeObject);return}this.attributeList=[];for(const n of this.store.extensions){if((t=n.options.exclude)!=null&&t.attributes)continue;const o=(r=n.createAttributes)==null?void 0:r.call(n),i={...o,class:Vu(...n.classNames??[],o==null?void 0:o.class)};this.attributeList.unshift(i)}for(const n of this.attributeList)this.attributeObject={...this.attributeObject,...n,class:Vu(this.attributeObject.class,n.class)};this.store.setStoreKey("attributes",this.attributeObject)}};function He(e={}){return(t,r,n)=>{(t.decoratedHelpers??(t.decoratedHelpers={}))[r]=e}}function U(e={}){return(t,r,n)=>{(t.decoratedCommands??(t.decoratedCommands={}))[r]=e}}function je(e){return(t,r,n)=>{(t.decoratedKeybindings??(t.decoratedKeybindings={}))[r]=e}}var AL=class{constructor(e){this.promiseCreator=e,this.failureHandlers=[],this.successHandlers=[],this.validateHandlers=[],this.generateCommand=()=>t=>{let r=!0;const{view:n,tr:o,dispatch:i}=t;if(!n)return!1;for(const a of this.validateHandlers)if(!a({...t,dispatch:()=>{}})){r=!1;break}return!i||!r?r:(this.promiseCreator(t).then(a=>{this.runHandlers(this.successHandlers,{value:a,state:n.state,tr:n.state.tr,dispatch:n.dispatch,view:n})}).catch(a=>{this.runHandlers(this.failureHandlers,{error:a,state:n.state,tr:n.state.tr,dispatch:n.dispatch,view:n})}),i(o),!0)}}validate(e,t="push"){return this.validateHandlers[t](e),this}success(e,t="push"){return this.successHandlers[t](e),this}failure(e,t="push"){return this.failureHandlers[t](e),this}runHandlers(e,t){var r;for(const n of e)if(!n({...t,dispatch:()=>{}}))break;(r=t.dispatch)==null||r.call(t,t.tr)}};function ns(e){const{type:t,attrs:r,range:n,selection:o}=e;return i=>{const{dispatch:s,tr:a,state:l}=i,c=ne(t)?l.schema.marks[t]:t;if(te(c,{code:H.SCHEMA,message:`Mark type: ${t} does not exist on the current schema.`}),n||o){const{from:u,to:d}=jr(o??n??a.selection,a.doc);return Ap({trState:a,type:t,...n})?s==null||s(a.removeMark(u,d,c)):s==null||s(a.addMark(u,d,c.create(r))),!0}return yu(tL(c,r))(i)}}function NL(e,t,r){for(const{$from:n,$to:o}of r){let i=n.depth===0?t.type.allowsMarkType(e):!1;if(t.nodesBetween(n.pos,o.pos,s=>{if(i)return!1;i=s.inlineContent&&s.type.allowsMarkType(e)}),i)return!0}return!1}function RL(e,t,r){return({tr:n,dispatch:o,state:i})=>{const s=jr(r??n.selection,n.doc),a=gz(s),l=ne(e)?i.schema.marks[e]:e;if(te(l,{code:H.SCHEMA,message:`Mark type: ${e} does not exist on the current schema.`}),s.empty&&!a||!NL(l,n.doc,s.ranges))return!1;if(!o)return!0;if(a)return n.removeStoredMark(l),t&&n.addStoredMark(l.create(t)),o(n),!0;let c=!1;for(const{$from:u,$to:d}of s.ranges){if(c)break;c=n.doc.rangeHasMark(u.pos,d.pos,l)}for(const{$from:u,$to:d}of s.ranges)c&&n.removeMark(u.pos,d.pos,l),t&&n.addMark(u.pos,d.pos,l.create(t));return o(n),!0}}function PL(e,t={}){return({tr:r,dispatch:n,state:o})=>{const i=o.schema,s=r.selection,{from:a=s.from,to:l=a??s.to,marks:c={}}=t;if(!n)return!0;r.insertText(e,a,l);const u=it(r.steps,r.steps.length-1).getMap().map(l);for(const[d,f]of At(c))r.addMark(a,u,it(i.marks,d).create(f));return n(r),!0}}var xe=class extends Ve{constructor(){super(...arguments),this.decorated=new Map,this.forceUpdateTransaction=(e,...t)=>{const{forcedUpdates:r}=this.getCommandMeta(e);return this.setCommandMeta(e,{forcedUpdates:Ml([...r,...t])}),e}}get name(){return"commands"}get transaction(){const e=this.store.getState();this._transaction||(this._transaction=e.tr);const t=this._transaction.before.eq(e.doc),r=!Mo(this._transaction.steps);if(!t){const n=e.tr;if(r)for(const o of this._transaction.steps)n.step(o);this._transaction=n}return this._transaction}onCreate(){this.store.setStoreKey("getForcedUpdates",this.getForcedUpdates.bind(this))}onView(e){var t;const{extensions:r,helpers:n}=this.store,o=ee(),i=new Set;let s=ee();const a=c=>{var u;const d=ee(),f=()=>c??this.transaction;let p=[];const h=()=>p;for(const[b,v]of Object.entries(o))(u=s[b])!=null&&u.disableChaining||(d[b]=this.chainedFactory({chain:d,command:v.original,getTr:f,getChain:h}));const m=b=>{te(b===f(),{message:"Chaining currently only supports `CommandFunction` methods which do not use the `state.tr` property. Instead you should use the provided `tr` property."})};return d.run=(b={})=>{const v=p;p=[];for(const g of v)if(!g(m)&&b.exitEarly)return;e.dispatch(f())},d.tr=()=>{const b=p;p=[];for(const v of b)v(m);return f()},d.enabled=()=>{for(const b of p)if(!b())return!1;return!0},d.new=b=>a(b),d};for(const c of r){const u=((t=c.createCommands)==null?void 0:t.call(c))??{},d=c.decoratedCommands??{},f={};s={...s,decoratedCommands:d};for(const[p,h]of Object.entries(d)){const m=ne(h.shortcut)&&h.shortcut.startsWith("_|")?{shortcut:n.getNamedShortcut(h.shortcut,c.options)}:void 0;this.updateDecorated(p,{...h,name:c.name,...m}),u[p]=c[p].bind(c),h.active&&(f[p]=()=>{var b;return((b=h.active)==null?void 0:b.call(h,c.options,this.store))??!1})}hp(u)||this.addCommands({active:f,names:i,commands:o,extensionCommands:u})}const l=a();for(const[c,u]of Object.entries(l))a[c]=u;this.store.setStoreKey("commands",o),this.store.setStoreKey("chain",a),this.store.setExtensionStore("commands",o),this.store.setExtensionStore("chain",a)}onStateUpdate({state:e}){this._transaction=e.tr}createPlugin(){return{}}customDispatch(e){return e}insertText(e,t={}){return ne(e)?PL(e,t):this.store.createPlaceholderCommand({promise:e,placeholder:{type:"inline"},onSuccess:(r,n,o)=>this.insertText(r,{...t,...n})(o)}).generateCommand()}selectText(e,t={}){return({tr:r,dispatch:n})=>{const o=jr(e,r.doc);return r.selection.anchor===o.anchor&&r.selection.head===o.head&&!t.forceUpdate?!1:(n==null||n(r.setSelection(o)),!0)}}selectMark(e){return t=>{const{tr:r}=t,n=_o(r.selection.$from,e);return n?this.store.commands.selectText.original({from:n.from,to:n.to})(t):!1}}delete(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=e??t.selection;return r==null||r(t.delete(n,o)),!0}}emptyUpdate(e){return({tr:t,dispatch:r})=>(r&&(e==null||e(),r(t)),!0)}forceUpdate(...e){return({tr:t,dispatch:r})=>(r==null||r(this.forceUpdateTransaction(t,...e)),!0)}updateNodeAttributes(e,t){return({tr:r,dispatch:n})=>(n==null||n(r.setNodeMarkup(e,void 0,t)),!0)}setContent(e,t){return r=>{const{tr:n,dispatch:o}=r,i=this.store.manager.createState({content:e,selection:t});return i?(o==null||o(n.replaceRangeWith(0,n.doc.nodeSize-2,i.doc)),!0):!1}}resetContent(){return e=>{const{tr:t,dispatch:r}=e,n=this.store.manager.createEmptyDoc();return n?this.setContent(n)(e):(r==null||r(t.delete(0,t.doc.nodeSize)),!0)}}emptySelection(){return({tr:e,dispatch:t})=>e.selection.empty?!1:(t==null||t(e.setSelection(le.near(e.selection.$anchor))),!0)}insertNewLine(){return({dispatch:e,tr:t})=>gs(t.selection)?(e==null||e(t.insertText(` -`)),!0):!1}insertNode(e,t={}){return({dispatch:r,tr:n,state:o})=>{var i;const{attrs:s,range:a,selection:l,replaceEmptyParentBlock:c=!1}=t,{from:u,to:d,$from:f}=jr(l??a??n.selection,n.doc);if(Ld(e)||iz(e)){const v=f.before(f.depth);return r==null||r(c&&u===d&&Dh(f.parent)?n.replaceWith(v,v+f.parent.nodeSize,e):n.replaceWith(u,d,e)),!0}const p=ne(e)?o.schema.nodes[e]:e;te(p,{code:H.SCHEMA,message:`The requested node type ${e} does not exist in the schema.`});const h=(i=t.marks)==null?void 0:i.map(v=>{if(v instanceof Te)return v;const g=ne(v)?o.schema.marks[v]:v;return te(g,{code:H.SCHEMA,message:`The requested mark type ${v} does not exist in the schema.`}),g.create()}),m=p.createAndFill(s,ne(t.content)?o.schema.text(t.content):t.content,h);if(!m)return!1;const b=u!==d;return r==null||r(b?n.replaceRangeWith(u,d,m):n.insert(u,m)),!0}}focus(e){return t=>{const{dispatch:r,tr:n}=t,{view:o}=this.store;if(e===!1||o.hasFocus()&&(e===void 0||e===!0))return!1;if(e===void 0||e===!0){const{from:i=0,to:s=i}=n.selection;e={from:i,to:s}}return r&&this.delayedFocus(),this.selectText(e)(t)}}blur(e){return t=>{const{view:r}=this.store;return r.hasFocus()?(requestAnimationFrame(()=>{r.dom.blur()}),e?this.selectText(e)(t):!0):!1}}setBlockNodeType(e,t,r,n=!0){return Bu(e,t,r,n)}toggleWrappingNode(e,t,r){return P5(e,t,r)}toggleBlockNodeItem(e){return Wv(e)}wrapInNode(e,t,r){return R5(e,t,r)}applyMark(e,t,r){return RL(e,t,r)}toggleMark(e){return ns(e)}removeMark(e){return L5(e)}setMeta(e,t){return({tr:r})=>(r.setMeta(e,t),!0)}selectAll(){return this.selectText("all")}copy(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("copy"),!0)}paste(){return this.store.createPlaceholderCommand({promise:async()=>{var e;return(e=navigator.clipboard)!=null&&e.readText?await navigator.clipboard.readText():""},placeholder:{type:"inline"},onSuccess:(e,t,r)=>this.insertNode(B1({content:e,schema:r.state.schema}),{selection:t})(r)}).generateCommand()}cut(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("cut"),!0)}replaceText(e){return Az(e)}getAllCommandOptions(){const e={};for(const[t,r]of this.decorated)hp(r)||(e[t]=r);return e}getCommandOptions(e){return this.decorated.get(e)}getCommandProp(){return{tr:this.transaction,dispatch:this.store.view.dispatch,state:this.store.view.state,view:this.store.view}}updateDecorated(e,t){if(!t){this.decorated.delete(e);return}const r=this.decorated.get(e)??{name:""};this.decorated.set(e,{...r,...t})}handleIosFocus(){nn.isIos&&this.store.view.dom.focus()}delayedFocus(){this.handleIosFocus(),requestAnimationFrame(()=>{this.store.view.focus(),this.store.view.dispatch(this.transaction.scrollIntoView())})}getForcedUpdates(e){return this.getCommandMeta(e).forcedUpdates}getCommandMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...zL,...t}}setCommandMeta(e,t){const r=this.getCommandMeta(e);e.setMeta(this.pluginKey,{...r,...t})}addCommands(e){const{extensionCommands:t,commands:r,names:n,active:o}=e;for(const[i,s]of At(t))q5({name:i,set:n,code:H.DUPLICATE_COMMAND_NAMES}),te(!LL.has(i),{code:H.DUPLICATE_COMMAND_NAMES,message:"The command name you chose is forbidden."}),r[i]=this.createUnchainedCommand(s,o[i])}unchainedFactory(e){return(...t)=>{const{shouldDispatch:r=!0,command:n}=e,{view:o}=this.store,{state:i}=o;let s;return r&&(s=o.dispatch),n(...t)({state:i,dispatch:s,view:o,tr:i.tr})}}createUnchainedCommand(e,t){const r=this.unchainedFactory({command:e});return r.enabled=this.unchainedFactory({command:e,shouldDispatch:!1}),r.isEnabled=r.enabled,r.original=e,r.active=t,r}chainedFactory(e){return(...t)=>{const{chain:r,command:n,getTr:o,getChain:i}=e,s=i(),{view:a}=this.store,{state:l}=a;return s.push(c=>n(...t)({state:l,dispatch:c,view:a,tr:o()})),r}}};Z([U()],xe.prototype,"customDispatch",1);Z([U()],xe.prototype,"insertText",1);Z([U()],xe.prototype,"selectText",1);Z([U()],xe.prototype,"selectMark",1);Z([U()],xe.prototype,"delete",1);Z([U()],xe.prototype,"emptyUpdate",1);Z([U()],xe.prototype,"forceUpdate",1);Z([U()],xe.prototype,"updateNodeAttributes",1);Z([U()],xe.prototype,"setContent",1);Z([U()],xe.prototype,"resetContent",1);Z([U()],xe.prototype,"emptySelection",1);Z([U()],xe.prototype,"insertNewLine",1);Z([U()],xe.prototype,"insertNode",1);Z([U()],xe.prototype,"focus",1);Z([U()],xe.prototype,"blur",1);Z([U()],xe.prototype,"setBlockNodeType",1);Z([U()],xe.prototype,"toggleWrappingNode",1);Z([U()],xe.prototype,"toggleBlockNodeItem",1);Z([U()],xe.prototype,"wrapInNode",1);Z([U()],xe.prototype,"applyMark",1);Z([U()],xe.prototype,"toggleMark",1);Z([U()],xe.prototype,"removeMark",1);Z([U()],xe.prototype,"setMeta",1);Z([U({description:({t:e})=>e(es.SELECT_ALL_DESCRIPTION),label:({t:e})=>e(es.SELECT_ALL_LABEL),shortcut:D.SelectAll})],xe.prototype,"selectAll",1);Z([U({description:({t:e})=>e(es.COPY_DESCRIPTION),label:({t:e})=>e(es.COPY_LABEL),shortcut:D.Copy,icon:"fileCopyLine"})],xe.prototype,"copy",1);Z([U({description:({t:e})=>e(es.PASTE_DESCRIPTION),label:({t:e})=>e(es.PASTE_LABEL),shortcut:D.Paste,icon:"clipboardLine"})],xe.prototype,"paste",1);Z([U({description:({t:e})=>e(es.CUT_DESCRIPTION),label:({t:e})=>e(es.CUT_LABEL),shortcut:D.Cut,icon:"scissorsFill"})],xe.prototype,"cut",1);Z([U()],xe.prototype,"replaceText",1);Z([He()],xe.prototype,"getAllCommandOptions",1);Z([He()],xe.prototype,"getCommandOptions",1);Z([He()],xe.prototype,"getCommandProp",1);xe=Z([me({defaultPriority:Ae.Highest,defaultOptions:{trackerClassName:"remirror-tracker-position",trackerNodeName:"span"},staticKeys:["trackerClassName","trackerNodeName"]})],xe);var zL={forcedUpdates:[]},LL=new Set(["run","chain","original","raw","enabled","tr","new"]),io=class extends Ve{constructor(){super(...arguments),this.placeholders=Ee.empty,this.placeholderWidgets=new Map,this.createPlaceholderCommand=e=>{const t=Cl(),{promise:r,placeholder:n,onFailure:o,onSuccess:i}=e;return new AL(r).validate(s=>this.addPlaceholder(t,n)(s)).success(s=>{const{state:a,tr:l,dispatch:c,view:u,value:d}=s,f=this.store.helpers.findPlaceholder(t);if(!f){const p=new Error("The placeholder has been removed");return(o==null?void 0:o({error:p,state:a,tr:l,dispatch:c,view:u}))??!1}return this.removePlaceholder(t)({state:a,tr:l,view:u,dispatch:()=>{}}),i(d,f,{state:a,tr:l,dispatch:c,view:u})}).failure(s=>(this.removePlaceholder(t)({...s,dispatch:()=>{}}),(o==null?void 0:o(s))??!1))}}get name(){return"decorations"}onCreate(){this.store.setExtensionStore("createPlaceholderCommand",this.createPlaceholderCommand)}createPlugin(){return{state:{init:()=>{},apply:e=>{var t,r,n,o,i,s;const{added:a,clearTrackers:l,removed:c,updated:u}=this.getMeta(e);if(l){this.placeholders=Ee.empty;for(const[,d]of this.placeholderWidgets)(r=(t=d.spec).onDestroy)==null||r.call(t,this.store.view,d.spec.element);this.placeholderWidgets.clear();return}this.placeholders=this.placeholders.map(e.mapping,e.doc,{onRemove:d=>{var f,p;const h=this.placeholderWidgets.get(d.id);h&&((p=(f=h.spec).onDestroy)==null||p.call(f,this.store.view,h.spec.element))}});for(const[,d]of this.placeholderWidgets)(o=(n=d.spec).onUpdate)==null||o.call(n,this.store.view,d.from,d.spec.element,d.spec.data);for(const d of a){if(d.type==="inline"){this.addInlinePlaceholder(d,e);continue}if(d.type==="node"){this.addNodePlaceholder(d,e);continue}if(d.type==="widget"){this.addWidgetPlaceholder(d,e);continue}}for(const{id:d,data:f}of u){const p=this.placeholderWidgets.get(d);if(!p)continue;const h=Ge.widget(p.from,p.spec.element,{...p.spec,data:f});this.placeholders=this.placeholders.remove([p]).add(e.doc,[h]),this.placeholderWidgets.set(d,h)}for(const d of c){const f=this.placeholders.find(void 0,void 0,h=>h.id===d&&h.__type===Na),p=this.placeholderWidgets.get(d);p&&((s=(i=p.spec).onDestroy)==null||s.call(i,this.store.view,p.spec.element)),this.placeholders=this.placeholders.remove(f),this.placeholderWidgets.delete(d)}}},props:{decorations:e=>{let t=this.options.decorations(e);t=t.add(e.doc,this.placeholders.find());for(const r of this.store.extensions){if(!r.createDecorations)continue;const n=r.createDecorations(e).find();t=t.add(e.doc,n)}return t},handleDOMEvents:{blur:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(d2,!1)),!1),focus:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(d2,!0)),!1)}}}}updateDecorations(){return({tr:e,dispatch:t})=>(t==null||t(e),!0)}addPlaceholder(e,t,r){return({dispatch:n,tr:o})=>this.addPlaceholderTransaction(e,t,o,!n)?(n==null||n(r?o.deleteSelection():o),!0):!1}updatePlaceholder(e,t){return({dispatch:r,tr:n})=>this.updatePlaceholderTransaction({id:e,data:t,tr:n,checkOnly:!r})?(r==null||r(n),!0):!1}removePlaceholder(e){return({dispatch:t,tr:r})=>this.removePlaceholderTransaction({id:e,tr:r,checkOnly:!t})?(t==null||t(r),!0):!1}clearPlaceholders(){return({tr:e,dispatch:t})=>this.clearPlaceholdersTransaction({tr:e,checkOnly:!t})?(t==null||t(e),!0):!1}findPlaceholder(e){return this.findAllPlaceholders().get(e)}findAllPlaceholders(){const e=new Map,t=this.placeholders.find(void 0,void 0,r=>r.__type===Na);for(const r of t)e.set(r.spec.id,{from:r.from,to:r.to});return e}createDecorations(e){var t,r,n;const{persistentSelectionClass:o}=this.options;return!o||(t=this.store.view)!=null&&t.hasFocus()||(n=(r=this.store.helpers).isInteracting)!=null&&n.call(r)?Ee.empty:DL(e,Ee.empty,{class:ne(o)?o:"selection"})}onApplyState(){}addWidgetPlaceholder(e,t){const{pos:r,createElement:n,onDestroy:o,onUpdate:i,className:s,nodeName:a,id:l,type:c}=e,u=(n==null?void 0:n(this.store.view,r))??document.createElement(a);u.classList.add(s);const d=Ge.widget(r,u,{id:l,__type:Na,type:c,element:u,onDestroy:o,onUpdate:i});this.placeholderWidgets.set(l,d),this.placeholders=this.placeholders.add(t.doc,[d])}addInlinePlaceholder(e,t){const{from:r=t.selection.from,to:n=t.selection.to,className:o,nodeName:i,id:s,type:a}=e;let l;if(r===n){const c=document.createElement(i);c.classList.add(o),l=Ge.widget(r,c,{id:s,type:a,__type:Na,widget:c})}else l=Ge.inline(r,n,{nodeName:i,class:o},{id:s,__type:Na});this.placeholders=this.placeholders.add(t.doc,[l])}addNodePlaceholder(e,t){const{pos:r,className:n,nodeName:o,id:i}=e,s=Jt(r)?t.doc.resolve(r):t.selection.$from,a=Jt(r)?s.nodeAfter?{pos:r,end:s.nodeAfter.nodeSize}:void 0:Y6(s);if(!a)return;const l=Ge.node(a.pos,a.end,{nodeName:o,class:n},{id:i,__type:Na});this.placeholders=this.placeholders.add(t.doc,[l])}withRequiredBase(e,t){const{placeholderNodeName:r,placeholderClassName:n}=this.options,{nodeName:o=r,className:i,...s}=t,a=(i?[n,i]:[n]).join(" ");return{nodeName:o,className:a,...s,id:e}}getMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...IL,...t}}setMeta(e,t){const r=this.getMeta(e);e.setMeta(this.pluginKey,{...r,...t})}addPlaceholderTransaction(e,t,r,n=!1){if(this.findPlaceholder(e))return!1;if(n)return!0;const{added:i}=this.getMeta(r);return this.setMeta(r,{added:[...i,this.withRequiredBase(e,t)]}),!0}updatePlaceholderTransaction(e){const{id:t,tr:r,checkOnly:n=!1,data:o}=e;if(!this.findPlaceholder(t))return!1;if(n)return!0;const{updated:s}=this.getMeta(r);return this.setMeta(r,{updated:Ml([...s,{id:t,data:o}])}),!0}removePlaceholderTransaction(e){const{id:t,tr:r,checkOnly:n=!1}=e;if(!this.findPlaceholder(t))return!1;if(n)return!0;const{removed:i}=this.getMeta(r);return this.setMeta(r,{removed:Ml([...i,t])}),!0}clearPlaceholdersTransaction(e){const{tr:t,checkOnly:r=!1}=e;return this.getPluginState()===Ee.empty?!1:(r||this.setMeta(t,{clearTrackers:!0}),!0)}};Z([U()],io.prototype,"updateDecorations",1);Z([U()],io.prototype,"addPlaceholder",1);Z([U()],io.prototype,"updatePlaceholder",1);Z([U()],io.prototype,"removePlaceholder",1);Z([U()],io.prototype,"clearPlaceholders",1);Z([He()],io.prototype,"findPlaceholder",1);Z([He()],io.prototype,"findAllPlaceholders",1);io=Z([me({defaultOptions:{persistentSelectionClass:void 0,placeholderClassName:"placeholder",placeholderNodeName:"span"},staticKeys:["placeholderClassName","placeholderNodeName"],handlerKeys:["decorations"],handlerKeyOptions:{decorations:{reducer:{accumulator:(e,t,r)=>e.add(r.doc,t.find()),getDefault:()=>Ee.empty}}},defaultPriority:Ae.Low})],io);var IL={added:[],updated:[],clearTrackers:!1,removed:[]},Na="placeholderDecoration",d2="persistentSelectionFocus";function DL(e,t,r){const{selection:n,doc:o}=e;if(n.empty)return t;const{from:i,to:s}=n,a=Id(n)?Ge.node(i,s,r):Ge.inline(i,s,r);return t.add(o,[a])}var V1=class extends Ve{get name(){return"docChanged"}onStateUpdate(e){const{firstUpdate:t,transactions:r,tr:n}=e;t||(r??[n]).some(o=>o==null?void 0:o.docChanged)&&this.options.docChanged(e)}};V1=Z([me({handlerKeys:["docChanged"],handlerKeyOptions:{docChanged:{earlyReturnValue:!1}},defaultPriority:Ae.Lowest})],V1);var An=class extends Ve{get name(){return"helpers"}onCreate(){var e;this.store.setStringHandler("text",this.textToProsemirrorNode.bind(this)),this.store.setStringHandler("html",B1);const t=ee(),r=ee(),n=ee(),o=new Set;for(const i of this.store.extensions){$d(i)&&(r[i.name]=a=>b5({state:this.store.getState(),type:i.type,attrs:a}),n[i.name]=a=>{var l;return(l=Hu({state:this.store.getState(),type:i.type,attrs:a}))==null?void 0:l.node.attrs}),Vh(i)&&(r[i.name]=a=>Ap({trState:this.store.getState(),type:i.type,attrs:a}),n[i.name]=a=>{const l=_o(this.store.getState().selection.$from,i.type);if(!l||!a)return l==null?void 0:l.mark.attrs;if(Fv(l.mark,a))return l.mark.attrs});const s=((e=i.createHelpers)==null?void 0:e.call(i))??{};for(const a of Object.keys(i.decoratedHelpers??{}))s[a]=i[a].bind(i);if(!hp(s))for(const[a,l]of At(s))q5({name:a,set:o,code:H.DUPLICATE_HELPER_NAMES}),t[a]=l}this.store.setStoreKey("attrs",n),this.store.setStoreKey("active",r),this.store.setStoreKey("helpers",t),this.store.setExtensionStore("attrs",n),this.store.setExtensionStore("active",r),this.store.setExtensionStore("helpers",t)}isSelectionEmpty(e=this.store.getState()){return Bv(e)}isViewEditable(e=this.store.getState()){var t,r;return((r=(t=this.store.view.props).editable)==null?void 0:r.call(t,e))??!1}getStateJSON(e=this.store.getState()){return e.toJSON()}getJSON(e=this.store.getState()){return e.doc.toJSON()}getRemirrorJSON(e=this.store.getState()){return this.getJSON(e)}insertHtml(e,t){return r=>{const{state:n}=r,o=B1({content:e,schema:n.schema,fragment:!0});return this.store.commands.insertNode.original(o,t)(r)}}getText({lineBreakDivider:e=` +If you are using Node.js, you can install JSDOM and Remirror will try to use it automatically, or you can create a fake document and pass it to Remirror`)}function NC(e){var t;return(e==null?void 0:e.defaultView)??(typeof window<"u"?window:void 0)??((t=NE())==null?void 0:t.defaultView)}function RC(e){return NC(e==null?void 0:e.ownerDocument)}function PC(e){const t=NC(e)??Fh().defaultView;if(t)return t;throw new Error("Unable to retrieve the window from the global scope")}function zC(e){return PC(e==null?void 0:e.ownerDocument)}function Tz(e,t=Fh()){const r=Ez(e,e.type.schema)?e.content:R.from(e);return an.fromSchema(e.type.schema).serializeFragment(r,{document:t})}function Oz(e,t){return new(PC(t)).DOMParser().parseFromString(`${e}`,"text/html").body}function _z(e,t=Fh()){const r=t.createElement("div");return r.append(Tz(e,t)),r.innerHTML}function j1(e){const{content:t,schema:r,document:n,fragment:o=!1,...i}=e,s=Oz(t,n),a=Cv.fromSchema(r);return o?a.parseSlice(s,{...c2,...i}).content:a.parse(s,{...c2,...i})}var c2={preserveWhitespace:!1};function $d(e,t){const r=Lu(t.defaults());return wv({...e},r)}function qv(e,t){let r="";t&&(r=`${t.trim()}`);const n=xN(e);if(!n)return r;const o=(r.endsWith(";")," ");return`${r}${o}${n}`}var Az={remove(e,t){let r=e;for(const n of t)n.invalidParentNode||(r=hA(n.path,r));return r}};function Nz({json:e,schema:t,...r}){const n=new Set(Lu(t.marks)),o=new Set(Lu(t.nodes)),i=LC({json:e,path:[],validNodes:o,validMarks:n});return{json:e,invalidContent:i,transformers:Az,...r}}function LC(e){const{json:t,validMarks:r,validNodes:n,path:o=[]}=e,i={validMarks:r,validNodes:n},s=[],{type:a,marks:l,content:c}=t;let{invalidParentMark:u=!1,invalidParentNode:d=!1}=e;if(l){const f=[];for(const[p,h]of l.entries()){const m=ne(h)?h:h.type;r.has(m)||(f.unshift({name:m,path:[...o,"marks",`${p}`],type:"mark",invalidParentMark:u,invalidParentNode:d}),u=!0)}s.push(...f)}if(n.has(a)||(s.push({name:a,type:"node",path:o,invalidParentMark:u,invalidParentNode:d}),d=!0),c){const f=[];for(const[p,h]of c.entries())f.unshift(...LC({...i,json:h,path:[...o,"content",`${p}`],invalidParentMark:u,invalidParentNode:d}));s.unshift(...f)}return s}function Rz(e){return!!(gs(e)&&e.$cursor&&e.$cursor.parentOffset>=e.$cursor.parent.content.size)}function U1(e){return!!(gs(e)&&e.$cursor&&e.$cursor.parentOffset<=0)}function u2(e){const t=be.atStart(e.$anchor.doc);return!!(U1(e)&&t.anchor===e.anchor)}function Pz(e){return({dispatch:t,tr:r})=>{const{type:n,attrs:o=ee(),appendText:i,range:s}=e,a=s?le.between(r.doc.resolve(s.from),r.doc.resolve(s.to)):r.selection,{$from:l,from:c,to:u}=a;let d=l.depth===0?r.doc.type.allowsMarkType(n):!1;return r.doc.nodesBetween(c,u,f=>{if(d)return!1;if(f.inlineContent&&f.type.allowsMarkType(n)){d=!0;return}}),d?(t==null||t(r.addMark(c,u,n.create(o))&&i?r.insertText(i):r),!0):!1}}function zz({tr:e,dispatch:t}){const{$from:r,$to:n}=e.selection,o=r.blockRange(n),i=o&&rc(o);return!Jt(i)||!o?!1:(t==null||t(e.lift(o,i).scrollIntoView()),!0)}function IC(e,t={},r){return function(n){const{tr:o,dispatch:i,state:s}=n,a=ne(e)?it(s.schema.nodes,e):e,{from:l,to:c}=jr(r??o.selection,o.doc),u=o.doc.resolve(l),d=o.doc.resolve(c),f=u.blockRange(d),p=f&&Tv(f,a,t);return!p||!f?!1:(i==null||i(o.wrap(f,p).scrollIntoView()),!0)}}function DC(e,t={},r){return n=>{const{tr:o,state:i}=n,s=ne(e)?it(i.schema.nodes,e):e;return Bu({state:o,type:s,attrs:t})?zz(n):IC(e,t,r)(n)}}function Fu(e,t,r,n=!0){return function(o){const{tr:i,dispatch:s,state:a}=o,l=ne(e)?it(a.schema.nodes,e):e,{from:c,to:u}=jr(r??i.selection,i.doc);let d=!1,f;return i.doc.nodesBetween(c,u,(p,h)=>{if(d)return!1;if(!p.isTextblock||p.hasMarkup(l,t))return;if(p.type===l){d=!0,f=p.attrs;return}const m=i.doc.resolve(h),b=m.index();d=m.parent.canReplaceWith(b,b+1,l),d&&(f=m.parent.attrs)}),d?(s==null||s(i.setBlockType(c,u,l,{...n?f:{},...t}).scrollIntoView()),!0):!1}}function Gv(e){return t=>{const{tr:r,state:n}=t,{type:o,attrs:i,preserveAttrs:s=!0}=e,a=Bu({state:r,type:o,attrs:i}),l=e.toggleType??Hh(n.schema);if(a)return Fu(l,{...s?a.node.attrs:{},...i})(t);const c=Bu({state:r,type:l,attrs:i});return Fu(o,{...s?c==null?void 0:c.node.attrs:{},...i})(t)}}function Lz(e=0){const t=navigator.userAgent.match(/Chrom(e|ium)\/(\d+)\./);return t?Number.parseInt(it(t,2),10)>=e:!1}function Iz(e,t){let{head:r,empty:n,anchor:o}=e;for(const i of t.steps)r=i.getMap().map(r);n?t.setSelection(le.near(t.doc.resolve(r))):t.setSelection(le.between(t.doc.resolve(o),t.doc.resolve(r)))}function Dz(e){const{attrs:t={},appendText:r="",content:n="",keepSelection:o=!1,range:i}=e;return({state:s,tr:a,dispatch:l})=>{var c;const u=s.schema,d=jr(e.selection??i??a.selection,a.doc),f=d.$from.index(),{from:p,to:h,$from:m}=d,b=ne(e.type)?u.nodes[e.type]??u.marks[e.type]:e.type;if(te(ne(e.type)?b:!0,{code:H.SCHEMA,message:`Schema contains no marks or nodes with name ${b}`}),cz(b)){if(!m.parent.canReplaceWith(f,f,b))return!1;a.replaceWith(p,h,b.create(t,n?u.text(n):void 0))}else te(n,{message:"`replaceText` cannot be called without content when using a mark type"}),a.replaceWith(p,h,u.text(n,EC(b)?[b.create(t)]:void 0));return r&&a.insertText(r),o&&Iz(s.selection,a),l&&(Lz(60)&&((c=document.getSelection())==null||c.empty()),l(a)),!0}}function $C(e,t){const r=e.parent.childAfter(e.parentOffset);if(!r.node)return;const{marks:n,nodeSize:o}=r.node;if(n[0])return n[0].type;const s=e.start()+r.offset+o;return $C(e.doc.resolve(s+1))}function HC(e){return({dispatch:t,tr:r,state:n})=>{const{type:o,expand:i=!0,range:s}=e,a=jr(e.selection??s??r.selection,r.doc);let{from:l,to:c,$from:u,$to:d}=a;const f=ne(o)?n.schema.marks[o]:o;f!==null&&te(f,{code:H.SCHEMA,message:`Mark type: ${o} does not exist on the current schema.`});const p=f??$C(u);if(!p)return!1;const h=_o(u,p,d);return i&&h&&(l=Math.max(0,Math.min(l,h.from)),c=Math.min(Math.max(c,h.to),r.doc.nodeSize-2)),t==null||t(r.removeMark(l,Jt(c)?c:l,EC(f)?f:void 0)),!0}}function $z(e){const t=["command","cmd","meta"];return on.isMac&&t.push("mod"),t.includes(e)}function Hz(e){const t=["control","ctrl"];return on.isMac||t.push("mod"),t.includes(e)}function Bz(e){const t=[];for(let r of e.split("-")){if(r=r.toLowerCase(),$z(r)){t.push({type:"modifier",symbol:"⌘",key:"command",i18n:Mt.COMMAND_KEY});continue}if(Hz(r)){t.push({type:"modifier",symbol:"⌃",key:"control",i18n:Mt.CONTROL_KEY});continue}switch(r){case"shift":t.push({type:"modifier",symbol:"⇧",key:r,i18n:Mt.SHIFT_KEY});continue;case"alt":t.push({type:"modifier",symbol:"⌥",key:r,i18n:Mt.ALT_KEY});continue;case` +`:case"\r":case"enter":t.push({type:"named",symbol:"↵",key:r,i18n:Mt.ENTER_KEY});continue;case"backspace":t.push({type:"named",symbol:"⌫",key:r,i18n:Mt.BACKSPACE_KEY});continue;case"delete":t.push({type:"named",symbol:"⌦",key:r,i18n:Mt.DELETE_KEY});continue;case"escape":t.push({type:"named",symbol:"␛",key:r,i18n:Mt.ESCAPE_KEY});continue;case"tab":t.push({type:"named",symbol:"⇥",key:r,i18n:Mt.TAB_KEY});continue;case"capslock":t.push({type:"named",symbol:"⇪",key:r,i18n:Mt.CAPS_LOCK_KEY});continue;case"space":t.push({type:"named",symbol:"␣",key:r,i18n:Mt.SPACE_KEY});continue;case"pageup":t.push({type:"named",symbol:"⤒",key:r,i18n:Mt.PAGE_UP_KEY});continue;case"pagedown":t.push({type:"named",symbol:"⤓",key:r,i18n:Mt.PAGE_DOWN_KEY});continue;case"home":t.push({type:"named",key:r,i18n:Mt.HOME_KEY});continue;case"end":t.push({type:"named",key:r,i18n:Mt.END_KEY});continue;case"arrowleft":t.push({type:"named",symbol:"←",key:r,i18n:Mt.ARROW_LEFT_KEY});continue;case"arrowright":t.push({type:"named",symbol:"→",key:r,i18n:Mt.ARROW_RIGHT_KEY});continue;case"arrowup":t.push({type:"named",symbol:"→",key:r,i18n:Mt.ARROW_UP_KEY});continue;case"arrowdown":t.push({type:"named",symbol:"↓",key:r,i18n:Mt.ARROW_DOWN_KEY});continue;default:t.push({type:"char",key:r});continue}}return t}function Fz(e){const{node:t,predicate:r,descend:n=!0,action:o}=e;te(Id(t),{code:H.INTERNAL,message:'Invalid "node" parameter passed to "findChildren".'}),te(_e(r),{code:H.INTERNAL,message:'Invalid "predicate" parameter passed to "findChildren".'});const i=[];return t.descendants((s,a)=>{const l={node:s,pos:a};return r(l)&&(i.push(l),o==null||o(l)),n}),i}function Vz(e){const{type:t,...r}=e;return Fz({...r,predicate:n=>n.node.type===t})}function jz(e,t={}){const{descend:r=!1,predicate:n,StepTypes:o}=t,i=xz(e,o),s=[];for(const a of i){const{start:l,end:c}=a;e.doc.nodesBetween(l,c,(u,d)=>(((n==null?void 0:n(u,d,a))??!0)&&s.push({node:u,pos:d}),r))}return s}function Vu(e){const{regexp:t,type:r,getAttributes:n,ignoreWhitespace:o=!1,beforeDispatch:i,updateCaptured:s,shouldSkip:a,invalidMarks:l}=e;let c;const u=new wa(t,(d,f,p,h)=>{const{tr:m,schema:b}=d;c||(c=ne(r)?b.marks[r]:r,te(c,{code:H.SCHEMA,message:`Mark type: ${r} does not exist on the current schema.`}));let v=f[1],g=f[0];const y=FC({captureGroup:v,fullMatch:g,end:h,start:p,rule:u,state:d,ignoreWhitespace:o,invalidMarks:l,shouldSkip:a,updateCaptured:s});if(!y)return null;({start:p,end:h,captureGroup:v,fullMatch:g}=y);const x=_e(n)?n(f):n;let k=h,w=[];if(v){const E=g.search(/\S/),T=p+g.indexOf(v),C=T+v.length;w=m.storedMarks??[],Cp&&m.delete(p+E,T),k=p+E+v.length}return m.addMark(p,k,c.create(x)),m.setStoredMarks(w),i==null||i({tr:m,match:f,start:p,end:h}),m});return u}function BC(e){const{regexp:t,type:r,getAttributes:n,beforeDispatch:o,shouldSkip:i,ignoreWhitespace:s=!1,updateCaptured:a,invalidMarks:l}=e,c=new wa(t,(u,d,f,p)=>{const h=_e(n)?n(d):n,{tr:m,schema:b}=u,v=ne(r)?b.nodes[r]:r;let g=d[1],y=d[0];const x=FC({captureGroup:g,fullMatch:y,end:p,start:f,rule:c,state:u,ignoreWhitespace:s,invalidMarks:l,shouldSkip:i,updateCaptured:a});if(!x)return null;({start:f,end:p,captureGroup:g,fullMatch:y}=x),te(v,{code:H.SCHEMA,message:`No node exists for ${r} in the schema.`});const k=v.createAndFill(h);return k&&(m.replaceRangeWith(v.isBlock?m.doc.resolve(f).before():f,p,k),o==null||o({tr:m,match:[y,g??""],start:f,end:p})),m});return c}function FC({captureGroup:e,fullMatch:t,end:r,start:n,rule:o,ignoreWhitespace:i,shouldSkip:s,updateCaptured:a,state:l,invalidMarks:c}){var u;if(t==null)return null;const d=(a==null?void 0:a({captureGroup:e,fullMatch:t,start:n,end:r}))??{};e=d.captureGroup??e,t=d.fullMatch??t,n=d.start??n,r=d.end??r;const f=l.doc.resolve(n),p=l.doc.resolve(r);return c&&F1({$from:f,$to:p},c)||o.invalidMarks&&F1({$from:f,$to:p},o.invalidMarks)||i&&(e==null?void 0:e.trim())===""||s!=null&&s({state:l,captureGroup:e,fullMatch:t,start:n,end:r,ruleType:"mark"})||(u=o.shouldSkip)!=null&&u.call(o,{state:l,captureGroup:e,fullMatch:t,start:n,end:r,ruleType:"mark"})?null:{captureGroup:e,end:r,fullMatch:t,start:n}}var Uz=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),r={},n=[];t.forEach(i=>{(i?i.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");r[l]=a}else n.push(a)})});const o=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&o.push(r[i]);return o.push(...n),o.join(" ")},Wz=Uz;const VC=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Kz(e,t){let{$cursor:r}=e.selection;return!r||(t?!t.endOfTextblock("backward",e):r.parentOffset>0)?null:r}const jC=(e,t,r)=>{let n=Kz(e,r);if(!n)return!1;let o=UC(n);if(!o){let s=n.blockRange(),a=s&&rc(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&qC(e,o,t))return!0;if(n.parent.content.size==0&&(zl(i,"end")||ce.isSelectable(i))){let s=Ov(e.doc,n.before(),n.after(),K.empty);if(s&&s.slice.size{let{$head:n,empty:o}=e.selection,i=n;if(!o)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",e):n.parentOffset>0)return!1;i=UC(n)}let s=i&&i.nodeBefore;return!s||!ce.isSelectable(s)?!1:(t&&t(e.tr.setSelection(ce.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function UC(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Gz(e,t){let{$cursor:r}=e.selection;return!r||(t?!t.endOfTextblock("forward",e):r.parentOffset{let n=Gz(e,r);if(!n)return!1;let o=WC(n);if(!o)return!1;let i=o.nodeAfter;if(qC(e,o,t))return!0;if(n.parent.content.size==0&&(zl(i,"start")||ce.isSelectable(i))){let s=Ov(e.doc,n.before(),n.after(),K.empty);if(s&&s.slice.size{let{$head:n,empty:o}=e.selection,i=n;if(!o)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",e):n.parentOffset=0;t--){let r=e.node(t);if(e.index(t)+1{let{$head:r,$anchor:n}=e.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(t&&t(e.tr.insertText(` +`).scrollIntoView()),!0)};function Yv(e){for(let t=0;t{let{$head:r,$anchor:n}=e.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let o=r.node(-1),i=r.indexAfter(-1),s=Yv(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let a=r.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection(be.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},Qz=(e,t)=>{let r=e.selection,{$from:n,$to:o}=r;if(r instanceof kr||n.parent.inlineContent||o.parent.inlineContent)return!1;let i=Yv(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let s=(!n.parentOffset&&o.index(){let{$cursor:r}=e.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let i=r.before();if(dl(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let n=r.blockRange(),o=n&&rc(n);return o==null?!1:(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)};function eL(e){return(t,r)=>{let{$from:n,$to:o}=t.selection;if(t.selection instanceof ce&&t.selection.node.isBlock)return!n.parentOffset||!dl(t.doc,n.pos)?!1:(r&&r(t.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(r){let i=o.parentOffset==o.parent.content.size,s=t.tr;(t.selection instanceof le||t.selection instanceof kr)&&s.deleteSelection();let a=n.depth==0?null:Yv(n.node(-1).contentMatchAt(n.indexAfter(-1))),l=e&&e(o.parent,i),c=l?[l]:i&&a?[{type:a}]:void 0,u=dl(s.doc,s.mapping.map(n.pos),1,c);if(!c&&!u&&dl(s.doc,s.mapping.map(n.pos),1,a?[{type:a}]:void 0)&&(a&&(c=[{type:a}]),u=!0),u&&(s.split(s.mapping.map(n.pos),1,c),!i&&!n.parentOffset&&n.parent.type!=a)){let d=s.mapping.map(n.before()),f=s.doc.resolve(d);a&&n.node(-1).canReplaceWith(f.index(),f.index()+1,a)&&s.setNodeMarkup(s.mapping.map(n.before()),a)}r(s.scrollIntoView())}return!0}}const tL=eL(),rL=(e,t)=>{let{$from:r,to:n}=e.selection,o,i=r.sharedDepth(n);return i==0?!1:(o=r.before(i),t&&t(e.tr.setSelection(ce.create(e.doc,o))),!0)},nL=(e,t)=>(t&&t(e.tr.setSelection(new kr(e.doc))),!0);function oL(e,t,r){let n=t.nodeBefore,o=t.nodeAfter,i=t.index();return!n||!o||!n.type.compatibleContent(o.type)?!1:!n.content.size&&t.parent.canReplace(i-1,i)?(r&&r(e.tr.delete(t.pos-n.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||Rd(e.doc,t.pos))?!1:(r&&r(e.tr.clearIncompatible(t.pos,n.type,n.contentMatchAt(n.childCount)).join(t.pos).scrollIntoView()),!0)}function qC(e,t,r){let n=t.nodeBefore,o=t.nodeAfter,i,s;if(n.type.spec.isolating||o.type.spec.isolating)return!1;if(oL(e,t,r))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(i=(s=n.contentMatchAt(n.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(r){let d=t.pos+o.nodeSize,f=R.empty;for(let m=i.length-1;m>=0;m--)f=R.from(i[m].create(null,f));f=R.from(n.copy(f));let p=e.tr.step(new bt(t.pos-1,d,t.pos,d,new K(f,1,0),i.length,!0)),h=d+2*i.length;Rd(p.doc,h)&&p.join(h),r(p.scrollIntoView())}return!0}let l=be.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),u=c&&rc(c);if(u!=null&&u>=t.depth)return r&&r(e.tr.lift(c,u).scrollIntoView()),!0;if(a&&zl(o,"start",!0)&&zl(n,"end")){let d=n,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let p=o,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(d.canReplace(d.childCount,d.childCount,p.content)){if(r){let m=R.empty;for(let v=f.length-1;v>=0;v--)m=R.from(f[v].copy(m));let b=e.tr.step(new bt(t.pos-f.length,t.pos+o.nodeSize,t.pos+h,t.pos+o.nodeSize-h,new K(m,f.length,0),0,!0));r(b.scrollIntoView())}return!0}}return!1}function GC(e){return function(t,r){let n=t.selection,o=e<0?n.$from:n.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(r&&r(t.tr.setSelection(le.create(t.doc,e<0?o.start(i):o.end(i)))),!0):!1}}const iL=GC(-1),sL=GC(1);function aL(e,t,r){for(let n=0;n{if(s)return!1;s=a.inlineContent&&a.type.allowsMarkType(r)}),s)return!0}return!1}function lL(e,t=null){return function(r,n){let{empty:o,$cursor:i,ranges:s}=r.selection;if(o&&!i||!aL(r.doc,s,e))return!1;if(n)if(i)e.isInSet(r.storedMarks||i.marks())?n(r.tr.removeStoredMark(e)):n(r.tr.addStoredMark(e.create(t)));else{let a=!1,l=r.tr;for(let c=0;!a&&c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},uL=typeof navigator<"u"&&/Mac/.test(navigator.platform),dL=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Yt=0;Yt<10;Yt++)rs[48+Yt]=rs[96+Yt]=String(Yt);for(var Yt=1;Yt<=24;Yt++)rs[Yt+111]="F"+Yt;for(var Yt=65;Yt<=90;Yt++)rs[Yt]=String.fromCharCode(Yt+32),Pp[Yt]=String.fromCharCode(Yt);for(var wg in rs)Pp.hasOwnProperty(wg)||(Pp[wg]=rs[wg]);function fL(e){var t=uL&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||dL&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",r=!t&&e.key||(e.shiftKey?Pp:rs)[e.keyCode]||e.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}const pL=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function hL(e){let t=e.split(/-(?!$)/),r=t[t.length-1];r=="Space"&&(r=" ");let n,o,i,s;for(let a=0;a127)&&(i=rs[n.keyCode])&&i!=o){let a=t[Sg(i,n)];if(a&&a(r.state,r.dispatch,r))return!0}}return!1}}function gL(e){const t=ra(e,(i,s)=>(s.priority??Ae.Low)-(i.priority??Ae.Low)),r=[],n=[];for(const i of t)SL(i)?r.push(i):n.push(i);let o;return new Ro({key:vL,view:i=>(o=i,{}),props:{transformPasted:i=>{var s,a,l;const c=o.state.selection.$from,u=c.node().type.name,d=new Set(c.marks().map(f=>f.type.name));for(const f of r){if((s=f.ignoredNodes)!=null&&s.includes(u)||(a=f.ignoredMarks)!=null&&a.some(g=>d.has(g)))continue;const p=((l=i.content.firstChild)==null?void 0:l.textContent)??"",h=!o.state.selection.empty&&i.content.childCount===1&&p,m=xa(p,f.regexp)[0];if(h&&m&&f.type==="mark"&&f.replaceSelection){const{from:g,to:y}=o.state.selection,x=o.state.doc.slice(g,y),k=x.content.textBetween(0,x.content.size);if(typeof f.replaceSelection!="boolean"?f.replaceSelection(k):f.replaceSelection){const w=[],{getAttributes:E,markType:T}=f,C=_e(E)?E(m,!0):E,M=T.create(C);return x.content.forEach(N=>{if(N.isText){const F=M.addToSet(N.marks);w.push(N.mark(F))}}),K.maxOpen(R.fromArray(w))}}const{nodes:b,transformed:v}=kL(i.content,f,o.state.schema);v&&(i=f.type==="node"&&f.nodeType.isBlock?new K(R.fromArray(b),0,0):new K(R.fromArray(b),i.openStart,i.openEnd))}return TL(i)},handleDOMEvents:{paste:(i,s)=>{var a,l;const c=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{clipboardData:u}=c;if(!u)return!1;const d=[...u.items].map(p=>p.getAsFile()).filter(p=>!!p);if(d.length===0)return!1;const{selection:f}=i.state;for(const{fileHandler:p,regexp:h}of n){const m=h?d.filter(b=>h.test(b.type)):d;if(m.length!==0&&p({event:c,files:m,selection:f,view:i,type:"paste"}))return c.preventDefault(),!0}return!1},drop:(i,s)=>{var a,l,c;const u=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{dataTransfer:d,clientX:f,clientY:p}=u;if(!d)return!1;const h=ML(u);if(h.length===0)return!1;const m=((c=i.posAtCoords({left:f,top:p}))==null?void 0:c.pos)??i.state.selection.anchor;for(const{fileHandler:b,regexp:v}of n){const g=v?h.filter(y=>v.test(y.type)):h;if(g.length!==0&&b({event:u,files:g,pos:m,view:i,type:"drop"}))return u.preventDefault(),!0}return!1}}}})}var vL=new ka("pasteRule");function Eg(e,t){return function r(n){const{fragment:o,rule:i,nodes:s}=n,{regexp:a,ignoreWhitespace:l,ignoredMarks:c,ignoredNodes:u}=i;let d=!1;return o.forEach(f=>{if(u!=null&&u.includes(f.type.name)||EL(f)){s.push(f);return}if(!f.isText){const m=r({fragment:f.content,rule:i,nodes:[]});d||(d=m.transformed);const b=R.fromArray(m.nodes);f.type.validContent(b)?s.push(f.copy(b)):s.push(...m.nodes);return}if(f.marks.some(m=>CL(m)||(c==null?void 0:c.includes(m.type.name)))){s.push(f);return}const p=f.text??"";let h=0;for(const m of xa(p,a)){const b=m[1],v=m[0];if(l&&(b==null?void 0:b.trim())===""||!v)return;const g=m.index,y=g+v.length;g>h&&s.push(f.cut(h,g));let x=f.cut(g,y);if(v&&b){const k=v.search(/\S/),w=g+v.indexOf(b),E=w+b.length;k&&s.push(f.cut(g,g+k)),x=f.cut(w,E)}e({nodes:s,rule:i,textNode:x,match:m,schema:t}),d=!0,h=y}p&&h0?[...n.files]:(r=n.items)!=null&&r.length?[...n.items].map(o=>o.getAsFile()).filter(o=>!!o):[]:[]}function TL(e){const t=K.maxOpen(e.content);return t.openStart({events:{},emit(e,...t){(this.events[e]||[]).forEach(r=>r(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(r=>r!==t)}});var OL=Object.defineProperty,_L=Object.getOwnPropertyDescriptor,Z=(e,t,r,n)=>{for(var o=n>1?void 0:n?_L(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&OL(t,r,o),o},JC=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},G=(e,t,r)=>(JC(e,t,"read from private field"),r?r.call(e):t.get(e)),kt=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Lt=(e,t,r,n)=>(JC(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function AL(e,t){return e===t}function f2(e){const{previousOptions:t,update:r,equals:n=AL}=e,o=Hs({...t,...r}),i=ee(),s=Lu(t);for(const l of s){const c=t[l],u=o[l];if(n(c,u)){i[l]={changed:!1};continue}i[l]={changed:!0,previousValue:c,value:u}}const a=l=>{const c=ee();for(const u of l){const d=i[u];d!=null&&d.changed&&(c[u]=d.value)}return c};return{changes:Hs(i),options:o,pickChanged:a}}var NL={[H.DUPLICATE_HELPER_NAMES]:"helper method",[H.DUPLICATE_COMMAND_NAMES]:"command method"};function XC(e){const{name:t,set:r,code:n}=e,o=NL[n];te(!r.has(t),{code:n,message:`There is a naming conflict for the name: ${t} used in this '${o}'. Please rename or remove from the editor to avoid runtime errors.`}),r.add(t)}function ju(...e){return Ml(Wz(...e).split(" ")).join(" ")}var p2="__IGNORE__",RL="__ALL__",sc=class{constructor(e,...[t]){this["~O"]={},this._mappedHandlers=ee(),this.populateMappedHandlers(),this._options=this._initialOptions=X4(e,this.constructor.defaultOptions,t??ee(),this.createDefaultHandlerOptions()),this._dynamicKeys=this.getDynamicKeys(),this.init()}get options(){return this._options}get dynamicKeys(){return this._dynamicKeys}get initialOptions(){return this._initialOptions}init(){}getDynamicKeys(){const e=[],{customHandlerKeys:t,handlerKeys:r,staticKeys:n}=this.constructor;for(const o of Lu(this._options))n.includes(o)||r.includes(o)||t.includes(o)||e.push(o);return e}ensureAllKeysAreDynamic(e){}setOptions(e){var t;const r=this.getDynamicOptions();this.ensureAllKeysAreDynamic(e);const{changes:n,options:o,pickChanged:i}=f2({previousOptions:r,update:e});this.updateDynamicOptions(o),(t=this.onSetOptions)==null||t.call(this,{reason:"set",changes:n,options:o,pickChanged:i,initialOptions:this._initialOptions})}resetOptions(){var e;const t=this.getDynamicOptions(),{changes:r,options:n,pickChanged:o}=f2({previousOptions:t,update:this._initialOptions});this.updateDynamicOptions(n),(e=this.onSetOptions)==null||e.call(this,{reason:"reset",options:n,changes:r,pickChanged:o,initialOptions:this._initialOptions})}getDynamicOptions(){return wv(this._options,[...this.constructor.customHandlerKeys,...this.constructor.handlerKeys])}updateDynamicOptions(e){this._options={...this._options,...e}}populateMappedHandlers(){for(const e of this.constructor.handlerKeys)this._mappedHandlers[e]=[]}createDefaultHandlerOptions(){const e=ee();for(const t of this.constructor.handlerKeys)e[t]=(...r)=>{var n;const{handlerKeyOptions:o}=this.constructor,i=(n=o[t])==null?void 0:n.reducer;let s=i==null?void 0:i.getDefault(...r);for(const[,a]of this._mappedHandlers[t]){const l=a(...r);if(s=i?i.accumulator(s,l,...r):l,PL(o,s,t))return s}return s};return e}addHandler(e,t,r=Ae.Default){return this._mappedHandlers[e].push([r,t]),this.sortHandlers(e),()=>this._mappedHandlers[e]=this._mappedHandlers[e].filter(([,n])=>n!==t)}hasHandlers(e){return(this._mappedHandlers[e]??[]).length>0}sortHandlers(e){this._mappedHandlers[e]=ra(this._mappedHandlers[e],([t],[r])=>r-t)}addCustomHandler(e,t){var r;return((r=this.onAddCustomHandler)==null?void 0:r.call(this,{[e]:t}))??J4}};sc.defaultOptions={};sc.staticKeys=[];sc.handlerKeys=[];sc.handlerKeyOptions={};sc.customHandlerKeys=[];function PL(e,t,r){const{[RL]:n}=e,o=e[r];return!n&&!o?!1:!!(o&&o.earlyReturnValue!==p2&&(_e(o.earlyReturnValue)?o.earlyReturnValue(t)===!0:t===o.earlyReturnValue)||n&&n.earlyReturnValue!==p2&&(_e(n.earlyReturnValue)?n.earlyReturnValue(t)===!0:t===n.earlyReturnValue))}var Uh=class extends sc{constructor(...e){super(zL,...e),this["~E"]={},this._extensions=Z4(this.createExtensions(),t=>t.constructor),this.extensionMap=new Map;for(const t of this._extensions)this.extensionMap.set(t.constructor,t)}get priority(){return this.priorityOverride??this.options.priority??this.constructor.defaultPriority}get constructorName(){return`${V4(this.name)}Extension`}get store(){return te(this._store,{code:H.MANAGER_PHASE_ERROR,message:"An error occurred while attempting to access the 'extension.store' when the Manager has not yet set created the lifecycle methods."}),Hs(this._store,{requireKeys:!0})}get extensions(){return this._extensions}replaceChildExtension(e,t){this.extensionMap.has(e)&&(this.extensionMap.set(e,t),this._extensions=this.extensions.map(r=>t.constructor===e?t:r))}createExtensions(){return[]}getExtension(e){const t=this.extensionMap.get(e);return te(t,{code:H.INVALID_GET_EXTENSION,message:`'${e.name}' does not exist within the preset: '${this.name}'`}),t}isOfType(e){return this.constructor===e}setStore(e){this._store||(this._store=e)}clone(...e){return new this.constructor(...e)}setPriority(e){this.priorityOverride=e}};Uh.defaultPriority=Ae.Default;var Ve=class extends Uh{static get[ti](){return $t.PlainExtensionConstructor}get[ti](){return $t.PlainExtension}},li=class extends Uh{static get[ti](){return $t.MarkExtensionConstructor}get[ti](){return $t.MarkExtension}get type(){return it(this.store.schema.marks,this.name)}constructor(...e){super(...e)}};li.disableExtraAttributes=!1;var er=class extends Uh{static get[ti](){return $t.NodeExtensionConstructor}get[ti](){return $t.NodeExtension}get type(){return it(this.store.schema.nodes,this.name)}constructor(...e){super(...e)}};er.disableExtraAttributes=!1;var zL={priority:void 0,extraAttributes:{},disableExtraAttributes:!1,exclude:{}};function QC(e){return oc(e)&&ic(e,[$t.PlainExtension,$t.MarkExtension,$t.NodeExtension])}function LL(e){return oc(e)&&ic(e,[$t.PlainExtensionConstructor,$t.MarkExtensionConstructor,$t.NodeExtensionConstructor])}function ZC(e){return oc(e)&&ic(e,$t.PlainExtension)}function Hd(e){return oc(e)&&ic(e,$t.NodeExtension)}function Wh(e){return oc(e)&&ic(e,$t.MarkExtension)}function pe(e){return t=>{const{defaultOptions:r,customHandlerKeys:n,handlerKeys:o,staticKeys:i,defaultPriority:s,handlerKeyOptions:a,...l}=e,c=t;r&&(c.defaultOptions=r),s&&(c.defaultPriority=s),a&&(c.handlerKeyOptions=a),c.staticKeys=i??[],c.handlerKeys=o??[],c.customHandlerKeys=n??[];for(const[u,d]of Object.entries(l))c[u]||(c[u]=d);return c}}var IL=class extends Ve{constructor(){super(...arguments),this.attributeList=[],this.attributeObject=ee(),this.updateAttributes=(e=!0)=>{this.transformAttributes(),e&&this.store.commands.forceUpdate("attributes")}}get name(){return"attributes"}onCreate(){this.transformAttributes(),this.store.setExtensionStore("updateAttributes",this.updateAttributes)}transformAttributes(){var e,t,r;if(this.attributeObject=ee(),(e=this.store.managerSettings.exclude)!=null&&e.attributes){this.store.setStoreKey("attributes",this.attributeObject);return}this.attributeList=[];for(const n of this.store.extensions){if((t=n.options.exclude)!=null&&t.attributes)continue;const o=(r=n.createAttributes)==null?void 0:r.call(n),i={...o,class:ju(...n.classNames??[],o==null?void 0:o.class)};this.attributeList.unshift(i)}for(const n of this.attributeList)this.attributeObject={...this.attributeObject,...n,class:ju(this.attributeObject.class,n.class)};this.store.setStoreKey("attributes",this.attributeObject)}};function He(e={}){return(t,r,n)=>{(t.decoratedHelpers??(t.decoratedHelpers={}))[r]=e}}function U(e={}){return(t,r,n)=>{(t.decoratedCommands??(t.decoratedCommands={}))[r]=e}}function je(e){return(t,r,n)=>{(t.decoratedKeybindings??(t.decoratedKeybindings={}))[r]=e}}var DL=class{constructor(e){this.promiseCreator=e,this.failureHandlers=[],this.successHandlers=[],this.validateHandlers=[],this.generateCommand=()=>t=>{let r=!0;const{view:n,tr:o,dispatch:i}=t;if(!n)return!1;for(const a of this.validateHandlers)if(!a({...t,dispatch:()=>{}})){r=!1;break}return!i||!r?r:(this.promiseCreator(t).then(a=>{this.runHandlers(this.successHandlers,{value:a,state:n.state,tr:n.state.tr,dispatch:n.dispatch,view:n})}).catch(a=>{this.runHandlers(this.failureHandlers,{error:a,state:n.state,tr:n.state.tr,dispatch:n.dispatch,view:n})}),i(o),!0)}}validate(e,t="push"){return this.validateHandlers[t](e),this}success(e,t="push"){return this.successHandlers[t](e),this}failure(e,t="push"){return this.failureHandlers[t](e),this}runHandlers(e,t){var r;for(const n of e)if(!n({...t,dispatch:()=>{}}))break;(r=t.dispatch)==null||r.call(t,t.tr)}};function ns(e){const{type:t,attrs:r,range:n,selection:o}=e;return i=>{const{dispatch:s,tr:a,state:l}=i,c=ne(t)?l.schema.marks[t]:t;if(te(c,{code:H.SCHEMA,message:`Mark type: ${t} does not exist on the current schema.`}),n||o){const{from:u,to:d}=jr(o??n??a.selection,a.doc);return Rp({trState:a,type:t,...n})?s==null||s(a.removeMark(u,d,c)):s==null||s(a.addMark(u,d,c.create(r))),!0}return bu(lL(c,r))(i)}}function $L(e,t,r){for(const{$from:n,$to:o}of r){let i=n.depth===0?t.type.allowsMarkType(e):!1;if(t.nodesBetween(n.pos,o.pos,s=>{if(i)return!1;i=s.inlineContent&&s.type.allowsMarkType(e)}),i)return!0}return!1}function HL(e,t,r){return({tr:n,dispatch:o,state:i})=>{const s=jr(r??n.selection,n.doc),a=Sz(s),l=ne(e)?i.schema.marks[e]:e;if(te(l,{code:H.SCHEMA,message:`Mark type: ${e} does not exist on the current schema.`}),s.empty&&!a||!$L(l,n.doc,s.ranges))return!1;if(!o)return!0;if(a)return n.removeStoredMark(l),t&&n.addStoredMark(l.create(t)),o(n),!0;let c=!1;for(const{$from:u,$to:d}of s.ranges){if(c)break;c=n.doc.rangeHasMark(u.pos,d.pos,l)}for(const{$from:u,$to:d}of s.ranges)c&&n.removeMark(u.pos,d.pos,l),t&&n.addMark(u.pos,d.pos,l.create(t));return o(n),!0}}function BL(e,t={}){return({tr:r,dispatch:n,state:o})=>{const i=o.schema,s=r.selection,{from:a=s.from,to:l=a??s.to,marks:c={}}=t;if(!n)return!0;r.insertText(e,a,l);const u=it(r.steps,r.steps.length-1).getMap().map(l);for(const[d,f]of At(c))r.addMark(a,u,it(i.marks,d).create(f));return n(r),!0}}var xe=class extends Ve{constructor(){super(...arguments),this.decorated=new Map,this.forceUpdateTransaction=(e,...t)=>{const{forcedUpdates:r}=this.getCommandMeta(e);return this.setCommandMeta(e,{forcedUpdates:Ml([...r,...t])}),e}}get name(){return"commands"}get transaction(){const e=this.store.getState();this._transaction||(this._transaction=e.tr);const t=this._transaction.before.eq(e.doc),r=!Mo(this._transaction.steps);if(!t){const n=e.tr;if(r)for(const o of this._transaction.steps)n.step(o);this._transaction=n}return this._transaction}onCreate(){this.store.setStoreKey("getForcedUpdates",this.getForcedUpdates.bind(this))}onView(e){var t;const{extensions:r,helpers:n}=this.store,o=ee(),i=new Set;let s=ee();const a=c=>{var u;const d=ee(),f=()=>c??this.transaction;let p=[];const h=()=>p;for(const[b,v]of Object.entries(o))(u=s[b])!=null&&u.disableChaining||(d[b]=this.chainedFactory({chain:d,command:v.original,getTr:f,getChain:h}));const m=b=>{te(b===f(),{message:"Chaining currently only supports `CommandFunction` methods which do not use the `state.tr` property. Instead you should use the provided `tr` property."})};return d.run=(b={})=>{const v=p;p=[];for(const g of v)if(!g(m)&&b.exitEarly)return;e.dispatch(f())},d.tr=()=>{const b=p;p=[];for(const v of b)v(m);return f()},d.enabled=()=>{for(const b of p)if(!b())return!1;return!0},d.new=b=>a(b),d};for(const c of r){const u=((t=c.createCommands)==null?void 0:t.call(c))??{},d=c.decoratedCommands??{},f={};s={...s,decoratedCommands:d};for(const[p,h]of Object.entries(d)){const m=ne(h.shortcut)&&h.shortcut.startsWith("_|")?{shortcut:n.getNamedShortcut(h.shortcut,c.options)}:void 0;this.updateDecorated(p,{...h,name:c.name,...m}),u[p]=c[p].bind(c),h.active&&(f[p]=()=>{var b;return((b=h.active)==null?void 0:b.call(h,c.options,this.store))??!1})}gp(u)||this.addCommands({active:f,names:i,commands:o,extensionCommands:u})}const l=a();for(const[c,u]of Object.entries(l))a[c]=u;this.store.setStoreKey("commands",o),this.store.setStoreKey("chain",a),this.store.setExtensionStore("commands",o),this.store.setExtensionStore("chain",a)}onStateUpdate({state:e}){this._transaction=e.tr}createPlugin(){return{}}customDispatch(e){return e}insertText(e,t={}){return ne(e)?BL(e,t):this.store.createPlaceholderCommand({promise:e,placeholder:{type:"inline"},onSuccess:(r,n,o)=>this.insertText(r,{...t,...n})(o)}).generateCommand()}selectText(e,t={}){return({tr:r,dispatch:n})=>{const o=jr(e,r.doc);return r.selection.anchor===o.anchor&&r.selection.head===o.head&&!t.forceUpdate?!1:(n==null||n(r.setSelection(o)),!0)}}selectMark(e){return t=>{const{tr:r}=t,n=_o(r.selection.$from,e);return n?this.store.commands.selectText.original({from:n.from,to:n.to})(t):!1}}delete(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=e??t.selection;return r==null||r(t.delete(n,o)),!0}}emptyUpdate(e){return({tr:t,dispatch:r})=>(r&&(e==null||e(),r(t)),!0)}forceUpdate(...e){return({tr:t,dispatch:r})=>(r==null||r(this.forceUpdateTransaction(t,...e)),!0)}updateNodeAttributes(e,t){return({tr:r,dispatch:n})=>(n==null||n(r.setNodeMarkup(e,void 0,t)),!0)}setContent(e,t){return r=>{const{tr:n,dispatch:o}=r,i=this.store.manager.createState({content:e,selection:t});return i?(o==null||o(n.replaceRangeWith(0,n.doc.nodeSize-2,i.doc)),!0):!1}}resetContent(){return e=>{const{tr:t,dispatch:r}=e,n=this.store.manager.createEmptyDoc();return n?this.setContent(n)(e):(r==null||r(t.delete(0,t.doc.nodeSize)),!0)}}emptySelection(){return({tr:e,dispatch:t})=>e.selection.empty?!1:(t==null||t(e.setSelection(le.near(e.selection.$anchor))),!0)}insertNewLine(){return({dispatch:e,tr:t})=>gs(t.selection)?(e==null||e(t.insertText(` +`)),!0):!1}insertNode(e,t={}){return({dispatch:r,tr:n,state:o})=>{var i;const{attrs:s,range:a,selection:l,replaceEmptyParentBlock:c=!1}=t,{from:u,to:d,$from:f}=jr(l??a??n.selection,n.doc);if(Id(e)||fz(e)){const v=f.before(f.depth);return r==null||r(c&&u===d&&Bh(f.parent)?n.replaceWith(v,v+f.parent.nodeSize,e):n.replaceWith(u,d,e)),!0}const p=ne(e)?o.schema.nodes[e]:e;te(p,{code:H.SCHEMA,message:`The requested node type ${e} does not exist in the schema.`});const h=(i=t.marks)==null?void 0:i.map(v=>{if(v instanceof Te)return v;const g=ne(v)?o.schema.marks[v]:v;return te(g,{code:H.SCHEMA,message:`The requested mark type ${v} does not exist in the schema.`}),g.create()}),m=p.createAndFill(s,ne(t.content)?o.schema.text(t.content):t.content,h);if(!m)return!1;const b=u!==d;return r==null||r(b?n.replaceRangeWith(u,d,m):n.insert(u,m)),!0}}focus(e){return t=>{const{dispatch:r,tr:n}=t,{view:o}=this.store;if(e===!1||o.hasFocus()&&(e===void 0||e===!0))return!1;if(e===void 0||e===!0){const{from:i=0,to:s=i}=n.selection;e={from:i,to:s}}return r&&this.delayedFocus(),this.selectText(e)(t)}}blur(e){return t=>{const{view:r}=this.store;return r.hasFocus()?(requestAnimationFrame(()=>{r.dom.blur()}),e?this.selectText(e)(t):!0):!1}}setBlockNodeType(e,t,r,n=!0){return Fu(e,t,r,n)}toggleWrappingNode(e,t,r){return DC(e,t,r)}toggleBlockNodeItem(e){return Gv(e)}wrapInNode(e,t,r){return IC(e,t,r)}applyMark(e,t,r){return HL(e,t,r)}toggleMark(e){return ns(e)}removeMark(e){return HC(e)}setMeta(e,t){return({tr:r})=>(r.setMeta(e,t),!0)}selectAll(){return this.selectText("all")}copy(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("copy"),!0)}paste(){return this.store.createPlaceholderCommand({promise:async()=>{var e;return(e=navigator.clipboard)!=null&&e.readText?await navigator.clipboard.readText():""},placeholder:{type:"inline"},onSuccess:(e,t,r)=>this.insertNode(j1({content:e,schema:r.state.schema}),{selection:t})(r)}).generateCommand()}cut(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("cut"),!0)}replaceText(e){return Dz(e)}getAllCommandOptions(){const e={};for(const[t,r]of this.decorated)gp(r)||(e[t]=r);return e}getCommandOptions(e){return this.decorated.get(e)}getCommandProp(){return{tr:this.transaction,dispatch:this.store.view.dispatch,state:this.store.view.state,view:this.store.view}}updateDecorated(e,t){if(!t){this.decorated.delete(e);return}const r=this.decorated.get(e)??{name:""};this.decorated.set(e,{...r,...t})}handleIosFocus(){on.isIos&&this.store.view.dom.focus()}delayedFocus(){this.handleIosFocus(),requestAnimationFrame(()=>{this.store.view.focus(),this.store.view.dispatch(this.transaction.scrollIntoView())})}getForcedUpdates(e){return this.getCommandMeta(e).forcedUpdates}getCommandMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...FL,...t}}setCommandMeta(e,t){const r=this.getCommandMeta(e);e.setMeta(this.pluginKey,{...r,...t})}addCommands(e){const{extensionCommands:t,commands:r,names:n,active:o}=e;for(const[i,s]of At(t))XC({name:i,set:n,code:H.DUPLICATE_COMMAND_NAMES}),te(!VL.has(i),{code:H.DUPLICATE_COMMAND_NAMES,message:"The command name you chose is forbidden."}),r[i]=this.createUnchainedCommand(s,o[i])}unchainedFactory(e){return(...t)=>{const{shouldDispatch:r=!0,command:n}=e,{view:o}=this.store,{state:i}=o;let s;return r&&(s=o.dispatch),n(...t)({state:i,dispatch:s,view:o,tr:i.tr})}}createUnchainedCommand(e,t){const r=this.unchainedFactory({command:e});return r.enabled=this.unchainedFactory({command:e,shouldDispatch:!1}),r.isEnabled=r.enabled,r.original=e,r.active=t,r}chainedFactory(e){return(...t)=>{const{chain:r,command:n,getTr:o,getChain:i}=e,s=i(),{view:a}=this.store,{state:l}=a;return s.push(c=>n(...t)({state:l,dispatch:c,view:a,tr:o()})),r}}};Z([U()],xe.prototype,"customDispatch",1);Z([U()],xe.prototype,"insertText",1);Z([U()],xe.prototype,"selectText",1);Z([U()],xe.prototype,"selectMark",1);Z([U()],xe.prototype,"delete",1);Z([U()],xe.prototype,"emptyUpdate",1);Z([U()],xe.prototype,"forceUpdate",1);Z([U()],xe.prototype,"updateNodeAttributes",1);Z([U()],xe.prototype,"setContent",1);Z([U()],xe.prototype,"resetContent",1);Z([U()],xe.prototype,"emptySelection",1);Z([U()],xe.prototype,"insertNewLine",1);Z([U()],xe.prototype,"insertNode",1);Z([U()],xe.prototype,"focus",1);Z([U()],xe.prototype,"blur",1);Z([U()],xe.prototype,"setBlockNodeType",1);Z([U()],xe.prototype,"toggleWrappingNode",1);Z([U()],xe.prototype,"toggleBlockNodeItem",1);Z([U()],xe.prototype,"wrapInNode",1);Z([U()],xe.prototype,"applyMark",1);Z([U()],xe.prototype,"toggleMark",1);Z([U()],xe.prototype,"removeMark",1);Z([U()],xe.prototype,"setMeta",1);Z([U({description:({t:e})=>e(es.SELECT_ALL_DESCRIPTION),label:({t:e})=>e(es.SELECT_ALL_LABEL),shortcut:D.SelectAll})],xe.prototype,"selectAll",1);Z([U({description:({t:e})=>e(es.COPY_DESCRIPTION),label:({t:e})=>e(es.COPY_LABEL),shortcut:D.Copy,icon:"fileCopyLine"})],xe.prototype,"copy",1);Z([U({description:({t:e})=>e(es.PASTE_DESCRIPTION),label:({t:e})=>e(es.PASTE_LABEL),shortcut:D.Paste,icon:"clipboardLine"})],xe.prototype,"paste",1);Z([U({description:({t:e})=>e(es.CUT_DESCRIPTION),label:({t:e})=>e(es.CUT_LABEL),shortcut:D.Cut,icon:"scissorsFill"})],xe.prototype,"cut",1);Z([U()],xe.prototype,"replaceText",1);Z([He()],xe.prototype,"getAllCommandOptions",1);Z([He()],xe.prototype,"getCommandOptions",1);Z([He()],xe.prototype,"getCommandProp",1);xe=Z([pe({defaultPriority:Ae.Highest,defaultOptions:{trackerClassName:"remirror-tracker-position",trackerNodeName:"span"},staticKeys:["trackerClassName","trackerNodeName"]})],xe);var FL={forcedUpdates:[]},VL=new Set(["run","chain","original","raw","enabled","tr","new"]),io=class extends Ve{constructor(){super(...arguments),this.placeholders=Ee.empty,this.placeholderWidgets=new Map,this.createPlaceholderCommand=e=>{const t=Cl(),{promise:r,placeholder:n,onFailure:o,onSuccess:i}=e;return new DL(r).validate(s=>this.addPlaceholder(t,n)(s)).success(s=>{const{state:a,tr:l,dispatch:c,view:u,value:d}=s,f=this.store.helpers.findPlaceholder(t);if(!f){const p=new Error("The placeholder has been removed");return(o==null?void 0:o({error:p,state:a,tr:l,dispatch:c,view:u}))??!1}return this.removePlaceholder(t)({state:a,tr:l,view:u,dispatch:()=>{}}),i(d,f,{state:a,tr:l,dispatch:c,view:u})}).failure(s=>(this.removePlaceholder(t)({...s,dispatch:()=>{}}),(o==null?void 0:o(s))??!1))}}get name(){return"decorations"}onCreate(){this.store.setExtensionStore("createPlaceholderCommand",this.createPlaceholderCommand)}createPlugin(){return{state:{init:()=>{},apply:e=>{var t,r,n,o,i,s;const{added:a,clearTrackers:l,removed:c,updated:u}=this.getMeta(e);if(l){this.placeholders=Ee.empty;for(const[,d]of this.placeholderWidgets)(r=(t=d.spec).onDestroy)==null||r.call(t,this.store.view,d.spec.element);this.placeholderWidgets.clear();return}this.placeholders=this.placeholders.map(e.mapping,e.doc,{onRemove:d=>{var f,p;const h=this.placeholderWidgets.get(d.id);h&&((p=(f=h.spec).onDestroy)==null||p.call(f,this.store.view,h.spec.element))}});for(const[,d]of this.placeholderWidgets)(o=(n=d.spec).onUpdate)==null||o.call(n,this.store.view,d.from,d.spec.element,d.spec.data);for(const d of a){if(d.type==="inline"){this.addInlinePlaceholder(d,e);continue}if(d.type==="node"){this.addNodePlaceholder(d,e);continue}if(d.type==="widget"){this.addWidgetPlaceholder(d,e);continue}}for(const{id:d,data:f}of u){const p=this.placeholderWidgets.get(d);if(!p)continue;const h=Ge.widget(p.from,p.spec.element,{...p.spec,data:f});this.placeholders=this.placeholders.remove([p]).add(e.doc,[h]),this.placeholderWidgets.set(d,h)}for(const d of c){const f=this.placeholders.find(void 0,void 0,h=>h.id===d&&h.__type===Na),p=this.placeholderWidgets.get(d);p&&((s=(i=p.spec).onDestroy)==null||s.call(i,this.store.view,p.spec.element)),this.placeholders=this.placeholders.remove(f),this.placeholderWidgets.delete(d)}}},props:{decorations:e=>{let t=this.options.decorations(e);t=t.add(e.doc,this.placeholders.find());for(const r of this.store.extensions){if(!r.createDecorations)continue;const n=r.createDecorations(e).find();t=t.add(e.doc,n)}return t},handleDOMEvents:{blur:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(h2,!1)),!1),focus:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(h2,!0)),!1)}}}}updateDecorations(){return({tr:e,dispatch:t})=>(t==null||t(e),!0)}addPlaceholder(e,t,r){return({dispatch:n,tr:o})=>this.addPlaceholderTransaction(e,t,o,!n)?(n==null||n(r?o.deleteSelection():o),!0):!1}updatePlaceholder(e,t){return({dispatch:r,tr:n})=>this.updatePlaceholderTransaction({id:e,data:t,tr:n,checkOnly:!r})?(r==null||r(n),!0):!1}removePlaceholder(e){return({dispatch:t,tr:r})=>this.removePlaceholderTransaction({id:e,tr:r,checkOnly:!t})?(t==null||t(r),!0):!1}clearPlaceholders(){return({tr:e,dispatch:t})=>this.clearPlaceholdersTransaction({tr:e,checkOnly:!t})?(t==null||t(e),!0):!1}findPlaceholder(e){return this.findAllPlaceholders().get(e)}findAllPlaceholders(){const e=new Map,t=this.placeholders.find(void 0,void 0,r=>r.__type===Na);for(const r of t)e.set(r.spec.id,{from:r.from,to:r.to});return e}createDecorations(e){var t,r,n;const{persistentSelectionClass:o}=this.options;return!o||(t=this.store.view)!=null&&t.hasFocus()||(n=(r=this.store.helpers).isInteracting)!=null&&n.call(r)?Ee.empty:UL(e,Ee.empty,{class:ne(o)?o:"selection"})}onApplyState(){}addWidgetPlaceholder(e,t){const{pos:r,createElement:n,onDestroy:o,onUpdate:i,className:s,nodeName:a,id:l,type:c}=e,u=(n==null?void 0:n(this.store.view,r))??document.createElement(a);u.classList.add(s);const d=Ge.widget(r,u,{id:l,__type:Na,type:c,element:u,onDestroy:o,onUpdate:i});this.placeholderWidgets.set(l,d),this.placeholders=this.placeholders.add(t.doc,[d])}addInlinePlaceholder(e,t){const{from:r=t.selection.from,to:n=t.selection.to,className:o,nodeName:i,id:s,type:a}=e;let l;if(r===n){const c=document.createElement(i);c.classList.add(o),l=Ge.widget(r,c,{id:s,type:a,__type:Na,widget:c})}else l=Ge.inline(r,n,{nodeName:i,class:o},{id:s,__type:Na});this.placeholders=this.placeholders.add(t.doc,[l])}addNodePlaceholder(e,t){const{pos:r,className:n,nodeName:o,id:i}=e,s=Jt(r)?t.doc.resolve(r):t.selection.$from,a=Jt(r)?s.nodeAfter?{pos:r,end:s.nodeAfter.nodeSize}:void 0:rz(s);if(!a)return;const l=Ge.node(a.pos,a.end,{nodeName:o,class:n},{id:i,__type:Na});this.placeholders=this.placeholders.add(t.doc,[l])}withRequiredBase(e,t){const{placeholderNodeName:r,placeholderClassName:n}=this.options,{nodeName:o=r,className:i,...s}=t,a=(i?[n,i]:[n]).join(" ");return{nodeName:o,className:a,...s,id:e}}getMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...jL,...t}}setMeta(e,t){const r=this.getMeta(e);e.setMeta(this.pluginKey,{...r,...t})}addPlaceholderTransaction(e,t,r,n=!1){if(this.findPlaceholder(e))return!1;if(n)return!0;const{added:i}=this.getMeta(r);return this.setMeta(r,{added:[...i,this.withRequiredBase(e,t)]}),!0}updatePlaceholderTransaction(e){const{id:t,tr:r,checkOnly:n=!1,data:o}=e;if(!this.findPlaceholder(t))return!1;if(n)return!0;const{updated:s}=this.getMeta(r);return this.setMeta(r,{updated:Ml([...s,{id:t,data:o}])}),!0}removePlaceholderTransaction(e){const{id:t,tr:r,checkOnly:n=!1}=e;if(!this.findPlaceholder(t))return!1;if(n)return!0;const{removed:i}=this.getMeta(r);return this.setMeta(r,{removed:Ml([...i,t])}),!0}clearPlaceholdersTransaction(e){const{tr:t,checkOnly:r=!1}=e;return this.getPluginState()===Ee.empty?!1:(r||this.setMeta(t,{clearTrackers:!0}),!0)}};Z([U()],io.prototype,"updateDecorations",1);Z([U()],io.prototype,"addPlaceholder",1);Z([U()],io.prototype,"updatePlaceholder",1);Z([U()],io.prototype,"removePlaceholder",1);Z([U()],io.prototype,"clearPlaceholders",1);Z([He()],io.prototype,"findPlaceholder",1);Z([He()],io.prototype,"findAllPlaceholders",1);io=Z([pe({defaultOptions:{persistentSelectionClass:void 0,placeholderClassName:"placeholder",placeholderNodeName:"span"},staticKeys:["placeholderClassName","placeholderNodeName"],handlerKeys:["decorations"],handlerKeyOptions:{decorations:{reducer:{accumulator:(e,t,r)=>e.add(r.doc,t.find()),getDefault:()=>Ee.empty}}},defaultPriority:Ae.Low})],io);var jL={added:[],updated:[],clearTrackers:!1,removed:[]},Na="placeholderDecoration",h2="persistentSelectionFocus";function UL(e,t,r){const{selection:n,doc:o}=e;if(n.empty)return t;const{from:i,to:s}=n,a=Dd(n)?Ge.node(i,s,r):Ge.inline(i,s,r);return t.add(o,[a])}var W1=class extends Ve{get name(){return"docChanged"}onStateUpdate(e){const{firstUpdate:t,transactions:r,tr:n}=e;t||(r??[n]).some(o=>o==null?void 0:o.docChanged)&&this.options.docChanged(e)}};W1=Z([pe({handlerKeys:["docChanged"],handlerKeyOptions:{docChanged:{earlyReturnValue:!1}},defaultPriority:Ae.Lowest})],W1);var Rn=class extends Ve{get name(){return"helpers"}onCreate(){var e;this.store.setStringHandler("text",this.textToProsemirrorNode.bind(this)),this.store.setStringHandler("html",j1);const t=ee(),r=ee(),n=ee(),o=new Set;for(const i of this.store.extensions){Hd(i)&&(r[i.name]=a=>SC({state:this.store.getState(),type:i.type,attrs:a}),n[i.name]=a=>{var l;return(l=Bu({state:this.store.getState(),type:i.type,attrs:a}))==null?void 0:l.node.attrs}),Wh(i)&&(r[i.name]=a=>Rp({trState:this.store.getState(),type:i.type,attrs:a}),n[i.name]=a=>{const l=_o(this.store.getState().selection.$from,i.type);if(!l||!a)return l==null?void 0:l.mark.attrs;if(Uv(l.mark,a))return l.mark.attrs});const s=((e=i.createHelpers)==null?void 0:e.call(i))??{};for(const a of Object.keys(i.decoratedHelpers??{}))s[a]=i[a].bind(i);if(!gp(s))for(const[a,l]of At(s))XC({name:a,set:o,code:H.DUPLICATE_HELPER_NAMES}),t[a]=l}this.store.setStoreKey("attrs",n),this.store.setStoreKey("active",r),this.store.setStoreKey("helpers",t),this.store.setExtensionStore("attrs",n),this.store.setExtensionStore("active",r),this.store.setExtensionStore("helpers",t)}isSelectionEmpty(e=this.store.getState()){return jv(e)}isViewEditable(e=this.store.getState()){var t,r;return((r=(t=this.store.view.props).editable)==null?void 0:r.call(t,e))??!1}getStateJSON(e=this.store.getState()){return e.toJSON()}getJSON(e=this.store.getState()){return e.doc.toJSON()}getRemirrorJSON(e=this.store.getState()){return this.getJSON(e)}insertHtml(e,t){return r=>{const{state:n}=r,o=j1({content:e,schema:n.schema,fragment:!0});return this.store.commands.insertNode.original(o,t)(r)}}getText({lineBreakDivider:e=` `,state:t=this.store.getState()}={}){return t.doc.textBetween(0,t.doc.content.size,e,zi)}getTextBetween(e,t,r=this.store.getState().doc){return r.textBetween(e,t,` -`,zi)}getHTML(e=this.store.getState()){return wz(e.doc,this.store.document)}textToProsemirrorNode(e){const t=`
${e.content}
`;return this.store.stringHandlers.html({...e,content:t})}};Z([He()],An.prototype,"isSelectionEmpty",1);Z([He()],An.prototype,"isViewEditable",1);Z([He()],An.prototype,"getStateJSON",1);Z([He()],An.prototype,"getJSON",1);Z([He()],An.prototype,"getRemirrorJSON",1);Z([U()],An.prototype,"insertHtml",1);Z([He()],An.prototype,"getText",1);Z([He()],An.prototype,"getTextBetween",1);Z([He()],An.prototype,"getHTML",1);An=Z([me({})],An);var j1=class extends Ve{get name(){return"inputRules"}onCreate(){this.store.setExtensionStore("rebuildInputRules",this.rebuildInputRules.bind(this))}createExternalPlugins(){return[this.generateInputRulesPlugin()]}generateInputRulesPlugin(){var e,t;const r=[],n=this.store.markTags[oe.ExcludeInputRules];for(const o of this.store.extensions)if(!((e=this.store.managerSettings.exclude)!=null&&e.inputRules||!o.createInputRules||(t=o.options.exclude)!=null&&t.inputRules))for(const i of o.createInputRules())i.shouldSkip=this.options.shouldSkipInputRule,i.invalidMarks=n,r.push(i);return LR({rules:r})}rebuildInputRules(){this.store.updateExtensionPlugins(this)}};j1=Z([me({defaultPriority:Ae.Default,handlerKeys:["shouldSkipInputRule"],handlerKeyOptions:{shouldSkipInputRule:{earlyReturnValue:!0}}})],j1);var Qn=class extends Ve{constructor(){super(...arguments),this.extraKeyBindings=[],this.backwardMarkExitTracker=new Map,this.keydownHandler=null,this.onAddCustomHandler=({keymap:e})=>{var t,r;if(e)return this.extraKeyBindings=[...this.extraKeyBindings,e],(r=(t=this.store).rebuildKeymap)==null||r.call(t),()=>{var n,o;this.extraKeyBindings=this.extraKeyBindings.filter(i=>i!==e),(o=(n=this.store).rebuildKeymap)==null||o.call(n)}},this.rebuildKeymap=()=>{this.setupKeydownHandler()}}get name(){return"keymap"}get shortcutMap(){const{shortcuts:e}=this.options;return ne(e)?FL[e]:e}onCreate(){this.store.setExtensionStore("rebuildKeymap",this.rebuildKeymap)}createExternalPlugins(){var e;return(e=this.store.managerSettings.exclude)!=null&&e.keymap?[]:(this.setupKeydownHandler(),[new Ro({props:{handleKeyDown:(t,r)=>{var n;return(n=this.keydownHandler)==null?void 0:n.call(this,t,r)}}})])}setupKeydownHandler(){const e=this.generateKeymapBindings();this.keydownHandler=qv(e)}generateKeymapBindings(){var e;const t=[],r=this.shortcutMap,n=this.store.getExtension(xe),o=a=>l=>$f({shortcut:l,map:r,store:this.store,options:a.options});for(const a of this.store.extensions){const l=a.decoratedKeybindings??{};if(!((e=a.options.exclude)!=null&&e.keymap)){a.createKeymap&&t.push(HL(a.createKeymap(o(a)),r));for(const[c,u]of At(l)){if(u.isActive&&!u.isActive(a.options,this.store))continue;const d=a[c].bind(a),f=$f({shortcut:u.shortcut,map:r,options:a.options,store:this.store}),p=_e(u.priority)?u.priority(a.options,this.store):u.priority??Ae.Low,h=ee();for(const m of f)h[m]=d;t.push([p,h]),u.command&&n.updateDecorated(u.command,{shortcut:f})}}}const i=this.sortKeymaps([...this.extraKeyBindings,...t]);return ez(i)}arrowRightShortcut(e){const t=this.store.markTags[oe.PreventExits],r=this.store.nodeTags[oe.PreventExits];return this.exitMarkForwards(t,r)(e)}arrowLeftShortcut(e){const t=this.store.markTags[oe.PreventExits],r=this.store.nodeTags[oe.PreventExits];return _p(this.exitNodeBackwards(r),this.exitMarkBackwards(t,r))(e)}backspace(e){const t=this.store.markTags[oe.PreventExits],r=this.store.nodeTags[oe.PreventExits];return _p(this.exitNodeBackwards(r,!0),this.exitMarkBackwards(t,r,!0))(e)}createKeymap(){const{selectParentNodeOnEscape:e,undoInputRuleOnBackspace:t,excludeBaseKeymap:r}=this.options,n=ee();if(!r)for(const[o,i]of At(yg))n[o]=yu(i);return t&&yg.Backspace&&(n.Backspace=yu(Hh(IR,yg.Backspace))),e&&(n.Escape=yu(Yz)),[Ae.Low,n]}getNamedShortcut(e,t={}){return e.startsWith("_|")?$f({shortcut:e,map:this.shortcutMap,store:this.store,options:t}):[e]}onSetOptions(e){var t,r;const{changes:n}=e;(n.excludeBaseKeymap.changed||n.selectParentNodeOnEscape.changed||n.undoInputRuleOnBackspace.changed)&&((r=(t=this.store).rebuildKeymap)==null||r.call(t))}sortKeymaps(e){return ra(e.map(t=>ct(t)?t:[Ae.Default,t]),(t,r)=>r[0]-t[0]).map(t=>t[1])}exitMarkForwards(e,t){return r=>{const{tr:n,dispatch:o}=r;if(!Cz(n.selection)||ts({selection:n.selection,types:t}))return!1;const a=n.selection.$from.marks().filter(l=>!e.includes(l.type.name));if(Mo(a))return!1;if(!o)return!0;for(const l of a)n.removeStoredMark(l);return o(n.insertText(" ",n.selection.from)),!0}}exitNodeBackwards(e,t=!1){return r=>{const{tr:n}=r;if(!(t?a2:F1)(n.selection))return!1;const i=n.selection.$anchor.node();return!Dh(i)||uz(i)||e.includes(i.type.name)?!1:this.store.commands.toggleBlockNodeItem.original({type:i.type})(r)}}exitMarkBackwards(e,t,r=!1){return n=>{const{tr:o,dispatch:i}=n;if(!(r?a2:F1)(o.selection)||this.backwardMarkExitTracker.has(o.selection.anchor))return this.backwardMarkExitTracker.clear(),!1;if(ts({selection:o.selection,types:t}))return!1;const l=[...o.storedMarks??[],...o.selection.$from.marks()].filter(c=>!e.includes(c.type.name));if(Mo(l))return!1;if(!i)return!0;for(const c of l)o.removeStoredMark(c);return this.backwardMarkExitTracker.set(o.selection.anchor,!0),i(o),!0}}};Z([je({shortcut:"ArrowRight",isActive:e=>e.exitMarksOnArrowPress})],Qn.prototype,"arrowRightShortcut",1);Z([je({shortcut:"ArrowLeft",isActive:e=>e.exitMarksOnArrowPress})],Qn.prototype,"arrowLeftShortcut",1);Z([je({shortcut:"Backspace",isActive:e=>e.exitMarksOnArrowPress})],Qn.prototype,"backspace",1);Z([He()],Qn.prototype,"getNamedShortcut",1);Qn=Z([me({defaultPriority:Ae.Low,defaultOptions:{shortcuts:"default",undoInputRuleOnBackspace:!0,selectParentNodeOnEscape:!1,excludeBaseKeymap:!1,exitMarksOnArrowPress:!0},customHandlerKeys:["keymap"]})],Qn);function $L(e){return dr(Th(D),e)}function $f({shortcut:e,map:t,options:r,store:n}){return ne(e)?[U1(e,t)]:ct(e)?e.map(o=>U1(o,t)):(e=e(r,n),$f({shortcut:e,map:t,options:r,store:n}))}function U1(e,t){return $L(e)?t[e]:e}function HL(e,t){const r={};let n,o;ct(e)?[o,n]=e:n=e;for(const[i,s]of At(n))r[U1(i,t)]=s;return Oh(o)?r:[o,r]}var J5={[D.Copy]:"Mod-c",[D.Cut]:"Mod-x",[D.Paste]:"Mod-v",[D.PastePlain]:"Mod-Shift-v",[D.SelectAll]:"Mod-a",[D.Undo]:"Mod-z",[D.Redo]:nn.isMac?"Shift-Mod-z":"Mod-y",[D.Bold]:"Mod-b",[D.Italic]:"Mod-i",[D.Underline]:"Mod-u",[D.Strike]:"Mod-d",[D.Code]:"Mod-`",[D.Paragraph]:"Mod-Shift-0",[D.H1]:"Mod-Shift-1",[D.H2]:"Mod-Shift-2",[D.H3]:"Mod-Shift-3",[D.H4]:"Mod-Shift-4",[D.H5]:"Mod-Shift-5",[D.H6]:"Mod-Shift-6",[D.TaskList]:"Mod-Shift-7",[D.BulletList]:"Mod-Shift-8",[D.OrderedList]:"Mod-Shift-9",[D.Quote]:"Mod->",[D.Divider]:"Mod-Shift-|",[D.Codeblock]:"Mod-Shift-~",[D.ClearFormatting]:"Mod-Shift-C",[D.Superscript]:"Mod-.",[D.Subscript]:"Mod-,",[D.LeftAlignment]:"Mod-Shift-L",[D.CenterAlignment]:"Mod-Shift-E",[D.RightAlignment]:"Mod-Shift-R",[D.JustifyAlignment]:"Mod-Shift-J",[D.InsertLink]:"Mod-k",[D.Find]:"Mod-f",[D.FindBackwards]:"Mod-Shift-f",[D.FindReplace]:"Mod-Shift-H",[D.AddFootnote]:"Mod-Alt-f",[D.AddComment]:"Mod-Alt-m",[D.ContextMenu]:"Mod-Shift-\\",[D.IncreaseFontSize]:"Mod-Shift-.",[D.DecreaseFontSize]:"Mod-Shift-,",[D.IncreaseIndent]:"Tab",[D.DecreaseIndent]:"Shift-Tab",[D.Shortcuts]:"Mod-/",[D.Format]:nn.isMac?"Alt-Shift-f":"Shift-Ctrl-f"},BL={...J5,[D.Strike]:"Mod-Shift-S",[D.Code]:"Mod-Shift-M",[D.Paragraph]:"Mod-Alt-0",[D.H1]:"Mod-Alt-1",[D.H2]:"Mod-Alt-2",[D.H3]:"Mod-Alt-3",[D.H4]:"Mod-Alt-4",[D.H5]:"Mod-Alt-5",[D.H6]:"Mod-Alt-6",[D.OrderedList]:"Mod-Alt-7",[D.BulletList]:"Mod-Alt-8",[D.Quote]:"Mod-Alt-9",[D.ClearFormatting]:"Mod-\\",[D.IncreaseIndent]:"Mod-[",[D.DecreaseIndent]:"Mod-]"},FL={default:J5,googleDoc:BL},VL=class extends Ve{get name(){return"nodeViews"}createPlugin(){const e=[],t=ee();for(const r of this.store.extensions){if(!r.createNodeViews)continue;const n=r.createNodeViews();e.unshift(_e(n)?{[r.name]:n}:n)}e.unshift(this.store.managerSettings.nodeViews??{});for(const r of e)Object.assign(t,r);return{props:{nodeViews:t}}}},jL=class extends Ve{get name(){return"pasteRules"}createExternalPlugins(){return[this.generatePasteRulesPlugin()]}generatePasteRulesPlugin(){var e,t;const r=[];for(const n of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.pasteRules||!n.createPasteRules||(t=n.options.exclude)!=null&&t.pasteRules)continue;const o=n.createPasteRules(),i=ct(o)?o:[o];r.push(...i)}return cL(r)}},Rp=class extends Ve{constructor(){super(...arguments),this.plugins=[],this.managerPlugins=[],this.applyStateHandlers=[],this.initStateHandlers=[],this.appendTransactionHandlers=[],this.pluginKeys=ee(),this.stateGetters=new Map,this.getPluginStateCreator=e=>t=>e.getState(t??this.store.getState()),this.getStateByName=e=>{const t=this.stateGetters.get(e);return te(t,{message:"No plugin exists for the requested extension name."}),t()}}get name(){return"plugins"}onCreate(){const{setStoreKey:e,setExtensionStore:t,managerSettings:r,extensions:n}=this.store;this.updateExtensionStore();const{plugins:o=[]}=r;this.updatePlugins(o,this.managerPlugins);for(const i of n)i.onApplyState&&this.applyStateHandlers.push(i.onApplyState.bind(i)),i.onInitState&&this.initStateHandlers.push(i.onInitState.bind(i)),i.onAppendTransaction&&this.appendTransactionHandlers.push(i.onAppendTransaction.bind(i)),this.extractExtensionPlugins(i);this.managerPlugins=o,this.store.setStoreKey("plugins",this.plugins),e("pluginKeys",this.pluginKeys),e("getPluginState",this.getStateByName),t("getPluginState",this.getStateByName)}createPlugin(){return{appendTransaction:(e,t,r)=>{const n=r.tr,o={previousState:t,tr:n,transactions:e,state:r};for(const i of this.appendTransactionHandlers)i(o);return this.options.appendTransaction(o),n.docChanged||n.steps.length>0||n.selectionSet||n.storedMarksSet?n:void 0},state:{init:(e,t)=>{for(const r of this.initStateHandlers)r(t)},apply:(e,t,r,n)=>{const o={previousState:r,state:n,tr:e};for(const i of this.applyStateHandlers)i(o);this.options.applyState(o)}}}}extractExtensionPlugins(e){var t,r;if(!(!e.createPlugin&&!e.createExternalPlugins||(t=this.store.managerSettings.exclude)!=null&&t.plugins||(r=e.options.exclude)!=null&&r.plugins)){if(e.createPlugin){const o=new ka(e.name);this.pluginKeys[e.name]=o;const i=this.getPluginStateCreator(o);e.pluginKey=o,e.getPluginState=i,this.stateGetters.set(e.name,i),this.stateGetters.set(e.constructor,i);const s={...e.createPlugin(),key:o},a=new Ro(s);this.updatePlugins([a],e.plugin?[e.plugin]:void 0),e.plugin=a}if(e.createExternalPlugins){const o=e.createExternalPlugins();this.updatePlugins(o,e.externalPlugins),e.externalPlugins=o}}}updatePlugins(e,t){if(!t||Mo(t)){this.plugins=[...this.plugins,...e];return}if(e.length!==t.length){this.plugins=[...this.plugins.filter(n=>!t.includes(n)),...e];return}const r=new Map;for(const[n,o]of e.entries())r.set(it(t,n),o);this.plugins=this.plugins.map(n=>t.includes(n)?r.get(n):n)}updateExtensionStore(){const{setExtensionStore:e}=this.store;e("updatePlugins",this.updatePlugins.bind(this)),e("dispatchPluginUpdate",this.dispatchPluginUpdate.bind(this)),e("updateExtensionPlugins",this.updateExtensionPlugins.bind(this))}updateExtensionPlugins(e){const t=G5(e)?e:OL(e)?this.store.manager.getExtension(e):this.store.extensions.find(r=>r.name===e);te(t,{code:H.INVALID_MANAGER_EXTENSION,message:`The extension ${e} does not exist within the editor.`}),this.extractExtensionPlugins(t),this.store.setStoreKey("plugins",this.plugins),this.dispatchPluginUpdate()}dispatchPluginUpdate(){te(this.store.phase>=Nr.EditorView,{code:H.MANAGER_PHASE_ERROR,message:"`dispatchPluginUpdate` should only be called after the view has been added to the manager."});const{view:e,updateState:t}=this.store,r=e.state.reconfigure({plugins:this.plugins});t(r)}};Rp=Z([me({defaultPriority:Ae.Highest,handlerKeys:["applyState","appendTransaction"]})],Rp);var W1=class extends Ve{constructor(){super(...arguments),this.dynamicAttributes={marks:ee(),nodes:ee()}}get name(){return"schema"}onCreate(){const{managerSettings:e,tags:t,markNames:r,nodeNames:n,extensions:o}=this.store,{defaultBlockNode:i,disableExtraAttributes:s,nodeOverride:a,markOverride:l}=e,c=h=>!!(h&&t[oe.Block].includes(h));if(e.schema){const{nodes:h,marks:m}=XL(e.schema);this.addSchema(e.schema,h,m);return}const u=c(i)?{doc:ee(),[i]:ee()}:ee(),d=ee(),f=UL({settings:e,gatheredSchemaAttributes:this.gatherExtraAttributes(o),nodeNames:n,markNames:r,tags:t});for(const h of o){f[h.name]={...f[h.name],...h.options.extraAttributes};const m=s===!0||h.options.disableExtraAttributes===!0||h.constructor.disableExtraAttributes===!0;if($d(h)){const{spec:b,dynamic:v}=f2({createExtensionSpec:(g,y)=>h.createNodeSpec(g,y),extraAttributes:it(f,h.name),override:{...a,...h.options.nodeOverride},ignoreExtraAttributes:m,name:h.constructorName,tags:h.tags});h.spec=b,u[h.name]=b,Object.keys(v).length>0&&(this.dynamicAttributes.nodes[h.name]=v)}if(Vh(h)){const{spec:b,dynamic:v}=f2({createExtensionSpec:(g,y)=>h.createMarkSpec(g,y),extraAttributes:it(f,h.name),override:{...l,...h.options.markOverride},ignoreExtraAttributes:m,name:h.constructorName,tags:h.tags??[]});h.spec=b,d[h.name]=b,Object.keys(v).length>0&&(this.dynamicAttributes.marks[h.name]=v)}}const p=new MA({nodes:u,marks:d,topNode:"doc"});this.addSchema(p,u,d)}createPlugin(){return{appendTransaction:(e,t,r)=>{const{tr:n}=r;return!e.some(i=>i.docChanged)||Object.keys(this.dynamicAttributes.nodes).length===0&&Object.keys(this.dynamicAttributes.marks).length===0?null:(n.doc.descendants((i,s)=>(this.checkAndUpdateDynamicNodes(i,s,n),this.checkAndUpdateDynamicMarks(i,s,n),!0)),n.steps.length>0?n:null)}}}addSchema(e,t,r){this.store.setStoreKey("nodes",t),this.store.setStoreKey("marks",r),this.store.setStoreKey("schema",e),this.store.setExtensionStore("schema",e),this.store.setStoreKey("defaultBlockNode",Ih(e).name);for(const n of Object.values(e.nodes))if(n.name!=="doc"&&(n.isBlock||n.isTextblock))break}checkAndUpdateDynamicNodes(e,t,r){for(const[n,o]of At(this.dynamicAttributes.nodes))if(e.type.name===n)for(const[i,s]of At(o)){if(!Zi(e.attrs[i]))continue;const a={...e.attrs,[i]:s(e)};r.setNodeMarkup(t,void 0,a),n2(r)}}checkAndUpdateDynamicMarks(e,t,r){for(const[n,o]of At(this.dynamicAttributes.marks)){const i=it(this.store.schema.marks,n),s=e.marks.find(a=>a.type.name===n);if(s)for(const[a,l]of At(o)){if(!Zi(s.attrs[a]))continue;const c=_o(r.doc.resolve(t),i);if(!c)continue;const{from:u,to:d}=c,f=i.create({...s.attrs,[a]:l(s)});r.removeMark(u,d,i).addMark(u,d,f),n2(r)}}}gatherExtraAttributes(e){const t=[];for(const r of e)r.createSchemaAttributes&&t.push(...r.createSchemaAttributes());return t}};W1=Z([me({defaultPriority:Ae.Highest})],W1);function UL(e){const{settings:t,gatheredSchemaAttributes:r,nodeNames:n,markNames:o,tags:i}=e,s=ee();if(t.disableExtraAttributes)return s;const a=[...r,...t.extraAttributes??[]];for(const l of a??[]){const c=KL({identifiers:l.identifiers,nodeNames:n,markNames:o,tags:i});for(const u of c){const d=s[u]??{};s[u]={...d,...l.attributes}}}return s}function WL(e){return hs(e)&&ct(e.tags)}function KL(e){const{identifiers:t,nodeNames:r,markNames:n,tags:o}=e;if(t==="nodes")return r;if(t==="marks")return n;if(t==="all")return[...r,...n];if(ct(t))return t;te(WL(t),{code:H.EXTENSION_EXTRA_ATTRIBUTES,message:"Invalid value passed as an identifier when creating `extraAttributes`."});const{tags:i=[],names:s=[],behavior:a="any",excludeNames:l,excludeTags:c,type:u}=t,d=new Set,f=u==="mark"?n:u==="node"?r:[...n,...r],p=m=>f.includes(m)&&!(l!=null&&l.includes(m));for(const m of s)p(m)&&d.add(m);const h=new Map;for(const m of i)if(!(c!=null&&c.includes(m)))for(const b of o[m]){if(!p(b))continue;if(a==="any"){d.add(b);continue}const v=h.get(b)??new Set;v.add(m),h.set(b,v)}for(const[m,b]of h)b.size===i.length&&d.add(m);return[...d]}function f2(e){var t;const{createExtensionSpec:r,extraAttributes:n,ignoreExtraAttributes:o,name:i,tags:s,override:a}=e,l=ee();function c(b,v){l[b]=v}let u=!1;function d(){u=!0}const f=qL(n,o,d,c),p=GL(n,o),h=YL(n,o),m=r({defaults:f,parse:p,dom:h},a);return te(o||u,{code:H.EXTENSION_SPEC,message:`When creating a node specification you must call the 'defaults', and parse, and 'dom' methods. To avoid this error you can set the static property 'disableExtraAttributes' of '${i}' to 'true'.`}),m.group=[...((t=m.group)==null?void 0:t.split(" "))??[],...s].join(" ")||void 0,{spec:m,dynamic:l}}function Gv(e){return ne(e)||_e(e)?{default:e}:(te(e,{message:`${F4(e)} is not supported`,code:H.EXTENSION_EXTRA_ATTRIBUTES}),e)}function qL(e,t,r,n){return()=>{r();const o=ee();if(t)return o;for(const[i,s]of At(e)){let l=Gv(s).default;_e(l)&&(n(i,l),l=null),o[i]=l===void 0?{}:{default:l}}return o}}function GL(e,t){return r=>{const n=ee();if(t)return n;for(const[o,i]of At(e)){const{parseDOM:s,...a}=Gv(i);if(Je(r)){if(Zi(s)){n[o]=r.getAttribute(o)??a.default;continue}if(_e(s)){n[o]=s(r)??a.default;continue}n[o]=r.getAttribute(s)??a.default}}return n}}function YL(e,t){return r=>{const n=ee();if(t)return n;function o(i,s){if(i){if(ne(i)){n[s]=i;return}if(ct(i)){const[a,l]=i;n[a]=l??r.attrs[s];return}for(const[a,l]of At(i))n[a]=l}}for(const[i,s]of At(e)){const{toDOM:a,parseDOM:l}=Gv(s);if(Zi(a)){const c=ne(l)?l:i;n[c]=r.attrs[i];continue}if(_e(a)){o(a(r.attrs,JL(r)),i);continue}o(a,i)}return n}}function JL(e){return Ld(e)?{node:e}:sz(e)?{mark:e}:{}}function XL(e){const t=ee(),r=ee();for(const[n,o]of Object.entries(e.nodes))t[n]=o.spec;for(const[n,o]of Object.entries(e.marks))r[n]=o.spec;return{nodes:t,marks:r}}var Ll=class extends Ve{constructor(){super(...arguments),this.onAddCustomHandler=({suggester:e})=>{var t;if(!(!e||(t=this.store.managerSettings.exclude)!=null&&t.suggesters))return r2(this.store.getState(),e)}}get name(){return"suggest"}onCreate(){this.store.setExtensionStore("addSuggester",e=>r2(this.store.getState(),e)),this.store.setExtensionStore("removeSuggester",e=>H6(this.store.getState(),e))}createExternalPlugins(){var e,t;const r=[];for(const n of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.suggesters)break;if(!n.createSuggesters||(t=n.options.exclude)!=null&&t.suggesters)continue;const o=n.createSuggesters(),i=ct(o)?o:[o];r.push(...i)}return[B6(...r)]}getSuggestState(e){return $v(e??this.store.getState())}getSuggestMethods(){const{addIgnored:e,clearIgnored:t,removeIgnored:r,ignoreNextExit:n,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}=this.getSuggestState();return{addIgnored:e,clearIgnored:t,removeIgnored:r,ignoreNextExit:n,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}}isSuggesterActive(e){var t;return dr(ct(e)?e:[e],(t=this.getSuggestState().match)==null?void 0:t.suggester.name)}};Z([He()],Ll.prototype,"getSuggestState",1);Z([He()],Ll.prototype,"getSuggestMethods",1);Z([He()],Ll.prototype,"isSuggesterActive",1);Ll=Z([me({customHandlerKeys:["suggester"]})],Ll);var K1=class extends Ve{constructor(){super(...arguments),this.allTags=ee(),this.plainTags=ee(),this.markTags=ee(),this.nodeTags=ee()}get name(){return"tags"}onCreate(){this.resetTags();for(const e of this.store.extensions)this.updateTagForExtension(e);this.store.setStoreKey("tags",this.allTags),this.store.setExtensionStore("tags",this.allTags),this.store.setStoreKey("plainTags",this.plainTags),this.store.setExtensionStore("plainTags",this.plainTags),this.store.setStoreKey("markTags",this.markTags),this.store.setExtensionStore("markTags",this.markTags),this.store.setStoreKey("nodeTags",this.nodeTags),this.store.setExtensionStore("nodeTags",this.nodeTags)}resetTags(){const e=ee(),t=ee(),r=ee(),n=ee();for(const o of Th(oe))e[o]=[],t[o]=[],r[o]=[],n[o]=[];this.allTags=e,this.plainTags=t,this.markTags=r,this.nodeTags=n}updateTagForExtension(e){var t,r;const n=new Set([...e.tags??[],...((t=e.createTags)==null?void 0:t.call(e))??[],...e.options.extraTags??[],...((r=this.store.managerSettings.extraTags)==null?void 0:r[e.name])??[]]);for(const o of n)te(QL(o),{code:H.EXTENSION,message:`The tag provided by the extension: ${e.constructorName} is not supported by the editor. To add custom tags you can use the 'mutateTag' method.`}),this.allTags[o].push(e.name),Y5(e)&&this.plainTags[o].push(e.name),Vh(e)&&this.markTags[o].push(e.name),$d(e)&&this.nodeTags[o].push(e.name);e.tags=[...n]}};K1=Z([me({defaultPriority:Ae.Highest})],K1);function QL(e){return dr(Th(oe),e)}var ZL=new ka("remirrorFilePlaceholderPlugin");function eI(){const e=new Ro({key:ZL,state:{init(){return{set:Ee.empty,payloads:new Map}},apply(t,{set:r,payloads:n}){r=r.map(t.mapping,t.doc);const o=t.getMeta(e);if(o)if(o.type===0){const i=document.createElement("placeholder"),s=Ge.widget(o.pos,i,{id:o.id});r=r.add(t.doc,[s]),n.set(o.id,o.payload)}else o.type===1&&(r=r.remove(r.find(void 0,void 0,i=>i.id===o.id)),n.delete(o.id));return{set:r,payloads:n}}},props:{decorations(t){var r;return((r=e.getState(t))==null?void 0:r.set)??null}}});return e}var tI=class extends Ve{get name(){return"upload"}createExternalPlugins(){return[eI()]}};function rI(e={}){e={...{exitMarksOnArrowPress:Qn.defaultOptions.exitMarksOnArrowPress,excludeBaseKeymap:Qn.defaultOptions.excludeBaseKeymap,selectParentNodeOnEscape:Qn.defaultOptions.selectParentNodeOnEscape,undoInputRuleOnBackspace:Qn.defaultOptions.undoInputRuleOnBackspace,persistentSelectionClass:io.defaultOptions.persistentSelectionClass},...e};const r=b1(e,["excludeBaseKeymap","selectParentNodeOnEscape","undoInputRuleOnBackspace"]),n=b1(e,["persistentSelectionClass"]);return[new K1,new W1,new _L,new Rp,new j1,new jL,new VL,new Ll,new xe,new An,new Qn(r),new V1,new tI,new io(n)]}var p2=class extends Ve{get name(){return"meta"}onCreate(){if(this.store.setStoreKey("getCommandMeta",this.getCommandMeta.bind(this)),!!this.options.capture)for(const e of this.store.extensions)this.captureCommands(e),this.captureKeybindings(e)}createPlugin(){return{}}captureCommands(e){const t=e.decoratedCommands??{},r=e.createCommands;for(const n of Object.keys(t)){const o=e[n];e[n]=(...i)=>s=>{var a;const l=o(...i)(s);return s.dispatch&&l&&this.setCommandMeta(s.tr,{type:"command",chain:s.dispatch!==((a=s.view)==null?void 0:a.dispatch),name:n,extension:e.name,decorated:!0}),l}}r&&(e.createCommands=()=>{const n=r();for(const[o,i]of Object.entries(n))n[o]=(...s)=>a=>{var l;const c=i(...s)(a);return a.dispatch&&c&&this.setCommandMeta(a.tr,{type:"command",chain:a.dispatch!==((l=a.view)==null?void 0:l.dispatch),name:o,extension:e.name,decorated:!1}),c};return n})}captureKeybindings(e){}getCommandMeta(e){return e.getMeta(this.pluginKey)??[]}setCommandMeta(e,t){const r=this.getCommandMeta(e);e.setMeta(this.pluginKey,[...r,t])}};p2=Z([me({defaultOptions:{capture:nn.isDevelopment},staticKeys:["capture"],defaultPriority:Ae.Highest})],p2);var Hf,Dc,Bf,Wa,Ei,Ff,Vf,nI=class{constructor(e){kt(this,Hf,Cl()),kt(this,Dc,void 0),kt(this,Bf,void 0),kt(this,Wa,!0),kt(this,Ei,Bh()),kt(this,Ff,void 0),kt(this,Vf,void 0),this.getState=()=>this.view.state??this.initialEditorState,this.getPreviousState=()=>this.previousState,this.dispatchTransaction=i=>{var s,a;te(!this.manager.destroyed,{code:H.MANAGER_PHASE_ERROR,message:"A transaction was dispatched to a manager that has already been destroyed. Please check your set up, or open an issue."}),i=((a=(s=this.props).onDispatchTransaction)==null?void 0:a.call(s,i,this.getState()))??i;const l=this.getState(),{state:c,transactions:u}=l.applyTransaction(i);Lt(this,Bf,l),this.updateState({state:c,tr:i,transactions:u});const d=this.manager.store.getForcedUpdates(i);Mo(d)||this.updateViewProps(...d)},this.onChange=(i=ee())=>{var s,a;const l=this.eventListenerProps(i);G(this,Wa)&&Lt(this,Wa,!1),(a=(s=this.props).onChange)==null||a.call(s,l)},this.onBlur=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onBlur)==null||a.call(s,l,i),G(this,Ei).emit("blur",l,i)},this.onFocus=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onFocus)==null||a.call(s,l,i),G(this,Ei).emit("focus",l,i)},this.setContent=(i,{triggerChange:s=!1}={})=>{const{doc:a}=this.manager.createState({content:i}),l=this.getState(),{state:c}=this.getState().applyTransaction(l.tr.replaceRangeWith(0,l.doc.nodeSize-2,a));if(s)return this.updateState({state:c,triggerChange:s});this.view.updateState(c)},this.clearContent=({triggerChange:i=!1}={})=>{this.setContent(this.manager.createEmptyDoc(),{triggerChange:i})},this.createStateFromContent=(i,s)=>this.manager.createState({content:i,selection:s}),this.focus=i=>{this.manager.store.commands.focus(i)},this.blur=i=>{this.manager.store.commands.blur(i)};const{getProps:t,initialEditorState:r,element:n}=e;if(Lt(this,Dc,t),Lt(this,Vf,r),this.manager.attachFramework(this,this.updateListener.bind(this)),this.manager.view)return;const o=this.createView(r,n);this.manager.addView(o)}get addHandler(){return G(this,Ff)??Lt(this,Ff,G(this,Ei).on.bind(G(this,Ei)))}get updatableViewProps(){return{attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0}}get firstRender(){return G(this,Wa)}get props(){return G(this,Dc).call(this)}get previousState(){return this.previousStateOverride??G(this,Bf)??this.initialEditorState}get manager(){return this.props.manager}get view(){return this.manager.view}get uid(){return G(this,Hf)}get initialEditorState(){return G(this,Vf)}updateListener(e){const{state:t,tr:r}=e;return G(this,Ei).emit("updated",this.eventListenerProps({state:t,tr:r}))}update(e){const{getProps:t}=e;return Lt(this,Dc,t),this}updateViewProps(...e){const t=b1(this.updatableViewProps,e);this.view.setProps({...this.view.props,...t})}getAttributes(e){var t;const{attributes:r,autoFocus:n,classNames:o=[],label:i,editable:s}=this.props,a=(t=this.manager.store)==null?void 0:t.attributes,l=_e(r)?r(this.eventListenerProps()):r;let c={};(n||Jt(n))&&(c=e?{autoFocus:!0}:{autofocus:"true"});const u=Ml(Vu(e&&"Prosemirror","remirror-editor",a==null?void 0:a.class,...o).split(" ")).join(" "),d={role:"textbox",...c,"aria-multiline":"true",...s??!0?{}:{"aria-readonly":"true"},"aria-label":i??"",...a,class:u};return j4({...d,...l})}addFocusListeners(){this.view.dom.addEventListener("blur",this.onBlur),this.view.dom.addEventListener("focus",this.onFocus)}removeFocusListeners(){this.view.dom.removeEventListener("blur",this.onBlur),this.view.dom.removeEventListener("focus",this.onFocus)}destroy(){G(this,Ei).emit("destroy"),this.view&&this.removeFocusListeners()}eventListenerProps(e=ee()){const{state:t,tr:r,transactions:n}=e;return{tr:r,transactions:n,internalUpdate:!r,view:this.view,firstRender:G(this,Wa),state:t??this.getState(),createStateFromContent:this.createStateFromContent,previousState:this.previousState,helpers:this.manager.store.helpers}}get baseOutput(){return{manager:this.manager,...this.manager.store,addHandler:this.addHandler,focus:this.focus,blur:this.blur,uid:G(this,Hf),view:this.view,getState:this.getState,getPreviousState:this.getPreviousState,getExtension:this.manager.getExtension.bind(this.manager),hasExtension:this.manager.hasExtension.bind(this.manager),clearContent:this.clearContent,setContent:this.setContent}}};Hf=new WeakMap;Dc=new WeakMap;Bf=new WeakMap;Wa=new WeakMap;Ei=new WeakMap;Ff=new WeakMap;Vf=new WeakMap;function oI(e,t){const r=[],n=new WeakMap,o=[],i=new WeakMap;let s=[];const a={duplicateMap:i,parentExtensions:o,gatheredExtensions:s,settings:t};for(const d of e)X5(a,{extension:d});s=ra(s,(d,f)=>f.priority-d.priority);const l=new WeakSet,c=new Set;for(const d of s){const f=d.constructor,p=d.name,h=i.get(f);te(h,{message:`No entries were found for the ExtensionConstructor ${d.name}`,code:H.INTERNAL}),!(l.has(f)||c.has(p))&&(l.add(f),c.add(p),r.push(d),n.set(f,d),h.forEach(m=>m==null?void 0:m.replaceChildExtension(f,d)))}const u=[];for(const d of r)iI({extension:d,found:l,missing:u});return te(Mo(u),{code:H.MISSING_REQUIRED_EXTENSION,message:u.map(({Constructor:d,extension:f})=>`The extension '${f.name}' requires '${d.name} in order to run correctly.`).join(` -`)}),{extensions:r,extensionMap:n}}function X5(e,t){var r;const{gatheredExtensions:n,duplicateMap:o,parentExtensions:i,settings:s}=e,{extension:a,parentExtension:l}=t;let{names:c=[]}=t;te(G5(a),{code:H.INVALID_MANAGER_EXTENSION,message:`An invalid extension: ${a} was provided to the [[\`RemirrorManager\`]].`});const u=a.extensions;if(a.setPriority((r=s.priority)==null?void 0:r[a.name]),n.push(a),sI({duplicateMap:o,extension:a,parentExtension:l}),u.length!==0){if(c.includes(a.name)){`${c.join(" > ")}${a.name}`;return}c=[...c,a.name],i.push(a);for(const d of u)X5(e,{names:c,extension:d,parentExtension:a})}}function iI(e){const{extension:t,found:r,missing:n}=e;if(t.requiredExtensions)for(const o of t.requiredExtensions??[])r.has(o)||n.push({Constructor:o,extension:t})}function sI(e){const{duplicateMap:t,extension:r,parentExtension:n}=e,o=r.constructor,i=t.get(o),s=n?[n]:[];t.set(o,i?[...i,...s]:s)}function aI(e){var t,r,n,o;const{extension:i,nodeNames:s,markNames:a,plainNames:l,store:c,handlers:u}=e;i.setStore(c);const d=(t=i.onCreate)==null?void 0:t.bind(i),f=(r=i.onView)==null?void 0:r.bind(i),p=(n=i.onStateUpdate)==null?void 0:n.bind(i),h=(o=i.onDestroy)==null?void 0:o.bind(i);d&&u.create.push(d),f&&u.view.push(f),p&&u.update.push(p),h&&u.destroy.push(h),Vh(i)&&a.push(i.name),$d(i)&&i.name!=="doc"&&s.push(i.name),Y5(i)&&l.push(i.name)}var Ci,$c,Un,$o,Hc,Qr,Cs,Bc,Ms,Fc,Ts,Wn,Vc,jf=class{constructor(e,t={}){kt(this,Ci,void 0),kt(this,$c,ee()),kt(this,Un,ee()),kt(this,$o,void 0),kt(this,Hc,void 0),kt(this,Qr,Nr.None),kt(this,Cs,void 0),kt(this,Bc,!0),kt(this,Ms,{create:[],view:[],update:[],destroy:[]}),kt(this,Fc,[]),kt(this,Ts,Bh()),kt(this,Wn,void 0),kt(this,Vc,void 0),this.getState=()=>{var o;return G(this,Qr)>=Nr.EditorView?this.view.state:(te(G(this,Wn),{code:H.MANAGER_PHASE_ERROR,message:"`getState` can only be called after the `Framework` or the `EditorView` has been added to the manager`. Check your plugins to make sure that the decorations callback uses the state argument."}),(o=G(this,Wn))==null?void 0:o.initialEditorState)},this.updateState=o=>{const i=this.getState();this.view.updateState(o),this.onStateUpdate({previousState:i,state:o})};const{extensions:r,extensionMap:n}=oI(e,t);Lt(this,Cs,t),Lt(this,$o,Hs(r)),Lt(this,Hc,n),Lt(this,Ci,this.createExtensionStore()),Lt(this,Qr,Nr.Create),this.setupLifecycleHandlers();for(const o of G(this,Ms).create){const i=o();i&&G(this,Fc).push(i)}}static create(e,t={}){return new jf([...J4(e),...rI(t.builtin)],t)}get[ti](){return $t.Manager}get destroyed(){return G(this,Qr)===Nr.Destroy}get mounted(){return G(this,Qr)>=Nr.EditorView&&G(this,Qr)G(this,$o),enumerable:t},phase:{get:()=>G(this,Qr),enumerable:t},view:{get:()=>this.view,enumerable:t},managerSettings:{get:()=>Hs(G(this,Cs)),enumerable:t},getState:{value:this.getState,enumerable:t},updateState:{value:this.updateState,enumerable:t},isMounted:{value:()=>this.mounted,enumerable:t},getExtension:{value:this.getExtension.bind(this),enumerable:t},manager:{get:()=>this,enumerable:t},document:{get:()=>this.document,enumerable:t},stringHandlers:{get:()=>G(this,$c),enumerable:t},currentState:{get:()=>r??(r=this.getState()),set:o=>{r=o},enumerable:t},previousState:{get:()=>n,set:o=>{n=o},enumerable:t}}),e.getStoreKey=this.getStoreKey.bind(this),e.setStoreKey=this.setStoreKey.bind(this),e.setExtensionStore=this.setExtensionStore.bind(this),e.setStringHandler=this.setStringHandler.bind(this),e}addView(e){if(G(this,Qr)>=Nr.EditorView)return this;Lt(this,Bc,!0),Lt(this,Qr,Nr.EditorView),G(this,Un).view=e;for(const t of G(this,Ms).view){const r=t(e);r&&G(this,Fc).push(r)}return this}attachFramework(e,t){var r;G(this,Wn)!==e&&(G(this,Wn)&&(G(this,Wn).destroy(),(r=G(this,Vc))==null||r.call(this)),Lt(this,Wn,e),Lt(this,Vc,this.addHandler("stateUpdate",t)))}createEmptyDoc(){var e;const t=(e=this.schema.nodes.doc)==null?void 0:e.createAndFill();return te(t,{code:H.INVALID_CONTENT,message:"An empty node could not be created due to an invalid schema."}),t}createState(e={}){const{onError:t,defaultSelection:r="end"}=this.settings,{content:n=this.createEmptyDoc(),selection:o=r,stringHandler:i=this.settings.stringHandler}=e,{schema:s,plugins:a}=this.store,l=M5({stringHandler:ne(i)?this.stringHandlers[i]:i,document:this.document,content:n,onError:t,schema:s,selection:o});return Bs.create({schema:s,doc:l,plugins:a,selection:jr(o,l)})}addHandler(e,t){return G(this,Ts).on(e,t)}onStateUpdate(e){const t=G(this,Bc);G(this,Ci).currentState=e.state,G(this,Ci).previousState=e.previousState,t&&(Lt(this,Qr,Nr.Runtime),Lt(this,Bc,!1));const r={...e,firstUpdate:t};for(const n of G(this,Ms).update)n(r);G(this,Ts).emit("stateUpdate",r)}getExtension(e){const t=G(this,Hc).get(e);return te(t,{code:H.INVALID_MANAGER_EXTENSION,message:`'${e.name}' doesn't exist within this manager. Make sure it is properly added before attempting to use it.`}),t}hasExtension(e){return!!G(this,Hc).get(e)}clone(){const e=G(this,$o).map(r=>r.clone(r.options)),t=jf.create(()=>e,G(this,Cs));return G(this,Ts).emit("clone",t),t}recreate(e=[],t={}){const r=G(this,$o).map(o=>o.clone(o.initialOptions)),n=jf.create(()=>[...r,...e],t);return G(this,Ts).emit("recreate",n),n}destroy(){var e,t,r,n,o,i;Lt(this,Qr,Nr.Destroy);for(const s of((e=this.view)==null?void 0:e.state.plugins)??[])(r=(t=s.getState(this.view.state))==null?void 0:t.destroy)==null||r.call(t);(n=G(this,Wn))==null||n.destroy(),(o=G(this,Vc))==null||o.call(this);for(const s of G(this,Fc))s();for(const s of G(this,Ms).destroy)s();(i=this.view)==null||i.destroy(),G(this,Ts).emit("destroy")}includes(e){const t=[],r=[];for(const n of G(this,$o))t.push(n.name,n.constructorName),r.push(n.constructor);return e.every(n=>ne(n)?dr(t,n):dr(r,n))}},lI=jf;Ci=new WeakMap;$c=new WeakMap;Un=new WeakMap;$o=new WeakMap;Hc=new WeakMap;Qr=new WeakMap;Cs=new WeakMap;Bc=new WeakMap;Ms=new WeakMap;Fc=new WeakMap;Ts=new WeakMap;Wn=new WeakMap;Vc=new WeakMap;function cI(e,t){return!nc(e)||!oc(e,$t.Manager)?!1:t?e.includes(t):!0}var uI=Object.defineProperty,dI=Object.getOwnPropertyDescriptor,Hd=(e,t,r,n)=>{for(var o=n>1?void 0:n?dI(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&uI(t,r,o),o},Q5=/\S+/g;function Z5(e){return e.type.isTextblock?1:e.type.isText?e.textBetween(0,e.nodeSize).length:0}function fI({doc:e},t){let r=0,n=0;return e.nodesBetween(0,e.nodeSize-2,(o,i)=>{if(n>0)return!1;const s=Z5(o);return r+s>t?(n=i+1+(t-r),!1):(r+=s,!0)}),n}function pI({doc:e},t){let r=0,n=0;return e.nodesBetween(0,e.nodeSize-2,(o,i)=>{if(n>0)return!1;if(!o.type.isText)return!0;const s=o.textBetween(0,o.nodeSize),a=xa(s,Q5);if(r+a.length>t){const l=t-r,c=a[l];return n=i+((c==null?void 0:c.index)??0),!1}return r+=a.length,!0}),n}var is=class extends Ve{get name(){return"count"}getCountMaximum(){return this.options.maximum}getCharacterCount(e=this.store.getState()){let t=0;return e.doc.nodesBetween(0,e.doc.nodeSize-2,r=>(t+=Z5(r),!0)),Math.max(t-1,0)}getWordCount(e=this.store.getState()){const t=this.store.helpers.getText({lineBreakDivider:" ",state:e});return xa(t,Q5).length}isCountValid(e=this.store.getState()){const{maximumStrategy:t,maximum:r}=this.options;return r<1?!0:t==="CHARACTERS"?this.store.helpers.getCharacterCount(e)<=r:this.store.helpers.getWordCount(e)<=r}createDecorationSet(e){const{maximum:t=-1,maximumStrategy:r,maximumExceededClassName:n}=this.options,s=(r==="CHARACTERS"?fI:pI)(e,t);return Ee.create(e.doc,[Ge.inline(s,e.doc.nodeSize-2,{class:n})])}createExternalPlugins(){const{maximum:e}=this.options,t=new Ro({state:{init:(r,n)=>this.isCountValid(n)?{decorationSet:Ee.empty}:{decorationSet:this.createDecorationSet(n)},apply:(r,n,o,i)=>!r.docChanged||e<1?n:this.isCountValid(i)?{decorationSet:Ee.empty}:{decorationSet:this.createDecorationSet(i)}},props:{decorations(r){var n;return((n=t.getState(r))==null?void 0:n.decorationSet)??null}}});return[t]}};Hd([He()],is.prototype,"getCountMaximum",1);Hd([He()],is.prototype,"getCharacterCount",1);Hd([He()],is.prototype,"getWordCount",1);Hd([He()],is.prototype,"isCountValid",1);is=Hd([me({defaultOptions:{maximum:-1,maximumExceededClassName:"remirror-max-count-exceeded",maximumStrategy:"CHARACTERS"},staticKeys:["maximum","maximumStrategy","maximumExceededClassName"]})],is);var eC={exports:{}},pn={},tC={exports:{}},rC={};/** +`,zi)}getHTML(e=this.store.getState()){return _z(e.doc,this.store.document)}textToProsemirrorNode(e){const t=`
${e.content}
`;return this.store.stringHandlers.html({...e,content:t})}};Z([He()],Rn.prototype,"isSelectionEmpty",1);Z([He()],Rn.prototype,"isViewEditable",1);Z([He()],Rn.prototype,"getStateJSON",1);Z([He()],Rn.prototype,"getJSON",1);Z([He()],Rn.prototype,"getRemirrorJSON",1);Z([U()],Rn.prototype,"insertHtml",1);Z([He()],Rn.prototype,"getText",1);Z([He()],Rn.prototype,"getTextBetween",1);Z([He()],Rn.prototype,"getHTML",1);Rn=Z([pe({})],Rn);var K1=class extends Ve{get name(){return"inputRules"}onCreate(){this.store.setExtensionStore("rebuildInputRules",this.rebuildInputRules.bind(this))}createExternalPlugins(){return[this.generateInputRulesPlugin()]}generateInputRulesPlugin(){var e,t;const r=[],n=this.store.markTags[oe.ExcludeInputRules];for(const o of this.store.extensions)if(!((e=this.store.managerSettings.exclude)!=null&&e.inputRules||!o.createInputRules||(t=o.options.exclude)!=null&&t.inputRules))for(const i of o.createInputRules())i.shouldSkip=this.options.shouldSkipInputRule,i.invalidMarks=n,r.push(i);return VR({rules:r})}rebuildInputRules(){this.store.updateExtensionPlugins(this)}};K1=Z([pe({defaultPriority:Ae.Default,handlerKeys:["shouldSkipInputRule"],handlerKeyOptions:{shouldSkipInputRule:{earlyReturnValue:!0}}})],K1);var Qn=class extends Ve{constructor(){super(...arguments),this.extraKeyBindings=[],this.backwardMarkExitTracker=new Map,this.keydownHandler=null,this.onAddCustomHandler=({keymap:e})=>{var t,r;if(e)return this.extraKeyBindings=[...this.extraKeyBindings,e],(r=(t=this.store).rebuildKeymap)==null||r.call(t),()=>{var n,o;this.extraKeyBindings=this.extraKeyBindings.filter(i=>i!==e),(o=(n=this.store).rebuildKeymap)==null||o.call(n)}},this.rebuildKeymap=()=>{this.setupKeydownHandler()}}get name(){return"keymap"}get shortcutMap(){const{shortcuts:e}=this.options;return ne(e)?GL[e]:e}onCreate(){this.store.setExtensionStore("rebuildKeymap",this.rebuildKeymap)}createExternalPlugins(){var e;return(e=this.store.managerSettings.exclude)!=null&&e.keymap?[]:(this.setupKeydownHandler(),[new Ro({props:{handleKeyDown:(t,r)=>{var n;return(n=this.keydownHandler)==null?void 0:n.call(this,t,r)}}})])}setupKeydownHandler(){const e=this.generateKeymapBindings();this.keydownHandler=Jv(e)}generateKeymapBindings(){var e;const t=[],r=this.shortcutMap,n=this.store.getExtension(xe),o=a=>l=>Bf({shortcut:l,map:r,store:this.store,options:a.options});for(const a of this.store.extensions){const l=a.decoratedKeybindings??{};if(!((e=a.options.exclude)!=null&&e.keymap)){a.createKeymap&&t.push(KL(a.createKeymap(o(a)),r));for(const[c,u]of At(l)){if(u.isActive&&!u.isActive(a.options,this.store))continue;const d=a[c].bind(a),f=Bf({shortcut:u.shortcut,map:r,options:a.options,store:this.store}),p=_e(u.priority)?u.priority(a.options,this.store):u.priority??Ae.Low,h=ee();for(const m of f)h[m]=d;t.push([p,h]),u.command&&n.updateDecorated(u.command,{shortcut:f})}}}const i=this.sortKeymaps([...this.extraKeyBindings,...t]);return az(i)}arrowRightShortcut(e){const t=this.store.markTags[oe.PreventExits],r=this.store.nodeTags[oe.PreventExits];return this.exitMarkForwards(t,r)(e)}arrowLeftShortcut(e){const t=this.store.markTags[oe.PreventExits],r=this.store.nodeTags[oe.PreventExits];return Np(this.exitNodeBackwards(r),this.exitMarkBackwards(t,r))(e)}backspace(e){const t=this.store.markTags[oe.PreventExits],r=this.store.nodeTags[oe.PreventExits];return Np(this.exitNodeBackwards(r,!0),this.exitMarkBackwards(t,r,!0))(e)}createKeymap(){const{selectParentNodeOnEscape:e,undoInputRuleOnBackspace:t,excludeBaseKeymap:r}=this.options,n=ee();if(!r)for(const[o,i]of At(kg))n[o]=bu(i);return t&&kg.Backspace&&(n.Backspace=bu(Vh(jR,kg.Backspace))),e&&(n.Escape=bu(rL)),[Ae.Low,n]}getNamedShortcut(e,t={}){return e.startsWith("_|")?Bf({shortcut:e,map:this.shortcutMap,store:this.store,options:t}):[e]}onSetOptions(e){var t,r;const{changes:n}=e;(n.excludeBaseKeymap.changed||n.selectParentNodeOnEscape.changed||n.undoInputRuleOnBackspace.changed)&&((r=(t=this.store).rebuildKeymap)==null||r.call(t))}sortKeymaps(e){return ra(e.map(t=>ct(t)?t:[Ae.Default,t]),(t,r)=>r[0]-t[0]).map(t=>t[1])}exitMarkForwards(e,t){return r=>{const{tr:n,dispatch:o}=r;if(!Rz(n.selection)||ts({selection:n.selection,types:t}))return!1;const a=n.selection.$from.marks().filter(l=>!e.includes(l.type.name));if(Mo(a))return!1;if(!o)return!0;for(const l of a)n.removeStoredMark(l);return o(n.insertText(" ",n.selection.from)),!0}}exitNodeBackwards(e,t=!1){return r=>{const{tr:n}=r;if(!(t?u2:U1)(n.selection))return!1;const i=n.selection.$anchor.node();return!Bh(i)||vz(i)||e.includes(i.type.name)?!1:this.store.commands.toggleBlockNodeItem.original({type:i.type})(r)}}exitMarkBackwards(e,t,r=!1){return n=>{const{tr:o,dispatch:i}=n;if(!(r?u2:U1)(o.selection)||this.backwardMarkExitTracker.has(o.selection.anchor))return this.backwardMarkExitTracker.clear(),!1;if(ts({selection:o.selection,types:t}))return!1;const l=[...o.storedMarks??[],...o.selection.$from.marks()].filter(c=>!e.includes(c.type.name));if(Mo(l))return!1;if(!i)return!0;for(const c of l)o.removeStoredMark(c);return this.backwardMarkExitTracker.set(o.selection.anchor,!0),i(o),!0}}};Z([je({shortcut:"ArrowRight",isActive:e=>e.exitMarksOnArrowPress})],Qn.prototype,"arrowRightShortcut",1);Z([je({shortcut:"ArrowLeft",isActive:e=>e.exitMarksOnArrowPress})],Qn.prototype,"arrowLeftShortcut",1);Z([je({shortcut:"Backspace",isActive:e=>e.exitMarksOnArrowPress})],Qn.prototype,"backspace",1);Z([He()],Qn.prototype,"getNamedShortcut",1);Qn=Z([pe({defaultPriority:Ae.Low,defaultOptions:{shortcuts:"default",undoInputRuleOnBackspace:!0,selectParentNodeOnEscape:!1,excludeBaseKeymap:!1,exitMarksOnArrowPress:!0},customHandlerKeys:["keymap"]})],Qn);function WL(e){return fr(Ah(D),e)}function Bf({shortcut:e,map:t,options:r,store:n}){return ne(e)?[q1(e,t)]:ct(e)?e.map(o=>q1(o,t)):(e=e(r,n),Bf({shortcut:e,map:t,options:r,store:n}))}function q1(e,t){return WL(e)?t[e]:e}function KL(e,t){const r={};let n,o;ct(e)?[o,n]=e:n=e;for(const[i,s]of At(n))r[q1(i,t)]=s;return Nh(o)?r:[o,r]}var e5={[D.Copy]:"Mod-c",[D.Cut]:"Mod-x",[D.Paste]:"Mod-v",[D.PastePlain]:"Mod-Shift-v",[D.SelectAll]:"Mod-a",[D.Undo]:"Mod-z",[D.Redo]:on.isMac?"Shift-Mod-z":"Mod-y",[D.Bold]:"Mod-b",[D.Italic]:"Mod-i",[D.Underline]:"Mod-u",[D.Strike]:"Mod-d",[D.Code]:"Mod-`",[D.Paragraph]:"Mod-Shift-0",[D.H1]:"Mod-Shift-1",[D.H2]:"Mod-Shift-2",[D.H3]:"Mod-Shift-3",[D.H4]:"Mod-Shift-4",[D.H5]:"Mod-Shift-5",[D.H6]:"Mod-Shift-6",[D.TaskList]:"Mod-Shift-7",[D.BulletList]:"Mod-Shift-8",[D.OrderedList]:"Mod-Shift-9",[D.Quote]:"Mod->",[D.Divider]:"Mod-Shift-|",[D.Codeblock]:"Mod-Shift-~",[D.ClearFormatting]:"Mod-Shift-C",[D.Superscript]:"Mod-.",[D.Subscript]:"Mod-,",[D.LeftAlignment]:"Mod-Shift-L",[D.CenterAlignment]:"Mod-Shift-E",[D.RightAlignment]:"Mod-Shift-R",[D.JustifyAlignment]:"Mod-Shift-J",[D.InsertLink]:"Mod-k",[D.Find]:"Mod-f",[D.FindBackwards]:"Mod-Shift-f",[D.FindReplace]:"Mod-Shift-H",[D.AddFootnote]:"Mod-Alt-f",[D.AddComment]:"Mod-Alt-m",[D.ContextMenu]:"Mod-Shift-\\",[D.IncreaseFontSize]:"Mod-Shift-.",[D.DecreaseFontSize]:"Mod-Shift-,",[D.IncreaseIndent]:"Tab",[D.DecreaseIndent]:"Shift-Tab",[D.Shortcuts]:"Mod-/",[D.Format]:on.isMac?"Alt-Shift-f":"Shift-Ctrl-f"},qL={...e5,[D.Strike]:"Mod-Shift-S",[D.Code]:"Mod-Shift-M",[D.Paragraph]:"Mod-Alt-0",[D.H1]:"Mod-Alt-1",[D.H2]:"Mod-Alt-2",[D.H3]:"Mod-Alt-3",[D.H4]:"Mod-Alt-4",[D.H5]:"Mod-Alt-5",[D.H6]:"Mod-Alt-6",[D.OrderedList]:"Mod-Alt-7",[D.BulletList]:"Mod-Alt-8",[D.Quote]:"Mod-Alt-9",[D.ClearFormatting]:"Mod-\\",[D.IncreaseIndent]:"Mod-[",[D.DecreaseIndent]:"Mod-]"},GL={default:e5,googleDoc:qL},YL=class extends Ve{get name(){return"nodeViews"}createPlugin(){const e=[],t=ee();for(const r of this.store.extensions){if(!r.createNodeViews)continue;const n=r.createNodeViews();e.unshift(_e(n)?{[r.name]:n}:n)}e.unshift(this.store.managerSettings.nodeViews??{});for(const r of e)Object.assign(t,r);return{props:{nodeViews:t}}}},JL=class extends Ve{get name(){return"pasteRules"}createExternalPlugins(){return[this.generatePasteRulesPlugin()]}generatePasteRulesPlugin(){var e,t;const r=[];for(const n of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.pasteRules||!n.createPasteRules||(t=n.options.exclude)!=null&&t.pasteRules)continue;const o=n.createPasteRules(),i=ct(o)?o:[o];r.push(...i)}return gL(r)}},zp=class extends Ve{constructor(){super(...arguments),this.plugins=[],this.managerPlugins=[],this.applyStateHandlers=[],this.initStateHandlers=[],this.appendTransactionHandlers=[],this.pluginKeys=ee(),this.stateGetters=new Map,this.getPluginStateCreator=e=>t=>e.getState(t??this.store.getState()),this.getStateByName=e=>{const t=this.stateGetters.get(e);return te(t,{message:"No plugin exists for the requested extension name."}),t()}}get name(){return"plugins"}onCreate(){const{setStoreKey:e,setExtensionStore:t,managerSettings:r,extensions:n}=this.store;this.updateExtensionStore();const{plugins:o=[]}=r;this.updatePlugins(o,this.managerPlugins);for(const i of n)i.onApplyState&&this.applyStateHandlers.push(i.onApplyState.bind(i)),i.onInitState&&this.initStateHandlers.push(i.onInitState.bind(i)),i.onAppendTransaction&&this.appendTransactionHandlers.push(i.onAppendTransaction.bind(i)),this.extractExtensionPlugins(i);this.managerPlugins=o,this.store.setStoreKey("plugins",this.plugins),e("pluginKeys",this.pluginKeys),e("getPluginState",this.getStateByName),t("getPluginState",this.getStateByName)}createPlugin(){return{appendTransaction:(e,t,r)=>{const n=r.tr,o={previousState:t,tr:n,transactions:e,state:r};for(const i of this.appendTransactionHandlers)i(o);return this.options.appendTransaction(o),n.docChanged||n.steps.length>0||n.selectionSet||n.storedMarksSet?n:void 0},state:{init:(e,t)=>{for(const r of this.initStateHandlers)r(t)},apply:(e,t,r,n)=>{const o={previousState:r,state:n,tr:e};for(const i of this.applyStateHandlers)i(o);this.options.applyState(o)}}}}extractExtensionPlugins(e){var t,r;if(!(!e.createPlugin&&!e.createExternalPlugins||(t=this.store.managerSettings.exclude)!=null&&t.plugins||(r=e.options.exclude)!=null&&r.plugins)){if(e.createPlugin){const o=new ka(e.name);this.pluginKeys[e.name]=o;const i=this.getPluginStateCreator(o);e.pluginKey=o,e.getPluginState=i,this.stateGetters.set(e.name,i),this.stateGetters.set(e.constructor,i);const s={...e.createPlugin(),key:o},a=new Ro(s);this.updatePlugins([a],e.plugin?[e.plugin]:void 0),e.plugin=a}if(e.createExternalPlugins){const o=e.createExternalPlugins();this.updatePlugins(o,e.externalPlugins),e.externalPlugins=o}}}updatePlugins(e,t){if(!t||Mo(t)){this.plugins=[...this.plugins,...e];return}if(e.length!==t.length){this.plugins=[...this.plugins.filter(n=>!t.includes(n)),...e];return}const r=new Map;for(const[n,o]of e.entries())r.set(it(t,n),o);this.plugins=this.plugins.map(n=>t.includes(n)?r.get(n):n)}updateExtensionStore(){const{setExtensionStore:e}=this.store;e("updatePlugins",this.updatePlugins.bind(this)),e("dispatchPluginUpdate",this.dispatchPluginUpdate.bind(this)),e("updateExtensionPlugins",this.updateExtensionPlugins.bind(this))}updateExtensionPlugins(e){const t=QC(e)?e:LL(e)?this.store.manager.getExtension(e):this.store.extensions.find(r=>r.name===e);te(t,{code:H.INVALID_MANAGER_EXTENSION,message:`The extension ${e} does not exist within the editor.`}),this.extractExtensionPlugins(t),this.store.setStoreKey("plugins",this.plugins),this.dispatchPluginUpdate()}dispatchPluginUpdate(){te(this.store.phase>=Nr.EditorView,{code:H.MANAGER_PHASE_ERROR,message:"`dispatchPluginUpdate` should only be called after the view has been added to the manager."});const{view:e,updateState:t}=this.store,r=e.state.reconfigure({plugins:this.plugins});t(r)}};zp=Z([pe({defaultPriority:Ae.Highest,handlerKeys:["applyState","appendTransaction"]})],zp);var G1=class extends Ve{constructor(){super(...arguments),this.dynamicAttributes={marks:ee(),nodes:ee()}}get name(){return"schema"}onCreate(){const{managerSettings:e,tags:t,markNames:r,nodeNames:n,extensions:o}=this.store,{defaultBlockNode:i,disableExtraAttributes:s,nodeOverride:a,markOverride:l}=e,c=h=>!!(h&&t[oe.Block].includes(h));if(e.schema){const{nodes:h,marks:m}=oI(e.schema);this.addSchema(e.schema,h,m);return}const u=c(i)?{doc:ee(),[i]:ee()}:ee(),d=ee(),f=XL({settings:e,gatheredSchemaAttributes:this.gatherExtraAttributes(o),nodeNames:n,markNames:r,tags:t});for(const h of o){f[h.name]={...f[h.name],...h.options.extraAttributes};const m=s===!0||h.options.disableExtraAttributes===!0||h.constructor.disableExtraAttributes===!0;if(Hd(h)){const{spec:b,dynamic:v}=m2({createExtensionSpec:(g,y)=>h.createNodeSpec(g,y),extraAttributes:it(f,h.name),override:{...a,...h.options.nodeOverride},ignoreExtraAttributes:m,name:h.constructorName,tags:h.tags});h.spec=b,u[h.name]=b,Object.keys(v).length>0&&(this.dynamicAttributes.nodes[h.name]=v)}if(Wh(h)){const{spec:b,dynamic:v}=m2({createExtensionSpec:(g,y)=>h.createMarkSpec(g,y),extraAttributes:it(f,h.name),override:{...l,...h.options.markOverride},ignoreExtraAttributes:m,name:h.constructorName,tags:h.tags??[]});h.spec=b,d[h.name]=b,Object.keys(v).length>0&&(this.dynamicAttributes.marks[h.name]=v)}}const p=new PA({nodes:u,marks:d,topNode:"doc"});this.addSchema(p,u,d)}createPlugin(){return{appendTransaction:(e,t,r)=>{const{tr:n}=r;return!e.some(i=>i.docChanged)||Object.keys(this.dynamicAttributes.nodes).length===0&&Object.keys(this.dynamicAttributes.marks).length===0?null:(n.doc.descendants((i,s)=>(this.checkAndUpdateDynamicNodes(i,s,n),this.checkAndUpdateDynamicMarks(i,s,n),!0)),n.steps.length>0?n:null)}}}addSchema(e,t,r){this.store.setStoreKey("nodes",t),this.store.setStoreKey("marks",r),this.store.setStoreKey("schema",e),this.store.setExtensionStore("schema",e),this.store.setStoreKey("defaultBlockNode",Hh(e).name);for(const n of Object.values(e.nodes))if(n.name!=="doc"&&(n.isBlock||n.isTextblock))break}checkAndUpdateDynamicNodes(e,t,r){for(const[n,o]of At(this.dynamicAttributes.nodes))if(e.type.name===n)for(const[i,s]of At(o)){if(!Zi(e.attrs[i]))continue;const a={...e.attrs,[i]:s(e)};r.setNodeMarkup(t,void 0,a),s2(r)}}checkAndUpdateDynamicMarks(e,t,r){for(const[n,o]of At(this.dynamicAttributes.marks)){const i=it(this.store.schema.marks,n),s=e.marks.find(a=>a.type.name===n);if(s)for(const[a,l]of At(o)){if(!Zi(s.attrs[a]))continue;const c=_o(r.doc.resolve(t),i);if(!c)continue;const{from:u,to:d}=c,f=i.create({...s.attrs,[a]:l(s)});r.removeMark(u,d,i).addMark(u,d,f),s2(r)}}}gatherExtraAttributes(e){const t=[];for(const r of e)r.createSchemaAttributes&&t.push(...r.createSchemaAttributes());return t}};G1=Z([pe({defaultPriority:Ae.Highest})],G1);function XL(e){const{settings:t,gatheredSchemaAttributes:r,nodeNames:n,markNames:o,tags:i}=e,s=ee();if(t.disableExtraAttributes)return s;const a=[...r,...t.extraAttributes??[]];for(const l of a??[]){const c=ZL({identifiers:l.identifiers,nodeNames:n,markNames:o,tags:i});for(const u of c){const d=s[u]??{};s[u]={...d,...l.attributes}}}return s}function QL(e){return hs(e)&&ct(e.tags)}function ZL(e){const{identifiers:t,nodeNames:r,markNames:n,tags:o}=e;if(t==="nodes")return r;if(t==="marks")return n;if(t==="all")return[...r,...n];if(ct(t))return t;te(QL(t),{code:H.EXTENSION_EXTRA_ATTRIBUTES,message:"Invalid value passed as an identifier when creating `extraAttributes`."});const{tags:i=[],names:s=[],behavior:a="any",excludeNames:l,excludeTags:c,type:u}=t,d=new Set,f=u==="mark"?n:u==="node"?r:[...n,...r],p=m=>f.includes(m)&&!(l!=null&&l.includes(m));for(const m of s)p(m)&&d.add(m);const h=new Map;for(const m of i)if(!(c!=null&&c.includes(m)))for(const b of o[m]){if(!p(b))continue;if(a==="any"){d.add(b);continue}const v=h.get(b)??new Set;v.add(m),h.set(b,v)}for(const[m,b]of h)b.size===i.length&&d.add(m);return[...d]}function m2(e){var t;const{createExtensionSpec:r,extraAttributes:n,ignoreExtraAttributes:o,name:i,tags:s,override:a}=e,l=ee();function c(b,v){l[b]=v}let u=!1;function d(){u=!0}const f=eI(n,o,d,c),p=tI(n,o),h=rI(n,o),m=r({defaults:f,parse:p,dom:h},a);return te(o||u,{code:H.EXTENSION_SPEC,message:`When creating a node specification you must call the 'defaults', and parse, and 'dom' methods. To avoid this error you can set the static property 'disableExtraAttributes' of '${i}' to 'true'.`}),m.group=[...((t=m.group)==null?void 0:t.split(" "))??[],...s].join(" ")||void 0,{spec:m,dynamic:l}}function Xv(e){return ne(e)||_e(e)?{default:e}:(te(e,{message:`${W4(e)} is not supported`,code:H.EXTENSION_EXTRA_ATTRIBUTES}),e)}function eI(e,t,r,n){return()=>{r();const o=ee();if(t)return o;for(const[i,s]of At(e)){let l=Xv(s).default;_e(l)&&(n(i,l),l=null),o[i]=l===void 0?{}:{default:l}}return o}}function tI(e,t){return r=>{const n=ee();if(t)return n;for(const[o,i]of At(e)){const{parseDOM:s,...a}=Xv(i);if(Je(r)){if(Zi(s)){n[o]=r.getAttribute(o)??a.default;continue}if(_e(s)){n[o]=s(r)??a.default;continue}n[o]=r.getAttribute(s)??a.default}}return n}}function rI(e,t){return r=>{const n=ee();if(t)return n;function o(i,s){if(i){if(ne(i)){n[s]=i;return}if(ct(i)){const[a,l]=i;n[a]=l??r.attrs[s];return}for(const[a,l]of At(i))n[a]=l}}for(const[i,s]of At(e)){const{toDOM:a,parseDOM:l}=Xv(s);if(Zi(a)){const c=ne(l)?l:i;n[c]=r.attrs[i];continue}if(_e(a)){o(a(r.attrs,nI(r)),i);continue}o(a,i)}return n}}function nI(e){return Id(e)?{node:e}:pz(e)?{mark:e}:{}}function oI(e){const t=ee(),r=ee();for(const[n,o]of Object.entries(e.nodes))t[n]=o.spec;for(const[n,o]of Object.entries(e.marks))r[n]=o.spec;return{nodes:t,marks:r}}var Ll=class extends Ve{constructor(){super(...arguments),this.onAddCustomHandler=({suggester:e})=>{var t;if(!(!e||(t=this.store.managerSettings.exclude)!=null&&t.suggesters))return i2(this.store.getState(),e)}}get name(){return"suggest"}onCreate(){this.store.setExtensionStore("addSuggester",e=>i2(this.store.getState(),e)),this.store.setExtensionStore("removeSuggester",e=>K6(this.store.getState(),e))}createExternalPlugins(){var e,t;const r=[];for(const n of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.suggesters)break;if(!n.createSuggesters||(t=n.options.exclude)!=null&&t.suggesters)continue;const o=n.createSuggesters(),i=ct(o)?o:[o];r.push(...i)}return[q6(...r)]}getSuggestState(e){return Fv(e??this.store.getState())}getSuggestMethods(){const{addIgnored:e,clearIgnored:t,removeIgnored:r,ignoreNextExit:n,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}=this.getSuggestState();return{addIgnored:e,clearIgnored:t,removeIgnored:r,ignoreNextExit:n,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}}isSuggesterActive(e){var t;return fr(ct(e)?e:[e],(t=this.getSuggestState().match)==null?void 0:t.suggester.name)}};Z([He()],Ll.prototype,"getSuggestState",1);Z([He()],Ll.prototype,"getSuggestMethods",1);Z([He()],Ll.prototype,"isSuggesterActive",1);Ll=Z([pe({customHandlerKeys:["suggester"]})],Ll);var Y1=class extends Ve{constructor(){super(...arguments),this.allTags=ee(),this.plainTags=ee(),this.markTags=ee(),this.nodeTags=ee()}get name(){return"tags"}onCreate(){this.resetTags();for(const e of this.store.extensions)this.updateTagForExtension(e);this.store.setStoreKey("tags",this.allTags),this.store.setExtensionStore("tags",this.allTags),this.store.setStoreKey("plainTags",this.plainTags),this.store.setExtensionStore("plainTags",this.plainTags),this.store.setStoreKey("markTags",this.markTags),this.store.setExtensionStore("markTags",this.markTags),this.store.setStoreKey("nodeTags",this.nodeTags),this.store.setExtensionStore("nodeTags",this.nodeTags)}resetTags(){const e=ee(),t=ee(),r=ee(),n=ee();for(const o of Ah(oe))e[o]=[],t[o]=[],r[o]=[],n[o]=[];this.allTags=e,this.plainTags=t,this.markTags=r,this.nodeTags=n}updateTagForExtension(e){var t,r;const n=new Set([...e.tags??[],...((t=e.createTags)==null?void 0:t.call(e))??[],...e.options.extraTags??[],...((r=this.store.managerSettings.extraTags)==null?void 0:r[e.name])??[]]);for(const o of n)te(iI(o),{code:H.EXTENSION,message:`The tag provided by the extension: ${e.constructorName} is not supported by the editor. To add custom tags you can use the 'mutateTag' method.`}),this.allTags[o].push(e.name),ZC(e)&&this.plainTags[o].push(e.name),Wh(e)&&this.markTags[o].push(e.name),Hd(e)&&this.nodeTags[o].push(e.name);e.tags=[...n]}};Y1=Z([pe({defaultPriority:Ae.Highest})],Y1);function iI(e){return fr(Ah(oe),e)}var sI=new ka("remirrorFilePlaceholderPlugin");function aI(){const e=new Ro({key:sI,state:{init(){return{set:Ee.empty,payloads:new Map}},apply(t,{set:r,payloads:n}){r=r.map(t.mapping,t.doc);const o=t.getMeta(e);if(o)if(o.type===0){const i=document.createElement("placeholder"),s=Ge.widget(o.pos,i,{id:o.id});r=r.add(t.doc,[s]),n.set(o.id,o.payload)}else o.type===1&&(r=r.remove(r.find(void 0,void 0,i=>i.id===o.id)),n.delete(o.id));return{set:r,payloads:n}}},props:{decorations(t){var r;return((r=e.getState(t))==null?void 0:r.set)??null}}});return e}var lI=class extends Ve{get name(){return"upload"}createExternalPlugins(){return[aI()]}};function cI(e={}){e={...{exitMarksOnArrowPress:Qn.defaultOptions.exitMarksOnArrowPress,excludeBaseKeymap:Qn.defaultOptions.excludeBaseKeymap,selectParentNodeOnEscape:Qn.defaultOptions.selectParentNodeOnEscape,undoInputRuleOnBackspace:Qn.defaultOptions.undoInputRuleOnBackspace,persistentSelectionClass:io.defaultOptions.persistentSelectionClass},...e};const r=w1(e,["excludeBaseKeymap","selectParentNodeOnEscape","undoInputRuleOnBackspace"]),n=w1(e,["persistentSelectionClass"]);return[new Y1,new G1,new IL,new zp,new K1,new JL,new YL,new Ll,new xe,new Rn,new Qn(r),new W1,new lI,new io(n)]}var g2=class extends Ve{get name(){return"meta"}onCreate(){if(this.store.setStoreKey("getCommandMeta",this.getCommandMeta.bind(this)),!!this.options.capture)for(const e of this.store.extensions)this.captureCommands(e),this.captureKeybindings(e)}createPlugin(){return{}}captureCommands(e){const t=e.decoratedCommands??{},r=e.createCommands;for(const n of Object.keys(t)){const o=e[n];e[n]=(...i)=>s=>{var a;const l=o(...i)(s);return s.dispatch&&l&&this.setCommandMeta(s.tr,{type:"command",chain:s.dispatch!==((a=s.view)==null?void 0:a.dispatch),name:n,extension:e.name,decorated:!0}),l}}r&&(e.createCommands=()=>{const n=r();for(const[o,i]of Object.entries(n))n[o]=(...s)=>a=>{var l;const c=i(...s)(a);return a.dispatch&&c&&this.setCommandMeta(a.tr,{type:"command",chain:a.dispatch!==((l=a.view)==null?void 0:l.dispatch),name:o,extension:e.name,decorated:!1}),c};return n})}captureKeybindings(e){}getCommandMeta(e){return e.getMeta(this.pluginKey)??[]}setCommandMeta(e,t){const r=this.getCommandMeta(e);e.setMeta(this.pluginKey,[...r,t])}};g2=Z([pe({defaultOptions:{capture:on.isDevelopment},staticKeys:["capture"],defaultPriority:Ae.Highest})],g2);var Ff,$c,Vf,Wa,Ei,jf,Uf,uI=class{constructor(e){kt(this,Ff,Cl()),kt(this,$c,void 0),kt(this,Vf,void 0),kt(this,Wa,!0),kt(this,Ei,jh()),kt(this,jf,void 0),kt(this,Uf,void 0),this.getState=()=>this.view.state??this.initialEditorState,this.getPreviousState=()=>this.previousState,this.dispatchTransaction=i=>{var s,a;te(!this.manager.destroyed,{code:H.MANAGER_PHASE_ERROR,message:"A transaction was dispatched to a manager that has already been destroyed. Please check your set up, or open an issue."}),i=((a=(s=this.props).onDispatchTransaction)==null?void 0:a.call(s,i,this.getState()))??i;const l=this.getState(),{state:c,transactions:u}=l.applyTransaction(i);Lt(this,Vf,l),this.updateState({state:c,tr:i,transactions:u});const d=this.manager.store.getForcedUpdates(i);Mo(d)||this.updateViewProps(...d)},this.onChange=(i=ee())=>{var s,a;const l=this.eventListenerProps(i);G(this,Wa)&&Lt(this,Wa,!1),(a=(s=this.props).onChange)==null||a.call(s,l)},this.onBlur=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onBlur)==null||a.call(s,l,i),G(this,Ei).emit("blur",l,i)},this.onFocus=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onFocus)==null||a.call(s,l,i),G(this,Ei).emit("focus",l,i)},this.setContent=(i,{triggerChange:s=!1}={})=>{const{doc:a}=this.manager.createState({content:i}),l=this.getState(),{state:c}=this.getState().applyTransaction(l.tr.replaceRangeWith(0,l.doc.nodeSize-2,a));if(s)return this.updateState({state:c,triggerChange:s});this.view.updateState(c)},this.clearContent=({triggerChange:i=!1}={})=>{this.setContent(this.manager.createEmptyDoc(),{triggerChange:i})},this.createStateFromContent=(i,s)=>this.manager.createState({content:i,selection:s}),this.focus=i=>{this.manager.store.commands.focus(i)},this.blur=i=>{this.manager.store.commands.blur(i)};const{getProps:t,initialEditorState:r,element:n}=e;if(Lt(this,$c,t),Lt(this,Uf,r),this.manager.attachFramework(this,this.updateListener.bind(this)),this.manager.view)return;const o=this.createView(r,n);this.manager.addView(o)}get addHandler(){return G(this,jf)??Lt(this,jf,G(this,Ei).on.bind(G(this,Ei)))}get updatableViewProps(){return{attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0}}get firstRender(){return G(this,Wa)}get props(){return G(this,$c).call(this)}get previousState(){return this.previousStateOverride??G(this,Vf)??this.initialEditorState}get manager(){return this.props.manager}get view(){return this.manager.view}get uid(){return G(this,Ff)}get initialEditorState(){return G(this,Uf)}updateListener(e){const{state:t,tr:r}=e;return G(this,Ei).emit("updated",this.eventListenerProps({state:t,tr:r}))}update(e){const{getProps:t}=e;return Lt(this,$c,t),this}updateViewProps(...e){const t=w1(this.updatableViewProps,e);this.view.setProps({...this.view.props,...t})}getAttributes(e){var t;const{attributes:r,autoFocus:n,classNames:o=[],label:i,editable:s}=this.props,a=(t=this.manager.store)==null?void 0:t.attributes,l=_e(r)?r(this.eventListenerProps()):r;let c={};(n||Jt(n))&&(c=e?{autoFocus:!0}:{autofocus:"true"});const u=Ml(ju(e&&"Prosemirror","remirror-editor",a==null?void 0:a.class,...o).split(" ")).join(" "),d={role:"textbox",...c,"aria-multiline":"true",...s??!0?{}:{"aria-readonly":"true"},"aria-label":i??"",...a,class:u};return q4({...d,...l})}addFocusListeners(){this.view.dom.addEventListener("blur",this.onBlur),this.view.dom.addEventListener("focus",this.onFocus)}removeFocusListeners(){this.view.dom.removeEventListener("blur",this.onBlur),this.view.dom.removeEventListener("focus",this.onFocus)}destroy(){G(this,Ei).emit("destroy"),this.view&&this.removeFocusListeners()}eventListenerProps(e=ee()){const{state:t,tr:r,transactions:n}=e;return{tr:r,transactions:n,internalUpdate:!r,view:this.view,firstRender:G(this,Wa),state:t??this.getState(),createStateFromContent:this.createStateFromContent,previousState:this.previousState,helpers:this.manager.store.helpers}}get baseOutput(){return{manager:this.manager,...this.manager.store,addHandler:this.addHandler,focus:this.focus,blur:this.blur,uid:G(this,Ff),view:this.view,getState:this.getState,getPreviousState:this.getPreviousState,getExtension:this.manager.getExtension.bind(this.manager),hasExtension:this.manager.hasExtension.bind(this.manager),clearContent:this.clearContent,setContent:this.setContent}}};Ff=new WeakMap;$c=new WeakMap;Vf=new WeakMap;Wa=new WeakMap;Ei=new WeakMap;jf=new WeakMap;Uf=new WeakMap;function dI(e,t){const r=[],n=new WeakMap,o=[],i=new WeakMap;let s=[];const a={duplicateMap:i,parentExtensions:o,gatheredExtensions:s,settings:t};for(const d of e)t5(a,{extension:d});s=ra(s,(d,f)=>f.priority-d.priority);const l=new WeakSet,c=new Set;for(const d of s){const f=d.constructor,p=d.name,h=i.get(f);te(h,{message:`No entries were found for the ExtensionConstructor ${d.name}`,code:H.INTERNAL}),!(l.has(f)||c.has(p))&&(l.add(f),c.add(p),r.push(d),n.set(f,d),h.forEach(m=>m==null?void 0:m.replaceChildExtension(f,d)))}const u=[];for(const d of r)fI({extension:d,found:l,missing:u});return te(Mo(u),{code:H.MISSING_REQUIRED_EXTENSION,message:u.map(({Constructor:d,extension:f})=>`The extension '${f.name}' requires '${d.name} in order to run correctly.`).join(` +`)}),{extensions:r,extensionMap:n}}function t5(e,t){var r;const{gatheredExtensions:n,duplicateMap:o,parentExtensions:i,settings:s}=e,{extension:a,parentExtension:l}=t;let{names:c=[]}=t;te(QC(a),{code:H.INVALID_MANAGER_EXTENSION,message:`An invalid extension: ${a} was provided to the [[\`RemirrorManager\`]].`});const u=a.extensions;if(a.setPriority((r=s.priority)==null?void 0:r[a.name]),n.push(a),pI({duplicateMap:o,extension:a,parentExtension:l}),u.length!==0){if(c.includes(a.name)){`${c.join(" > ")}${a.name}`;return}c=[...c,a.name],i.push(a);for(const d of u)t5(e,{names:c,extension:d,parentExtension:a})}}function fI(e){const{extension:t,found:r,missing:n}=e;if(t.requiredExtensions)for(const o of t.requiredExtensions??[])r.has(o)||n.push({Constructor:o,extension:t})}function pI(e){const{duplicateMap:t,extension:r,parentExtension:n}=e,o=r.constructor,i=t.get(o),s=n?[n]:[];t.set(o,i?[...i,...s]:s)}function hI(e){var t,r,n,o;const{extension:i,nodeNames:s,markNames:a,plainNames:l,store:c,handlers:u}=e;i.setStore(c);const d=(t=i.onCreate)==null?void 0:t.bind(i),f=(r=i.onView)==null?void 0:r.bind(i),p=(n=i.onStateUpdate)==null?void 0:n.bind(i),h=(o=i.onDestroy)==null?void 0:o.bind(i);d&&u.create.push(d),f&&u.view.push(f),p&&u.update.push(p),h&&u.destroy.push(h),Wh(i)&&a.push(i.name),Hd(i)&&i.name!=="doc"&&s.push(i.name),ZC(i)&&l.push(i.name)}var Ci,Hc,Wn,$o,Bc,Zr,Cs,Fc,Ms,Vc,Ts,Kn,jc,Wf=class{constructor(e,t={}){kt(this,Ci,void 0),kt(this,Hc,ee()),kt(this,Wn,ee()),kt(this,$o,void 0),kt(this,Bc,void 0),kt(this,Zr,Nr.None),kt(this,Cs,void 0),kt(this,Fc,!0),kt(this,Ms,{create:[],view:[],update:[],destroy:[]}),kt(this,Vc,[]),kt(this,Ts,jh()),kt(this,Kn,void 0),kt(this,jc,void 0),this.getState=()=>{var o;return G(this,Zr)>=Nr.EditorView?this.view.state:(te(G(this,Kn),{code:H.MANAGER_PHASE_ERROR,message:"`getState` can only be called after the `Framework` or the `EditorView` has been added to the manager`. Check your plugins to make sure that the decorations callback uses the state argument."}),(o=G(this,Kn))==null?void 0:o.initialEditorState)},this.updateState=o=>{const i=this.getState();this.view.updateState(o),this.onStateUpdate({previousState:i,state:o})};const{extensions:r,extensionMap:n}=dI(e,t);Lt(this,Cs,t),Lt(this,$o,Hs(r)),Lt(this,Bc,n),Lt(this,Ci,this.createExtensionStore()),Lt(this,Zr,Nr.Create),this.setupLifecycleHandlers();for(const o of G(this,Ms).create){const i=o();i&&G(this,Vc).push(i)}}static create(e,t={}){return new Wf([...eE(e),...cI(t.builtin)],t)}get[ti](){return $t.Manager}get destroyed(){return G(this,Zr)===Nr.Destroy}get mounted(){return G(this,Zr)>=Nr.EditorView&&G(this,Zr)G(this,$o),enumerable:t},phase:{get:()=>G(this,Zr),enumerable:t},view:{get:()=>this.view,enumerable:t},managerSettings:{get:()=>Hs(G(this,Cs)),enumerable:t},getState:{value:this.getState,enumerable:t},updateState:{value:this.updateState,enumerable:t},isMounted:{value:()=>this.mounted,enumerable:t},getExtension:{value:this.getExtension.bind(this),enumerable:t},manager:{get:()=>this,enumerable:t},document:{get:()=>this.document,enumerable:t},stringHandlers:{get:()=>G(this,Hc),enumerable:t},currentState:{get:()=>r??(r=this.getState()),set:o=>{r=o},enumerable:t},previousState:{get:()=>n,set:o=>{n=o},enumerable:t}}),e.getStoreKey=this.getStoreKey.bind(this),e.setStoreKey=this.setStoreKey.bind(this),e.setExtensionStore=this.setExtensionStore.bind(this),e.setStringHandler=this.setStringHandler.bind(this),e}addView(e){if(G(this,Zr)>=Nr.EditorView)return this;Lt(this,Fc,!0),Lt(this,Zr,Nr.EditorView),G(this,Wn).view=e;for(const t of G(this,Ms).view){const r=t(e);r&&G(this,Vc).push(r)}return this}attachFramework(e,t){var r;G(this,Kn)!==e&&(G(this,Kn)&&(G(this,Kn).destroy(),(r=G(this,jc))==null||r.call(this)),Lt(this,Kn,e),Lt(this,jc,this.addHandler("stateUpdate",t)))}createEmptyDoc(){var e;const t=(e=this.schema.nodes.doc)==null?void 0:e.createAndFill();return te(t,{code:H.INVALID_CONTENT,message:"An empty node could not be created due to an invalid schema."}),t}createState(e={}){const{onError:t,defaultSelection:r="end"}=this.settings,{content:n=this.createEmptyDoc(),selection:o=r,stringHandler:i=this.settings.stringHandler}=e,{schema:s,plugins:a}=this.store,l=AC({stringHandler:ne(i)?this.stringHandlers[i]:i,document:this.document,content:n,onError:t,schema:s,selection:o});return Bs.create({schema:s,doc:l,plugins:a,selection:jr(o,l)})}addHandler(e,t){return G(this,Ts).on(e,t)}onStateUpdate(e){const t=G(this,Fc);G(this,Ci).currentState=e.state,G(this,Ci).previousState=e.previousState,t&&(Lt(this,Zr,Nr.Runtime),Lt(this,Fc,!1));const r={...e,firstUpdate:t};for(const n of G(this,Ms).update)n(r);G(this,Ts).emit("stateUpdate",r)}getExtension(e){const t=G(this,Bc).get(e);return te(t,{code:H.INVALID_MANAGER_EXTENSION,message:`'${e.name}' doesn't exist within this manager. Make sure it is properly added before attempting to use it.`}),t}hasExtension(e){return!!G(this,Bc).get(e)}clone(){const e=G(this,$o).map(r=>r.clone(r.options)),t=Wf.create(()=>e,G(this,Cs));return G(this,Ts).emit("clone",t),t}recreate(e=[],t={}){const r=G(this,$o).map(o=>o.clone(o.initialOptions)),n=Wf.create(()=>[...r,...e],t);return G(this,Ts).emit("recreate",n),n}destroy(){var e,t,r,n,o,i;Lt(this,Zr,Nr.Destroy);for(const s of((e=this.view)==null?void 0:e.state.plugins)??[])(r=(t=s.getState(this.view.state))==null?void 0:t.destroy)==null||r.call(t);(n=G(this,Kn))==null||n.destroy(),(o=G(this,jc))==null||o.call(this);for(const s of G(this,Vc))s();for(const s of G(this,Ms).destroy)s();(i=this.view)==null||i.destroy(),G(this,Ts).emit("destroy")}includes(e){const t=[],r=[];for(const n of G(this,$o))t.push(n.name,n.constructorName),r.push(n.constructor);return e.every(n=>ne(n)?fr(t,n):fr(r,n))}},mI=Wf;Ci=new WeakMap;Hc=new WeakMap;Wn=new WeakMap;$o=new WeakMap;Bc=new WeakMap;Zr=new WeakMap;Cs=new WeakMap;Fc=new WeakMap;Ms=new WeakMap;Vc=new WeakMap;Ts=new WeakMap;Kn=new WeakMap;jc=new WeakMap;function gI(e,t){return!oc(e)||!ic(e,$t.Manager)?!1:t?e.includes(t):!0}var vI=Object.defineProperty,yI=Object.getOwnPropertyDescriptor,Bd=(e,t,r,n)=>{for(var o=n>1?void 0:n?yI(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&vI(t,r,o),o},r5=/\S+/g;function n5(e){return e.type.isTextblock?1:e.type.isText?e.textBetween(0,e.nodeSize).length:0}function bI({doc:e},t){let r=0,n=0;return e.nodesBetween(0,e.nodeSize-2,(o,i)=>{if(n>0)return!1;const s=n5(o);return r+s>t?(n=i+1+(t-r),!1):(r+=s,!0)}),n}function xI({doc:e},t){let r=0,n=0;return e.nodesBetween(0,e.nodeSize-2,(o,i)=>{if(n>0)return!1;if(!o.type.isText)return!0;const s=o.textBetween(0,o.nodeSize),a=xa(s,r5);if(r+a.length>t){const l=t-r,c=a[l];return n=i+((c==null?void 0:c.index)??0),!1}return r+=a.length,!0}),n}var is=class extends Ve{get name(){return"count"}getCountMaximum(){return this.options.maximum}getCharacterCount(e=this.store.getState()){let t=0;return e.doc.nodesBetween(0,e.doc.nodeSize-2,r=>(t+=n5(r),!0)),Math.max(t-1,0)}getWordCount(e=this.store.getState()){const t=this.store.helpers.getText({lineBreakDivider:" ",state:e});return xa(t,r5).length}isCountValid(e=this.store.getState()){const{maximumStrategy:t,maximum:r}=this.options;return r<1?!0:t==="CHARACTERS"?this.store.helpers.getCharacterCount(e)<=r:this.store.helpers.getWordCount(e)<=r}createDecorationSet(e){const{maximum:t=-1,maximumStrategy:r,maximumExceededClassName:n}=this.options,s=(r==="CHARACTERS"?bI:xI)(e,t);return Ee.create(e.doc,[Ge.inline(s,e.doc.nodeSize-2,{class:n})])}createExternalPlugins(){const{maximum:e}=this.options,t=new Ro({state:{init:(r,n)=>this.isCountValid(n)?{decorationSet:Ee.empty}:{decorationSet:this.createDecorationSet(n)},apply:(r,n,o,i)=>!r.docChanged||e<1?n:this.isCountValid(i)?{decorationSet:Ee.empty}:{decorationSet:this.createDecorationSet(i)}},props:{decorations(r){var n;return((n=t.getState(r))==null?void 0:n.decorationSet)??null}}});return[t]}};Bd([He()],is.prototype,"getCountMaximum",1);Bd([He()],is.prototype,"getCharacterCount",1);Bd([He()],is.prototype,"getWordCount",1);Bd([He()],is.prototype,"isCountValid",1);is=Bd([pe({defaultOptions:{maximum:-1,maximumExceededClassName:"remirror-max-count-exceeded",maximumStrategy:"CHARACTERS"},staticKeys:["maximum","maximumStrategy","maximumExceededClassName"]})],is);var o5={exports:{}},hn={},i5={exports:{}},s5={};/** * @license React * scheduler.production.min.js * @@ -80,7 +80,7 @@ If you are using Node.js, you can install JSDOM and Remirror will try to use it * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(A,P){var B=A.length;A.push(P);e:for(;0>>1,J=A[Y];if(0>>1;Yo(ue,B))deo(he,ue)?(A[Y]=he,A[de]=B,Y=de):(A[Y]=ue,A[ie]=B,Y=ie);else if(deo(he,B))A[Y]=he,A[de]=B,Y=de;else break e}}return P}function o(A,P){var B=A.sortIndex-P.sortIndex;return B!==0?B:A.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,d=null,f=3,p=!1,h=!1,m=!1,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(A){for(var P=r(c);P!==null;){if(P.callback===null)n(c);else if(P.startTime<=A)n(c),P.sortIndex=P.expirationTime,t(l,P);else break;P=r(c)}}function x(A){if(m=!1,y(A),!h)if(r(l)!==null)h=!0,z(k);else{var P=r(c);P!==null&&q(x,P.startTime-A)}}function k(A,P){h=!1,m&&(m=!1,v(M),M=-1),p=!0;var B=f;try{for(y(P),d=r(l);d!==null&&(!(d.expirationTime>P)||A&&!N());){var Y=d.callback;if(typeof Y=="function"){d.callback=null,f=d.priorityLevel;var J=Y(d.expirationTime<=P);P=e.unstable_now(),typeof J=="function"?d.callback=J:d===r(l)&&n(l),y(P)}else n(l);d=r(l)}if(d!==null)var Ne=!0;else{var ie=r(c);ie!==null&&q(x,ie.startTime-P),Ne=!1}return Ne}finally{d=null,f=B,p=!1}}var w=!1,E=null,M=-1,C=5,T=-1;function N(){return!(e.unstable_now()-TA||125Y?(A.sortIndex=B,t(c,A),r(l)===null&&A===r(c)&&(m?(v(M),M=-1):m=!0,q(x,B-Y))):(A.sortIndex=J,t(l,A),h||p||(h=!0,z(k))),A},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(A){var P=f;return function(){var B=f;f=P;try{return A.apply(this,arguments)}finally{f=B}}}})(rC);tC.exports=rC;var hI=tC.exports;/** + */(function(e){function t(A,P){var B=A.length;A.push(P);e:for(;0>>1,J=A[Y];if(0>>1;Yo(ue,B))deo(me,ue)?(A[Y]=me,A[de]=B,Y=de):(A[Y]=ue,A[ie]=B,Y=ie);else if(deo(me,B))A[Y]=me,A[de]=B,Y=de;else break e}}return P}function o(A,P){var B=A.sortIndex-P.sortIndex;return B!==0?B:A.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,d=null,f=3,p=!1,h=!1,m=!1,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(A){for(var P=r(c);P!==null;){if(P.callback===null)n(c);else if(P.startTime<=A)n(c),P.sortIndex=P.expirationTime,t(l,P);else break;P=r(c)}}function x(A){if(m=!1,y(A),!h)if(r(l)!==null)h=!0,z(k);else{var P=r(c);P!==null&&q(x,P.startTime-A)}}function k(A,P){h=!1,m&&(m=!1,v(T),T=-1),p=!0;var B=f;try{for(y(P),d=r(l);d!==null&&(!(d.expirationTime>P)||A&&!N());){var Y=d.callback;if(typeof Y=="function"){d.callback=null,f=d.priorityLevel;var J=Y(d.expirationTime<=P);P=e.unstable_now(),typeof J=="function"?d.callback=J:d===r(l)&&n(l),y(P)}else n(l);d=r(l)}if(d!==null)var Ne=!0;else{var ie=r(c);ie!==null&&q(x,ie.startTime-P),Ne=!1}return Ne}finally{d=null,f=B,p=!1}}var w=!1,E=null,T=-1,C=5,M=-1;function N(){return!(e.unstable_now()-MA||125Y?(A.sortIndex=B,t(c,A),r(l)===null&&A===r(c)&&(m?(v(T),T=-1):m=!0,q(x,B-Y))):(A.sortIndex=J,t(l,A),h||p||(h=!0,z(k))),A},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(A){var P=f;return function(){var B=f;f=P;try{return A.apply(this,arguments)}finally{f=B}}}})(s5);i5.exports=s5;var kI=i5.exports;/** * @license React * react-dom.production.min.js * @@ -88,16 +88,16 @@ If you are using Node.js, you can install JSDOM and Remirror will try to use it * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var nC=S,dn=hI;function $(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),q1=Object.prototype.hasOwnProperty,mI=/^[: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]*$/,h2={},m2={};function gI(e){return q1.call(m2,e)?!0:q1.call(h2,e)?!1:mI.test(e)?m2[e]=!0:(h2[e]=!0,!1)}function vI(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function yI(e,t,r,n){if(t===null||typeof t>"u"||vI(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Mr(e,t,r,n,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Qt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Qt[e]=new Mr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Qt[t]=new Mr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Qt[e]=new Mr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Qt[e]=new Mr(e,2,!1,e,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(e){Qt[e]=new Mr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Qt[e]=new Mr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Qt[e]=new Mr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Qt[e]=new Mr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Qt[e]=new Mr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Yv=/[\-:]([a-z])/g;function Jv(e){return e[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(e){var t=e.replace(Yv,Jv);Qt[t]=new Mr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Yv,Jv);Qt[t]=new Mr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Yv,Jv);Qt[t]=new Mr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Qt[e]=new Mr(e,1,!1,e.toLowerCase(),null,!1,!1)});Qt.xlinkHref=new Mr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Qt[e]=new Mr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xv(e,t,r,n){var o=Qt.hasOwnProperty(t)?Qt[t]:null;(o!==null?o.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),J1=Object.prototype.hasOwnProperty,wI=/^[: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]*$/,v2={},y2={};function SI(e){return J1.call(y2,e)?!0:J1.call(v2,e)?!1:wI.test(e)?y2[e]=!0:(v2[e]=!0,!1)}function EI(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function CI(e,t,r,n){if(t===null||typeof t>"u"||EI(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Tr(e,t,r,n,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Qt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Qt[e]=new Tr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Qt[t]=new Tr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Qt[e]=new Tr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Qt[e]=new Tr(e,2,!1,e,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(e){Qt[e]=new Tr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Qt[e]=new Tr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Qt[e]=new Tr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Qt[e]=new Tr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Qt[e]=new Tr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Qv=/[\-:]([a-z])/g;function Zv(e){return e[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(e){var t=e.replace(Qv,Zv);Qt[t]=new Tr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Qv,Zv);Qt[t]=new Tr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Qv,Zv);Qt[t]=new Tr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Qt[e]=new Tr(e,1,!1,e.toLowerCase(),null,!1,!1)});Qt.xlinkHref=new Tr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Qt[e]=new Tr(e,1,!1,e.toLowerCase(),null,!0,!0)});function ey(e,t,r,n){var o=Qt.hasOwnProperty(t)?Qt[t]:null;(o!==null?o.type!==0:n||!(2a||o[s]!==i[a]){var l=` -`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Sg=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?jc(e):""}function bI(e){switch(e.tag){case 5:return jc(e.type);case 16:return jc("Lazy");case 13:return jc("Suspense");case 19:return jc("SuspenseList");case 0:case 2:case 15:return e=Eg(e.type,!1),e;case 11:return e=Eg(e.type.render,!1),e;case 1:return e=Eg(e.type,!0),e;default:return""}}function X1(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Za:return"Fragment";case Qa:return"Portal";case G1:return"Profiler";case Qv:return"StrictMode";case Y1:return"Suspense";case J1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case sC:return(e.displayName||"Context")+".Consumer";case iC:return(e._context.displayName||"Context")+".Provider";case Zv:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ey:return t=e.displayName||null,t!==null?t:X1(e.type)||"Memo";case Oi:t=e._payload,e=e._init;try{return X1(e(t))}catch{}}return null}function xI(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return X1(t);case 8:return t===Qv?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ss(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lC(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kI(e){var t=lC(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){n=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function of(e){e._valueTracker||(e._valueTracker=kI(e))}function cC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=lC(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Pp(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Q1(e,t){var r=t.checked;return ut({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function v2(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=ss(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function uC(e,t){t=t.checked,t!=null&&Xv(e,"checked",t,!1)}function Z1(e,t){uC(e,t);var r=ss(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?e0(e,t.type,r):t.hasOwnProperty("defaultValue")&&e0(e,t.type,ss(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function y2(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function e0(e,t,r){(t!=="number"||Pp(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Uc=Array.isArray;function ml(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=sf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Uu(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var bu={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},wI=["Webkit","ms","Moz","O"];Object.keys(bu).forEach(function(e){wI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),bu[t]=bu[e]})});function hC(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||bu.hasOwnProperty(e)&&bu[e]?(""+t).trim():t+"px"}function mC(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=hC(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var SI=ut({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 n0(e,t){if(t){if(SI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error($(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error($(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error($(61))}if(t.style!=null&&typeof t.style!="object")throw Error($(62))}}function o0(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 i0=null;function ty(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var s0=null,gl=null,vl=null;function k2(e){if(e=Vd(e)){if(typeof s0!="function")throw Error($(280));var t=e.stateNode;t&&(t=qh(t),s0(e.stateNode,e.type,t))}}function gC(e){gl?vl?vl.push(e):vl=[e]:gl=e}function vC(){if(gl){var e=gl,t=vl;if(vl=gl=null,k2(e),t)for(e=0;e>>=0,e===0?32:31-(zI(e)/LI|0)|0}var af=64,lf=4194304;function Wc(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Dp(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,o=e.suspendedLanes,i=e.pingedLanes,s=r&268435455;if(s!==0){var a=s&~o;a!==0?n=Wc(a):(i&=s,i!==0&&(n=Wc(i)))}else s=r&~o,s!==0?n=Wc(s):i!==0&&(n=Wc(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&o)&&(o=n&-n,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Bd(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-to(t),e[t]=r}function HI(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=ku),A2=String.fromCharCode(32),N2=!1;function DC(e,t){switch(e){case"keyup":return p8.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $C(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var el=!1;function m8(e,t){switch(e){case"compositionend":return $C(t);case"keypress":return t.which!==32?null:(N2=!0,A2);case"textInput":return e=t.data,e===A2&&N2?null:e;default:return null}}function g8(e,t){if(el)return e==="compositionend"||!cy&&DC(e,t)?(e=LC(),Wf=sy=Di=null,el=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=L2(r)}}function VC(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?VC(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jC(){for(var e=window,t=Pp();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Pp(e.document)}return t}function uy(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function C8(e){var t=jC(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&VC(r.ownerDocument.documentElement,r)){if(n!==null&&uy(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=r.textContent.length,i=Math.min(n.start,o);n=n.end===void 0?i:Math.min(n.end,o),!e.extend&&i>n&&(o=n,n=i,i=o),o=I2(r,i);var s=I2(r,n);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,tl=null,f0=null,Su=null,p0=!1;function D2(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;p0||tl==null||tl!==Pp(n)||(n=tl,"selectionStart"in n&&uy(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Su&&Ju(Su,n)||(Su=n,n=Bp(f0,"onSelect"),0ol||(e.current=b0[ol],b0[ol]=null,ol--)}function Ye(e,t){ol++,b0[ol]=e.current,e.current=t}var as={},fr=ys(as),Dr=ys(!1),aa=as;function Dl(e,t){var r=e.type.contextTypes;if(!r)return as;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in r)o[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function $r(e){return e=e.childContextTypes,e!=null}function Vp(){tt(Dr),tt(fr)}function U2(e,t,r){if(fr.current!==as)throw Error($(168));Ye(fr,t),Ye(Dr,r)}function QC(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var o in n)if(!(o in t))throw Error($(108,xI(e)||"Unknown",o));return ut({},r,n)}function jp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||as,aa=fr.current,Ye(fr,e),Ye(Dr,Dr.current),!0}function W2(e,t,r){var n=e.stateNode;if(!n)throw Error($(169));r?(e=QC(e,t,aa),n.__reactInternalMemoizedMergedChildContext=e,tt(Dr),tt(fr),Ye(fr,e)):tt(Dr),Ye(Dr,r)}var Uo=null,Gh=!1,$g=!1;function ZC(e){Uo===null?Uo=[e]:Uo.push(e)}function D8(e){Gh=!0,ZC(e)}function bs(){if(!$g&&Uo!==null){$g=!0;var e=0,t=$e;try{var r=Uo;for($e=1;e>=s,o-=s,qo=1<<32-to(t)+o|r<M?(C=E,E=null):C=E.sibling;var T=f(v,E,y[M],x);if(T===null){E===null&&(E=C);break}e&&E&&T.alternate===null&&t(v,E),g=i(T,g,M),w===null?k=T:w.sibling=T,w=T,E=C}if(M===y.length)return r(v,E),ot&&Os(v,M),k;if(E===null){for(;MM?(C=E,E=null):C=E.sibling;var N=f(v,E,T.value,x);if(N===null){E===null&&(E=C);break}e&&E&&N.alternate===null&&t(v,E),g=i(N,g,M),w===null?k=N:w.sibling=N,w=N,E=C}if(T.done)return r(v,E),ot&&Os(v,M),k;if(E===null){for(;!T.done;M++,T=y.next())T=d(v,T.value,x),T!==null&&(g=i(T,g,M),w===null?k=T:w.sibling=T,w=T);return ot&&Os(v,M),k}for(E=n(v,E);!T.done;M++,T=y.next())T=p(E,v,M,T.value,x),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?M:T.key),g=i(T,g,M),w===null?k=T:w.sibling=T,w=T);return e&&E.forEach(function(F){return t(v,F)}),ot&&Os(v,M),k}function b(v,g,y,x){if(typeof y=="object"&&y!==null&&y.type===Za&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case nf:e:{for(var k=y.key,w=g;w!==null;){if(w.key===k){if(k=y.type,k===Za){if(w.tag===7){r(v,w.sibling),g=o(w,y.props.children),g.return=v,v=g;break e}}else if(w.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Oi&&Q2(k)===w.type){r(v,w.sibling),g=o(w,y.props),g.ref=Sc(v,w,y),g.return=v,v=g;break e}r(v,w);break}else t(v,w);w=w.sibling}y.type===Za?(g=ea(y.props.children,v.mode,x,y.key),g.return=v,v=g):(x=Zf(y.type,y.key,y.props,null,v.mode,x),x.ref=Sc(v,g,y),x.return=v,v=x)}return s(v);case Qa:e:{for(w=y.key;g!==null;){if(g.key===w)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){r(v,g.sibling),g=o(g,y.children||[]),g.return=v,v=g;break e}else{r(v,g);break}else t(v,g);g=g.sibling}g=Kg(y,v.mode,x),g.return=v,v=g}return s(v);case Oi:return w=y._init,b(v,g,w(y._payload),x)}if(Uc(y))return h(v,g,y,x);if(yc(y))return m(v,g,y,x);mf(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(r(v,g.sibling),g=o(g,y),g.return=v,v=g):(r(v,g),g=Wg(y,v.mode,x),g.return=v,v=g),s(v)):r(v,g)}return b}var Hl=aM(!0),lM=aM(!1),jd={},wo=ys(jd),ed=ys(jd),td=ys(jd);function Ws(e){if(e===jd)throw Error($(174));return e}function by(e,t){switch(Ye(td,t),Ye(ed,e),Ye(wo,jd),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:r0(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=r0(t,e)}tt(wo),Ye(wo,t)}function Bl(){tt(wo),tt(ed),tt(td)}function cM(e){Ws(td.current);var t=Ws(wo.current),r=r0(t,e.type);t!==r&&(Ye(ed,e),Ye(wo,r))}function xy(e){ed.current===e&&(tt(wo),tt(ed))}var at=ys(0);function Yp(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Hg=[];function ky(){for(var e=0;er?r:4,e(!0);var n=Bg.transition;Bg.transition={};try{e(!1),t()}finally{$e=r,Bg.transition=n}}function CM(){return Rn().memoizedState}function F8(e,t,r){var n=Ji(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},MM(e))TM(t,r);else if(r=nM(e,t,r,n),r!==null){var o=kr();ro(r,e,n,o),OM(r,t,n)}}function V8(e,t,r){var n=Ji(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(MM(e))TM(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,r);if(o.hasEagerState=!0,o.eagerState=a,so(a,s)){var l=t.interleaved;l===null?(o.next=o,vy(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}r=nM(e,t,o,n),r!==null&&(o=kr(),ro(r,e,n,o),OM(r,t,n))}}function MM(e){var t=e.alternate;return e===lt||t!==null&&t===lt}function TM(e,t){Eu=Jp=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function OM(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ny(e,r)}}var Xp={readContext:Nn,useCallback:nr,useContext:nr,useEffect:nr,useImperativeHandle:nr,useInsertionEffect:nr,useLayoutEffect:nr,useMemo:nr,useReducer:nr,useRef:nr,useState:nr,useDebugValue:nr,useDeferredValue:nr,useTransition:nr,useMutableSource:nr,useSyncExternalStore:nr,useId:nr,unstable_isNewReconciler:!1},j8={readContext:Nn,useCallback:function(e,t){return ho().memoizedState=[e,t===void 0?null:t],e},useContext:Nn,useEffect:ew,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Yf(4194308,4,xM.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Yf(4194308,4,e,t)},useInsertionEffect:function(e,t){return Yf(4,2,e,t)},useMemo:function(e,t){var r=ho();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ho();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=F8.bind(null,lt,e),[n.memoizedState,e]},useRef:function(e){var t=ho();return e={current:e},t.memoizedState=e},useState:Z2,useDebugValue:My,useDeferredValue:function(e){return ho().memoizedState=e},useTransition:function(){var e=Z2(!1),t=e[0];return e=B8.bind(null,e[1]),ho().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=lt,o=ho();if(ot){if(r===void 0)throw Error($(407));r=r()}else{if(r=t(),Ht===null)throw Error($(349));ca&30||fM(n,t,r)}o.memoizedState=r;var i={value:r,getSnapshot:t};return o.queue=i,ew(hM.bind(null,n,i,e),[e]),n.flags|=2048,od(9,pM.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=ho(),t=Ht.identifierPrefix;if(ot){var r=Go,n=qo;r=(n&~(1<<32-to(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=rd++,0")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Mg=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Uc(e):""}function MI(e){switch(e.tag){case 5:return Uc(e.type);case 16:return Uc("Lazy");case 13:return Uc("Suspense");case 19:return Uc("SuspenseList");case 0:case 2:case 15:return e=Tg(e.type,!1),e;case 11:return e=Tg(e.type.render,!1),e;case 1:return e=Tg(e.type,!0),e;default:return""}}function e0(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Za:return"Fragment";case Qa:return"Portal";case X1:return"Profiler";case ty:return"StrictMode";case Q1:return"Suspense";case Z1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case u5:return(e.displayName||"Context")+".Consumer";case c5:return(e._context.displayName||"Context")+".Provider";case ry:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ny:return t=e.displayName||null,t!==null?t:e0(e.type)||"Memo";case Oi:t=e._payload,e=e._init;try{return e0(e(t))}catch{}}return null}function TI(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return e0(t);case 8:return t===ty?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ss(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function f5(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function OI(e){var t=f5(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){n=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function af(e){e._valueTracker||(e._valueTracker=OI(e))}function p5(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=f5(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Lp(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function t0(e,t){var r=t.checked;return ut({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function x2(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=ss(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function h5(e,t){t=t.checked,t!=null&&ey(e,"checked",t,!1)}function r0(e,t){h5(e,t);var r=ss(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?n0(e,t.type,r):t.hasOwnProperty("defaultValue")&&n0(e,t.type,ss(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function k2(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function n0(e,t,r){(t!=="number"||Lp(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Wc=Array.isArray;function ml(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=lf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Wu(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var xu={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},_I=["Webkit","ms","Moz","O"];Object.keys(xu).forEach(function(e){_I.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xu[t]=xu[e]})});function y5(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||xu.hasOwnProperty(e)&&xu[e]?(""+t).trim():t+"px"}function b5(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=y5(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var AI=ut({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 s0(e,t){if(t){if(AI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error($(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error($(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error($(61))}if(t.style!=null&&typeof t.style!="object")throw Error($(62))}}function a0(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 l0=null;function oy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var c0=null,gl=null,vl=null;function E2(e){if(e=jd(e)){if(typeof c0!="function")throw Error($(280));var t=e.stateNode;t&&(t=Jh(t),c0(e.stateNode,e.type,t))}}function x5(e){gl?vl?vl.push(e):vl=[e]:gl=e}function k5(){if(gl){var e=gl,t=vl;if(vl=gl=null,E2(e),t)for(e=0;e>>=0,e===0?32:31-(FI(e)/VI|0)|0}var cf=64,uf=4194304;function Kc(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Hp(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,o=e.suspendedLanes,i=e.pingedLanes,s=r&268435455;if(s!==0){var a=s&~o;a!==0?n=Kc(a):(i&=s,i!==0&&(n=Kc(i)))}else s=r&~o,s!==0?n=Kc(s):i!==0&&(n=Kc(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&o)&&(o=n&-n,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Fd(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-to(t),e[t]=r}function KI(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=wu),P2=String.fromCharCode(32),z2=!1;function F5(e,t){switch(e){case"keyup":return x8.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function V5(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var el=!1;function w8(e,t){switch(e){case"compositionend":return V5(t);case"keypress":return t.which!==32?null:(z2=!0,P2);case"textInput":return e=t.data,e===P2&&z2?null:e;default:return null}}function S8(e,t){if(el)return e==="compositionend"||!fy&&F5(e,t)?(e=H5(),qf=cy=Di=null,el=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=$2(r)}}function K5(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?K5(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function q5(){for(var e=window,t=Lp();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Lp(e.document)}return t}function py(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function R8(e){var t=q5(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&K5(r.ownerDocument.documentElement,r)){if(n!==null&&py(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=r.textContent.length,i=Math.min(n.start,o);n=n.end===void 0?i:Math.min(n.end,o),!e.extend&&i>n&&(o=n,n=i,i=o),o=H2(r,i);var s=H2(r,n);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,tl=null,m0=null,Eu=null,g0=!1;function B2(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;g0||tl==null||tl!==Lp(n)||(n=tl,"selectionStart"in n&&py(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Eu&&Xu(Eu,n)||(Eu=n,n=Vp(m0,"onSelect"),0ol||(e.current=w0[ol],w0[ol]=null,ol--)}function Ye(e,t){ol++,w0[ol]=e.current,e.current=t}var as={},pr=ys(as),Dr=ys(!1),aa=as;function Dl(e,t){var r=e.type.contextTypes;if(!r)return as;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in r)o[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function $r(e){return e=e.childContextTypes,e!=null}function Up(){tt(Dr),tt(pr)}function q2(e,t,r){if(pr.current!==as)throw Error($(168));Ye(pr,t),Ye(Dr,r)}function rM(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var o in n)if(!(o in t))throw Error($(108,TI(e)||"Unknown",o));return ut({},r,n)}function Wp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||as,aa=pr.current,Ye(pr,e),Ye(Dr,Dr.current),!0}function G2(e,t,r){var n=e.stateNode;if(!n)throw Error($(169));r?(e=rM(e,t,aa),n.__reactInternalMemoizedMergedChildContext=e,tt(Dr),tt(pr),Ye(pr,e)):tt(Dr),Ye(Dr,r)}var Uo=null,Xh=!1,Fg=!1;function nM(e){Uo===null?Uo=[e]:Uo.push(e)}function U8(e){Xh=!0,nM(e)}function bs(){if(!Fg&&Uo!==null){Fg=!0;var e=0,t=$e;try{var r=Uo;for($e=1;e>=s,o-=s,qo=1<<32-to(t)+o|r<T?(C=E,E=null):C=E.sibling;var M=f(v,E,y[T],x);if(M===null){E===null&&(E=C);break}e&&E&&M.alternate===null&&t(v,E),g=i(M,g,T),w===null?k=M:w.sibling=M,w=M,E=C}if(T===y.length)return r(v,E),ot&&Os(v,T),k;if(E===null){for(;TT?(C=E,E=null):C=E.sibling;var N=f(v,E,M.value,x);if(N===null){E===null&&(E=C);break}e&&E&&N.alternate===null&&t(v,E),g=i(N,g,T),w===null?k=N:w.sibling=N,w=N,E=C}if(M.done)return r(v,E),ot&&Os(v,T),k;if(E===null){for(;!M.done;T++,M=y.next())M=d(v,M.value,x),M!==null&&(g=i(M,g,T),w===null?k=M:w.sibling=M,w=M);return ot&&Os(v,T),k}for(E=n(v,E);!M.done;T++,M=y.next())M=p(E,v,T,M.value,x),M!==null&&(e&&M.alternate!==null&&E.delete(M.key===null?T:M.key),g=i(M,g,T),w===null?k=M:w.sibling=M,w=M);return e&&E.forEach(function(F){return t(v,F)}),ot&&Os(v,T),k}function b(v,g,y,x){if(typeof y=="object"&&y!==null&&y.type===Za&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case sf:e:{for(var k=y.key,w=g;w!==null;){if(w.key===k){if(k=y.type,k===Za){if(w.tag===7){r(v,w.sibling),g=o(w,y.props.children),g.return=v,v=g;break e}}else if(w.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Oi&&tw(k)===w.type){r(v,w.sibling),g=o(w,y.props),g.ref=Ec(v,w,y),g.return=v,v=g;break e}r(v,w);break}else t(v,w);w=w.sibling}y.type===Za?(g=ea(y.props.children,v.mode,x,y.key),g.return=v,v=g):(x=tp(y.type,y.key,y.props,null,v.mode,x),x.ref=Ec(v,g,y),x.return=v,v=x)}return s(v);case Qa:e:{for(w=y.key;g!==null;){if(g.key===w)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){r(v,g.sibling),g=o(g,y.children||[]),g.return=v,v=g;break e}else{r(v,g);break}else t(v,g);g=g.sibling}g=Yg(y,v.mode,x),g.return=v,v=g}return s(v);case Oi:return w=y._init,b(v,g,w(y._payload),x)}if(Wc(y))return h(v,g,y,x);if(bc(y))return m(v,g,y,x);vf(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(r(v,g.sibling),g=o(g,y),g.return=v,v=g):(r(v,g),g=Gg(y,v.mode,x),g.return=v,v=g),s(v)):r(v,g)}return b}var Hl=dM(!0),fM=dM(!1),Ud={},wo=ys(Ud),td=ys(Ud),rd=ys(Ud);function Ws(e){if(e===Ud)throw Error($(174));return e}function wy(e,t){switch(Ye(rd,t),Ye(td,e),Ye(wo,Ud),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:i0(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=i0(t,e)}tt(wo),Ye(wo,t)}function Bl(){tt(wo),tt(td),tt(rd)}function pM(e){Ws(rd.current);var t=Ws(wo.current),r=i0(t,e.type);t!==r&&(Ye(td,e),Ye(wo,r))}function Sy(e){td.current===e&&(tt(wo),tt(td))}var at=ys(0);function Xp(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vg=[];function Ey(){for(var e=0;er?r:4,e(!0);var n=jg.transition;jg.transition={};try{e(!1),t()}finally{$e=r,jg.transition=n}}function _M(){return zn().memoizedState}function G8(e,t,r){var n=Ji(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},AM(e))NM(t,r);else if(r=aM(e,t,r,n),r!==null){var o=wr();ro(r,e,n,o),RM(r,t,n)}}function Y8(e,t,r){var n=Ji(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(AM(e))NM(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,r);if(o.hasEagerState=!0,o.eagerState=a,so(a,s)){var l=t.interleaved;l===null?(o.next=o,xy(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}r=aM(e,t,o,n),r!==null&&(o=wr(),ro(r,e,n,o),RM(r,t,n))}}function AM(e){var t=e.alternate;return e===lt||t!==null&&t===lt}function NM(e,t){Cu=Qp=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function RM(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,sy(e,r)}}var Zp={readContext:Pn,useCallback:or,useContext:or,useEffect:or,useImperativeHandle:or,useInsertionEffect:or,useLayoutEffect:or,useMemo:or,useReducer:or,useRef:or,useState:or,useDebugValue:or,useDeferredValue:or,useTransition:or,useMutableSource:or,useSyncExternalStore:or,useId:or,unstable_isNewReconciler:!1},J8={readContext:Pn,useCallback:function(e,t){return ho().memoizedState=[e,t===void 0?null:t],e},useContext:Pn,useEffect:nw,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Xf(4194308,4,EM.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Xf(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xf(4,2,e,t)},useMemo:function(e,t){var r=ho();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ho();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=G8.bind(null,lt,e),[n.memoizedState,e]},useRef:function(e){var t=ho();return e={current:e},t.memoizedState=e},useState:rw,useDebugValue:_y,useDeferredValue:function(e){return ho().memoizedState=e},useTransition:function(){var e=rw(!1),t=e[0];return e=q8.bind(null,e[1]),ho().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=lt,o=ho();if(ot){if(r===void 0)throw Error($(407));r=r()}else{if(r=t(),Ht===null)throw Error($(349));ca&30||gM(n,t,r)}o.memoizedState=r;var i={value:r,getSnapshot:t};return o.queue=i,nw(yM.bind(null,n,i,e),[e]),n.flags|=2048,id(9,vM.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=ho(),t=Ht.identifierPrefix;if(ot){var r=Go,n=qo;r=(n&~(1<<32-to(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=nd++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=s.createElement(r,{is:n.is}):(e=s.createElement(r),r==="select"&&(s=e,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):e=s.createElementNS(e,r),e[bo]=t,e[Zu]=n,DM(e,t,!1,!1),t.stateNode=e;e:{switch(s=o0(r,n),r){case"dialog":et("cancel",e),et("close",e),o=n;break;case"iframe":case"object":case"embed":et("load",e),o=n;break;case"video":case"audio":for(o=0;oVl&&(t.flags|=128,n=!0,Ec(i,!1),t.lanes=4194304)}else{if(!n)if(e=Yp(s),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ec(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ot)return or(t),null}else 2*vt()-i.renderingStartTime>Vl&&r!==1073741824&&(t.flags|=128,n=!0,Ec(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(r=i.last,r!==null?r.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=vt(),t.sibling=null,r=at.current,Ye(at,n?r&1|2:r&1),t):(or(t),null);case 22:case 23:return Ry(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?en&1073741824&&(or(t),t.subtreeFlags&6&&(t.flags|=8192)):or(t),null;case 24:return null;case 25:return null}throw Error($(156,t.tag))}function X8(e,t){switch(fy(t),t.tag){case 1:return $r(t.type)&&Vp(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bl(),tt(Dr),tt(fr),ky(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return xy(t),null;case 13:if(tt(at),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error($(340));$l()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return tt(at),null;case 4:return Bl(),null;case 10:return gy(t.type._context),null;case 22:case 23:return Ry(),null;case 24:return null;default:return null}}var vf=!1,cr=!1,Q8=typeof WeakSet=="function"?WeakSet:Set,X=null;function ll(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){mt(e,t,n)}else r.current=null}function N0(e,t,r){try{r()}catch(n){mt(e,t,n)}}var cw=!1;function Z8(e,t){if(h0=$p,e=jC(),uy(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var o=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var p;d!==r||o!==0&&d.nodeType!==3||(a=s+o),d!==i||n!==0&&d.nodeType!==3||(l=s+n),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===r&&++c===o&&(a=s),f===i&&++u===n&&(l=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(m0={focusedElem:e,selectionRange:r},$p=!1,X=t;X!==null;)if(t=X,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,X=e;else for(;X!==null;){t=X;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,b=h.memoizedState,v=t.stateNode,g=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:qn(t.type,m),b);v.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error($(163))}}catch(x){mt(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,X=e;break}X=t.return}return h=cw,cw=!1,h}function Cu(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&N0(t,r,i)}o=o.next}while(o!==n)}}function Xh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function R0(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function BM(e){var t=e.alternate;t!==null&&(e.alternate=null,BM(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[bo],delete t[Zu],delete t[y0],delete t[L8],delete t[I8])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function FM(e){return e.tag===5||e.tag===3||e.tag===4}function uw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||FM(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function P0(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Fp));else if(n!==4&&(e=e.child,e!==null))for(P0(e,t,r),e=e.sibling;e!==null;)P0(e,t,r),e=e.sibling}function z0(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(z0(e,t,r),e=e.sibling;e!==null;)z0(e,t,r),e=e.sibling}var qt=null,Gn=!1;function vi(e,t,r){for(r=r.child;r!==null;)VM(e,t,r),r=r.sibling}function VM(e,t,r){if(ko&&typeof ko.onCommitFiberUnmount=="function")try{ko.onCommitFiberUnmount(jh,r)}catch{}switch(r.tag){case 5:cr||ll(r,t);case 6:var n=qt,o=Gn;qt=null,vi(e,t,r),qt=n,Gn=o,qt!==null&&(Gn?(e=qt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):qt.removeChild(r.stateNode));break;case 18:qt!==null&&(Gn?(e=qt,r=r.stateNode,e.nodeType===8?Dg(e.parentNode,r):e.nodeType===1&&Dg(e,r),Gu(e)):Dg(qt,r.stateNode));break;case 4:n=qt,o=Gn,qt=r.stateNode.containerInfo,Gn=!0,vi(e,t,r),qt=n,Gn=o;break;case 0:case 11:case 14:case 15:if(!cr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){o=n=n.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&N0(r,t,s),o=o.next}while(o!==n)}vi(e,t,r);break;case 1:if(!cr&&(ll(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){mt(r,t,a)}vi(e,t,r);break;case 21:vi(e,t,r);break;case 22:r.mode&1?(cr=(n=cr)||r.memoizedState!==null,vi(e,t,r),cr=n):vi(e,t,r);break;default:vi(e,t,r)}}function dw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Q8),t.forEach(function(n){var o=l9.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function jn(e,t){var r=t.deletions;if(r!==null)for(var n=0;no&&(o=s),n&=~i}if(n=o,n=vt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*t9(n/1960))-n,10e?16:e,$i===null)var n=!1;else{if(e=$i,$i=null,eh=0,Oe&6)throw Error($(331));var o=Oe;for(Oe|=4,X=e.current;X!==null;){var i=X,s=i.child;if(X.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lvt()-Ay?Zs(e,0):_y|=r),Hr(e,t)}function JM(e,t){t===0&&(e.mode&1?(t=lf,lf<<=1,!(lf&130023424)&&(lf=4194304)):t=1);var r=kr();e=oi(e,t),e!==null&&(Bd(e,t,r),Hr(e,r))}function a9(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),JM(e,r)}function l9(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:n=e.stateNode;break;default:throw Error($(314))}n!==null&&n.delete(t),JM(e,r)}var XM;XM=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dr.current)zr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return zr=!1,Y8(e,t,r);zr=!!(e.flags&131072)}else zr=!1,ot&&t.flags&1048576&&eM(t,Wp,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Jf(e,t),e=t.pendingProps;var o=Dl(t,fr.current);bl(t,r),o=Sy(null,t,n,e,o,r);var i=Ey();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,$r(n)?(i=!0,jp(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,yy(t),o.updater=Yh,t.stateNode=o,o._reactInternals=t,E0(t,n,e,r),t=T0(null,t,n,!0,i,r)):(t.tag=0,ot&&i&&dy(t),vr(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Jf(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=u9(n),e=qn(n,e),o){case 0:t=M0(null,t,n,e,r);break e;case 1:t=sw(null,t,n,e,r);break e;case 11:t=ow(null,t,n,e,r);break e;case 14:t=iw(null,t,n,qn(n.type,e),r);break e}throw Error($(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:qn(n,o),M0(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:qn(n,o),sw(e,t,n,o,r);case 3:e:{if(zM(t),e===null)throw Error($(387));n=t.pendingProps,i=t.memoizedState,o=i.element,oM(e,t),Gp(t,n,null,r);var s=t.memoizedState;if(n=s.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Fl(Error($(423)),t),t=aw(e,t,n,r,o);break e}else if(n!==o){o=Fl(Error($(424)),t),t=aw(e,t,n,r,o);break e}else for(an=qi(t.stateNode.containerInfo.firstChild),ln=t,ot=!0,Jn=null,r=lM(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if($l(),n===o){t=ii(e,t,r);break e}vr(e,t,n,r)}t=t.child}return t;case 5:return cM(t),e===null&&k0(t),n=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,g0(n,o)?s=null:i!==null&&g0(n,i)&&(t.flags|=32),PM(e,t),vr(e,t,s,r),t.child;case 6:return e===null&&k0(t),null;case 13:return LM(e,t,r);case 4:return by(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Hl(t,null,n,r):vr(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:qn(n,o),ow(e,t,n,o,r);case 7:return vr(e,t,t.pendingProps,r),t.child;case 8:return vr(e,t,t.pendingProps.children,r),t.child;case 12:return vr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Ye(Kp,n._currentValue),n._currentValue=s,i!==null)if(so(i.value,s)){if(i.children===o.children&&!Dr.current){t=ii(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=ei(-1,r&-r),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),w0(i.return,r,t),a.lanes|=r;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error($(341));s.lanes|=r,a=s.alternate,a!==null&&(a.lanes|=r),w0(s,r,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}vr(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,bl(t,r),o=Nn(o),n=n(o),t.flags|=1,vr(e,t,n,r),t.child;case 14:return n=t.type,o=qn(n,t.pendingProps),o=qn(n.type,o),iw(e,t,n,o,r);case 15:return NM(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:qn(n,o),Jf(e,t),t.tag=1,$r(n)?(e=!0,jp(t)):e=!1,bl(t,r),sM(t,n,o),E0(t,n,o,r),T0(null,t,n,!0,e,r);case 19:return IM(e,t,r);case 22:return RM(e,t,r)}throw Error($(156,t.tag))};function QM(e,t){return EC(e,t)}function c9(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mn(e,t,r,n){return new c9(e,t,r,n)}function zy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function u9(e){if(typeof e=="function")return zy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zv)return 11;if(e===ey)return 14}return 2}function Xi(e,t){var r=e.alternate;return r===null?(r=Mn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Zf(e,t,r,n,o,i){var s=2;if(n=e,typeof e=="function")zy(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Za:return ea(r.children,o,i,t);case Qv:s=8,o|=8;break;case G1:return e=Mn(12,r,t,o|2),e.elementType=G1,e.lanes=i,e;case Y1:return e=Mn(13,r,t,o),e.elementType=Y1,e.lanes=i,e;case J1:return e=Mn(19,r,t,o),e.elementType=J1,e.lanes=i,e;case aC:return Zh(r,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case iC:s=10;break e;case sC:s=9;break e;case Zv:s=11;break e;case ey:s=14;break e;case Oi:s=16,n=null;break e}throw Error($(130,e==null?e:typeof e,""))}return t=Mn(s,r,t,o),t.elementType=e,t.type=n,t.lanes=i,t}function ea(e,t,r,n){return e=Mn(7,e,n,t),e.lanes=r,e}function Zh(e,t,r,n){return e=Mn(22,e,n,t),e.elementType=aC,e.lanes=r,e.stateNode={isHidden:!1},e}function Wg(e,t,r){return e=Mn(6,e,null,t),e.lanes=r,e}function Kg(e,t,r){return t=Mn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function d9(e,t,r,n,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Mg(0),this.expirationTimes=Mg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mg(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Ly(e,t,r,n,o,i,s,a,l){return e=new d9(e,t,r,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Mn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},yy(i),e}function f9(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(rT)}catch(e){console.error(e)}}rT(),eC.exports=pn;var om=eC.exports;const xf=Ln(om);var v9=Object.defineProperty,y9=Object.getOwnPropertyDescriptor,b9=(e,t,r,n)=>{for(var o=n>1?void 0:n?y9(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&v9(t,r,o),o},nT=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},re=(e,t,r)=>(nT(e,t,"read from private field"),r?r.call(e):t.get(e)),Zr=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Xr=(e,t,r,n)=>(nT(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),qc,x9=class{constructor(){this.portals=new Map,Zr(this,qc,Bh()),this.on=e=>re(this,qc).on("update",e),this.once=e=>{const t=re(this,qc).on("update",r=>{t(),e(r)});return t}}update(){re(this,qc).emit("update",this.portals)}render({Component:e,container:t}){const r=this.portals.get(t);this.portals.set(t,{Component:e,key:(r==null?void 0:r.key)??Cl()}),this.update()}forceUpdate(){for(const[e,{Component:t}]of this.portals)this.portals.set(e,{Component:t,key:Cl()})}remove(e){this.portals.delete(e),this.update()}};qc=new WeakMap;var k9=e=>{const{portals:t}=e;return L.createElement(L.Fragment,null,t.map(([r,{Component:n,key:o}])=>om.createPortal(L.createElement(n,null),r,o)))};function w9(e){const[t,r]=S.useState(()=>Array.from(e.portals.entries()));return S.useEffect(()=>e.on(n=>{r(Array.from(n.entries()))}),[e]),S.useMemo(()=>t,[t])}var st,Gc,As,Yc,ep,Jc,Ka,Xc,tp,Ho,gr,H0,oT=class{constructor({getPosition:e,node:t,portalContainer:r,view:n,ReactComponent:o,options:i}){Zr(this,st,void 0),Zr(this,Gc,[]),Zr(this,As,void 0),Zr(this,Yc,void 0),Zr(this,ep,void 0),Zr(this,Jc,void 0),Zr(this,Ka,void 0),Zr(this,Xc,!1),Zr(this,tp,void 0),Zr(this,Ho,void 0),Zr(this,gr,void 0),Zr(this,H0,l=>{l&&(te(re(this,Ho),{code:H.REACT_NODE_VIEW,message:`You have applied a ref to a node view provided for '${re(this,st).type.name}' which doesn't support content.`}),l.append(re(this,Ho)))}),this.Component=()=>{const l=re(this,ep);return te(l,{code:H.REACT_NODE_VIEW,message:`The custom react node view provided for ${re(this,st).type.name} doesn't have a valid ReactComponent`}),L.createElement(l,{updateAttributes:this.updateAttributes,selected:this.selected,view:re(this,As),getPosition:re(this,Jc),node:re(this,st),forwardRef:re(this,H0),decorations:re(this,Gc)})},this.updateAttributes=l=>{if(!re(this,As).editable)return;const c=re(this,Jc).call(this);if(c==null)return;const u=re(this,As).state.tr.setNodeMarkup(c,void 0,{...re(this,st).attrs,...l});re(this,As).dispatch(u)},te(_e(e),{message:"You are attempting to use a node view for a mark type. This is not supported yet. Please check your configuration."}),Xr(this,st,t),Xr(this,As,n),Xr(this,Yc,r),Xr(this,ep,o),Xr(this,Jc,e),Xr(this,Ka,i),Xr(this,gr,this.createDom());const{contentDOM:s,wrapper:a}=this.createContentDom()??{};Xr(this,tp,s??void 0),Xr(this,Ho,a),re(this,Ho)&&re(this,gr).append(re(this,Ho)),this.setDomAttributes(re(this,st),re(this,gr)),this.Component.displayName=$4(`${re(this,st).type.name}NodeView`),this.renderComponent()}static create(e){const{portalContainer:t,ReactComponent:r,options:n}=e;return(o,i,s)=>new oT({options:n,node:o,view:i,getPosition:s,portalContainer:t,ReactComponent:r})}get selected(){return re(this,Xc)}get contentDOM(){return re(this,tp)}get dom(){return re(this,gr)}renderComponent(){re(this,Yc).render({Component:this.Component,container:re(this,gr)})}createDom(){const{defaultBlockNode:e,defaultInlineNode:t}=re(this,Ka),r=re(this,st).isInline?document.createElement(t):document.createElement(e);return r.classList.add(`${Gx(re(this,st).type.name)}-node-view-wrapper`),r}createContentDom(){var e,t;if(re(this,st).isLeaf)return;const r=(t=(e=re(this,st).type.spec).toDOM)==null?void 0:t.call(e,re(this,st));if(!r)return;const{contentDOM:n,dom:o}=sn.renderSpec(document,r);let i;if(Je(o))return i=o,o===n&&(i=document.createElement("span"),i.classList.add(`${Gx(re(this,st).type.name)}-node-view-content-wrapper`),i.append(n)),Je(n),{wrapper:i,contentDOM:n}}update(e,t){return Lh({types:re(this,st).type,node:e})?(re(this,st)===e&&re(this,Gc)===t||(re(this,st).sameMarkup(e)||this.setDomAttributes(e,re(this,gr)),Xr(this,st,e),Xr(this,Gc,t),this.renderComponent()),!0):!1}setDomAttributes(e,t){const{toDOM:r}=re(this,st).type.spec;let n=e.attrs;if(r){const o=r(e);if(ne(o)||S9(o))return;hs(o[1])&&(n=o[1])}for(const[o,i]of At(n))t.setAttribute(o,i)}selectNode(){Xr(this,Xc,!0),re(this,gr)&&re(this,gr).classList.add(Ux),this.renderComponent()}deselectNode(){Xr(this,Xc,!1),re(this,gr)&&re(this,gr).classList.remove(Ux),this.renderComponent()}destroy(){re(this,Yc).remove(re(this,gr))}ignoreMutation(e){return e.type==="selection"?!re(this,st).type.spec.selectable:re(this,Ho)?!re(this,Ho).contains(e.target):!0}stopEvent(e){var t;if(!re(this,gr))return!1;if(_e(re(this,Ka).stopEvent))return re(this,Ka).stopEvent({event:e});const r=e.target;if(!(re(this,gr).contains(r)&&!((t=this.contentDOM)!=null&&t.contains(r))))return!1;const o=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o)return!0;const s=!!re(this,st).type.spec.draggable,a=ce.isSelectable(re(this,st)),l=e.type==="copy",c=e.type==="paste",u=e.type==="cut",d=e.type==="mousedown",f=e.type.startsWith("drag");return!s&&a&&f&&e.preventDefault(),!(f||o||l||c||u||d&&a)}},bw=oT;st=new WeakMap;Gc=new WeakMap;As=new WeakMap;Yc=new WeakMap;ep=new WeakMap;Jc=new WeakMap;Ka=new WeakMap;Xc=new WeakMap;tp=new WeakMap;Ho=new WeakMap;gr=new WeakMap;H0=new WeakMap;function S9(e){return Op(e)||hs(e)&&Op(e.dom)}var sd=class extends Ve{constructor(){super(...arguments),this.portalContainer=new x9}get name(){return"reactComponent"}onCreate(){this.store.setStoreKey("portalContainer",this.portalContainer)}createNodeViews(){const e=ee(),t=this.store.managerSettings.nodeViewComponents??{};for(const n of this.store.extensions)!n.ReactComponent||!$d(n)||n.reactComponentEnvironment==="ssr"||(e[n.name]=bw.create({options:this.options,ReactComponent:n.ReactComponent,portalContainer:this.portalContainer}));const r=At({...this.options.nodeViewComponents,...t});for(const[n,o]of r)e[n]=bw.create({options:this.options,ReactComponent:o,portalContainer:this.portalContainer});return e}};sd=b9([me({defaultOptions:{defaultBlockNode:"div",defaultInlineNode:"span",defaultContentNode:"span",defaultEnvironment:"both",nodeViewComponents:{},stopEvent:null},staticKeys:["defaultBlockNode","defaultInlineNode","defaultContentNode","defaultEnvironment"]})],sd);function E9(e){const t=S.createContext(null),r=C9(t);return[o=>{const i=e(o);return L.createElement(t.Provider,{value:i},o.children)},r,t]}function C9(e){return(t,r)=>{const n=S.useContext(e),o=M9(n);if(!n)throw new Error("`useContextHook` must be placed inside the `Provider` returned by the `createContextState` method");if(!t)return n;if(typeof t!="function")throw new TypeError("invalid arguments passed to `useContextHook`. This hook must be called with zero arguments, a getter function or a path string.");const i=t(n);if(!o||!r)return i;const s=t(o);return r(s,i)?s:i}}function M9(e){const t=S.useRef();return T9(()=>{t.current=e}),t.current}var T9=typeof document<"u"?S.useLayoutEffect:S.useEffect;function O9(e,t){return E9(r=>{const n=S.useRef(null),o=S.useRef(),i=t==null?void 0:t(r),[s,a]=S.useState(()=>e({get:xw(n),set:kw(o),previousContext:void 0,props:r,state:i})),l=[...Object.values(r),i];return S.useEffect(()=>{l.length!==0&&a(c=>e({get:xw(n),set:kw(o),previousContext:c,props:r,state:i}))},l),n.current=s,o.current=a,s})}function xw(e){return t=>{if(!e.current)throw new Error("`get` called outside of function scope. `get` can only be called within a function.");if(!t)return e.current;if(typeof t!="function")throw new TypeError("Invalid arguments passed to `useContextHook`. The hook must be called with zero arguments, a getter function or a path string.");return t(e.current)}}function kw(e){return t=>{if(!e.current)throw new Error("`set` called outside of function scope. `set` can only be called within a function.");e.current(r=>({...r,...typeof t=="function"?t(r):t}))}}var iT={},sT={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorMessages=e.ErrorType=void 0;var t;(function(r){r.MalformedUnicode="MALFORMED_UNICODE",r.MalformedHexadecimal="MALFORMED_HEXADECIMAL",r.CodePointLimit="CODE_POINT_LIMIT",r.OctalDeprecation="OCTAL_DEPRECATION",r.EndOfString="END_OF_STRING"})(t=e.ErrorType||(e.ErrorType={})),e.errorMessages=new Map([[t.MalformedUnicode,"malformed Unicode character escape sequence"],[t.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[t.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[t.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[t.EndOfString,"malformed escape sequence at end of string"]])})(sT);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.unraw=e.errorMessages=e.ErrorType=void 0;const t=sT;Object.defineProperty(e,"ErrorType",{enumerable:!0,get:function(){return t.ErrorType}}),Object.defineProperty(e,"errorMessages",{enumerable:!0,get:function(){return t.errorMessages}});function r(p){return!p.match(/[^a-f0-9]/i)?parseInt(p,16):NaN}function n(p,h,m){const b=r(p);if(Number.isNaN(b)||m!==void 0&&m!==p.length)throw new SyntaxError(t.errorMessages.get(h));return b}function o(p){const h=n(p,t.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(h)}function i(p,h){const m=n(p,t.ErrorType.MalformedUnicode,4);if(h!==void 0){const b=n(h,t.ErrorType.MalformedUnicode,4);return String.fromCharCode(m,b)}return String.fromCharCode(m)}function s(p){return p.charAt(0)==="{"&&p.charAt(p.length-1)==="}"}function a(p){if(!s(p))throw new SyntaxError(t.errorMessages.get(t.ErrorType.MalformedUnicode));const h=p.slice(1,-1),m=n(h,t.ErrorType.MalformedUnicode);try{return String.fromCodePoint(m)}catch(b){throw b instanceof RangeError?new SyntaxError(t.errorMessages.get(t.ErrorType.CodePointLimit)):b}}function l(p,h=!1){if(h)throw new SyntaxError(t.errorMessages.get(t.ErrorType.OctalDeprecation));const m=parseInt(p,8);return String.fromCharCode(m)}const c=new Map([["b","\b"],["f","\f"],["n",` -`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function u(p){return c.get(p)||p}const d=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function f(p,h=!1){return p.replace(d,function(m,b,v,g,y,x,k,w,E){if(b!==void 0)return"\\";if(v!==void 0)return o(v);if(g!==void 0)return a(g);if(y!==void 0)return i(y,x);if(k!==void 0)return i(k);if(w==="0")return"\0";if(w!==void 0)return l(w,!h);if(E!==void 0)return u(E);throw new SyntaxError(t.errorMessages.get(t.ErrorType.EndOfString))})}e.unraw=f,e.default=f})(iT);const _9=Ln(iT),Yo=e=>typeof e=="string",A9=e=>typeof e=="function",ww=new Map;function Hy(e){return[...Array.isArray(e)?e:[e],"en"]}function aT(e,t,r){const n=Hy(e);return nh(()=>oh("date",n,r),()=>new Intl.DateTimeFormat(n,r)).format(Yo(t)?new Date(t):t)}function B0(e,t,r){const n=Hy(e);return nh(()=>oh("number",n,r),()=>new Intl.NumberFormat(n,r)).format(t)}function Sw(e,t,r,{offset:n=0,...o}){const i=Hy(e),s=t?nh(()=>oh("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):nh(()=>oh("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return o[r]??o[s.select(r-n)]??o.other}function nh(e,t){const r=e();let n=ww.get(r);return n||(n=t(),ww.set(r,n)),n}function oh(e,t,r){const n=t.join("-");return`${e}-${n}-${JSON.stringify(r)}`}const lT=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g,N9=(e,t,r={})=>{t=t||e;const n=i=>Yo(i)?r[i]||{style:i}:i,o=(i,s)=>{const a=Object.keys(r).length?n("number"):{},l=B0(t,i,a);return s.replace("#",l)};return{plural:(i,s)=>{const{offset:a=0}=s,l=Sw(t,!1,i,s);return o(i-a,l)},selectordinal:(i,s)=>{const{offset:a=0}=s,l=Sw(t,!0,i,s);return o(i-a,l)},select:(i,s)=>s[i]??s.other,number:(i,s)=>B0(t,i,n(s)),date:(i,s)=>aT(t,i,n(s)),undefined:i=>i}};function R9(e,t,r){return(n,o={})=>{const i=N9(t,r,o),s=l=>Array.isArray(l)?l.reduce((c,u)=>{if(Yo(u))return c+u;const[d,f,p]=u;let h={};p!=null&&!Yo(p)?Object.keys(p).forEach(b=>{h[b]=s(p[b])}):h=p;const m=i[f](n[d],h);return m==null?c:c+m},""):l,a=s(e);return Yo(a)&&lT.test(a)?_9(a.trim()):Yo(a)?a.trim():a}}var P9=Object.defineProperty,z9=(e,t,r)=>t in e?P9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,L9=(e,t,r)=>(z9(e,typeof t!="symbol"?t+"":t,r),r);class I9{constructor(){L9(this,"_events",{})}on(t,r){return this._hasEvent(t)||(this._events[t]=[]),this._events[t].push(r),()=>this.removeListener(t,r)}removeListener(t,r){if(!this._hasEvent(t))return;const n=this._events[t].indexOf(r);~n&&this._events[t].splice(n,1)}emit(t,...r){this._hasEvent(t)&&this._events[t].map(n=>n.apply(this,r))}_hasEvent(t){return Array.isArray(this._events[t])}}var D9=Object.defineProperty,$9=(e,t,r)=>t in e?D9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pa=(e,t,r)=>($9(e,typeof t!="symbol"?t+"":t,r),r);class H9 extends I9{constructor(t){super(),Pa(this,"_locale"),Pa(this,"_locales"),Pa(this,"_localeData"),Pa(this,"_messages"),Pa(this,"_missing"),Pa(this,"t",this._.bind(this)),this._messages={},this._localeData={},t.missing!=null&&(this._missing=t.missing),t.messages!=null&&this.load(t.messages),t.localeData!=null&&this.loadLocaleData(t.localeData),(t.locale!=null||t.locales!=null)&&this.activate(t.locale,t.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(t,r){this._localeData[t]==null?this._localeData[t]=r:Object.assign(this._localeData[t],r)}loadLocaleData(t,r){r!=null?this._loadLocaleData(t,r):Object.keys(t).forEach(n=>this._loadLocaleData(n,t[n])),this.emit("change")}_load(t,r){this._messages[t]==null?this._messages[t]=r:Object.assign(this._messages[t],r)}load(t,r){r!=null?this._load(t,r):Object.keys(t).forEach(n=>this._load(n,t[n])),this.emit("change")}loadAndActivate({locale:t,locales:r,messages:n}){this._locale=t,this._locales=r||void 0,this._messages[this._locale]=n,this.emit("change")}activate(t,r){this._locale=t,this._locales=r,this.emit("change")}_(t,r={},{message:n,formats:o}={}){Yo(t)||(r=t.values||r,n=t.message,t=t.id);const i=!this.messages[t],s=this._missing;if(s&&i)return A9(s)?s(this._locale,t):s;i&&this.emit("missing",{id:t,locale:this._locale});let a=this.messages[t]||n||t;return Yo(a)&&lT.test(a)?JSON.parse(`"${a}"`):Yo(a)?a:R9(a,this._locale,this._locales)(r,o)}date(t,r){return aT(this._locales||this._locale,t,r)}number(t,r){return B0(this._locales||this._locale,t,r)}}function B9(e={}){return new H9(e)}const im=B9();function W(e,t){return t?"other":e==1?"one":"other"}function ui(e,t){return t?"other":e==0||e==1?"one":"other"}function Kr(e,t){var r=String(e).split("."),n=!r[1];return t?"other":e==1&&n?"one":"other"}function Le(e,t){return"other"}function xs(e,t){return t?"other":e==1?"one":e==2?"two":"other"}const F9=Le,V9=W,j9=ui;function U9(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const W9=W;function K9(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function q9(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function G9(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const Y9=W,J9=Kr;function X9(e,t){var r=String(e).split("."),n=r[0],o=n.slice(-1),i=n.slice(-2),s=n.slice(-3);return t?o==1||o==2||o==5||o==7||o==8||i==20||i==50||i==70||i==80?"one":o==3||o==4||s==100||s==200||s==300||s==400||s==500||s==600||s==700||s==800||s==900?"few":n==0||o==6||i==40||i==60||i==90?"many":"other":e==1?"one":"other"}function Q9(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2);return t?(o==2||o==3)&&i!=12&&i!=13?"few":"other":o==1&&i!=11?"one":o>=2&&o<=4&&(i<12||i>14)?"few":n&&o==0||o>=5&&o<=9||i>=11&&i<=14?"many":"other"}const Z9=W,eD=W,tD=W,rD=ui,nD=Le;function oD(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const iD=Le;function sD(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2),s=n&&r[0].slice(-6);return t?"other":o==1&&i!=11&&i!=71&&i!=91?"one":o==2&&i!=12&&i!=72&&i!=92?"two":(o==3||o==4||o==9)&&(i<10||i>19)&&(i<70||i>79)&&(i<90||i>99)?"few":e!=0&&n&&s==0?"many":"other"}const aD=W;function lD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function cD(e,t){var r=String(e).split("."),n=!r[1];return t?e==1||e==3?"one":e==2?"two":e==4?"few":"other":e==1&&n?"one":"other"}const uD=W;function dD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const fD=W,pD=W,hD=W;function mD(e,t){var r=String(e).split("."),n=r[0],o=!r[1];return t?"other":e==1&&o?"one":n>=2&&n<=4&&o?"few":o?"other":"many"}function gD(e,t){return t?e==0||e==7||e==8||e==9?"zero":e==1?"one":e==2?"two":e==3||e==4?"few":e==5||e==6?"many":"other":e==0?"zero":e==1?"one":e==2?"two":e==3?"few":e==6?"many":"other"}function vD(e,t){var r=String(e).split("."),n=r[0],o=Number(r[0])==e;return t?"other":e==1||!o&&(n==0||n==1)?"one":"other"}const yD=Kr;function bD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}const xD=W,kD=Le,wD=W,SD=W;function ED(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?i==1&&s!=11?"one":i==2&&s!=12?"two":i==3&&s!=13?"few":"other":e==1&&n?"one":"other"}const CD=W,MD=W,TD=Kr,OD=W;function _D(e,t){return t?"other":e>=0&&e<=1?"one":"other"}function AD(e,t){return t?"other":e>=0&&e<2?"one":"other"}const ND=Kr;function RD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const PD=W;function zD(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const LD=W,ID=Kr;function DD(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1?"one":"other":e==1?"one":e==2?"two":n&&e>=3&&e<=6?"few":n&&e>=7&&e<=10?"many":"other"}function $D(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1||e==11?"one":e==2||e==12?"two":e==3||e==13?"few":"other":e==1||e==11?"one":e==2||e==12?"two":n&&e>=3&&e<=10||n&&e>=13&&e<=19?"few":"other"}const HD=Kr,BD=W;function FD(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const VD=ui;function jD(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(s==0||s==20||s==40||s==60||s==80)?"few":o?"other":"many"}const UD=W,WD=W;function KD(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1);return t?"other":e==1&&o?"one":n==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}function qD(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}function GD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function YD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}function JD(e,t){return t?e==1||e==5?"one":"other":e==1?"one":"other"}function XD(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const QD=Kr,ZD=Le,e7=Le,t7=Le,r7=Kr;function n7(e,t){var r=String(e).split("."),n=r[0],o=Number(r[0])==e,i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1&&s!=11||!o?"one":"other"}function o7(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}const i7=xs;function s7(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1);return t?"other":e==1&&o?"one":n==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}const a7=Le,l7=Le,c7=W,u7=Kr,d7=W,f7=Le,p7=Le;function h7(e,t){var r=String(e).split("."),n=r[0],o=n.slice(-2);return t?n==1?"one":n==0||o>=2&&o<=20||o==40||o==60||o==80?"many":"other":e==1?"one":"other"}function m7(e,t){return t?"other":e>=0&&e<2?"one":"other"}const g7=W,v7=W,y7=Le,b7=Le;function x7(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1);return t?o==6||o==9||n&&o==0&&e!=0?"many":"other":e==1?"one":"other"}const k7=W,w7=W,S7=Le;function E7(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const C7=Le,M7=W,T7=W;function O7(e,t){return t?"other":e==0?"zero":e==1?"one":"other"}const _7=W;function A7(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2),i=n&&r[0].slice(-3),s=n&&r[0].slice(-5),a=n&&r[0].slice(-6);return t?n&&e>=1&&e<=4||o>=1&&o<=4||o>=21&&o<=24||o>=41&&o<=44||o>=61&&o<=64||o>=81&&o<=84?"one":e==5||o==5?"many":"other":e==0?"zero":e==1?"one":o==2||o==22||o==42||o==62||o==82||n&&i==0&&(s>=1e3&&s<=2e4||s==4e4||s==6e4||s==8e4)||e!=0&&a==1e5?"two":o==3||o==23||o==43||o==63||o==83?"few":e!=1&&(o==1||o==21||o==41||o==61||o==81)?"many":"other"}const N7=W;function R7(e,t){var r=String(e).split("."),n=r[0];return t?"other":e==0?"zero":(n==0||n==1)&&e!=0?"one":"other"}const P7=W,z7=W,L7=Le,I7=ui;function D7(e,t){return t&&e==1?"one":"other"}function $7(e,t){var r=String(e).split("."),n=r[1]||"",o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?"other":i==1&&(s<11||s>19)?"one":i>=2&&i<=9&&(s<11||s>19)?"few":n!=0?"many":"other"}function H7(e,t){var r=String(e).split("."),n=r[1]||"",o=n.length,i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const B7=W,F7=ui,V7=W;function j7(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?s==1&&a!=11?"one":s==2&&a!=12?"two":(s==7||s==8)&&a!=17&&a!=18?"many":"other":i&&s==1&&a!=11||l==1&&c!=11?"one":"other"}const U7=W,W7=W;function K7(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-2);return t?e==1?"one":"other":e==1&&n?"one":!n||e==0||i>=2&&i<=19?"few":"other"}function q7(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":"other":e==1?"one":"other"}function G7(e,t){return t&&e==1?"one":"other"}function Y7(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==1?"one":e==0||o>=2&&o<=10?"few":o>=11&&o<=19?"many":"other"}const J7=Le,X7=W,Q7=xs,Z7=W,e$=W;function t$(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?n&&e>=1&&e<=4?"one":"other":e==1?"one":"other"}const r$=Kr,n$=W,o$=W,i$=W,s$=Le,a$=W,l$=ui,c$=W,u$=W,d$=W;function f$(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1||e==5||n&&e>=7&&e<=9?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e==1?"one":"other"}const p$=W,h$=Le,m$=ui,g$=W;function v$(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":e==1&&o?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&n!=1&&(i==0||i==1)||o&&i>=5&&i<=9||o&&s>=12&&s<=14?"many":"other"}function y$(e,t){var r=String(e).split("."),n=r[1]||"",o=n.length,i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const b$=W;function x$(e,t){var r=String(e).split("."),n=r[0];return t?"other":n==0||n==1?"one":"other"}const k$=Kr,w$=W;function S$(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-2);return t?e==1?"one":"other":e==1&&n?"one":!n||e==0||i>=2&&i<=19?"few":"other"}const E$=W,C$=Le;function M$(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1&&s!=11?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&i==0||o&&i>=5&&i<=9||o&&s>=11&&s<=14?"many":"other"}const T$=W,O$=Le,_$=W;function A$(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}function N$(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}const R$=W,P$=W,z$=xs,L$=W,I$=Le,D$=Le;function $$(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function H$(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?"other":e>=0&&e<=1?"one":n&&e>=2&&e<=10?"few":"other"}function B$(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"";return t?"other":e==0||e==1||n==0&&o==1?"one":"other"}function F$(e,t){var r=String(e).split("."),n=r[0],o=!r[1];return t?"other":e==1&&o?"one":n>=2&&n<=4&&o?"few":o?"other":"many"}function V$(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(i==3||i==4)||!o?"few":"other"}const j$=xs,U$=xs,W$=xs,K$=xs,q$=xs,G$=W,Y$=W;function J$(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2);return t?e==1?"one":o==4&&i!=14?"many":"other":e==1?"one":"other"}function X$(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}const Q$=W,Z$=W,eH=W,tH=Le;function rH(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?(i==1||i==2)&&s!=11&&s!=12?"one":"other":e==1&&n?"one":"other"}const nH=Kr,oH=W,iH=W,sH=W,aH=W,lH=Le,cH=ui,uH=W;function dH(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1);return t?o==6||o==9||e==10?"few":"other":e==1?"one":"other"}function fH(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const pH=W,hH=Le,mH=W,gH=W;function vH(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?"other":e==0||e==1||n&&e>=11&&e<=99?"one":"other"}const yH=W;function bH(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-1),c=n.slice(-2);return t?s==3&&a!=13?"few":"other":o&&l==1&&c!=11?"one":o&&l>=2&&l<=4&&(c<12||c>14)?"few":o&&l==0||o&&l>=5&&l<=9||o&&c>=11&&c<=14?"many":"other"}const xH=Kr,kH=W,wH=W;function SH(e,t){return t&&e==1?"one":"other"}const EH=W,CH=W,MH=ui,TH=W,OH=Le,_H=W,AH=W,NH=Kr,RH=Le,PH=Le,zH=Le;function LH(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const IH=Object.freeze(Object.defineProperty({__proto__:null,_in:F9,af:V9,ak:j9,am:U9,an:W9,ar:K9,ars:q9,as:G9,asa:Y9,ast:J9,az:X9,be:Q9,bem:Z9,bez:eD,bg:tD,bho:rD,bm:nD,bn:oD,bo:iD,br:sD,brx:aD,bs:lD,ca:cD,ce:uD,ceb:dD,cgg:fD,chr:pD,ckb:hD,cs:mD,cy:gD,da:vD,de:yD,dsb:bD,dv:xD,dz:kD,ee:wD,el:SD,en:ED,eo:CD,es:MD,et:TD,eu:OD,fa:_D,ff:AD,fi:ND,fil:RD,fo:PD,fr:zD,fur:LD,fy:ID,ga:DD,gd:$D,gl:HD,gsw:BD,gu:FD,guw:VD,gv:jD,ha:UD,haw:WD,he:KD,hi:qD,hr:GD,hsb:YD,hu:JD,hy:XD,ia:QD,id:ZD,ig:e7,ii:t7,io:r7,is:n7,it:o7,iu:i7,iw:s7,ja:a7,jbo:l7,jgo:c7,ji:u7,jmc:d7,jv:f7,jw:p7,ka:h7,kab:m7,kaj:g7,kcg:v7,kde:y7,kea:b7,kk:x7,kkj:k7,kl:w7,km:S7,kn:E7,ko:C7,ks:M7,ksb:T7,ksh:O7,ku:_7,kw:A7,ky:N7,lag:R7,lb:P7,lg:z7,lkt:L7,ln:I7,lo:D7,lt:$7,lv:H7,mas:B7,mg:F7,mgo:V7,mk:j7,ml:U7,mn:W7,mo:K7,mr:q7,ms:G7,mt:Y7,my:J7,nah:X7,naq:Q7,nb:Z7,nd:e$,ne:t$,nl:r$,nn:n$,nnh:o$,no:i$,nqo:s$,nr:a$,nso:l$,ny:c$,nyn:u$,om:d$,or:f$,os:p$,osa:h$,pa:m$,pap:g$,pl:v$,prg:y$,ps:b$,pt:x$,pt_PT:k$,rm:w$,ro:S$,rof:E$,root:C$,ru:M$,rwk:T$,sah:O$,saq:_$,sc:A$,scn:N$,sd:R$,sdh:P$,se:z$,seh:L$,ses:I$,sg:D$,sh:$$,shi:H$,si:B$,sk:F$,sl:V$,sma:j$,smi:U$,smj:W$,smn:K$,sms:q$,sn:G$,so:Y$,sq:J$,sr:X$,ss:Q$,ssy:Z$,st:eH,su:tH,sv:rH,sw:nH,syr:oH,ta:iH,te:sH,teo:aH,th:lH,ti:cH,tig:uH,tk:dH,tl:fH,tn:pH,to:hH,tr:mH,ts:gH,tzm:vH,ug:yH,uk:bH,ur:xH,uz:kH,ve:wH,vi:SH,vo:EH,vun:CH,wa:MH,wae:TH,wo:OH,xh:_H,xog:AH,yi:NH,yo:RH,yue:PH,zh:zH,zu:LH},Symbol.toStringTag,{value:"Module"}));var DH=Object.defineProperty,$H=Object.getOwnPropertyDescriptor,HH=Object.getOwnPropertyNames,BH=Object.prototype.hasOwnProperty,Ew=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of HH(t))!BH.call(e,o)&&o!==r&&DH(e,o,{get:()=>t[o],enumerable:!(n=$H(t,o))||n.enumerable});return e},FH=(e,t,r)=>(Ew(e,t,"default"),r&&Ew(r,t,"default")),VH=JSON.parse('{"extension.command.toggle-upper-case.label":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"extension.table.column_count":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"extension.table.row_count":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.toggle-columns.description":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"extension.command.toggle-columns.label":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"extension.command.set-text-direction.label":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"extension.command.set-text-direction.description":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"extension.command.toggle-heading.label":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"extension.command.toggle-callout.description":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"extension.command.toggle-callout.label":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"extension.command.toggle-code-block.description":"Add a code block","extension.command.add-annotation.label":"Add annotation","extension.command.toggle-blockquote.description":"Add blockquote formatting to the selected text","extension.command.toggle-bold.description":"Add bold formatting to the selected text","extension.command.toggle-code.description":"Add inline code formatting to the selected text","keyboard.shortcut.alt":"Alt","keyboard.shortcut.arrowDown":"Arrow Down","keyboard.shortcut.arrowLeft":"Arrow Left","keyboard.shortcut.arrowRight":"Arrow Right","keyboard.shortcut.arrowUp":"Arrow Up","keyboard.shortcut.backspace":"Backspace","ui.text-color.black":"Black","extension.command.toggle-blockquote.label":"Blockquote","ui.text-color.blue":"Blue","ui.text-color.blue.hue":["Blue ",["hue"]],"extension.command.toggle-bold.label":"Bold","extension.command.toggle-bullet-list.description":"Bulleted list","keyboard.shortcut.capsLock":"Caps Lock","extension.command.center-align.label":"Center align","extension.command.toggle-code.label":"Code","extension.command.toggle-code-block.label":"Codeblock","keyboard.shortcut.command":"Command","QcPNd6":"Image description","ogrUzJ":"Add a short description here.","yqdyzr":"Image","6/02F4":"Image source","X8H91v":"Image","zhQ7Zt":"Italic","ZL7E7l":"Underline","keyboard.shortcut.control":"Control","extension.command.convert-paragraph.description":"Convert current block into a paragraph block.","extension.command.convert-paragraph.label":"Convert Paragraph","extension.command.copy.label":"Copy","extension.command.copy.description":"Copy the selected text","extension.command.create-table.description":"Create a table with set number of rows and columns.","extension.command.create-table.label":"Create table","extension.command.cut.label":"Cut","extension.command.cut.description":"Cut the selected text","ui.text-color.cyan":"Cyan","ui.text-color.cyan.hue":["Cyan ",["hue"]],"extension.command.decrease-font-size.label":"Decrease","extension.command.decrease-indent.label":"Decrease indentation","extension.command.decrease-font-size.description":"Decrease the font size.","keyboard.shortcut.delete":"Delete","extension.command.insert-horizontal-rule.label":"Divider","keyboard.shortcut.end":"End","keyboard.shortcut.escape":"Enter","keyboard.shortcut.enter":"Enter","6PjrOF":"Add annotation","OTq5WC":"Center align","oeZ3ox":"Convert current block into a paragraph block.","m1khs+":"Convert Paragraph","w/1U+3":"Copy the selected text","kdodi0":"Copy","k0KR/u":"Create a table with set number of rows and columns.","zrwMyD":"Create table","D/nWxh":"Cut the selected text","jHPv5m":"Cut","5cNgRx":"Decrease the font size.","vyRNWx":"Decrease","Jgiol4":"Decrease indentation","1gJSHH":"Increase the font size","OQXJXz":"Increase","72TLhr":"Increase indentation","HFlfzJ":"Insert Emoji","RPq9fY":"Separate content with a diving horizontal line","OKQF+e":"Divider","zjYb9C":"Insert a new paragraph","4M4sXC":"Insert Paragraph","1Q+eVc":"Justify","ejWWtP":"Left align","wVqrpS":"Paste content into the editor","07v9aw":"Paste","zUYfou":"Redo the most recent action","9Nq9zr":"Redo","0uxaZe":"Remove annotation","iJWZAz":"Right align","g5WpPn":"Select all content within the editor","2+pZDT":"Select all","yChCR1":"Set text case","GMzAC/":"Set the font size for the selected text.","vzEyrv":"Font size","7VCkJ8":"Set the text color for the selected text.","qjWFaR":"Text color","LVWgFu":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"WXwRy1":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"G/o315":"Set the text highlight color for the selected text.","xtHg6d":"Text highlight","1p1W/p":"Add blockquote formatting to the selected text","6+rh6I":"Blockquote","0yB3LV":"Add bold formatting to the selected text","sFMo4Z":"Bold","SMKG/s":"Bulleted list","/BYCMi":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"V+3IBe":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"hbIo4L":"Add a code block","7GkMcx":"Codeblock","2r4JYl":"Add inline code formatting to the selected text","Up8Tpe":"Code","ATHSPS":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"7DC1VE":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"hnrBeo":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"NkZAcw":"Italicize the selected text","2fTW9e":"Italic","c759Ra":"Ordered list","uQwrZu":"Strikethrough the selected text","pT3qly":"Strikethrough","BHk+zu":"Subscript","18BVwM":"Superscript","tOIVCV":"Tasked list","4Janx3":"Underline the selected text","dCHt+D":"Underline","YYAprs":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"tczyZL":"Show hidden whitespace characters in your editor.","0qAX23":"Toggle Whitespace","ezMADU":"Undo the most recent action","N3P7EC":"Undo","2nj/+s":"Update annotation","dWD7u4":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"qXqgVT":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.set-font-size.label":"Font size","ui.text-color.grape":"Grape","ui.text-color.grape.hue":["Grape ",["hue"]],"ui.text-color.gray":"Gray","ui.text-color.gray.hue":["Gray ",["hue"]],"ui.text-color.green":"Green","ui.text-color.green.hue":["Green ",["hue"]],"keyboard.shortcut.home":"Home","extension.command.increase-font-size.label":"Increase","extension.command.increase-indent.label":"Increase indentation","extension.command.increase-font-size.description":"Increase the font size","ui.text-color.indigo":"Indigo","ui.text-color.indigo.hue":["Indigo ",["hue"]],"extension.command.insert-paragraph.description":"Insert a new paragraph","extension.command.insert-emoji.label":"Insert Emoji","extension.command.insert-paragraph.label":"Insert Paragraph","extension.command.toggle-italic.label":"Italic","extension.command.toggle-italic.description":"Italicize the selected text","extension.command.justify-align.label":"Justify","R7NlCw":"Alt","RbDiK5":"Arrow Down","Dgyd+E":"Arrow Left","8pdCk4":"Arrow Right","Gp/343":"Arrow Up","PFPV0A":"Backspace","0IRYvp":"Caps Lock","X7HX0D":"Command","zq0AdD":"Control","8SfToN":"Delete","Ys/uah":"End","3K5hww":"Enter","veQt1j":"Enter","ySv7i+":"Home","e6RUI1":"Page Down","EEJk31":"Page Up","7sbhAU":"Shift","Q4eplT":"Space","SUhVVC":"Tab","extension.command.left-align.label":"Left align","ui.text-color.lime":"Lime","ui.text-color.lime.hue":["Lime ",["hue"]],"react-components.mention-atom-component.zero-items":"No items available","ui.text-color.orange":"Orange","ui.text-color.orange.hue":["Orange ",["hue"]],"extension.command.toggle-ordered-list.label":"Ordered list","keyboard.shortcut.pageDown":"Page Down","keyboard.shortcut.pageUp":"Page Up","extension.command.paste.label":"Paste","extension.command.paste.description":"Paste content into the editor","ui.text-color.pink":"Pink","ui.text-color.pink.hue":["Pink ",["hue"]],"zvMfIA":"No items available","pEjhti":"Static Menu","ui.text-color.red":"Red","ui.text-color.red.hue":["Red ",["hue"]],"extension.command.redo.label":"Redo","extension.command.redo.description":"Redo the most recent action","extension.command.remove-annotation.label":"Remove annotation","extension.command.right-align.label":"Right align","extension.command.select-all.label":"Select all","extension.command.select-all.description":"Select all content within the editor","extension.command.insert-horizontal-rule.description":"Separate content with a diving horizontal line","extension.command.set-casing.label":"Set text case","extension.command.set-font-size.description":"Set the font size for the selected text.","extension.command.set-text-color.description":"Set the text color for the selected text.","extension.command.set-text-highlight.description":"Set the text highlight color for the selected text.","keyboard.shortcut.shift":"Shift","extension.command.toggle-whitespace.description":"Show hidden whitespace characters in your editor.","keyboard.shortcut.space":"Space","extension.command.toggle-strike.label":"Strikethrough","extension.command.toggle-strike.description":"Strikethrough the selected text","extension.command.toggle-subscript.label":"Subscript","extension.command.toggle-superscript.label":"Superscript","keyboard.shortcut.tab":"Tab","extension.command.toggle-task-list.description":"Tasked list","ui.text-color.teal":"Teal","ui.text-color.teal.hue":["Teal ",["hue"]],"extension.command.set-text-color.label":"Text color","extension.command.set-text-highlight.label":"Text highlight","extension.command.toggle-whitespace.label":"Toggle Whitespace","ui.text-color.transparent":"Transparent","slrB1c":"Black","6QML30":"Blue","xw+keN":["Blue ",["hue"]],"38RHqP":"Cyan","D89yPf":["Cyan ",["hue"]],"VjBLnd":"Grape","Rp40yv":["Grape ",["hue"]],"5Dm9D1":"Gray","HGjXjC":["Gray ",["hue"]],"b9fz+n":"Green","18jo3M":["Green ",["hue"]],"CFzqCV":"Indigo","aVlDku":["Indigo ",["hue"]],"04PfLc":"Lime","KRTK6Y":["Lime ",["hue"]],"pSnXFd":"Orange","ve/MJZ":["Orange ",["hue"]],"OvCgDa":"Pink","l7NqyT":["Pink ",["hue"]],"IT9k0j":"Red","AdyJ7/":["Red ",["hue"]],"3D2UWc":"Teal","Dcq0Y1":["Teal ",["hue"]],"bsi2ik":"Transparent","Tj3PRR":"Violet","xxMH5N":["Violet ",["hue"]],"Rum0ah":"White","4gaw/Q":"Yellow","hhauc3":["Yellow ",["hue"]],"extension.command.toggle-underline.label":"Underline","extension.command.toggle-underline.description":"Underline the selected text","extension.command.undo.label":"Undo","extension.command.undo.description":"Undo the most recent action","extension.command.update-annotation.label":"Update annotation","ui.text-color.violet":"Violet","ui.text-color.violet.hue":["Violet ",["hue"]],"ui.text-color.white":"White","ui.text-color.yellow":"Yellow","ui.text-color.yellow.hue":["Yellow ",["hue"]]}'),cT={};FH(cT,IH);im.loadLocaleData("en",{plurals:cT.en});im.load("en",VH);im.activate("en");var jH=Object.defineProperty,UH=Object.getOwnPropertyDescriptor,By=(e,t,r,n)=>{for(var o=n>1?void 0:n?UH(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&jH(t,r,o),o},jl=class extends er{get name(){return"doc"}createNodeSpec(e,t){const{docAttributes:r,content:n}=this.options,o=ee();if(hs(r))for(const[i,s]of At(r))o[i]={default:s};else for(const i of r)o[i]={default:null};return{attrs:o,content:n,...t}}setDocAttributes(e){return({tr:t,dispatch:r})=>{if(r){for(const[n,o]of Object.entries(e))t.step(new ad(n,o));r(t)}return!0}}isDefaultDocNode({state:e=this.store.getState(),options:t}={}){return jv(e.doc,t)}};By([U()],jl.prototype,"setDocAttributes",1);By([He()],jl.prototype,"isDefaultDocNode",1);jl=By([me({defaultOptions:{content:"block+",docAttributes:[]},defaultPriority:Ae.Medium,staticKeys:["content","docAttributes"],disableExtraAttributes:!0})],jl);var uT="SetDocAttribute",dT="RevertSetDocAttribute",ad=class extends Rt{constructor(e,t,r=uT){super(),this.stepType=r,this.key=e,this.value=t}static fromJSON(e,t){return new ad(t.key,t.value,t.stepType)}apply(e){this.previous=e.attrs[this.key];const t={...e.attrs,[this.key]:this.value};return yt.ok(e.type.create(t,e.content,e.marks))}invert(){return new ad(this.key,this.previous,dT)}map(){return this}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}};try{Rt.jsonID(uT,ad),Rt.jsonID(dT,ad)}catch(e){if(!e.message.startsWith("Duplicate use of step JSON ID"))throw e}var WH=Object.defineProperty,KH=Object.getOwnPropertyDescriptor,fT=(e,t,r,n)=>{for(var o=n>1?void 0:n?KH(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&WH(t,r,o),o};function qH(e,t,r,n){const o=e.docView.posFromDOM(t,r,n);return o===null||o<0?null:o}function GH(e,t){const r=t.target;if(r){const n=qH(e,r,0);if(n!==null){const o=e.state.doc.resolve(n),i=o.node().isLeaf?0:1,s=o.start()-i;return{pos:n,inside:s}}}return e.posAtCoords({left:t.clientX,top:t.clientY})??void 0}var ih=class extends Ve{constructor(){super(...arguments),this.mousedown=!1,this.mouseover=!1,this.createMouseEventHandler=e=>(t,r)=>{const n=r,o=GH(t,n);if(!o)return!1;const i=[],s=[],{inside:a,pos:l}=o;if(a===-1)return!1;const c=t.state.doc.resolve(l),u=c.depth+1;for(const d of kv(u,1))i.push({node:d>c.depth&&c.nodeAfter?c.nodeAfter:c.node(d),pos:c.before(d)});for(const{type:d}of c.marksAcross(c)??[]){const f=_o(c,d);f&&s.push(f)}return e(n,{view:t,nodes:i,marks:s,getMark:d=>{const f=ne(d)?t.state.schema.marks[d]:d;return te(f,{code:H.EXTENSION,message:`The mark ${d} being checked does not exist within the editor schema.`}),s.find(p=>p.mark.type===f)},getNode:d=>{var f;const p=ne(d)?t.state.schema.nodes[d]:d;te(p,{code:H.EXTENSION,message:"The node being checked does not exist"});const h=i.find(({node:m})=>m.type===p);if(h)return{...h,isRoot:!!((f=i[0])!=null&&f.node.eq(h.node))}}})}}get name(){return"events"}onView(){var e,t;if(!((e=this.store.managerSettings.exclude)!=null&&e.clickHandler))for(const r of this.store.extensions){if(!r.createEventHandlers||(t=r.options.exclude)!=null&&t.clickHandler)continue;const n=r.createEventHandlers();for(const[o,i]of At(n))this.addHandler(o,i)}}createPlugin(){const e=new WeakMap,t=(r,n,o,i,s,a,l,c)=>{const u=this.store.currentState,{schema:d,doc:f}=u,p=f.resolve(i),h=e.has(l),m=YH({$pos:p,handled:h,view:o,state:u});let b=!1;h||(b=r(l,m)||b);const v={...m,pos:i,direct:c,nodeWithPosition:{node:s,pos:a},getNode:g=>{const y=ne(g)?d.nodes[g]:g;return te(y,{code:H.EXTENSION,message:"The node being checked does not exist"}),y===s.type?{node:s,pos:a}:void 0}};return e.set(l,!0),n(l,v)||b};return{props:{handleKeyPress:(r,n)=>this.options.keypress(n)||!1,handleKeyDown:(r,n)=>this.options.keydown(n)||!1,handleTextInput:(r,n,o,i)=>this.options.textInput({from:n,to:o,text:i})||!1,handleClickOn:(r,n,o,i,s,a)=>t(this.options.clickMark,this.options.click,r,n,o,i,s,a),handleDoubleClickOn:(r,n,o,i,s,a)=>t(this.options.doubleClickMark,this.options.doubleClick,r,n,o,i,s,a),handleTripleClickOn:(r,n,o,i,s,a)=>t(this.options.tripleClickMark,this.options.tripleClick,r,n,o,i,s,a),handleDOMEvents:{focus:(r,n)=>this.options.focus(n)||!1,blur:(r,n)=>this.options.blur(n)||!1,mousedown:(r,n)=>(this.startMouseover(),this.options.mousedown(n)||!1),mouseup:(r,n)=>(this.endMouseover(),this.options.mouseup(n)||!1),mouseleave:(r,n)=>(this.mouseover=!1,this.options.mouseleave(n)||!1),mouseenter:(r,n)=>(this.mouseover=!0,this.options.mouseenter(n)||!1),keyup:(r,n)=>this.options.keyup(n)||!1,mouseout:this.createMouseEventHandler((r,n)=>{const o={...n,hovering:!1};return this.options.hover(r,o)||!1}),mouseover:this.createMouseEventHandler((r,n)=>{const o={...n,hovering:!0};return this.options.hover(r,o)||!1}),contextmenu:this.createMouseEventHandler((r,n)=>this.options.contextmenu(r,n)||!1),scroll:(r,n)=>this.options.scroll(n)||!1,copy:(r,n)=>this.options.copy(n)||!1,cut:(r,n)=>this.options.cut(n)||!1,paste:(r,n)=>this.options.paste(n)||!1}},view:r=>{let n=r.editable;const o=this.options;return{update(i){const s=i.editable;s!==n&&(o.editable(s),n=s)}}}}}isInteracting(){return this.mousedown&&this.mouseover}startMouseover(){this.mouseover=!0,!this.mousedown&&(this.mousedown=!0,this.store.document.documentElement.addEventListener("mouseup",()=>{this.endMouseover()},{once:!0}))}endMouseover(){this.mousedown&&(this.mousedown=!1,this.store.commands.emptyUpdate())}};fT([He()],ih.prototype,"isInteracting",1);ih=fT([me({handlerKeys:["blur","focus","mousedown","mouseup","mouseenter","mouseleave","textInput","keypress","keyup","keydown","click","clickMark","doubleClick","doubleClickMark","tripleClick","tripleClickMark","contextmenu","hover","scroll","copy","cut","paste","editable"],handlerKeyOptions:{blur:{earlyReturnValue:!0},focus:{earlyReturnValue:!0},mousedown:{earlyReturnValue:!0},mouseleave:{earlyReturnValue:!0},mouseup:{earlyReturnValue:!0},click:{earlyReturnValue:!0},doubleClick:{earlyReturnValue:!0},tripleClick:{earlyReturnValue:!0},hover:{earlyReturnValue:!0},contextmenu:{earlyReturnValue:!0},scroll:{earlyReturnValue:!0},copy:{earlyReturnValue:!0},cut:{earlyReturnValue:!0},paste:{earlyReturnValue:!0}},defaultPriority:Ae.High})],ih);function YH(e){const{handled:t,view:r,$pos:n,state:o}=e,i={getMark:K4,markRanges:[],view:r,state:o};if(t)return i;for(const{type:s}of n.marksAcross(n)??[]){const a=_o(n,s);a&&i.markRanges.push(a)}return i.getMark=s=>{const a=ne(s)?o.schema.marks[s]:s;return te(a,{code:H.EXTENSION,message:`The mark ${s} being checked does not exist within the editor schema.`}),i.markRanges.find(l=>l.mark.type===a)},i}class gt extends be{constructor(t){super(t,t)}map(t,r){let n=t.resolve(r.map(this.head));return gt.valid(n)?new gt(n):be.near(n)}content(){return K.empty}eq(t){return t instanceof gt&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new gt(t.resolve(r.pos))}getBookmark(){return new Fy(this.anchor)}static valid(t){let r=t.parent;if(r.isTextblock||!JH(t)||!XH(t))return!1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let o=r.contentMatchAt(t.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(t,r,n=!1){e:for(;;){if(!n&>.valid(t))return t;let o=t.pos,i=null;for(let s=t.depth;;s--){let a=t.node(s);if(r>0?t.indexAfter(s)0){i=a.child(r>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;o+=r;let l=t.doc.resolve(o);if(gt.valid(l))return l}for(;;){let s=r>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!ce.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*r),n=!1;continue e}break}i=s,o+=r;let a=t.doc.resolve(o);if(gt.valid(a))return a}return null}}}gt.prototype.visible=!1;gt.findFrom=gt.findGapCursorFrom;be.jsonID("gapcursor",gt);class Fy{constructor(t){this.pos=t}map(t){return new Fy(t.map(this.pos))}resolve(t){let r=t.resolve(this.pos);return gt.valid(r)?new gt(r):be.near(r)}}function JH(e){for(let t=e.depth;t>=0;t--){let r=e.index(t),n=e.node(t);if(r==0){if(n.type.spec.isolating)return!0;continue}for(let o=n.child(r-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function XH(e){for(let t=e.depth;t>=0;t--){let r=e.indexAfter(t),n=e.node(t);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let o=n.child(r);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function QH(){return new Ro({props:{decorations:rB,createSelectionBetween(e,t,r){return t.pos==r.pos&>.valid(r)?new gt(r):null},handleClick:eB,handleKeyDown:ZH,handleDOMEvents:{beforeinput:tB}}})}const ZH=qv({ArrowLeft:kf("horiz",-1),ArrowRight:kf("horiz",1),ArrowUp:kf("vert",-1),ArrowDown:kf("vert",1)});function kf(e,t){const r=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(n,o,i){let s=n.selection,a=t>0?s.$to:s.$from,l=s.empty;if(s instanceof le){if(!i.endOfTextblock(r)||a.depth==0)return!1;l=!1,a=n.doc.resolve(t>0?a.after():a.before())}let c=gt.findGapCursorFrom(a,t,l);return c?(o&&o(n.tr.setSelection(new gt(c))),!0):!1}}function eB(e,t,r){if(!e||!e.editable)return!1;let n=e.state.doc.resolve(t);if(!gt.valid(n))return!1;let o=e.posAtCoords({left:r.clientX,top:r.clientY});return o&&o.inside>-1&&ce.isSelectable(e.state.doc.nodeAt(o.inside))?!1:(e.dispatch(e.state.tr.setSelection(new gt(n))),!0)}function tB(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof gt))return!1;let{$from:r}=e.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(e.state.schema.nodes.text);if(!n)return!1;let o=R.empty;for(let s=n.length-1;s>=0;s--)o=R.from(n[s].createAndFill(null,o));let i=e.state.tr.replace(r.pos,r.pos,new K(o,0,0));return i.setSelection(le.near(i.doc.resolve(r.pos+1))),e.dispatch(i),!1}function rB(e){if(!(e.selection instanceof gt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Ee.create(e.doc,[Ge.widget(e.selection.head,t,{key:"gapcursor"})])}var nB=Object.defineProperty,oB=Object.getOwnPropertyDescriptor,iB=(e,t,r,n)=>{for(var o=n>1?void 0:n?oB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&nB(t,r,o),o},F0=class extends Ve{get name(){return"gapCursor"}createExternalPlugins(){return[QH()]}};F0=iB([me({})],F0);var sh=200,Bt=function(){};Bt.prototype.append=function(t){return t.length?(t=Bt.from(t),!this.length&&t||t.length=r?Bt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,r))};Bt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Bt.prototype.forEach=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(t,r,n,0):this.forEachInvertedInner(t,r,n,0)};Bt.prototype.map=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},r,n),o};Bt.from=function(t){return t instanceof Bt?t:t&&t.length?new pT(t):Bt.empty};var pT=function(e){function t(n){e.call(this),this.values=n}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new t(this.values.slice(o,i))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,i,s,a){for(var l=i;l=s;l--)if(o(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=sh)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=sh)return new t(o.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(t.prototype,r),t}(Bt);Bt.empty=new pT([]);var sB=function(e){function t(r,n){e.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(n){return na&&this.right.forEachInner(n,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(n,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(n,o-a,Math.max(i,a)-a,s+a)===!1||i=i?this.right.slice(n-i,o-i):this.left.slice(n,i).append(this.right.slice(0,o-i))},t.prototype.leafAppend=function(n){var o=this.right.leafAppend(n);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(n){var o=this.left.leafPrepend(n);if(o)return new t(o,this.right)},t.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new t(this.left,new t(this.right,n)):new t(this,n)},t}(Bt);const aB=500;class Zn{constructor(t,r){this.items=t,this.eventCount=r}popEvent(t,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let o,i;r&&(o=this.remapping(n,this.items.length),i=o.maps.length);let s=t.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(n,f+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new mo(d.map));let p=d.step.map(o.slice(i)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new mo(h,void 0,void 0,c.length+u.length))),i--,h&&o.appendMap(h,i)}else s.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(i)):d.selection,l=new Zn(this.items.slice(0,n).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(t,r,n,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;ucB&&(a=lB(a,c),s-=c),new Zn(a.append(i),s)}remapping(t,r){let n=new ul;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=t?n.maps.length-o.mirrorOffset:void 0;n.appendMap(o.map,s)},t,r),n}addMaps(t){return this.eventCount==0?this:new Zn(this.items.append(t.map(r=>new mo(r))),this.eventCount)}rebased(t,r){if(!this.eventCount)return this;let n=[],o=Math.max(0,this.items.length-r),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},o);let l=r;this.items.forEach(f=>{let p=i.getMirror(--l);if(p==null)return;s=Math.min(s,p);let h=i.maps[p];if(f.step){let m=t.steps[p].invert(t.docs[p]),b=f.selection&&f.selection.map(i.slice(l+1,p));b&&a++,n.push(new mo(h,m,b))}else n.push(new mo(h))},o);let c=[];for(let f=r;faB&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let t=0;return this.items.forEach(r=>{r.step||t++}),t}compress(t=this.items.length){let r=this.remapping(0,t),n=r.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=t)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(r.slice(n)),c=l&&l.getMap();if(n--,c&&r.appendMap(c,n),l){let u=s.selection&&s.selection.map(r.slice(n));u&&i++;let d=new mo(c.invert(),l,u),f,p=o.length-1;(f=o.length&&o[p].merge(d))?o[p]=f:o.push(d)}}else s.map&&n--},this.items.length,0),new Zn(Bt.from(o.reverse()),i)}}Zn.empty=new Zn(Bt.empty,0);function lB(e,t){let r;return e.forEach((n,o)=>{if(n.selection&&t--==0)return r=o,!1}),e.slice(r)}class mo{constructor(t,r,n,o){this.map=t,this.step=r,this.selection=n,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let r=t.step.merge(this.step);if(r)return new mo(r.getMap().invert(),r,this.selection)}}}class Ai{constructor(t,r,n,o,i){this.done=t,this.undone=r,this.prevRanges=n,this.prevTime=o,this.prevComposition=i}}const cB=20;function uB(e,t,r,n){let o=r.getMeta(So),i;if(o)return o.historyState;r.getMeta(fB)&&(e=new Ai(e.done,e.undone,null,0,-1));let s=r.getMeta("appendedTransaction");if(r.steps.length==0)return e;if(s&&s.getMeta(So))return s.getMeta(So).redo?new Ai(e.done.addTransform(r,void 0,n,rp(t)),e.undone,Cw(r.mapping.maps[r.steps.length-1]),e.prevTime,e.prevComposition):new Ai(e.done,e.undone.addTransform(r,void 0,n,rp(t)),null,e.prevTime,e.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=r.getMeta("composition"),l=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(r.time||0)-n.newGroupDelay||!dB(r,e.prevRanges)),c=s?qg(e.prevRanges,r.mapping):Cw(r.mapping.maps[r.steps.length-1]);return new Ai(e.done.addTransform(r,l?t.selection.getBookmark():void 0,n,rp(t)),Zn.empty,c,r.time,a??e.prevComposition)}else return(i=r.getMeta("rebased"))?new Ai(e.done.rebased(r,i),e.undone.rebased(r,i),qg(e.prevRanges,r.mapping),e.prevTime,e.prevComposition):new Ai(e.done.addMaps(r.mapping.maps),e.undone.addMaps(r.mapping.maps),qg(e.prevRanges,r.mapping),e.prevTime,e.prevComposition)}function dB(e,t){if(!t)return!1;if(!e.docChanged)return!0;let r=!1;return e.mapping.maps[0].forEach((n,o)=>{for(let i=0;i=t[i]&&(r=!0)}),r}function Cw(e){let t=[];return e.forEach((r,n,o,i)=>t.push(o,i)),t}function qg(e,t){if(!e)return null;let r=[];for(let n=0;n{let r=So.getState(e);return!r||r.done.eventCount==0?!1:(t&&hT(r,e,t,!1),!0)},Qc=(e,t)=>{let r=So.getState(e);return!r||r.undone.eventCount==0?!1:(t&&hT(r,e,t,!0),!0)};function V0(e){let t=So.getState(e);return t?t.done.eventCount:0}function hB(e){let t=So.getState(e);return t?t.undone.eventCount:0}var mB=Object.defineProperty,gB=Object.getOwnPropertyDescriptor,Ca=(e,t,r,n)=>{for(var o=n>1?void 0:n?gB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&mB(t,r,o),o},Ao=class extends Ve{constructor(){super(...arguments),this.wrapMethod=(e,t)=>({state:r,dispatch:n,view:o})=>{const{getState:i,getDispatch:s}=this.options,a=_e(i)?i():r,l=_e(s)&&n?s():n,c=e(a,l,o);return t==null||t(c),c}}get name(){return"history"}createKeymap(){return{"Mod-y":nn.isMac?()=>!1:this.wrapMethod(Qc,this.options.onRedo),"Mod-z":this.wrapMethod(np,this.options.onUndo),"Shift-Mod-z":this.wrapMethod(Qc,this.options.onRedo)}}undoShortcut(e){return this.wrapMethod(np,this.options.onUndo)(e)}redoShortcut(e){return this.wrapMethod(Qc,this.options.onRedo)(e)}createExternalPlugins(){const{depth:e,newGroupDelay:t}=this.options;return[pB({depth:e,newGroupDelay:t})]}undo(){return o2(this.wrapMethod(np,this.options.onUndo))}redo(){return o2(this.wrapMethod(Qc,this.options.onRedo))}undoDepth(e=this.store.getState()){return V0(e)}redoDepth(e=this.store.getState()){return hB(e)}};Ca([je({shortcut:D.Undo,command:"undo"})],Ao.prototype,"undoShortcut",1);Ca([je({shortcut:D.Redo,command:"redo"})],Ao.prototype,"redoShortcut",1);Ca([U({disableChaining:!0,description:({t:e})=>e(wp.UNDO_DESCRIPTION),label:({t:e})=>e(wp.UNDO_LABEL),icon:"arrowGoBackFill"})],Ao.prototype,"undo",1);Ca([U({disableChaining:!0,description:({t:e})=>e(wp.REDO_DESCRIPTION),label:({t:e})=>e(wp.REDO_LABEL),icon:"arrowGoForwardFill"})],Ao.prototype,"redo",1);Ca([He()],Ao.prototype,"undoDepth",1);Ca([He()],Ao.prototype,"redoDepth",1);Ao=Ca([me({defaultOptions:{depth:100,newGroupDelay:500,getDispatch:void 0,getState:void 0},staticKeys:["depth","newGroupDelay"],handlerKeys:["onUndo","onRedo"]})],Ao);var vB=Object.defineProperty,yB=Object.getOwnPropertyDescriptor,sm=(e,t,r,n)=>{for(var o=n>1?void 0:n?yB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&vB(t,r,o),o},bB={icon:"paragraph",label:({t:e})=>e(Sp.INSERT_LABEL),description:({t:e})=>e(Sp.INSERT_DESCRIPTION)},xB={icon:"paragraph",label:({t:e})=>e(Sp.CONVERT_LABEL),description:({t:e})=>e(Sp.CONVERT_DESCRIPTION)},fa=class extends er{get name(){return"paragraph"}createTags(){return[oe.LastNodeCompatible,oe.TextBlock,oe.Block,oe.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",draggable:!1,...t,attrs:{...e.defaults()},parseDOM:[{tag:"p",getAttrs:r=>({...e.parse(r)})},...t.parseDOM??[]],toDOM:r=>["p",e.dom(r),0]}}convertParagraph(e={}){const{attrs:t,selection:r,preserveAttrs:n}=e;return this.store.commands.setBlockNodeType.original(this.type,t,r,n)}insertParagraph(e,t={}){const{selection:r,attrs:n}=t;return this.store.commands.insertNode.original(this.type,{content:e,selection:r,attrs:n})}shortcut(e){return this.convertParagraph()(e)}};sm([U(xB)],fa.prototype,"convertParagraph",1);sm([U(bB)],fa.prototype,"insertParagraph",1);sm([je({shortcut:D.Paragraph,command:"convertParagraph"})],fa.prototype,"shortcut",1);fa=sm([me({defaultPriority:Ae.Medium})],fa);function Jo(e,t,r){return Math.min(Math.max(e,r),t)}class kB extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var Zc=kB;function Vy(e){if(typeof e!="string")throw new Zc(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=_B.test(e)?EB(e):e;const r=CB.exec(t);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(ld(a,2),16)),parseInt(ld(s[3]||"f",2),16)/255]}const n=MB.exec(t);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const o=TB.exec(t);if(o){const s=Array.from(o).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const i=OB.exec(t);if(i){const[s,a,l,c]=Array.from(i).slice(1).map(parseFloat);if(Jo(0,100,a)!==a)throw new Zc(e);if(Jo(0,100,l)!==l)throw new Zc(e);return[...AB(s,a,l),Number.isNaN(c)?1:c]}throw new Zc(e)}function wB(e){let t=5381,r=e.length;for(;r;)t=t*33^e.charCodeAt(--r);return(t>>>0)%2341}const Tw=e=>parseInt(e.replace(/_/g,""),36),SB="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const r=Tw(t.substring(0,3)),n=Tw(t.substring(3)).toString(16);let o="";for(let i=0;i<6-n.length;i++)o+="0";return e[r]=`${o}${n}`,e},{});function EB(e){const t=e.toLowerCase().trim(),r=SB[wB(t)];if(!r)throw new Zc(e);return`#${r}`}const ld=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),CB=new RegExp(`^#${ld("([a-f0-9])",3)}([a-f0-9])?$`,"i"),MB=new RegExp(`^#${ld("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),TB=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${ld(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),OB=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,_B=/^[a-z]+$/i,Ow=e=>Math.round(e*255),AB=(e,t,r)=>{let n=r/100;if(t===0)return[n,n,n].map(Ow);const o=(e%360+360)%360/60,i=(1-Math.abs(2*n-1))*(t/100),s=i*(1-Math.abs(o%2-1));let a=0,l=0,c=0;o>=0&&o<1?(a=i,l=s):o>=1&&o<2?(a=s,l=i):o>=2&&o<3?(l=i,c=s):o>=3&&o<4?(l=s,c=i):o>=4&&o<5?(a=s,c=i):o>=5&&o<6&&(a=i,c=s);const u=n-i/2,d=a+u,f=l+u,p=c+u;return[d,f,p].map(Ow)};function NB(e){const[t,r,n,o]=Vy(e).map((d,f)=>f===3?d:d/255),i=Math.max(t,r,n),s=Math.min(t,r,n),a=(i+s)/2;if(i===s)return[0,0,a,o];const l=i-s,c=a>.5?l/(2-i-s):l/(i+s);return[60*(t===i?(r-n)/l+(r.179}function kl(e){return LB(e)?"#000":"#fff"}const IB="remirror-editor-wrapper",DB="remirror-button-active",$B="remirror-button",HB="remirror-composite",BB="remirror-dialog",FB="remirror-dialog-backdrop",VB="remirror-form",jB="remirror-form-message",UB="remirror-form-label",WB="remirror-form-group",KB="remirror-group",qB="remirror-input",GB="remirror-menu",YB="remirror-menu-pane",JB="remirror-menu-pane-active",XB="remirror-menu-dropdown-label",QB="remirror-menu-pane-icon",ZB="remirror-menu-pane-label",eF="remirror-menu-pane-shortcut",tF="remirror-menu-button-left",rF="remirror-menu-button-right",nF="remirror-menu-button-nested-left",oF="remirror-menu-button-nested-right",iF="remirror-menu-button",sF="remirror-menu-bar",aF="remirror-flex-column",lF="remirror-flex-row",cF="remirror-menu-item",uF="remirror-menu-item-row",dF="remirror-menu-item-column",fF="remirror-menu-item-checkbox",pF="remirror-menu-item-radio",hF="remirror-menu-group",mF="remirror-floating-popover",gF="remirror-popover",vF="remirror-animated-popover",yF="remirror-role",bF="remirror-separator",xF="remirror-tab",kF="remirror-tab-list",wF="remirror-tabbable",SF="remirror-toolbar",EF="remirror-tooltip",CF="remirror-table-size-editor",MF="remirror-table-size-editor-body",TF="remirror-table-size-editor-cell",OF="remirror-table-size-editor-cell-selected",_F="remirror-table-size-editor-footer",AF="remirror-color-picker",NF="remirror-color-picker-cell",RF="remirror-color-picker-cell-selected";var PF=Object.freeze({__proto__:null,ANIMATED_POPOVER:vF,BUTTON:$B,BUTTON_ACTIVE:DB,COLOR_PICKER:AF,COLOR_PICKER_CELL:NF,COLOR_PICKER_CELL_SELECTED:RF,COMPOSITE:HB,DIALOG:BB,DIALOG_BACKDROP:FB,EDITOR_WRAPPER:IB,FLEX_COLUMN:aF,FLEX_ROW:lF,FLOATING_POPOVER:mF,FORM:VB,FORM_GROUP:WB,FORM_LABEL:UB,FORM_MESSAGE:jB,GROUP:KB,INPUT:qB,MENU:GB,MENU_BAR:sF,MENU_BUTTON:iF,MENU_BUTTON_LEFT:tF,MENU_BUTTON_NESTED_LEFT:nF,MENU_BUTTON_NESTED_RIGHT:oF,MENU_BUTTON_RIGHT:rF,MENU_DROPDOWN_LABEL:XB,MENU_GROUP:hF,MENU_ITEM:cF,MENU_ITEM_CHECKBOX:fF,MENU_ITEM_COLUMN:dF,MENU_ITEM_RADIO:pF,MENU_ITEM_ROW:uF,MENU_PANE:YB,MENU_PANE_ACTIVE:JB,MENU_PANE_ICON:QB,MENU_PANE_LABEL:ZB,MENU_PANE_SHORTCUT:eF,POPOVER:gF,ROLE:yF,SEPARATOR:bF,TAB:xF,TABBABLE:wF,TABLE_SIZE_EDITOR:CF,TABLE_SIZE_EDITOR_BODY:MF,TABLE_SIZE_EDITOR_CELL:TF,TABLE_SIZE_EDITOR_CELL_SELECTED:OF,TABLE_SIZE_EDITOR_FOOTER:_F,TAB_LIST:kF,TOOLBAR:SF,TOOLTIP:EF});const zF="remirror-wrap",LF="remirror-language-select-positioner",IF="remirror-language-select-width",DF="remirror-a11y-dark",$F="remirror-atom-dark",HF="remirror-base16-ateliersulphurpool-light",BF="remirror-cb",FF="remirror-darcula",VF="remirror-dracula",jF="remirror-duotone-dark",UF="remirror-duotone-earth",WF="remirror-duotone-forest",KF="remirror-duotone-light",qF="remirror-duotone-sea",GF="remirror-duotone-space",YF="remirror-gh-colors",JF="remirror-hopscotch",XF="remirror-pojoaque",QF="remirror-vs",ZF="remirror-xonokai";var eV=Object.freeze({__proto__:null,A11Y_DARK:DF,ATOM_DARK:$F,BASE16_ATELIERSULPHURPOOL_LIGHT:HF,CB:BF,DARCULA:FF,DRACULA:VF,DUOTONE_DARK:jF,DUOTONE_EARTH:UF,DUOTONE_FOREST:WF,DUOTONE_LIGHT:KF,DUOTONE_SEA:qF,DUOTONE_SPACE:GF,GH_COLORS:YF,HOPSCOTCH:JF,LANGUAGE_SELECT_POSITIONER:LF,LANGUAGE_SELECT_WIDTH:IF,POJOAQUE:XF,VS:QF,WRAP:zF,XONOKAI:ZF});const tV="remirror-image-loader";var rV=Object.freeze({__proto__:null,IMAGE_LOADER:tV});const nV="remirror-list-item-with-custom-mark",oV="remirror-ul-list-content",iV="remirror-editor",sV="remirror-list-item-marker-container",aV="remirror-list-item-checkbox",lV="remirror-collapsible-list-item-closed",cV="remirror-collapsible-list-item-button",uV="remirror-list-spine";var ls=Object.freeze({__proto__:null,COLLAPSIBLE_LIST_ITEM_BUTTON:cV,COLLAPSIBLE_LIST_ITEM_CLOSED:lV,EDITOR:iV,LIST_ITEM_CHECKBOX:aV,LIST_ITEM_MARKER_CONTAINER:sV,LIST_ITEM_WITH_CUSTOM_MARKER:nV,LIST_SPINE:uV,UL_LIST_CONTENT:oV});const dV="remirror-is-empty";var fV=Object.freeze({__proto__:null,IS_EMPTY:dV});const pV="remirror-editor",hV="remirror-positioner",mV="remirror-positioner-widget";var gV=Object.freeze({__proto__:null,EDITOR:pV,POSITIONER:hV,POSITIONER_WIDGET:mV});const vV="remirror-theme";function yV(e={}){const t=[],r={};function n(o,i){if(typeof i=="string"||typeof i=="number"){t.push(`${_w(o)}: ${i};`),r[_w(o)]=i;return}if(!(typeof i!="object"||!i))for(const[s,a]of Object.entries(i))n([...o,s],a)}for(const[o,i]of Object.entries(e))n([o],i);return{css:t.join(` -`),styles:r}}function bV(e){return e.replace(/([a-z])([\dA-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function _w(e){return`--rmr-${e.map(bV).join("-")}`}const Kn={gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},Xo="#000000",jy="#ffffff",xV="#252103",Uy=ah(Xo,.75),am="#7963d2",Wy="#bcd263",kV="#fff",wV="#fff",Ky=Kn.gray[1],Aw="rgba(10,31,68,0.08)",Nw="rgba(10,31,68,0.10)",Rw="rgba(10,31,68,0.12)",SV=op(ah(Xo,.1),.13),qy={background:jy,border:Uy,foreground:Xo,muted:Ky,primary:am,secondary:Wy,primaryText:kV,secondaryText:wV,text:xV,faded:SV},EV={...qy,background:tn(jy,.15),border:tn(Uy,.15),foreground:tn(Xo,.15),muted:tn(Ky,.15),primary:tn(am,.15),secondary:tn(Wy,.15),get text(){return kl(this.background)},get primaryText(){return kl(this.primary)},get secondaryText(){return kl(this.secondary)}},CV={...qy,background:tn(jy,.075),border:tn(Uy,.075),foreground:tn(Xo,.075),muted:tn(Ky,.075),primary:tn(am,.075),secondary:tn(Wy,.075),get text(){return kl(this.background)},get primaryText(){return kl(this.primary)},get secondaryText(){return kl(this.secondary)}},Ss={color:{...qy,active:EV,hover:CV,shadow1:Aw,shadow2:Nw,shadow3:Rw,backdrop:ah(Xo,.1),outline:ah(am,.6),table:{default:{border:op(Xo,.8),cell:op(Xo,.4),controller:Kn.gray[3]},selected:{border:Kn.blue[7],cell:Kn.blue[1],controller:Kn.blue[5]},preselect:{border:Kn.blue[7],cell:op(Xo,.4),controller:Kn.blue[5]},predelete:{border:Kn.red[7],cell:Kn.red[1],controller:Kn.red[5]},mark:"#91919196"}},hue:Kn,radius:{border:"0.25rem",extra:"0.5rem",circle:"50%"},fontFamily:{default:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif',heading:"inherit",mono:"Menlo, monospace"},fontSize:{0:"12px",1:"14px",2:"16px",3:"20px",4:"24px",5:"32px",6:"48px",7:"64px",8:"96px",default:"16px"},space:{1:"4px",2:"8px",3:"16px",4:"32px",5:"64px",6:"128px",7:"256px",8:"512px"},fontWeight:{bold:"700",default:"400",heading:"700"},letterSpacing:{tight:"-1px",default:"normal",loose:"1px",wide:"3px"},lineHeight:{heading:"1.25em",default:"1.5em"},boxShadow:{1:`0 1px 1px ${Aw}`,2:`0 1px 1px ${Nw}`,3:`0 1px 1px ${Rw}`}};var MV=Object.defineProperty,TV=Object.getOwnPropertyDescriptor,Gy=(e,t,r,n)=>{for(var o=n>1?void 0:n?TV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&MV(t,r,o),o},mT=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Tt=(e,t,r)=>(mT(e,t,"read from private field"),r?r.call(e):t.get(e)),Do=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},yi=(e,t,r,n)=>(mT(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),eu,tu,qa,ru,ip,nu,ou,iu,su,sp=class{constructor(e){Do(this,eu,Bh()),Do(this,tu,[]),Do(this,qa,new Map),Do(this,ru,[]),Do(this,ip,!1),Do(this,nu,void 0),Do(this,ou,void 0),Do(this,iu,void 0),Do(this,su,void 0),this.addListener=(t,r)=>Tt(this,eu).on(t,r),yi(this,nu,e),yi(this,ou,e.getActive),yi(this,su,e.getPosition),yi(this,iu,e.getID),this.hasChanged=e.hasChanged,this.events=e.events??["state","scroll"]}static create(e){return new sp(e)}static fromPositioner(e,t){return sp.create({...e.basePositioner,...t})}get basePositioner(){return{getActive:Tt(this,ou),getPosition:Tt(this,su),hasChanged:this.hasChanged,events:this.events,getID:Tt(this,iu)}}onActiveChanged(e){this.recentUpdate=e;const t=Tt(this,ou).call(this,e);yi(this,tu,t),yi(this,qa,new Map),yi(this,ip,!1),yi(this,ru,[]);const r=[];for(const[n,o]of t.entries()){const i=this.getID(o,n);Tt(this,ru).push(i),r.push({setElement:s=>this.addProps({...e,data:o,element:s},n),id:i,data:o})}Tt(this,eu).emit("update",r)}getID(e,t){var r;return((r=Tt(this,iu))==null?void 0:r.call(this,e,t))??t.toString()}addProps(e,t){if(Tt(this,ip)||(Tt(this,qa).set(t,e),Tt(this,qa).sizee;return this.clone(r=>({getActive:n=>r.getActive(n).filter(t)}))}},no=sp;eu=new WeakMap;tu=new WeakMap;qa=new WeakMap;ru=new WeakMap;ip=new WeakMap;nu=new WeakMap;ou=new WeakMap;iu=new WeakMap;su=new WeakMap;no.EMPTY=[];function OV(e,t=bT){const{key:r}=(e==null?void 0:e.getMeta(yT))??{};return r===t}function gT(e){const{tr:t,state:r,previousState:n}=e;return!n||t&&OV(t)?!0:t?Q6(t):!r.doc.eq(n.doc)||!r.selection.eq(n.selection)}function vT(e,t,r={}){const n=t.getBoundingClientRect(),{accountForPadding:o=!1}=r;let i=0,s=0,a=0,l=0;if(Je(t)&&o){const u=Number.parseFloat(xn(t,"padding-left").replace("px","")),d=Number.parseFloat(xn(t,"padding-right").replace("px","")),f=Number.parseFloat(xn(t,"padding-top").replace("px","")),p=Number.parseFloat(xn(t,"padding-bottom").replace("px","")),h=Number.parseFloat(xn(t,"border-left").replace("px","")),m=Number.parseFloat(xn(t,"border-right").replace("px","")),b=Number.parseFloat(xn(t,"border-top").replace("px","")),v=Number.parseFloat(xn(t,"border-bottom").replace("px","")),g=t.offsetWidth-t.clientWidth,y=t.offsetHeight-t.clientHeight;i+=u+h+(t.dir==="rtl"?g:0),s+=d+m+(t.dir==="rtl"?0:g),a+=f+b,l+=p+v+y}const c=new DOMRect(n.left+i,n.top+a,n.width-s,n.height-l);for(const[u,d]of[[e.top,e.left],[e.top,e.right],[e.bottom,e.left],[e.bottom,e.right]])if(Jx(u,c.top,c.bottom)&&Jx(d,c.left,c.right))return!0;return!1}var _V="remirror-positioner-widget",yT="positionerUpdate",bT="__all_positioners__",xT={y:-999999,x:-999999,width:0,height:0},Pw={...xT,left:-999999,top:-999999,bottom:-999999,right:-999999},Yy={...xT,rect:{...Pw,toJSON:()=>Pw},visible:!1},kT=no.create({hasChanged:gT,getActive(e){const{state:t}=e;if(!Bv(t)||t.selection.$anchor.depth>2)return no.EMPTY;const r=zd({predicate:n=>n.type.isBlock,selection:t});return r?[r]:no.EMPTY},getPosition(e){const{view:t,data:r}=e,n=t.nodeDOM(r.pos);if(!Je(n))return Yy;const o=n.getBoundingClientRect(),i=t.dom.getBoundingClientRect(),s=o.height,a=o.width,l=t.dom.scrollLeft+o.left-i.left,c=t.dom.scrollTop+o.top-i.top,u=vT(o,t.dom);return{y:c,x:l,height:s,width:a,rect:o,visible:u}}}),Jy=kT.clone(({getActive:e})=>({getActive:t=>{const[r]=e(t);return r&&Dh(r.node)&&r.node.type===Ih(t.state.schema)?[r]:no.EMPTY}})),AV=Jy.clone(({getPosition:e})=>({getPosition:t=>({...e(t),width:1})})),NV=Jy.clone(({getPosition:e})=>({getPosition:t=>{const{width:r,x:n,y:o,height:i}=e(t);return{...e(t),width:1,x:r+n,rect:new DOMRect(r+n,o,1,i)}}}));function Xy(e){return no.create({hasChanged:gT,getActive:t=>{const{state:r,view:n}=t;if(!e(r)||!gs(r.selection))return no.EMPTY;try{const{head:o,anchor:i}=r.selection;return[{from:n.coordsAtPos(i),to:n.coordsAtPos(o)}]}catch{return no.EMPTY}},getPosition(t){const{element:r,data:n,view:o}=t,{from:i,to:s}=n,a=r.offsetParent??o.dom,l=a.getBoundingClientRect(),c=Math.abs(s.bottom-i.top),u=c>i.bottom-i.top,d=Math.min(i.left,s.left),f=Math.min(i.top,s.top),p=a.scrollLeft+(u?s.left-l.left:d-l.left),h=a.scrollTop+f-l.top,m=u?1:Math.abs(i.left-s.right),b=new DOMRect(u?s.left:d,f,m,c),v=vT(b,o.dom);return{rect:b,y:h,x:p,height:c,width:m,visible:v}}})}var wT=Xy(e=>!e.selection.empty),RV=Xy(e=>e.selection.empty),PV=Xy(()=>!0),zV=wT.clone(()=>({getActive:e=>{const{state:t,view:r}=e;if(!t.selection.empty)return no.EMPTY;const n=C5(t);if(!n)return no.EMPTY;try{return[{from:r.coordsAtPos(n.from),to:r.coordsAtPos(n.to)}]}catch{return no.EMPTY}}})),LV={selection:wT,cursor:RV,always:PV,block:kT,emptyBlock:Jy,emptyBlockStart:AV,emptyBlockEnd:NV,nearestWord:zV},Ul=class extends Ve{constructor(){super(...arguments),this.positioners=[],this.onAddCustomHandler=({positioner:e})=>{if(e)return this.positioners=[...this.positioners,e],this.store.commands.forceUpdate(),()=>{this.positioners=this.positioners.filter(t=>t!==e)}}}get name(){return"positioner"}createAttributes(){return{class:gV.EDITOR}}init(){this.onScroll=H4(this.options.scrollDebounce,this.onScroll.bind(this))}createEventHandlers(){return{scroll:()=>(this.onScroll(),!1),hover:(e,t)=>(this.positioner(this.getBaseProps("hover",{hover:t})),!1),contextmenu:(e,t)=>(this.positioner(this.getBaseProps("contextmenu",{contextmenu:t})),!1)}}onStateUpdate(e){this.positioner({...e,previousState:e.firstUpdate?void 0:e.previousState,event:"state",helpers:this.store.helpers})}createDecorations(e){if(this.element??(this.element=this.createElement()),!this.element.hasChildNodes())return Ee.empty;const t=Ge.widget(0,this.element,{key:"positioner-widget",side:-1,stopEvent:()=>!0});return Ee.create(e.doc,[t])}forceUpdatePositioners(e=bT){return({tr:t,dispatch:r})=>(r==null||r(t.setMeta(yT,{key:e})),!0)}getPositionerWidget(){return this.element??(this.element=this.createElement())}createElement(){const e=document.createElement("span");return e.dataset.id=_V,e.setAttribute("role","presentation"),e}triggerPositioner(e,t){e.hasChanged(t)&&e.onActiveChanged({...t,view:this.store.view})}positioner(e){for(const t of this.positioners)t.events.includes(e.event)&&this.triggerPositioner(t,e)}getBaseProps(e,t){const r=this.store.getState(),n=this.store.previousState;return{helpers:this.store.helpers,event:e,firstUpdate:!1,previousState:n,state:r,...t}}onScroll(){this.positioner(this.getBaseProps("scroll",{scroll:{scrollTop:this.store.view.dom.scrollTop}}))}};Gy([U()],Ul.prototype,"forceUpdatePositioners",1);Gy([He()],Ul.prototype,"getPositionerWidget",1);Ul=Gy([me({defaultOptions:{scrollDebounce:100},customHandlerKeys:["positioner"],staticKeys:["scrollDebounce"]})],Ul);function j0(e){return ne(e)?LV[e].clone():_e(e)?e().clone():e.clone()}var IV=Object.defineProperty,DV=Object.getOwnPropertyDescriptor,$V=(e,t,r,n)=>{for(var o=n>1?void 0:n?DV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&IV(t,r,o),o},U0=class extends er{get name(){return"text"}createTags(){return[oe.InlineNode]}createNodeSpec(){return{}}};U0=$V([me({disableExtraAttributes:!0,defaultPriority:Ae.Medium})],U0);var HV={...jl.defaultOptions,...fa.defaultOptions,...Ao.defaultOptions,excludeExtensions:[]};function BV(e={}){e={...HV,...e};const{content:t,depth:r,getDispatch:n,getState:o,newGroupDelay:i,excludeExtensions:s}=e,a={};for(const c of s??[])a[c]=!0;const l=[];if(!a.history){const c=new Ao({depth:r,getDispatch:n,getState:o,newGroupDelay:i});l.push(c)}return a.doc||l.push(new jl({content:t})),a.text||l.push(new U0),a.paragraph||l.push(new fa),a.positioner||l.push(new Ul),a.gapCursor||l.push(new F0),a.events||l.push(new ih),l}var FV=Object.defineProperty,VV=Object.getOwnPropertyDescriptor,jV=(e,t,r,n)=>{for(var o=n>1?void 0:n?VV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&FV(t,r,o),o},pa=class extends Ve{get name(){return"placeholder"}createAttributes(){return{"aria-placeholder":this.options.placeholder}}createPlugin(){return{state:{init:(e,t)=>({...this.options,empty:jv(t.doc,{ignoreAttributes:!0})}),apply:(e,t,r,n)=>UV({pluginState:t,tr:e,extension:this,state:n})},props:{decorations:e=>WV({state:e,extension:this})}}}onSetOptions(e){const{changes:t}=e;t.placeholder.changed&&this.store.phase>=Nr.EditorView&&this.store.updateAttributes()}};pa=jV([me({defaultOptions:{emptyNodeClass:fV.IS_EMPTY,placeholder:""}})],pa);function UV(e){const{pluginState:t,extension:r,tr:n,state:o}=e;return n.docChanged?{...r.options,empty:jv(o.doc)}:t}function WV(e){const{extension:t,state:r}=e,{empty:n}=t.pluginKey.getState(r),{emptyNodeClass:o,placeholder:i}=t.options;if(!n)return null;const s=[];return r.doc.descendants((a,l)=>{const c=Ge.node(l,l+a.nodeSize,{class:o,"data-placeholder":i});s.push(c)}),Ee.create(r.doc,s)}var KV=Object.defineProperty,qV=Object.getOwnPropertyDescriptor,GV=(e,t,r,n)=>{for(var o=n>1?void 0:n?qV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&KV(t,r,o),o},YV={...pa.defaultOptions,...sd.defaultOptions},JV=[...pa.staticKeys,...sd.staticKeys],cd=class extends Ve{get name(){return"react"}onSetOptions(e){const{pickChanged:t}=e;this.getExtension(pa).setOptions(t(["placeholder"]))}createExtensions(){const{emptyNodeClass:e,placeholder:t,defaultBlockNode:r,defaultContentNode:n,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s}=this.options;return[new pa({emptyNodeClass:e,placeholder:t,priority:Ae.Low}),new sd({defaultBlockNode:r,defaultContentNode:n,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s})]}};cd=GV([me({defaultOptions:YV,staticKeys:JV})],cd);var ST={};Object.defineProperty(ST,"__esModule",{value:!0});function XV(){for(var e=[],t=0;t{if(!t.has(e))throw TypeError("Cannot "+r)},Yg=(e,t,r)=>(ET(e,t,"read from private field"),r?r.call(e):t.get(e)),QV=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},ZV=(e,t,r,n)=>(ET(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function ej(){const[,e]=S.useState(ee());return S.useCallback(()=>{e(ee())},[])}var CT=S.createContext(null);function di(e){const t=S.useContext(CT),r=S.useRef(ej());te(t,{code:H.REACT_PROVIDER_CONTEXT});const{addHandler:n}=t;return S.useEffect(()=>{let o=e;if(o){if(hs(o)){const{autoUpdate:i}=o;o=i?()=>r.current():void 0}if(_e(o))return n("updated",o)}},[n,e]),t}function In(e=!0){return di({autoUpdate:e}).active}function tj(e=!1){return di(e?{autoUpdate:!0}:void 0).attrs}function lc(){return di().chain.new()}function Tr(){return di().commands}function Qy(){return di({autoUpdate:!0}).getState().selection}function Zy(e,t=void 0,r){const{getExtension:n}=di(),o=S.useMemo(()=>n(e),[e,n]);let i;if(_e(t)?i=r?[o,...r]:[o,t]:i=t?[o,...Object.values(t)]:[],S.useEffect(()=>{_e(t)||!t||o.setOptions(t)},i),S.useEffect(()=>{if(_e(t))return t({addHandler:o.addHandler.bind(o),addCustomHandler:o.addCustomHandler.bind(o),extension:o})},i),!t)return o}function rj(e,t,r){const n=S.useCallback(({addHandler:o})=>o(t,r),[r,t]);return Zy(e,n)}function lm(e=!1){return di(e?{autoUpdate:!0}:void 0).helpers}var[nj,oj]=O9(({props:e})=>{const t=e.locale??"en",r=e.i18n??im,n=e.supportedLocales??[t],o=r._.bind(r);return{locale:t,i18n:r,supportedLocales:n,t:o}});function Dw(e,t={}){const{core:r,react:n,...o}=t;return cI(e)?e:lI.create(()=>[...J4(e),new cd(n),...BV(r)],o)}function ij(e,t={}){const r=S.useRef(e),n=S.useRef(t),[o,i]=S.useState(()=>Dw(e,t));return r.current=e,n.current=t,S.useEffect(()=>o.addHandler("destroy",()=>{i(()=>Dw(r.current,n.current))}),[o]),o}var sj=typeof br=="object"&&br.__esModule&&br.default?br.default:br,Ga,aj=class extends nI{constructor(e){if(super(e),QV(this,Ga,void 0),this.rootPropsConfig={called:!1,count:0},this.getRootProps=t=>this.internalGetRootProps(t,null),this.internalGetRootProps=(t,r)=>{this.rootPropsConfig.called=!0;const{refKey:n="ref",ref:o,...i}=t??ee();return{[n]:sj(o,this.onRef),key:this.uid,...i,children:r}},this.onRef=t=>{t&&(this.rootPropsConfig.count+=1,te(this.rootPropsConfig.count<=1,{code:H.REACT_GET_ROOT_PROPS,message:`Called ${this.rootPropsConfig.count} times`}),ZV(this,Ga,t),this.onRefLoad())},this.manager.view){this.manager.view.setProps({state:this.manager.view.state,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0});return}this.manager.getExtension(pa).setOptions({placeholder:this.props.placeholder??""})}get name(){return"react"}update(e){return super.update(e),this}createView(e){return new f6(null,{state:e,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0,plugins:[]})}updateState({state:e,...t}){const{triggerChange:r=!0,tr:n,transactions:o}=t;if(this.props.state){const{onChange:i}=this.props;te(i,{code:H.REACT_CONTROLLED,message:"You are required to provide the `onChange` handler when creating a controlled editor."}),te(r,{code:H.REACT_CONTROLLED,message:"Controlled editors do not support `clearContent` or `setContent` where `triggerChange` is `true`. Update the `state` prop instead."}),this.previousStateOverride||(this.previousStateOverride=this.getState()),this.onChange({state:e,tr:n,transactions:o});return}!n&&!o&&(e=e.apply(e.tr.setMeta(Wx,{}))),this.view.updateState(e),r&&(o==null?void 0:o.length)!==0&&this.onChange({state:e,tr:n,transactions:o}),this.manager.onStateUpdate({previousState:this.previousState,state:e,tr:n,transactions:o})}updateControlledState(e,t){this.previousStateOverride=t,e=e.apply(e.tr.setMeta(Wx,{})),this.view.updateState(e),this.manager.onStateUpdate({previousState:this.previousState,state:e}),this.previousStateOverride=void 0}addProsemirrorViewToDom(e,t){this.props.insertPosition==="start"?e.insertBefore(t,e.firstChild):e.append(t)}onRefLoad(){te(Yg(this,Ga),{code:H.REACT_EDITOR_VIEW,message:"Something went wrong when initializing the text editor. Please check your setup."});const{autoFocus:e}=this.props;this.addProsemirrorViewToDom(Yg(this,Ga),this.view.dom),e&&this.focus(e),this.onChange(),this.addFocusListeners()}onUpdate(){this.view&&Yg(this,Ga)&&this.view.setProps({...this.view.props,editable:()=>this.props.editable??!0})}get frameworkOutput(){return{...this.baseOutput,getRootProps:this.getRootProps,portalContainer:this.manager.store.portalContainer}}resetRender(){this.rootPropsConfig.called=!1,this.rootPropsConfig.count=0}};Ga=new WeakMap;var MT=typeof document<"u"?S.useLayoutEffect:S.useEffect;function lj(e){const t=S.useRef();return MT(()=>{t.current=e}),t.current}function cj(e){const{manager:t,state:r}=e,{placeholder:n,editable:o}=e;S.useRef(!0).current&&!Zi(n)&&t.getExtension(cd).setOptions({placeholder:n}),S.useEffect(()=>{n!=null&&t.getExtension(cd).setOptions({placeholder:n})},[n,t]);const[s]=S.useState(()=>{if(r)return r;const l=t.createEmptyDoc(),[c,u]=ct(e.initialContent)?e.initialContent:[e.initialContent??l];return t.createState({content:c,selection:u})}),a=uj({initialEditorState:s,getProps:()=>e});return S.useEffect(()=>()=>{a.destroy()},[a]),S.useEffect(()=>{a.onUpdate()},[o,a]),dj(a),a.frameworkOutput}function uj(e){const t=S.useRef(e);t.current=e;const r=S.useMemo(()=>new aj(t.current),[]);return r.update(e),r}function dj(e){const{state:t}=e.props,r=S.useRef(!!t),n=lj(t);MT(()=>{const o=t?r.current===!0:r.current===!1;te(o,{code:H.REACT_CONTROLLED,message:r.current?"You have attempted to switch from a controlled to an uncontrolled editor. Once you set up an editor as a controlled editor it must always provide a `state` prop.":"You have provided a `state` prop to an uncontrolled editor. In order to set up your editor as controlled you must provide the `state` prop from the very first render."}),!(!t||t===n)&&e.updateControlledState(t,n??void 0)},[t,n,e])}function fj(e={}){const{content:t,document:r,selection:n,extensions:o,...i}=e,s=ij(o??(()=>[]),i),[a,l]=S.useState(()=>s.createState({selection:n,content:t??s.createEmptyDoc()})),c=S.useCallback(({state:d})=>{l(d)},[]),u=S.useCallback(()=>s.output,[s]);return S.useMemo(()=>({state:a,setState:l,manager:s,onChange:c,getContext:u}),[u,s,c,a])}var $w={doc:!1,selection:!1,storedMark:!1};function pj(){const[e,t]=S.useState($w);return rj(Rp,"applyState",S.useCallback(({tr:r})=>{const n={...$w};r.docChanged&&(n.doc=!0),r.selectionSet&&(n.selection=!0),r.storedMarksSet&&(n.storedMark=!0),t(n)},[])),e}var W0=()=>L.createElement("div",{className:PF.EDITOR_WRAPPER,...di().getRootProps()}),hj=e=>(e.hook(),null);function mj(e){const{children:t,autoRender:r,i18n:n,locale:o,supportedLocales:i,hooks:s=[],...a}=e,l=cj(a),c=w9(l.portalContainer),u=r==="start"||r===!0||!t&&Zi(r),d=r==="end";return L.createElement(nj,{i18n:n,locale:o,supportedLocales:i},L.createElement(CT.Provider,{value:l},L.createElement(k9,{portals:c}),s.map((f,p)=>L.createElement(hj,{hook:f,key:p})),u&&L.createElement(W0,null),t,d&&L.createElement(W0,null)))}const gj={black:"#000",white:"#fff"},ud=gj,vj={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},za=vj,yj={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},La=yj,bj={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Ia=bj,xj={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},Da=xj,kj={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},$a=kj,wj={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},Mc=wj,Sj={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Ej=Sj;function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t[r]=TT(e[r])}),t}function cn(e,t,r={clone:!0}){const n=r.clone?_({},e):e;return Wo(e)&&Wo(t)&&Object.keys(t).forEach(o=>{o!=="__proto__"&&(Wo(t[o])&&o in e&&Wo(e[o])?n[o]=cn(e[o],t[o],r):r.clone?n[o]=Wo(t[o])?TT(t[o]):t[o]:n[o]=t[o])}),n}function Wl(e){let t="https://mui.com/production-error/?code="+e;for(let r=1;r<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=s.createElement(r,{is:n.is}):(e=s.createElement(r),r==="select"&&(s=e,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):e=s.createElementNS(e,r),e[bo]=t,e[ed]=n,FM(e,t,!1,!1),t.stateNode=e;e:{switch(s=a0(r,n),r){case"dialog":et("cancel",e),et("close",e),o=n;break;case"iframe":case"object":case"embed":et("load",e),o=n;break;case"video":case"audio":for(o=0;oVl&&(t.flags|=128,n=!0,Cc(i,!1),t.lanes=4194304)}else{if(!n)if(e=Xp(s),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Cc(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ot)return ir(t),null}else 2*vt()-i.renderingStartTime>Vl&&r!==1073741824&&(t.flags|=128,n=!0,Cc(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(r=i.last,r!==null?r.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=vt(),t.sibling=null,r=at.current,Ye(at,n?r&1|2:r&1),t):(ir(t),null);case 22:case 23:return Ly(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?tn&1073741824&&(ir(t),t.subtreeFlags&6&&(t.flags|=8192)):ir(t),null;case 24:return null;case 25:return null}throw Error($(156,t.tag))}function o9(e,t){switch(my(t),t.tag){case 1:return $r(t.type)&&Up(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bl(),tt(Dr),tt(pr),Ey(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Sy(t),null;case 13:if(tt(at),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error($(340));$l()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return tt(at),null;case 4:return Bl(),null;case 10:return by(t.type._context),null;case 22:case 23:return Ly(),null;case 24:return null;default:return null}}var bf=!1,ur=!1,i9=typeof WeakSet=="function"?WeakSet:Set,X=null;function ll(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){mt(e,t,n)}else r.current=null}function z0(e,t,r){try{r()}catch(n){mt(e,t,n)}}var fw=!1;function s9(e,t){if(v0=Bp,e=q5(),py(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var o=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var p;d!==r||o!==0&&d.nodeType!==3||(a=s+o),d!==i||n!==0&&d.nodeType!==3||(l=s+n),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===r&&++c===o&&(a=s),f===i&&++u===n&&(l=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(y0={focusedElem:e,selectionRange:r},Bp=!1,X=t;X!==null;)if(t=X,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,X=e;else for(;X!==null;){t=X;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,b=h.memoizedState,v=t.stateNode,g=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:Gn(t.type,m),b);v.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error($(163))}}catch(x){mt(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,X=e;break}X=t.return}return h=fw,fw=!1,h}function Mu(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&z0(t,r,i)}o=o.next}while(o!==n)}}function em(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function L0(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function UM(e){var t=e.alternate;t!==null&&(e.alternate=null,UM(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[bo],delete t[ed],delete t[k0],delete t[V8],delete t[j8])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function WM(e){return e.tag===5||e.tag===3||e.tag===4}function pw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||WM(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function I0(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=jp));else if(n!==4&&(e=e.child,e!==null))for(I0(e,t,r),e=e.sibling;e!==null;)I0(e,t,r),e=e.sibling}function D0(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(D0(e,t,r),e=e.sibling;e!==null;)D0(e,t,r),e=e.sibling}var qt=null,Yn=!1;function vi(e,t,r){for(r=r.child;r!==null;)KM(e,t,r),r=r.sibling}function KM(e,t,r){if(ko&&typeof ko.onCommitFiberUnmount=="function")try{ko.onCommitFiberUnmount(Kh,r)}catch{}switch(r.tag){case 5:ur||ll(r,t);case 6:var n=qt,o=Yn;qt=null,vi(e,t,r),qt=n,Yn=o,qt!==null&&(Yn?(e=qt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):qt.removeChild(r.stateNode));break;case 18:qt!==null&&(Yn?(e=qt,r=r.stateNode,e.nodeType===8?Bg(e.parentNode,r):e.nodeType===1&&Bg(e,r),Yu(e)):Bg(qt,r.stateNode));break;case 4:n=qt,o=Yn,qt=r.stateNode.containerInfo,Yn=!0,vi(e,t,r),qt=n,Yn=o;break;case 0:case 11:case 14:case 15:if(!ur&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){o=n=n.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&z0(r,t,s),o=o.next}while(o!==n)}vi(e,t,r);break;case 1:if(!ur&&(ll(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){mt(r,t,a)}vi(e,t,r);break;case 21:vi(e,t,r);break;case 22:r.mode&1?(ur=(n=ur)||r.memoizedState!==null,vi(e,t,r),ur=n):vi(e,t,r);break;default:vi(e,t,r)}}function hw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new i9),t.forEach(function(n){var o=m9.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function Un(e,t){var r=t.deletions;if(r!==null)for(var n=0;no&&(o=s),n&=~i}if(n=o,n=vt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*l9(n/1960))-n,10e?16:e,$i===null)var n=!1;else{if(e=$i,$i=null,rh=0,Oe&6)throw Error($(331));var o=Oe;for(Oe|=4,X=e.current;X!==null;){var i=X,s=i.child;if(X.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lvt()-Py?Zs(e,0):Ry|=r),Hr(e,t)}function eT(e,t){t===0&&(e.mode&1?(t=uf,uf<<=1,!(uf&130023424)&&(uf=4194304)):t=1);var r=wr();e=oi(e,t),e!==null&&(Fd(e,t,r),Hr(e,r))}function h9(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),eT(e,r)}function m9(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:n=e.stateNode;break;default:throw Error($(314))}n!==null&&n.delete(t),eT(e,r)}var tT;tT=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dr.current)zr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return zr=!1,r9(e,t,r);zr=!!(e.flags&131072)}else zr=!1,ot&&t.flags&1048576&&oM(t,qp,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Qf(e,t),e=t.pendingProps;var o=Dl(t,pr.current);bl(t,r),o=My(null,t,n,e,o,r);var i=Ty();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,$r(n)?(i=!0,Wp(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,ky(t),o.updater=Qh,t.stateNode=o,o._reactInternals=t,T0(t,n,e,r),t=A0(null,t,n,!0,i,r)):(t.tag=0,ot&&i&&hy(t),yr(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Qf(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=v9(n),e=Gn(n,e),o){case 0:t=_0(null,t,n,e,r);break e;case 1:t=cw(null,t,n,e,r);break e;case 11:t=aw(null,t,n,e,r);break e;case 14:t=lw(null,t,n,Gn(n.type,e),r);break e}throw Error($(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Gn(n,o),_0(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Gn(n,o),cw(e,t,n,o,r);case 3:e:{if($M(t),e===null)throw Error($(387));n=t.pendingProps,i=t.memoizedState,o=i.element,lM(e,t),Jp(t,n,null,r);var s=t.memoizedState;if(n=s.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Fl(Error($(423)),t),t=uw(e,t,n,r,o);break e}else if(n!==o){o=Fl(Error($(424)),t),t=uw(e,t,n,r,o);break e}else for(ln=qi(t.stateNode.containerInfo.firstChild),cn=t,ot=!0,Xn=null,r=fM(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if($l(),n===o){t=ii(e,t,r);break e}yr(e,t,n,r)}t=t.child}return t;case 5:return pM(t),e===null&&E0(t),n=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,b0(n,o)?s=null:i!==null&&b0(n,i)&&(t.flags|=32),DM(e,t),yr(e,t,s,r),t.child;case 6:return e===null&&E0(t),null;case 13:return HM(e,t,r);case 4:return wy(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Hl(t,null,n,r):yr(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Gn(n,o),aw(e,t,n,o,r);case 7:return yr(e,t,t.pendingProps,r),t.child;case 8:return yr(e,t,t.pendingProps.children,r),t.child;case 12:return yr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Ye(Gp,n._currentValue),n._currentValue=s,i!==null)if(so(i.value,s)){if(i.children===o.children&&!Dr.current){t=ii(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=ei(-1,r&-r),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),C0(i.return,r,t),a.lanes|=r;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error($(341));s.lanes|=r,a=s.alternate,a!==null&&(a.lanes|=r),C0(s,r,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}yr(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,bl(t,r),o=Pn(o),n=n(o),t.flags|=1,yr(e,t,n,r),t.child;case 14:return n=t.type,o=Gn(n,t.pendingProps),o=Gn(n.type,o),lw(e,t,n,o,r);case 15:return LM(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Gn(n,o),Qf(e,t),t.tag=1,$r(n)?(e=!0,Wp(t)):e=!1,bl(t,r),uM(t,n,o),T0(t,n,o,r),A0(null,t,n,!0,e,r);case 19:return BM(e,t,r);case 22:return IM(e,t,r)}throw Error($(156,t.tag))};function rT(e,t){return O5(e,t)}function g9(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function On(e,t,r,n){return new g9(e,t,r,n)}function Dy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function v9(e){if(typeof e=="function")return Dy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ry)return 11;if(e===ny)return 14}return 2}function Xi(e,t){var r=e.alternate;return r===null?(r=On(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function tp(e,t,r,n,o,i){var s=2;if(n=e,typeof e=="function")Dy(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Za:return ea(r.children,o,i,t);case ty:s=8,o|=8;break;case X1:return e=On(12,r,t,o|2),e.elementType=X1,e.lanes=i,e;case Q1:return e=On(13,r,t,o),e.elementType=Q1,e.lanes=i,e;case Z1:return e=On(19,r,t,o),e.elementType=Z1,e.lanes=i,e;case d5:return rm(r,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case c5:s=10;break e;case u5:s=9;break e;case ry:s=11;break e;case ny:s=14;break e;case Oi:s=16,n=null;break e}throw Error($(130,e==null?e:typeof e,""))}return t=On(s,r,t,o),t.elementType=e,t.type=n,t.lanes=i,t}function ea(e,t,r,n){return e=On(7,e,n,t),e.lanes=r,e}function rm(e,t,r,n){return e=On(22,e,n,t),e.elementType=d5,e.lanes=r,e.stateNode={isHidden:!1},e}function Gg(e,t,r){return e=On(6,e,null,t),e.lanes=r,e}function Yg(e,t,r){return t=On(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function y9(e,t,r,n,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_g(0),this.expirationTimes=_g(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_g(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function $y(e,t,r,n,o,i,s,a,l){return e=new y9(e,t,r,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=On(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},ky(i),e}function b9(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(sT)}catch(e){console.error(e)}}sT(),o5.exports=hn;var am=o5.exports;const wf=Dn(am);var E9=Object.defineProperty,C9=Object.getOwnPropertyDescriptor,M9=(e,t,r,n)=>{for(var o=n>1?void 0:n?C9(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&E9(t,r,o),o},aT=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},re=(e,t,r)=>(aT(e,t,"read from private field"),r?r.call(e):t.get(e)),en=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Qr=(e,t,r,n)=>(aT(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Gc,T9=class{constructor(){this.portals=new Map,en(this,Gc,jh()),this.on=e=>re(this,Gc).on("update",e),this.once=e=>{const t=re(this,Gc).on("update",r=>{t(),e(r)});return t}}update(){re(this,Gc).emit("update",this.portals)}render({Component:e,container:t}){const r=this.portals.get(t);this.portals.set(t,{Component:e,key:(r==null?void 0:r.key)??Cl()}),this.update()}forceUpdate(){for(const[e,{Component:t}]of this.portals)this.portals.set(e,{Component:t,key:Cl()})}remove(e){this.portals.delete(e),this.update()}};Gc=new WeakMap;var O9=e=>{const{portals:t}=e;return L.createElement(L.Fragment,null,t.map(([r,{Component:n,key:o}])=>am.createPortal(L.createElement(n,null),r,o)))};function _9(e){const[t,r]=S.useState(()=>Array.from(e.portals.entries()));return S.useEffect(()=>e.on(n=>{r(Array.from(n.entries()))}),[e]),S.useMemo(()=>t,[t])}var st,Yc,As,Jc,rp,Xc,Ka,Qc,np,Ho,vr,V0,lT=class{constructor({getPosition:e,node:t,portalContainer:r,view:n,ReactComponent:o,options:i}){en(this,st,void 0),en(this,Yc,[]),en(this,As,void 0),en(this,Jc,void 0),en(this,rp,void 0),en(this,Xc,void 0),en(this,Ka,void 0),en(this,Qc,!1),en(this,np,void 0),en(this,Ho,void 0),en(this,vr,void 0),en(this,V0,l=>{l&&(te(re(this,Ho),{code:H.REACT_NODE_VIEW,message:`You have applied a ref to a node view provided for '${re(this,st).type.name}' which doesn't support content.`}),l.append(re(this,Ho)))}),this.Component=()=>{const l=re(this,rp);return te(l,{code:H.REACT_NODE_VIEW,message:`The custom react node view provided for ${re(this,st).type.name} doesn't have a valid ReactComponent`}),L.createElement(l,{updateAttributes:this.updateAttributes,selected:this.selected,view:re(this,As),getPosition:re(this,Xc),node:re(this,st),forwardRef:re(this,V0),decorations:re(this,Yc)})},this.updateAttributes=l=>{if(!re(this,As).editable)return;const c=re(this,Xc).call(this);if(c==null)return;const u=re(this,As).state.tr.setNodeMarkup(c,void 0,{...re(this,st).attrs,...l});re(this,As).dispatch(u)},te(_e(e),{message:"You are attempting to use a node view for a mark type. This is not supported yet. Please check your configuration."}),Qr(this,st,t),Qr(this,As,n),Qr(this,Jc,r),Qr(this,rp,o),Qr(this,Xc,e),Qr(this,Ka,i),Qr(this,vr,this.createDom());const{contentDOM:s,wrapper:a}=this.createContentDom()??{};Qr(this,np,s??void 0),Qr(this,Ho,a),re(this,Ho)&&re(this,vr).append(re(this,Ho)),this.setDomAttributes(re(this,st),re(this,vr)),this.Component.displayName=V4(`${re(this,st).type.name}NodeView`),this.renderComponent()}static create(e){const{portalContainer:t,ReactComponent:r,options:n}=e;return(o,i,s)=>new lT({options:n,node:o,view:i,getPosition:s,portalContainer:t,ReactComponent:r})}get selected(){return re(this,Qc)}get contentDOM(){return re(this,np)}get dom(){return re(this,vr)}renderComponent(){re(this,Jc).render({Component:this.Component,container:re(this,vr)})}createDom(){const{defaultBlockNode:e,defaultInlineNode:t}=re(this,Ka),r=re(this,st).isInline?document.createElement(t):document.createElement(e);return r.classList.add(`${Xx(re(this,st).type.name)}-node-view-wrapper`),r}createContentDom(){var e,t;if(re(this,st).isLeaf)return;const r=(t=(e=re(this,st).type.spec).toDOM)==null?void 0:t.call(e,re(this,st));if(!r)return;const{contentDOM:n,dom:o}=an.renderSpec(document,r);let i;if(Je(o))return i=o,o===n&&(i=document.createElement("span"),i.classList.add(`${Xx(re(this,st).type.name)}-node-view-content-wrapper`),i.append(n)),Je(n),{wrapper:i,contentDOM:n}}update(e,t){return $h({types:re(this,st).type,node:e})?(re(this,st)===e&&re(this,Yc)===t||(re(this,st).sameMarkup(e)||this.setDomAttributes(e,re(this,vr)),Qr(this,st,e),Qr(this,Yc,t),this.renderComponent()),!0):!1}setDomAttributes(e,t){const{toDOM:r}=re(this,st).type.spec;let n=e.attrs;if(r){const o=r(e);if(ne(o)||A9(o))return;hs(o[1])&&(n=o[1])}for(const[o,i]of At(n))t.setAttribute(o,i)}selectNode(){Qr(this,Qc,!0),re(this,vr)&&re(this,vr).classList.add(qx),this.renderComponent()}deselectNode(){Qr(this,Qc,!1),re(this,vr)&&re(this,vr).classList.remove(qx),this.renderComponent()}destroy(){re(this,Jc).remove(re(this,vr))}ignoreMutation(e){return e.type==="selection"?!re(this,st).type.spec.selectable:re(this,Ho)?!re(this,Ho).contains(e.target):!0}stopEvent(e){var t;if(!re(this,vr))return!1;if(_e(re(this,Ka).stopEvent))return re(this,Ka).stopEvent({event:e});const r=e.target;if(!(re(this,vr).contains(r)&&!((t=this.contentDOM)!=null&&t.contains(r))))return!1;const o=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o)return!0;const s=!!re(this,st).type.spec.draggable,a=ce.isSelectable(re(this,st)),l=e.type==="copy",c=e.type==="paste",u=e.type==="cut",d=e.type==="mousedown",f=e.type.startsWith("drag");return!s&&a&&f&&e.preventDefault(),!(f||o||l||c||u||d&&a)}},ww=lT;st=new WeakMap;Yc=new WeakMap;As=new WeakMap;Jc=new WeakMap;rp=new WeakMap;Xc=new WeakMap;Ka=new WeakMap;Qc=new WeakMap;np=new WeakMap;Ho=new WeakMap;vr=new WeakMap;V0=new WeakMap;function A9(e){return Ap(e)||hs(e)&&Ap(e.dom)}var ad=class extends Ve{constructor(){super(...arguments),this.portalContainer=new T9}get name(){return"reactComponent"}onCreate(){this.store.setStoreKey("portalContainer",this.portalContainer)}createNodeViews(){const e=ee(),t=this.store.managerSettings.nodeViewComponents??{};for(const n of this.store.extensions)!n.ReactComponent||!Hd(n)||n.reactComponentEnvironment==="ssr"||(e[n.name]=ww.create({options:this.options,ReactComponent:n.ReactComponent,portalContainer:this.portalContainer}));const r=At({...this.options.nodeViewComponents,...t});for(const[n,o]of r)e[n]=ww.create({options:this.options,ReactComponent:o,portalContainer:this.portalContainer});return e}};ad=M9([pe({defaultOptions:{defaultBlockNode:"div",defaultInlineNode:"span",defaultContentNode:"span",defaultEnvironment:"both",nodeViewComponents:{},stopEvent:null},staticKeys:["defaultBlockNode","defaultInlineNode","defaultContentNode","defaultEnvironment"]})],ad);function N9(e){const t=S.createContext(null),r=R9(t);return[o=>{const i=e(o);return L.createElement(t.Provider,{value:i},o.children)},r,t]}function R9(e){return(t,r)=>{const n=S.useContext(e),o=P9(n);if(!n)throw new Error("`useContextHook` must be placed inside the `Provider` returned by the `createContextState` method");if(!t)return n;if(typeof t!="function")throw new TypeError("invalid arguments passed to `useContextHook`. This hook must be called with zero arguments, a getter function or a path string.");const i=t(n);if(!o||!r)return i;const s=t(o);return r(s,i)?s:i}}function P9(e){const t=S.useRef();return z9(()=>{t.current=e}),t.current}var z9=typeof document<"u"?S.useLayoutEffect:S.useEffect;function L9(e,t){return N9(r=>{const n=S.useRef(null),o=S.useRef(),i=t==null?void 0:t(r),[s,a]=S.useState(()=>e({get:Sw(n),set:Ew(o),previousContext:void 0,props:r,state:i})),l=[...Object.values(r),i];return S.useEffect(()=>{l.length!==0&&a(c=>e({get:Sw(n),set:Ew(o),previousContext:c,props:r,state:i}))},l),n.current=s,o.current=a,s})}function Sw(e){return t=>{if(!e.current)throw new Error("`get` called outside of function scope. `get` can only be called within a function.");if(!t)return e.current;if(typeof t!="function")throw new TypeError("Invalid arguments passed to `useContextHook`. The hook must be called with zero arguments, a getter function or a path string.");return t(e.current)}}function Ew(e){return t=>{if(!e.current)throw new Error("`set` called outside of function scope. `set` can only be called within a function.");e.current(r=>({...r,...typeof t=="function"?t(r):t}))}}var cT={},uT={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorMessages=e.ErrorType=void 0;var t;(function(r){r.MalformedUnicode="MALFORMED_UNICODE",r.MalformedHexadecimal="MALFORMED_HEXADECIMAL",r.CodePointLimit="CODE_POINT_LIMIT",r.OctalDeprecation="OCTAL_DEPRECATION",r.EndOfString="END_OF_STRING"})(t=e.ErrorType||(e.ErrorType={})),e.errorMessages=new Map([[t.MalformedUnicode,"malformed Unicode character escape sequence"],[t.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[t.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[t.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[t.EndOfString,"malformed escape sequence at end of string"]])})(uT);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.unraw=e.errorMessages=e.ErrorType=void 0;const t=uT;Object.defineProperty(e,"ErrorType",{enumerable:!0,get:function(){return t.ErrorType}}),Object.defineProperty(e,"errorMessages",{enumerable:!0,get:function(){return t.errorMessages}});function r(p){return!p.match(/[^a-f0-9]/i)?parseInt(p,16):NaN}function n(p,h,m){const b=r(p);if(Number.isNaN(b)||m!==void 0&&m!==p.length)throw new SyntaxError(t.errorMessages.get(h));return b}function o(p){const h=n(p,t.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(h)}function i(p,h){const m=n(p,t.ErrorType.MalformedUnicode,4);if(h!==void 0){const b=n(h,t.ErrorType.MalformedUnicode,4);return String.fromCharCode(m,b)}return String.fromCharCode(m)}function s(p){return p.charAt(0)==="{"&&p.charAt(p.length-1)==="}"}function a(p){if(!s(p))throw new SyntaxError(t.errorMessages.get(t.ErrorType.MalformedUnicode));const h=p.slice(1,-1),m=n(h,t.ErrorType.MalformedUnicode);try{return String.fromCodePoint(m)}catch(b){throw b instanceof RangeError?new SyntaxError(t.errorMessages.get(t.ErrorType.CodePointLimit)):b}}function l(p,h=!1){if(h)throw new SyntaxError(t.errorMessages.get(t.ErrorType.OctalDeprecation));const m=parseInt(p,8);return String.fromCharCode(m)}const c=new Map([["b","\b"],["f","\f"],["n",` +`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function u(p){return c.get(p)||p}const d=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function f(p,h=!1){return p.replace(d,function(m,b,v,g,y,x,k,w,E){if(b!==void 0)return"\\";if(v!==void 0)return o(v);if(g!==void 0)return a(g);if(y!==void 0)return i(y,x);if(k!==void 0)return i(k);if(w==="0")return"\0";if(w!==void 0)return l(w,!h);if(E!==void 0)return u(E);throw new SyntaxError(t.errorMessages.get(t.ErrorType.EndOfString))})}e.unraw=f,e.default=f})(cT);const I9=Dn(cT),Yo=e=>typeof e=="string",D9=e=>typeof e=="function",Cw=new Map;function Vy(e){return[...Array.isArray(e)?e:[e],"en"]}function dT(e,t,r){const n=Vy(e);return ih(()=>sh("date",n,r),()=>new Intl.DateTimeFormat(n,r)).format(Yo(t)?new Date(t):t)}function j0(e,t,r){const n=Vy(e);return ih(()=>sh("number",n,r),()=>new Intl.NumberFormat(n,r)).format(t)}function Mw(e,t,r,{offset:n=0,...o}){const i=Vy(e),s=t?ih(()=>sh("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):ih(()=>sh("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return o[r]??o[s.select(r-n)]??o.other}function ih(e,t){const r=e();let n=Cw.get(r);return n||(n=t(),Cw.set(r,n)),n}function sh(e,t,r){const n=t.join("-");return`${e}-${n}-${JSON.stringify(r)}`}const fT=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g,$9=(e,t,r={})=>{t=t||e;const n=i=>Yo(i)?r[i]||{style:i}:i,o=(i,s)=>{const a=Object.keys(r).length?n("number"):{},l=j0(t,i,a);return s.replace("#",l)};return{plural:(i,s)=>{const{offset:a=0}=s,l=Mw(t,!1,i,s);return o(i-a,l)},selectordinal:(i,s)=>{const{offset:a=0}=s,l=Mw(t,!0,i,s);return o(i-a,l)},select:(i,s)=>s[i]??s.other,number:(i,s)=>j0(t,i,n(s)),date:(i,s)=>dT(t,i,n(s)),undefined:i=>i}};function H9(e,t,r){return(n,o={})=>{const i=$9(t,r,o),s=l=>Array.isArray(l)?l.reduce((c,u)=>{if(Yo(u))return c+u;const[d,f,p]=u;let h={};p!=null&&!Yo(p)?Object.keys(p).forEach(b=>{h[b]=s(p[b])}):h=p;const m=i[f](n[d],h);return m==null?c:c+m},""):l,a=s(e);return Yo(a)&&fT.test(a)?I9(a.trim()):Yo(a)?a.trim():a}}var B9=Object.defineProperty,F9=(e,t,r)=>t in e?B9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,V9=(e,t,r)=>(F9(e,typeof t!="symbol"?t+"":t,r),r);class j9{constructor(){V9(this,"_events",{})}on(t,r){return this._hasEvent(t)||(this._events[t]=[]),this._events[t].push(r),()=>this.removeListener(t,r)}removeListener(t,r){if(!this._hasEvent(t))return;const n=this._events[t].indexOf(r);~n&&this._events[t].splice(n,1)}emit(t,...r){this._hasEvent(t)&&this._events[t].map(n=>n.apply(this,r))}_hasEvent(t){return Array.isArray(this._events[t])}}var U9=Object.defineProperty,W9=(e,t,r)=>t in e?U9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pa=(e,t,r)=>(W9(e,typeof t!="symbol"?t+"":t,r),r);class K9 extends j9{constructor(t){super(),Pa(this,"_locale"),Pa(this,"_locales"),Pa(this,"_localeData"),Pa(this,"_messages"),Pa(this,"_missing"),Pa(this,"t",this._.bind(this)),this._messages={},this._localeData={},t.missing!=null&&(this._missing=t.missing),t.messages!=null&&this.load(t.messages),t.localeData!=null&&this.loadLocaleData(t.localeData),(t.locale!=null||t.locales!=null)&&this.activate(t.locale,t.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(t,r){this._localeData[t]==null?this._localeData[t]=r:Object.assign(this._localeData[t],r)}loadLocaleData(t,r){r!=null?this._loadLocaleData(t,r):Object.keys(t).forEach(n=>this._loadLocaleData(n,t[n])),this.emit("change")}_load(t,r){this._messages[t]==null?this._messages[t]=r:Object.assign(this._messages[t],r)}load(t,r){r!=null?this._load(t,r):Object.keys(t).forEach(n=>this._load(n,t[n])),this.emit("change")}loadAndActivate({locale:t,locales:r,messages:n}){this._locale=t,this._locales=r||void 0,this._messages[this._locale]=n,this.emit("change")}activate(t,r){this._locale=t,this._locales=r,this.emit("change")}_(t,r={},{message:n,formats:o}={}){Yo(t)||(r=t.values||r,n=t.message,t=t.id);const i=!this.messages[t],s=this._missing;if(s&&i)return D9(s)?s(this._locale,t):s;i&&this.emit("missing",{id:t,locale:this._locale});let a=this.messages[t]||n||t;return Yo(a)&&fT.test(a)?JSON.parse(`"${a}"`):Yo(a)?a:H9(a,this._locale,this._locales)(r,o)}date(t,r){return dT(this._locales||this._locale,t,r)}number(t,r){return j0(this._locales||this._locale,t,r)}}function q9(e={}){return new K9(e)}const lm=q9();function W(e,t){return t?"other":e==1?"one":"other"}function ui(e,t){return t?"other":e==0||e==1?"one":"other"}function Kr(e,t){var r=String(e).split("."),n=!r[1];return t?"other":e==1&&n?"one":"other"}function Le(e,t){return"other"}function xs(e,t){return t?"other":e==1?"one":e==2?"two":"other"}const G9=Le,Y9=W,J9=ui;function X9(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const Q9=W;function Z9(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function eD(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function tD(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const rD=W,nD=Kr;function oD(e,t){var r=String(e).split("."),n=r[0],o=n.slice(-1),i=n.slice(-2),s=n.slice(-3);return t?o==1||o==2||o==5||o==7||o==8||i==20||i==50||i==70||i==80?"one":o==3||o==4||s==100||s==200||s==300||s==400||s==500||s==600||s==700||s==800||s==900?"few":n==0||o==6||i==40||i==60||i==90?"many":"other":e==1?"one":"other"}function iD(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2);return t?(o==2||o==3)&&i!=12&&i!=13?"few":"other":o==1&&i!=11?"one":o>=2&&o<=4&&(i<12||i>14)?"few":n&&o==0||o>=5&&o<=9||i>=11&&i<=14?"many":"other"}const sD=W,aD=W,lD=W,cD=ui,uD=Le;function dD(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const fD=Le;function pD(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2),s=n&&r[0].slice(-6);return t?"other":o==1&&i!=11&&i!=71&&i!=91?"one":o==2&&i!=12&&i!=72&&i!=92?"two":(o==3||o==4||o==9)&&(i<10||i>19)&&(i<70||i>79)&&(i<90||i>99)?"few":e!=0&&n&&s==0?"many":"other"}const hD=W;function mD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function gD(e,t){var r=String(e).split("."),n=!r[1];return t?e==1||e==3?"one":e==2?"two":e==4?"few":"other":e==1&&n?"one":"other"}const vD=W;function yD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const bD=W,xD=W,kD=W;function wD(e,t){var r=String(e).split("."),n=r[0],o=!r[1];return t?"other":e==1&&o?"one":n>=2&&n<=4&&o?"few":o?"other":"many"}function SD(e,t){return t?e==0||e==7||e==8||e==9?"zero":e==1?"one":e==2?"two":e==3||e==4?"few":e==5||e==6?"many":"other":e==0?"zero":e==1?"one":e==2?"two":e==3?"few":e==6?"many":"other"}function ED(e,t){var r=String(e).split("."),n=r[0],o=Number(r[0])==e;return t?"other":e==1||!o&&(n==0||n==1)?"one":"other"}const CD=Kr;function MD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}const TD=W,OD=Le,_D=W,AD=W;function ND(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?i==1&&s!=11?"one":i==2&&s!=12?"two":i==3&&s!=13?"few":"other":e==1&&n?"one":"other"}const RD=W,PD=W,zD=Kr,LD=W;function ID(e,t){return t?"other":e>=0&&e<=1?"one":"other"}function DD(e,t){return t?"other":e>=0&&e<2?"one":"other"}const $D=Kr;function HD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const BD=W;function FD(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const VD=W,jD=Kr;function UD(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1?"one":"other":e==1?"one":e==2?"two":n&&e>=3&&e<=6?"few":n&&e>=7&&e<=10?"many":"other"}function WD(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1||e==11?"one":e==2||e==12?"two":e==3||e==13?"few":"other":e==1||e==11?"one":e==2||e==12?"two":n&&e>=3&&e<=10||n&&e>=13&&e<=19?"few":"other"}const KD=Kr,qD=W;function GD(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const YD=ui;function JD(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(s==0||s==20||s==40||s==60||s==80)?"few":o?"other":"many"}const XD=W,QD=W;function ZD(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1);return t?"other":e==1&&o?"one":n==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}function e7(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}function t7(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function r7(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}function n7(e,t){return t?e==1||e==5?"one":"other":e==1?"one":"other"}function o7(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const i7=Kr,s7=Le,a7=Le,l7=Le,c7=Kr;function u7(e,t){var r=String(e).split("."),n=r[0],o=Number(r[0])==e,i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1&&s!=11||!o?"one":"other"}function d7(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}const f7=xs;function p7(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1);return t?"other":e==1&&o?"one":n==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}const h7=Le,m7=Le,g7=W,v7=Kr,y7=W,b7=Le,x7=Le;function k7(e,t){var r=String(e).split("."),n=r[0],o=n.slice(-2);return t?n==1?"one":n==0||o>=2&&o<=20||o==40||o==60||o==80?"many":"other":e==1?"one":"other"}function w7(e,t){return t?"other":e>=0&&e<2?"one":"other"}const S7=W,E7=W,C7=Le,M7=Le;function T7(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1);return t?o==6||o==9||n&&o==0&&e!=0?"many":"other":e==1?"one":"other"}const O7=W,_7=W,A7=Le;function N7(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const R7=Le,P7=W,z7=W;function L7(e,t){return t?"other":e==0?"zero":e==1?"one":"other"}const I7=W;function D7(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2),i=n&&r[0].slice(-3),s=n&&r[0].slice(-5),a=n&&r[0].slice(-6);return t?n&&e>=1&&e<=4||o>=1&&o<=4||o>=21&&o<=24||o>=41&&o<=44||o>=61&&o<=64||o>=81&&o<=84?"one":e==5||o==5?"many":"other":e==0?"zero":e==1?"one":o==2||o==22||o==42||o==62||o==82||n&&i==0&&(s>=1e3&&s<=2e4||s==4e4||s==6e4||s==8e4)||e!=0&&a==1e5?"two":o==3||o==23||o==43||o==63||o==83?"few":e!=1&&(o==1||o==21||o==41||o==61||o==81)?"many":"other"}const $7=W;function H7(e,t){var r=String(e).split("."),n=r[0];return t?"other":e==0?"zero":(n==0||n==1)&&e!=0?"one":"other"}const B7=W,F7=W,V7=Le,j7=ui;function U7(e,t){return t&&e==1?"one":"other"}function W7(e,t){var r=String(e).split("."),n=r[1]||"",o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?"other":i==1&&(s<11||s>19)?"one":i>=2&&i<=9&&(s<11||s>19)?"few":n!=0?"many":"other"}function K7(e,t){var r=String(e).split("."),n=r[1]||"",o=n.length,i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const q7=W,G7=ui,Y7=W;function J7(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?s==1&&a!=11?"one":s==2&&a!=12?"two":(s==7||s==8)&&a!=17&&a!=18?"many":"other":i&&s==1&&a!=11||l==1&&c!=11?"one":"other"}const X7=W,Q7=W;function Z7(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-2);return t?e==1?"one":"other":e==1&&n?"one":!n||e==0||i>=2&&i<=19?"few":"other"}function e$(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":"other":e==1?"one":"other"}function t$(e,t){return t&&e==1?"one":"other"}function r$(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==1?"one":e==0||o>=2&&o<=10?"few":o>=11&&o<=19?"many":"other"}const n$=Le,o$=W,i$=xs,s$=W,a$=W;function l$(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?n&&e>=1&&e<=4?"one":"other":e==1?"one":"other"}const c$=Kr,u$=W,d$=W,f$=W,p$=Le,h$=W,m$=ui,g$=W,v$=W,y$=W;function b$(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1||e==5||n&&e>=7&&e<=9?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e==1?"one":"other"}const x$=W,k$=Le,w$=ui,S$=W;function E$(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":e==1&&o?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&n!=1&&(i==0||i==1)||o&&i>=5&&i<=9||o&&s>=12&&s<=14?"many":"other"}function C$(e,t){var r=String(e).split("."),n=r[1]||"",o=n.length,i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const M$=W;function T$(e,t){var r=String(e).split("."),n=r[0];return t?"other":n==0||n==1?"one":"other"}const O$=Kr,_$=W;function A$(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-2);return t?e==1?"one":"other":e==1&&n?"one":!n||e==0||i>=2&&i<=19?"few":"other"}const N$=W,R$=Le;function P$(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1&&s!=11?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&i==0||o&&i>=5&&i<=9||o&&s>=11&&s<=14?"many":"other"}const z$=W,L$=Le,I$=W;function D$(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}function $$(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}const H$=W,B$=W,F$=xs,V$=W,j$=Le,U$=Le;function W$(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function K$(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?"other":e>=0&&e<=1?"one":n&&e>=2&&e<=10?"few":"other"}function q$(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"";return t?"other":e==0||e==1||n==0&&o==1?"one":"other"}function G$(e,t){var r=String(e).split("."),n=r[0],o=!r[1];return t?"other":e==1&&o?"one":n>=2&&n<=4&&o?"few":o?"other":"many"}function Y$(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(i==3||i==4)||!o?"few":"other"}const J$=xs,X$=xs,Q$=xs,Z$=xs,eH=xs,tH=W,rH=W;function nH(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2);return t?e==1?"one":o==4&&i!=14?"many":"other":e==1?"one":"other"}function oH(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}const iH=W,sH=W,aH=W,lH=Le;function cH(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?(i==1||i==2)&&s!=11&&s!=12?"one":"other":e==1&&n?"one":"other"}const uH=Kr,dH=W,fH=W,pH=W,hH=W,mH=Le,gH=ui,vH=W;function yH(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1);return t?o==6||o==9||e==10?"few":"other":e==1?"one":"other"}function bH(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const xH=W,kH=Le,wH=W,SH=W;function EH(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?"other":e==0||e==1||n&&e>=11&&e<=99?"one":"other"}const CH=W;function MH(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-1),c=n.slice(-2);return t?s==3&&a!=13?"few":"other":o&&l==1&&c!=11?"one":o&&l>=2&&l<=4&&(c<12||c>14)?"few":o&&l==0||o&&l>=5&&l<=9||o&&c>=11&&c<=14?"many":"other"}const TH=Kr,OH=W,_H=W;function AH(e,t){return t&&e==1?"one":"other"}const NH=W,RH=W,PH=ui,zH=W,LH=Le,IH=W,DH=W,$H=Kr,HH=Le,BH=Le,FH=Le;function VH(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const jH=Object.freeze(Object.defineProperty({__proto__:null,_in:G9,af:Y9,ak:J9,am:X9,an:Q9,ar:Z9,ars:eD,as:tD,asa:rD,ast:nD,az:oD,be:iD,bem:sD,bez:aD,bg:lD,bho:cD,bm:uD,bn:dD,bo:fD,br:pD,brx:hD,bs:mD,ca:gD,ce:vD,ceb:yD,cgg:bD,chr:xD,ckb:kD,cs:wD,cy:SD,da:ED,de:CD,dsb:MD,dv:TD,dz:OD,ee:_D,el:AD,en:ND,eo:RD,es:PD,et:zD,eu:LD,fa:ID,ff:DD,fi:$D,fil:HD,fo:BD,fr:FD,fur:VD,fy:jD,ga:UD,gd:WD,gl:KD,gsw:qD,gu:GD,guw:YD,gv:JD,ha:XD,haw:QD,he:ZD,hi:e7,hr:t7,hsb:r7,hu:n7,hy:o7,ia:i7,id:s7,ig:a7,ii:l7,io:c7,is:u7,it:d7,iu:f7,iw:p7,ja:h7,jbo:m7,jgo:g7,ji:v7,jmc:y7,jv:b7,jw:x7,ka:k7,kab:w7,kaj:S7,kcg:E7,kde:C7,kea:M7,kk:T7,kkj:O7,kl:_7,km:A7,kn:N7,ko:R7,ks:P7,ksb:z7,ksh:L7,ku:I7,kw:D7,ky:$7,lag:H7,lb:B7,lg:F7,lkt:V7,ln:j7,lo:U7,lt:W7,lv:K7,mas:q7,mg:G7,mgo:Y7,mk:J7,ml:X7,mn:Q7,mo:Z7,mr:e$,ms:t$,mt:r$,my:n$,nah:o$,naq:i$,nb:s$,nd:a$,ne:l$,nl:c$,nn:u$,nnh:d$,no:f$,nqo:p$,nr:h$,nso:m$,ny:g$,nyn:v$,om:y$,or:b$,os:x$,osa:k$,pa:w$,pap:S$,pl:E$,prg:C$,ps:M$,pt:T$,pt_PT:O$,rm:_$,ro:A$,rof:N$,root:R$,ru:P$,rwk:z$,sah:L$,saq:I$,sc:D$,scn:$$,sd:H$,sdh:B$,se:F$,seh:V$,ses:j$,sg:U$,sh:W$,shi:K$,si:q$,sk:G$,sl:Y$,sma:J$,smi:X$,smj:Q$,smn:Z$,sms:eH,sn:tH,so:rH,sq:nH,sr:oH,ss:iH,ssy:sH,st:aH,su:lH,sv:cH,sw:uH,syr:dH,ta:fH,te:pH,teo:hH,th:mH,ti:gH,tig:vH,tk:yH,tl:bH,tn:xH,to:kH,tr:wH,ts:SH,tzm:EH,ug:CH,uk:MH,ur:TH,uz:OH,ve:_H,vi:AH,vo:NH,vun:RH,wa:PH,wae:zH,wo:LH,xh:IH,xog:DH,yi:$H,yo:HH,yue:BH,zh:FH,zu:VH},Symbol.toStringTag,{value:"Module"}));var UH=Object.defineProperty,WH=Object.getOwnPropertyDescriptor,KH=Object.getOwnPropertyNames,qH=Object.prototype.hasOwnProperty,Tw=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of KH(t))!qH.call(e,o)&&o!==r&&UH(e,o,{get:()=>t[o],enumerable:!(n=WH(t,o))||n.enumerable});return e},GH=(e,t,r)=>(Tw(e,t,"default"),r&&Tw(r,t,"default")),YH=JSON.parse('{"extension.command.toggle-upper-case.label":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"extension.table.column_count":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"extension.table.row_count":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.toggle-columns.description":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"extension.command.toggle-columns.label":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"extension.command.set-text-direction.label":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"extension.command.set-text-direction.description":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"extension.command.toggle-heading.label":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"extension.command.toggle-callout.description":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"extension.command.toggle-callout.label":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"extension.command.toggle-code-block.description":"Add a code block","extension.command.add-annotation.label":"Add annotation","extension.command.toggle-blockquote.description":"Add blockquote formatting to the selected text","extension.command.toggle-bold.description":"Add bold formatting to the selected text","extension.command.toggle-code.description":"Add inline code formatting to the selected text","keyboard.shortcut.alt":"Alt","keyboard.shortcut.arrowDown":"Arrow Down","keyboard.shortcut.arrowLeft":"Arrow Left","keyboard.shortcut.arrowRight":"Arrow Right","keyboard.shortcut.arrowUp":"Arrow Up","keyboard.shortcut.backspace":"Backspace","ui.text-color.black":"Black","extension.command.toggle-blockquote.label":"Blockquote","ui.text-color.blue":"Blue","ui.text-color.blue.hue":["Blue ",["hue"]],"extension.command.toggle-bold.label":"Bold","extension.command.toggle-bullet-list.description":"Bulleted list","keyboard.shortcut.capsLock":"Caps Lock","extension.command.center-align.label":"Center align","extension.command.toggle-code.label":"Code","extension.command.toggle-code-block.label":"Codeblock","keyboard.shortcut.command":"Command","QcPNd6":"Image description","ogrUzJ":"Add a short description here.","yqdyzr":"Image","6/02F4":"Image source","X8H91v":"Image","zhQ7Zt":"Italic","ZL7E7l":"Underline","keyboard.shortcut.control":"Control","extension.command.convert-paragraph.description":"Convert current block into a paragraph block.","extension.command.convert-paragraph.label":"Convert Paragraph","extension.command.copy.label":"Copy","extension.command.copy.description":"Copy the selected text","extension.command.create-table.description":"Create a table with set number of rows and columns.","extension.command.create-table.label":"Create table","extension.command.cut.label":"Cut","extension.command.cut.description":"Cut the selected text","ui.text-color.cyan":"Cyan","ui.text-color.cyan.hue":["Cyan ",["hue"]],"extension.command.decrease-font-size.label":"Decrease","extension.command.decrease-indent.label":"Decrease indentation","extension.command.decrease-font-size.description":"Decrease the font size.","keyboard.shortcut.delete":"Delete","extension.command.insert-horizontal-rule.label":"Divider","keyboard.shortcut.end":"End","keyboard.shortcut.escape":"Enter","keyboard.shortcut.enter":"Enter","6PjrOF":"Add annotation","OTq5WC":"Center align","oeZ3ox":"Convert current block into a paragraph block.","m1khs+":"Convert Paragraph","w/1U+3":"Copy the selected text","kdodi0":"Copy","k0KR/u":"Create a table with set number of rows and columns.","zrwMyD":"Create table","D/nWxh":"Cut the selected text","jHPv5m":"Cut","5cNgRx":"Decrease the font size.","vyRNWx":"Decrease","Jgiol4":"Decrease indentation","1gJSHH":"Increase the font size","OQXJXz":"Increase","72TLhr":"Increase indentation","HFlfzJ":"Insert Emoji","RPq9fY":"Separate content with a diving horizontal line","OKQF+e":"Divider","zjYb9C":"Insert a new paragraph","4M4sXC":"Insert Paragraph","1Q+eVc":"Justify","ejWWtP":"Left align","wVqrpS":"Paste content into the editor","07v9aw":"Paste","zUYfou":"Redo the most recent action","9Nq9zr":"Redo","0uxaZe":"Remove annotation","iJWZAz":"Right align","g5WpPn":"Select all content within the editor","2+pZDT":"Select all","yChCR1":"Set text case","GMzAC/":"Set the font size for the selected text.","vzEyrv":"Font size","7VCkJ8":"Set the text color for the selected text.","qjWFaR":"Text color","LVWgFu":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"WXwRy1":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"G/o315":"Set the text highlight color for the selected text.","xtHg6d":"Text highlight","1p1W/p":"Add blockquote formatting to the selected text","6+rh6I":"Blockquote","0yB3LV":"Add bold formatting to the selected text","sFMo4Z":"Bold","SMKG/s":"Bulleted list","/BYCMi":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"V+3IBe":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"hbIo4L":"Add a code block","7GkMcx":"Codeblock","2r4JYl":"Add inline code formatting to the selected text","Up8Tpe":"Code","ATHSPS":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"7DC1VE":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"hnrBeo":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"NkZAcw":"Italicize the selected text","2fTW9e":"Italic","c759Ra":"Ordered list","uQwrZu":"Strikethrough the selected text","pT3qly":"Strikethrough","BHk+zu":"Subscript","18BVwM":"Superscript","tOIVCV":"Tasked list","4Janx3":"Underline the selected text","dCHt+D":"Underline","YYAprs":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"tczyZL":"Show hidden whitespace characters in your editor.","0qAX23":"Toggle Whitespace","ezMADU":"Undo the most recent action","N3P7EC":"Undo","2nj/+s":"Update annotation","dWD7u4":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"qXqgVT":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.set-font-size.label":"Font size","ui.text-color.grape":"Grape","ui.text-color.grape.hue":["Grape ",["hue"]],"ui.text-color.gray":"Gray","ui.text-color.gray.hue":["Gray ",["hue"]],"ui.text-color.green":"Green","ui.text-color.green.hue":["Green ",["hue"]],"keyboard.shortcut.home":"Home","extension.command.increase-font-size.label":"Increase","extension.command.increase-indent.label":"Increase indentation","extension.command.increase-font-size.description":"Increase the font size","ui.text-color.indigo":"Indigo","ui.text-color.indigo.hue":["Indigo ",["hue"]],"extension.command.insert-paragraph.description":"Insert a new paragraph","extension.command.insert-emoji.label":"Insert Emoji","extension.command.insert-paragraph.label":"Insert Paragraph","extension.command.toggle-italic.label":"Italic","extension.command.toggle-italic.description":"Italicize the selected text","extension.command.justify-align.label":"Justify","R7NlCw":"Alt","RbDiK5":"Arrow Down","Dgyd+E":"Arrow Left","8pdCk4":"Arrow Right","Gp/343":"Arrow Up","PFPV0A":"Backspace","0IRYvp":"Caps Lock","X7HX0D":"Command","zq0AdD":"Control","8SfToN":"Delete","Ys/uah":"End","3K5hww":"Enter","veQt1j":"Enter","ySv7i+":"Home","e6RUI1":"Page Down","EEJk31":"Page Up","7sbhAU":"Shift","Q4eplT":"Space","SUhVVC":"Tab","extension.command.left-align.label":"Left align","ui.text-color.lime":"Lime","ui.text-color.lime.hue":["Lime ",["hue"]],"react-components.mention-atom-component.zero-items":"No items available","ui.text-color.orange":"Orange","ui.text-color.orange.hue":["Orange ",["hue"]],"extension.command.toggle-ordered-list.label":"Ordered list","keyboard.shortcut.pageDown":"Page Down","keyboard.shortcut.pageUp":"Page Up","extension.command.paste.label":"Paste","extension.command.paste.description":"Paste content into the editor","ui.text-color.pink":"Pink","ui.text-color.pink.hue":["Pink ",["hue"]],"zvMfIA":"No items available","pEjhti":"Static Menu","ui.text-color.red":"Red","ui.text-color.red.hue":["Red ",["hue"]],"extension.command.redo.label":"Redo","extension.command.redo.description":"Redo the most recent action","extension.command.remove-annotation.label":"Remove annotation","extension.command.right-align.label":"Right align","extension.command.select-all.label":"Select all","extension.command.select-all.description":"Select all content within the editor","extension.command.insert-horizontal-rule.description":"Separate content with a diving horizontal line","extension.command.set-casing.label":"Set text case","extension.command.set-font-size.description":"Set the font size for the selected text.","extension.command.set-text-color.description":"Set the text color for the selected text.","extension.command.set-text-highlight.description":"Set the text highlight color for the selected text.","keyboard.shortcut.shift":"Shift","extension.command.toggle-whitespace.description":"Show hidden whitespace characters in your editor.","keyboard.shortcut.space":"Space","extension.command.toggle-strike.label":"Strikethrough","extension.command.toggle-strike.description":"Strikethrough the selected text","extension.command.toggle-subscript.label":"Subscript","extension.command.toggle-superscript.label":"Superscript","keyboard.shortcut.tab":"Tab","extension.command.toggle-task-list.description":"Tasked list","ui.text-color.teal":"Teal","ui.text-color.teal.hue":["Teal ",["hue"]],"extension.command.set-text-color.label":"Text color","extension.command.set-text-highlight.label":"Text highlight","extension.command.toggle-whitespace.label":"Toggle Whitespace","ui.text-color.transparent":"Transparent","slrB1c":"Black","6QML30":"Blue","xw+keN":["Blue ",["hue"]],"38RHqP":"Cyan","D89yPf":["Cyan ",["hue"]],"VjBLnd":"Grape","Rp40yv":["Grape ",["hue"]],"5Dm9D1":"Gray","HGjXjC":["Gray ",["hue"]],"b9fz+n":"Green","18jo3M":["Green ",["hue"]],"CFzqCV":"Indigo","aVlDku":["Indigo ",["hue"]],"04PfLc":"Lime","KRTK6Y":["Lime ",["hue"]],"pSnXFd":"Orange","ve/MJZ":["Orange ",["hue"]],"OvCgDa":"Pink","l7NqyT":["Pink ",["hue"]],"IT9k0j":"Red","AdyJ7/":["Red ",["hue"]],"3D2UWc":"Teal","Dcq0Y1":["Teal ",["hue"]],"bsi2ik":"Transparent","Tj3PRR":"Violet","xxMH5N":["Violet ",["hue"]],"Rum0ah":"White","4gaw/Q":"Yellow","hhauc3":["Yellow ",["hue"]],"extension.command.toggle-underline.label":"Underline","extension.command.toggle-underline.description":"Underline the selected text","extension.command.undo.label":"Undo","extension.command.undo.description":"Undo the most recent action","extension.command.update-annotation.label":"Update annotation","ui.text-color.violet":"Violet","ui.text-color.violet.hue":["Violet ",["hue"]],"ui.text-color.white":"White","ui.text-color.yellow":"Yellow","ui.text-color.yellow.hue":["Yellow ",["hue"]]}'),pT={};GH(pT,jH);lm.loadLocaleData("en",{plurals:pT.en});lm.load("en",YH);lm.activate("en");var JH=Object.defineProperty,XH=Object.getOwnPropertyDescriptor,jy=(e,t,r,n)=>{for(var o=n>1?void 0:n?XH(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&JH(t,r,o),o},jl=class extends er{get name(){return"doc"}createNodeSpec(e,t){const{docAttributes:r,content:n}=this.options,o=ee();if(hs(r))for(const[i,s]of At(r))o[i]={default:s};else for(const i of r)o[i]={default:null};return{attrs:o,content:n,...t}}setDocAttributes(e){return({tr:t,dispatch:r})=>{if(r){for(const[n,o]of Object.entries(e))t.step(new ld(n,o));r(t)}return!0}}isDefaultDocNode({state:e=this.store.getState(),options:t}={}){return Kv(e.doc,t)}};jy([U()],jl.prototype,"setDocAttributes",1);jy([He()],jl.prototype,"isDefaultDocNode",1);jl=jy([pe({defaultOptions:{content:"block+",docAttributes:[]},defaultPriority:Ae.Medium,staticKeys:["content","docAttributes"],disableExtraAttributes:!0})],jl);var hT="SetDocAttribute",mT="RevertSetDocAttribute",ld=class extends Rt{constructor(e,t,r=hT){super(),this.stepType=r,this.key=e,this.value=t}static fromJSON(e,t){return new ld(t.key,t.value,t.stepType)}apply(e){this.previous=e.attrs[this.key];const t={...e.attrs,[this.key]:this.value};return yt.ok(e.type.create(t,e.content,e.marks))}invert(){return new ld(this.key,this.previous,mT)}map(){return this}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}};try{Rt.jsonID(hT,ld),Rt.jsonID(mT,ld)}catch(e){if(!e.message.startsWith("Duplicate use of step JSON ID"))throw e}var QH=Object.defineProperty,ZH=Object.getOwnPropertyDescriptor,gT=(e,t,r,n)=>{for(var o=n>1?void 0:n?ZH(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&QH(t,r,o),o};function eB(e,t,r,n){const o=e.docView.posFromDOM(t,r,n);return o===null||o<0?null:o}function tB(e,t){const r=t.target;if(r){const n=eB(e,r,0);if(n!==null){const o=e.state.doc.resolve(n),i=o.node().isLeaf?0:1,s=o.start()-i;return{pos:n,inside:s}}}return e.posAtCoords({left:t.clientX,top:t.clientY})??void 0}var ah=class extends Ve{constructor(){super(...arguments),this.mousedown=!1,this.mouseover=!1,this.createMouseEventHandler=e=>(t,r)=>{const n=r,o=tB(t,n);if(!o)return!1;const i=[],s=[],{inside:a,pos:l}=o;if(a===-1)return!1;const c=t.state.doc.resolve(l),u=c.depth+1;for(const d of Ev(u,1))i.push({node:d>c.depth&&c.nodeAfter?c.nodeAfter:c.node(d),pos:c.before(d)});for(const{type:d}of c.marksAcross(c)??[]){const f=_o(c,d);f&&s.push(f)}return e(n,{view:t,nodes:i,marks:s,getMark:d=>{const f=ne(d)?t.state.schema.marks[d]:d;return te(f,{code:H.EXTENSION,message:`The mark ${d} being checked does not exist within the editor schema.`}),s.find(p=>p.mark.type===f)},getNode:d=>{var f;const p=ne(d)?t.state.schema.nodes[d]:d;te(p,{code:H.EXTENSION,message:"The node being checked does not exist"});const h=i.find(({node:m})=>m.type===p);if(h)return{...h,isRoot:!!((f=i[0])!=null&&f.node.eq(h.node))}}})}}get name(){return"events"}onView(){var e,t;if(!((e=this.store.managerSettings.exclude)!=null&&e.clickHandler))for(const r of this.store.extensions){if(!r.createEventHandlers||(t=r.options.exclude)!=null&&t.clickHandler)continue;const n=r.createEventHandlers();for(const[o,i]of At(n))this.addHandler(o,i)}}createPlugin(){const e=new WeakMap,t=(r,n,o,i,s,a,l,c)=>{const u=this.store.currentState,{schema:d,doc:f}=u,p=f.resolve(i),h=e.has(l),m=rB({$pos:p,handled:h,view:o,state:u});let b=!1;h||(b=r(l,m)||b);const v={...m,pos:i,direct:c,nodeWithPosition:{node:s,pos:a},getNode:g=>{const y=ne(g)?d.nodes[g]:g;return te(y,{code:H.EXTENSION,message:"The node being checked does not exist"}),y===s.type?{node:s,pos:a}:void 0}};return e.set(l,!0),n(l,v)||b};return{props:{handleKeyPress:(r,n)=>this.options.keypress(n)||!1,handleKeyDown:(r,n)=>this.options.keydown(n)||!1,handleTextInput:(r,n,o,i)=>this.options.textInput({from:n,to:o,text:i})||!1,handleClickOn:(r,n,o,i,s,a)=>t(this.options.clickMark,this.options.click,r,n,o,i,s,a),handleDoubleClickOn:(r,n,o,i,s,a)=>t(this.options.doubleClickMark,this.options.doubleClick,r,n,o,i,s,a),handleTripleClickOn:(r,n,o,i,s,a)=>t(this.options.tripleClickMark,this.options.tripleClick,r,n,o,i,s,a),handleDOMEvents:{focus:(r,n)=>this.options.focus(n)||!1,blur:(r,n)=>this.options.blur(n)||!1,mousedown:(r,n)=>(this.startMouseover(),this.options.mousedown(n)||!1),mouseup:(r,n)=>(this.endMouseover(),this.options.mouseup(n)||!1),mouseleave:(r,n)=>(this.mouseover=!1,this.options.mouseleave(n)||!1),mouseenter:(r,n)=>(this.mouseover=!0,this.options.mouseenter(n)||!1),keyup:(r,n)=>this.options.keyup(n)||!1,mouseout:this.createMouseEventHandler((r,n)=>{const o={...n,hovering:!1};return this.options.hover(r,o)||!1}),mouseover:this.createMouseEventHandler((r,n)=>{const o={...n,hovering:!0};return this.options.hover(r,o)||!1}),contextmenu:this.createMouseEventHandler((r,n)=>this.options.contextmenu(r,n)||!1),scroll:(r,n)=>this.options.scroll(n)||!1,copy:(r,n)=>this.options.copy(n)||!1,cut:(r,n)=>this.options.cut(n)||!1,paste:(r,n)=>this.options.paste(n)||!1}},view:r=>{let n=r.editable;const o=this.options;return{update(i){const s=i.editable;s!==n&&(o.editable(s),n=s)}}}}}isInteracting(){return this.mousedown&&this.mouseover}startMouseover(){this.mouseover=!0,!this.mousedown&&(this.mousedown=!0,this.store.document.documentElement.addEventListener("mouseup",()=>{this.endMouseover()},{once:!0}))}endMouseover(){this.mousedown&&(this.mousedown=!1,this.store.commands.emptyUpdate())}};gT([He()],ah.prototype,"isInteracting",1);ah=gT([pe({handlerKeys:["blur","focus","mousedown","mouseup","mouseenter","mouseleave","textInput","keypress","keyup","keydown","click","clickMark","doubleClick","doubleClickMark","tripleClick","tripleClickMark","contextmenu","hover","scroll","copy","cut","paste","editable"],handlerKeyOptions:{blur:{earlyReturnValue:!0},focus:{earlyReturnValue:!0},mousedown:{earlyReturnValue:!0},mouseleave:{earlyReturnValue:!0},mouseup:{earlyReturnValue:!0},click:{earlyReturnValue:!0},doubleClick:{earlyReturnValue:!0},tripleClick:{earlyReturnValue:!0},hover:{earlyReturnValue:!0},contextmenu:{earlyReturnValue:!0},scroll:{earlyReturnValue:!0},copy:{earlyReturnValue:!0},cut:{earlyReturnValue:!0},paste:{earlyReturnValue:!0}},defaultPriority:Ae.High})],ah);function rB(e){const{handled:t,view:r,$pos:n,state:o}=e,i={getMark:J4,markRanges:[],view:r,state:o};if(t)return i;for(const{type:s}of n.marksAcross(n)??[]){const a=_o(n,s);a&&i.markRanges.push(a)}return i.getMark=s=>{const a=ne(s)?o.schema.marks[s]:s;return te(a,{code:H.EXTENSION,message:`The mark ${s} being checked does not exist within the editor schema.`}),i.markRanges.find(l=>l.mark.type===a)},i}class gt extends be{constructor(t){super(t,t)}map(t,r){let n=t.resolve(r.map(this.head));return gt.valid(n)?new gt(n):be.near(n)}content(){return K.empty}eq(t){return t instanceof gt&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new gt(t.resolve(r.pos))}getBookmark(){return new Uy(this.anchor)}static valid(t){let r=t.parent;if(r.isTextblock||!nB(t)||!oB(t))return!1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let o=r.contentMatchAt(t.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(t,r,n=!1){e:for(;;){if(!n&>.valid(t))return t;let o=t.pos,i=null;for(let s=t.depth;;s--){let a=t.node(s);if(r>0?t.indexAfter(s)0){i=a.child(r>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;o+=r;let l=t.doc.resolve(o);if(gt.valid(l))return l}for(;;){let s=r>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!ce.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*r),n=!1;continue e}break}i=s,o+=r;let a=t.doc.resolve(o);if(gt.valid(a))return a}return null}}}gt.prototype.visible=!1;gt.findFrom=gt.findGapCursorFrom;be.jsonID("gapcursor",gt);class Uy{constructor(t){this.pos=t}map(t){return new Uy(t.map(this.pos))}resolve(t){let r=t.resolve(this.pos);return gt.valid(r)?new gt(r):be.near(r)}}function nB(e){for(let t=e.depth;t>=0;t--){let r=e.index(t),n=e.node(t);if(r==0){if(n.type.spec.isolating)return!0;continue}for(let o=n.child(r-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function oB(e){for(let t=e.depth;t>=0;t--){let r=e.indexAfter(t),n=e.node(t);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let o=n.child(r);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function iB(){return new Ro({props:{decorations:cB,createSelectionBetween(e,t,r){return t.pos==r.pos&>.valid(r)?new gt(r):null},handleClick:aB,handleKeyDown:sB,handleDOMEvents:{beforeinput:lB}}})}const sB=Jv({ArrowLeft:Sf("horiz",-1),ArrowRight:Sf("horiz",1),ArrowUp:Sf("vert",-1),ArrowDown:Sf("vert",1)});function Sf(e,t){const r=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(n,o,i){let s=n.selection,a=t>0?s.$to:s.$from,l=s.empty;if(s instanceof le){if(!i.endOfTextblock(r)||a.depth==0)return!1;l=!1,a=n.doc.resolve(t>0?a.after():a.before())}let c=gt.findGapCursorFrom(a,t,l);return c?(o&&o(n.tr.setSelection(new gt(c))),!0):!1}}function aB(e,t,r){if(!e||!e.editable)return!1;let n=e.state.doc.resolve(t);if(!gt.valid(n))return!1;let o=e.posAtCoords({left:r.clientX,top:r.clientY});return o&&o.inside>-1&&ce.isSelectable(e.state.doc.nodeAt(o.inside))?!1:(e.dispatch(e.state.tr.setSelection(new gt(n))),!0)}function lB(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof gt))return!1;let{$from:r}=e.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(e.state.schema.nodes.text);if(!n)return!1;let o=R.empty;for(let s=n.length-1;s>=0;s--)o=R.from(n[s].createAndFill(null,o));let i=e.state.tr.replace(r.pos,r.pos,new K(o,0,0));return i.setSelection(le.near(i.doc.resolve(r.pos+1))),e.dispatch(i),!1}function cB(e){if(!(e.selection instanceof gt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Ee.create(e.doc,[Ge.widget(e.selection.head,t,{key:"gapcursor"})])}var uB=Object.defineProperty,dB=Object.getOwnPropertyDescriptor,fB=(e,t,r,n)=>{for(var o=n>1?void 0:n?dB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&uB(t,r,o),o},U0=class extends Ve{get name(){return"gapCursor"}createExternalPlugins(){return[iB()]}};U0=fB([pe({})],U0);var lh=200,Bt=function(){};Bt.prototype.append=function(t){return t.length?(t=Bt.from(t),!this.length&&t||t.length=r?Bt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,r))};Bt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Bt.prototype.forEach=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(t,r,n,0):this.forEachInvertedInner(t,r,n,0)};Bt.prototype.map=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},r,n),o};Bt.from=function(t){return t instanceof Bt?t:t&&t.length?new vT(t):Bt.empty};var vT=function(e){function t(n){e.call(this),this.values=n}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new t(this.values.slice(o,i))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,i,s,a){for(var l=i;l=s;l--)if(o(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=lh)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=lh)return new t(o.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(t.prototype,r),t}(Bt);Bt.empty=new vT([]);var pB=function(e){function t(r,n){e.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(n){return na&&this.right.forEachInner(n,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(n,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(n,o-a,Math.max(i,a)-a,s+a)===!1||i=i?this.right.slice(n-i,o-i):this.left.slice(n,i).append(this.right.slice(0,o-i))},t.prototype.leafAppend=function(n){var o=this.right.leafAppend(n);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(n){var o=this.left.leafPrepend(n);if(o)return new t(o,this.right)},t.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new t(this.left,new t(this.right,n)):new t(this,n)},t}(Bt);const hB=500;class Zn{constructor(t,r){this.items=t,this.eventCount=r}popEvent(t,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let o,i;r&&(o=this.remapping(n,this.items.length),i=o.maps.length);let s=t.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(n,f+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new mo(d.map));let p=d.step.map(o.slice(i)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new mo(h,void 0,void 0,c.length+u.length))),i--,h&&o.appendMap(h,i)}else s.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(i)):d.selection,l=new Zn(this.items.slice(0,n).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(t,r,n,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;ugB&&(a=mB(a,c),s-=c),new Zn(a.append(i),s)}remapping(t,r){let n=new ul;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=t?n.maps.length-o.mirrorOffset:void 0;n.appendMap(o.map,s)},t,r),n}addMaps(t){return this.eventCount==0?this:new Zn(this.items.append(t.map(r=>new mo(r))),this.eventCount)}rebased(t,r){if(!this.eventCount)return this;let n=[],o=Math.max(0,this.items.length-r),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},o);let l=r;this.items.forEach(f=>{let p=i.getMirror(--l);if(p==null)return;s=Math.min(s,p);let h=i.maps[p];if(f.step){let m=t.steps[p].invert(t.docs[p]),b=f.selection&&f.selection.map(i.slice(l+1,p));b&&a++,n.push(new mo(h,m,b))}else n.push(new mo(h))},o);let c=[];for(let f=r;fhB&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let t=0;return this.items.forEach(r=>{r.step||t++}),t}compress(t=this.items.length){let r=this.remapping(0,t),n=r.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=t)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(r.slice(n)),c=l&&l.getMap();if(n--,c&&r.appendMap(c,n),l){let u=s.selection&&s.selection.map(r.slice(n));u&&i++;let d=new mo(c.invert(),l,u),f,p=o.length-1;(f=o.length&&o[p].merge(d))?o[p]=f:o.push(d)}}else s.map&&n--},this.items.length,0),new Zn(Bt.from(o.reverse()),i)}}Zn.empty=new Zn(Bt.empty,0);function mB(e,t){let r;return e.forEach((n,o)=>{if(n.selection&&t--==0)return r=o,!1}),e.slice(r)}class mo{constructor(t,r,n,o){this.map=t,this.step=r,this.selection=n,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let r=t.step.merge(this.step);if(r)return new mo(r.getMap().invert(),r,this.selection)}}}class Ai{constructor(t,r,n,o,i){this.done=t,this.undone=r,this.prevRanges=n,this.prevTime=o,this.prevComposition=i}}const gB=20;function vB(e,t,r,n){let o=r.getMeta(So),i;if(o)return o.historyState;r.getMeta(bB)&&(e=new Ai(e.done,e.undone,null,0,-1));let s=r.getMeta("appendedTransaction");if(r.steps.length==0)return e;if(s&&s.getMeta(So))return s.getMeta(So).redo?new Ai(e.done.addTransform(r,void 0,n,op(t)),e.undone,Ow(r.mapping.maps[r.steps.length-1]),e.prevTime,e.prevComposition):new Ai(e.done,e.undone.addTransform(r,void 0,n,op(t)),null,e.prevTime,e.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=r.getMeta("composition"),l=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(r.time||0)-n.newGroupDelay||!yB(r,e.prevRanges)),c=s?Jg(e.prevRanges,r.mapping):Ow(r.mapping.maps[r.steps.length-1]);return new Ai(e.done.addTransform(r,l?t.selection.getBookmark():void 0,n,op(t)),Zn.empty,c,r.time,a??e.prevComposition)}else return(i=r.getMeta("rebased"))?new Ai(e.done.rebased(r,i),e.undone.rebased(r,i),Jg(e.prevRanges,r.mapping),e.prevTime,e.prevComposition):new Ai(e.done.addMaps(r.mapping.maps),e.undone.addMaps(r.mapping.maps),Jg(e.prevRanges,r.mapping),e.prevTime,e.prevComposition)}function yB(e,t){if(!t)return!1;if(!e.docChanged)return!0;let r=!1;return e.mapping.maps[0].forEach((n,o)=>{for(let i=0;i=t[i]&&(r=!0)}),r}function Ow(e){let t=[];return e.forEach((r,n,o,i)=>t.push(o,i)),t}function Jg(e,t){if(!e)return null;let r=[];for(let n=0;n{let r=So.getState(e);return!r||r.done.eventCount==0?!1:(t&&yT(r,e,t,!1),!0)},Zc=(e,t)=>{let r=So.getState(e);return!r||r.undone.eventCount==0?!1:(t&&yT(r,e,t,!0),!0)};function W0(e){let t=So.getState(e);return t?t.done.eventCount:0}function kB(e){let t=So.getState(e);return t?t.undone.eventCount:0}var wB=Object.defineProperty,SB=Object.getOwnPropertyDescriptor,Ca=(e,t,r,n)=>{for(var o=n>1?void 0:n?SB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&wB(t,r,o),o},Ao=class extends Ve{constructor(){super(...arguments),this.wrapMethod=(e,t)=>({state:r,dispatch:n,view:o})=>{const{getState:i,getDispatch:s}=this.options,a=_e(i)?i():r,l=_e(s)&&n?s():n,c=e(a,l,o);return t==null||t(c),c}}get name(){return"history"}createKeymap(){return{"Mod-y":on.isMac?()=>!1:this.wrapMethod(Zc,this.options.onRedo),"Mod-z":this.wrapMethod(ip,this.options.onUndo),"Shift-Mod-z":this.wrapMethod(Zc,this.options.onRedo)}}undoShortcut(e){return this.wrapMethod(ip,this.options.onUndo)(e)}redoShortcut(e){return this.wrapMethod(Zc,this.options.onRedo)(e)}createExternalPlugins(){const{depth:e,newGroupDelay:t}=this.options;return[xB({depth:e,newGroupDelay:t})]}undo(){return a2(this.wrapMethod(ip,this.options.onUndo))}redo(){return a2(this.wrapMethod(Zc,this.options.onRedo))}undoDepth(e=this.store.getState()){return W0(e)}redoDepth(e=this.store.getState()){return kB(e)}};Ca([je({shortcut:D.Undo,command:"undo"})],Ao.prototype,"undoShortcut",1);Ca([je({shortcut:D.Redo,command:"redo"})],Ao.prototype,"redoShortcut",1);Ca([U({disableChaining:!0,description:({t:e})=>e(Ep.UNDO_DESCRIPTION),label:({t:e})=>e(Ep.UNDO_LABEL),icon:"arrowGoBackFill"})],Ao.prototype,"undo",1);Ca([U({disableChaining:!0,description:({t:e})=>e(Ep.REDO_DESCRIPTION),label:({t:e})=>e(Ep.REDO_LABEL),icon:"arrowGoForwardFill"})],Ao.prototype,"redo",1);Ca([He()],Ao.prototype,"undoDepth",1);Ca([He()],Ao.prototype,"redoDepth",1);Ao=Ca([pe({defaultOptions:{depth:100,newGroupDelay:500,getDispatch:void 0,getState:void 0},staticKeys:["depth","newGroupDelay"],handlerKeys:["onUndo","onRedo"]})],Ao);var EB=Object.defineProperty,CB=Object.getOwnPropertyDescriptor,cm=(e,t,r,n)=>{for(var o=n>1?void 0:n?CB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&EB(t,r,o),o},MB={icon:"paragraph",label:({t:e})=>e(Cp.INSERT_LABEL),description:({t:e})=>e(Cp.INSERT_DESCRIPTION)},TB={icon:"paragraph",label:({t:e})=>e(Cp.CONVERT_LABEL),description:({t:e})=>e(Cp.CONVERT_DESCRIPTION)},fa=class extends er{get name(){return"paragraph"}createTags(){return[oe.LastNodeCompatible,oe.TextBlock,oe.Block,oe.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",draggable:!1,...t,attrs:{...e.defaults()},parseDOM:[{tag:"p",getAttrs:r=>({...e.parse(r)})},...t.parseDOM??[]],toDOM:r=>["p",e.dom(r),0]}}convertParagraph(e={}){const{attrs:t,selection:r,preserveAttrs:n}=e;return this.store.commands.setBlockNodeType.original(this.type,t,r,n)}insertParagraph(e,t={}){const{selection:r,attrs:n}=t;return this.store.commands.insertNode.original(this.type,{content:e,selection:r,attrs:n})}shortcut(e){return this.convertParagraph()(e)}};cm([U(TB)],fa.prototype,"convertParagraph",1);cm([U(MB)],fa.prototype,"insertParagraph",1);cm([je({shortcut:D.Paragraph,command:"convertParagraph"})],fa.prototype,"shortcut",1);fa=cm([pe({defaultPriority:Ae.Medium})],fa);function Jo(e,t,r){return Math.min(Math.max(e,r),t)}class OB extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var eu=OB;function Wy(e){if(typeof e!="string")throw new eu(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=IB.test(e)?NB(e):e;const r=RB.exec(t);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(cd(a,2),16)),parseInt(cd(s[3]||"f",2),16)/255]}const n=PB.exec(t);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const o=zB.exec(t);if(o){const s=Array.from(o).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const i=LB.exec(t);if(i){const[s,a,l,c]=Array.from(i).slice(1).map(parseFloat);if(Jo(0,100,a)!==a)throw new eu(e);if(Jo(0,100,l)!==l)throw new eu(e);return[...DB(s,a,l),Number.isNaN(c)?1:c]}throw new eu(e)}function _B(e){let t=5381,r=e.length;for(;r;)t=t*33^e.charCodeAt(--r);return(t>>>0)%2341}const Aw=e=>parseInt(e.replace(/_/g,""),36),AB="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const r=Aw(t.substring(0,3)),n=Aw(t.substring(3)).toString(16);let o="";for(let i=0;i<6-n.length;i++)o+="0";return e[r]=`${o}${n}`,e},{});function NB(e){const t=e.toLowerCase().trim(),r=AB[_B(t)];if(!r)throw new eu(e);return`#${r}`}const cd=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),RB=new RegExp(`^#${cd("([a-f0-9])",3)}([a-f0-9])?$`,"i"),PB=new RegExp(`^#${cd("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),zB=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${cd(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),LB=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,IB=/^[a-z]+$/i,Nw=e=>Math.round(e*255),DB=(e,t,r)=>{let n=r/100;if(t===0)return[n,n,n].map(Nw);const o=(e%360+360)%360/60,i=(1-Math.abs(2*n-1))*(t/100),s=i*(1-Math.abs(o%2-1));let a=0,l=0,c=0;o>=0&&o<1?(a=i,l=s):o>=1&&o<2?(a=s,l=i):o>=2&&o<3?(l=i,c=s):o>=3&&o<4?(l=s,c=i):o>=4&&o<5?(a=s,c=i):o>=5&&o<6&&(a=i,c=s);const u=n-i/2,d=a+u,f=l+u,p=c+u;return[d,f,p].map(Nw)};function $B(e){const[t,r,n,o]=Wy(e).map((d,f)=>f===3?d:d/255),i=Math.max(t,r,n),s=Math.min(t,r,n),a=(i+s)/2;if(i===s)return[0,0,a,o];const l=i-s,c=a>.5?l/(2-i-s):l/(i+s);return[60*(t===i?(r-n)/l+(r.179}function kl(e){return VB(e)?"#000":"#fff"}const jB="remirror-editor-wrapper",UB="remirror-button-active",WB="remirror-button",KB="remirror-composite",qB="remirror-dialog",GB="remirror-dialog-backdrop",YB="remirror-form",JB="remirror-form-message",XB="remirror-form-label",QB="remirror-form-group",ZB="remirror-group",eF="remirror-input",tF="remirror-menu",rF="remirror-menu-pane",nF="remirror-menu-pane-active",oF="remirror-menu-dropdown-label",iF="remirror-menu-pane-icon",sF="remirror-menu-pane-label",aF="remirror-menu-pane-shortcut",lF="remirror-menu-button-left",cF="remirror-menu-button-right",uF="remirror-menu-button-nested-left",dF="remirror-menu-button-nested-right",fF="remirror-menu-button",pF="remirror-menu-bar",hF="remirror-flex-column",mF="remirror-flex-row",gF="remirror-menu-item",vF="remirror-menu-item-row",yF="remirror-menu-item-column",bF="remirror-menu-item-checkbox",xF="remirror-menu-item-radio",kF="remirror-menu-group",wF="remirror-floating-popover",SF="remirror-popover",EF="remirror-animated-popover",CF="remirror-role",MF="remirror-separator",TF="remirror-tab",OF="remirror-tab-list",_F="remirror-tabbable",AF="remirror-toolbar",NF="remirror-tooltip",RF="remirror-table-size-editor",PF="remirror-table-size-editor-body",zF="remirror-table-size-editor-cell",LF="remirror-table-size-editor-cell-selected",IF="remirror-table-size-editor-footer",DF="remirror-color-picker",$F="remirror-color-picker-cell",HF="remirror-color-picker-cell-selected";var BF=Object.freeze({__proto__:null,ANIMATED_POPOVER:EF,BUTTON:WB,BUTTON_ACTIVE:UB,COLOR_PICKER:DF,COLOR_PICKER_CELL:$F,COLOR_PICKER_CELL_SELECTED:HF,COMPOSITE:KB,DIALOG:qB,DIALOG_BACKDROP:GB,EDITOR_WRAPPER:jB,FLEX_COLUMN:hF,FLEX_ROW:mF,FLOATING_POPOVER:wF,FORM:YB,FORM_GROUP:QB,FORM_LABEL:XB,FORM_MESSAGE:JB,GROUP:ZB,INPUT:eF,MENU:tF,MENU_BAR:pF,MENU_BUTTON:fF,MENU_BUTTON_LEFT:lF,MENU_BUTTON_NESTED_LEFT:uF,MENU_BUTTON_NESTED_RIGHT:dF,MENU_BUTTON_RIGHT:cF,MENU_DROPDOWN_LABEL:oF,MENU_GROUP:kF,MENU_ITEM:gF,MENU_ITEM_CHECKBOX:bF,MENU_ITEM_COLUMN:yF,MENU_ITEM_RADIO:xF,MENU_ITEM_ROW:vF,MENU_PANE:rF,MENU_PANE_ACTIVE:nF,MENU_PANE_ICON:iF,MENU_PANE_LABEL:sF,MENU_PANE_SHORTCUT:aF,POPOVER:SF,ROLE:CF,SEPARATOR:MF,TAB:TF,TABBABLE:_F,TABLE_SIZE_EDITOR:RF,TABLE_SIZE_EDITOR_BODY:PF,TABLE_SIZE_EDITOR_CELL:zF,TABLE_SIZE_EDITOR_CELL_SELECTED:LF,TABLE_SIZE_EDITOR_FOOTER:IF,TAB_LIST:OF,TOOLBAR:AF,TOOLTIP:NF});const FF="remirror-wrap",VF="remirror-language-select-positioner",jF="remirror-language-select-width",UF="remirror-a11y-dark",WF="remirror-atom-dark",KF="remirror-base16-ateliersulphurpool-light",qF="remirror-cb",GF="remirror-darcula",YF="remirror-dracula",JF="remirror-duotone-dark",XF="remirror-duotone-earth",QF="remirror-duotone-forest",ZF="remirror-duotone-light",eV="remirror-duotone-sea",tV="remirror-duotone-space",rV="remirror-gh-colors",nV="remirror-hopscotch",oV="remirror-pojoaque",iV="remirror-vs",sV="remirror-xonokai";var aV=Object.freeze({__proto__:null,A11Y_DARK:UF,ATOM_DARK:WF,BASE16_ATELIERSULPHURPOOL_LIGHT:KF,CB:qF,DARCULA:GF,DRACULA:YF,DUOTONE_DARK:JF,DUOTONE_EARTH:XF,DUOTONE_FOREST:QF,DUOTONE_LIGHT:ZF,DUOTONE_SEA:eV,DUOTONE_SPACE:tV,GH_COLORS:rV,HOPSCOTCH:nV,LANGUAGE_SELECT_POSITIONER:VF,LANGUAGE_SELECT_WIDTH:jF,POJOAQUE:oV,VS:iV,WRAP:FF,XONOKAI:sV});const lV="remirror-image-loader";var cV=Object.freeze({__proto__:null,IMAGE_LOADER:lV});const uV="remirror-list-item-with-custom-mark",dV="remirror-ul-list-content",fV="remirror-editor",pV="remirror-list-item-marker-container",hV="remirror-list-item-checkbox",mV="remirror-collapsible-list-item-closed",gV="remirror-collapsible-list-item-button",vV="remirror-list-spine";var ls=Object.freeze({__proto__:null,COLLAPSIBLE_LIST_ITEM_BUTTON:gV,COLLAPSIBLE_LIST_ITEM_CLOSED:mV,EDITOR:fV,LIST_ITEM_CHECKBOX:hV,LIST_ITEM_MARKER_CONTAINER:pV,LIST_ITEM_WITH_CUSTOM_MARKER:uV,LIST_SPINE:vV,UL_LIST_CONTENT:dV});const yV="remirror-is-empty";var bV=Object.freeze({__proto__:null,IS_EMPTY:yV});const xV="remirror-editor",kV="remirror-positioner",wV="remirror-positioner-widget";var SV=Object.freeze({__proto__:null,EDITOR:xV,POSITIONER:kV,POSITIONER_WIDGET:wV});const EV="remirror-theme";function CV(e={}){const t=[],r={};function n(o,i){if(typeof i=="string"||typeof i=="number"){t.push(`${Rw(o)}: ${i};`),r[Rw(o)]=i;return}if(!(typeof i!="object"||!i))for(const[s,a]of Object.entries(i))n([...o,s],a)}for(const[o,i]of Object.entries(e))n([o],i);return{css:t.join(` +`),styles:r}}function MV(e){return e.replace(/([a-z])([\dA-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function Rw(e){return`--rmr-${e.map(MV).join("-")}`}const qn={gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},Xo="#000000",Ky="#ffffff",TV="#252103",qy=ch(Xo,.75),um="#7963d2",Gy="#bcd263",OV="#fff",_V="#fff",Yy=qn.gray[1],Pw="rgba(10,31,68,0.08)",zw="rgba(10,31,68,0.10)",Lw="rgba(10,31,68,0.12)",AV=sp(ch(Xo,.1),.13),Jy={background:Ky,border:qy,foreground:Xo,muted:Yy,primary:um,secondary:Gy,primaryText:OV,secondaryText:_V,text:TV,faded:AV},NV={...Jy,background:rn(Ky,.15),border:rn(qy,.15),foreground:rn(Xo,.15),muted:rn(Yy,.15),primary:rn(um,.15),secondary:rn(Gy,.15),get text(){return kl(this.background)},get primaryText(){return kl(this.primary)},get secondaryText(){return kl(this.secondary)}},RV={...Jy,background:rn(Ky,.075),border:rn(qy,.075),foreground:rn(Xo,.075),muted:rn(Yy,.075),primary:rn(um,.075),secondary:rn(Gy,.075),get text(){return kl(this.background)},get primaryText(){return kl(this.primary)},get secondaryText(){return kl(this.secondary)}},Ss={color:{...Jy,active:NV,hover:RV,shadow1:Pw,shadow2:zw,shadow3:Lw,backdrop:ch(Xo,.1),outline:ch(um,.6),table:{default:{border:sp(Xo,.8),cell:sp(Xo,.4),controller:qn.gray[3]},selected:{border:qn.blue[7],cell:qn.blue[1],controller:qn.blue[5]},preselect:{border:qn.blue[7],cell:sp(Xo,.4),controller:qn.blue[5]},predelete:{border:qn.red[7],cell:qn.red[1],controller:qn.red[5]},mark:"#91919196"}},hue:qn,radius:{border:"0.25rem",extra:"0.5rem",circle:"50%"},fontFamily:{default:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif',heading:"inherit",mono:"Menlo, monospace"},fontSize:{0:"12px",1:"14px",2:"16px",3:"20px",4:"24px",5:"32px",6:"48px",7:"64px",8:"96px",default:"16px"},space:{1:"4px",2:"8px",3:"16px",4:"32px",5:"64px",6:"128px",7:"256px",8:"512px"},fontWeight:{bold:"700",default:"400",heading:"700"},letterSpacing:{tight:"-1px",default:"normal",loose:"1px",wide:"3px"},lineHeight:{heading:"1.25em",default:"1.5em"},boxShadow:{1:`0 1px 1px ${Pw}`,2:`0 1px 1px ${zw}`,3:`0 1px 1px ${Lw}`}};var PV=Object.defineProperty,zV=Object.getOwnPropertyDescriptor,Xy=(e,t,r,n)=>{for(var o=n>1?void 0:n?zV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&PV(t,r,o),o},bT=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Tt=(e,t,r)=>(bT(e,t,"read from private field"),r?r.call(e):t.get(e)),Do=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},yi=(e,t,r,n)=>(bT(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),tu,ru,qa,nu,ap,ou,iu,su,au,lp=class{constructor(e){Do(this,tu,jh()),Do(this,ru,[]),Do(this,qa,new Map),Do(this,nu,[]),Do(this,ap,!1),Do(this,ou,void 0),Do(this,iu,void 0),Do(this,su,void 0),Do(this,au,void 0),this.addListener=(t,r)=>Tt(this,tu).on(t,r),yi(this,ou,e),yi(this,iu,e.getActive),yi(this,au,e.getPosition),yi(this,su,e.getID),this.hasChanged=e.hasChanged,this.events=e.events??["state","scroll"]}static create(e){return new lp(e)}static fromPositioner(e,t){return lp.create({...e.basePositioner,...t})}get basePositioner(){return{getActive:Tt(this,iu),getPosition:Tt(this,au),hasChanged:this.hasChanged,events:this.events,getID:Tt(this,su)}}onActiveChanged(e){this.recentUpdate=e;const t=Tt(this,iu).call(this,e);yi(this,ru,t),yi(this,qa,new Map),yi(this,ap,!1),yi(this,nu,[]);const r=[];for(const[n,o]of t.entries()){const i=this.getID(o,n);Tt(this,nu).push(i),r.push({setElement:s=>this.addProps({...e,data:o,element:s},n),id:i,data:o})}Tt(this,tu).emit("update",r)}getID(e,t){var r;return((r=Tt(this,su))==null?void 0:r.call(this,e,t))??t.toString()}addProps(e,t){if(Tt(this,ap)||(Tt(this,qa).set(t,e),Tt(this,qa).sizee;return this.clone(r=>({getActive:n=>r.getActive(n).filter(t)}))}},no=lp;tu=new WeakMap;ru=new WeakMap;qa=new WeakMap;nu=new WeakMap;ap=new WeakMap;ou=new WeakMap;iu=new WeakMap;su=new WeakMap;au=new WeakMap;no.EMPTY=[];function LV(e,t=ST){const{key:r}=(e==null?void 0:e.getMeta(wT))??{};return r===t}function xT(e){const{tr:t,state:r,previousState:n}=e;return!n||t&&LV(t)?!0:t?iz(t):!r.doc.eq(n.doc)||!r.selection.eq(n.selection)}function kT(e,t,r={}){const n=t.getBoundingClientRect(),{accountForPadding:o=!1}=r;let i=0,s=0,a=0,l=0;if(Je(t)&&o){const u=Number.parseFloat(kn(t,"padding-left").replace("px","")),d=Number.parseFloat(kn(t,"padding-right").replace("px","")),f=Number.parseFloat(kn(t,"padding-top").replace("px","")),p=Number.parseFloat(kn(t,"padding-bottom").replace("px","")),h=Number.parseFloat(kn(t,"border-left").replace("px","")),m=Number.parseFloat(kn(t,"border-right").replace("px","")),b=Number.parseFloat(kn(t,"border-top").replace("px","")),v=Number.parseFloat(kn(t,"border-bottom").replace("px","")),g=t.offsetWidth-t.clientWidth,y=t.offsetHeight-t.clientHeight;i+=u+h+(t.dir==="rtl"?g:0),s+=d+m+(t.dir==="rtl"?0:g),a+=f+b,l+=p+v+y}const c=new DOMRect(n.left+i,n.top+a,n.width-s,n.height-l);for(const[u,d]of[[e.top,e.left],[e.top,e.right],[e.bottom,e.left],[e.bottom,e.right]])if(Zx(u,c.top,c.bottom)&&Zx(d,c.left,c.right))return!0;return!1}var IV="remirror-positioner-widget",wT="positionerUpdate",ST="__all_positioners__",ET={y:-999999,x:-999999,width:0,height:0},Iw={...ET,left:-999999,top:-999999,bottom:-999999,right:-999999},Qy={...ET,rect:{...Iw,toJSON:()=>Iw},visible:!1},CT=no.create({hasChanged:xT,getActive(e){const{state:t}=e;if(!jv(t)||t.selection.$anchor.depth>2)return no.EMPTY;const r=Ld({predicate:n=>n.type.isBlock,selection:t});return r?[r]:no.EMPTY},getPosition(e){const{view:t,data:r}=e,n=t.nodeDOM(r.pos);if(!Je(n))return Qy;const o=n.getBoundingClientRect(),i=t.dom.getBoundingClientRect(),s=o.height,a=o.width,l=t.dom.scrollLeft+o.left-i.left,c=t.dom.scrollTop+o.top-i.top,u=kT(o,t.dom);return{y:c,x:l,height:s,width:a,rect:o,visible:u}}}),Zy=CT.clone(({getActive:e})=>({getActive:t=>{const[r]=e(t);return r&&Bh(r.node)&&r.node.type===Hh(t.state.schema)?[r]:no.EMPTY}})),DV=Zy.clone(({getPosition:e})=>({getPosition:t=>({...e(t),width:1})})),$V=Zy.clone(({getPosition:e})=>({getPosition:t=>{const{width:r,x:n,y:o,height:i}=e(t);return{...e(t),width:1,x:r+n,rect:new DOMRect(r+n,o,1,i)}}}));function eb(e){return no.create({hasChanged:xT,getActive:t=>{const{state:r,view:n}=t;if(!e(r)||!gs(r.selection))return no.EMPTY;try{const{head:o,anchor:i}=r.selection;return[{from:n.coordsAtPos(i),to:n.coordsAtPos(o)}]}catch{return no.EMPTY}},getPosition(t){const{element:r,data:n,view:o}=t,{from:i,to:s}=n,a=r.offsetParent??o.dom,l=a.getBoundingClientRect(),c=Math.abs(s.bottom-i.top),u=c>i.bottom-i.top,d=Math.min(i.left,s.left),f=Math.min(i.top,s.top),p=a.scrollLeft+(u?s.left-l.left:d-l.left),h=a.scrollTop+f-l.top,m=u?1:Math.abs(i.left-s.right),b=new DOMRect(u?s.left:d,f,m,c),v=kT(b,o.dom);return{rect:b,y:h,x:p,height:c,width:m,visible:v}}})}var MT=eb(e=>!e.selection.empty),HV=eb(e=>e.selection.empty),BV=eb(()=>!0),FV=MT.clone(()=>({getActive:e=>{const{state:t,view:r}=e;if(!t.selection.empty)return no.EMPTY;const n=_C(t);if(!n)return no.EMPTY;try{return[{from:r.coordsAtPos(n.from),to:r.coordsAtPos(n.to)}]}catch{return no.EMPTY}}})),VV={selection:MT,cursor:HV,always:BV,block:CT,emptyBlock:Zy,emptyBlockStart:DV,emptyBlockEnd:$V,nearestWord:FV},Ul=class extends Ve{constructor(){super(...arguments),this.positioners=[],this.onAddCustomHandler=({positioner:e})=>{if(e)return this.positioners=[...this.positioners,e],this.store.commands.forceUpdate(),()=>{this.positioners=this.positioners.filter(t=>t!==e)}}}get name(){return"positioner"}createAttributes(){return{class:SV.EDITOR}}init(){this.onScroll=j4(this.options.scrollDebounce,this.onScroll.bind(this))}createEventHandlers(){return{scroll:()=>(this.onScroll(),!1),hover:(e,t)=>(this.positioner(this.getBaseProps("hover",{hover:t})),!1),contextmenu:(e,t)=>(this.positioner(this.getBaseProps("contextmenu",{contextmenu:t})),!1)}}onStateUpdate(e){this.positioner({...e,previousState:e.firstUpdate?void 0:e.previousState,event:"state",helpers:this.store.helpers})}createDecorations(e){if(this.element??(this.element=this.createElement()),!this.element.hasChildNodes())return Ee.empty;const t=Ge.widget(0,this.element,{key:"positioner-widget",side:-1,stopEvent:()=>!0});return Ee.create(e.doc,[t])}forceUpdatePositioners(e=ST){return({tr:t,dispatch:r})=>(r==null||r(t.setMeta(wT,{key:e})),!0)}getPositionerWidget(){return this.element??(this.element=this.createElement())}createElement(){const e=document.createElement("span");return e.dataset.id=IV,e.setAttribute("role","presentation"),e}triggerPositioner(e,t){e.hasChanged(t)&&e.onActiveChanged({...t,view:this.store.view})}positioner(e){for(const t of this.positioners)t.events.includes(e.event)&&this.triggerPositioner(t,e)}getBaseProps(e,t){const r=this.store.getState(),n=this.store.previousState;return{helpers:this.store.helpers,event:e,firstUpdate:!1,previousState:n,state:r,...t}}onScroll(){this.positioner(this.getBaseProps("scroll",{scroll:{scrollTop:this.store.view.dom.scrollTop}}))}};Xy([U()],Ul.prototype,"forceUpdatePositioners",1);Xy([He()],Ul.prototype,"getPositionerWidget",1);Ul=Xy([pe({defaultOptions:{scrollDebounce:100},customHandlerKeys:["positioner"],staticKeys:["scrollDebounce"]})],Ul);function K0(e){return ne(e)?VV[e].clone():_e(e)?e().clone():e.clone()}var jV=Object.defineProperty,UV=Object.getOwnPropertyDescriptor,WV=(e,t,r,n)=>{for(var o=n>1?void 0:n?UV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&jV(t,r,o),o},q0=class extends er{get name(){return"text"}createTags(){return[oe.InlineNode]}createNodeSpec(){return{}}};q0=WV([pe({disableExtraAttributes:!0,defaultPriority:Ae.Medium})],q0);var KV={...jl.defaultOptions,...fa.defaultOptions,...Ao.defaultOptions,excludeExtensions:[]};function qV(e={}){e={...KV,...e};const{content:t,depth:r,getDispatch:n,getState:o,newGroupDelay:i,excludeExtensions:s}=e,a={};for(const c of s??[])a[c]=!0;const l=[];if(!a.history){const c=new Ao({depth:r,getDispatch:n,getState:o,newGroupDelay:i});l.push(c)}return a.doc||l.push(new jl({content:t})),a.text||l.push(new q0),a.paragraph||l.push(new fa),a.positioner||l.push(new Ul),a.gapCursor||l.push(new U0),a.events||l.push(new ah),l}var GV=Object.defineProperty,YV=Object.getOwnPropertyDescriptor,JV=(e,t,r,n)=>{for(var o=n>1?void 0:n?YV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&GV(t,r,o),o},pa=class extends Ve{get name(){return"placeholder"}createAttributes(){return{"aria-placeholder":this.options.placeholder}}createPlugin(){return{state:{init:(e,t)=>({...this.options,empty:Kv(t.doc,{ignoreAttributes:!0})}),apply:(e,t,r,n)=>XV({pluginState:t,tr:e,extension:this,state:n})},props:{decorations:e=>QV({state:e,extension:this})}}}onSetOptions(e){const{changes:t}=e;t.placeholder.changed&&this.store.phase>=Nr.EditorView&&this.store.updateAttributes()}};pa=JV([pe({defaultOptions:{emptyNodeClass:bV.IS_EMPTY,placeholder:""}})],pa);function XV(e){const{pluginState:t,extension:r,tr:n,state:o}=e;return n.docChanged?{...r.options,empty:Kv(o.doc)}:t}function QV(e){const{extension:t,state:r}=e,{empty:n}=t.pluginKey.getState(r),{emptyNodeClass:o,placeholder:i}=t.options;if(!n)return null;const s=[];return r.doc.descendants((a,l)=>{const c=Ge.node(l,l+a.nodeSize,{class:o,"data-placeholder":i});s.push(c)}),Ee.create(r.doc,s)}var ZV=Object.defineProperty,ej=Object.getOwnPropertyDescriptor,tj=(e,t,r,n)=>{for(var o=n>1?void 0:n?ej(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ZV(t,r,o),o},rj={...pa.defaultOptions,...ad.defaultOptions},nj=[...pa.staticKeys,...ad.staticKeys],ud=class extends Ve{get name(){return"react"}onSetOptions(e){const{pickChanged:t}=e;this.getExtension(pa).setOptions(t(["placeholder"]))}createExtensions(){const{emptyNodeClass:e,placeholder:t,defaultBlockNode:r,defaultContentNode:n,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s}=this.options;return[new pa({emptyNodeClass:e,placeholder:t,priority:Ae.Low}),new ad({defaultBlockNode:r,defaultContentNode:n,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s})]}};ud=tj([pe({defaultOptions:rj,staticKeys:nj})],ud);var TT={};Object.defineProperty(TT,"__esModule",{value:!0});function oj(){for(var e=[],t=0;t{if(!t.has(e))throw TypeError("Cannot "+r)},Qg=(e,t,r)=>(OT(e,t,"read from private field"),r?r.call(e):t.get(e)),ij=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},sj=(e,t,r,n)=>(OT(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function aj(){const[,e]=S.useState(ee());return S.useCallback(()=>{e(ee())},[])}var _T=S.createContext(null);function di(e){const t=S.useContext(_T),r=S.useRef(aj());te(t,{code:H.REACT_PROVIDER_CONTEXT});const{addHandler:n}=t;return S.useEffect(()=>{let o=e;if(o){if(hs(o)){const{autoUpdate:i}=o;o=i?()=>r.current():void 0}if(_e(o))return n("updated",o)}},[n,e]),t}function qr(e=!0){return di({autoUpdate:e}).active}function lj(e=!1){return di(e?{autoUpdate:!0}:void 0).attrs}function cc(){return di().chain.new()}function tr(){return di().commands}function tb(){return di({autoUpdate:!0}).getState().selection}function Wd(e,t=void 0,r){const{getExtension:n}=di(),o=S.useMemo(()=>n(e),[e,n]);let i;if(_e(t)?i=r?[o,...r]:[o,t]:i=t?[o,...Object.values(t)]:[],S.useEffect(()=>{_e(t)||!t||o.setOptions(t)},i),S.useEffect(()=>{if(_e(t))return t({addHandler:o.addHandler.bind(o),addCustomHandler:o.addCustomHandler.bind(o),extension:o})},i),!t)return o}function cj(e,t,r){const n=S.useCallback(({addHandler:o})=>o(t,r),[r,t]);return Wd(e,n)}function dm(e=!1){return di(e?{autoUpdate:!0}:void 0).helpers}var[uj,dj]=L9(({props:e})=>{const t=e.locale??"en",r=e.i18n??lm,n=e.supportedLocales??[t],o=r._.bind(r);return{locale:t,i18n:r,supportedLocales:n,t:o}});function Bw(e,t={}){const{core:r,react:n,...o}=t;return gI(e)?e:mI.create(()=>[...eE(e),new ud(n),...qV(r)],o)}function fj(e,t={}){const r=S.useRef(e),n=S.useRef(t),[o,i]=S.useState(()=>Bw(e,t));return r.current=e,n.current=t,S.useEffect(()=>o.addHandler("destroy",()=>{i(()=>Bw(r.current,n.current))}),[o]),o}var pj=typeof xr=="object"&&xr.__esModule&&xr.default?xr.default:xr,Ga,hj=class extends uI{constructor(e){if(super(e),ij(this,Ga,void 0),this.rootPropsConfig={called:!1,count:0},this.getRootProps=t=>this.internalGetRootProps(t,null),this.internalGetRootProps=(t,r)=>{this.rootPropsConfig.called=!0;const{refKey:n="ref",ref:o,...i}=t??ee();return{[n]:pj(o,this.onRef),key:this.uid,...i,children:r}},this.onRef=t=>{t&&(this.rootPropsConfig.count+=1,te(this.rootPropsConfig.count<=1,{code:H.REACT_GET_ROOT_PROPS,message:`Called ${this.rootPropsConfig.count} times`}),sj(this,Ga,t),this.onRefLoad())},this.manager.view){this.manager.view.setProps({state:this.manager.view.state,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0});return}this.manager.getExtension(pa).setOptions({placeholder:this.props.placeholder??""})}get name(){return"react"}update(e){return super.update(e),this}createView(e){return new b6(null,{state:e,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0,plugins:[]})}updateState({state:e,...t}){const{triggerChange:r=!0,tr:n,transactions:o}=t;if(this.props.state){const{onChange:i}=this.props;te(i,{code:H.REACT_CONTROLLED,message:"You are required to provide the `onChange` handler when creating a controlled editor."}),te(r,{code:H.REACT_CONTROLLED,message:"Controlled editors do not support `clearContent` or `setContent` where `triggerChange` is `true`. Update the `state` prop instead."}),this.previousStateOverride||(this.previousStateOverride=this.getState()),this.onChange({state:e,tr:n,transactions:o});return}!n&&!o&&(e=e.apply(e.tr.setMeta(Gx,{}))),this.view.updateState(e),r&&(o==null?void 0:o.length)!==0&&this.onChange({state:e,tr:n,transactions:o}),this.manager.onStateUpdate({previousState:this.previousState,state:e,tr:n,transactions:o})}updateControlledState(e,t){this.previousStateOverride=t,e=e.apply(e.tr.setMeta(Gx,{})),this.view.updateState(e),this.manager.onStateUpdate({previousState:this.previousState,state:e}),this.previousStateOverride=void 0}addProsemirrorViewToDom(e,t){this.props.insertPosition==="start"?e.insertBefore(t,e.firstChild):e.append(t)}onRefLoad(){te(Qg(this,Ga),{code:H.REACT_EDITOR_VIEW,message:"Something went wrong when initializing the text editor. Please check your setup."});const{autoFocus:e}=this.props;this.addProsemirrorViewToDom(Qg(this,Ga),this.view.dom),e&&this.focus(e),this.onChange(),this.addFocusListeners()}onUpdate(){this.view&&Qg(this,Ga)&&this.view.setProps({...this.view.props,editable:()=>this.props.editable??!0})}get frameworkOutput(){return{...this.baseOutput,getRootProps:this.getRootProps,portalContainer:this.manager.store.portalContainer}}resetRender(){this.rootPropsConfig.called=!1,this.rootPropsConfig.count=0}};Ga=new WeakMap;var AT=typeof document<"u"?S.useLayoutEffect:S.useEffect;function mj(e){const t=S.useRef();return AT(()=>{t.current=e}),t.current}function gj(e){const{manager:t,state:r}=e,{placeholder:n,editable:o}=e;S.useRef(!0).current&&!Zi(n)&&t.getExtension(ud).setOptions({placeholder:n}),S.useEffect(()=>{n!=null&&t.getExtension(ud).setOptions({placeholder:n})},[n,t]);const[s]=S.useState(()=>{if(r)return r;const l=t.createEmptyDoc(),[c,u]=ct(e.initialContent)?e.initialContent:[e.initialContent??l];return t.createState({content:c,selection:u})}),a=vj({initialEditorState:s,getProps:()=>e});return S.useEffect(()=>()=>{a.destroy()},[a]),S.useEffect(()=>{a.onUpdate()},[o,a]),yj(a),a.frameworkOutput}function vj(e){const t=S.useRef(e);t.current=e;const r=S.useMemo(()=>new hj(t.current),[]);return r.update(e),r}function yj(e){const{state:t}=e.props,r=S.useRef(!!t),n=mj(t);AT(()=>{const o=t?r.current===!0:r.current===!1;te(o,{code:H.REACT_CONTROLLED,message:r.current?"You have attempted to switch from a controlled to an uncontrolled editor. Once you set up an editor as a controlled editor it must always provide a `state` prop.":"You have provided a `state` prop to an uncontrolled editor. In order to set up your editor as controlled you must provide the `state` prop from the very first render."}),!(!t||t===n)&&e.updateControlledState(t,n??void 0)},[t,n,e])}function bj(e={}){const{content:t,document:r,selection:n,extensions:o,...i}=e,s=fj(o??(()=>[]),i),[a,l]=S.useState(()=>s.createState({selection:n,content:t??s.createEmptyDoc()})),c=S.useCallback(({state:d})=>{l(d)},[]),u=S.useCallback(()=>s.output,[s]);return S.useMemo(()=>({state:a,setState:l,manager:s,onChange:c,getContext:u}),[u,s,c,a])}var Fw={doc:!1,selection:!1,storedMark:!1};function xj(){const[e,t]=S.useState(Fw);return cj(zp,"applyState",S.useCallback(({tr:r})=>{const n={...Fw};r.docChanged&&(n.doc=!0),r.selectionSet&&(n.selection=!0),r.storedMarksSet&&(n.storedMark=!0),t(n)},[])),e}var G0=()=>L.createElement("div",{className:BF.EDITOR_WRAPPER,...di().getRootProps()}),kj=e=>(e.hook(),null);function wj(e){const{children:t,autoRender:r,i18n:n,locale:o,supportedLocales:i,hooks:s=[],...a}=e,l=gj(a),c=_9(l.portalContainer),u=r==="start"||r===!0||!t&&Zi(r),d=r==="end";return L.createElement(uj,{i18n:n,locale:o,supportedLocales:i},L.createElement(_T.Provider,{value:l},L.createElement(O9,{portals:c}),s.map((f,p)=>L.createElement(kj,{hook:f,key:p})),u&&L.createElement(G0,null),t,d&&L.createElement(G0,null)))}const Sj={black:"#000",white:"#fff"},dd=Sj,Ej={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},za=Ej,Cj={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},La=Cj,Mj={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Ia=Mj,Tj={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},Da=Tj,Oj={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},$a=Oj,_j={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},Tc=_j,Aj={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Nj=Aj;function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t[r]=NT(e[r])}),t}function un(e,t,r={clone:!0}){const n=r.clone?_({},e):e;return Wo(e)&&Wo(t)&&Object.keys(t).forEach(o=>{o!=="__proto__"&&(Wo(t[o])&&o in e&&Wo(e[o])?n[o]=un(e[o],t[o],r):r.clone?n[o]=Wo(t[o])?NT(t[o]):t[o]:n[o]=t[o])}),n}function Wl(e){let t="https://mui.com/production-error/?code="+e;for(let r=1;rr==null?t:function(...o){t.apply(this,o),r.apply(this,o)},()=>{})}function Tj(e,t=166){let r;function n(...o){const i=()=>{e.apply(this,o)};clearTimeout(r),r=setTimeout(i,t)}return n.clear=()=>{clearTimeout(r)},n}function Br(e){return e&&e.ownerDocument||document}function dd(e){return Br(e).defaultView||window}function K0(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const Oj=typeof window<"u"?S.useLayoutEffect:S.useEffect,ha=Oj;let Bw=0;function _j(e){const[t,r]=S.useState(e),n=e||t;return S.useEffect(()=>{t==null&&(Bw+=1,r(`mui-${Bw}`))},[t]),n}const Fw=v1["useId".toString()];function Aj(e){if(Fw!==void 0){const t=Fw();return e??t}return _j(e)}function Nj({controlled:e,default:t,name:r,state:n="value"}){const{current:o}=S.useRef(e!==void 0),[i,s]=S.useState(t),a=o?e:i,l=S.useCallback(c=>{o||s(c)},[]);return[a,l]}function Ks(e){const t=S.useRef(e);return ha(()=>{t.current=e}),S.useCallback((...r)=>(0,t.current)(...r),[])}function Ur(...e){return S.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(r=>{K0(r,t)})},e)}let bm=!0,q0=!1,Vw;const Rj={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function Pj(e){const{type:t,tagName:r}=e;return!!(r==="INPUT"&&Rj[t]&&!e.readOnly||r==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function zj(e){e.metaKey||e.altKey||e.ctrlKey||(bm=!0)}function Jg(){bm=!1}function Lj(){this.visibilityState==="hidden"&&q0&&(bm=!0)}function Ij(e){e.addEventListener("keydown",zj,!0),e.addEventListener("mousedown",Jg,!0),e.addEventListener("pointerdown",Jg,!0),e.addEventListener("touchstart",Jg,!0),e.addEventListener("visibilitychange",Lj,!0)}function Dj(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return bm||Pj(t)}function _T(){const e=S.useCallback(o=>{o!=null&&Ij(o.ownerDocument)},[]),t=S.useRef(!1);function r(){return t.current?(q0=!0,window.clearTimeout(Vw),Vw=window.setTimeout(()=>{q0=!1},100),t.current=!1,!0):!1}function n(o){return Dj(o)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:n,onBlur:r,ref:e}}function AT(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}const $j=e=>{const t=S.useRef({});return S.useEffect(()=>{t.current=e}),t.current},NT=$j;function RT(e,t){const r=_({},t);return Object.keys(e).forEach(n=>{if(n.toString().match(/^(components|slots)$/))r[n]=_({},e[n],r[n]);else if(n.toString().match(/^(componentsProps|slotProps)$/)){const o=e[n]||{},i=t[n];r[n]={},!i||!Object.keys(i)?r[n]=o:!o||!Object.keys(o)?r[n]=i:(r[n]=_({},i),Object.keys(o).forEach(s=>{r[n][s]=RT(o[s],i[s])}))}else r[n]===void 0&&(r[n]=e[n])}),r}function tr(e,t,r=void 0){const n={};return Object.keys(e).forEach(o=>{n[o]=e[o].reduce((i,s)=>{if(s){const a=t(s);a!==""&&i.push(a),r&&r[s]&&i.push(r[s])}return i},[]).join(" ")}),n}const jw=e=>e,Hj=()=>{let e=jw;return{configure(t){e=t},generate(t){return e(t)},reset(){e=jw}}},Bj=Hj(),PT=Bj,Fj={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Vt(e,t,r="Mui"){const n=Fj[t];return n?`${r}-${n}`:`${PT.generate(e)}-${t}`}function jt(e,t,r="Mui"){const n={};return t.forEach(o=>{n[o]=Vt(e,o,r)}),n}const Kl="$$material";function ve(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i=0)&&(r[o]=e[o]);return r}function zT(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Vj=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,jj=zT(function(e){return Vj.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});function Uj(e){if(e.sheet)return e.sheet;for(var t=0;t0?Gt(cc,--Wr):0,ql--,wt===10&&(ql=1,km--),wt}function un(){return wt=Wr<$T?Gt(cc,Wr++):0,ql++,wt===10&&(ql=1,km++),wt}function Eo(){return Gt(cc,Wr)}function ap(){return Wr}function Ud(e,t){return fd(cc,e,t)}function pd(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function HT(e){return km=ql=1,$T=go(cc=e),Wr=0,[]}function BT(e){return cc="",e}function lp(e){return DT(Ud(Wr-1,Y0(e===91?e+2:e===40?e+1:e)))}function rU(e){for(;(wt=Eo())&&wt<33;)un();return pd(e)>2||pd(wt)>3?"":" "}function nU(e,t){for(;--t&&un()&&!(wt<48||wt>102||wt>57&&wt<65||wt>70&&wt<97););return Ud(e,ap()+(t<6&&Eo()==32&&un()==32))}function Y0(e){for(;un();)switch(wt){case e:return Wr;case 34:case 39:e!==34&&e!==39&&Y0(wt);break;case 40:e===41&&Y0(e);break;case 92:un();break}return Wr}function oU(e,t){for(;un()&&e+wt!==47+10;)if(e+wt===42+42&&Eo()===47)break;return"/*"+Ud(t,Wr-1)+"*"+xm(e===47?e:un())}function iU(e){for(;!pd(Eo());)un();return Ud(e,Wr)}function sU(e){return BT(cp("",null,null,null,[""],e=HT(e),0,[0],e))}function cp(e,t,r,n,o,i,s,a,l){for(var c=0,u=0,d=s,f=0,p=0,h=0,m=1,b=1,v=1,g=0,y="",x=o,k=i,w=n,E=y;b;)switch(h=g,g=un()){case 40:if(h!=108&&Gt(E,d-1)==58){G0(E+=Pe(lp(g),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:E+=lp(g);break;case 9:case 10:case 13:case 32:E+=rU(h);break;case 92:E+=nU(ap()-1,7);continue;case 47:switch(Eo()){case 42:case 47:wf(aU(oU(un(),ap()),t,r),l);break;default:E+="/"}break;case 123*m:a[c++]=go(E)*v;case 125*m:case 59:case 0:switch(g){case 0:case 125:b=0;case 59+u:v==-1&&(E=Pe(E,/\f/g,"")),p>0&&go(E)-d&&wf(p>32?Ww(E+";",n,r,d-1):Ww(Pe(E," ","")+";",n,r,d-2),l);break;case 59:E+=";";default:if(wf(w=Uw(E,t,r,c,u,o,a,y,x=[],k=[],d),i),g===123)if(u===0)cp(E,t,w,w,x,i,d,a,k);else switch(f===99&&Gt(E,3)===110?100:f){case 100:case 108:case 109:case 115:cp(e,w,w,n&&wf(Uw(e,w,w,0,0,o,a,y,o,x=[],d),k),o,k,d,a,n?x:k);break;default:cp(E,w,w,w,[""],k,0,a,k)}}c=u=p=0,m=v=1,y=E="",d=s;break;case 58:d=1+go(E),p=h;default:if(m<1){if(g==123)--m;else if(g==125&&m++==0&&tU()==125)continue}switch(E+=xm(g),g*m){case 38:v=u>0?1:(E+="\f",-1);break;case 44:a[c++]=(go(E)-1)*v,v=1;break;case 64:Eo()===45&&(E+=lp(un())),f=Eo(),u=d=go(y=E+=iU(ap())),g++;break;case 45:h===45&&go(E)==2&&(m=0)}}return i}function Uw(e,t,r,n,o,i,s,a,l,c,u){for(var d=o-1,f=o===0?i:[""],p=ob(f),h=0,m=0,b=0;h0?f[v]+" "+g:Pe(g,/&\f/g,f[v])))&&(l[b++]=y);return wm(e,t,r,o===0?rb:a,l,c,u)}function aU(e,t,r){return wm(e,t,r,LT,xm(eU()),fd(e,2,-2),0)}function Ww(e,t,r,n){return wm(e,t,r,nb,fd(e,0,n),fd(e,n+1,-1),n)}function wl(e,t){for(var r="",n=ob(e),o=0;o6)switch(Gt(e,t+1)){case 109:if(Gt(e,t+4)!==45)break;case 102:return Pe(e,/(.+:)(.+)-([^]+)/,"$1"+Re+"$2-$3$1"+lh+(Gt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~G0(e,"stretch")?FT(Pe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Gt(e,t+1)!==115)break;case 6444:switch(Gt(e,go(e)-3-(~G0(e,"!important")&&10))){case 107:return Pe(e,":",":"+Re)+e;case 101:return Pe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Re+(Gt(e,14)===45?"inline-":"")+"box$3$1"+Re+"$2$3$1"+ir+"$2box$3")+e}break;case 5936:switch(Gt(e,t+11)){case 114:return Re+e+ir+Pe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Re+e+ir+Pe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Re+e+ir+Pe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Re+e+ir+e+e}return e}var gU=function(t,r,n,o){if(t.length>-1&&!t.return)switch(t.type){case nb:t.return=FT(t.value,t.length);break;case IT:return wl([Tc(t,{value:Pe(t.value,"@","@"+Re)})],o);case rb:if(t.length)return Zj(t.props,function(i){switch(Qj(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return wl([Tc(t,{props:[Pe(i,/:(read-\w+)/,":"+lh+"$1")]})],o);case"::placeholder":return wl([Tc(t,{props:[Pe(i,/:(plac\w+)/,":"+Re+"input-$1")]}),Tc(t,{props:[Pe(i,/:(plac\w+)/,":"+lh+"$1")]}),Tc(t,{props:[Pe(i,/:(plac\w+)/,ir+"input-$1")]})],o)}return""})}},vU=[gU],yU=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(m){var b=m.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var o=t.stylisPlugins||vU,i={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(m){for(var b=m.getAttribute("data-emotion").split(" "),v=1;vr==null?t:function(...o){t.apply(this,o),r.apply(this,o)},()=>{})}function zj(e,t=166){let r;function n(...o){const i=()=>{e.apply(this,o)};clearTimeout(r),r=setTimeout(i,t)}return n.clear=()=>{clearTimeout(r)},n}function Br(e){return e&&e.ownerDocument||document}function fd(e){return Br(e).defaultView||window}function Y0(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const Lj=typeof window<"u"?S.useLayoutEffect:S.useEffect,ha=Lj;let jw=0;function Ij(e){const[t,r]=S.useState(e),n=e||t;return S.useEffect(()=>{t==null&&(jw+=1,r(`mui-${jw}`))},[t]),n}const Uw=x1["useId".toString()];function Dj(e){if(Uw!==void 0){const t=Uw();return e??t}return Ij(e)}function $j({controlled:e,default:t,name:r,state:n="value"}){const{current:o}=S.useRef(e!==void 0),[i,s]=S.useState(t),a=o?e:i,l=S.useCallback(c=>{o||s(c)},[]);return[a,l]}function Ks(e){const t=S.useRef(e);return ha(()=>{t.current=e}),S.useCallback((...r)=>(0,t.current)(...r),[])}function Ur(...e){return S.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(r=>{Y0(r,t)})},e)}let wm=!0,J0=!1,Ww;const Hj={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function Bj(e){const{type:t,tagName:r}=e;return!!(r==="INPUT"&&Hj[t]&&!e.readOnly||r==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function Fj(e){e.metaKey||e.altKey||e.ctrlKey||(wm=!0)}function Zg(){wm=!1}function Vj(){this.visibilityState==="hidden"&&J0&&(wm=!0)}function jj(e){e.addEventListener("keydown",Fj,!0),e.addEventListener("mousedown",Zg,!0),e.addEventListener("pointerdown",Zg,!0),e.addEventListener("touchstart",Zg,!0),e.addEventListener("visibilitychange",Vj,!0)}function Uj(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return wm||Bj(t)}function PT(){const e=S.useCallback(o=>{o!=null&&jj(o.ownerDocument)},[]),t=S.useRef(!1);function r(){return t.current?(J0=!0,window.clearTimeout(Ww),Ww=window.setTimeout(()=>{J0=!1},100),t.current=!1,!0):!1}function n(o){return Uj(o)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:n,onBlur:r,ref:e}}function zT(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}const Wj=e=>{const t=S.useRef({});return S.useEffect(()=>{t.current=e}),t.current},LT=Wj;function IT(e,t){const r=_({},t);return Object.keys(e).forEach(n=>{if(n.toString().match(/^(components|slots)$/))r[n]=_({},e[n],r[n]);else if(n.toString().match(/^(componentsProps|slotProps)$/)){const o=e[n]||{},i=t[n];r[n]={},!i||!Object.keys(i)?r[n]=o:!o||!Object.keys(o)?r[n]=i:(r[n]=_({},i),Object.keys(o).forEach(s=>{r[n][s]=IT(o[s],i[s])}))}else r[n]===void 0&&(r[n]=e[n])}),r}function rr(e,t,r=void 0){const n={};return Object.keys(e).forEach(o=>{n[o]=e[o].reduce((i,s)=>{if(s){const a=t(s);a!==""&&i.push(a),r&&r[s]&&i.push(r[s])}return i},[]).join(" ")}),n}const Kw=e=>e,Kj=()=>{let e=Kw;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Kw}}},qj=Kj(),DT=qj,Gj={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Vt(e,t,r="Mui"){const n=Gj[t];return n?`${r}-${n}`:`${DT.generate(e)}-${t}`}function jt(e,t,r="Mui"){const n={};return t.forEach(o=>{n[o]=Vt(e,o,r)}),n}const Kl="$$material";function ve(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i=0)&&(r[o]=e[o]);return r}function $T(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Yj=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Jj=$T(function(e){return Yj.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});function Xj(e){if(e.sheet)return e.sheet;for(var t=0;t0?Gt(uc,--Wr):0,ql--,wt===10&&(ql=1,Em--),wt}function dn(){return wt=Wr2||hd(wt)>3?"":" "}function uU(e,t){for(;--t&&dn()&&!(wt<48||wt>102||wt>57&&wt<65||wt>70&&wt<97););return Kd(e,cp()+(t<6&&Eo()==32&&dn()==32))}function Q0(e){for(;dn();)switch(wt){case e:return Wr;case 34:case 39:e!==34&&e!==39&&Q0(wt);break;case 40:e===41&&Q0(e);break;case 92:dn();break}return Wr}function dU(e,t){for(;dn()&&e+wt!==47+10;)if(e+wt===42+42&&Eo()===47)break;return"/*"+Kd(t,Wr-1)+"*"+Sm(e===47?e:dn())}function fU(e){for(;!hd(Eo());)dn();return Kd(e,Wr)}function pU(e){return UT(dp("",null,null,null,[""],e=jT(e),0,[0],e))}function dp(e,t,r,n,o,i,s,a,l){for(var c=0,u=0,d=s,f=0,p=0,h=0,m=1,b=1,v=1,g=0,y="",x=o,k=i,w=n,E=y;b;)switch(h=g,g=dn()){case 40:if(h!=108&&Gt(E,d-1)==58){X0(E+=Pe(up(g),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:E+=up(g);break;case 9:case 10:case 13:case 32:E+=cU(h);break;case 92:E+=uU(cp()-1,7);continue;case 47:switch(Eo()){case 42:case 47:Ef(hU(dU(dn(),cp()),t,r),l);break;default:E+="/"}break;case 123*m:a[c++]=go(E)*v;case 125*m:case 59:case 0:switch(g){case 0:case 125:b=0;case 59+u:v==-1&&(E=Pe(E,/\f/g,"")),p>0&&go(E)-d&&Ef(p>32?Gw(E+";",n,r,d-1):Gw(Pe(E," ","")+";",n,r,d-2),l);break;case 59:E+=";";default:if(Ef(w=qw(E,t,r,c,u,o,a,y,x=[],k=[],d),i),g===123)if(u===0)dp(E,t,w,w,x,i,d,a,k);else switch(f===99&&Gt(E,3)===110?100:f){case 100:case 108:case 109:case 115:dp(e,w,w,n&&Ef(qw(e,w,w,0,0,o,a,y,o,x=[],d),k),o,k,d,a,n?x:k);break;default:dp(E,w,w,w,[""],k,0,a,k)}}c=u=p=0,m=v=1,y=E="",d=s;break;case 58:d=1+go(E),p=h;default:if(m<1){if(g==123)--m;else if(g==125&&m++==0&&lU()==125)continue}switch(E+=Sm(g),g*m){case 38:v=u>0?1:(E+="\f",-1);break;case 44:a[c++]=(go(E)-1)*v,v=1;break;case 64:Eo()===45&&(E+=up(dn())),f=Eo(),u=d=go(y=E+=fU(cp())),g++;break;case 45:h===45&&go(E)==2&&(m=0)}}return i}function qw(e,t,r,n,o,i,s,a,l,c,u){for(var d=o-1,f=o===0?i:[""],p=sb(f),h=0,m=0,b=0;h0?f[v]+" "+g:Pe(g,/&\f/g,f[v])))&&(l[b++]=y);return Cm(e,t,r,o===0?ob:a,l,c,u)}function hU(e,t,r){return Cm(e,t,r,HT,Sm(aU()),pd(e,2,-2),0)}function Gw(e,t,r,n){return Cm(e,t,r,ib,pd(e,0,n),pd(e,n+1,-1),n)}function wl(e,t){for(var r="",n=sb(e),o=0;o6)switch(Gt(e,t+1)){case 109:if(Gt(e,t+4)!==45)break;case 102:return Pe(e,/(.+:)(.+)-([^]+)/,"$1"+Re+"$2-$3$1"+uh+(Gt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~X0(e,"stretch")?WT(Pe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Gt(e,t+1)!==115)break;case 6444:switch(Gt(e,go(e)-3-(~X0(e,"!important")&&10))){case 107:return Pe(e,":",":"+Re)+e;case 101:return Pe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Re+(Gt(e,14)===45?"inline-":"")+"box$3$1"+Re+"$2$3$1"+sr+"$2box$3")+e}break;case 5936:switch(Gt(e,t+11)){case 114:return Re+e+sr+Pe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Re+e+sr+Pe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Re+e+sr+Pe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Re+e+sr+e+e}return e}var SU=function(t,r,n,o){if(t.length>-1&&!t.return)switch(t.type){case ib:t.return=WT(t.value,t.length);break;case BT:return wl([Oc(t,{value:Pe(t.value,"@","@"+Re)})],o);case ob:if(t.length)return sU(t.props,function(i){switch(iU(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return wl([Oc(t,{props:[Pe(i,/:(read-\w+)/,":"+uh+"$1")]})],o);case"::placeholder":return wl([Oc(t,{props:[Pe(i,/:(plac\w+)/,":"+Re+"input-$1")]}),Oc(t,{props:[Pe(i,/:(plac\w+)/,":"+uh+"$1")]}),Oc(t,{props:[Pe(i,/:(plac\w+)/,sr+"input-$1")]})],o)}return""})}},EU=[SU],CU=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(m){var b=m.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var o=t.stylisPlugins||EU,i={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(m){for(var b=m.getAttribute("data-emotion").split(" "),v=1;v=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var NU={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},RU=/[A-Z]|^ms/g,PU=/_EMO_([^_]+?)_([^]*?)_EMO_/g,qT=function(t){return t.charCodeAt(1)===45},qw=function(t){return t!=null&&typeof t!="boolean"},Xg=zT(function(e){return qT(e)?e:e.replace(RU,"-$&").toLowerCase()}),Gw=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(PU,function(n,o,i){return vo={name:o,styles:i,next:vo},o})}return NU[t]!==1&&!qT(t)&&typeof r=="number"&&r!==0?r+"px":r};function hd(e,t,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return vo={name:r.name,styles:r.styles,next:vo},r.name;if(r.styles!==void 0){var n=r.next;if(n!==void 0)for(;n!==void 0;)vo={name:n.name,styles:n.styles,next:vo},n=n.next;var o=r.styles+";";return o}return zU(e,t,r)}case"function":{if(e!==void 0){var i=vo,s=r(e);return vo=i,hd(e,t,s)}break}}if(t==null)return r;var a=t[r];return a!==void 0?a:r}function zU(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o96?HU:BU},Xw=function(t,r,n){var o;if(r){var i=r.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(s){return t.__emotion_forwardProp(s)&&i(s)}:i}return typeof o!="function"&&n&&(o=t.__emotion_forwardProp),o},FU=function(t){var r=t.cache,n=t.serialized,o=t.isStringTag;return KT(r,n,o),DU(function(){return _U(r,n,o)}),null},VU=function e(t,r){var n=t.__emotion_real===t,o=n&&t.__emotion_base||t,i,s;r!==void 0&&(i=r.label,s=r.target);var a=Xw(t,r,n),l=a||Jw(o),c=!l("as");return function(){var u=arguments,d=n&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&d.push("label:"+i+";"),u[0]==null||u[0].raw===void 0)d.push.apply(d,u);else{d.push(u[0][0]);for(var f=u.length,p=1;p=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var $U={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},HU=/[A-Z]|^ms/g,BU=/_EMO_([^_]+?)_([^]*?)_EMO_/g,XT=function(t){return t.charCodeAt(1)===45},Jw=function(t){return t!=null&&typeof t!="boolean"},e1=$T(function(e){return XT(e)?e:e.replace(HU,"-$&").toLowerCase()}),Xw=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(BU,function(n,o,i){return vo={name:o,styles:i,next:vo},o})}return $U[t]!==1&&!XT(t)&&typeof r=="number"&&r!==0?r+"px":r};function md(e,t,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return vo={name:r.name,styles:r.styles,next:vo},r.name;if(r.styles!==void 0){var n=r.next;if(n!==void 0)for(;n!==void 0;)vo={name:n.name,styles:n.styles,next:vo},n=n.next;var o=r.styles+";";return o}return FU(e,t,r)}case"function":{if(e!==void 0){var i=vo,s=r(e);return vo=i,md(e,t,s)}break}}if(t==null)return r;var a=t[r];return a!==void 0?a:r}function FU(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o96?KU:qU},eS=function(t,r,n){var o;if(r){var i=r.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(s){return t.__emotion_forwardProp(s)&&i(s)}:i}return typeof o!="function"&&n&&(o=t.__emotion_forwardProp),o},GU=function(t){var r=t.cache,n=t.serialized,o=t.isStringTag;return JT(r,n,o),UU(function(){return IU(r,n,o)}),null},YU=function e(t,r){var n=t.__emotion_real===t,o=n&&t.__emotion_base||t,i,s;r!==void 0&&(i=r.label,s=r.target);var a=eS(t,r,n),l=a||Zw(o),c=!l("as");return function(){var u=arguments,d=n&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&d.push("label:"+i+";"),u[0]==null||u[0].raw===void 0)d.push.apply(d,u);else{d.push(u[0][0]);for(var f=u.length,p=1;p{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))},WU=["values","unit","step"],KU=e=>{const t=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return t.sort((r,n)=>r.val-n.val),t.reduce((r,n)=>_({},r,{[n.key]:n.val}),{})};function qU(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5}=e,o=ve(e,WU),i=KU(t),s=Object.keys(i);function a(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r})`}function l(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-n/100}${r})`}function c(f,p){const h=s.indexOf(p);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r}) and (max-width:${(h!==-1&&typeof t[s[h]]=="number"?t[s[h]]:p)-n/100}${r})`}function u(f){return s.indexOf(f)+1`@media (min-width:${ub[e]}px)`};function ao(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const i=n.breakpoints||Qw;return t.reduce((s,a,l)=>(s[i.up(i.keys[l])]=r(t[l]),s),{})}if(typeof t=="object"){const i=n.breakpoints||Qw;return Object.keys(t).reduce((s,a)=>{if(Object.keys(i.values||ub).indexOf(a)!==-1){const l=i.up(a);s[l]=r(t[a],a)}else{const l=a;s[l]=t[l]}return s},{})}return r(t)}function XT(e={}){var t;return((t=e.keys)==null?void 0:t.reduce((n,o)=>{const i=e.up(o);return n[i]={},n},{}))||{}}function QT(e,t){return e.reduce((r,n)=>{const o=r[n];return(!o||Object.keys(o).length===0)&&delete r[n],r},t)}function JU(e,...t){const r=XT(e),n=[r,...t].reduce((o,i)=>cn(o,i),{});return QT(Object.keys(r),n)}function XU(e,t){if(typeof e!="object")return{};const r={},n=Object.keys(t);return Array.isArray(e)?n.forEach((o,i)=>{i{e[o]!=null&&(r[o]=!0)}),r}function Qg({values:e,breakpoints:t,base:r}){const n=r||XU(e,t),o=Object.keys(n);if(o.length===0)return e;let i;return o.reduce((s,a,l)=>(Array.isArray(e)?(s[a]=e[l]!=null?e[l]:e[i],i=l):typeof e=="object"?(s[a]=e[a]!=null?e[a]:e[i],i=a):s[a]=e,s),{})}function Pm(e,t,r=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&r){const n=`vars.${t}`.split(".").reduce((o,i)=>o&&o[i]?o[i]:null,e);if(n!=null)return n}return t.split(".").reduce((n,o)=>n&&n[o]!=null?n[o]:null,e)}function uh(e,t,r,n=r){let o;return typeof e=="function"?o=e(r):Array.isArray(e)?o=e[r]||n:o=Pm(e,r)||n,t&&(o=t(o,n,e)),o}function Ie(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:o}=e,i=s=>{if(s[t]==null)return null;const a=s[t],l=s.theme,c=Pm(l,n)||{};return ao(s,a,d=>{let f=uh(c,o,d);return d===f&&typeof d=="string"&&(f=uh(c,o,`${t}${d==="default"?"":Fe(d)}`,d)),r===!1?f:{[r]:f}})};return i.propTypes={},i.filterProps=[t],i}function QU(e){const t={};return r=>(t[r]===void 0&&(t[r]=e(r)),t[r])}const ZU={m:"margin",p:"padding"},eW={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Zw={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},tW=QU(e=>{if(e.length>2)if(Zw[e])e=Zw[e];else return[e];const[t,r]=e.split(""),n=ZU[t],o=eW[r]||"";return Array.isArray(o)?o.map(i=>n+i):[n+o]}),db=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],fb=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...db,...fb];function Wd(e,t,r,n){var o;const i=(o=Pm(e,t,!1))!=null?o:r;return typeof i=="number"?s=>typeof s=="string"?s:i*s:Array.isArray(i)?s=>typeof s=="string"?s:i[s]:typeof i=="function"?i:()=>{}}function pb(e){return Wd(e,"spacing",8)}function ma(e,t){if(typeof t=="string"||t==null)return t;const r=Math.abs(t),n=e(r);return t>=0?n:typeof n=="number"?-n:`-${n}`}function rW(e,t){return r=>e.reduce((n,o)=>(n[o]=ma(t,r),n),{})}function nW(e,t,r,n){if(t.indexOf(r)===-1)return null;const o=tW(r),i=rW(o,n),s=e[r];return ao(e,s,i)}function ZT(e,t){const r=pb(e.theme);return Object.keys(e).map(n=>nW(e,t,n,r)).reduce(Ou,{})}function pt(e){return ZT(e,db)}pt.propTypes={};pt.filterProps=db;function ht(e){return ZT(e,fb)}ht.propTypes={};ht.filterProps=fb;function oW(e=8){if(e.mui)return e;const t=pb({spacing:e}),r=(...n)=>(n.length===0?[1]:n).map(i=>{const s=t(i);return typeof s=="number"?`${s}px`:s}).join(" ");return r.mui=!0,r}function zm(...e){const t=e.reduce((n,o)=>(o.filterProps.forEach(i=>{n[i]=o}),n),{}),r=n=>Object.keys(n).reduce((o,i)=>t[i]?Ou(o,t[i](n)):o,{});return r.propTypes={},r.filterProps=e.reduce((n,o)=>n.concat(o.filterProps),[]),r}function xo(e){return typeof e!="number"?e:`${e}px solid`}const iW=Ie({prop:"border",themeKey:"borders",transform:xo}),sW=Ie({prop:"borderTop",themeKey:"borders",transform:xo}),aW=Ie({prop:"borderRight",themeKey:"borders",transform:xo}),lW=Ie({prop:"borderBottom",themeKey:"borders",transform:xo}),cW=Ie({prop:"borderLeft",themeKey:"borders",transform:xo}),uW=Ie({prop:"borderColor",themeKey:"palette"}),dW=Ie({prop:"borderTopColor",themeKey:"palette"}),fW=Ie({prop:"borderRightColor",themeKey:"palette"}),pW=Ie({prop:"borderBottomColor",themeKey:"palette"}),hW=Ie({prop:"borderLeftColor",themeKey:"palette"}),Lm=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Wd(e.theme,"shape.borderRadius",4),r=n=>({borderRadius:ma(t,n)});return ao(e,e.borderRadius,r)}return null};Lm.propTypes={};Lm.filterProps=["borderRadius"];zm(iW,sW,aW,lW,cW,uW,dW,fW,pW,hW,Lm);const Im=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Wd(e.theme,"spacing",8),r=n=>({gap:ma(t,n)});return ao(e,e.gap,r)}return null};Im.propTypes={};Im.filterProps=["gap"];const Dm=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Wd(e.theme,"spacing",8),r=n=>({columnGap:ma(t,n)});return ao(e,e.columnGap,r)}return null};Dm.propTypes={};Dm.filterProps=["columnGap"];const $m=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Wd(e.theme,"spacing",8),r=n=>({rowGap:ma(t,n)});return ao(e,e.rowGap,r)}return null};$m.propTypes={};$m.filterProps=["rowGap"];const mW=Ie({prop:"gridColumn"}),gW=Ie({prop:"gridRow"}),vW=Ie({prop:"gridAutoFlow"}),yW=Ie({prop:"gridAutoColumns"}),bW=Ie({prop:"gridAutoRows"}),xW=Ie({prop:"gridTemplateColumns"}),kW=Ie({prop:"gridTemplateRows"}),wW=Ie({prop:"gridTemplateAreas"}),SW=Ie({prop:"gridArea"});zm(Im,Dm,$m,mW,gW,vW,yW,bW,xW,kW,wW,SW);function Sl(e,t){return t==="grey"?t:e}const EW=Ie({prop:"color",themeKey:"palette",transform:Sl}),CW=Ie({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Sl}),MW=Ie({prop:"backgroundColor",themeKey:"palette",transform:Sl});zm(EW,CW,MW);function on(e){return e<=1&&e!==0?`${e*100}%`:e}const TW=Ie({prop:"width",transform:on}),hb=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=r=>{var n,o;const i=((n=e.theme)==null||(n=n.breakpoints)==null||(n=n.values)==null?void 0:n[r])||ub[r];return i?((o=e.theme)==null||(o=o.breakpoints)==null?void 0:o.unit)!=="px"?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:on(r)}};return ao(e,e.maxWidth,t)}return null};hb.filterProps=["maxWidth"];const OW=Ie({prop:"minWidth",transform:on}),_W=Ie({prop:"height",transform:on}),AW=Ie({prop:"maxHeight",transform:on}),NW=Ie({prop:"minHeight",transform:on});Ie({prop:"size",cssProperty:"width",transform:on});Ie({prop:"size",cssProperty:"height",transform:on});const RW=Ie({prop:"boxSizing"});zm(TW,hb,OW,_W,AW,NW,RW);const PW={border:{themeKey:"borders",transform:xo},borderTop:{themeKey:"borders",transform:xo},borderRight:{themeKey:"borders",transform:xo},borderBottom:{themeKey:"borders",transform:xo},borderLeft:{themeKey:"borders",transform:xo},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Lm},color:{themeKey:"palette",transform:Sl},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Sl},backgroundColor:{themeKey:"palette",transform:Sl},p:{style:ht},pt:{style:ht},pr:{style:ht},pb:{style:ht},pl:{style:ht},px:{style:ht},py:{style:ht},padding:{style:ht},paddingTop:{style:ht},paddingRight:{style:ht},paddingBottom:{style:ht},paddingLeft:{style:ht},paddingX:{style:ht},paddingY:{style:ht},paddingInline:{style:ht},paddingInlineStart:{style:ht},paddingInlineEnd:{style:ht},paddingBlock:{style:ht},paddingBlockStart:{style:ht},paddingBlockEnd:{style:ht},m:{style:pt},mt:{style:pt},mr:{style:pt},mb:{style:pt},ml:{style:pt},mx:{style:pt},my:{style:pt},margin:{style:pt},marginTop:{style:pt},marginRight:{style:pt},marginBottom:{style:pt},marginLeft:{style:pt},marginX:{style:pt},marginY:{style:pt},marginInline:{style:pt},marginInlineStart:{style:pt},marginInlineEnd:{style:pt},marginBlock:{style:pt},marginBlockStart:{style:pt},marginBlockEnd:{style:pt},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Im},rowGap:{style:$m},columnGap:{style:Dm},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:on},maxWidth:{style:hb},minWidth:{transform:on},height:{transform:on},maxHeight:{transform:on},minHeight:{transform:on},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},Hm=PW;function zW(...e){const t=e.reduce((n,o)=>n.concat(Object.keys(o)),[]),r=new Set(t);return e.every(n=>r.size===Object.keys(n).length)}function LW(e,t){return typeof e=="function"?e(t):e}function IW(){function e(r,n,o,i){const s={[r]:n,theme:o},a=i[r];if(!a)return{[r]:n};const{cssProperty:l=r,themeKey:c,transform:u,style:d}=a;if(n==null)return null;if(c==="typography"&&n==="inherit")return{[r]:n};const f=Pm(o,c)||{};return d?d(s):ao(s,n,h=>{let m=uh(f,u,h);return h===m&&typeof h=="string"&&(m=uh(f,u,`${r}${h==="default"?"":Fe(h)}`,h)),l===!1?m:{[l]:m}})}function t(r){var n;const{sx:o,theme:i={}}=r||{};if(!o)return null;const s=(n=i.unstable_sxConfig)!=null?n:Hm;function a(l){let c=l;if(typeof l=="function")c=l(i);else if(typeof l!="object")return l;if(!c)return null;const u=XT(i.breakpoints),d=Object.keys(u);let f=u;return Object.keys(c).forEach(p=>{const h=LW(c[p],i);if(h!=null)if(typeof h=="object")if(s[p])f=Ou(f,e(p,h,i,s));else{const m=ao({theme:i},h,b=>({[p]:b}));zW(m,h)?f[p]=t({sx:h,theme:i}):f=Ou(f,m)}else f=Ou(f,e(p,h,i,s))}),QT(d,f)}return Array.isArray(o)?o.map(a):a(o)}return t}const e3=IW();e3.filterProps=["sx"];const Bm=e3,DW=["breakpoints","palette","spacing","shape"];function Fm(e={},...t){const{breakpoints:r={},palette:n={},spacing:o,shape:i={}}=e,s=ve(e,DW),a=qU(r),l=oW(o);let c=cn({breakpoints:a,direction:"ltr",components:{},palette:_({mode:"light"},n),spacing:l,shape:_({},YU,i)},s);return c=t.reduce((u,d)=>cn(u,d),c),c.unstable_sxConfig=_({},Hm,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(d){return Bm({sx:d,theme:this})},c}function $W(e){return Object.keys(e).length===0}function mb(e=null){const t=S.useContext(lb);return!t||$W(t)?e:t}const HW=Fm();function gb(e=HW){return mb(e)}const BW=["sx"],FW=e=>{var t,r;const n={systemProps:{},otherProps:{}},o=(t=e==null||(r=e.theme)==null?void 0:r.unstable_sxConfig)!=null?t:Hm;return Object.keys(e).forEach(i=>{o[i]?n.systemProps[i]=e[i]:n.otherProps[i]=e[i]}),n};function vb(e){const{sx:t}=e,r=ve(e,BW),{systemProps:n,otherProps:o}=FW(r);let i;return Array.isArray(t)?i=[n,...t]:typeof t=="function"?i=(...s)=>{const a=t(...s);return Wo(a)?_({},n,a):n}:i=_({},n,t),_({},o,{sx:i})}function t3(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ta!=="theme"&&a!=="sx"&&a!=="as"})(Bm);return S.forwardRef(function(l,c){const u=gb(r),d=vb(l),{className:f,component:p="div"}=d,h=ve(d,VW);return O.jsx(i,_({as:p,ref:c,className:Ce(f,o?o(n):n),theme:t&&u[t]||u},h))})}const UW=["variant"];function eS(e){return e.length===0}function r3(e){const{variant:t}=e,r=ve(e,UW);let n=t||"";return Object.keys(r).sort().forEach(o=>{o==="color"?n+=eS(n)?e[o]:Fe(e[o]):n+=`${eS(n)?o:Fe(o)}${Fe(e[o].toString())}`}),n}const WW=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function KW(e){return Object.keys(e).length===0}function qW(e){return typeof e=="string"&&e.charCodeAt(0)>96}const GW=(e,t)=>t.components&&t.components[e]&&t.components[e].styleOverrides?t.components[e].styleOverrides:null,dh=e=>{const t={};return e&&e.forEach(r=>{const n=r3(r.props);t[n]=r.style}),t},YW=(e,t)=>{let r=[];return t&&t.components&&t.components[e]&&t.components[e].variants&&(r=t.components[e].variants),dh(r)},fh=(e,t,r)=>{const{ownerState:n={}}=e,o=[];return r&&r.forEach(i=>{let s=!0;Object.keys(i.props).forEach(a=>{n[a]!==i.props[a]&&e[a]!==i.props[a]&&(s=!1)}),s&&o.push(t[r3(i.props)])}),o},JW=(e,t,r,n)=>{var o;const i=r==null||(o=r.components)==null||(o=o[n])==null?void 0:o.variants;return fh(e,t,i)};function up(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const XW=Fm(),QW=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function dp({defaultTheme:e,theme:t,themeId:r}){return KW(t)?e:t[r]||t}function ZW(e){return e?(t,r)=>r[e]:null}const tS=({styledArg:e,props:t,defaultTheme:r,themeId:n})=>{const o=e(_({},t,{theme:dp(_({},t,{defaultTheme:r,themeId:n}))}));let i;if(o&&o.variants&&(i=o.variants,delete o.variants),i){const s=fh(t,dh(i),i);return[o,...s]}return o};function n3(e={}){const{themeId:t,defaultTheme:r=XW,rootShouldForwardProp:n=up,slotShouldForwardProp:o=up}=e,i=s=>Bm(_({},s,{theme:dp(_({},s,{defaultTheme:r,themeId:t}))}));return i.__mui_systemSx=!0,(s,a={})=>{UU(s,x=>x.filter(k=>!(k!=null&&k.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:d,overridesResolver:f=ZW(QW(c))}=a,p=ve(a,WW),h=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=d||!1;let b,v=up;c==="Root"||c==="root"?v=n:c?v=o:qW(s)&&(v=void 0);const g=JT(s,_({shouldForwardProp:v,label:b},p)),y=(x,...k)=>{const w=k?k.map(T=>{if(typeof T=="function"&&T.__emotion_real!==T)return N=>tS({styledArg:T,props:N,defaultTheme:r,themeId:t});if(Wo(T)){let N=T,F;return T&&T.variants&&(F=T.variants,delete N.variants,N=I=>{let V=T;return fh(I,dh(F),F).forEach(z=>{V=cn(V,z)}),V}),N}return T}):[];let E=x;if(Wo(x)){let T;x&&x.variants&&(T=x.variants,delete E.variants,E=N=>{let F=x;return fh(N,dh(T),T).forEach(V=>{F=cn(F,V)}),F})}else typeof x=="function"&&x.__emotion_real!==x&&(E=T=>tS({styledArg:x,props:T,defaultTheme:r,themeId:t}));l&&f&&w.push(T=>{const N=dp(_({},T,{defaultTheme:r,themeId:t})),F=GW(l,N);if(F){const I={};return Object.entries(F).forEach(([V,j])=>{I[V]=typeof j=="function"?j(_({},T,{theme:N})):j}),f(T,I)}return null}),l&&!h&&w.push(T=>{const N=dp(_({},T,{defaultTheme:r,themeId:t}));return JW(T,YW(l,N),N,l)}),m||w.push(i);const M=w.length-k.length;if(Array.isArray(x)&&M>0){const T=new Array(M).fill("");E=[...x,...T],E.raw=[...x.raw,...T]}const C=g(E,...w);return s.muiName&&(C.muiName=s.muiName),C};return g.withConfig&&(y.withConfig=g.withConfig),y}}const eK=n3(),tK=eK;function rK(e){const{theme:t,name:r,props:n}=e;return!t||!t.components||!t.components[r]||!t.components[r].defaultProps?n:RT(t.components[r].defaultProps,n)}function o3({props:e,name:t,defaultTheme:r,themeId:n}){let o=gb(r);return n&&(o=o[n]||o),rK({theme:o,name:t,props:e})}function yb(e,t=0,r=1){return Math.min(Math.max(t,e),r)}function nK(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&r[0].length===1&&(r=r.map(n=>n+n)),r?`rgb${r.length===4?"a":""}(${r.map((n,o)=>o<3?parseInt(n,16):Math.round(parseInt(n,16)/255*1e3)/1e3).join(", ")})`:""}function ga(e){if(e.type)return e;if(e.charAt(0)==="#")return ga(nK(e));const t=e.indexOf("("),r=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(r)===-1)throw new Error(Wl(9,e));let n=e.substring(t+1,e.length-1),o;if(r==="color"){if(n=n.split(" "),o=n.shift(),n.length===4&&n[3].charAt(0)==="/"&&(n[3]=n[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(o)===-1)throw new Error(Wl(10,o))}else n=n.split(",");return n=n.map(i=>parseFloat(i)),{type:r,values:n,colorSpace:o}}function Vm(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return t.indexOf("rgb")!==-1?n=n.map((o,i)=>i<3?parseInt(o,10):o):t.indexOf("hsl")!==-1&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),t.indexOf("color")!==-1?n=`${r} ${n.join(" ")}`:n=`${n.join(", ")}`,`${t}(${n})`}function oK(e){e=ga(e);const{values:t}=e,r=t[0],n=t[1]/100,o=t[2]/100,i=n*Math.min(o,1-o),s=(c,u=(c+r/30)%12)=>o-i*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),Vm({type:a,values:l})}function rS(e){e=ga(e);let t=e.type==="hsl"||e.type==="hsla"?ga(oK(e)).values:e.values;return t=t.map(r=>(e.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function iK(e,t){const r=rS(e),n=rS(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function Lr(e,t){return e=ga(e),t=yb(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Vm(e)}function sK(e,t){if(e=ga(e),t=yb(t),e.type.indexOf("hsl")!==-1)e.values[2]*=1-t;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)e.values[r]*=1-t;return Vm(e)}function aK(e,t){if(e=ga(e),t=yb(t),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*t;else if(e.type.indexOf("rgb")!==-1)for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return Vm(e)}const lK=S.createContext(null),i3=lK;function s3(){return S.useContext(i3)}const cK=typeof Symbol=="function"&&Symbol.for,uK=cK?Symbol.for("mui.nested"):"__THEME_NESTED__";function dK(e,t){return typeof t=="function"?t(e):_({},e,t)}function fK(e){const{children:t,theme:r}=e,n=s3(),o=S.useMemo(()=>{const i=n===null?r:dK(n,r);return i!=null&&(i[uK]=n!==null),i},[r,n]);return O.jsx(i3.Provider,{value:o,children:t})}const nS={};function oS(e,t,r,n=!1){return S.useMemo(()=>{const o=e&&t[e]||t;if(typeof r=="function"){const i=r(o),s=e?_({},t,{[e]:i}):i;return n?()=>s:s}return e?_({},t,{[e]:r}):_({},t,r)},[e,t,r,n])}function pK(e){const{children:t,theme:r,themeId:n}=e,o=mb(nS),i=s3()||nS,s=oS(n,o,r),a=oS(n,i,r,!0);return O.jsx(fK,{theme:a,children:O.jsx(lb.Provider,{value:s,children:t})})}const hK=["component","direction","spacing","divider","children","className","useFlexGap"],mK=Fm(),gK=tK("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function vK(e){return o3({props:e,name:"MuiStack",defaultTheme:mK})}function yK(e,t){const r=S.Children.toArray(e).filter(Boolean);return r.reduce((n,o,i)=>(n.push(o),i({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],xK=({ownerState:e,theme:t})=>{let r=_({display:"flex",flexDirection:"column"},ao({theme:t},Qg({values:e.direction,breakpoints:t.breakpoints.values}),n=>({flexDirection:n})));if(e.spacing){const n=pb(t),o=Object.keys(t.breakpoints.values).reduce((l,c)=>((typeof e.spacing=="object"&&e.spacing[c]!=null||typeof e.direction=="object"&&e.direction[c]!=null)&&(l[c]=!0),l),{}),i=Qg({values:e.direction,base:o}),s=Qg({values:e.spacing,base:o});typeof i=="object"&&Object.keys(i).forEach((l,c,u)=>{if(!i[l]){const f=c>0?i[u[c-1]]:"column";i[l]=f}}),r=cn(r,ao({theme:t},s,(l,c)=>e.useFlexGap?{gap:ma(n,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${bK(c?i[c]:e.direction)}`]:ma(n,l)}}))}return r=JU(t.breakpoints,r),r};function kK(e={}){const{createStyledComponent:t=gK,useThemeProps:r=vK,componentName:n="MuiStack"}=e,o=()=>tr({root:["root"]},l=>Vt(n,l),{}),i=t(xK);return S.forwardRef(function(l,c){const u=r(l),d=vb(u),{component:f="div",direction:p="column",spacing:h=0,divider:m,children:b,className:v,useFlexGap:g=!1}=d,y=ve(d,hK),x={direction:p,spacing:h,useFlexGap:g},k=o();return O.jsx(i,_({as:f,ownerState:x,ref:c,className:Ce(k.root,v)},y,{children:m?yK(b,m):b}))})}function wK(e,t){return _({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}const SK=["mode","contrastThreshold","tonalOffset"],iS={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:ud.white,default:ud.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},Zg={text:{primary:ud.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:ud.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function sS(e,t,r,n){const o=n.light||n,i=n.dark||n*1.5;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:t==="light"?e.light=aK(e.main,o):t==="dark"&&(e.dark=sK(e.main,i)))}function EK(e="light"){return e==="dark"?{main:Ia[200],light:Ia[50],dark:Ia[400]}:{main:Ia[700],light:Ia[400],dark:Ia[800]}}function CK(e="light"){return e==="dark"?{main:La[200],light:La[50],dark:La[400]}:{main:La[500],light:La[300],dark:La[700]}}function MK(e="light"){return e==="dark"?{main:za[500],light:za[300],dark:za[700]}:{main:za[700],light:za[400],dark:za[800]}}function TK(e="light"){return e==="dark"?{main:Da[400],light:Da[300],dark:Da[700]}:{main:Da[700],light:Da[500],dark:Da[900]}}function OK(e="light"){return e==="dark"?{main:$a[400],light:$a[300],dark:$a[700]}:{main:$a[800],light:$a[500],dark:$a[900]}}function _K(e="light"){return e==="dark"?{main:Mc[400],light:Mc[300],dark:Mc[700]}:{main:"#ed6c02",light:Mc[500],dark:Mc[900]}}function AK(e){const{mode:t="light",contrastThreshold:r=3,tonalOffset:n=.2}=e,o=ve(e,SK),i=e.primary||EK(t),s=e.secondary||CK(t),a=e.error||MK(t),l=e.info||TK(t),c=e.success||OK(t),u=e.warning||_K(t);function d(m){return iK(m,Zg.text.primary)>=r?Zg.text.primary:iS.text.primary}const f=({color:m,name:b,mainShade:v=500,lightShade:g=300,darkShade:y=700})=>{if(m=_({},m),!m.main&&m[v]&&(m.main=m[v]),!m.hasOwnProperty("main"))throw new Error(Wl(11,b?` (${b})`:"",v));if(typeof m.main!="string")throw new Error(Wl(12,b?` (${b})`:"",JSON.stringify(m.main)));return sS(m,"light",g,n),sS(m,"dark",y,n),m.contrastText||(m.contrastText=d(m.main)),m},p={dark:Zg,light:iS};return cn(_({common:_({},ud),mode:t,primary:f({color:i,name:"primary"}),secondary:f({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:a,name:"error"}),warning:f({color:u,name:"warning"}),info:f({color:l,name:"info"}),success:f({color:c,name:"success"}),grey:Ej,contrastThreshold:r,getContrastText:d,augmentColor:f,tonalOffset:n},p[t]),o)}const NK=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function RK(e){return Math.round(e*1e5)/1e5}const aS={textTransform:"uppercase"},lS='"Roboto", "Helvetica", "Arial", sans-serif';function PK(e,t){const r=typeof t=="function"?t(e):t,{fontFamily:n=lS,fontSize:o=14,fontWeightLight:i=300,fontWeightRegular:s=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:d}=r,f=ve(r,NK),p=o/14,h=d||(v=>`${v/c*p}rem`),m=(v,g,y,x,k)=>_({fontFamily:n,fontWeight:v,fontSize:h(g),lineHeight:y},n===lS?{letterSpacing:`${RK(x/g)}em`}:{},k,u),b={h1:m(i,96,1.167,-1.5),h2:m(i,60,1.2,-.5),h3:m(s,48,1.167,0),h4:m(s,34,1.235,.25),h5:m(s,24,1.334,0),h6:m(a,20,1.6,.15),subtitle1:m(s,16,1.75,.15),subtitle2:m(a,14,1.57,.1),body1:m(s,16,1.5,.15),body2:m(s,14,1.43,.15),button:m(a,14,1.75,.4,aS),caption:m(s,12,1.66,.4),overline:m(s,12,2.66,1,aS),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return cn(_({htmlFontSize:c,pxToRem:h,fontFamily:n,fontSize:o,fontWeightLight:i,fontWeightRegular:s,fontWeightMedium:a,fontWeightBold:l},b),f,{clone:!1})}const zK=.2,LK=.14,IK=.12;function nt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${zK})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${LK})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${IK})`].join(",")}const DK=["none",nt(0,2,1,-1,0,1,1,0,0,1,3,0),nt(0,3,1,-2,0,2,2,0,0,1,5,0),nt(0,3,3,-2,0,3,4,0,0,1,8,0),nt(0,2,4,-1,0,4,5,0,0,1,10,0),nt(0,3,5,-1,0,5,8,0,0,1,14,0),nt(0,3,5,-1,0,6,10,0,0,1,18,0),nt(0,4,5,-2,0,7,10,1,0,2,16,1),nt(0,5,5,-3,0,8,10,1,0,3,14,2),nt(0,5,6,-3,0,9,12,1,0,3,16,2),nt(0,6,6,-3,0,10,14,1,0,4,18,3),nt(0,6,7,-4,0,11,15,1,0,4,20,3),nt(0,7,8,-4,0,12,17,2,0,5,22,4),nt(0,7,8,-4,0,13,19,2,0,5,24,4),nt(0,7,9,-4,0,14,21,2,0,5,26,4),nt(0,8,9,-5,0,15,22,2,0,6,28,5),nt(0,8,10,-5,0,16,24,2,0,6,30,5),nt(0,8,11,-5,0,17,26,2,0,6,32,5),nt(0,9,11,-5,0,18,28,2,0,7,34,6),nt(0,9,12,-6,0,19,29,2,0,7,36,6),nt(0,10,13,-6,0,20,31,3,0,8,38,7),nt(0,10,13,-6,0,21,33,3,0,8,40,7),nt(0,10,14,-6,0,22,35,3,0,8,42,7),nt(0,11,14,-7,0,23,36,3,0,9,44,8),nt(0,11,15,-7,0,24,38,3,0,9,46,8)],$K=DK,HK=["duration","easing","delay"],BK={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},FK={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function cS(e){return`${Math.round(e)}ms`}function VK(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function jK(e){const t=_({},BK,e.easing),r=_({},FK,e.duration);return _({getAutoHeightDuration:VK,create:(o=["all"],i={})=>{const{duration:s=r.standard,easing:a=t.easeInOut,delay:l=0}=i;return ve(i,HK),(Array.isArray(o)?o:[o]).map(c=>`${c} ${typeof s=="string"?s:cS(s)} ${a} ${typeof l=="string"?l:cS(l)}`).join(",")}},e,{easing:t,duration:r})}const UK={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},WK=UK,KK=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function bb(e={},...t){const{mixins:r={},palette:n={},transitions:o={},typography:i={}}=e,s=ve(e,KK);if(e.vars)throw new Error(Wl(18));const a=AK(n),l=Fm(e);let c=cn(l,{mixins:wK(l.breakpoints,r),palette:a,shadows:$K.slice(),typography:PK(a,i),transitions:jK(o),zIndex:_({},WK)});return c=cn(c,s),c=t.reduce((u,d)=>cn(u,d),c),c.unstable_sxConfig=_({},Hm,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(d){return Bm({sx:d,theme:this})},c}const qK=bb(),xb=qK;function jm(){const e=gb(xb);return e[Kl]||e}function Wt({props:e,name:t}){return o3({props:e,name:t,defaultTheme:xb,themeId:Kl})}const kb=e=>up(e)&&e!=="classes",GK=n3({themeId:Kl,defaultTheme:xb,rootShouldForwardProp:kb}),Xe=GK,YK=["theme"];function JK(e){let{theme:t}=e,r=ve(e,YK);const n=t[Kl];return O.jsx(pK,_({},r,{themeId:n?Kl:void 0,theme:n||t}))}const XK=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},uS=XK;function J0(e,t){return J0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},J0(e,t)}function a3(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,J0(e,t)}const dS={disabled:!1},ph=L.createContext(null);var QK=function(t){return t.scrollTop},au="unmounted",Ns="exited",Rs="entering",Ya="entered",X0="exiting",fi=function(e){a3(t,e);function t(n,o){var i;i=e.call(this,n,o)||this;var s=o,a=s&&!s.isMounting?n.enter:n.appear,l;return i.appearStatus=null,n.in?a?(l=Ns,i.appearStatus=Rs):l=Ya:n.unmountOnExit||n.mountOnEnter?l=au:l=Ns,i.state={status:l},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var s=o.in;return s&&i.status===au?{status:Ns}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(o){var i=null;if(o!==this.props){var s=this.state.status;this.props.in?s!==Rs&&s!==Ya&&(i=Rs):(s===Rs||s===Ya)&&(i=X0)}this.updateStatus(!1,i)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var o=this.props.timeout,i,s,a;return i=s=a=o,o!=null&&typeof o!="number"&&(i=o.exit,s=o.enter,a=o.appear!==void 0?o.appear:s),{exit:i,enter:s,appear:a}},r.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===Rs){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:xf.findDOMNode(this);s&&QK(s)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ns&&this.setState({status:au})},r.performEnter=function(o){var i=this,s=this.props.enter,a=this.context?this.context.isMounting:o,l=this.props.nodeRef?[a]:[xf.findDOMNode(this),a],c=l[0],u=l[1],d=this.getTimeouts(),f=a?d.appear:d.enter;if(!o&&!s||dS.disabled){this.safeSetState({status:Ya},function(){i.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Rs},function(){i.props.onEntering(c,u),i.onTransitionEnd(f,function(){i.safeSetState({status:Ya},function(){i.props.onEntered(c,u)})})})},r.performExit=function(){var o=this,i=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:xf.findDOMNode(this);if(!i||dS.disabled){this.safeSetState({status:Ns},function(){o.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:X0},function(){o.props.onExiting(a),o.onTransitionEnd(s.exit,function(){o.safeSetState({status:Ns},function(){o.props.onExited(a)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},r.setNextCallback=function(o){var i=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,i.nextCallback=null,o(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},r.onTransitionEnd=function(o,i){this.setNextCallback(i);var s=this.props.nodeRef?this.props.nodeRef.current:xf.findDOMNode(this),a=o==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}o!=null&&setTimeout(this.nextCallback,o)},r.render=function(){var o=this.state.status;if(o===au)return null;var i=this.props,s=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var a=ve(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return L.createElement(ph.Provider,{value:null},typeof s=="function"?s(o,a):L.cloneElement(L.Children.only(s),a))},t}(L.Component);fi.contextType=ph;fi.propTypes={};function Ha(){}fi.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ha,onEntering:Ha,onEntered:Ha,onExit:Ha,onExiting:Ha,onExited:Ha};fi.UNMOUNTED=au;fi.EXITED=Ns;fi.ENTERING=Rs;fi.ENTERED=Ya;fi.EXITING=X0;const l3=fi;function ZK(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wb(e,t){var r=function(i){return t&&S.isValidElement(i)?t(i):i},n=Object.create(null);return e&&S.Children.map(e,function(o){return o}).forEach(function(o){n[o.key]=r(o)}),n}function eq(e,t){e=e||{},t=t||{};function r(u){return u in t?t[u]:e[u]}var n=Object.create(null),o=[];for(var i in e)i in t?o.length&&(n[i]=o,o=[]):o.push(i);var s,a={};for(var l in t){if(n[l])for(s=0;se.scrollTop;function hh(e,t){var r,n;const{timeout:o,easing:i,style:s={}}=e;return{duration:(r=s.transitionDuration)!=null?r:typeof o=="number"?o:o[t.mode]||0,easing:(n=s.transitionTimingFunction)!=null?n:typeof i=="object"?i[t.mode]:i,delay:s.transitionDelay}}function sq(e){return Vt("MuiPaper",e)}jt("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const aq=["className","component","elevation","square","variant"],lq=e=>{const{square:t,elevation:r,variant:n,classes:o}=e,i={root:["root",n,!t&&"rounded",n==="elevation"&&`elevation${r}`]};return tr(i,sq,o)},cq=Xe("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],!r.square&&t.rounded,r.variant==="elevation"&&t[`elevation${r.elevation}`]]}})(({theme:e,ownerState:t})=>{var r;return _({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&_({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${Lr("#fff",uS(t.elevation))}, ${Lr("#fff",uS(t.elevation))})`},e.vars&&{backgroundImage:(r=e.vars.overlays)==null?void 0:r[t.elevation]}))}),uq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiPaper"}),{className:o,component:i="div",elevation:s=1,square:a=!1,variant:l="elevation"}=n,c=ve(n,aq),u=_({},n,{component:i,elevation:s,square:a,variant:l}),d=lq(u);return O.jsx(cq,_({as:i,ownerState:u,className:Ce(d.root,o),ref:r},c))}),dq=uq;function fq(e){const{className:t,classes:r,pulsate:n=!1,rippleX:o,rippleY:i,rippleSize:s,in:a,onExited:l,timeout:c}=e,[u,d]=S.useState(!1),f=Ce(t,r.ripple,r.rippleVisible,n&&r.ripplePulsate),p={width:s,height:s,top:-(s/2)+i,left:-(s/2)+o},h=Ce(r.child,u&&r.childLeaving,n&&r.childPulsate);return!a&&!u&&d(!0),S.useEffect(()=>{if(!a&&l!=null){const m=setTimeout(l,c);return()=>{clearTimeout(m)}}},[l,a,c]),O.jsx("span",{className:f,style:p,children:O.jsx("span",{className:h})})}const pq=jt("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),wn=pq,hq=["center","classes","className"];let Um=e=>e,fS,pS,hS,mS;const Q0=550,mq=80,gq=cb(fS||(fS=Um` + */function e3(e,t){return dh(e,t)}const XU=(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))},QU=["values","unit","step"],ZU=e=>{const t=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return t.sort((r,n)=>r.val-n.val),t.reduce((r,n)=>_({},r,{[n.key]:n.val}),{})};function eW(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5}=e,o=ve(e,QU),i=ZU(t),s=Object.keys(i);function a(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r})`}function l(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-n/100}${r})`}function c(f,p){const h=s.indexOf(p);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r}) and (max-width:${(h!==-1&&typeof t[s[h]]=="number"?t[s[h]]:p)-n/100}${r})`}function u(f){return s.indexOf(f)+1`@media (min-width:${fb[e]}px)`};function ao(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const i=n.breakpoints||tS;return t.reduce((s,a,l)=>(s[i.up(i.keys[l])]=r(t[l]),s),{})}if(typeof t=="object"){const i=n.breakpoints||tS;return Object.keys(t).reduce((s,a)=>{if(Object.keys(i.values||fb).indexOf(a)!==-1){const l=i.up(a);s[l]=r(t[a],a)}else{const l=a;s[l]=t[l]}return s},{})}return r(t)}function t3(e={}){var t;return((t=e.keys)==null?void 0:t.reduce((n,o)=>{const i=e.up(o);return n[i]={},n},{}))||{}}function r3(e,t){return e.reduce((r,n)=>{const o=r[n];return(!o||Object.keys(o).length===0)&&delete r[n],r},t)}function nW(e,...t){const r=t3(e),n=[r,...t].reduce((o,i)=>un(o,i),{});return r3(Object.keys(r),n)}function oW(e,t){if(typeof e!="object")return{};const r={},n=Object.keys(t);return Array.isArray(e)?n.forEach((o,i)=>{i{e[o]!=null&&(r[o]=!0)}),r}function t1({values:e,breakpoints:t,base:r}){const n=r||oW(e,t),o=Object.keys(n);if(o.length===0)return e;let i;return o.reduce((s,a,l)=>(Array.isArray(e)?(s[a]=e[l]!=null?e[l]:e[i],i=l):typeof e=="object"?(s[a]=e[a]!=null?e[a]:e[i],i=a):s[a]=e,s),{})}function Im(e,t,r=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&r){const n=`vars.${t}`.split(".").reduce((o,i)=>o&&o[i]?o[i]:null,e);if(n!=null)return n}return t.split(".").reduce((n,o)=>n&&n[o]!=null?n[o]:null,e)}function fh(e,t,r,n=r){let o;return typeof e=="function"?o=e(r):Array.isArray(e)?o=e[r]||n:o=Im(e,r)||n,t&&(o=t(o,n,e)),o}function Ie(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:o}=e,i=s=>{if(s[t]==null)return null;const a=s[t],l=s.theme,c=Im(l,n)||{};return ao(s,a,d=>{let f=fh(c,o,d);return d===f&&typeof d=="string"&&(f=fh(c,o,`${t}${d==="default"?"":Fe(d)}`,d)),r===!1?f:{[r]:f}})};return i.propTypes={},i.filterProps=[t],i}function iW(e){const t={};return r=>(t[r]===void 0&&(t[r]=e(r)),t[r])}const sW={m:"margin",p:"padding"},aW={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},rS={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},lW=iW(e=>{if(e.length>2)if(rS[e])e=rS[e];else return[e];const[t,r]=e.split(""),n=sW[t],o=aW[r]||"";return Array.isArray(o)?o.map(i=>n+i):[n+o]}),pb=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],hb=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...pb,...hb];function qd(e,t,r,n){var o;const i=(o=Im(e,t,!1))!=null?o:r;return typeof i=="number"?s=>typeof s=="string"?s:i*s:Array.isArray(i)?s=>typeof s=="string"?s:i[s]:typeof i=="function"?i:()=>{}}function mb(e){return qd(e,"spacing",8)}function ma(e,t){if(typeof t=="string"||t==null)return t;const r=Math.abs(t),n=e(r);return t>=0?n:typeof n=="number"?-n:`-${n}`}function cW(e,t){return r=>e.reduce((n,o)=>(n[o]=ma(t,r),n),{})}function uW(e,t,r,n){if(t.indexOf(r)===-1)return null;const o=lW(r),i=cW(o,n),s=e[r];return ao(e,s,i)}function n3(e,t){const r=mb(e.theme);return Object.keys(e).map(n=>uW(e,t,n,r)).reduce(_u,{})}function pt(e){return n3(e,pb)}pt.propTypes={};pt.filterProps=pb;function ht(e){return n3(e,hb)}ht.propTypes={};ht.filterProps=hb;function dW(e=8){if(e.mui)return e;const t=mb({spacing:e}),r=(...n)=>(n.length===0?[1]:n).map(i=>{const s=t(i);return typeof s=="number"?`${s}px`:s}).join(" ");return r.mui=!0,r}function Dm(...e){const t=e.reduce((n,o)=>(o.filterProps.forEach(i=>{n[i]=o}),n),{}),r=n=>Object.keys(n).reduce((o,i)=>t[i]?_u(o,t[i](n)):o,{});return r.propTypes={},r.filterProps=e.reduce((n,o)=>n.concat(o.filterProps),[]),r}function xo(e){return typeof e!="number"?e:`${e}px solid`}const fW=Ie({prop:"border",themeKey:"borders",transform:xo}),pW=Ie({prop:"borderTop",themeKey:"borders",transform:xo}),hW=Ie({prop:"borderRight",themeKey:"borders",transform:xo}),mW=Ie({prop:"borderBottom",themeKey:"borders",transform:xo}),gW=Ie({prop:"borderLeft",themeKey:"borders",transform:xo}),vW=Ie({prop:"borderColor",themeKey:"palette"}),yW=Ie({prop:"borderTopColor",themeKey:"palette"}),bW=Ie({prop:"borderRightColor",themeKey:"palette"}),xW=Ie({prop:"borderBottomColor",themeKey:"palette"}),kW=Ie({prop:"borderLeftColor",themeKey:"palette"}),$m=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=qd(e.theme,"shape.borderRadius",4),r=n=>({borderRadius:ma(t,n)});return ao(e,e.borderRadius,r)}return null};$m.propTypes={};$m.filterProps=["borderRadius"];Dm(fW,pW,hW,mW,gW,vW,yW,bW,xW,kW,$m);const Hm=e=>{if(e.gap!==void 0&&e.gap!==null){const t=qd(e.theme,"spacing",8),r=n=>({gap:ma(t,n)});return ao(e,e.gap,r)}return null};Hm.propTypes={};Hm.filterProps=["gap"];const Bm=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=qd(e.theme,"spacing",8),r=n=>({columnGap:ma(t,n)});return ao(e,e.columnGap,r)}return null};Bm.propTypes={};Bm.filterProps=["columnGap"];const Fm=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=qd(e.theme,"spacing",8),r=n=>({rowGap:ma(t,n)});return ao(e,e.rowGap,r)}return null};Fm.propTypes={};Fm.filterProps=["rowGap"];const wW=Ie({prop:"gridColumn"}),SW=Ie({prop:"gridRow"}),EW=Ie({prop:"gridAutoFlow"}),CW=Ie({prop:"gridAutoColumns"}),MW=Ie({prop:"gridAutoRows"}),TW=Ie({prop:"gridTemplateColumns"}),OW=Ie({prop:"gridTemplateRows"}),_W=Ie({prop:"gridTemplateAreas"}),AW=Ie({prop:"gridArea"});Dm(Hm,Bm,Fm,wW,SW,EW,CW,MW,TW,OW,_W,AW);function Sl(e,t){return t==="grey"?t:e}const NW=Ie({prop:"color",themeKey:"palette",transform:Sl}),RW=Ie({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Sl}),PW=Ie({prop:"backgroundColor",themeKey:"palette",transform:Sl});Dm(NW,RW,PW);function sn(e){return e<=1&&e!==0?`${e*100}%`:e}const zW=Ie({prop:"width",transform:sn}),gb=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=r=>{var n,o;const i=((n=e.theme)==null||(n=n.breakpoints)==null||(n=n.values)==null?void 0:n[r])||fb[r];return i?((o=e.theme)==null||(o=o.breakpoints)==null?void 0:o.unit)!=="px"?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:sn(r)}};return ao(e,e.maxWidth,t)}return null};gb.filterProps=["maxWidth"];const LW=Ie({prop:"minWidth",transform:sn}),IW=Ie({prop:"height",transform:sn}),DW=Ie({prop:"maxHeight",transform:sn}),$W=Ie({prop:"minHeight",transform:sn});Ie({prop:"size",cssProperty:"width",transform:sn});Ie({prop:"size",cssProperty:"height",transform:sn});const HW=Ie({prop:"boxSizing"});Dm(zW,gb,LW,IW,DW,$W,HW);const BW={border:{themeKey:"borders",transform:xo},borderTop:{themeKey:"borders",transform:xo},borderRight:{themeKey:"borders",transform:xo},borderBottom:{themeKey:"borders",transform:xo},borderLeft:{themeKey:"borders",transform:xo},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:$m},color:{themeKey:"palette",transform:Sl},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Sl},backgroundColor:{themeKey:"palette",transform:Sl},p:{style:ht},pt:{style:ht},pr:{style:ht},pb:{style:ht},pl:{style:ht},px:{style:ht},py:{style:ht},padding:{style:ht},paddingTop:{style:ht},paddingRight:{style:ht},paddingBottom:{style:ht},paddingLeft:{style:ht},paddingX:{style:ht},paddingY:{style:ht},paddingInline:{style:ht},paddingInlineStart:{style:ht},paddingInlineEnd:{style:ht},paddingBlock:{style:ht},paddingBlockStart:{style:ht},paddingBlockEnd:{style:ht},m:{style:pt},mt:{style:pt},mr:{style:pt},mb:{style:pt},ml:{style:pt},mx:{style:pt},my:{style:pt},margin:{style:pt},marginTop:{style:pt},marginRight:{style:pt},marginBottom:{style:pt},marginLeft:{style:pt},marginX:{style:pt},marginY:{style:pt},marginInline:{style:pt},marginInlineStart:{style:pt},marginInlineEnd:{style:pt},marginBlock:{style:pt},marginBlockStart:{style:pt},marginBlockEnd:{style:pt},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Hm},rowGap:{style:Fm},columnGap:{style:Bm},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:sn},maxWidth:{style:gb},minWidth:{transform:sn},height:{transform:sn},maxHeight:{transform:sn},minHeight:{transform:sn},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},Vm=BW;function FW(...e){const t=e.reduce((n,o)=>n.concat(Object.keys(o)),[]),r=new Set(t);return e.every(n=>r.size===Object.keys(n).length)}function VW(e,t){return typeof e=="function"?e(t):e}function jW(){function e(r,n,o,i){const s={[r]:n,theme:o},a=i[r];if(!a)return{[r]:n};const{cssProperty:l=r,themeKey:c,transform:u,style:d}=a;if(n==null)return null;if(c==="typography"&&n==="inherit")return{[r]:n};const f=Im(o,c)||{};return d?d(s):ao(s,n,h=>{let m=fh(f,u,h);return h===m&&typeof h=="string"&&(m=fh(f,u,`${r}${h==="default"?"":Fe(h)}`,h)),l===!1?m:{[l]:m}})}function t(r){var n;const{sx:o,theme:i={}}=r||{};if(!o)return null;const s=(n=i.unstable_sxConfig)!=null?n:Vm;function a(l){let c=l;if(typeof l=="function")c=l(i);else if(typeof l!="object")return l;if(!c)return null;const u=t3(i.breakpoints),d=Object.keys(u);let f=u;return Object.keys(c).forEach(p=>{const h=VW(c[p],i);if(h!=null)if(typeof h=="object")if(s[p])f=_u(f,e(p,h,i,s));else{const m=ao({theme:i},h,b=>({[p]:b}));FW(m,h)?f[p]=t({sx:h,theme:i}):f=_u(f,m)}else f=_u(f,e(p,h,i,s))}),r3(d,f)}return Array.isArray(o)?o.map(a):a(o)}return t}const o3=jW();o3.filterProps=["sx"];const jm=o3,UW=["breakpoints","palette","spacing","shape"];function Um(e={},...t){const{breakpoints:r={},palette:n={},spacing:o,shape:i={}}=e,s=ve(e,UW),a=eW(r),l=dW(o);let c=un({breakpoints:a,direction:"ltr",components:{},palette:_({mode:"light"},n),spacing:l,shape:_({},rW,i)},s);return c=t.reduce((u,d)=>un(u,d),c),c.unstable_sxConfig=_({},Vm,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(d){return jm({sx:d,theme:this})},c}function WW(e){return Object.keys(e).length===0}function vb(e=null){const t=S.useContext(ub);return!t||WW(t)?e:t}const KW=Um();function yb(e=KW){return vb(e)}const qW=["sx"],GW=e=>{var t,r;const n={systemProps:{},otherProps:{}},o=(t=e==null||(r=e.theme)==null?void 0:r.unstable_sxConfig)!=null?t:Vm;return Object.keys(e).forEach(i=>{o[i]?n.systemProps[i]=e[i]:n.otherProps[i]=e[i]}),n};function bb(e){const{sx:t}=e,r=ve(e,qW),{systemProps:n,otherProps:o}=GW(r);let i;return Array.isArray(t)?i=[n,...t]:typeof t=="function"?i=(...s)=>{const a=t(...s);return Wo(a)?_({},n,a):n}:i=_({},n,t),_({},o,{sx:i})}function i3(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ta!=="theme"&&a!=="sx"&&a!=="as"})(jm);return S.forwardRef(function(l,c){const u=yb(r),d=bb(l),{className:f,component:p="div"}=d,h=ve(d,YW);return O.jsx(i,_({as:p,ref:c,className:Ce(f,o?o(n):n),theme:t&&u[t]||u},h))})}const XW=["variant"];function nS(e){return e.length===0}function s3(e){const{variant:t}=e,r=ve(e,XW);let n=t||"";return Object.keys(r).sort().forEach(o=>{o==="color"?n+=nS(n)?e[o]:Fe(e[o]):n+=`${nS(n)?o:Fe(o)}${Fe(e[o].toString())}`}),n}const QW=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function ZW(e){return Object.keys(e).length===0}function eK(e){return typeof e=="string"&&e.charCodeAt(0)>96}const tK=(e,t)=>t.components&&t.components[e]&&t.components[e].styleOverrides?t.components[e].styleOverrides:null,ph=e=>{const t={};return e&&e.forEach(r=>{const n=s3(r.props);t[n]=r.style}),t},rK=(e,t)=>{let r=[];return t&&t.components&&t.components[e]&&t.components[e].variants&&(r=t.components[e].variants),ph(r)},hh=(e,t,r)=>{const{ownerState:n={}}=e,o=[];return r&&r.forEach(i=>{let s=!0;Object.keys(i.props).forEach(a=>{n[a]!==i.props[a]&&e[a]!==i.props[a]&&(s=!1)}),s&&o.push(t[s3(i.props)])}),o},nK=(e,t,r,n)=>{var o;const i=r==null||(o=r.components)==null||(o=o[n])==null?void 0:o.variants;return hh(e,t,i)};function fp(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const oK=Um(),iK=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function pp({defaultTheme:e,theme:t,themeId:r}){return ZW(t)?e:t[r]||t}function sK(e){return e?(t,r)=>r[e]:null}const oS=({styledArg:e,props:t,defaultTheme:r,themeId:n})=>{const o=e(_({},t,{theme:pp(_({},t,{defaultTheme:r,themeId:n}))}));let i;if(o&&o.variants&&(i=o.variants,delete o.variants),i){const s=hh(t,ph(i),i);return[o,...s]}return o};function a3(e={}){const{themeId:t,defaultTheme:r=oK,rootShouldForwardProp:n=fp,slotShouldForwardProp:o=fp}=e,i=s=>jm(_({},s,{theme:pp(_({},s,{defaultTheme:r,themeId:t}))}));return i.__mui_systemSx=!0,(s,a={})=>{XU(s,x=>x.filter(k=>!(k!=null&&k.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:d,overridesResolver:f=sK(iK(c))}=a,p=ve(a,QW),h=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=d||!1;let b,v=fp;c==="Root"||c==="root"?v=n:c?v=o:eK(s)&&(v=void 0);const g=e3(s,_({shouldForwardProp:v,label:b},p)),y=(x,...k)=>{const w=k?k.map(M=>{if(typeof M=="function"&&M.__emotion_real!==M)return N=>oS({styledArg:M,props:N,defaultTheme:r,themeId:t});if(Wo(M)){let N=M,F;return M&&M.variants&&(F=M.variants,delete N.variants,N=I=>{let V=M;return hh(I,ph(F),F).forEach(z=>{V=un(V,z)}),V}),N}return M}):[];let E=x;if(Wo(x)){let M;x&&x.variants&&(M=x.variants,delete E.variants,E=N=>{let F=x;return hh(N,ph(M),M).forEach(V=>{F=un(F,V)}),F})}else typeof x=="function"&&x.__emotion_real!==x&&(E=M=>oS({styledArg:x,props:M,defaultTheme:r,themeId:t}));l&&f&&w.push(M=>{const N=pp(_({},M,{defaultTheme:r,themeId:t})),F=tK(l,N);if(F){const I={};return Object.entries(F).forEach(([V,j])=>{I[V]=typeof j=="function"?j(_({},M,{theme:N})):j}),f(M,I)}return null}),l&&!h&&w.push(M=>{const N=pp(_({},M,{defaultTheme:r,themeId:t}));return nK(M,rK(l,N),N,l)}),m||w.push(i);const T=w.length-k.length;if(Array.isArray(x)&&T>0){const M=new Array(T).fill("");E=[...x,...M],E.raw=[...x.raw,...M]}const C=g(E,...w);return s.muiName&&(C.muiName=s.muiName),C};return g.withConfig&&(y.withConfig=g.withConfig),y}}const aK=a3(),lK=aK;function cK(e){const{theme:t,name:r,props:n}=e;return!t||!t.components||!t.components[r]||!t.components[r].defaultProps?n:IT(t.components[r].defaultProps,n)}function l3({props:e,name:t,defaultTheme:r,themeId:n}){let o=yb(r);return n&&(o=o[n]||o),cK({theme:o,name:t,props:e})}function xb(e,t=0,r=1){return Math.min(Math.max(t,e),r)}function uK(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&r[0].length===1&&(r=r.map(n=>n+n)),r?`rgb${r.length===4?"a":""}(${r.map((n,o)=>o<3?parseInt(n,16):Math.round(parseInt(n,16)/255*1e3)/1e3).join(", ")})`:""}function ga(e){if(e.type)return e;if(e.charAt(0)==="#")return ga(uK(e));const t=e.indexOf("("),r=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(r)===-1)throw new Error(Wl(9,e));let n=e.substring(t+1,e.length-1),o;if(r==="color"){if(n=n.split(" "),o=n.shift(),n.length===4&&n[3].charAt(0)==="/"&&(n[3]=n[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(o)===-1)throw new Error(Wl(10,o))}else n=n.split(",");return n=n.map(i=>parseFloat(i)),{type:r,values:n,colorSpace:o}}function Wm(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return t.indexOf("rgb")!==-1?n=n.map((o,i)=>i<3?parseInt(o,10):o):t.indexOf("hsl")!==-1&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),t.indexOf("color")!==-1?n=`${r} ${n.join(" ")}`:n=`${n.join(", ")}`,`${t}(${n})`}function dK(e){e=ga(e);const{values:t}=e,r=t[0],n=t[1]/100,o=t[2]/100,i=n*Math.min(o,1-o),s=(c,u=(c+r/30)%12)=>o-i*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),Wm({type:a,values:l})}function iS(e){e=ga(e);let t=e.type==="hsl"||e.type==="hsla"?ga(dK(e)).values:e.values;return t=t.map(r=>(e.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function fK(e,t){const r=iS(e),n=iS(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function Lr(e,t){return e=ga(e),t=xb(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Wm(e)}function pK(e,t){if(e=ga(e),t=xb(t),e.type.indexOf("hsl")!==-1)e.values[2]*=1-t;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)e.values[r]*=1-t;return Wm(e)}function hK(e,t){if(e=ga(e),t=xb(t),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*t;else if(e.type.indexOf("rgb")!==-1)for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return Wm(e)}const mK=S.createContext(null),c3=mK;function u3(){return S.useContext(c3)}const gK=typeof Symbol=="function"&&Symbol.for,vK=gK?Symbol.for("mui.nested"):"__THEME_NESTED__";function yK(e,t){return typeof t=="function"?t(e):_({},e,t)}function bK(e){const{children:t,theme:r}=e,n=u3(),o=S.useMemo(()=>{const i=n===null?r:yK(n,r);return i!=null&&(i[vK]=n!==null),i},[r,n]);return O.jsx(c3.Provider,{value:o,children:t})}const sS={};function aS(e,t,r,n=!1){return S.useMemo(()=>{const o=e&&t[e]||t;if(typeof r=="function"){const i=r(o),s=e?_({},t,{[e]:i}):i;return n?()=>s:s}return e?_({},t,{[e]:r}):_({},t,r)},[e,t,r,n])}function xK(e){const{children:t,theme:r,themeId:n}=e,o=vb(sS),i=u3()||sS,s=aS(n,o,r),a=aS(n,i,r,!0);return O.jsx(bK,{theme:a,children:O.jsx(ub.Provider,{value:s,children:t})})}const kK=["component","direction","spacing","divider","children","className","useFlexGap"],wK=Um(),SK=lK("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function EK(e){return l3({props:e,name:"MuiStack",defaultTheme:wK})}function CK(e,t){const r=S.Children.toArray(e).filter(Boolean);return r.reduce((n,o,i)=>(n.push(o),i({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],TK=({ownerState:e,theme:t})=>{let r=_({display:"flex",flexDirection:"column"},ao({theme:t},t1({values:e.direction,breakpoints:t.breakpoints.values}),n=>({flexDirection:n})));if(e.spacing){const n=mb(t),o=Object.keys(t.breakpoints.values).reduce((l,c)=>((typeof e.spacing=="object"&&e.spacing[c]!=null||typeof e.direction=="object"&&e.direction[c]!=null)&&(l[c]=!0),l),{}),i=t1({values:e.direction,base:o}),s=t1({values:e.spacing,base:o});typeof i=="object"&&Object.keys(i).forEach((l,c,u)=>{if(!i[l]){const f=c>0?i[u[c-1]]:"column";i[l]=f}}),r=un(r,ao({theme:t},s,(l,c)=>e.useFlexGap?{gap:ma(n,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${MK(c?i[c]:e.direction)}`]:ma(n,l)}}))}return r=nW(t.breakpoints,r),r};function OK(e={}){const{createStyledComponent:t=SK,useThemeProps:r=EK,componentName:n="MuiStack"}=e,o=()=>rr({root:["root"]},l=>Vt(n,l),{}),i=t(TK);return S.forwardRef(function(l,c){const u=r(l),d=bb(u),{component:f="div",direction:p="column",spacing:h=0,divider:m,children:b,className:v,useFlexGap:g=!1}=d,y=ve(d,kK),x={direction:p,spacing:h,useFlexGap:g},k=o();return O.jsx(i,_({as:f,ownerState:x,ref:c,className:Ce(k.root,v)},y,{children:m?CK(b,m):b}))})}function _K(e,t){return _({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}const AK=["mode","contrastThreshold","tonalOffset"],lS={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:dd.white,default:dd.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},r1={text:{primary:dd.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:dd.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function cS(e,t,r,n){const o=n.light||n,i=n.dark||n*1.5;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:t==="light"?e.light=hK(e.main,o):t==="dark"&&(e.dark=pK(e.main,i)))}function NK(e="light"){return e==="dark"?{main:Ia[200],light:Ia[50],dark:Ia[400]}:{main:Ia[700],light:Ia[400],dark:Ia[800]}}function RK(e="light"){return e==="dark"?{main:La[200],light:La[50],dark:La[400]}:{main:La[500],light:La[300],dark:La[700]}}function PK(e="light"){return e==="dark"?{main:za[500],light:za[300],dark:za[700]}:{main:za[700],light:za[400],dark:za[800]}}function zK(e="light"){return e==="dark"?{main:Da[400],light:Da[300],dark:Da[700]}:{main:Da[700],light:Da[500],dark:Da[900]}}function LK(e="light"){return e==="dark"?{main:$a[400],light:$a[300],dark:$a[700]}:{main:$a[800],light:$a[500],dark:$a[900]}}function IK(e="light"){return e==="dark"?{main:Tc[400],light:Tc[300],dark:Tc[700]}:{main:"#ed6c02",light:Tc[500],dark:Tc[900]}}function DK(e){const{mode:t="light",contrastThreshold:r=3,tonalOffset:n=.2}=e,o=ve(e,AK),i=e.primary||NK(t),s=e.secondary||RK(t),a=e.error||PK(t),l=e.info||zK(t),c=e.success||LK(t),u=e.warning||IK(t);function d(m){return fK(m,r1.text.primary)>=r?r1.text.primary:lS.text.primary}const f=({color:m,name:b,mainShade:v=500,lightShade:g=300,darkShade:y=700})=>{if(m=_({},m),!m.main&&m[v]&&(m.main=m[v]),!m.hasOwnProperty("main"))throw new Error(Wl(11,b?` (${b})`:"",v));if(typeof m.main!="string")throw new Error(Wl(12,b?` (${b})`:"",JSON.stringify(m.main)));return cS(m,"light",g,n),cS(m,"dark",y,n),m.contrastText||(m.contrastText=d(m.main)),m},p={dark:r1,light:lS};return un(_({common:_({},dd),mode:t,primary:f({color:i,name:"primary"}),secondary:f({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:a,name:"error"}),warning:f({color:u,name:"warning"}),info:f({color:l,name:"info"}),success:f({color:c,name:"success"}),grey:Nj,contrastThreshold:r,getContrastText:d,augmentColor:f,tonalOffset:n},p[t]),o)}const $K=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function HK(e){return Math.round(e*1e5)/1e5}const uS={textTransform:"uppercase"},dS='"Roboto", "Helvetica", "Arial", sans-serif';function BK(e,t){const r=typeof t=="function"?t(e):t,{fontFamily:n=dS,fontSize:o=14,fontWeightLight:i=300,fontWeightRegular:s=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:d}=r,f=ve(r,$K),p=o/14,h=d||(v=>`${v/c*p}rem`),m=(v,g,y,x,k)=>_({fontFamily:n,fontWeight:v,fontSize:h(g),lineHeight:y},n===dS?{letterSpacing:`${HK(x/g)}em`}:{},k,u),b={h1:m(i,96,1.167,-1.5),h2:m(i,60,1.2,-.5),h3:m(s,48,1.167,0),h4:m(s,34,1.235,.25),h5:m(s,24,1.334,0),h6:m(a,20,1.6,.15),subtitle1:m(s,16,1.75,.15),subtitle2:m(a,14,1.57,.1),body1:m(s,16,1.5,.15),body2:m(s,14,1.43,.15),button:m(a,14,1.75,.4,uS),caption:m(s,12,1.66,.4),overline:m(s,12,2.66,1,uS),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return un(_({htmlFontSize:c,pxToRem:h,fontFamily:n,fontSize:o,fontWeightLight:i,fontWeightRegular:s,fontWeightMedium:a,fontWeightBold:l},b),f,{clone:!1})}const FK=.2,VK=.14,jK=.12;function nt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${FK})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${VK})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${jK})`].join(",")}const UK=["none",nt(0,2,1,-1,0,1,1,0,0,1,3,0),nt(0,3,1,-2,0,2,2,0,0,1,5,0),nt(0,3,3,-2,0,3,4,0,0,1,8,0),nt(0,2,4,-1,0,4,5,0,0,1,10,0),nt(0,3,5,-1,0,5,8,0,0,1,14,0),nt(0,3,5,-1,0,6,10,0,0,1,18,0),nt(0,4,5,-2,0,7,10,1,0,2,16,1),nt(0,5,5,-3,0,8,10,1,0,3,14,2),nt(0,5,6,-3,0,9,12,1,0,3,16,2),nt(0,6,6,-3,0,10,14,1,0,4,18,3),nt(0,6,7,-4,0,11,15,1,0,4,20,3),nt(0,7,8,-4,0,12,17,2,0,5,22,4),nt(0,7,8,-4,0,13,19,2,0,5,24,4),nt(0,7,9,-4,0,14,21,2,0,5,26,4),nt(0,8,9,-5,0,15,22,2,0,6,28,5),nt(0,8,10,-5,0,16,24,2,0,6,30,5),nt(0,8,11,-5,0,17,26,2,0,6,32,5),nt(0,9,11,-5,0,18,28,2,0,7,34,6),nt(0,9,12,-6,0,19,29,2,0,7,36,6),nt(0,10,13,-6,0,20,31,3,0,8,38,7),nt(0,10,13,-6,0,21,33,3,0,8,40,7),nt(0,10,14,-6,0,22,35,3,0,8,42,7),nt(0,11,14,-7,0,23,36,3,0,9,44,8),nt(0,11,15,-7,0,24,38,3,0,9,46,8)],WK=UK,KK=["duration","easing","delay"],qK={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},GK={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function fS(e){return`${Math.round(e)}ms`}function YK(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function JK(e){const t=_({},qK,e.easing),r=_({},GK,e.duration);return _({getAutoHeightDuration:YK,create:(o=["all"],i={})=>{const{duration:s=r.standard,easing:a=t.easeInOut,delay:l=0}=i;return ve(i,KK),(Array.isArray(o)?o:[o]).map(c=>`${c} ${typeof s=="string"?s:fS(s)} ${a} ${typeof l=="string"?l:fS(l)}`).join(",")}},e,{easing:t,duration:r})}const XK={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},QK=XK,ZK=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function kb(e={},...t){const{mixins:r={},palette:n={},transitions:o={},typography:i={}}=e,s=ve(e,ZK);if(e.vars)throw new Error(Wl(18));const a=DK(n),l=Um(e);let c=un(l,{mixins:_K(l.breakpoints,r),palette:a,shadows:WK.slice(),typography:BK(a,i),transitions:JK(o),zIndex:_({},QK)});return c=un(c,s),c=t.reduce((u,d)=>un(u,d),c),c.unstable_sxConfig=_({},Vm,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(d){return jm({sx:d,theme:this})},c}const eq=kb(),wb=eq;function Km(){const e=yb(wb);return e[Kl]||e}function Wt({props:e,name:t}){return l3({props:e,name:t,defaultTheme:wb,themeId:Kl})}const Sb=e=>fp(e)&&e!=="classes",tq=a3({themeId:Kl,defaultTheme:wb,rootShouldForwardProp:Sb}),Xe=tq,rq=["theme"];function nq(e){let{theme:t}=e,r=ve(e,rq);const n=t[Kl];return O.jsx(xK,_({},r,{themeId:n?Kl:void 0,theme:n||t}))}const oq=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},pS=oq;function Z0(e,t){return Z0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Z0(e,t)}function d3(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Z0(e,t)}const hS={disabled:!1},mh=L.createContext(null);var iq=function(t){return t.scrollTop},lu="unmounted",Ns="exited",Rs="entering",Ya="entered",ev="exiting",fi=function(e){d3(t,e);function t(n,o){var i;i=e.call(this,n,o)||this;var s=o,a=s&&!s.isMounting?n.enter:n.appear,l;return i.appearStatus=null,n.in?a?(l=Ns,i.appearStatus=Rs):l=Ya:n.unmountOnExit||n.mountOnEnter?l=lu:l=Ns,i.state={status:l},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var s=o.in;return s&&i.status===lu?{status:Ns}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(o){var i=null;if(o!==this.props){var s=this.state.status;this.props.in?s!==Rs&&s!==Ya&&(i=Rs):(s===Rs||s===Ya)&&(i=ev)}this.updateStatus(!1,i)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var o=this.props.timeout,i,s,a;return i=s=a=o,o!=null&&typeof o!="number"&&(i=o.exit,s=o.enter,a=o.appear!==void 0?o.appear:s),{exit:i,enter:s,appear:a}},r.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===Rs){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:wf.findDOMNode(this);s&&iq(s)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ns&&this.setState({status:lu})},r.performEnter=function(o){var i=this,s=this.props.enter,a=this.context?this.context.isMounting:o,l=this.props.nodeRef?[a]:[wf.findDOMNode(this),a],c=l[0],u=l[1],d=this.getTimeouts(),f=a?d.appear:d.enter;if(!o&&!s||hS.disabled){this.safeSetState({status:Ya},function(){i.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Rs},function(){i.props.onEntering(c,u),i.onTransitionEnd(f,function(){i.safeSetState({status:Ya},function(){i.props.onEntered(c,u)})})})},r.performExit=function(){var o=this,i=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:wf.findDOMNode(this);if(!i||hS.disabled){this.safeSetState({status:Ns},function(){o.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:ev},function(){o.props.onExiting(a),o.onTransitionEnd(s.exit,function(){o.safeSetState({status:Ns},function(){o.props.onExited(a)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},r.setNextCallback=function(o){var i=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,i.nextCallback=null,o(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},r.onTransitionEnd=function(o,i){this.setNextCallback(i);var s=this.props.nodeRef?this.props.nodeRef.current:wf.findDOMNode(this),a=o==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}o!=null&&setTimeout(this.nextCallback,o)},r.render=function(){var o=this.state.status;if(o===lu)return null;var i=this.props,s=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var a=ve(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return L.createElement(mh.Provider,{value:null},typeof s=="function"?s(o,a):L.cloneElement(L.Children.only(s),a))},t}(L.Component);fi.contextType=mh;fi.propTypes={};function Ha(){}fi.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ha,onEntering:Ha,onEntered:Ha,onExit:Ha,onExiting:Ha,onExited:Ha};fi.UNMOUNTED=lu;fi.EXITED=Ns;fi.ENTERING=Rs;fi.ENTERED=Ya;fi.EXITING=ev;const f3=fi;function sq(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Eb(e,t){var r=function(i){return t&&S.isValidElement(i)?t(i):i},n=Object.create(null);return e&&S.Children.map(e,function(o){return o}).forEach(function(o){n[o.key]=r(o)}),n}function aq(e,t){e=e||{},t=t||{};function r(u){return u in t?t[u]:e[u]}var n=Object.create(null),o=[];for(var i in e)i in t?o.length&&(n[i]=o,o=[]):o.push(i);var s,a={};for(var l in t){if(n[l])for(s=0;se.scrollTop;function gh(e,t){var r,n;const{timeout:o,easing:i,style:s={}}=e;return{duration:(r=s.transitionDuration)!=null?r:typeof o=="number"?o:o[t.mode]||0,easing:(n=s.transitionTimingFunction)!=null?n:typeof i=="object"?i[t.mode]:i,delay:s.transitionDelay}}function pq(e){return Vt("MuiPaper",e)}jt("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const hq=["className","component","elevation","square","variant"],mq=e=>{const{square:t,elevation:r,variant:n,classes:o}=e,i={root:["root",n,!t&&"rounded",n==="elevation"&&`elevation${r}`]};return rr(i,pq,o)},gq=Xe("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],!r.square&&t.rounded,r.variant==="elevation"&&t[`elevation${r.elevation}`]]}})(({theme:e,ownerState:t})=>{var r;return _({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&_({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${Lr("#fff",pS(t.elevation))}, ${Lr("#fff",pS(t.elevation))})`},e.vars&&{backgroundImage:(r=e.vars.overlays)==null?void 0:r[t.elevation]}))}),vq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiPaper"}),{className:o,component:i="div",elevation:s=1,square:a=!1,variant:l="elevation"}=n,c=ve(n,hq),u=_({},n,{component:i,elevation:s,square:a,variant:l}),d=mq(u);return O.jsx(gq,_({as:i,ownerState:u,className:Ce(d.root,o),ref:r},c))}),yq=vq;function bq(e){const{className:t,classes:r,pulsate:n=!1,rippleX:o,rippleY:i,rippleSize:s,in:a,onExited:l,timeout:c}=e,[u,d]=S.useState(!1),f=Ce(t,r.ripple,r.rippleVisible,n&&r.ripplePulsate),p={width:s,height:s,top:-(s/2)+i,left:-(s/2)+o},h=Ce(r.child,u&&r.childLeaving,n&&r.childPulsate);return!a&&!u&&d(!0),S.useEffect(()=>{if(!a&&l!=null){const m=setTimeout(l,c);return()=>{clearTimeout(m)}}},[l,a,c]),O.jsx("span",{className:f,style:p,children:O.jsx("span",{className:h})})}const xq=jt("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Sn=xq,kq=["center","classes","className"];let qm=e=>e,mS,gS,vS,yS;const tv=550,wq=80,Sq=db(mS||(mS=qm` 0% { transform: scale(0); opacity: 0.1; @@ -128,7 +128,7 @@ Error generating stack: `+i.message+` transform: scale(1); opacity: 0.3; } -`)),vq=cb(pS||(pS=Um` +`)),Eq=db(gS||(gS=qm` 0% { opacity: 1; } @@ -136,7 +136,7 @@ Error generating stack: `+i.message+` 100% { opacity: 0; } -`)),yq=cb(hS||(hS=Um` +`)),Cq=db(vS||(vS=qm` 0% { transform: scale(1); } @@ -148,7 +148,7 @@ Error generating stack: `+i.message+` 100% { transform: scale(1); } -`)),bq=Xe("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),xq=Xe(fq,{name:"MuiTouchRipple",slot:"Ripple"})(mS||(mS=Um` +`)),Mq=Xe("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),Tq=Xe(bq,{name:"MuiTouchRipple",slot:"Ripple"})(yS||(yS=qm` opacity: 0; position: absolute; @@ -191,7 +191,7 @@ Error generating stack: `+i.message+` animation-iteration-count: infinite; animation-delay: 200ms; } -`),wn.rippleVisible,gq,Q0,({theme:e})=>e.transitions.easing.easeInOut,wn.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,wn.child,wn.childLeaving,vq,Q0,({theme:e})=>e.transitions.easing.easeInOut,wn.childPulsate,yq,({theme:e})=>e.transitions.easing.easeInOut),kq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:s}=n,a=ve(n,hq),[l,c]=S.useState([]),u=S.useRef(0),d=S.useRef(null);S.useEffect(()=>{d.current&&(d.current(),d.current=null)},[l]);const f=S.useRef(!1),p=S.useRef(0),h=S.useRef(null),m=S.useRef(null);S.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const b=S.useCallback(x=>{const{pulsate:k,rippleX:w,rippleY:E,rippleSize:M,cb:C}=x;c(T=>[...T,O.jsx(xq,{classes:{ripple:Ce(i.ripple,wn.ripple),rippleVisible:Ce(i.rippleVisible,wn.rippleVisible),ripplePulsate:Ce(i.ripplePulsate,wn.ripplePulsate),child:Ce(i.child,wn.child),childLeaving:Ce(i.childLeaving,wn.childLeaving),childPulsate:Ce(i.childPulsate,wn.childPulsate)},timeout:Q0,pulsate:k,rippleX:w,rippleY:E,rippleSize:M},u.current)]),u.current+=1,d.current=C},[i]),v=S.useCallback((x={},k={},w=()=>{})=>{const{pulsate:E=!1,center:M=o||k.pulsate,fakeElement:C=!1}=k;if((x==null?void 0:x.type)==="mousedown"&&f.current){f.current=!1;return}(x==null?void 0:x.type)==="touchstart"&&(f.current=!0);const T=C?null:m.current,N=T?T.getBoundingClientRect():{width:0,height:0,left:0,top:0};let F,I,V;if(M||x===void 0||x.clientX===0&&x.clientY===0||!x.clientX&&!x.touches)F=Math.round(N.width/2),I=Math.round(N.height/2);else{const{clientX:j,clientY:z}=x.touches&&x.touches.length>0?x.touches[0]:x;F=Math.round(j-N.left),I=Math.round(z-N.top)}if(M)V=Math.sqrt((2*N.width**2+N.height**2)/3),V%2===0&&(V+=1);else{const j=Math.max(Math.abs((T?T.clientWidth:0)-F),F)*2+2,z=Math.max(Math.abs((T?T.clientHeight:0)-I),I)*2+2;V=Math.sqrt(j**2+z**2)}x!=null&&x.touches?h.current===null&&(h.current=()=>{b({pulsate:E,rippleX:F,rippleY:I,rippleSize:V,cb:w})},p.current=setTimeout(()=>{h.current&&(h.current(),h.current=null)},mq)):b({pulsate:E,rippleX:F,rippleY:I,rippleSize:V,cb:w})},[o,b]),g=S.useCallback(()=>{v({},{pulsate:!0})},[v]),y=S.useCallback((x,k)=>{if(clearTimeout(p.current),(x==null?void 0:x.type)==="touchend"&&h.current){h.current(),h.current=null,p.current=setTimeout(()=>{y(x,k)});return}h.current=null,c(w=>w.length>0?w.slice(1):w),d.current=k},[]);return S.useImperativeHandle(r,()=>({pulsate:g,start:v,stop:y}),[g,v,y]),O.jsx(bq,_({className:Ce(wn.root,i.root,s),ref:m},a,{children:O.jsx(iq,{component:null,exit:!0,children:l})}))}),wq=kq;function Sq(e){return Vt("MuiButtonBase",e)}const Eq=jt("MuiButtonBase",["root","disabled","focusVisible"]),Cq=Eq,Mq=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],Tq=e=>{const{disabled:t,focusVisible:r,focusVisibleClassName:n,classes:o}=e,s=tr({root:["root",t&&"disabled",r&&"focusVisible"]},Sq,o);return r&&n&&(s.root+=` ${n}`),s},Oq=Xe("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Cq.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),_q=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:s,className:a,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:d=!1,focusRipple:f=!1,LinkComponent:p="a",onBlur:h,onClick:m,onContextMenu:b,onDragLeave:v,onFocus:g,onFocusVisible:y,onKeyDown:x,onKeyUp:k,onMouseDown:w,onMouseLeave:E,onMouseUp:M,onTouchEnd:C,onTouchMove:T,onTouchStart:N,tabIndex:F=0,TouchRippleProps:I,touchRippleRef:V,type:j}=n,z=ve(n,Mq),q=S.useRef(null),A=S.useRef(null),P=Ur(A,V),{isFocusVisibleRef:B,onFocus:Y,onBlur:J,ref:Ne}=_T(),[ie,ue]=S.useState(!1);c&&ie&&ue(!1),S.useImperativeHandle(o,()=>({focusVisible:()=>{ue(!0),q.current.focus()}}),[]);const[de,he]=S.useState(!1);S.useEffect(()=>{he(!0)},[]);const Me=de&&!u&&!c;S.useEffect(()=>{ie&&f&&!u&&de&&A.current.pulsate()},[u,f,ie,de]);function Se(fe,yn,dc=d){return Ks(gi=>(yn&&yn(gi),!dc&&A.current&&A.current[fe](gi),!0))}const ft=Se("start",w),rt=Se("stop",b),Or=Se("stop",v),pe=Se("stop",M),De=Se("stop",fe=>{ie&&fe.preventDefault(),E&&E(fe)}),Ke=Se("start",N),Bn=Se("stop",C),qr=Se("stop",T),rr=Se("stop",fe=>{J(fe),B.current===!1&&ue(!1),h&&h(fe)},!1),zo=Ks(fe=>{q.current||(q.current=fe.currentTarget),Y(fe),B.current===!0&&(ue(!0),y&&y(fe)),g&&g(fe)}),Pt=()=>{const fe=q.current;return l&&l!=="button"&&!(fe.tagName==="A"&&fe.href)},Gr=S.useRef(!1),gn=Ks(fe=>{f&&!Gr.current&&ie&&A.current&&fe.key===" "&&(Gr.current=!0,A.current.stop(fe,()=>{A.current.start(fe)})),fe.target===fe.currentTarget&&Pt()&&fe.key===" "&&fe.preventDefault(),x&&x(fe),fe.target===fe.currentTarget&&Pt()&&fe.key==="Enter"&&!c&&(fe.preventDefault(),m&&m(fe))}),Fn=Ks(fe=>{f&&fe.key===" "&&A.current&&ie&&!fe.defaultPrevented&&(Gr.current=!1,A.current.stop(fe,()=>{A.current.pulsate(fe)})),k&&k(fe),m&&fe.target===fe.currentTarget&&Pt()&&fe.key===" "&&!fe.defaultPrevented&&m(fe)});let Qe=l;Qe==="button"&&(z.href||z.to)&&(Qe=p);const Yr={};Qe==="button"?(Yr.type=j===void 0?"button":j,Yr.disabled=c):(!z.href&&!z.to&&(Yr.role="button"),c&&(Yr["aria-disabled"]=c));const vn=Ur(r,Ne,q),mi=_({},n,{centerRipple:i,component:l,disabled:c,disableRipple:u,disableTouchRipple:d,focusRipple:f,tabIndex:F,focusVisible:ie}),Oa=Tq(mi);return O.jsxs(Oq,_({as:Qe,className:Ce(Oa.root,a),ownerState:mi,onBlur:rr,onClick:m,onContextMenu:rt,onFocus:zo,onKeyDown:gn,onKeyUp:Fn,onMouseDown:ft,onMouseLeave:De,onMouseUp:pe,onDragLeave:Or,onTouchEnd:Bn,onTouchMove:qr,onTouchStart:Ke,ref:vn,tabIndex:c?-1:F,type:j},Yr,z,{children:[s,Me?O.jsx(wq,_({ref:P,center:i},I)):null]}))}),Eb=_q;function Aq(e){return Vt("MuiIconButton",e)}const Nq=jt("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),Rq=Nq,Pq=["edge","children","className","color","disabled","disableFocusRipple","size"],zq=e=>{const{classes:t,disabled:r,color:n,edge:o,size:i}=e,s={root:["root",r&&"disabled",n!=="default"&&`color${Fe(n)}`,o&&`edge${Fe(o)}`,`size${Fe(i)}`]};return tr(s,Aq,t)},Lq=Xe(Eb,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.color!=="default"&&t[`color${Fe(r.color)}`],r.edge&&t[`edge${Fe(r.edge)}`],t[`size${Fe(r.size)}`]]}})(({theme:e,ownerState:t})=>_({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Lr(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12}),({theme:e,ownerState:t})=>{var r;const n=(r=(e.vars||e).palette)==null?void 0:r[t.color];return _({},t.color==="inherit"&&{color:"inherit"},t.color!=="inherit"&&t.color!=="default"&&_({color:n==null?void 0:n.main},!t.disableRipple&&{"&:hover":_({},n&&{backgroundColor:e.vars?`rgba(${n.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Lr(n.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),t.size==="small"&&{padding:5,fontSize:e.typography.pxToRem(18)},t.size==="large"&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${Rq.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})}),Iq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiIconButton"}),{edge:o=!1,children:i,className:s,color:a="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium"}=n,d=ve(n,Pq),f=_({},n,{edge:o,color:a,disabled:l,disableFocusRipple:c,size:u}),p=zq(f);return O.jsx(Lq,_({className:Ce(p.root,s),centerRipple:!0,focusRipple:!c,disabled:l,ref:r,ownerState:f},d,{children:i}))}),Dq=Iq;function $q(e){return Vt("MuiTypography",e)}jt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const Hq=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],Bq=e=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:o,variant:i,classes:s}=e,a={root:["root",i,e.align!=="inherit"&&`align${Fe(t)}`,r&&"gutterBottom",n&&"noWrap",o&&"paragraph"]};return tr(a,$q,s)},Fq=Xe("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.variant&&t[r.variant],r.align!=="inherit"&&t[`align${Fe(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>_({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&e.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),gS={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Vq={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},jq=e=>Vq[e]||e,Uq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiTypography"}),o=jq(n.color),i=vb(_({},n,{color:o})),{align:s="inherit",className:a,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:d=!1,variant:f="body1",variantMapping:p=gS}=i,h=ve(i,Hq),m=_({},i,{align:s,color:o,className:a,component:l,gutterBottom:c,noWrap:u,paragraph:d,variant:f,variantMapping:p}),b=l||(d?"p":p[f]||gS[f])||"span",v=Bq(m);return O.jsx(Fq,_({as:b,ref:r,ownerState:m,className:Ce(v.root,a)},h))}),lu=Uq;function u3(e){return typeof e=="string"}function cu(e,t,r){return e===void 0||u3(e)?t:_({},t,{ownerState:_({},t.ownerState,r)})}const Wq={disableDefaultClasses:!1},Kq=S.createContext(Wq);function qq(e){const{disableDefaultClasses:t}=S.useContext(Kq);return r=>t?"":e(r)}function d3(e,t=[]){if(e===void 0)return{};const r={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&typeof e[n]=="function"&&!t.includes(n)).forEach(n=>{r[n]=e[n]}),r}function Gq(e,t,r){return typeof e=="function"?e(t,r):e}function vS(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(r=>!(r.match(/^on[A-Z]/)&&typeof e[r]=="function")).forEach(r=>{t[r]=e[r]}),t}function Yq(e){const{getSlotProps:t,additionalProps:r,externalSlotProps:n,externalForwardedProps:o,className:i}=e;if(!t){const p=Ce(o==null?void 0:o.className,n==null?void 0:n.className,i,r==null?void 0:r.className),h=_({},r==null?void 0:r.style,o==null?void 0:o.style,n==null?void 0:n.style),m=_({},r,o,n);return p.length>0&&(m.className=p),Object.keys(h).length>0&&(m.style=h),{props:m,internalRef:void 0}}const s=d3(_({},o,n)),a=vS(n),l=vS(o),c=t(s),u=Ce(c==null?void 0:c.className,r==null?void 0:r.className,i,o==null?void 0:o.className,n==null?void 0:n.className),d=_({},c==null?void 0:c.style,r==null?void 0:r.style,o==null?void 0:o.style,n==null?void 0:n.style),f=_({},c,r,l,a);return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:c.ref}}const Jq=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function si(e){var t;const{elementType:r,externalSlotProps:n,ownerState:o,skipResolvingSlotProps:i=!1}=e,s=ve(e,Jq),a=i?{}:Gq(n,o),{props:l,internalRef:c}=Yq(_({},s,{externalSlotProps:a})),u=Ur(c,a==null?void 0:a.ref,(t=e.additionalProps)==null?void 0:t.ref);return cu(r,_({},l,{ref:u}),o)}function Xq(e){const{badgeContent:t,invisible:r=!1,max:n=99,showZero:o=!1}=e,i=NT({badgeContent:t,max:n});let s=r;r===!1&&t===0&&!o&&(s=!0);const{badgeContent:a,max:l=n}=s?i:e,c=a&&Number(a)>l?`${l}+`:a;return{badgeContent:a,invisible:s,max:l,displayValue:c}}const Qq=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Zq(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function eG(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=n=>e.ownerDocument.querySelector(`input[type="radio"]${n}`);let r=t(`[name="${e.name}"]:checked`);return r||(r=t(`[name="${e.name}"]`)),r!==e}function tG(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||eG(e))}function rG(e){const t=[],r=[];return Array.from(e.querySelectorAll(Qq)).forEach((n,o)=>{const i=Zq(n);i===-1||!tG(n)||(i===0?t.push(n):r.push({documentOrder:o,tabIndex:i,node:n}))}),r.sort((n,o)=>n.tabIndex===o.tabIndex?n.documentOrder-o.documentOrder:n.tabIndex-o.tabIndex).map(n=>n.node).concat(t)}function nG(){return!0}function oG(e){const{children:t,disableAutoFocus:r=!1,disableEnforceFocus:n=!1,disableRestoreFocus:o=!1,getTabbable:i=rG,isEnabled:s=nG,open:a}=e,l=S.useRef(!1),c=S.useRef(null),u=S.useRef(null),d=S.useRef(null),f=S.useRef(null),p=S.useRef(!1),h=S.useRef(null),m=Ur(t.ref,h),b=S.useRef(null);S.useEffect(()=>{!a||!h.current||(p.current=!r)},[r,a]),S.useEffect(()=>{if(!a||!h.current)return;const y=Br(h.current);return h.current.contains(y.activeElement)||(h.current.hasAttribute("tabIndex")||h.current.setAttribute("tabIndex","-1"),p.current&&h.current.focus()),()=>{o||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[a]),S.useEffect(()=>{if(!a||!h.current)return;const y=Br(h.current),x=E=>{b.current=E,!(n||!s()||E.key!=="Tab")&&y.activeElement===h.current&&E.shiftKey&&(l.current=!0,u.current&&u.current.focus())},k=()=>{const E=h.current;if(E===null)return;if(!y.hasFocus()||!s()||l.current){l.current=!1;return}if(E.contains(y.activeElement)||n&&y.activeElement!==c.current&&y.activeElement!==u.current)return;if(y.activeElement!==f.current)f.current=null;else if(f.current!==null)return;if(!p.current)return;let M=[];if((y.activeElement===c.current||y.activeElement===u.current)&&(M=i(h.current)),M.length>0){var C,T;const N=!!((C=b.current)!=null&&C.shiftKey&&((T=b.current)==null?void 0:T.key)==="Tab"),F=M[0],I=M[M.length-1];typeof F!="string"&&typeof I!="string"&&(N?I.focus():F.focus())}else E.focus()};y.addEventListener("focusin",k),y.addEventListener("keydown",x,!0);const w=setInterval(()=>{y.activeElement&&y.activeElement.tagName==="BODY"&&k()},50);return()=>{clearInterval(w),y.removeEventListener("focusin",k),y.removeEventListener("keydown",x,!0)}},[r,n,o,s,a,i]);const v=y=>{d.current===null&&(d.current=y.relatedTarget),p.current=!0,f.current=y.target;const x=t.props.onFocus;x&&x(y)},g=y=>{d.current===null&&(d.current=y.relatedTarget),p.current=!0};return O.jsxs(S.Fragment,{children:[O.jsx("div",{tabIndex:a?0:-1,onFocus:g,ref:c,"data-testid":"sentinelStart"}),S.cloneElement(t,{ref:m,onFocus:v}),O.jsx("div",{tabIndex:a?0:-1,onFocus:g,ref:u,"data-testid":"sentinelEnd"})]})}var Fr="top",Pn="bottom",zn="right",Vr="left",Cb="auto",Kd=[Fr,Pn,zn,Vr],Gl="start",md="end",iG="clippingParents",f3="viewport",Oc="popper",sG="reference",yS=Kd.reduce(function(e,t){return e.concat([t+"-"+Gl,t+"-"+md])},[]),p3=[].concat(Kd,[Cb]).reduce(function(e,t){return e.concat([t,t+"-"+Gl,t+"-"+md])},[]),aG="beforeRead",lG="read",cG="afterRead",uG="beforeMain",dG="main",fG="afterMain",pG="beforeWrite",hG="write",mG="afterWrite",gG=[aG,lG,cG,uG,dG,fG,pG,hG,mG];function No(e){return e?(e.nodeName||"").toLowerCase():null}function fn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function va(e){var t=fn(e).Element;return e instanceof t||e instanceof Element}function _n(e){var t=fn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Mb(e){if(typeof ShadowRoot>"u")return!1;var t=fn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function vG(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},o=t.attributes[r]||{},i=t.elements[r];!_n(i)||!No(i)||(Object.assign(i.style,n),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function yG(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var o=t.elements[n],i=t.attributes[n]||{},s=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),a=s.reduce(function(l,c){return l[c]="",l},{});!_n(o)||!No(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const bG={name:"applyStyles",enabled:!0,phase:"write",fn:vG,effect:yG,requires:["computeStyles"]};function Co(e){return e.split("-")[0]}var ta=Math.max,mh=Math.min,Yl=Math.round;function Z0(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function h3(){return!/^((?!chrome|android).)*safari/i.test(Z0())}function Jl(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),o=1,i=1;t&&_n(e)&&(o=e.offsetWidth>0&&Yl(n.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Yl(n.height)/e.offsetHeight||1);var s=va(e)?fn(e):window,a=s.visualViewport,l=!h3()&&r,c=(n.left+(l&&a?a.offsetLeft:0))/o,u=(n.top+(l&&a?a.offsetTop:0))/i,d=n.width/o,f=n.height/i;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function Tb(e){var t=Jl(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function m3(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Mb(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function ai(e){return fn(e).getComputedStyle(e)}function xG(e){return["table","td","th"].indexOf(No(e))>=0}function ks(e){return((va(e)?e.ownerDocument:e.document)||window.document).documentElement}function Wm(e){return No(e)==="html"?e:e.assignedSlot||e.parentNode||(Mb(e)?e.host:null)||ks(e)}function bS(e){return!_n(e)||ai(e).position==="fixed"?null:e.offsetParent}function kG(e){var t=/firefox/i.test(Z0()),r=/Trident/i.test(Z0());if(r&&_n(e)){var n=ai(e);if(n.position==="fixed")return null}var o=Wm(e);for(Mb(o)&&(o=o.host);_n(o)&&["html","body"].indexOf(No(o))<0;){var i=ai(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function qd(e){for(var t=fn(e),r=bS(e);r&&xG(r)&&ai(r).position==="static";)r=bS(r);return r&&(No(r)==="html"||No(r)==="body"&&ai(r).position==="static")?t:r||kG(e)||t}function Ob(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function _u(e,t,r){return ta(e,mh(t,r))}function wG(e,t,r){var n=_u(e,t,r);return n>r?r:n}function g3(){return{top:0,right:0,bottom:0,left:0}}function v3(e){return Object.assign({},g3(),e)}function y3(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var SG=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,v3(typeof t!="number"?t:y3(t,Kd))};function EG(e){var t,r=e.state,n=e.name,o=e.options,i=r.elements.arrow,s=r.modifiersData.popperOffsets,a=Co(r.placement),l=Ob(a),c=[Vr,zn].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var d=SG(o.padding,r),f=Tb(i),p=l==="y"?Fr:Vr,h=l==="y"?Pn:zn,m=r.rects.reference[u]+r.rects.reference[l]-s[l]-r.rects.popper[u],b=s[l]-r.rects.reference[l],v=qd(i),g=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,y=m/2-b/2,x=d[p],k=g-f[u]-d[h],w=g/2-f[u]/2+y,E=_u(x,w,k),M=l;r.modifiersData[n]=(t={},t[M]=E,t.centerOffset=E-w,t)}}function CG(e){var t=e.state,r=e.options,n=r.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||m3(t.elements.popper,o)&&(t.elements.arrow=o))}const MG={name:"arrow",enabled:!0,phase:"main",fn:EG,effect:CG,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Xl(e){return e.split("-")[1]}var TG={top:"auto",right:"auto",bottom:"auto",left:"auto"};function OG(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:Yl(r*o)/o||0,y:Yl(n*o)/o||0}}function xS(e){var t,r=e.popper,n=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=s.x,p=f===void 0?0:f,h=s.y,m=h===void 0?0:h,b=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=b.x,m=b.y;var v=s.hasOwnProperty("x"),g=s.hasOwnProperty("y"),y=Vr,x=Fr,k=window;if(c){var w=qd(r),E="clientHeight",M="clientWidth";if(w===fn(r)&&(w=ks(r),ai(w).position!=="static"&&a==="absolute"&&(E="scrollHeight",M="scrollWidth")),w=w,o===Fr||(o===Vr||o===zn)&&i===md){x=Pn;var C=d&&w===k&&k.visualViewport?k.visualViewport.height:w[E];m-=C-n.height,m*=l?1:-1}if(o===Vr||(o===Fr||o===Pn)&&i===md){y=zn;var T=d&&w===k&&k.visualViewport?k.visualViewport.width:w[M];p-=T-n.width,p*=l?1:-1}}var N=Object.assign({position:a},c&&TG),F=u===!0?OG({x:p,y:m},fn(r)):{x:p,y:m};if(p=F.x,m=F.y,l){var I;return Object.assign({},N,(I={},I[x]=g?"0":"",I[y]=v?"0":"",I.transform=(k.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",I))}return Object.assign({},N,(t={},t[x]=g?m+"px":"",t[y]=v?p+"px":"",t.transform="",t))}function _G(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=n===void 0?!0:n,i=r.adaptive,s=i===void 0?!0:i,a=r.roundOffsets,l=a===void 0?!0:a,c={placement:Co(t.placement),variation:Xl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,xS(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,xS(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const AG={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:_G,data:{}};var Sf={passive:!0};function NG(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,i=o===void 0?!0:o,s=n.resize,a=s===void 0?!0:s,l=fn(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",r.update,Sf)}),a&&l.addEventListener("resize",r.update,Sf),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",r.update,Sf)}),a&&l.removeEventListener("resize",r.update,Sf)}}const RG={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:NG,data:{}};var PG={left:"right",right:"left",bottom:"top",top:"bottom"};function fp(e){return e.replace(/left|right|bottom|top/g,function(t){return PG[t]})}var zG={start:"end",end:"start"};function kS(e){return e.replace(/start|end/g,function(t){return zG[t]})}function _b(e){var t=fn(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function Ab(e){return Jl(ks(e)).left+_b(e).scrollLeft}function LG(e,t){var r=fn(e),n=ks(e),o=r.visualViewport,i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=h3();(c||!c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+Ab(e),y:l}}function IG(e){var t,r=ks(e),n=_b(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=ta(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=ta(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-n.scrollLeft+Ab(e),l=-n.scrollTop;return ai(o||r).direction==="rtl"&&(a+=ta(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function Nb(e){var t=ai(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function b3(e){return["html","body","#document"].indexOf(No(e))>=0?e.ownerDocument.body:_n(e)&&Nb(e)?e:b3(Wm(e))}function Au(e,t){var r;t===void 0&&(t=[]);var n=b3(e),o=n===((r=e.ownerDocument)==null?void 0:r.body),i=fn(n),s=o?[i].concat(i.visualViewport||[],Nb(n)?n:[]):n,a=t.concat(s);return o?a:a.concat(Au(Wm(s)))}function ev(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function DG(e,t){var r=Jl(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function wS(e,t,r){return t===f3?ev(LG(e,r)):va(t)?DG(t,r):ev(IG(ks(e)))}function $G(e){var t=Au(Wm(e)),r=["absolute","fixed"].indexOf(ai(e).position)>=0,n=r&&_n(e)?qd(e):e;return va(n)?t.filter(function(o){return va(o)&&m3(o,n)&&No(o)!=="body"}):[]}function HG(e,t,r,n){var o=t==="clippingParents"?$G(e):[].concat(t),i=[].concat(o,[r]),s=i[0],a=i.reduce(function(l,c){var u=wS(e,c,n);return l.top=ta(u.top,l.top),l.right=mh(u.right,l.right),l.bottom=mh(u.bottom,l.bottom),l.left=ta(u.left,l.left),l},wS(e,s,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function x3(e){var t=e.reference,r=e.element,n=e.placement,o=n?Co(n):null,i=n?Xl(n):null,s=t.x+t.width/2-r.width/2,a=t.y+t.height/2-r.height/2,l;switch(o){case Fr:l={x:s,y:t.y-r.height};break;case Pn:l={x:s,y:t.y+t.height};break;case zn:l={x:t.x+t.width,y:a};break;case Vr:l={x:t.x-r.width,y:a};break;default:l={x:t.x,y:t.y}}var c=o?Ob(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case Gl:l[c]=l[c]-(t[u]/2-r[u]/2);break;case md:l[c]=l[c]+(t[u]/2-r[u]/2);break}}return l}function gd(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=n===void 0?e.placement:n,i=r.strategy,s=i===void 0?e.strategy:i,a=r.boundary,l=a===void 0?iG:a,c=r.rootBoundary,u=c===void 0?f3:c,d=r.elementContext,f=d===void 0?Oc:d,p=r.altBoundary,h=p===void 0?!1:p,m=r.padding,b=m===void 0?0:m,v=v3(typeof b!="number"?b:y3(b,Kd)),g=f===Oc?sG:Oc,y=e.rects.popper,x=e.elements[h?g:f],k=HG(va(x)?x:x.contextElement||ks(e.elements.popper),l,u,s),w=Jl(e.elements.reference),E=x3({reference:w,element:y,strategy:"absolute",placement:o}),M=ev(Object.assign({},y,E)),C=f===Oc?M:w,T={top:k.top-C.top+v.top,bottom:C.bottom-k.bottom+v.bottom,left:k.left-C.left+v.left,right:C.right-k.right+v.right},N=e.modifiersData.offset;if(f===Oc&&N){var F=N[o];Object.keys(T).forEach(function(I){var V=[zn,Pn].indexOf(I)>=0?1:-1,j=[Fr,Pn].indexOf(I)>=0?"y":"x";T[I]+=F[j]*V})}return T}function BG(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=r.boundary,i=r.rootBoundary,s=r.padding,a=r.flipVariations,l=r.allowedAutoPlacements,c=l===void 0?p3:l,u=Xl(n),d=u?a?yS:yS.filter(function(h){return Xl(h)===u}):Kd,f=d.filter(function(h){return c.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,m){return h[m]=gd(e,{placement:m,boundary:o,rootBoundary:i,padding:s})[Co(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function FG(e){if(Co(e)===Cb)return[];var t=fp(e);return[kS(e),t,kS(t)]}function VG(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,i=o===void 0?!0:o,s=r.altAxis,a=s===void 0?!0:s,l=r.fallbackPlacements,c=r.padding,u=r.boundary,d=r.rootBoundary,f=r.altBoundary,p=r.flipVariations,h=p===void 0?!0:p,m=r.allowedAutoPlacements,b=t.options.placement,v=Co(b),g=v===b,y=l||(g||!h?[fp(b)]:FG(b)),x=[b].concat(y).reduce(function(ie,ue){return ie.concat(Co(ue)===Cb?BG(t,{placement:ue,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):ue)},[]),k=t.rects.reference,w=t.rects.popper,E=new Map,M=!0,C=x[0],T=0;T=0,j=V?"width":"height",z=gd(t,{placement:N,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),q=V?I?zn:Vr:I?Pn:Fr;k[j]>w[j]&&(q=fp(q));var A=fp(q),P=[];if(i&&P.push(z[F]<=0),a&&P.push(z[q]<=0,z[A]<=0),P.every(function(ie){return ie})){C=N,M=!1;break}E.set(N,P)}if(M)for(var B=h?3:1,Y=function(ue){var de=x.find(function(he){var Me=E.get(he);if(Me)return Me.slice(0,ue).every(function(Se){return Se})});if(de)return C=de,"break"},J=B;J>0;J--){var Ne=Y(J);if(Ne==="break")break}t.placement!==C&&(t.modifiersData[n]._skip=!0,t.placement=C,t.reset=!0)}}const jG={name:"flip",enabled:!0,phase:"main",fn:VG,requiresIfExists:["offset"],data:{_skip:!1}};function SS(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function ES(e){return[Fr,zn,Pn,Vr].some(function(t){return e[t]>=0})}function UG(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=gd(t,{elementContext:"reference"}),a=gd(t,{altBoundary:!0}),l=SS(s,n),c=SS(a,o,i),u=ES(l),d=ES(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const WG={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:UG};function KG(e,t,r){var n=Co(e),o=[Vr,Fr].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Vr,zn].indexOf(n)>=0?{x:a,y:s}:{x:s,y:a}}function qG(e){var t=e.state,r=e.options,n=e.name,o=r.offset,i=o===void 0?[0,0]:o,s=p3.reduce(function(u,d){return u[d]=KG(d,t.rects,i),u},{}),a=s[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=s}const GG={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:qG};function YG(e){var t=e.state,r=e.name;t.modifiersData[r]=x3({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const JG={name:"popperOffsets",enabled:!0,phase:"read",fn:YG,data:{}};function XG(e){return e==="x"?"y":"x"}function QG(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,i=o===void 0?!0:o,s=r.altAxis,a=s===void 0?!1:s,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,d=r.padding,f=r.tether,p=f===void 0?!0:f,h=r.tetherOffset,m=h===void 0?0:h,b=gd(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=Co(t.placement),g=Xl(t.placement),y=!g,x=Ob(v),k=XG(x),w=t.modifiersData.popperOffsets,E=t.rects.reference,M=t.rects.popper,C=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,T=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,F={x:0,y:0};if(w){if(i){var I,V=x==="y"?Fr:Vr,j=x==="y"?Pn:zn,z=x==="y"?"height":"width",q=w[x],A=q+b[V],P=q-b[j],B=p?-M[z]/2:0,Y=g===Gl?E[z]:M[z],J=g===Gl?-M[z]:-E[z],Ne=t.elements.arrow,ie=p&&Ne?Tb(Ne):{width:0,height:0},ue=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:g3(),de=ue[V],he=ue[j],Me=_u(0,E[z],ie[z]),Se=y?E[z]/2-B-Me-de-T.mainAxis:Y-Me-de-T.mainAxis,ft=y?-E[z]/2+B+Me+he+T.mainAxis:J+Me+he+T.mainAxis,rt=t.elements.arrow&&qd(t.elements.arrow),Or=rt?x==="y"?rt.clientTop||0:rt.clientLeft||0:0,pe=(I=N==null?void 0:N[x])!=null?I:0,De=q+Se-pe-Or,Ke=q+ft-pe,Bn=_u(p?mh(A,De):A,q,p?ta(P,Ke):P);w[x]=Bn,F[x]=Bn-q}if(a){var qr,rr=x==="x"?Fr:Vr,zo=x==="x"?Pn:zn,Pt=w[k],Gr=k==="y"?"height":"width",gn=Pt+b[rr],Fn=Pt-b[zo],Qe=[Fr,Vr].indexOf(v)!==-1,Yr=(qr=N==null?void 0:N[k])!=null?qr:0,vn=Qe?gn:Pt-E[Gr]-M[Gr]-Yr+T.altAxis,mi=Qe?Pt+E[Gr]+M[Gr]-Yr-T.altAxis:Fn,Oa=p&&Qe?wG(vn,Pt,mi):_u(p?vn:gn,Pt,p?mi:Fn);w[k]=Oa,F[k]=Oa-Pt}t.modifiersData[n]=F}}const ZG={name:"preventOverflow",enabled:!0,phase:"main",fn:QG,requiresIfExists:["offset"]};function eY(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function tY(e){return e===fn(e)||!_n(e)?_b(e):eY(e)}function rY(e){var t=e.getBoundingClientRect(),r=Yl(t.width)/e.offsetWidth||1,n=Yl(t.height)/e.offsetHeight||1;return r!==1||n!==1}function nY(e,t,r){r===void 0&&(r=!1);var n=_n(t),o=_n(t)&&rY(t),i=ks(t),s=Jl(e,o,r),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&((No(t)!=="body"||Nb(i))&&(a=tY(t)),_n(t)?(l=Jl(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Ab(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function oY(e){var t=new Map,r=new Set,n=[];e.forEach(function(i){t.set(i.name,i)});function o(i){r.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!r.has(a)){var l=t.get(a);l&&o(l)}}),n.push(i)}return e.forEach(function(i){r.has(i.name)||o(i)}),n}function iY(e){var t=oY(e);return gG.reduce(function(r,n){return r.concat(t.filter(function(o){return o.phase===n}))},[])}function sY(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function aY(e){var t=e.reduce(function(r,n){var o=r[n.name];return r[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var CS={placement:"bottom",modifiers:[],strategy:"absolute"};function MS(){for(var e=arguments.length,t=new Array(e),r=0;r{i||a(dY(o)||document.body)},[o,i]),ha(()=>{if(s&&!i)return K0(r,s),()=>{K0(r,null)}},[r,s,i]),i){if(S.isValidElement(n)){const c={ref:l};return S.cloneElement(n,c)}return O.jsx(S.Fragment,{children:n})}return O.jsx(S.Fragment,{children:s&&om.createPortal(n,s)})});function fY(e){return Vt("MuiPopper",e)}jt("MuiPopper",["root"]);const pY=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],hY=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function mY(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function tv(e){return typeof e=="function"?e():e}function gY(e){return e.nodeType!==void 0}const vY=()=>tr({root:["root"]},qq(fY)),yY={},bY=S.forwardRef(function(t,r){var n;const{anchorEl:o,children:i,direction:s,disablePortal:a,modifiers:l,open:c,placement:u,popperOptions:d,popperRef:f,slotProps:p={},slots:h={},TransitionProps:m}=t,b=ve(t,pY),v=S.useRef(null),g=Ur(v,r),y=S.useRef(null),x=Ur(y,f),k=S.useRef(x);ha(()=>{k.current=x},[x]),S.useImperativeHandle(f,()=>y.current,[]);const w=mY(u,s),[E,M]=S.useState(w),[C,T]=S.useState(tv(o));S.useEffect(()=>{y.current&&y.current.forceUpdate()}),S.useEffect(()=>{o&&T(tv(o))},[o]),ha(()=>{if(!C||!c)return;const j=A=>{M(A.placement)};let z=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:A})=>{j(A)}}];l!=null&&(z=z.concat(l)),d&&d.modifiers!=null&&(z=z.concat(d.modifiers));const q=uY(C,v.current,_({placement:w},d,{modifiers:z}));return k.current(q),()=>{q.destroy(),k.current(null)}},[C,a,l,c,d,w]);const N={placement:E};m!==null&&(N.TransitionProps=m);const F=vY(),I=(n=h.root)!=null?n:"div",V=si({elementType:I,externalSlotProps:p.root,externalForwardedProps:b,additionalProps:{role:"tooltip",ref:g},ownerState:t,className:F.root});return O.jsx(I,_({},V,{children:typeof i=="function"?i(N):i}))}),xY=S.forwardRef(function(t,r){const{anchorEl:n,children:o,container:i,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:c,open:u,placement:d="bottom",popperOptions:f=yY,popperRef:p,style:h,transition:m=!1,slotProps:b={},slots:v={}}=t,g=ve(t,hY),[y,x]=S.useState(!0),k=()=>{x(!1)},w=()=>{x(!0)};if(!l&&!u&&(!m||y))return null;let E;if(i)E=i;else if(n){const T=tv(n);E=T&&gY(T)?Br(T).body:Br(null).body}const M=!u&&l&&(!m||y)?"none":void 0,C=m?{in:u,onEnter:k,onExited:w}:void 0;return O.jsx(k3,{disablePortal:a,container:E,children:O.jsx(bY,_({anchorEl:n,direction:s,disablePortal:a,modifiers:c,ref:r,open:m?!y:u,placement:d,popperOptions:f,popperRef:p,slotProps:b,slots:v},g,{style:_({position:"fixed",top:0,left:0,display:M},h),TransitionProps:C,children:o}))})});function kY(e){const t=Br(e);return t.body===e?dd(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function Nu(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function TS(e){return parseInt(dd(e).getComputedStyle(e).paddingRight,10)||0}function wY(e){const r=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,n=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return r||n}function OS(e,t,r,n,o){const i=[t,r,...n];[].forEach.call(e.children,s=>{const a=i.indexOf(s)===-1,l=!wY(s);a&&l&&Nu(s,o)})}function e1(e,t){let r=-1;return e.some((n,o)=>t(n)?(r=o,!0):!1),r}function SY(e,t){const r=[],n=e.container;if(!t.disableScrollLock){if(kY(n)){const s=AT(Br(n));r.push({value:n.style.paddingRight,property:"padding-right",el:n}),n.style.paddingRight=`${TS(n)+s}px`;const a=Br(n).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{r.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${TS(l)+s}px`})}let i;if(n.parentNode instanceof DocumentFragment)i=Br(n).body;else{const s=n.parentElement,a=dd(n);i=(s==null?void 0:s.nodeName)==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:n}r.push({value:i.style.overflow,property:"overflow",el:i},{value:i.style.overflowX,property:"overflow-x",el:i},{value:i.style.overflowY,property:"overflow-y",el:i}),i.style.overflow="hidden"}return()=>{r.forEach(({value:i,el:s,property:a})=>{i?s.style.setProperty(a,i):s.style.removeProperty(a)})}}function EY(e){const t=[];return[].forEach.call(e.children,r=>{r.getAttribute("aria-hidden")==="true"&&t.push(r)}),t}class CY{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,r){let n=this.modals.indexOf(t);if(n!==-1)return n;n=this.modals.length,this.modals.push(t),t.modalRef&&Nu(t.modalRef,!1);const o=EY(r);OS(r,t.mount,t.modalRef,o,!0);const i=e1(this.containers,s=>s.container===r);return i!==-1?(this.containers[i].modals.push(t),n):(this.containers.push({modals:[t],container:r,restore:null,hiddenSiblings:o}),n)}mount(t,r){const n=e1(this.containers,i=>i.modals.indexOf(t)!==-1),o=this.containers[n];o.restore||(o.restore=SY(o,r))}remove(t,r=!0){const n=this.modals.indexOf(t);if(n===-1)return n;const o=e1(this.containers,s=>s.modals.indexOf(t)!==-1),i=this.containers[o];if(i.modals.splice(i.modals.indexOf(t),1),this.modals.splice(n,1),i.modals.length===0)i.restore&&i.restore(),t.modalRef&&Nu(t.modalRef,r),OS(i.container,t.mount,t.modalRef,i.hiddenSiblings,!1),this.containers.splice(o,1);else{const s=i.modals[i.modals.length-1];s.modalRef&&Nu(s.modalRef,!1)}return n}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function MY(e){return typeof e=="function"?e():e}function TY(e){return e?e.props.hasOwnProperty("in"):!1}const OY=new CY;function _Y(e){const{container:t,disableEscapeKeyDown:r=!1,disableScrollLock:n=!1,manager:o=OY,closeAfterTransition:i=!1,onTransitionEnter:s,onTransitionExited:a,children:l,onClose:c,open:u,rootRef:d}=e,f=S.useRef({}),p=S.useRef(null),h=S.useRef(null),m=Ur(h,d),[b,v]=S.useState(!u),g=TY(l);let y=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(y=!1);const x=()=>Br(p.current),k=()=>(f.current.modalRef=h.current,f.current.mount=p.current,f.current),w=()=>{o.mount(k(),{disableScrollLock:n}),h.current&&(h.current.scrollTop=0)},E=Ks(()=>{const z=MY(t)||x().body;o.add(k(),z),h.current&&w()}),M=S.useCallback(()=>o.isTopModal(k()),[o]),C=Ks(z=>{p.current=z,z&&(u&&M()?w():h.current&&Nu(h.current,y))}),T=S.useCallback(()=>{o.remove(k(),y)},[y,o]);S.useEffect(()=>()=>{T()},[T]),S.useEffect(()=>{u?E():(!g||!i)&&T()},[u,T,g,i,E]);const N=z=>q=>{var A;(A=z.onKeyDown)==null||A.call(z,q),!(q.key!=="Escape"||!M())&&(r||(q.stopPropagation(),c&&c(q,"escapeKeyDown")))},F=z=>q=>{var A;(A=z.onClick)==null||A.call(z,q),q.target===q.currentTarget&&c&&c(q,"backdropClick")};return{getRootProps:(z={})=>{const q=d3(e);delete q.onTransitionEnter,delete q.onTransitionExited;const A=_({},q,z);return _({role:"presentation"},A,{onKeyDown:N(A),ref:m})},getBackdropProps:(z={})=>{const q=z;return _({"aria-hidden":!0},q,{onClick:F(q),open:u})},getTransitionProps:()=>{const z=()=>{v(!1),s&&s()},q=()=>{v(!0),a&&a(),i&&T()};return{onEnter:Hw(z,l==null?void 0:l.props.onEnter),onExited:Hw(q,l==null?void 0:l.props.onExited)}},rootRef:m,portalRef:C,isTopModal:M,exited:b,hasTransition:g}}const AY=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],NY=Xe(xY,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),RY=S.forwardRef(function(t,r){var n;const o=mb(),i=Wt({props:t,name:"MuiPopper"}),{anchorEl:s,component:a,components:l,componentsProps:c,container:u,disablePortal:d,keepMounted:f,modifiers:p,open:h,placement:m,popperOptions:b,popperRef:v,transition:g,slots:y,slotProps:x}=i,k=ve(i,AY),w=(n=y==null?void 0:y.root)!=null?n:l==null?void 0:l.Root,E=_({anchorEl:s,container:u,disablePortal:d,keepMounted:f,modifiers:p,open:h,placement:m,popperOptions:b,popperRef:v,transition:g},k);return O.jsx(NY,_({as:a,direction:o==null?void 0:o.direction,slots:{root:w},slotProps:x??c},E,{ref:r}))}),Rb=RY,PY=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],zY={entering:{opacity:1},entered:{opacity:1}},LY=S.forwardRef(function(t,r){const n=jm(),o={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:s=!0,children:a,easing:l,in:c,onEnter:u,onEntered:d,onEntering:f,onExit:p,onExited:h,onExiting:m,style:b,timeout:v=o,TransitionComponent:g=l3}=t,y=ve(t,PY),x=S.useRef(null),k=Ur(x,a.ref,r),w=V=>j=>{if(V){const z=x.current;j===void 0?V(z):V(z,j)}},E=w(f),M=w((V,j)=>{c3(V);const z=hh({style:b,timeout:v,easing:l},{mode:"enter"});V.style.webkitTransition=n.transitions.create("opacity",z),V.style.transition=n.transitions.create("opacity",z),u&&u(V,j)}),C=w(d),T=w(m),N=w(V=>{const j=hh({style:b,timeout:v,easing:l},{mode:"exit"});V.style.webkitTransition=n.transitions.create("opacity",j),V.style.transition=n.transitions.create("opacity",j),p&&p(V)}),F=w(h),I=V=>{i&&i(x.current,V)};return O.jsx(g,_({appear:s,in:c,nodeRef:x,onEnter:M,onEntered:C,onEntering:E,onExit:N,onExited:F,onExiting:T,addEndListener:I,timeout:v},y,{children:(V,j)=>S.cloneElement(a,_({style:_({opacity:0,visibility:V==="exited"&&!c?"hidden":void 0},zY[V],b,a.props.style),ref:k},j))}))}),IY=LY;function DY(e){return Vt("MuiBackdrop",e)}jt("MuiBackdrop",["root","invisible"]);const $Y=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],HY=e=>{const{classes:t,invisible:r}=e;return tr({root:["root",r&&"invisible"]},DY,t)},BY=Xe("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.invisible&&t.invisible]}})(({ownerState:e})=>_({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),FY=S.forwardRef(function(t,r){var n,o,i;const s=Wt({props:t,name:"MuiBackdrop"}),{children:a,className:l,component:c="div",components:u={},componentsProps:d={},invisible:f=!1,open:p,slotProps:h={},slots:m={},TransitionComponent:b=IY,transitionDuration:v}=s,g=ve(s,$Y),y=_({},s,{component:c,invisible:f}),x=HY(y),k=(n=h.root)!=null?n:d.root;return O.jsx(b,_({in:p,timeout:v},g,{children:O.jsx(BY,_({"aria-hidden":!0},k,{as:(o=(i=m.root)!=null?i:u.Root)!=null?o:c,className:Ce(x.root,l,k==null?void 0:k.className),ownerState:_({},y,k==null?void 0:k.ownerState),classes:x,ref:r,children:a}))}))}),VY=FY;function jY(e){return Vt("MuiBadge",e)}const UY=jt("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),bi=UY,WY=["anchorOrigin","className","classes","component","components","componentsProps","children","overlap","color","invisible","max","badgeContent","slots","slotProps","showZero","variant"],t1=10,r1=4,KY=e=>{const{color:t,anchorOrigin:r,invisible:n,overlap:o,variant:i,classes:s={}}=e,a={root:["root"],badge:["badge",i,n&&"invisible",`anchorOrigin${Fe(r.vertical)}${Fe(r.horizontal)}`,`anchorOrigin${Fe(r.vertical)}${Fe(r.horizontal)}${Fe(o)}`,`overlap${Fe(o)}`,t!=="default"&&`color${Fe(t)}`]};return tr(a,jY,s)},qY=Xe("span",{name:"MuiBadge",slot:"Root",overridesResolver:(e,t)=>t.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),GY=Xe("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.badge,t[r.variant],t[`anchorOrigin${Fe(r.anchorOrigin.vertical)}${Fe(r.anchorOrigin.horizontal)}${Fe(r.overlap)}`],r.color!=="default"&&t[`color${Fe(r.color)}`],r.invisible&&t.invisible]}})(({theme:e,ownerState:t})=>_({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:t1*2,lineHeight:1,padding:"0 6px",height:t1*2,borderRadius:t1,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen})},t.color!=="default"&&{backgroundColor:(e.vars||e).palette[t.color].main,color:(e.vars||e).palette[t.color].contrastText},t.variant==="dot"&&{borderRadius:r1,height:r1*2,minWidth:r1*2,padding:0},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular"&&{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular"&&{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular"&&{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular"&&{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular"&&{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular"&&{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular"&&{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular"&&{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}},t.invisible&&{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})})),YY=S.forwardRef(function(t,r){var n,o,i,s,a,l;const c=Wt({props:t,name:"MuiBadge"}),{anchorOrigin:u={vertical:"top",horizontal:"right"},className:d,component:f,components:p={},componentsProps:h={},children:m,overlap:b="rectangular",color:v="default",invisible:g=!1,max:y=99,badgeContent:x,slots:k,slotProps:w,showZero:E=!1,variant:M="standard"}=c,C=ve(c,WY),{badgeContent:T,invisible:N,max:F,displayValue:I}=Xq({max:y,invisible:g,badgeContent:x,showZero:E}),V=NT({anchorOrigin:u,color:v,overlap:b,variant:M,badgeContent:x}),j=N||T==null&&M!=="dot",{color:z=v,overlap:q=b,anchorOrigin:A=u,variant:P=M}=j?V:c,B=P!=="dot"?I:void 0,Y=_({},c,{badgeContent:T,invisible:j,max:F,displayValue:B,showZero:E,anchorOrigin:A,color:z,overlap:q,variant:P}),J=KY(Y),Ne=(n=(o=k==null?void 0:k.root)!=null?o:p.Root)!=null?n:qY,ie=(i=(s=k==null?void 0:k.badge)!=null?s:p.Badge)!=null?i:GY,ue=(a=w==null?void 0:w.root)!=null?a:h.root,de=(l=w==null?void 0:w.badge)!=null?l:h.badge,he=si({elementType:Ne,externalSlotProps:ue,externalForwardedProps:C,additionalProps:{ref:r,as:f},ownerState:Y,className:Ce(ue==null?void 0:ue.className,J.root,d)}),Me=si({elementType:ie,externalSlotProps:de,ownerState:Y,className:Ce(J.badge,de==null?void 0:de.className)});return O.jsxs(Ne,_({},he,{children:[m,O.jsx(ie,_({},Me,{children:B}))]}))}),JY=YY,XY=bb(),QY=jW({themeId:Kl,defaultTheme:XY,defaultClassName:"MuiBox-root",generateClassName:PT.generate}),w3=QY;function ZY(e){return Vt("MuiModal",e)}jt("MuiModal",["root","hidden","backdrop"]);const eJ=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],tJ=e=>{const{open:t,exited:r,classes:n}=e;return tr({root:["root",!t&&r&&"hidden"],backdrop:["backdrop"]},ZY,n)},rJ=Xe("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.open&&r.exited&&t.hidden]}})(({theme:e,ownerState:t})=>_({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),nJ=Xe(VY,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),oJ=S.forwardRef(function(t,r){var n,o,i,s,a,l;const c=Wt({name:"MuiModal",props:t}),{BackdropComponent:u=nJ,BackdropProps:d,className:f,closeAfterTransition:p=!1,children:h,container:m,component:b,components:v={},componentsProps:g={},disableAutoFocus:y=!1,disableEnforceFocus:x=!1,disableEscapeKeyDown:k=!1,disablePortal:w=!1,disableRestoreFocus:E=!1,disableScrollLock:M=!1,hideBackdrop:C=!1,keepMounted:T=!1,onBackdropClick:N,open:F,slotProps:I,slots:V}=c,j=ve(c,eJ),z=_({},c,{closeAfterTransition:p,disableAutoFocus:y,disableEnforceFocus:x,disableEscapeKeyDown:k,disablePortal:w,disableRestoreFocus:E,disableScrollLock:M,hideBackdrop:C,keepMounted:T}),{getRootProps:q,getBackdropProps:A,getTransitionProps:P,portalRef:B,isTopModal:Y,exited:J,hasTransition:Ne}=_Y(_({},z,{rootRef:r})),ie=_({},z,{exited:J}),ue=tJ(ie),de={};if(h.props.tabIndex===void 0&&(de.tabIndex="-1"),Ne){const{onEnter:pe,onExited:De}=P();de.onEnter=pe,de.onExited=De}const he=(n=(o=V==null?void 0:V.root)!=null?o:v.Root)!=null?n:rJ,Me=(i=(s=V==null?void 0:V.backdrop)!=null?s:v.Backdrop)!=null?i:u,Se=(a=I==null?void 0:I.root)!=null?a:g.root,ft=(l=I==null?void 0:I.backdrop)!=null?l:g.backdrop,rt=si({elementType:he,externalSlotProps:Se,externalForwardedProps:j,getSlotProps:q,additionalProps:{ref:r,as:b},ownerState:ie,className:Ce(f,Se==null?void 0:Se.className,ue==null?void 0:ue.root,!ie.open&&ie.exited&&(ue==null?void 0:ue.hidden))}),Or=si({elementType:Me,externalSlotProps:ft,additionalProps:d,getSlotProps:pe=>A(_({},pe,{onClick:De=>{N&&N(De),pe!=null&&pe.onClick&&pe.onClick(De)}})),className:Ce(ft==null?void 0:ft.className,d==null?void 0:d.className,ue==null?void 0:ue.backdrop),ownerState:ie});return!T&&!F&&(!Ne||J)?null:O.jsx(k3,{ref:B,container:m,disablePortal:w,children:O.jsxs(he,_({},rt,{children:[!C&&u?O.jsx(Me,_({},Or)):null,O.jsx(oG,{disableEnforceFocus:x,disableAutoFocus:y,disableRestoreFocus:E,isEnabled:Y,open:F,children:S.cloneElement(h,de)})]}))})}),iJ=oJ,sJ=jt("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),_S=sJ,aJ=kK({createStyledComponent:Xe("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>Wt({props:e,name:"MuiStack"})}),lJ=aJ,cJ=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function rv(e){return`scale(${e}, ${e**2})`}const uJ={entering:{opacity:1,transform:rv(1)},entered:{opacity:1,transform:"none"}},n1=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),S3=S.forwardRef(function(t,r){const{addEndListener:n,appear:o=!0,children:i,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:d,onExited:f,onExiting:p,style:h,timeout:m="auto",TransitionComponent:b=l3}=t,v=ve(t,cJ),g=S.useRef(),y=S.useRef(),x=jm(),k=S.useRef(null),w=Ur(k,i.ref,r),E=j=>z=>{if(j){const q=k.current;z===void 0?j(q):j(q,z)}},M=E(u),C=E((j,z)=>{c3(j);const{duration:q,delay:A,easing:P}=hh({style:h,timeout:m,easing:s},{mode:"enter"});let B;m==="auto"?(B=x.transitions.getAutoHeightDuration(j.clientHeight),y.current=B):B=q,j.style.transition=[x.transitions.create("opacity",{duration:B,delay:A}),x.transitions.create("transform",{duration:n1?B:B*.666,delay:A,easing:P})].join(","),l&&l(j,z)}),T=E(c),N=E(p),F=E(j=>{const{duration:z,delay:q,easing:A}=hh({style:h,timeout:m,easing:s},{mode:"exit"});let P;m==="auto"?(P=x.transitions.getAutoHeightDuration(j.clientHeight),y.current=P):P=z,j.style.transition=[x.transitions.create("opacity",{duration:P,delay:q}),x.transitions.create("transform",{duration:n1?P:P*.666,delay:n1?q:q||P*.333,easing:A})].join(","),j.style.opacity=0,j.style.transform=rv(.75),d&&d(j)}),I=E(f),V=j=>{m==="auto"&&(g.current=setTimeout(j,y.current||0)),n&&n(k.current,j)};return S.useEffect(()=>()=>{clearTimeout(g.current)},[]),O.jsx(b,_({appear:o,in:a,nodeRef:k,onEnter:C,onEntered:T,onEntering:M,onExit:F,onExited:I,onExiting:N,addEndListener:V,timeout:m==="auto"?null:m},v,{children:(j,z)=>S.cloneElement(i,_({style:_({opacity:0,transform:rv(.75),visibility:j==="exited"&&!a?"hidden":void 0},uJ[j],h,i.props.style),ref:w},z))}))});S3.muiSupportAuto=!0;const nv=S3,dJ=S.createContext({}),vd=dJ;function fJ(e){return Vt("MuiList",e)}jt("MuiList",["root","padding","dense","subheader"]);const pJ=["children","className","component","dense","disablePadding","subheader"],hJ=e=>{const{classes:t,disablePadding:r,dense:n,subheader:o}=e;return tr({root:["root",!r&&"padding",n&&"dense",o&&"subheader"]},fJ,t)},mJ=Xe("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disablePadding&&t.padding,r.dense&&t.dense,r.subheader&&t.subheader]}})(({ownerState:e})=>_({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),gJ=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiList"}),{children:o,className:i,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:c}=n,u=ve(n,pJ),d=S.useMemo(()=>({dense:a}),[a]),f=_({},n,{component:s,dense:a,disablePadding:l}),p=hJ(f);return O.jsx(vd.Provider,{value:d,children:O.jsxs(mJ,_({as:s,className:Ce(p.root,i),ref:r,ownerState:f},u,{children:[c,o]}))})}),vJ=gJ;function yJ(e){return Vt("MuiListItemIcon",e)}const bJ=jt("MuiListItemIcon",["root","alignItemsFlexStart"]),AS=bJ,xJ=["className"],kJ=e=>{const{alignItems:t,classes:r}=e;return tr({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},yJ,r)},wJ=Xe("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(({theme:e,ownerState:t})=>_({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex"},t.alignItems==="flex-start"&&{marginTop:8})),SJ=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiListItemIcon"}),{className:o}=n,i=ve(n,xJ),s=S.useContext(vd),a=_({},n,{alignItems:s.alignItems}),l=kJ(a);return O.jsx(wJ,_({className:Ce(l.root,o),ownerState:a,ref:r},i))}),EJ=SJ;function CJ(e){return Vt("MuiListItemText",e)}const MJ=jt("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),gh=MJ,TJ=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],OJ=e=>{const{classes:t,inset:r,primary:n,secondary:o,dense:i}=e;return tr({root:["root",r&&"inset",i&&"dense",n&&o&&"multiline"],primary:["primary"],secondary:["secondary"]},CJ,t)},_J=Xe("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${gh.primary}`]:t.primary},{[`& .${gh.secondary}`]:t.secondary},t.root,r.inset&&t.inset,r.primary&&r.secondary&&t.multiline,r.dense&&t.dense]}})(({ownerState:e})=>_({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},e.primary&&e.secondary&&{marginTop:6,marginBottom:6},e.inset&&{paddingLeft:56})),AJ=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiListItemText"}),{children:o,className:i,disableTypography:s=!1,inset:a=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:d}=n,f=ve(n,TJ),{dense:p}=S.useContext(vd);let h=l??o,m=u;const b=_({},n,{disableTypography:s,inset:a,primary:!!h,secondary:!!m,dense:p}),v=OJ(b);return h!=null&&h.type!==lu&&!s&&(h=O.jsx(lu,_({variant:p?"body2":"body1",className:v.primary,component:c!=null&&c.variant?void 0:"span",display:"block"},c,{children:h}))),m!=null&&m.type!==lu&&!s&&(m=O.jsx(lu,_({variant:"body2",className:v.secondary,color:"text.secondary",display:"block"},d,{children:m}))),O.jsxs(_J,_({className:Ce(v.root,i),ownerState:b,ref:r},f,{children:[h,m]}))}),NJ=AJ,RJ=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function o1(e,t,r){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:r?null:e.firstChild}function NS(e,t,r){return e===t?r?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:r?null:e.lastChild}function E3(e,t){if(t===void 0)return!0;let r=e.innerText;return r===void 0&&(r=e.textContent),r=r.trim().toLowerCase(),r.length===0?!1:t.repeating?r[0]===t.keys[0]:r.indexOf(t.keys.join(""))===0}function _c(e,t,r,n,o,i){let s=!1,a=o(e,t,t?r:!1);for(;a;){if(a===e.firstChild){if(s)return!1;s=!0}const l=n?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!E3(a,i)||l)a=o(e,a,r);else return a.focus(),!0}return!1}const PJ=S.forwardRef(function(t,r){const{actions:n,autoFocus:o=!1,autoFocusItem:i=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:d="selectedMenu"}=t,f=ve(t,RJ),p=S.useRef(null),h=S.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});ha(()=>{o&&p.current.focus()},[o]),S.useImperativeHandle(n,()=>({adjustStyleForScrollbar:(y,x)=>{const k=!p.current.style.width;if(y.clientHeight{const x=p.current,k=y.key,w=Br(x).activeElement;if(k==="ArrowDown")y.preventDefault(),_c(x,w,c,l,o1);else if(k==="ArrowUp")y.preventDefault(),_c(x,w,c,l,NS);else if(k==="Home")y.preventDefault(),_c(x,null,c,l,o1);else if(k==="End")y.preventDefault(),_c(x,null,c,l,NS);else if(k.length===1){const E=h.current,M=k.toLowerCase(),C=performance.now();E.keys.length>0&&(C-E.lastTime>500?(E.keys=[],E.repeating=!0,E.previousKeyMatched=!0):E.repeating&&M!==E.keys[0]&&(E.repeating=!1)),E.lastTime=C,E.keys.push(M);const T=w&&!E.repeating&&E3(w,E);E.previousKeyMatched&&(T||_c(x,w,!1,l,o1,E))?y.preventDefault():E.previousKeyMatched=!1}u&&u(y)},b=Ur(p,r);let v=-1;S.Children.forEach(s,(y,x)=>{if(!S.isValidElement(y)){v===x&&(v+=1,v>=s.length&&(v=-1));return}y.props.disabled||(d==="selectedMenu"&&y.props.selected||v===-1)&&(v=x),v===x&&(y.props.disabled||y.props.muiSkipListHighlight||y.type.muiSkipListHighlight)&&(v+=1,v>=s.length&&(v=-1))});const g=S.Children.map(s,(y,x)=>{if(x===v){const k={};return i&&(k.autoFocus=!0),y.props.tabIndex===void 0&&d==="selectedMenu"&&(k.tabIndex=0),S.cloneElement(y,k)}return y});return O.jsx(vJ,_({role:"menu",ref:b,className:a,onKeyDown:m,tabIndex:o?0:-1},f,{children:g}))}),zJ=PJ;function LJ(e){return Vt("MuiPopover",e)}jt("MuiPopover",["root","paper"]);const IJ=["onEntering"],DJ=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],$J=["slotProps"];function RS(e,t){let r=0;return typeof t=="number"?r=t:t==="center"?r=e.height/2:t==="bottom"&&(r=e.height),r}function PS(e,t){let r=0;return typeof t=="number"?r=t:t==="center"?r=e.width/2:t==="right"&&(r=e.width),r}function zS(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function i1(e){return typeof e=="function"?e():e}const HJ=e=>{const{classes:t}=e;return tr({root:["root"],paper:["paper"]},LJ,t)},BJ=Xe(iJ,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),C3=Xe(dq,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),FJ=S.forwardRef(function(t,r){var n,o,i;const s=Wt({props:t,name:"MuiPopover"}),{action:a,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:d="anchorEl",children:f,className:p,container:h,elevation:m=8,marginThreshold:b=16,open:v,PaperProps:g={},slots:y,slotProps:x,transformOrigin:k={vertical:"top",horizontal:"left"},TransitionComponent:w=nv,transitionDuration:E="auto",TransitionProps:{onEntering:M}={},disableScrollLock:C=!1}=s,T=ve(s.TransitionProps,IJ),N=ve(s,DJ),F=(n=x==null?void 0:x.paper)!=null?n:g,I=S.useRef(),V=Ur(I,F.ref),j=_({},s,{anchorOrigin:c,anchorReference:d,elevation:m,marginThreshold:b,externalPaperSlotProps:F,transformOrigin:k,TransitionComponent:w,transitionDuration:E,TransitionProps:T}),z=HJ(j),q=S.useCallback(()=>{if(d==="anchorPosition")return u;const pe=i1(l),Ke=(pe&&pe.nodeType===1?pe:Br(I.current).body).getBoundingClientRect();return{top:Ke.top+RS(Ke,c.vertical),left:Ke.left+PS(Ke,c.horizontal)}},[l,c.horizontal,c.vertical,u,d]),A=S.useCallback(pe=>({vertical:RS(pe,k.vertical),horizontal:PS(pe,k.horizontal)}),[k.horizontal,k.vertical]),P=S.useCallback(pe=>{const De={width:pe.offsetWidth,height:pe.offsetHeight},Ke=A(De);if(d==="none")return{top:null,left:null,transformOrigin:zS(Ke)};const Bn=q();let qr=Bn.top-Ke.vertical,rr=Bn.left-Ke.horizontal;const zo=qr+De.height,Pt=rr+De.width,Gr=dd(i1(l)),gn=Gr.innerHeight-b,Fn=Gr.innerWidth-b;if(b!==null&&qrgn){const Qe=zo-gn;qr-=Qe,Ke.vertical+=Qe}if(b!==null&&rrFn){const Qe=Pt-Fn;rr-=Qe,Ke.horizontal+=Qe}return{top:`${Math.round(qr)}px`,left:`${Math.round(rr)}px`,transformOrigin:zS(Ke)}},[l,d,q,A,b]),[B,Y]=S.useState(v),J=S.useCallback(()=>{const pe=I.current;if(!pe)return;const De=P(pe);De.top!==null&&(pe.style.top=De.top),De.left!==null&&(pe.style.left=De.left),pe.style.transformOrigin=De.transformOrigin,Y(!0)},[P]);S.useEffect(()=>(C&&window.addEventListener("scroll",J),()=>window.removeEventListener("scroll",J)),[l,C,J]);const Ne=(pe,De)=>{M&&M(pe,De),J()},ie=()=>{Y(!1)};S.useEffect(()=>{v&&J()}),S.useImperativeHandle(a,()=>v?{updatePosition:()=>{J()}}:null,[v,J]),S.useEffect(()=>{if(!v)return;const pe=Tj(()=>{J()}),De=dd(l);return De.addEventListener("resize",pe),()=>{pe.clear(),De.removeEventListener("resize",pe)}},[l,v,J]);let ue=E;E==="auto"&&!w.muiSupportAuto&&(ue=void 0);const de=h||(l?Br(i1(l)).body:void 0),he=(o=y==null?void 0:y.root)!=null?o:BJ,Me=(i=y==null?void 0:y.paper)!=null?i:C3,Se=si({elementType:Me,externalSlotProps:_({},F,{style:B?F.style:_({},F.style,{opacity:0})}),additionalProps:{elevation:m,ref:V},ownerState:j,className:Ce(z.paper,F==null?void 0:F.className)}),ft=si({elementType:he,externalSlotProps:(x==null?void 0:x.root)||{},externalForwardedProps:N,additionalProps:{ref:r,slotProps:{backdrop:{invisible:!0}},container:de,open:v},ownerState:j,className:Ce(z.root,p)}),{slotProps:rt}=ft,Or=ve(ft,$J);return O.jsx(he,_({},Or,!u3(he)&&{slotProps:rt,disableScrollLock:C},{children:O.jsx(w,_({appear:!0,in:v,onEntering:Ne,onExited:ie,timeout:ue},T,{children:O.jsx(Me,_({},Se,{children:f}))}))}))}),VJ=FJ;function jJ(e){return Vt("MuiMenu",e)}jt("MuiMenu",["root","paper","list"]);const UJ=["onEntering"],WJ=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],KJ={vertical:"top",horizontal:"right"},qJ={vertical:"top",horizontal:"left"},GJ=e=>{const{classes:t}=e;return tr({root:["root"],paper:["paper"],list:["list"]},jJ,t)},YJ=Xe(VJ,{shouldForwardProp:e=>kb(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),JJ=Xe(C3,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),XJ=Xe(zJ,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),QJ=S.forwardRef(function(t,r){var n,o;const i=Wt({props:t,name:"MuiMenu"}),{autoFocus:s=!0,children:a,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:d,open:f,PaperProps:p={},PopoverClasses:h,transitionDuration:m="auto",TransitionProps:{onEntering:b}={},variant:v="selectedMenu",slots:g={},slotProps:y={}}=i,x=ve(i.TransitionProps,UJ),k=ve(i,WJ),w=jm(),E=w.direction==="rtl",M=_({},i,{autoFocus:s,disableAutoFocusItem:c,MenuListProps:u,onEntering:b,PaperProps:p,transitionDuration:m,TransitionProps:x,variant:v}),C=GJ(M),T=s&&!c&&f,N=S.useRef(null),F=(P,B)=>{N.current&&N.current.adjustStyleForScrollbar(P,w),b&&b(P,B)},I=P=>{P.key==="Tab"&&(P.preventDefault(),d&&d(P,"tabKeyDown"))};let V=-1;S.Children.map(a,(P,B)=>{S.isValidElement(P)&&(P.props.disabled||(v==="selectedMenu"&&P.props.selected||V===-1)&&(V=B))});const j=(n=g.paper)!=null?n:JJ,z=(o=y.paper)!=null?o:p,q=si({elementType:g.root,externalSlotProps:y.root,ownerState:M,className:[C.root,l]}),A=si({elementType:j,externalSlotProps:z,ownerState:M,className:C.paper});return O.jsx(YJ,_({onClose:d,anchorOrigin:{vertical:"bottom",horizontal:E?"right":"left"},transformOrigin:E?KJ:qJ,slots:{paper:j,root:g.root},slotProps:{root:q,paper:A},open:f,ref:r,transitionDuration:m,TransitionProps:_({onEntering:F},x),ownerState:M},k,{classes:h,children:O.jsx(XJ,_({onKeyDown:I,actions:N,autoFocus:s&&(V===-1||c),autoFocusItem:T,variant:v},u,{className:Ce(C.list,u.className),children:a}))}))}),ZJ=QJ;function eX(e){return Vt("MuiMenuItem",e)}const tX=jt("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),Ac=tX,rX=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],nX=(e,t)=>{const{ownerState:r}=e;return[t.root,r.dense&&t.dense,r.divider&&t.divider,!r.disableGutters&&t.gutters]},oX=e=>{const{disabled:t,dense:r,divider:n,disableGutters:o,selected:i,classes:s}=e,l=tr({root:["root",r&&"dense",t&&"disabled",!o&&"gutters",n&&"divider",i&&"selected"]},eX,s);return _({},s,l)},iX=Xe(Eb,{shouldForwardProp:e=>kb(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:nX})(({theme:e,ownerState:t})=>_({},e.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Ac.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${Ac.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${Ac.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${Ac.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Ac.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${_S.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${_S.inset}`]:{marginLeft:52},[`& .${gh.root}`]:{marginTop:0,marginBottom:0},[`& .${gh.inset}`]:{paddingLeft:36},[`& .${AS.root}`]:{minWidth:36}},!t.dense&&{[e.breakpoints.up("sm")]:{minHeight:"auto"}},t.dense&&_({minHeight:32,paddingTop:4,paddingBottom:4},e.typography.body2,{[`& .${AS.root} svg`]:{fontSize:"1.25rem"}}))),sX=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:i="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:d,className:f}=n,p=ve(n,rX),h=S.useContext(vd),m=S.useMemo(()=>({dense:s||h.dense||!1,disableGutters:l}),[h.dense,s,l]),b=S.useRef(null);ha(()=>{o&&b.current&&b.current.focus()},[o]);const v=_({},n,{dense:m.dense,divider:a,disableGutters:l}),g=oX(n),y=Ur(b,r);let x;return n.disabled||(x=d!==void 0?d:-1),O.jsx(vd.Provider,{value:m,children:O.jsx(iX,_({ref:y,role:u,tabIndex:x,component:i,focusVisibleClassName:Ce(g.focusVisible,c),className:Ce(g.root,f)},p,{ownerState:v,classes:g}))})}),aX=sX;function lX(e){return Vt("MuiTooltip",e)}const cX=jt("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),Hi=cX,uX=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function dX(e){return Math.round(e*1e5)/1e5}const fX=e=>{const{classes:t,disableInteractive:r,arrow:n,touch:o,placement:i}=e,s={popper:["popper",!r&&"popperInteractive",n&&"popperArrow"],tooltip:["tooltip",n&&"tooltipArrow",o&&"touch",`tooltipPlacement${Fe(i.split("-")[0])}`],arrow:["arrow"]};return tr(s,lX,t)},pX=Xe(Rb,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.popper,!r.disableInteractive&&t.popperInteractive,r.arrow&&t.popperArrow,!r.open&&t.popperClose]}})(({theme:e,ownerState:t,open:r})=>_({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none"},!t.disableInteractive&&{pointerEvents:"auto"},!r&&{pointerEvents:"none"},t.arrow&&{[`&[data-popper-placement*="bottom"] .${Hi.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Hi.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Hi.arrow}`]:_({},t.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${Hi.arrow}`]:_({},t.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),hX=Xe("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.tooltip,r.touch&&t.touch,r.arrow&&t.tooltipArrow,t[`tooltipPlacement${Fe(r.placement.split("-")[0])}`]]}})(({theme:e,ownerState:t})=>_({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:Lr(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},t.arrow&&{position:"relative",margin:0},t.touch&&{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${dX(16/14)}em`,fontWeight:e.typography.fontWeightRegular},{[`.${Hi.popper}[data-popper-placement*="left"] &`]:_({transformOrigin:"right center"},t.isRtl?_({marginLeft:"14px"},t.touch&&{marginLeft:"24px"}):_({marginRight:"14px"},t.touch&&{marginRight:"24px"})),[`.${Hi.popper}[data-popper-placement*="right"] &`]:_({transformOrigin:"left center"},t.isRtl?_({marginRight:"14px"},t.touch&&{marginRight:"24px"}):_({marginLeft:"14px"},t.touch&&{marginLeft:"24px"})),[`.${Hi.popper}[data-popper-placement*="top"] &`]:_({transformOrigin:"center bottom",marginBottom:"14px"},t.touch&&{marginBottom:"24px"}),[`.${Hi.popper}[data-popper-placement*="bottom"] &`]:_({transformOrigin:"center top",marginTop:"14px"},t.touch&&{marginTop:"24px"})})),mX=Xe("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:Lr(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let Ef=!1,s1=null,Nc={x:0,y:0};function Cf(e,t){return r=>{t&&t(r),e(r)}}const gX=S.forwardRef(function(t,r){var n,o,i,s,a,l,c,u,d,f,p,h,m,b,v,g,y,x,k;const w=Wt({props:t,name:"MuiTooltip"}),{arrow:E=!1,children:M,components:C={},componentsProps:T={},describeChild:N=!1,disableFocusListener:F=!1,disableHoverListener:I=!1,disableInteractive:V=!1,disableTouchListener:j=!1,enterDelay:z=100,enterNextDelay:q=0,enterTouchDelay:A=700,followCursor:P=!1,id:B,leaveDelay:Y=0,leaveTouchDelay:J=1500,onClose:Ne,onOpen:ie,open:ue,placement:de="bottom",PopperComponent:he,PopperProps:Me={},slotProps:Se={},slots:ft={},title:rt,TransitionComponent:Or=nv,TransitionProps:pe}=w,De=ve(w,uX),Ke=S.isValidElement(M)?M:O.jsx("span",{children:M}),Bn=jm(),qr=Bn.direction==="rtl",[rr,zo]=S.useState(),[Pt,Gr]=S.useState(null),gn=S.useRef(!1),Fn=V||P,Qe=S.useRef(),Yr=S.useRef(),vn=S.useRef(),mi=S.useRef(),[Oa,fe]=Nj({controlled:ue,default:!1,name:"Tooltip",state:"open"});let yn=Oa;const dc=Aj(B),gi=S.useRef(),fc=S.useCallback(()=>{gi.current!==void 0&&(document.body.style.WebkitUserSelect=gi.current,gi.current=void 0),clearTimeout(mi.current)},[]);S.useEffect(()=>()=>{clearTimeout(Qe.current),clearTimeout(Yr.current),clearTimeout(vn.current),fc()},[fc]);const Ox=ke=>{clearTimeout(s1),Ef=!0,fe(!0),ie&&!yn&&ie(ke)},Qd=Ks(ke=>{clearTimeout(s1),s1=setTimeout(()=>{Ef=!1},800+Y),fe(!1),Ne&&yn&&Ne(ke),clearTimeout(Qe.current),Qe.current=setTimeout(()=>{gn.current=!1},Bn.transitions.duration.shortest)}),Jm=ke=>{gn.current&&ke.type!=="touchstart"||(rr&&rr.removeAttribute("title"),clearTimeout(Yr.current),clearTimeout(vn.current),z||Ef&&q?Yr.current=setTimeout(()=>{Ox(ke)},Ef?q:z):Ox(ke))},_x=ke=>{clearTimeout(Yr.current),clearTimeout(vn.current),vn.current=setTimeout(()=>{Qd(ke)},Y)},{isFocusVisibleRef:Ax,onBlur:FO,onFocus:VO,ref:jO}=_T(),[,Nx]=S.useState(!1),Rx=ke=>{FO(ke),Ax.current===!1&&(Nx(!1),_x(ke))},Px=ke=>{rr||zo(ke.currentTarget),VO(ke),Ax.current===!0&&(Nx(!0),Jm(ke))},zx=ke=>{gn.current=!0;const Jr=Ke.props;Jr.onTouchStart&&Jr.onTouchStart(ke)},Lx=Jm,Ix=_x,UO=ke=>{zx(ke),clearTimeout(vn.current),clearTimeout(Qe.current),fc(),gi.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",mi.current=setTimeout(()=>{document.body.style.WebkitUserSelect=gi.current,Jm(ke)},A)},WO=ke=>{Ke.props.onTouchEnd&&Ke.props.onTouchEnd(ke),fc(),clearTimeout(vn.current),vn.current=setTimeout(()=>{Qd(ke)},J)};S.useEffect(()=>{if(!yn)return;function ke(Jr){(Jr.key==="Escape"||Jr.key==="Esc")&&Qd(Jr)}return document.addEventListener("keydown",ke),()=>{document.removeEventListener("keydown",ke)}},[Qd,yn]);const KO=Ur(Ke.ref,jO,zo,r);!rt&&rt!==0&&(yn=!1);const Xm=S.useRef(),qO=ke=>{const Jr=Ke.props;Jr.onMouseMove&&Jr.onMouseMove(ke),Nc={x:ke.clientX,y:ke.clientY},Xm.current&&Xm.current.update()},pc={},Qm=typeof rt=="string";N?(pc.title=!yn&&Qm&&!I?rt:null,pc["aria-describedby"]=yn?dc:null):(pc["aria-label"]=Qm?rt:null,pc["aria-labelledby"]=yn&&!Qm?dc:null);const Vn=_({},pc,De,Ke.props,{className:Ce(De.className,Ke.props.className),onTouchStart:zx,ref:KO},P?{onMouseMove:qO}:{}),hc={};j||(Vn.onTouchStart=UO,Vn.onTouchEnd=WO),I||(Vn.onMouseOver=Cf(Lx,Vn.onMouseOver),Vn.onMouseLeave=Cf(Ix,Vn.onMouseLeave),Fn||(hc.onMouseOver=Lx,hc.onMouseLeave=Ix)),F||(Vn.onFocus=Cf(Px,Vn.onFocus),Vn.onBlur=Cf(Rx,Vn.onBlur),Fn||(hc.onFocus=Px,hc.onBlur=Rx));const GO=S.useMemo(()=>{var ke;let Jr=[{name:"arrow",enabled:!!Pt,options:{element:Pt,padding:4}}];return(ke=Me.popperOptions)!=null&&ke.modifiers&&(Jr=Jr.concat(Me.popperOptions.modifiers)),_({},Me.popperOptions,{modifiers:Jr})},[Pt,Me]),mc=_({},w,{isRtl:qr,arrow:E,disableInteractive:Fn,placement:de,PopperComponentProp:he,touch:gn.current}),Zm=fX(mc),Dx=(n=(o=ft.popper)!=null?o:C.Popper)!=null?n:pX,$x=(i=(s=(a=ft.transition)!=null?a:C.Transition)!=null?s:Or)!=null?i:nv,Hx=(l=(c=ft.tooltip)!=null?c:C.Tooltip)!=null?l:hX,Bx=(u=(d=ft.arrow)!=null?d:C.Arrow)!=null?u:mX,YO=cu(Dx,_({},Me,(f=Se.popper)!=null?f:T.popper,{className:Ce(Zm.popper,Me==null?void 0:Me.className,(p=(h=Se.popper)!=null?h:T.popper)==null?void 0:p.className)}),mc),JO=cu($x,_({},pe,(m=Se.transition)!=null?m:T.transition),mc),XO=cu(Hx,_({},(b=Se.tooltip)!=null?b:T.tooltip,{className:Ce(Zm.tooltip,(v=(g=Se.tooltip)!=null?g:T.tooltip)==null?void 0:v.className)}),mc),QO=cu(Bx,_({},(y=Se.arrow)!=null?y:T.arrow,{className:Ce(Zm.arrow,(x=(k=Se.arrow)!=null?k:T.arrow)==null?void 0:x.className)}),mc);return O.jsxs(S.Fragment,{children:[S.cloneElement(Ke,Vn),O.jsx(Dx,_({as:he??Rb,placement:de,anchorEl:P?{getBoundingClientRect:()=>({top:Nc.y,left:Nc.x,right:Nc.x,bottom:Nc.y,width:0,height:0})}:rr,popperRef:Xm,open:rr?yn:!1,id:dc,transition:!0},hc,YO,{popperOptions:GO,children:({TransitionProps:ke})=>O.jsx($x,_({timeout:Bn.transitions.duration.shorter},ke,JO,{children:O.jsxs(Hx,_({},XO,{children:[rt,E?O.jsx(Bx,_({},QO,{ref:Gr})):null]}))}))}))]})}),M3=gX;function vX(e){return Vt("MuiToggleButton",e)}const yX=jt("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge"]),LS=yX,bX=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],xX=e=>{const{classes:t,fullWidth:r,selected:n,disabled:o,size:i,color:s}=e,a={root:["root",n&&"selected",o&&"disabled",r&&"fullWidth",`size${Fe(i)}`,s]};return tr(a,vX,t)},kX=Xe(Eb,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`size${Fe(r.size)}`]]}})(({theme:e,ownerState:t})=>{let r=t.color==="standard"?e.palette.text.primary:e.palette[t.color].main,n;return e.vars&&(r=t.color==="standard"?e.vars.palette.text.primary:e.vars.palette[t.color].main,n=t.color==="standard"?e.vars.palette.text.primaryChannel:e.vars.palette[t.color].mainChannel),_({},e.typography.button,{borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active},t.fullWidth&&{width:"100%"},{[`&.${LS.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Lr(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${LS.selected}`]:{color:r,backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:Lr(r,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${n} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Lr(r,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:Lr(r,e.palette.action.selectedOpacity)}}}},t.size==="small"&&{padding:7,fontSize:e.typography.pxToRem(13)},t.size==="large"&&{padding:15,fontSize:e.typography.pxToRem(15)})}),wX=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiToggleButton"}),{children:o,className:i,color:s="standard",disabled:a=!1,disableFocusRipple:l=!1,fullWidth:c=!1,onChange:u,onClick:d,selected:f,size:p="medium",value:h}=n,m=ve(n,bX),b=_({},n,{color:s,disabled:a,disableFocusRipple:l,fullWidth:c,size:p}),v=xX(b),g=y=>{d&&(d(y,h),y.defaultPrevented)||u&&u(y,h)};return O.jsx(kX,_({className:Ce(v.root,i),disabled:a,focusRipple:!l,ref:r,onClick:g,onChange:u,value:h,ownerState:b,"aria-pressed":f},m,{children:o}))}),SX=wX;var EX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 15v2c0 1.054.95 2 2 2h3v2H7a4 4 0 0 1-4-4v-2h2zm13-5l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16 10h2zm-1 2.885L15.753 16h2.492L17 12.885zM3 3h6a3 3 0 0 1 2.235 5A3 3 0 0 1 9 13H3V3zm6 6H5v2h4a1 1 0 0 0 0-2zm8-6a4 4 0 0 1 4 4v2h-2V7a2 2 0 0 0-2-2h-3V3h3zM9 5H5v2h4a1 1 0 1 0 0-2z"}}],CX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"}}],MX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"}}],TX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0zm-8.66 16h15.588L12 5.5 4.206 19zM11 16h2v2h-2v-2zm0-7h2v5h-2V9z"}}],OX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 19h18v2H3v-2zm5-6h3l-4 4-4-4h3V3h2v10zm10 0h3l-4 4-4-4h3V3h2v10z"}}],_X=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm2 15h14v2H5v-2zm-2-5h18v2H3v-2zm2-5h14v2H5V9z"}}],AX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm0-5h18v2H3v-2zm0-5h18v2H3V9z"}}],NX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h14v2H3v-2zm0-5h18v2H3v-2zm0-5h14v2H3V9z"}}],RX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm4 15h14v2H7v-2zm-4-5h18v2H3v-2zm4-5h14v2H7V9z"}}],PX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3h18v2H3V3zm5 8v10H6V11H3l4-4 4 4H8zm10 0v10h-2V11h-3l4-4 4 4h-3z"}}],zX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 11h18v2H3v-2zm15 7v3h-2v-3h-3l4-4 4 4h-3zM8 18v3H6v-3H3l4-4 4 4H8zM18 6h3l-4 4-4-4h3V3h2v3zM8 6h3l-4 4-4-4h3V3h2v3z"}}],LX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6.75 2.5A4.25 4.25 0 0 1 11 6.75V11H6.75a4.25 4.25 0 1 1 0-8.5zM9 9V6.75A2.25 2.25 0 1 0 6.75 9H9zm-2.25 4H11v4.25A4.25 4.25 0 1 1 6.75 13zm0 2A2.25 2.25 0 1 0 9 17.25V15H6.75zm10.5-12.5a4.25 4.25 0 1 1 0 8.5H13V6.75a4.25 4.25 0 0 1 4.25-4.25zm0 6.5A2.25 2.25 0 1 0 15 6.75V9h2.25zM13 13h4.25A4.25 4.25 0 1 1 13 17.25V13zm2 2v2.25A2.25 2.25 0 1 0 17.25 15H15z"}}],IX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 16l-6-6h12z"}}],DX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 7v4L2 6l6-5v4h5a8 8 0 1 1 0 16H4v-2h9a6 6 0 1 0 0-12H8z"}}],$X=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 7h-5a6 6 0 1 0 0 12h9v2h-9a8 8 0 1 1 0-16h5V1l6 5-6 5V7z"}}],HX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 12l6-6v12z"}}],BX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 12l-6 6V6z"}}],FX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 8l6 6H6z"}}],VX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 3v7.267l6.294-3.633 1 1.732-6.293 3.633 6.293 3.635-1 1.732L13 13.732V21h-2v-7.268l-6.294 3.634-1-1.732L9.999 12 3.706 8.366l1-1.732L11 10.267V3z"}}],jX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.828 7.757l-5.656 5.657a1 1 0 1 0 1.414 1.414l5.657-5.656A3 3 0 1 0 12 4.929l-5.657 5.657a5 5 0 1 0 7.071 7.07L19.071 12l1.414 1.414-5.657 5.657a7 7 0 1 1-9.9-9.9l5.658-5.656a5 5 0 0 1 7.07 7.07L12 16.244A3 3 0 1 1 7.757 12l5.657-5.657 1.414 1.414z"}}],UX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 11h4.5a2.5 2.5 0 1 0 0-5H8v5zm10 4.5a4.5 4.5 0 0 1-4.5 4.5H6V4h6.5a4.5 4.5 0 0 1 3.256 7.606A4.498 4.498 0 0 1 18 15.5zM8 13v5h5.5a2.5 2.5 0 1 0 0-5H8z"}}],WX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12 2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3zm16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5z"}}],KX=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M14 3c.552 0 1 .448 1 1v5h5c.552 0 1 .448 1 1v10c0 .552-.448 1-1 1H10c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h10zm-1 2H5v8h8V5z"}}],qX=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M11 3c.552 0 1 .448 1 1v2h5c.552 0 1 .448 1 1v5h2c.552 0 1 .448 1 1v7c0 .552-.448 1-1 1h-7c-.552 0-1-.448-1-1v-2H7c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h7zm5 5H8v8h8V8z"}}],GX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 3v2H4v13.385L5.763 17H20v-7h2v8a1 1 0 0 1-1 1H6.455L2 22.5V4a1 1 0 0 1 1-1h11zm5 0V0h2v3h3v2h-3v3h-2V5h-3V3h3z"}}],YX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-.997-4L6.76 11.757l1.414-1.414 2.829 2.829 5.656-5.657 1.415 1.414L11.003 16z"}}],JX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M7 7V3a1 1 0 0 1 1-1h13a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-4v3.993c0 .556-.449 1.007-1.007 1.007H3.007A1.006 1.006 0 0 1 2 20.993l.003-12.986C2.003 7.451 2.452 7 3.01 7H7zm2 0h6.993C16.549 7 17 7.449 17 8.007V15h3V4H9v3zm6 2H4.003L4 20h11V9zm-6.497 9l-3.536-3.536 1.414-1.414 2.122 2.122 4.242-4.243 1.414 1.414L8.503 18z"}}],XX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6 4v4h12V4h2.007c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 21.007V4.993C3 4.445 3.445 4 3.993 4H6zm2-2h8v4H8V2z"}}],QX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 4V2h10v2h3.007c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 21.007V4.993C3 4.445 3.445 4 3.993 4H7zm0 2H5v14h14V6h-2v2H7V6zm2-2v2h6V4H9z"}}],ZX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm0-9.414l2.828-2.829 1.415 1.415L13.414 12l2.829 2.828-1.415 1.415L12 13.414l-2.828 2.829-1.415-1.415L10.586 12 7.757 9.172l1.415-1.415L12 10.586z"}}],eQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"}}],tQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"}}],rQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M23 12l-7.071 7.071-1.414-1.414L20.172 12l-5.657-5.657 1.414-1.414L23 12zM3.828 12l5.657 5.657-1.414 1.414L1 12l7.071-7.071 1.414 1.414L3.828 12z"}}],nQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16.95 8.464l1.414-1.414 4.95 4.95-4.95 4.95-1.414-1.414L20.485 12 16.95 8.464zm-9.9 0L3.515 12l3.535 3.536-1.414 1.414L.686 12l4.95-4.95L7.05 8.464z"}}],oQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 6h5v2h-2v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8H2V6h5V3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v3zm-8 5v6h2v-6H9zm4 0v6h2v-6h-2zM9 4v2h6V4H9z"}}],iQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 6h5v2h-2v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8H2V6h5V3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v3zm1 2H6v12h12V8zm-9 3h2v6H9v-6zm4 0h2v6h-2v-6zM9 4v2h6V4H9z"}}],sQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 3c.552 0 1 .448 1 1v8c.835-.628 1.874-1 3-1 2.761 0 5 2.239 5 5s-2.239 5-5 5c-1.032 0-1.99-.313-2.787-.848L13 20c0 .552-.448 1-1 1H6c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zm-1 2H7v14h4V5zm8 10h-6v2h6v-2z"}}],aQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 5c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1 .628.835 1 1.874 1 3 0 2.761-2.239 5-5 5s-5-2.239-5-5c0-1.126.372-2.165 1-3H4c-.552 0-1-.448-1-1V6c0-.552.448-1 1-1h16zm-7 10v2h6v-2h-6zm6-8H5v4h14V7z"}}],lQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4.583 17.321C3.553 16.227 3 15 3 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179zm10 0C13.553 16.227 13 15 13 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179z"}}],cQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19.417 6.679C20.447 7.773 21 9 21 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311-1.804-.167-3.226-1.648-3.226-3.489a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179zm-10 0C10.447 7.773 11 9 11 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311C4.591 12.322 3.17 10.841 3.17 9a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179z"}}],uQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 19h16v-7h2v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-8h2v7zM14 9h5l-7 7-7-7h5V3h4v6z"}}],dQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M16 13l6.964 4.062-2.973.85 2.125 3.681-1.732 1-2.125-3.68-2.223 2.15L16 13zm-2-7h2v2h5a1 1 0 0 1 1 1v4h-2v-3H10v10h4v2H9a1 1 0 0 1-1-1v-5H6v-2h2V9a1 1 0 0 1 1-1h5V6zM4 14v2H2v-2h2zm0-4v2H2v-2h2zm0-4v2H2V6h2zm0-4v2H2V2h2zm4 0v2H6V2h2zm4 0v2h-2V2h2zm4 0v2h-2V2h2z"}}],fQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 19a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm-5.5 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm11 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zM13 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.621 6.302 14.685 14.685 0 0 0 5.327 3.042l-.536 1.93A16.685 16.685 0 0 1 12 13.726a16.696 16.696 0 0 1-6.202 3.547l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042 18.077 18.077 0 0 1-2.822-4.3h2.24A16.031 16.031 0 0 0 12 10.876a16.168 16.168 0 0 0 2.91-4.876L5 6V4h6V2h2z"}}],pQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 19a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm-5.5 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm11 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zM18 3v2H8v4h9v2H8v4h10v2H6V3h12z"}}],hQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 10h2v.757a4.5 4.5 0 0 1 7 3.743V20h-2v-5.5c0-1.43-1.175-2.5-2.5-2.5S16 13.07 16 14.5V20h-2V10zm-2-6v2H4v5h8v2H4v5h8v2H2V4h10z"}}],mQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-1-5h2v2h-2v-2zm0-8h2v6h-2V7z"}}],gQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm11-3v9l-3.794-3.793-5.999 6-1.414-1.414 5.999-6L12 3h9z"}}],vQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1.001 1.001 0 0 1 3 21l.003-14c0-.552.45-1 1.007-1H7zM5.003 8L5 20h10V8H5.003zM9 6h8v10h2V4H9v2z"}}],yQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M6 21.5c-1.933 0-3.5-1.567-3.5-3.5s1.567-3.5 3.5-3.5c1.585 0 2.924 1.054 3.355 2.5H15v-2h2V9.242L14.757 7H9V9H3V3h6v2h5.757L18 1.756 22.243 6 19 9.241V15L21 15v6h-6v-2H9.355c-.43 1.446-1.77 2.5-3.355 2.5zm0-5c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5zm13 .5h-2v2h2v-2zM18 4.586L16.586 6 18 7.414 19.414 6 18 4.586zM7 5H5v2h2V5z"}}],bQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.246 14H8.754l-1.6 4H5l6-15h2l6 15h-2.154l-1.6-4zm-.8-2L12 5.885 9.554 12h4.892zM3 20h18v2H3v-2z"}}],xQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6v15H8V6H2V4h14v2h-6zm8 8v7h-2v-7h-3v-2h8v2h-3z"}}],kQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"}}],wQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12.651 14.065L11.605 20H9.574l1.35-7.661-7.41-7.41L4.93 3.515 20.485 19.07l-1.414 1.414-6.42-6.42zm-.878-6.535l.27-1.53h-1.8l-2-2H20v2h-5.927L13.5 9.257 11.773 7.53z"}}],SQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z"}}],EQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 3h2v6h-2V5h-4V3h4zM4 3h4v2H4v4H2V3h2zm16 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z"}}],CQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 18l7.68-6L5 6V4h14v2H8.263L16 12l-7.737 6H19v2H5v-2z"}}],MQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 1v4H4v14h16V3h1.008c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3H6V1h2zm4 7l4 4h-3v4h-2v-4H8l4-4zm6-7v4h-8V3h6V1h2z"}}],TQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M13 20h-2v-7H4v7H2V4h2v7h7V4h2v16zm8-12v12h-2v-9.796l-2 .536V8.67L19.5 8H21z"}}],OQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 4c2.071 0 3.75 1.679 3.75 3.75 0 .857-.288 1.648-.772 2.28l-.148.18L18.034 18H22v2h-7v-1.556l4.82-5.546c.268-.307.43-.709.43-1.148 0-.966-.784-1.75-1.75-1.75-.918 0-1.671.707-1.744 1.606l-.006.144h-2C14.75 9.679 16.429 8 18.5 8z"}}],_Q=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M22 8l-.002 2-2.505 2.883c1.59.435 2.757 1.89 2.757 3.617 0 2.071-1.679 3.75-3.75 3.75-1.826 0-3.347-1.305-3.682-3.033l1.964-.382c.156.806.866 1.415 1.718 1.415.966 0 1.75-.784 1.75-1.75s-.784-1.75-1.75-1.75c-.286 0-.556.069-.794.19l-1.307-1.547L19.35 10H15V8h7zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2z"}}],AQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M13 20h-2v-7H4v7H2V4h2v7h7V4h2v16zm9-12v8h1.5v2H22v2h-2v-2h-5.5v-1.34l5-8.66H22zm-2 3.133L17.19 16H20v-4.867z"}}],NQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M22 8v2h-4.323l-.464 2.636c.33-.089.678-.136 1.037-.136 2.21 0 4 1.79 4 4s-1.79 4-4 4c-1.827 0-3.367-1.224-3.846-2.897l1.923-.551c.24.836 1.01 1.448 1.923 1.448 1.105 0 2-.895 2-2s-.895-2-2-2c-.63 0-1.193.292-1.56.748l-1.81-.904L16 8h6zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2z"}}],RQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21.097 8l-2.598 4.5c2.21 0 4.001 1.79 4.001 4s-1.79 4-4 4-4-1.79-4-4c0-.736.199-1.426.546-2.019L18.788 8h2.309zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 10.5c-1.105 0-2 .895-2 2s.895 2 2 2 2-.895 2-2-.895-2-2-2z"}}],PQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7.784 14l.42-4H4V8h4.415l.525-5h2.011l-.525 5h3.989l.525-5h2.011l-.525 5H20v2h-3.784l-.42 4H20v2h-4.415l-.525 5h-2.011l.525-5H9.585l-.525 5H7.049l.525-5H4v-2h3.784zm2.011 0h3.99l.42-4h-3.99l-.42 4z"}}],zQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 11V4h2v17h-2v-8H7v8H5V4h2v7z"}}],LQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 15v3h3v2h-3v3h-2v-3h-3v-2h3v-3h2zm.008-12c.548 0 .992.445.992.993V13h-2V5H4v13.999L14 9l3 3v2.829l-3-3L6.827 19H14v2H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016zM8 7a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"}}],IQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v1.757l-2 2V5H5v8.1l4-4 4.328 4.329-1.415 1.413L9 11.93l-4 3.999V19h10.533l.708.001 1.329-1.33L18.9 19h.1v-2.758l2-2V20c0 .552-.448 1-1 1H4c-.55 0-1-.45-1-1V4c0-.552.448-1 1-1h16zm1.778 4.808l1.414 1.414L15.414 17l-1.416-.002.002-1.412 7.778-7.778zM15.5 7c.828 0 1.5.672 1.5 1.5s-.672 1.5-1.5 1.5S14 9.328 14 8.5 14.672 7 15.5 7z"}}],DQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4.828 21l-.02.02-.021-.02H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H4.828zM20 15V5H4v14L14 9l6 6zm0 2.828l-6-6L6.828 19H20v-1.172zM8 11a2 2 0 1 1 0-4 2 2 0 0 1 0 4z"}}],$Q=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm8-5h10v2H11v-2zm0-5h10v2H11V9zm-8 3.5L7 9v7l-4-3.5z"}}],HQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm8-5h10v2H11v-2zm0-5h10v2H11V9zm-4 3.5L3 16V9l4 3.5z"}}],BQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM11 7h2v2h-2V7zm0 4h2v6h-2v-6z"}}],FQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 21v-2h3V5H8V3h8v2h-3v14h3v2H8zM18.05 7.05L23 12l-4.95 4.95-1.414-1.414L20.172 12l-3.536-3.536L18.05 7.05zm-12.1 0l1.414 1.414L3.828 12l3.536 3.536L5.95 16.95 1 12l4.95-4.95z"}}],VQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zm-1 2h-4v14h4V5zM6 7c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2H5v1.999L3 11v2l2-.001V15h2v-2.001L9 13v-2l-2-.001V9z"}}],jQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M10 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zM9 5H5v14h4V5zm9 2c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L15 11v2l2-.001V15h2v-2.001L21 13v-2l-2-.001V9z"}}],UQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 13c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L9 17v2l2-.001V21h2v-2.001L15 19v-2l-2-.001V15zm7-12c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zM5 5v4h14V5H5z"}}],WQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 13c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1v-6c0-.552.448-1 1-1h16zm-1 2H5v4h14v-4zM12 1c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L9 5v2l2-.001V9h2V6.999L15 7V5l-2-.001V3z"}}],KQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 20H7v-2h2.927l2.116-12H9V4h8v2h-2.927l-2.116 12H15z"}}],qQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M11 5H5v14h6V5zm2 0v14h6V5h-6zM4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],GQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 4h10v2H11V4zM6 7v4H4V7H1l4-4 4 4H6zm0 10h3l-4 4-4-4h3v-4h2v4zm5 1h10v2H11v-2zm-2-7h12v2H9v-2z"}}],YQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.657 14.828l-1.414-1.414L17.657 12A4 4 0 1 0 12 6.343l-1.414 1.414-1.414-1.414 1.414-1.414a6 6 0 0 1 8.485 8.485l-1.414 1.414zm-2.829 2.829l-1.414 1.414a6 6 0 1 1-8.485-8.485l1.414-1.414 1.414 1.414L6.343 12A4 4 0 1 0 12 17.657l1.414-1.414 1.414 1.414zm0-9.9l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],JQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.657 14.828l-1.414-1.414L17.657 12A4 4 0 1 0 12 6.343l-1.414 1.414-1.414-1.414 1.414-1.414a6 6 0 0 1 8.485 8.485l-1.414 1.414zm-2.829 2.829l-1.414 1.414a6 6 0 1 1-8.485-8.485l1.414-1.414 1.414 1.414L6.343 12A4 4 0 1 0 12 17.657l1.414-1.414 1.414 1.414zm0-9.9l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07zM5.775 2.293l1.932-.518L8.742 5.64l-1.931.518-1.036-3.864zm9.483 16.068l1.931-.518 1.036 3.864-1.932.518-1.035-3.864zM2.293 5.775l3.864 1.036-.518 1.931-3.864-1.035.518-1.932zm16.068 9.483l3.864 1.035-.518 1.932-3.864-1.036.518-1.931z"}}],XQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 17h5v2h-3v3h-2v-5zM7 7H2V5h3V2h2v5zm11.364 8.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],QQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18.364 15.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],ZQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 4h10v2H11V4zm0 4h6v2h-6V8zm0 6h10v2H11v-2zm0 4h6v2h-6v-2zM3 4h6v6H3V4zm2 2v2h2V6H5zm-2 8h6v6H3v-6zm2 2v2h2v-2H5z"}}],eZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zm-5-.5h3v3H3v-3zm0 7h3v3H3v-3zm0 7h3v3H3v-3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],tZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zM5 3v3h1v1H3V6h1V4H3V3h2zM3 14v-2.5h2V11H3v-1h3v2.5H4v.5h2v1H3zm2 5.5H3v-1h2V18H3v-1h3v4H3v-1h2v-.5zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],rZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zM4.5 6.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 6.9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],nZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.243 4.515l-6.738 6.737-.707 2.121-1.04 1.041 2.828 2.829 1.04-1.041 2.122-.707 6.737-6.738-4.242-4.242zm6.364 3.535a1 1 0 0 1 0 1.414l-7.779 7.779-2.12.707-1.415 1.414a1 1 0 0 1-1.414 0l-4.243-4.243a1 1 0 0 1 0-1.414l1.414-1.414.707-2.121 7.779-7.779a1 1 0 0 1 1.414 0l5.657 5.657zm-6.364-.707l1.414 1.414-4.95 4.95-1.414-1.414 4.95-4.95zM4.283 16.89l2.828 2.829-1.414 1.414-4.243-1.414 2.828-2.829z"}}],oZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm4 12.5v-4l2 2 2-2v4h2v-7h-2l-2 2-2-2H5v7h2zm11-3v-4h-2v4h-2l3 3 3-3h-2z"}}],iZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm1 2v14h16V5H4zm3 10.5H5v-7h2l2 2 2-2h2v7h-2v-4l-2 2-2-2v4zm11-3h2l-3 3-3-3h2v-4h2v4z"}}],sZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-9 2H5v5.999h2V9l3 3-3 3v-2H5v6h6v-2h2v2h6v-6h-2v2l-3-3 3-3v1.999h2V5h-6v2h-2V5zm2 8v2h-2v-2h2zm0-4v2h-2V9h2z"}}],aZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21 20c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16c.552 0 1 .448 1 1v16zm-2-9V5h-5.999v2H15l-3 3-3-3h2V5H5v6h2v2H5v6h6v-2H9l3-3 3 3h-1.999v2H19v-6h-2v-2h2zm-8 2H9v-2h2v2zm4 0h-2v-2h2v2z"}}],lZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M18 3c1.657 0 3 1.343 3 3s-1.343 3-3 3h-3c-1.306 0-2.417-.834-2.829-2H11c-1.1 0-2 .9-2 2v.171c1.166.412 2 1.523 2 2.829 0 1.306-.834 2.417-2 2.829V15c0 1.1.9 2 2 2h1.17c.412-1.165 1.524-2 2.83-2h3c1.657 0 3 1.343 3 3s-1.343 3-3 3h-3c-1.306 0-2.417-.834-2.829-2H11c-2.21 0-4-1.79-4-4H5c-1.657 0-3-1.343-3-3s1.343-3 3-3h2c0-2.21 1.79-4 4-4h1.17c.412-1.165 1.524-2 2.83-2h3zm0 14h-3c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1zM8 11H5c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1zm10-6h-3c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1z"}}],cZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm14 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-7 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}}],uZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M10 2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1H8v2h5V9c0-.552.448-1 1-1h6c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-1H8v6h5v-1c0-.552.448-1 1-1h6c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-1H7c-.552 0-1-.448-1-1V8H4c-.552 0-1-.448-1-1V3c0-.552.448-1 1-1h6zm9 16h-4v2h4v-2zm0-8h-4v2h4v-2zM9 4H5v2h4V4z"}}],dZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5c1.321 0 2.484.348 3.447.994.963.645 1.726 1.588 2.249 2.778.522 1.19.804 2.625.804 4.257v4.942c0 1.632-.282 3.068-.804 4.257-.523 1.19-1.286 2.133-2.25 2.778-.962.646-2.125.994-3.446.994-1.321 0-2.484-.348-3.447-.994-.963-.645-1.726-1.588-2.249-2.778-.522-1.19-.804-2.625-.804-4.257V9.529c0-1.632.282-3.068.804-4.257.523-1.19 1.286-2.133 2.25-2.778C9.515 1.848 10.678 1.5 12 1.5zm0 2c-.916 0-1.694.226-2.333.655-.637.427-1.158 1.07-1.532 1.92-.412.94-.635 2.108-.635 3.454v4.942c0 1.346.223 2.514.635 3.453.374.851.895 1.494 1.532 1.921.639.429 1.417.655 2.333.655.916 0 1.694-.226 2.333-.655.637-.427 1.158-1.07 1.532-1.92.412-.94.635-2.108.635-3.454V9.529c0-1.346-.223-2.514-.635-3.453-.374-.851-.895-1.494-1.532-1.921C13.694 3.726 12.916 3.5 12 3.5z"}}],fZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 1.5V22h-2V3.704L7.5 4.91V2.839l5-1.339z"}}],pZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 7.5a4 4 0 1 0-8 0H6a6 6 0 1 1 10.663 3.776l-7.32 8.723L18 20v2H6v-1.127l9.064-10.802A3.982 3.982 0 0 0 16 7.5z"}}],hZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 2v1.362L12.809 9.55a6.501 6.501 0 1 1-7.116 8.028l1.94-.486A4.502 4.502 0 0 0 16.5 16a4.5 4.5 0 0 0-6.505-4.03l-.228.122-.69-1.207L14.855 4 6.5 4V2H18z"}}],mZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 1.5V16h3v2h-3v4h-2v-4H4v-1.102L14 1.5h2zM14 16V5.171L6.968 16H14z"}}],gZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 2v2H9.3l-.677 6.445a6.5 6.5 0 1 1-2.93 7.133l1.94-.486A4.502 4.502 0 0 0 16.5 16a4.5 4.5 0 0 0-4.5-4.5c-2.022 0-3.278.639-3.96 1.53l-1.575-1.182L7.5 2H18z"}}],vZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.886 2l-4.438 7.686A6.5 6.5 0 1 1 6.4 12.7L12.576 2h2.31zM12 11.5a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9z"}}],yZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 2v1.5L10.763 22H8.574l8.013-18H6V2z"}}],bZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5a5.5 5.5 0 0 1 3.352 9.86C17.24 12.41 18.5 14.32 18.5 16.5c0 3.314-2.91 6-6.5 6s-6.5-2.686-6.5-6c0-2.181 1.261-4.09 3.147-5.141A5.5 5.5 0 0 1 12 1.5zm0 11c-2.52 0-4.5 1.828-4.5 4 0 2.172 1.98 4 4.5 4s4.5-1.828 4.5-4c0-2.172-1.98-4-4.5-4zm0-9a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7z"}}],xZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5a6.5 6.5 0 0 1 5.619 9.77l-6.196 10.729H9.114l4.439-7.686A6.5 6.5 0 1 1 12 1.5zm0 2a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9z"}}],kZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M14 20v-2.157c1.863-1.192 3.5-3.875 3.5-6.959 0-3.073-2-6.029-5.5-6.029s-5.5 2.956-5.5 6.03c0 3.083 1.637 5.766 3.5 6.958V20H3v-2h4.76C5.666 16.505 4 13.989 4 10.884 4 6.247 7.5 3 12 3s8 3.247 8 7.884c0 3.105-1.666 5.621-3.76 7.116H21v2h-7z"}}],wZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M15 3c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-2v2h4c.552 0 1 .448 1 1v3h2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1h2v-2H8v2h2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1h2v-3c0-.552.448-1 1-1h4V9H9c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zM9 17H5v2h4v-2zm10 0h-4v2h4v-2zM14 5h-4v2h4V5z"}}],SZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 21v-4H7v4H5v-5a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v5h-2zM7 3v4h10V3h2v5a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V3h2zM2 9l4 3-4 3V9zm20 0v6l-4-3 4-3z"}}],EZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 6v15h-2v-5a6 6 0 1 1 0-12h10v2h-3v15h-2V6h-3zm-2 0a4 4 0 1 0 0 8V6z"}}],CZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12.9 6.858l4.242 4.243L7.242 21H3v-4.243l9.9-9.9zm1.414-1.414l2.121-2.122a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414l-2.122 2.121-4.242-4.242z"}}],MZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.728 9.686l-1.414-1.414L5 17.586V19h1.414l9.314-9.314zm1.414-1.414l1.414-1.414-1.414-1.414-1.414 1.414 1.414 1.414zM7.242 21H3v-4.243L16.435 3.322a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414L7.243 21z"}}],TZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.934 3.036l1.732 1L18.531 6H21v2h-2v4h2v2h-2v7h-2v-7h-3.084c-.325 2.862-1.564 5.394-3.37 7.193l-1.562-1.27c1.52-1.438 2.596-3.522 2.917-5.922L10 14v-2l2-.001V8h-2V6h2.467l-1.133-1.964 1.732-1L14.777 6h1.444l1.713-2.964zM5 13.803l-2 .536v-2.071l2-.536V8H3V6h2V3h2v3h2v2H7v3.197l2-.536v2.07l-2 .536V18.5A2.5 2.5 0 0 1 4.5 21H3v-2h1.5a.5.5 0 0 0 .492-.41L5 18.5v-4.697zM17 8h-3v4h3V8z"}}],OZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 19c.828 0 1.5.672 1.5 1.5S12.828 22 12 22s-1.5-.672-1.5-1.5.672-1.5 1.5-1.5zm0-17c3.314 0 6 2.686 6 6 0 2.165-.753 3.29-2.674 4.923C13.399 14.56 13 15.297 13 17h-2c0-2.474.787-3.695 3.031-5.601C15.548 10.11 16 9.434 16 8c0-2.21-1.79-4-4-4S8 5.79 8 8v1H6V8c0-3.314 2.686-6 6-6z"}}],_Z=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21 19v2h-2v-2h2zm-4 0v2h-2v-2h2zm-4 0v2h-2v-2h2zm-4 0v2H7v-2h2zm-4 0v2H3v-2h2zm16-4v2h-2v-2h2zM5 15v2H3v-2h2zm0-4v2H3v-2h2zm11-8c2.687 0 4.882 2.124 4.995 4.783L21 8v5h-2V8c0-1.591-1.255-2.903-2.824-2.995L16 5h-5V3h5zM5 7v2H3V7h2zm0-4v2H3V3h2zm4 0v2H7V3h2z"}}],AZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M9.683 7.562L12 9.88l6.374-6.375a2 2 0 0 1 2.829 0l.707.707L9.683 16.438a4 4 0 1 1-2.121-2.121L9.88 12 7.562 9.683a4 4 0 1 1 2.121-2.121zM6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 12a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm9.535-6.587l6.375 6.376-.707.707a2 2 0 0 1-2.829 0l-4.96-4.961 2.12-2.122z"}}],NZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M14 3c.552 0 1 .448 1 1v5h5c.552 0 1 .448 1 1v10c0 .552-.448 1-1 1H10c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h10zm-1 2H5v8h4v-3c0-.552.448-1 1-1h3V5z"}}],RZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M11 3c.552 0 1 .448 1 1v2h5c.552 0 1 .448 1 1v5h2c.552 0 1 .448 1 1v7c0 .552-.448 1-1 1h-7c-.552 0-1-.448-1-1v-2H7c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h7zm5 5h-4v3c0 .552-.448 1-1 1H8v4h4v-3c0-.552.448-1 1-1h3V8z"}}],PZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M2 11h2v2H2v-2zm4 0h12v2H6v-2zm14 0h2v2h-2v-2z"}}],zZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M9.583 17.321C8.553 16.227 8 15 8 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179z"}}],LZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.417 6.679C15.447 7.773 16 9 16 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311C9.591 12.322 8.17 10.841 8.17 9a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179z"}}],IZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M19 3l4 5h-3v12h-2V8h-3l4-5zm-5 15v2H3v-2h11zm0-7v2H3v-2h11zm-2-7v2H3V4h9z"}}],DZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 4v12h3l-4 5-4-5h3V4h2zm-8 14v2H3v-2h9zm2-7v2H3v-2h11zm0-7v2H3V4h11z"}}],$Z=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 9v4h16V9h2v5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V9h2z"}}],HZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M17.5 2.5L23 12l-5.5 9.5h-11L1 12l5.5-9.5h11zm-1.153 2H7.653L3.311 12l4.342 7.5h8.694l4.342-7.5-4.342-7.5zM11 15h2v2h-2v-2zm0-8h2v6h-2V7z"}}],BZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-9 2H5v14h6v-4h2v4h6V5h-6v4h-2V5zm4 4l3 3-3 3v-2H9v2l-3-3 3-3v2h6V9z"}}],FZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-1 2H5v5.999L9 11v2H5v6h14v-6h-4v-2l4-.001V5zm-7 1l3 3h-2v6h2l-3 3-3-3h2V9H9l3-3z"}}],VZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 9h-2V6H5V4h14v2h-6v3zm0 6v5h-2v-5h2zM3 11h18v2H3v-2z"}}],jZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.154 14c.23.516.346 1.09.346 1.72 0 1.342-.524 2.392-1.571 3.147C14.88 19.622 13.433 20 11.586 20c-1.64 0-3.263-.381-4.87-1.144V16.6c1.52.877 3.075 1.316 4.666 1.316 2.551 0 3.83-.732 3.839-2.197a2.21 2.21 0 0 0-.648-1.603l-.12-.117H3v-2h18v2h-3.846zm-4.078-3H7.629a4.086 4.086 0 0 1-.481-.522C6.716 9.92 6.5 9.246 6.5 8.452c0-1.236.466-2.287 1.397-3.153C8.83 4.433 10.271 4 12.222 4c1.471 0 2.879.328 4.222.984v2.152c-1.2-.687-2.515-1.03-3.946-1.03-2.48 0-3.719.782-3.719 2.346 0 .42.218.786.654 1.099.436.313.974.562 1.613.75.62.18 1.297.414 2.03.699z"}}],UZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 6v13H9V6H3V4h14v2h-6zm8.55 10.58a.8.8 0 1 0-1.32-.36l-1.154.33A2.001 2.001 0 0 1 19 14a2 2 0 0 1 1.373 3.454L18.744 19H21v1h-4v-1l2.55-2.42z"}}],WZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5.596 4L10.5 9.928 15.404 4H18l-6.202 7.497L18 18.994V19h-2.59l-4.91-5.934L5.59 19H3v-.006l6.202-7.497L3 4h2.596zM21.55 16.58a.8.8 0 1 0-1.32-.36l-1.155.33A2.001 2.001 0 0 1 21 14a2 2 0 0 1 1.373 3.454L20.744 19H23v1h-4v-1l2.55-2.42z"}}],KZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 11h14v2H5z"}}],qZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 7v13H9V7H3V5h12v2h-4zm8.55-.42a.8.8 0 1 0-1.32-.36l-1.154.33A2.001 2.001 0 0 1 19 4a2 2 0 0 1 1.373 3.454L18.744 9H21v1h-4V9l2.55-2.42z"}}],GZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5.596 5l4.904 5.928L15.404 5H18l-6.202 7.497L18 19.994V20h-2.59l-4.91-5.934L5.59 20H3v-.006l6.202-7.497L3 5h2.596zM21.55 6.58a.8.8 0 1 0-1.32-.36l-1.155.33A2.001 2.001 0 0 1 21 4a2 2 0 0 1 1.373 3.454L20.744 9H23v1h-4V9l2.55-2.42z"}}],YZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M13 10v4h6v-4h-6zm-2 0H5v4h6v-4zm2 9h6v-3h-6v3zm-2 0v-3H5v3h6zm2-14v3h6V5h-6zm-2 0H5v3h6V5zM4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],JZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 8h16V5H4v3zm10 11v-9h-4v9h4zm2 0h4v-9h-4v9zm-8 0v-9H4v9h4zM3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],XZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 5v10H9v-4a4 4 0 1 1 0-8h8v2h-2v10h-2V5h-2zM9 5a2 2 0 1 0 0 4V5zm8 12v-2.5l4 3.5-4 3.5V19H5v-2h12z"}}],QZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 5v10H9v-4a4 4 0 1 1 0-8h8v2h-2v10h-2V5h-2zM9 5a2 2 0 1 0 0 4V5zM7 17h12v2H7v2.5L3 18l4-3.5V17z"}}],ZZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 17h10v-2.5l3.5 3.5-3.5 3.5V19H7v2.5L3.5 18 7 14.5V17zm6-11v9h-2V6H5V4h14v2h-6z"}}],eee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 18h1.5a2.5 2.5 0 1 0 0-5H3v-2h13.5a4.5 4.5 0 1 1 0 9H15v2l-4-3 4-3v2zM3 4h18v2H3V4zm6 14v2H3v-2h6z"}}],tee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 6v15h-2V6H5V4h14v2z"}}],ree=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301 14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"}}],nee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 15v2a2 2 0 0 0 1.85 1.995L7 19h3v2H7a4 4 0 0 1-4-4v-2h2zm13-5l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16 10h2zm-1 2.885L15.753 16h2.492L17 12.885zM8 2v2h4v7H8v3H6v-3H2V4h4V2h2zm9 1a4 4 0 0 1 4 4v2h-2V7a2 2 0 0 0-2-2h-3V3h3zM6 6H4v3h2V6zm4 0H8v3h2V6z"}}],oee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 3v9a4 4 0 1 0 8 0V3h2v9a6 6 0 1 1-12 0V3h2zM4 20h16v2H4v-2z"}}],iee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 19h16v-7h2v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-8h2v7zM14 9v6h-4V9H5l7-7 7 7h-5z"}}],see=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3.993C3 3.445 3.445 3 3.993 3h16.014c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 20.007V3.993zM5 5v14h14V5H5zm5.622 3.415l4.879 3.252a.4.4 0 0 1 0 .666l-4.88 3.252a.4.4 0 0 1-.621-.332V8.747a.4.4 0 0 1 .622-.332z"}}],aee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 21v-2h3.662l1.234-7H5v-2h3.249l.881-5H4V3h16v2h-8.839l-.882 5H18v9h3v2H3zm13-9H9.927l-1.235 7H16v-7z"}}];const lee=Object.freeze(Object.defineProperty({__proto__:null,ab:EX,addFill:CX,addLine:MX,alertLine:TX,alignBottom:OX,alignCenter:_X,alignJustify:AX,alignLeft:NX,alignRight:RX,alignTop:PX,alignVertically:zX,appsLine:LX,arrowDownSFill:IX,arrowGoBackFill:DX,arrowGoForwardFill:$X,arrowLeftSFill:HX,arrowRightSFill:BX,arrowUpSFill:FX,asterisk:VX,attachment2:jX,bold:UX,bracesLine:WX,bringForward:KX,bringToFront:qX,chatNewLine:GX,checkboxCircleLine:YX,checkboxMultipleLine:JX,clipboardFill:XX,clipboardLine:QX,closeCircleLine:ZX,closeFill:eQ,closeLine:tQ,codeLine:rQ,codeView:nQ,deleteBinFill:oQ,deleteBinLine:iQ,deleteColumn:sQ,deleteRow:aQ,doubleQuotesL:lQ,doubleQuotesR:cQ,download2Fill:uQ,dragDropLine:dQ,emphasis:pQ,emphasisCn:fQ,englishInput:hQ,errorWarningLine:mQ,externalLinkFill:gQ,fileCopyLine:vQ,flowChart:yQ,fontColor:bQ,fontSize:kQ,fontSize2:xQ,formatClear:wQ,fullscreenExitLine:SQ,fullscreenLine:EQ,functions:CQ,galleryUploadLine:MQ,h1:TQ,h2:OQ,h3:_Q,h4:AQ,h5:NQ,h6:RQ,hashtag:PQ,heading:zQ,imageAddLine:LQ,imageEditLine:IQ,imageLine:DQ,indentDecrease:$Q,indentIncrease:HQ,informationLine:BQ,inputCursorMove:FQ,insertColumnLeft:VQ,insertColumnRight:jQ,insertRowBottom:UQ,insertRowTop:WQ,italic:KQ,layoutColumnLine:qQ,lineHeight:GQ,link:QQ,linkM:YQ,linkUnlink:XQ,linkUnlinkM:JQ,listCheck:eZ,listCheck2:ZQ,listOrdered:tZ,listUnordered:rZ,markPenLine:nZ,markdownFill:oZ,markdownLine:iZ,mergeCellsHorizontal:sZ,mergeCellsVertical:aZ,mindMap:lZ,moreFill:cZ,nodeTree:uZ,number0:dZ,number1:fZ,number2:pZ,number3:hZ,number4:mZ,number5:gZ,number6:vZ,number7:yZ,number8:bZ,number9:xZ,omega:kZ,organizationChart:wZ,pageSeparator:SZ,paragraph:EZ,pencilFill:CZ,pencilLine:MZ,pinyinInput:TZ,questionMark:OZ,roundedCorner:_Z,scissorsFill:AZ,sendBackward:NZ,sendToBack:RZ,separator:PZ,singleQuotesL:zZ,singleQuotesR:LZ,sortAsc:IZ,sortDesc:DZ,space:$Z,spamLine:HZ,splitCellsHorizontal:BZ,splitCellsVertical:FZ,strikethrough:jZ,strikethrough2:VZ,subscript:WZ,subscript2:UZ,subtractLine:KZ,superscript:GZ,superscript2:qZ,table2:YZ,tableLine:JZ,text:tee,textDirectionL:XZ,textDirectionR:QZ,textSpacing:ZZ,textWrap:eee,translate:nee,translate2:ree,underline:oee,upload2Fill:iee,videoLine:see,wubiInput:aee},Symbol.toStringTag,{value:"Module"}));function cee(e,t=null){return function(r,n){let{$from:o,$to:i}=r.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(e)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=r.doc.resolve(s.start-2);l=new na(u,u,s.depth),s.endIndex=0;u--)i=R.from(r[u].type.create(r[u].attrs,i));e.step(new bt(t.start-(n?2:0),t.end,t.start,t.end,new K(i,0,0),r.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==e);return i?r?n.node(i.depth-1).type==e?fee(t,r,e,i):pee(t,r,i):!0:!1}}function fee(e,t,r,n){let o=e.tr,i=n.end,s=n.$to.end(n.depth);im;h--)p-=o.child(h).nodeSize,n.delete(p-1,p+1);let i=n.doc.resolve(r.start),s=i.nodeAfter;if(n.mapping.map(r.end)!=r.start+i.nodeAfter.nodeSize)return!1;let a=r.startIndex==0,l=r.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?R.empty:R.from(o))))return!1;let d=i.pos,f=d+s.nodeSize;return n.step(new bt(d-(a?1:0),f+(l?1:0),d+1,f-1,new K((a?R.empty:R.from(o.copy(R.empty))).append(l?R.empty:R.from(o.copy(R.empty))),a?0:1,l?0:1),a?0:1)),t(n.scrollIntoView()),!0}var hee=Object.defineProperty,mee=Object.getOwnPropertyDescriptor,$n=(e,t,r,n)=>{for(var o=n>1?void 0:n?mee(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&hee(t,r,o),o};function ov(e){var t;return!!((t=e.spec.group)!=null&&t.includes(oe.ListContainerNode))}function gee(e){var t;return!!((t=e.spec.group)!=null&&t.includes(oe.ListItemNode))}function cs(e){return ov(e.type)}function Qi(e){return gee(e.type)}function Pb(e,t){return r=>{const{dispatch:n,tr:o}=r,i=Hv(o,r.state),{$from:s,$to:a}=o.selection,l=s.blockRange(a);if(!l)return!1;const c=zd({predicate:u=>ov(u.type),selection:o.selection});if(c&&l.depth-c.depth<=1&&l.startIndex===0){if(c.node.type===e)return _3(t)(r);if(ov(c.node.type))return e.validContent(c.node.content)?(n==null||n(o.setNodeMarkup(c.pos,e)),!0):vee(o,c,e,t)?(n==null||n(o.scrollIntoView()),!0):!1}return cee(e)(i,n)}}function T3(e,t=["checked"]){return function({tr:r,dispatch:n,state:o}){var i,s;const a=nz(e,o.schema),{$from:l,$to:c}=r.selection;if(Id(r.selection)&&r.selection.node.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(n){const m=l.index(-1)>0;let b=R.empty;for(let y=l.depth-(m?1:2);y>=l.depth-3;y--)b=R.from(l.node(y).copy(b));const v=((i=a.contentMatch.defaultType)==null?void 0:i.createAndFill())||void 0;b=b.append(R.from(a.createAndFill(null,v)||void 0));const g=l.indexAfter(-1)!t.includes(m))),f=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,p={...l.node().attrs};r.delete(l.pos,c.pos);const h=f?[{type:a,attrs:d},{type:f,attrs:p}]:[{type:a,attrs:d}];return dl(r.doc,l.pos,2)?(n&&n(r.split(l.pos,2,h).scrollIntoView()),!0):!1}}function vee(e,t,r,n){const o=t.node,i=e.doc.resolve(t.start),s=i.node(-1),a=i.index(-1);if(!s||!s.canReplace(a,a+1,R.from(r.create())))return!1;const l=[];for(let p=0;pb;m--)h-=o.child(m).nodeSize,n.delete(h-1,h+1);const s=n.doc.resolve(r.start),a=s.nodeAfter;if(!a||n.mapping.slice(i).map(r.end)!==r.start+a.nodeSize)return!1;const l=r.startIndex===0,c=r.endIndex===o.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(l?0:1),d+1,a.content.append(c?R.empty:R.from(o))))return!1;const f=s.pos,p=f+a.nodeSize;return n.step(new bt(f-(l?1:0),p+(c?1:0),f+1,p-1,new K((l?R.empty:R.from(o.copy(R.empty))).append(c?R.empty:R.from(o.copy(R.empty))),l?0:1,c?0:1),l?0:1)),t(n.scrollIntoView()),!0}function O3(e,t){const r=t||e.selection.$from;let n=[],o,i,s,a;for(let c=r.depth;c>=0;c--){if(i=r.node(c),o=r.index(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&cs(s)){const u=r.before(c+1);n.push(u)}if(o=r.indexAfter(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&cs(s)){const u=r.after(c+1);n.push(u)}}n=[...new Set(n)].sort((c,u)=>u-c);let l=!1;for(const c of n)Nd(e.doc,c)&&(e.join(c),l=!0);return l}function _3(e){return t=>{const{dispatch:r,tr:n}=t,o=Hv(n,t.state),i=xee(e,n.selection);return i?(r&&bee(o,r,i),!0):!1}}function xee(e,t){const{$from:r,$to:n}=t;return r.blockRange(n,i=>{var s;return((s=i.firstChild)==null?void 0:s.type)===e})}function vh(e){const{$from:t,$to:r}=e;return t.blockRange(r,cs)}function kee(e){const t=e.selection.$from,r=t.blockRange();if(!r||!Qi(r.parent)||r.startIndex!==0)return!1;const n=t.node(r.depth-2),o=t.index(r.depth),i=t.index(r.depth-1),s=t.index(r.depth-2),a=n.maybeChild(s-1),l=a==null?void 0:a.lastChild;if(o!==0||i!==0)return!1;if(a&&cs(a)&&l&&Qi(l))return Ql({listType:a.type,itemType:l.type,tr:e});if(Qi(n)){const c=n,u=t.node(r.depth-3);if(cs(u))return Ql({listType:u.type,itemType:c.type,tr:e})}return!1}function IS({view:e}){if(!e)return!1;{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const r=t.blockRange();if(!r||!Qi(r.parent)||r.startIndex!==0)return!1}{const t=e.state.tr;kee(t)&&e.dispatch(t)}{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const r=t.blockRange();if(!r||!Qi(r.parent)||r.startIndex!==0)return!1;const n=t.index(r.depth),o=t.index(r.depth-1),i=t.index(r.depth-2),s=r.depth-2>=1&&Qi(t.node(r.depth-2));n===0&&o===0&&i<=1&&s&&dee(r.parent.type)(e.state,e.dispatch)}return H5(e.state,e.dispatch,e),!0}function A3({node:e,mark:t,updateDOM:r,updateMark:n}){const o=document.createElement("label");o.contentEditable="false",o.classList.add(ls.LIST_ITEM_MARKER_CONTAINER),o.append(t);const i=document.createElement("div"),s=document.createElement("li");s.classList.add(ls.LIST_ITEM_WITH_CUSTOM_MARKER),s.append(o),s.append(i);const a=l=>l.type!==e.type?!1:(e=l,r(e,s),n(e,t),!0);return a(e),{dom:s,contentDOM:i,update:a}}function wee(e,t){const r=e.node(t.depth-1),n=e.node(t.depth-2);return!Qi(r)||!cs(n)?!1:{parentItem:r,parentList:n}}function See(e,t){const r=t.parent,n=t.parent.child(t.endIndex-1),o=t.end,i=t.$to.end(t.depth);return oMee(e)?(t==null||t(e.scrollIntoView()),!0):!1;function Oee(e,t,r){let n,o,i,s;const a=t.doc;if(r.startIndex>=1){n=e.child(r.startIndex-1),o=e,s=a.resolve(r.start).start(r.depth),i=s+1;for(let l=0;l=1){const c=t.node(r.depth-1),u=t.start(r.depth-1);if(o=c.child(l-1),!cs(o))return!1;s=u+1;for(let d=0;d=r.depth+2?t.end(r.depth+2):r.end-1,a=r.end;return s+1>=a?(n=e.slice(i,a),o=null):(n=e.slice(i,s),o=e.slice(s+1,a-1)),{selectedSlice:n,unselectedSlice:o}}function Aee(e){const{$from:t,$to:r}=e.selection,n=vh(e.selection);if(!n)return!1;const o=e.doc.resolve(n.start).node();if(!cs(o))return!1;const i=Oee(o,t,n);if(!i)return!1;const{previousItem:s,previousList:a,previousItemStart:l}=i,{selectedSlice:c,unselectedSlice:u}=_ee(e.doc,r,n),d=s.content.append(R.fromArray([o.copy(c.content)])).append(u?u.content:R.empty);e.deleteRange(n.start,n.end);const f=l+s.nodeSize-2,p=s.copy(d);return p.check(),e.replaceRangeWith(l-1,f+1,p),e.setSelection(a===o?le.between(e.doc.resolve(t.pos),e.doc.resolve(r.pos)):le.between(e.doc.resolve(t.pos-2),e.doc.resolve(r.pos-2))),!0}var Nee=({tr:e,dispatch:t})=>Aee(e)?(t==null||t(e.scrollIntoView()),!0):!1,N3=class extends Ve{get name(){return"listItemShared"}createKeymap(){const e={Tab:Nee,"Shift-Tab":Tee,Backspace:IS,"Mod-Backspace":IS};if(nn.isMac){const t={"Ctrl-h":e.Backspace,"Alt-Backspace":e["Mod-Backspace"]};return{...e,...t}}return e}createPlugin(){return{appendTransaction:(e,t,r)=>{const n=r.tr;return O3(n)?n:null}}}},ya=class extends er{get name(){return"listItem"}createTags(){return[oe.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),closed:{default:!1},nested:{default:!1}},parseDOM:[{tag:"li",getAttrs:e.parse,priority:Ae.Lowest},...t.parseDOM??[]],toDOM:r=>["li",e.dom(r),0]}}createNodeViews(){return this.options.enableCollapsible?(e,t,r)=>{const n=document.createElement("div");return n.classList.add(ls.COLLAPSIBLE_LIST_ITEM_BUTTON),n.contentEditable="false",n.addEventListener("click",()=>{if(n.classList.contains("disabled"))return;const o=r(),i=ce.create(t.state.doc,o);return t.dispatch(t.state.tr.setSelection(i)),this.store.commands.toggleListItemClosed(),!0}),A3({mark:n,node:e,updateDOM:Ree,updateMark:Pee})}:{}}createKeymap(){return{Enter:T3(this.type)}}createExtensions(){return[new N3]}toggleListItemClosed(e){return({state:{tr:t,selection:r},dispatch:n})=>{if(!Id(r)||r.node.type.name!==this.name)return!1;const{node:o,from:i}=r;return e=k1(e)?e:!o.attrs.closed,n==null||n(t.setNodeMarkup(i,void 0,{...o.attrs,closed:e})),!0}}liftListItemOutOfList(e){return _3(e??this.type)}};$n([U()],ya.prototype,"toggleListItemClosed",1);$n([U()],ya.prototype,"liftListItemOutOfList",1);ya=$n([me({defaultOptions:{enableCollapsible:!1},staticKeys:["enableCollapsible"]})],ya);function Ree(e,t){e.attrs.closed?t.classList.add(ls.COLLAPSIBLE_LIST_ITEM_CLOSED):t.classList.remove(ls.COLLAPSIBLE_LIST_ITEM_CLOSED)}function Pee(e,t){e.childCount<=1?t.classList.add("disabled"):t.classList.remove("disabled")}var yd=class extends er{get name(){return"bulletList"}createTags(){return[oe.Block,oe.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["ul",e.dom(r),0]}}createNodeViews(){return this.options.enableSpine?(e,t,r)=>{var n;const o=document.createElement("div");o.style.position="relative";const i=r(),s=t.state.doc.resolve(i+1),a=s.node(s.depth-1);if(!(((n=a==null?void 0:a.type)==null?void 0:n.name)!=="listItem")){const u=document.createElement("div");u.contentEditable="false",u.classList.add(ls.LIST_SPINE),u.addEventListener("click",d=>{const f=r(),p=t.state.doc.resolve(f+1),h=p.start(p.depth-1),m=ce.create(t.state.doc,h-1);t.dispatch(t.state.tr.setSelection(m)),this.store.commands.toggleListItemClosed(),d.preventDefault(),d.stopPropagation()}),o.append(u)}const c=document.createElement("ul");return c.classList.add(ls.UL_LIST_CONTENT),o.append(c),{dom:o,contentDOM:c}}:{}}createExtensions(){return[new ya({priority:Ae.Low,enableCollapsible:this.options.enableSpine})]}toggleBulletList(){return Pb(this.type,it(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleBulletList()(e)}createInputRules(){const e=/^\s*([*+-])\s$/;return[Nh(e,this.type),new wa(e,(t,r,n,o)=>{const i=t.tr;return i.deleteRange(n,o),Ql({listType:this.type,itemType:it(this.store.schema.nodes,"listItem"),tr:i})?i:null})]}};$n([U({icon:"listUnordered",label:({t:e})=>e(Ov.BULLET_LIST_LABEL)})],yd.prototype,"toggleBulletList",1);$n([je({shortcut:D.BulletList,command:"toggleBulletList"})],yd.prototype,"listShortcut",1);yd=$n([me({defaultOptions:{enableSpine:!1},staticKeys:["enableSpine"]})],yd);var bd=class extends er{get name(){return"orderedList"}createTags(){return[oe.Block,oe.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:{...e.defaults(),order:{default:1}},parseDOM:[{tag:"ol",getAttrs:r=>Je(r)?{...e.parse(r),order:+(r.getAttribute("start")??1)}:{}},...t.parseDOM??[]],toDOM:r=>{const n=e.dom(r);return r.attrs.order===1?["ol",n,0]:["ol",{...n,start:r.attrs.order},0]}}}createExtensions(){return[new ya({priority:Ae.Low})]}toggleOrderedList(){return Pb(this.type,it(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleOrderedList()(e)}createInputRules(){const e=/^(\d+)\.\s$/;return[Nh(e,this.type,t=>({order:+it(t,1)}),(t,r)=>r.childCount+r.attrs.order===+it(t,1)),new wa(e,(t,r,n,o)=>{const i=t.tr;if(i.deleteRange(n,o),!Ql({listType:this.type,itemType:it(this.store.schema.nodes,"listItem"),tr:i}))return null;const a=+it(r,1);if(a!==1){const l=ts({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{order:a})}return i})]}};$n([U({icon:"listOrdered",label:({t:e})=>e(Ov.ORDERED_LIST_LABEL)})],bd.prototype,"toggleOrderedList",1);$n([je({shortcut:D.OrderedList,command:"toggleOrderedList"})],bd.prototype,"listShortcut",1);bd=$n([me({})],bd);var R3=class extends er{get name(){return"taskListItem"}createTags(){return[oe.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),checked:{default:!1}},parseDOM:[{tag:"li[data-task-list-item]",getAttrs:r=>{let n=!1;return Je(r)&&r.getAttribute("data-checked")!==null&&(n=!0),{checked:n,...e.parse(r)}},priority:Ae.Medium},...t.parseDOM??[]],toDOM:r=>["li",{...e.dom(r),"data-task-list-item":"","data-checked":r.attrs.checked?"":void 0},0]}}createNodeViews(){return(e,t,r)=>{const n=document.createElement("input");return n.type="checkbox",n.classList.add(ls.LIST_ITEM_CHECKBOX),n.contentEditable="false",n.addEventListener("click",o=>{t.editable||o.preventDefault()}),n.addEventListener("change",()=>{const o=r(),i=t.state.doc.resolve(o+1);this.store.commands.toggleCheckboxChecked({$pos:i})}),n.checked=e.attrs.checked,A3({node:e,mark:n,updateDOM:zee,updateMark:Lee})}}createKeymap(){return{Enter:T3(this.type)}}createExtensions(){return[new N3]}toggleCheckboxChecked(e){let t,r;return typeof e=="boolean"?t=e:e&&(t=e.checked,r=e.$pos),({tr:n,dispatch:o})=>{const i=ts({selection:r??n.selection.$from,types:this.type});if(!i)return!1;const{node:s,pos:a}=i,l={...s.attrs,checked:t??!s.attrs.checked};return o==null||o(n.setNodeMarkup(a,void 0,l)),!0}}createInputRules(){const e=/^\s*(\[( ?|x|X)]\s)$/;return[Nh(e,this.type,t=>({checked:["x","X"].includes(Zo(t,2))})),new wa(e,(t,r,n,o)=>{const i=t.tr;if(i.deleteRange(n,o),!Ql({listType:it(this.store.schema.nodes,"taskList"),itemType:this.type,tr:i}))return null;const a=["x","X"].includes(Zo(r,2));if(a){const l=ts({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{checked:a})}return i})]}};$n([U()],R3.prototype,"toggleCheckboxChecked",1);function zee(e,t){e.attrs.checked?t.setAttribute("data-checked",""):t.removeAttribute("data-checked"),t.setAttribute("data-task-list-item","")}function Lee(e,t){t.checked=!!e.attrs.checked}var P3=class extends er{get name(){return"taskList"}createTags(){return[oe.Block,oe.ListContainerNode]}createNodeSpec(e,t){return{content:"taskListItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul[data-task-list]",getAttrs:e.parse,priority:Ae.Medium},...t.parseDOM??[]],toDOM:r=>["ul",{...e.dom(r),"data-task-list":""},0]}}createExtensions(){return[new R3({})]}toggleTaskList(){return Pb(this.type,it(this.store.schema.nodes,"taskListItem"))}listShortcut(e){return this.toggleTaskList()(e)}};$n([U({icon:"checkboxMultipleLine",label:({t:e})=>e(Ov.TASK_LIST_LABEL)})],P3.prototype,"toggleTaskList",1);$n([je({shortcut:D.TaskList,command:"toggleTaskList"})],P3.prototype,"listShortcut",1);var fo,Iee=(e=document)=>fo||(fo=e.createElement("div"),fo.setAttribute("id","a11y-status-message"),fo.setAttribute("role","status"),fo.setAttribute("aria-live","polite"),fo.setAttribute("aria-relevant","additions text"),Object.assign(fo.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.append(fo),fo);H4(500,()=>{Iee().textContent=""});function DS(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function $S(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function a1(e,t){if(e.clientHeightt||i>e&&s=t&&a>=r?i-e-n:s>t&&ar?s-t+o:0}var Dee=function(e,t){var r=window,n=t.scrollMode,o=t.block,i=t.inline,s=t.boundary,a=t.skipOverflowHiddenElements,l=typeof s=="function"?s:function(De){return De!==s};if(!DS(e))throw new TypeError("Invalid target");for(var c,u,d=document.scrollingElement||document.documentElement,f=[],p=e;DS(p)&&l(p);){if((p=(u=(c=p).parentElement)==null?c.getRootNode().host||null:u)===d){f.push(p);break}p!=null&&p===document.body&&a1(p)&&!a1(document.documentElement)||p!=null&&a1(p,a)&&f.push(p)}for(var h=r.visualViewport?r.visualViewport.width:innerWidth,m=r.visualViewport?r.visualViewport.height:innerHeight,b=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,g=e.getBoundingClientRect(),y=g.height,x=g.width,k=g.top,w=g.right,E=g.bottom,M=g.left,C=o==="start"||o==="nearest"?k:o==="end"?E:k+y/2,T=i==="center"?M+x/2:i==="end"?w:M,N=[],F=0;F=0&&M>=0&&E<=m&&w<=h&&k>=q&&E<=P&&M>=B&&w<=A)return N;var Y=getComputedStyle(I),J=parseInt(Y.borderLeftWidth,10),Ne=parseInt(Y.borderTopWidth,10),ie=parseInt(Y.borderRightWidth,10),ue=parseInt(Y.borderBottomWidth,10),de=0,he=0,Me="offsetWidth"in I?I.offsetWidth-I.clientWidth-J-ie:0,Se="offsetHeight"in I?I.offsetHeight-I.clientHeight-Ne-ue:0,ft="offsetWidth"in I?I.offsetWidth===0?0:z/I.offsetWidth:0,rt="offsetHeight"in I?I.offsetHeight===0?0:j/I.offsetHeight:0;if(d===I)de=o==="start"?C:o==="end"?C-m:o==="nearest"?Mf(v,v+m,m,Ne,ue,v+C,v+C+y,y):C-m/2,he=i==="start"?T:i==="center"?T-h/2:i==="end"?T-h:Mf(b,b+h,h,J,ie,b+T,b+T+x,x),de=Math.max(0,de+v),he=Math.max(0,he+b);else{de=o==="start"?C-q-Ne:o==="end"?C-P+ue+Se:o==="nearest"?Mf(q,P,j,Ne,ue+Se,C,C+y,y):C-(q+j/2)+Se/2,he=i==="start"?T-B-J:i==="center"?T-(B+z/2)+Me/2:i==="end"?T-A+ie+Me:Mf(B,A,z,J,ie+Me,T,T+x,x);var Or=I.scrollLeft,pe=I.scrollTop;C+=pe-(de=Math.max(0,Math.min(pe+de/rt,I.scrollHeight-j/rt+Se))),T+=Or-(he=Math.max(0,Math.min(Or+he/ft,I.scrollWidth-z/ft+Me)))}N.push({el:I,top:de,left:he})}return N};typeof br=="object"&&br.__esModule&&br.default&&br.default;_h(Dee);var $ee=typeof document<"u"?S.useLayoutEffect:S.useEffect;function Hee(e){const t=S.useRef();return $ee(()=>{t.current=e}),t.current}function Bee(e,t){const[r,n]=S.useState([]),[o,i]=S.useState(()=>j0(e)),[s,a]=S.useState([]),l=S.useRef(e),c=Hee(o);return l.current=e,Zy(Ul,({addCustomHandler:u})=>{const d=j0(l.current),f=u("positioner",d);return i(d),f},t),S.useLayoutEffect(()=>{const u=o.addListener("update",f=>{const p=[];for(const{id:h,data:m,setElement:b}of f){const v=g=>{g&&b(g)};p.push({id:h,data:m,ref:v})}a(p)}),d=o.addListener("done",f=>{n(f)});return c!=null&&c.recentUpdate&&o.onActiveChanged(c==null?void 0:c.recentUpdate),()=>{u(),d()}},[o,c]),S.useMemo(()=>{const u=[];for(const[d,{ref:f,data:p,id:h}]of s.entries()){const m=r[d],{element:b,position:v={}}=m??{},g={...Yy,...j4(v)};u.push({ref:f,element:b,data:p,key:h,...g})}return u},[s,r])}function Fee(e,t){const r=t==null||k1(t)?[e]:t,n=k1(t)?t:!0,o=S.useRef(Cl()),s=Bee(e,r)[0];return S.useMemo(()=>s&&n?{...s,active:!0}:{...Yy,ref:void 0,data:{},active:!1,key:o.current},[n,s])}function l1(e,t){return _e(e)?e(t):e}function Vee(e){return ne(e[0])}function jee(e,t){var r;return ne(e)?e:ct(e)?Vee(e)?e[0]??"":((r=e.find(n=>U4(n.attrs,t))??e[0])==null?void 0:r.shortcut)??"":e.shortcut}var Uee={title:e=>oA(e),upper:e=>e.toLocaleUpperCase(),lower:e=>e.toLocaleLowerCase()};function Wee(e,t){const{casing:r="title",namedAsSymbol:n=!1,modifierAsSymbol:o=!0,separator:i=" ",t:s}=t,a=Pz(e),l=[],c=Uee[r];for(const u of a){if(u.type==="char"){l.push(c(u.key));continue}if(u.type==="named"){const f=n===!0||ct(n)&&dr(n,u.key)?u.symbol??s(u.i18n):s(u.i18n);l.push(c(f));continue}const d=o===!0||ct(o)&&dr(o,u.key)?u.symbol:s(u.i18n);l.push(c(d))}return l.join(i)}var z3=({commandName:e,active:t,enabled:r,attrs:n})=>{const{t:o}=oj(),{getCommandOptions:i}=lm(),s=i(e),{description:a,label:l,icon:c,shortcut:u}=s||{},d=S.useMemo(()=>({active:t,attrs:n,enabled:r,t:o}),[t,n,r,o]),f=S.useMemo(()=>{if(u)return Wee(jee(u,n??{}),{t:o,separator:""})},[u,n,o]);return S.useMemo(()=>({description:l1(a,d),label:l1(l,d),icon:l1(c,d),shortcut:f}),[d,a,l,c,f])},Kee={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},L3=S.createContext(Kee);L3.Provider;function I3(e){return e.map((t,r)=>S.createElement(t.tag,{key:r,...t.attr},I3(t.child??[])))}var Km=e=>{const{name:t}=e;return L.createElement(qee,{...e},I3(lee[t]))},qee=e=>{const t=r=>{const n=e.size??r.size??"1em";let o;r.className&&(o=r.className),e.className&&(o=(o?`${o} `:"")+e.className);const{title:i,...s}=e;return L.createElement("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",...r.attr,...s,className:o,style:{color:e.color??r.color,...r.style,...e.style},height:n,width:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},i&&L.createElement("title",null,i),e.children)};return L.createElement(L3.Consumer,null,t)},Gee=e=>hs(e)?!!e.name:!1,Yee=({icon:e})=>ne(e)?L.createElement(Km,{name:e,size:"1rem"}):e,Jee=({icon:e,children:t})=>{if(!Gee(e))return L.createElement(L.Fragment,null,t);const{sub:r,sup:n}=e,o=r??n,i=r!==void 0;return o===void 0?L.createElement(L.Fragment,null,t):L.createElement(JY,{anchorOrigin:{vertical:i?"bottom":"top",horizontal:"right"},badgeContent:o,sx:{"& > .MuiBadge-badge":{bgcolor:"background.paper",color:"text.secondary",minWidth:12,height:12,margin:"2px 0",padding:"1px"}}},t)},dt=({commandName:e,active:t=!1,enabled:r,attrs:n,onSelect:o,onChange:i,icon:s,displayShortcut:a=!0,"aria-label":l,label:c,...u})=>{const d=S.useCallback((g,y)=>{o(),i==null||i(g,y)},[o,i]),f=S.useCallback(g=>{g.preventDefault()},[]),p=z3({commandName:e,active:t,enabled:r,attrs:n});let h=null;p.icon&&(h=ne(p.icon)?p.icon:p.icon.name);const m=l??p.label??"",b=c??m,v=a&&p.shortcut?` (${p.shortcut})`:"";return L.createElement(M3,{title:`${b}${v}`},L.createElement(w3,{component:"span",sx:{"&:not(:first-of-type)":{marginLeft:"-1px"}}},L.createElement(SX,{"aria-label":m,selected:t,disabled:!r,onMouseDown:f,color:"primary",size:"small",sx:{padding:"6px 12px","&.Mui-selected":{backgroundColor:"primary.main",color:"primary.contrastText"},"&.Mui-selected:hover":{backgroundColor:"primary.dark",color:"primary.contrastText"},"&:not(:first-of-type)":{borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-of-type)":{borderTopRightRadius:0,borderBottomRightRadius:0}},...u,value:e,onChange:d},L.createElement(Jee,{icon:p.icon},L.createElement(Yee,{icon:s??h})))))},Xee=({icon:e})=>ne(e)?L.createElement(Km,{name:e,size:"1rem"}):e,Qee=({label:e,"aria-label":t,icon:r,children:n,onClose:o,...i})=>{const s=S.useRef(Cl()),[a,l]=S.useState(null),c=!!a,u=S.useCallback(p=>{p.preventDefault()},[]),d=S.useCallback(p=>{l(p.currentTarget)},[]),f=S.useCallback((p,h)=>{l(null),o==null||o(p,h)},[o]);return L.createElement(L.Fragment,null,L.createElement(M3,{title:e??t},L.createElement(Dq,{"aria-label":t,"aria-controls":c?s.current:void 0,"aria-haspopup":!0,"aria-expanded":c?"true":void 0,onMouseDown:u,onClick:d,size:"small",sx:p=>({border:`1px solid ${p.palette.divider}`,borderRadius:`${p.shape.borderRadius}px`,padding:"6px 12px","&:not(:first-of-type)":{marginLeft:"-1px",borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-of-type)":{borderTopRightRadius:0,borderBottomRightRadius:0}})},r&&L.createElement(Xee,{icon:r}),L.createElement(Km,{name:"arrowDownSFill",size:"1rem"}))),L.createElement(ZJ,{...i,id:s.current,anchorEl:a,open:c,onClose:f},n))},Zee=e=>{const{insertHorizontalRule:t}=Tr();Qy();const r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=t.enabled();return L.createElement(dt,{...e,commandName:"insertHorizontalRule",enabled:n,onSelect:r})},ete=e=>{const{redo:t}=Tr(),{redoDepth:r}=lm(!0),n=S.useCallback(()=>{t.enabled()&&t()},[t]),o=r()>0;return L.createElement(dt,{...e,commandName:"redo",active:!1,enabled:o,onSelect:n})},tte=e=>{const{toggleBlockquote:t}=Tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=In().blockquote(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleBlockquote",active:n,enabled:o,onSelect:r})},iv=e=>{const{toggleBold:t}=Tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=In().bold(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleBold",active:n,enabled:o,onSelect:r})},rte=e=>{const{toggleBulletList:t}=Tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=In().bulletList(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleBulletList",active:n,enabled:o,onSelect:r})},nte=({attrs:e={},...t})=>{const{toggleCodeBlock:r}=Tr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=In().codeBlock(),i=r.enabled(e);return L.createElement(dt,{...t,commandName:"toggleCodeBlock",active:o,enabled:i,attrs:e,onSelect:n})},sv=e=>{const{toggleCode:t}=Tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=In().code(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleCode",active:n,enabled:o,onSelect:r})},c1=({attrs:e,...t})=>{const{toggleHeading:r}=Tr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=In().heading(e),i=r.enabled(e);return L.createElement(dt,{...t,commandName:"toggleHeading",active:o,enabled:i,attrs:e,onSelect:n})},av=e=>{const{toggleItalic:t}=Tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=In().italic(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleItalic",active:n,enabled:o,onSelect:r})},ote=e=>{const{toggleOrderedList:t}=Tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=In().orderedList(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleOrderedList",active:n,enabled:o,onSelect:r})},ite=e=>{const{toggleStrike:t}=Tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=In().strike(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleStrike",active:n,enabled:o,onSelect:r})},lv=e=>{const{toggleUnderline:t}=Tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=In().underline(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleUnderline",active:n,enabled:o,onSelect:r})},ste=e=>{const{undo:t}=Tr(),{undoDepth:r}=lm(!0),n=S.useCallback(()=>{t.enabled()&&t()},[t]),o=r()>0;return L.createElement(dt,{...e,commandName:"undo",active:!1,enabled:o,onSelect:n})},Xn=e=>L.createElement(w3,{sx:{display:"flex",alignItems:"center",width:"fit-content",bgcolor:"background.paper",color:"text.secondary"},...e}),ate=({children:e})=>L.createElement(Xn,null,L.createElement(iv,null),L.createElement(av,null),L.createElement(lv,null),L.createElement(ite,null),L.createElement(sv,null),e),lte=({icon:e})=>e?L.createElement(EJ,null,ne(e)?L.createElement(Km,{name:e,size:"1rem"}):L.createElement(L.Fragment,null,e)):null,cte=({commandName:e,active:t=!1,enabled:r,attrs:n,onSelect:o,onClick:i,icon:s,displayShortcut:a=!0,label:l,description:c,displayDescription:u=!0,...d})=>{const f=S.useCallback(g=>{o(),i==null||i(g)},[o,i]),p=S.useCallback(g=>{g.preventDefault()},[]),h=z3({commandName:e,active:t,enabled:r,attrs:n});let m=null;h.icon&&(m=ne(h.icon)?h.icon:h.icon.name);const b=l??h.label??"",v=u&&(c??h.description);return L.createElement(aX,{selected:t,disabled:!r,onMouseDown:p,...d,onClick:f},s!==null&&L.createElement(lte,{icon:s??m}),L.createElement(NJ,{primary:b,secondary:v}),a&&h.shortcut&&L.createElement(lu,{variant:"body2",color:"text.secondary",sx:{ml:2}},h.shortcut))},Tf=({attrs:e,...t})=>{const{toggleHeading:r}=Tr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=In().heading(e),i=r.enabled(e);return L.createElement(cte,{...t,commandName:"toggleHeading",active:o,enabled:i,attrs:e,onSelect:n})},ute={level:1},dte={level:2},HS={level:3},fte={level:4},pte={level:5},hte={level:6},mte=({showAll:e=!1,children:t})=>L.createElement(Xn,null,L.createElement(c1,{attrs:ute}),L.createElement(c1,{attrs:dte}),e?L.createElement(Qee,{"aria-label":"More heading options"},L.createElement(Tf,{attrs:HS}),L.createElement(Tf,{attrs:fte}),L.createElement(Tf,{attrs:pte}),L.createElement(Tf,{attrs:hte})):L.createElement(c1,{attrs:HS}),t),gte=({children:e})=>L.createElement(Xn,null,L.createElement(ste,null),L.createElement(ete,null),e);typeof br=="object"&&br.__esModule&&br.default&&br.default;var D3=S.createContext({});function vte(e={}){const t=S.useContext(D3),r=S.useMemo(()=>q4(t,e.theme??{}),[t,e.theme]),n=S.useMemo(()=>yV(r).styles,[r]),o=Vu(vV,e.className);return S.useMemo(()=>({style:n,className:o,theme:r}),[n,o,r])}var yte=e=>{var t,r,n,o,i,s,a,l;const{children:c,as:u="div"}=e,{theme:d,style:f,className:p}=vte({theme:e.theme??Ss}),h=bb({palette:{primary:{main:((t=d.color)==null?void 0:t.primary)??Ss.color.primary,dark:((n=(r=d.color)==null?void 0:r.hover)==null?void 0:n.primary)??Ss.color.hover.primary,contrastText:((o=d.color)==null?void 0:o.primaryText)??Ss.color.primaryText},secondary:{main:((i=d.color)==null?void 0:i.secondary)??Ss.color.secondary,dark:((a=(s=d.color)==null?void 0:s.hover)==null?void 0:a.secondary)??Ss.color.hover.secondary,contrastText:((l=d.color)==null?void 0:l.secondaryText)??Ss.color.secondaryText}}});return L.createElement(JK,{theme:h},L.createElement(D3.Provider,{value:d},L.createElement(u,{style:f,className:p},c)))},$3=e=>L.createElement(lJ,{direction:"row",spacing:1,sx:{backgroundColor:"background.paper",overflowX:"auto"},...e}),bte=[{name:"offset",options:{offset:[0,8]}}],xte=({positioner:e="selection",children:t,...r})=>{const{ref:n,x:o,y:i,width:s,height:a,active:l}=Fee(()=>j0(e),[e]),[c,u]=S.useState(null),d=S.useMemo(()=>({position:"absolute",pointerEvents:"none",left:o,top:i,width:s,height:a}),[o,i,s,a]),f=S.useCallback(p=>{u(p),n==null||n(p)},[n]);return L.createElement(L.Fragment,null,L.createElement("div",{ref:f,style:d}),L.createElement(Rb,{placement:"top",modifiers:bte,...r,open:l,anchorEl:c},L.createElement($3,null,t?L.createElement(L.Fragment,null,t):L.createElement(ate,null))))},Ct=_h(ch),zb=xt` +`),Sn.rippleVisible,Sq,tv,({theme:e})=>e.transitions.easing.easeInOut,Sn.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,Sn.child,Sn.childLeaving,Eq,tv,({theme:e})=>e.transitions.easing.easeInOut,Sn.childPulsate,Cq,({theme:e})=>e.transitions.easing.easeInOut),Oq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:s}=n,a=ve(n,kq),[l,c]=S.useState([]),u=S.useRef(0),d=S.useRef(null);S.useEffect(()=>{d.current&&(d.current(),d.current=null)},[l]);const f=S.useRef(!1),p=S.useRef(0),h=S.useRef(null),m=S.useRef(null);S.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const b=S.useCallback(x=>{const{pulsate:k,rippleX:w,rippleY:E,rippleSize:T,cb:C}=x;c(M=>[...M,O.jsx(Tq,{classes:{ripple:Ce(i.ripple,Sn.ripple),rippleVisible:Ce(i.rippleVisible,Sn.rippleVisible),ripplePulsate:Ce(i.ripplePulsate,Sn.ripplePulsate),child:Ce(i.child,Sn.child),childLeaving:Ce(i.childLeaving,Sn.childLeaving),childPulsate:Ce(i.childPulsate,Sn.childPulsate)},timeout:tv,pulsate:k,rippleX:w,rippleY:E,rippleSize:T},u.current)]),u.current+=1,d.current=C},[i]),v=S.useCallback((x={},k={},w=()=>{})=>{const{pulsate:E=!1,center:T=o||k.pulsate,fakeElement:C=!1}=k;if((x==null?void 0:x.type)==="mousedown"&&f.current){f.current=!1;return}(x==null?void 0:x.type)==="touchstart"&&(f.current=!0);const M=C?null:m.current,N=M?M.getBoundingClientRect():{width:0,height:0,left:0,top:0};let F,I,V;if(T||x===void 0||x.clientX===0&&x.clientY===0||!x.clientX&&!x.touches)F=Math.round(N.width/2),I=Math.round(N.height/2);else{const{clientX:j,clientY:z}=x.touches&&x.touches.length>0?x.touches[0]:x;F=Math.round(j-N.left),I=Math.round(z-N.top)}if(T)V=Math.sqrt((2*N.width**2+N.height**2)/3),V%2===0&&(V+=1);else{const j=Math.max(Math.abs((M?M.clientWidth:0)-F),F)*2+2,z=Math.max(Math.abs((M?M.clientHeight:0)-I),I)*2+2;V=Math.sqrt(j**2+z**2)}x!=null&&x.touches?h.current===null&&(h.current=()=>{b({pulsate:E,rippleX:F,rippleY:I,rippleSize:V,cb:w})},p.current=setTimeout(()=>{h.current&&(h.current(),h.current=null)},wq)):b({pulsate:E,rippleX:F,rippleY:I,rippleSize:V,cb:w})},[o,b]),g=S.useCallback(()=>{v({},{pulsate:!0})},[v]),y=S.useCallback((x,k)=>{if(clearTimeout(p.current),(x==null?void 0:x.type)==="touchend"&&h.current){h.current(),h.current=null,p.current=setTimeout(()=>{y(x,k)});return}h.current=null,c(w=>w.length>0?w.slice(1):w),d.current=k},[]);return S.useImperativeHandle(r,()=>({pulsate:g,start:v,stop:y}),[g,v,y]),O.jsx(Mq,_({className:Ce(Sn.root,i.root,s),ref:m},a,{children:O.jsx(fq,{component:null,exit:!0,children:l})}))}),_q=Oq;function Aq(e){return Vt("MuiButtonBase",e)}const Nq=jt("MuiButtonBase",["root","disabled","focusVisible"]),Rq=Nq,Pq=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],zq=e=>{const{disabled:t,focusVisible:r,focusVisibleClassName:n,classes:o}=e,s=rr({root:["root",t&&"disabled",r&&"focusVisible"]},Aq,o);return r&&n&&(s.root+=` ${n}`),s},Lq=Xe("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Rq.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Iq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:s,className:a,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:d=!1,focusRipple:f=!1,LinkComponent:p="a",onBlur:h,onClick:m,onContextMenu:b,onDragLeave:v,onFocus:g,onFocusVisible:y,onKeyDown:x,onKeyUp:k,onMouseDown:w,onMouseLeave:E,onMouseUp:T,onTouchEnd:C,onTouchMove:M,onTouchStart:N,tabIndex:F=0,TouchRippleProps:I,touchRippleRef:V,type:j}=n,z=ve(n,Pq),q=S.useRef(null),A=S.useRef(null),P=Ur(A,V),{isFocusVisibleRef:B,onFocus:Y,onBlur:J,ref:Ne}=PT(),[ie,ue]=S.useState(!1);c&&ie&&ue(!1),S.useImperativeHandle(o,()=>({focusVisible:()=>{ue(!0),q.current.focus()}}),[]);const[de,me]=S.useState(!1);S.useEffect(()=>{me(!0)},[]);const Me=de&&!u&&!c;S.useEffect(()=>{ie&&f&&!u&&de&&A.current.pulsate()},[u,f,ie,de]);function Se(fe,bn,fc=d){return Ks(gi=>(bn&&bn(gi),!fc&&A.current&&A.current[fe](gi),!0))}const ft=Se("start",w),rt=Se("stop",b),Or=Se("stop",v),he=Se("stop",T),De=Se("stop",fe=>{ie&&fe.preventDefault(),E&&E(fe)}),Ke=Se("start",N),Fn=Se("stop",C),Gr=Se("stop",M),nr=Se("stop",fe=>{J(fe),B.current===!1&&ue(!1),h&&h(fe)},!1),zo=Ks(fe=>{q.current||(q.current=fe.currentTarget),Y(fe),B.current===!0&&(ue(!0),y&&y(fe)),g&&g(fe)}),Pt=()=>{const fe=q.current;return l&&l!=="button"&&!(fe.tagName==="A"&&fe.href)},Yr=S.useRef(!1),vn=Ks(fe=>{f&&!Yr.current&&ie&&A.current&&fe.key===" "&&(Yr.current=!0,A.current.stop(fe,()=>{A.current.start(fe)})),fe.target===fe.currentTarget&&Pt()&&fe.key===" "&&fe.preventDefault(),x&&x(fe),fe.target===fe.currentTarget&&Pt()&&fe.key==="Enter"&&!c&&(fe.preventDefault(),m&&m(fe))}),Vn=Ks(fe=>{f&&fe.key===" "&&A.current&&ie&&!fe.defaultPrevented&&(Yr.current=!1,A.current.stop(fe,()=>{A.current.pulsate(fe)})),k&&k(fe),m&&fe.target===fe.currentTarget&&Pt()&&fe.key===" "&&!fe.defaultPrevented&&m(fe)});let Qe=l;Qe==="button"&&(z.href||z.to)&&(Qe=p);const Jr={};Qe==="button"?(Jr.type=j===void 0?"button":j,Jr.disabled=c):(!z.href&&!z.to&&(Jr.role="button"),c&&(Jr["aria-disabled"]=c));const yn=Ur(r,Ne,q),mi=_({},n,{centerRipple:i,component:l,disabled:c,disableRipple:u,disableTouchRipple:d,focusRipple:f,tabIndex:F,focusVisible:ie}),Oa=zq(mi);return O.jsxs(Lq,_({as:Qe,className:Ce(Oa.root,a),ownerState:mi,onBlur:nr,onClick:m,onContextMenu:rt,onFocus:zo,onKeyDown:vn,onKeyUp:Vn,onMouseDown:ft,onMouseLeave:De,onMouseUp:he,onDragLeave:Or,onTouchEnd:Fn,onTouchMove:Gr,onTouchStart:Ke,ref:yn,tabIndex:c?-1:F,type:j},Jr,z,{children:[s,Me?O.jsx(_q,_({ref:P,center:i},I)):null]}))}),Mb=Iq;function Dq(e){return Vt("MuiIconButton",e)}const $q=jt("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),Hq=$q,Bq=["edge","children","className","color","disabled","disableFocusRipple","size"],Fq=e=>{const{classes:t,disabled:r,color:n,edge:o,size:i}=e,s={root:["root",r&&"disabled",n!=="default"&&`color${Fe(n)}`,o&&`edge${Fe(o)}`,`size${Fe(i)}`]};return rr(s,Dq,t)},Vq=Xe(Mb,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.color!=="default"&&t[`color${Fe(r.color)}`],r.edge&&t[`edge${Fe(r.edge)}`],t[`size${Fe(r.size)}`]]}})(({theme:e,ownerState:t})=>_({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Lr(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12}),({theme:e,ownerState:t})=>{var r;const n=(r=(e.vars||e).palette)==null?void 0:r[t.color];return _({},t.color==="inherit"&&{color:"inherit"},t.color!=="inherit"&&t.color!=="default"&&_({color:n==null?void 0:n.main},!t.disableRipple&&{"&:hover":_({},n&&{backgroundColor:e.vars?`rgba(${n.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Lr(n.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),t.size==="small"&&{padding:5,fontSize:e.typography.pxToRem(18)},t.size==="large"&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${Hq.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})}),jq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiIconButton"}),{edge:o=!1,children:i,className:s,color:a="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium"}=n,d=ve(n,Bq),f=_({},n,{edge:o,color:a,disabled:l,disableFocusRipple:c,size:u}),p=Fq(f);return O.jsx(Vq,_({className:Ce(p.root,s),centerRipple:!0,focusRipple:!c,disabled:l,ref:r,ownerState:f},d,{children:i}))}),Uq=jq;function Wq(e){return Vt("MuiTypography",e)}jt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const Kq=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],qq=e=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:o,variant:i,classes:s}=e,a={root:["root",i,e.align!=="inherit"&&`align${Fe(t)}`,r&&"gutterBottom",n&&"noWrap",o&&"paragraph"]};return rr(a,Wq,s)},Gq=Xe("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.variant&&t[r.variant],r.align!=="inherit"&&t[`align${Fe(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>_({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&e.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),bS={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Yq={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Jq=e=>Yq[e]||e,Xq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiTypography"}),o=Jq(n.color),i=bb(_({},n,{color:o})),{align:s="inherit",className:a,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:d=!1,variant:f="body1",variantMapping:p=bS}=i,h=ve(i,Kq),m=_({},i,{align:s,color:o,className:a,component:l,gutterBottom:c,noWrap:u,paragraph:d,variant:f,variantMapping:p}),b=l||(d?"p":p[f]||bS[f])||"span",v=qq(m);return O.jsx(Gq,_({as:b,ref:r,ownerState:m,className:Ce(v.root,a)},h))}),cu=Xq;function h3(e){return typeof e=="string"}function uu(e,t,r){return e===void 0||h3(e)?t:_({},t,{ownerState:_({},t.ownerState,r)})}const Qq={disableDefaultClasses:!1},Zq=S.createContext(Qq);function eG(e){const{disableDefaultClasses:t}=S.useContext(Zq);return r=>t?"":e(r)}function m3(e,t=[]){if(e===void 0)return{};const r={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&typeof e[n]=="function"&&!t.includes(n)).forEach(n=>{r[n]=e[n]}),r}function tG(e,t,r){return typeof e=="function"?e(t,r):e}function xS(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(r=>!(r.match(/^on[A-Z]/)&&typeof e[r]=="function")).forEach(r=>{t[r]=e[r]}),t}function rG(e){const{getSlotProps:t,additionalProps:r,externalSlotProps:n,externalForwardedProps:o,className:i}=e;if(!t){const p=Ce(o==null?void 0:o.className,n==null?void 0:n.className,i,r==null?void 0:r.className),h=_({},r==null?void 0:r.style,o==null?void 0:o.style,n==null?void 0:n.style),m=_({},r,o,n);return p.length>0&&(m.className=p),Object.keys(h).length>0&&(m.style=h),{props:m,internalRef:void 0}}const s=m3(_({},o,n)),a=xS(n),l=xS(o),c=t(s),u=Ce(c==null?void 0:c.className,r==null?void 0:r.className,i,o==null?void 0:o.className,n==null?void 0:n.className),d=_({},c==null?void 0:c.style,r==null?void 0:r.style,o==null?void 0:o.style,n==null?void 0:n.style),f=_({},c,r,l,a);return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:c.ref}}const nG=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function si(e){var t;const{elementType:r,externalSlotProps:n,ownerState:o,skipResolvingSlotProps:i=!1}=e,s=ve(e,nG),a=i?{}:tG(n,o),{props:l,internalRef:c}=rG(_({},s,{externalSlotProps:a})),u=Ur(c,a==null?void 0:a.ref,(t=e.additionalProps)==null?void 0:t.ref);return uu(r,_({},l,{ref:u}),o)}function oG(e){const{badgeContent:t,invisible:r=!1,max:n=99,showZero:o=!1}=e,i=LT({badgeContent:t,max:n});let s=r;r===!1&&t===0&&!o&&(s=!0);const{badgeContent:a,max:l=n}=s?i:e,c=a&&Number(a)>l?`${l}+`:a;return{badgeContent:a,invisible:s,max:l,displayValue:c}}const iG=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function sG(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function aG(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=n=>e.ownerDocument.querySelector(`input[type="radio"]${n}`);let r=t(`[name="${e.name}"]:checked`);return r||(r=t(`[name="${e.name}"]`)),r!==e}function lG(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||aG(e))}function cG(e){const t=[],r=[];return Array.from(e.querySelectorAll(iG)).forEach((n,o)=>{const i=sG(n);i===-1||!lG(n)||(i===0?t.push(n):r.push({documentOrder:o,tabIndex:i,node:n}))}),r.sort((n,o)=>n.tabIndex===o.tabIndex?n.documentOrder-o.documentOrder:n.tabIndex-o.tabIndex).map(n=>n.node).concat(t)}function uG(){return!0}function dG(e){const{children:t,disableAutoFocus:r=!1,disableEnforceFocus:n=!1,disableRestoreFocus:o=!1,getTabbable:i=cG,isEnabled:s=uG,open:a}=e,l=S.useRef(!1),c=S.useRef(null),u=S.useRef(null),d=S.useRef(null),f=S.useRef(null),p=S.useRef(!1),h=S.useRef(null),m=Ur(t.ref,h),b=S.useRef(null);S.useEffect(()=>{!a||!h.current||(p.current=!r)},[r,a]),S.useEffect(()=>{if(!a||!h.current)return;const y=Br(h.current);return h.current.contains(y.activeElement)||(h.current.hasAttribute("tabIndex")||h.current.setAttribute("tabIndex","-1"),p.current&&h.current.focus()),()=>{o||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[a]),S.useEffect(()=>{if(!a||!h.current)return;const y=Br(h.current),x=E=>{b.current=E,!(n||!s()||E.key!=="Tab")&&y.activeElement===h.current&&E.shiftKey&&(l.current=!0,u.current&&u.current.focus())},k=()=>{const E=h.current;if(E===null)return;if(!y.hasFocus()||!s()||l.current){l.current=!1;return}if(E.contains(y.activeElement)||n&&y.activeElement!==c.current&&y.activeElement!==u.current)return;if(y.activeElement!==f.current)f.current=null;else if(f.current!==null)return;if(!p.current)return;let T=[];if((y.activeElement===c.current||y.activeElement===u.current)&&(T=i(h.current)),T.length>0){var C,M;const N=!!((C=b.current)!=null&&C.shiftKey&&((M=b.current)==null?void 0:M.key)==="Tab"),F=T[0],I=T[T.length-1];typeof F!="string"&&typeof I!="string"&&(N?I.focus():F.focus())}else E.focus()};y.addEventListener("focusin",k),y.addEventListener("keydown",x,!0);const w=setInterval(()=>{y.activeElement&&y.activeElement.tagName==="BODY"&&k()},50);return()=>{clearInterval(w),y.removeEventListener("focusin",k),y.removeEventListener("keydown",x,!0)}},[r,n,o,s,a,i]);const v=y=>{d.current===null&&(d.current=y.relatedTarget),p.current=!0,f.current=y.target;const x=t.props.onFocus;x&&x(y)},g=y=>{d.current===null&&(d.current=y.relatedTarget),p.current=!0};return O.jsxs(S.Fragment,{children:[O.jsx("div",{tabIndex:a?0:-1,onFocus:g,ref:c,"data-testid":"sentinelStart"}),S.cloneElement(t,{ref:m,onFocus:v}),O.jsx("div",{tabIndex:a?0:-1,onFocus:g,ref:u,"data-testid":"sentinelEnd"})]})}var Fr="top",Ln="bottom",In="right",Vr="left",Tb="auto",Gd=[Fr,Ln,In,Vr],Gl="start",gd="end",fG="clippingParents",g3="viewport",_c="popper",pG="reference",kS=Gd.reduce(function(e,t){return e.concat([t+"-"+Gl,t+"-"+gd])},[]),v3=[].concat(Gd,[Tb]).reduce(function(e,t){return e.concat([t,t+"-"+Gl,t+"-"+gd])},[]),hG="beforeRead",mG="read",gG="afterRead",vG="beforeMain",yG="main",bG="afterMain",xG="beforeWrite",kG="write",wG="afterWrite",SG=[hG,mG,gG,vG,yG,bG,xG,kG,wG];function No(e){return e?(e.nodeName||"").toLowerCase():null}function pn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function va(e){var t=pn(e).Element;return e instanceof t||e instanceof Element}function Nn(e){var t=pn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Ob(e){if(typeof ShadowRoot>"u")return!1;var t=pn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function EG(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},o=t.attributes[r]||{},i=t.elements[r];!Nn(i)||!No(i)||(Object.assign(i.style,n),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function CG(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var o=t.elements[n],i=t.attributes[n]||{},s=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),a=s.reduce(function(l,c){return l[c]="",l},{});!Nn(o)||!No(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const MG={name:"applyStyles",enabled:!0,phase:"write",fn:EG,effect:CG,requires:["computeStyles"]};function Co(e){return e.split("-")[0]}var ta=Math.max,vh=Math.min,Yl=Math.round;function rv(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function y3(){return!/^((?!chrome|android).)*safari/i.test(rv())}function Jl(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),o=1,i=1;t&&Nn(e)&&(o=e.offsetWidth>0&&Yl(n.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Yl(n.height)/e.offsetHeight||1);var s=va(e)?pn(e):window,a=s.visualViewport,l=!y3()&&r,c=(n.left+(l&&a?a.offsetLeft:0))/o,u=(n.top+(l&&a?a.offsetTop:0))/i,d=n.width/o,f=n.height/i;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function _b(e){var t=Jl(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function b3(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Ob(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function ai(e){return pn(e).getComputedStyle(e)}function TG(e){return["table","td","th"].indexOf(No(e))>=0}function ks(e){return((va(e)?e.ownerDocument:e.document)||window.document).documentElement}function Gm(e){return No(e)==="html"?e:e.assignedSlot||e.parentNode||(Ob(e)?e.host:null)||ks(e)}function wS(e){return!Nn(e)||ai(e).position==="fixed"?null:e.offsetParent}function OG(e){var t=/firefox/i.test(rv()),r=/Trident/i.test(rv());if(r&&Nn(e)){var n=ai(e);if(n.position==="fixed")return null}var o=Gm(e);for(Ob(o)&&(o=o.host);Nn(o)&&["html","body"].indexOf(No(o))<0;){var i=ai(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Yd(e){for(var t=pn(e),r=wS(e);r&&TG(r)&&ai(r).position==="static";)r=wS(r);return r&&(No(r)==="html"||No(r)==="body"&&ai(r).position==="static")?t:r||OG(e)||t}function Ab(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Au(e,t,r){return ta(e,vh(t,r))}function _G(e,t,r){var n=Au(e,t,r);return n>r?r:n}function x3(){return{top:0,right:0,bottom:0,left:0}}function k3(e){return Object.assign({},x3(),e)}function w3(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var AG=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,k3(typeof t!="number"?t:w3(t,Gd))};function NG(e){var t,r=e.state,n=e.name,o=e.options,i=r.elements.arrow,s=r.modifiersData.popperOffsets,a=Co(r.placement),l=Ab(a),c=[Vr,In].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var d=AG(o.padding,r),f=_b(i),p=l==="y"?Fr:Vr,h=l==="y"?Ln:In,m=r.rects.reference[u]+r.rects.reference[l]-s[l]-r.rects.popper[u],b=s[l]-r.rects.reference[l],v=Yd(i),g=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,y=m/2-b/2,x=d[p],k=g-f[u]-d[h],w=g/2-f[u]/2+y,E=Au(x,w,k),T=l;r.modifiersData[n]=(t={},t[T]=E,t.centerOffset=E-w,t)}}function RG(e){var t=e.state,r=e.options,n=r.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||b3(t.elements.popper,o)&&(t.elements.arrow=o))}const PG={name:"arrow",enabled:!0,phase:"main",fn:NG,effect:RG,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Xl(e){return e.split("-")[1]}var zG={top:"auto",right:"auto",bottom:"auto",left:"auto"};function LG(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:Yl(r*o)/o||0,y:Yl(n*o)/o||0}}function SS(e){var t,r=e.popper,n=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=s.x,p=f===void 0?0:f,h=s.y,m=h===void 0?0:h,b=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=b.x,m=b.y;var v=s.hasOwnProperty("x"),g=s.hasOwnProperty("y"),y=Vr,x=Fr,k=window;if(c){var w=Yd(r),E="clientHeight",T="clientWidth";if(w===pn(r)&&(w=ks(r),ai(w).position!=="static"&&a==="absolute"&&(E="scrollHeight",T="scrollWidth")),w=w,o===Fr||(o===Vr||o===In)&&i===gd){x=Ln;var C=d&&w===k&&k.visualViewport?k.visualViewport.height:w[E];m-=C-n.height,m*=l?1:-1}if(o===Vr||(o===Fr||o===Ln)&&i===gd){y=In;var M=d&&w===k&&k.visualViewport?k.visualViewport.width:w[T];p-=M-n.width,p*=l?1:-1}}var N=Object.assign({position:a},c&&zG),F=u===!0?LG({x:p,y:m},pn(r)):{x:p,y:m};if(p=F.x,m=F.y,l){var I;return Object.assign({},N,(I={},I[x]=g?"0":"",I[y]=v?"0":"",I.transform=(k.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",I))}return Object.assign({},N,(t={},t[x]=g?m+"px":"",t[y]=v?p+"px":"",t.transform="",t))}function IG(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=n===void 0?!0:n,i=r.adaptive,s=i===void 0?!0:i,a=r.roundOffsets,l=a===void 0?!0:a,c={placement:Co(t.placement),variation:Xl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,SS(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,SS(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const DG={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:IG,data:{}};var Cf={passive:!0};function $G(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,i=o===void 0?!0:o,s=n.resize,a=s===void 0?!0:s,l=pn(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",r.update,Cf)}),a&&l.addEventListener("resize",r.update,Cf),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",r.update,Cf)}),a&&l.removeEventListener("resize",r.update,Cf)}}const HG={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:$G,data:{}};var BG={left:"right",right:"left",bottom:"top",top:"bottom"};function hp(e){return e.replace(/left|right|bottom|top/g,function(t){return BG[t]})}var FG={start:"end",end:"start"};function ES(e){return e.replace(/start|end/g,function(t){return FG[t]})}function Nb(e){var t=pn(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function Rb(e){return Jl(ks(e)).left+Nb(e).scrollLeft}function VG(e,t){var r=pn(e),n=ks(e),o=r.visualViewport,i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=y3();(c||!c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+Rb(e),y:l}}function jG(e){var t,r=ks(e),n=Nb(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=ta(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=ta(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-n.scrollLeft+Rb(e),l=-n.scrollTop;return ai(o||r).direction==="rtl"&&(a+=ta(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function Pb(e){var t=ai(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function S3(e){return["html","body","#document"].indexOf(No(e))>=0?e.ownerDocument.body:Nn(e)&&Pb(e)?e:S3(Gm(e))}function Nu(e,t){var r;t===void 0&&(t=[]);var n=S3(e),o=n===((r=e.ownerDocument)==null?void 0:r.body),i=pn(n),s=o?[i].concat(i.visualViewport||[],Pb(n)?n:[]):n,a=t.concat(s);return o?a:a.concat(Nu(Gm(s)))}function nv(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function UG(e,t){var r=Jl(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function CS(e,t,r){return t===g3?nv(VG(e,r)):va(t)?UG(t,r):nv(jG(ks(e)))}function WG(e){var t=Nu(Gm(e)),r=["absolute","fixed"].indexOf(ai(e).position)>=0,n=r&&Nn(e)?Yd(e):e;return va(n)?t.filter(function(o){return va(o)&&b3(o,n)&&No(o)!=="body"}):[]}function KG(e,t,r,n){var o=t==="clippingParents"?WG(e):[].concat(t),i=[].concat(o,[r]),s=i[0],a=i.reduce(function(l,c){var u=CS(e,c,n);return l.top=ta(u.top,l.top),l.right=vh(u.right,l.right),l.bottom=vh(u.bottom,l.bottom),l.left=ta(u.left,l.left),l},CS(e,s,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function E3(e){var t=e.reference,r=e.element,n=e.placement,o=n?Co(n):null,i=n?Xl(n):null,s=t.x+t.width/2-r.width/2,a=t.y+t.height/2-r.height/2,l;switch(o){case Fr:l={x:s,y:t.y-r.height};break;case Ln:l={x:s,y:t.y+t.height};break;case In:l={x:t.x+t.width,y:a};break;case Vr:l={x:t.x-r.width,y:a};break;default:l={x:t.x,y:t.y}}var c=o?Ab(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case Gl:l[c]=l[c]-(t[u]/2-r[u]/2);break;case gd:l[c]=l[c]+(t[u]/2-r[u]/2);break}}return l}function vd(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=n===void 0?e.placement:n,i=r.strategy,s=i===void 0?e.strategy:i,a=r.boundary,l=a===void 0?fG:a,c=r.rootBoundary,u=c===void 0?g3:c,d=r.elementContext,f=d===void 0?_c:d,p=r.altBoundary,h=p===void 0?!1:p,m=r.padding,b=m===void 0?0:m,v=k3(typeof b!="number"?b:w3(b,Gd)),g=f===_c?pG:_c,y=e.rects.popper,x=e.elements[h?g:f],k=KG(va(x)?x:x.contextElement||ks(e.elements.popper),l,u,s),w=Jl(e.elements.reference),E=E3({reference:w,element:y,strategy:"absolute",placement:o}),T=nv(Object.assign({},y,E)),C=f===_c?T:w,M={top:k.top-C.top+v.top,bottom:C.bottom-k.bottom+v.bottom,left:k.left-C.left+v.left,right:C.right-k.right+v.right},N=e.modifiersData.offset;if(f===_c&&N){var F=N[o];Object.keys(M).forEach(function(I){var V=[In,Ln].indexOf(I)>=0?1:-1,j=[Fr,Ln].indexOf(I)>=0?"y":"x";M[I]+=F[j]*V})}return M}function qG(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=r.boundary,i=r.rootBoundary,s=r.padding,a=r.flipVariations,l=r.allowedAutoPlacements,c=l===void 0?v3:l,u=Xl(n),d=u?a?kS:kS.filter(function(h){return Xl(h)===u}):Gd,f=d.filter(function(h){return c.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,m){return h[m]=vd(e,{placement:m,boundary:o,rootBoundary:i,padding:s})[Co(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function GG(e){if(Co(e)===Tb)return[];var t=hp(e);return[ES(e),t,ES(t)]}function YG(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,i=o===void 0?!0:o,s=r.altAxis,a=s===void 0?!0:s,l=r.fallbackPlacements,c=r.padding,u=r.boundary,d=r.rootBoundary,f=r.altBoundary,p=r.flipVariations,h=p===void 0?!0:p,m=r.allowedAutoPlacements,b=t.options.placement,v=Co(b),g=v===b,y=l||(g||!h?[hp(b)]:GG(b)),x=[b].concat(y).reduce(function(ie,ue){return ie.concat(Co(ue)===Tb?qG(t,{placement:ue,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):ue)},[]),k=t.rects.reference,w=t.rects.popper,E=new Map,T=!0,C=x[0],M=0;M=0,j=V?"width":"height",z=vd(t,{placement:N,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),q=V?I?In:Vr:I?Ln:Fr;k[j]>w[j]&&(q=hp(q));var A=hp(q),P=[];if(i&&P.push(z[F]<=0),a&&P.push(z[q]<=0,z[A]<=0),P.every(function(ie){return ie})){C=N,T=!1;break}E.set(N,P)}if(T)for(var B=h?3:1,Y=function(ue){var de=x.find(function(me){var Me=E.get(me);if(Me)return Me.slice(0,ue).every(function(Se){return Se})});if(de)return C=de,"break"},J=B;J>0;J--){var Ne=Y(J);if(Ne==="break")break}t.placement!==C&&(t.modifiersData[n]._skip=!0,t.placement=C,t.reset=!0)}}const JG={name:"flip",enabled:!0,phase:"main",fn:YG,requiresIfExists:["offset"],data:{_skip:!1}};function MS(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function TS(e){return[Fr,In,Ln,Vr].some(function(t){return e[t]>=0})}function XG(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=vd(t,{elementContext:"reference"}),a=vd(t,{altBoundary:!0}),l=MS(s,n),c=MS(a,o,i),u=TS(l),d=TS(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const QG={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:XG};function ZG(e,t,r){var n=Co(e),o=[Vr,Fr].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Vr,In].indexOf(n)>=0?{x:a,y:s}:{x:s,y:a}}function eY(e){var t=e.state,r=e.options,n=e.name,o=r.offset,i=o===void 0?[0,0]:o,s=v3.reduce(function(u,d){return u[d]=ZG(d,t.rects,i),u},{}),a=s[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=s}const tY={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:eY};function rY(e){var t=e.state,r=e.name;t.modifiersData[r]=E3({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const nY={name:"popperOffsets",enabled:!0,phase:"read",fn:rY,data:{}};function oY(e){return e==="x"?"y":"x"}function iY(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,i=o===void 0?!0:o,s=r.altAxis,a=s===void 0?!1:s,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,d=r.padding,f=r.tether,p=f===void 0?!0:f,h=r.tetherOffset,m=h===void 0?0:h,b=vd(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=Co(t.placement),g=Xl(t.placement),y=!g,x=Ab(v),k=oY(x),w=t.modifiersData.popperOffsets,E=t.rects.reference,T=t.rects.popper,C=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,M=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,F={x:0,y:0};if(w){if(i){var I,V=x==="y"?Fr:Vr,j=x==="y"?Ln:In,z=x==="y"?"height":"width",q=w[x],A=q+b[V],P=q-b[j],B=p?-T[z]/2:0,Y=g===Gl?E[z]:T[z],J=g===Gl?-T[z]:-E[z],Ne=t.elements.arrow,ie=p&&Ne?_b(Ne):{width:0,height:0},ue=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:x3(),de=ue[V],me=ue[j],Me=Au(0,E[z],ie[z]),Se=y?E[z]/2-B-Me-de-M.mainAxis:Y-Me-de-M.mainAxis,ft=y?-E[z]/2+B+Me+me+M.mainAxis:J+Me+me+M.mainAxis,rt=t.elements.arrow&&Yd(t.elements.arrow),Or=rt?x==="y"?rt.clientTop||0:rt.clientLeft||0:0,he=(I=N==null?void 0:N[x])!=null?I:0,De=q+Se-he-Or,Ke=q+ft-he,Fn=Au(p?vh(A,De):A,q,p?ta(P,Ke):P);w[x]=Fn,F[x]=Fn-q}if(a){var Gr,nr=x==="x"?Fr:Vr,zo=x==="x"?Ln:In,Pt=w[k],Yr=k==="y"?"height":"width",vn=Pt+b[nr],Vn=Pt-b[zo],Qe=[Fr,Vr].indexOf(v)!==-1,Jr=(Gr=N==null?void 0:N[k])!=null?Gr:0,yn=Qe?vn:Pt-E[Yr]-T[Yr]-Jr+M.altAxis,mi=Qe?Pt+E[Yr]+T[Yr]-Jr-M.altAxis:Vn,Oa=p&&Qe?_G(yn,Pt,mi):Au(p?yn:vn,Pt,p?mi:Vn);w[k]=Oa,F[k]=Oa-Pt}t.modifiersData[n]=F}}const sY={name:"preventOverflow",enabled:!0,phase:"main",fn:iY,requiresIfExists:["offset"]};function aY(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function lY(e){return e===pn(e)||!Nn(e)?Nb(e):aY(e)}function cY(e){var t=e.getBoundingClientRect(),r=Yl(t.width)/e.offsetWidth||1,n=Yl(t.height)/e.offsetHeight||1;return r!==1||n!==1}function uY(e,t,r){r===void 0&&(r=!1);var n=Nn(t),o=Nn(t)&&cY(t),i=ks(t),s=Jl(e,o,r),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&((No(t)!=="body"||Pb(i))&&(a=lY(t)),Nn(t)?(l=Jl(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Rb(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function dY(e){var t=new Map,r=new Set,n=[];e.forEach(function(i){t.set(i.name,i)});function o(i){r.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!r.has(a)){var l=t.get(a);l&&o(l)}}),n.push(i)}return e.forEach(function(i){r.has(i.name)||o(i)}),n}function fY(e){var t=dY(e);return SG.reduce(function(r,n){return r.concat(t.filter(function(o){return o.phase===n}))},[])}function pY(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function hY(e){var t=e.reduce(function(r,n){var o=r[n.name];return r[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var OS={placement:"bottom",modifiers:[],strategy:"absolute"};function _S(){for(var e=arguments.length,t=new Array(e),r=0;r{i||a(yY(o)||document.body)},[o,i]),ha(()=>{if(s&&!i)return Y0(r,s),()=>{Y0(r,null)}},[r,s,i]),i){if(S.isValidElement(n)){const c={ref:l};return S.cloneElement(n,c)}return O.jsx(S.Fragment,{children:n})}return O.jsx(S.Fragment,{children:s&&am.createPortal(n,s)})});function bY(e){return Vt("MuiPopper",e)}jt("MuiPopper",["root"]);const xY=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],kY=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function wY(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function ov(e){return typeof e=="function"?e():e}function SY(e){return e.nodeType!==void 0}const EY=()=>rr({root:["root"]},eG(bY)),CY={},MY=S.forwardRef(function(t,r){var n;const{anchorEl:o,children:i,direction:s,disablePortal:a,modifiers:l,open:c,placement:u,popperOptions:d,popperRef:f,slotProps:p={},slots:h={},TransitionProps:m}=t,b=ve(t,xY),v=S.useRef(null),g=Ur(v,r),y=S.useRef(null),x=Ur(y,f),k=S.useRef(x);ha(()=>{k.current=x},[x]),S.useImperativeHandle(f,()=>y.current,[]);const w=wY(u,s),[E,T]=S.useState(w),[C,M]=S.useState(ov(o));S.useEffect(()=>{y.current&&y.current.forceUpdate()}),S.useEffect(()=>{o&&M(ov(o))},[o]),ha(()=>{if(!C||!c)return;const j=A=>{T(A.placement)};let z=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:A})=>{j(A)}}];l!=null&&(z=z.concat(l)),d&&d.modifiers!=null&&(z=z.concat(d.modifiers));const q=vY(C,v.current,_({placement:w},d,{modifiers:z}));return k.current(q),()=>{q.destroy(),k.current(null)}},[C,a,l,c,d,w]);const N={placement:E};m!==null&&(N.TransitionProps=m);const F=EY(),I=(n=h.root)!=null?n:"div",V=si({elementType:I,externalSlotProps:p.root,externalForwardedProps:b,additionalProps:{role:"tooltip",ref:g},ownerState:t,className:F.root});return O.jsx(I,_({},V,{children:typeof i=="function"?i(N):i}))}),TY=S.forwardRef(function(t,r){const{anchorEl:n,children:o,container:i,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:c,open:u,placement:d="bottom",popperOptions:f=CY,popperRef:p,style:h,transition:m=!1,slotProps:b={},slots:v={}}=t,g=ve(t,kY),[y,x]=S.useState(!0),k=()=>{x(!1)},w=()=>{x(!0)};if(!l&&!u&&(!m||y))return null;let E;if(i)E=i;else if(n){const M=ov(n);E=M&&SY(M)?Br(M).body:Br(null).body}const T=!u&&l&&(!m||y)?"none":void 0,C=m?{in:u,onEnter:k,onExited:w}:void 0;return O.jsx(C3,{disablePortal:a,container:E,children:O.jsx(MY,_({anchorEl:n,direction:s,disablePortal:a,modifiers:c,ref:r,open:m?!y:u,placement:d,popperOptions:f,popperRef:p,slotProps:b,slots:v},g,{style:_({position:"fixed",top:0,left:0,display:T},h),TransitionProps:C,children:o}))})});function OY(e){const t=Br(e);return t.body===e?fd(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function Ru(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function AS(e){return parseInt(fd(e).getComputedStyle(e).paddingRight,10)||0}function _Y(e){const r=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,n=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return r||n}function NS(e,t,r,n,o){const i=[t,r,...n];[].forEach.call(e.children,s=>{const a=i.indexOf(s)===-1,l=!_Y(s);a&&l&&Ru(s,o)})}function n1(e,t){let r=-1;return e.some((n,o)=>t(n)?(r=o,!0):!1),r}function AY(e,t){const r=[],n=e.container;if(!t.disableScrollLock){if(OY(n)){const s=zT(Br(n));r.push({value:n.style.paddingRight,property:"padding-right",el:n}),n.style.paddingRight=`${AS(n)+s}px`;const a=Br(n).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{r.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${AS(l)+s}px`})}let i;if(n.parentNode instanceof DocumentFragment)i=Br(n).body;else{const s=n.parentElement,a=fd(n);i=(s==null?void 0:s.nodeName)==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:n}r.push({value:i.style.overflow,property:"overflow",el:i},{value:i.style.overflowX,property:"overflow-x",el:i},{value:i.style.overflowY,property:"overflow-y",el:i}),i.style.overflow="hidden"}return()=>{r.forEach(({value:i,el:s,property:a})=>{i?s.style.setProperty(a,i):s.style.removeProperty(a)})}}function NY(e){const t=[];return[].forEach.call(e.children,r=>{r.getAttribute("aria-hidden")==="true"&&t.push(r)}),t}class RY{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,r){let n=this.modals.indexOf(t);if(n!==-1)return n;n=this.modals.length,this.modals.push(t),t.modalRef&&Ru(t.modalRef,!1);const o=NY(r);NS(r,t.mount,t.modalRef,o,!0);const i=n1(this.containers,s=>s.container===r);return i!==-1?(this.containers[i].modals.push(t),n):(this.containers.push({modals:[t],container:r,restore:null,hiddenSiblings:o}),n)}mount(t,r){const n=n1(this.containers,i=>i.modals.indexOf(t)!==-1),o=this.containers[n];o.restore||(o.restore=AY(o,r))}remove(t,r=!0){const n=this.modals.indexOf(t);if(n===-1)return n;const o=n1(this.containers,s=>s.modals.indexOf(t)!==-1),i=this.containers[o];if(i.modals.splice(i.modals.indexOf(t),1),this.modals.splice(n,1),i.modals.length===0)i.restore&&i.restore(),t.modalRef&&Ru(t.modalRef,r),NS(i.container,t.mount,t.modalRef,i.hiddenSiblings,!1),this.containers.splice(o,1);else{const s=i.modals[i.modals.length-1];s.modalRef&&Ru(s.modalRef,!1)}return n}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function PY(e){return typeof e=="function"?e():e}function zY(e){return e?e.props.hasOwnProperty("in"):!1}const LY=new RY;function IY(e){const{container:t,disableEscapeKeyDown:r=!1,disableScrollLock:n=!1,manager:o=LY,closeAfterTransition:i=!1,onTransitionEnter:s,onTransitionExited:a,children:l,onClose:c,open:u,rootRef:d}=e,f=S.useRef({}),p=S.useRef(null),h=S.useRef(null),m=Ur(h,d),[b,v]=S.useState(!u),g=zY(l);let y=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(y=!1);const x=()=>Br(p.current),k=()=>(f.current.modalRef=h.current,f.current.mount=p.current,f.current),w=()=>{o.mount(k(),{disableScrollLock:n}),h.current&&(h.current.scrollTop=0)},E=Ks(()=>{const z=PY(t)||x().body;o.add(k(),z),h.current&&w()}),T=S.useCallback(()=>o.isTopModal(k()),[o]),C=Ks(z=>{p.current=z,z&&(u&&T()?w():h.current&&Ru(h.current,y))}),M=S.useCallback(()=>{o.remove(k(),y)},[y,o]);S.useEffect(()=>()=>{M()},[M]),S.useEffect(()=>{u?E():(!g||!i)&&M()},[u,M,g,i,E]);const N=z=>q=>{var A;(A=z.onKeyDown)==null||A.call(z,q),!(q.key!=="Escape"||!T())&&(r||(q.stopPropagation(),c&&c(q,"escapeKeyDown")))},F=z=>q=>{var A;(A=z.onClick)==null||A.call(z,q),q.target===q.currentTarget&&c&&c(q,"backdropClick")};return{getRootProps:(z={})=>{const q=m3(e);delete q.onTransitionEnter,delete q.onTransitionExited;const A=_({},q,z);return _({role:"presentation"},A,{onKeyDown:N(A),ref:m})},getBackdropProps:(z={})=>{const q=z;return _({"aria-hidden":!0},q,{onClick:F(q),open:u})},getTransitionProps:()=>{const z=()=>{v(!1),s&&s()},q=()=>{v(!0),a&&a(),i&&M()};return{onEnter:Vw(z,l==null?void 0:l.props.onEnter),onExited:Vw(q,l==null?void 0:l.props.onExited)}},rootRef:m,portalRef:C,isTopModal:T,exited:b,hasTransition:g}}const DY=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],$Y=Xe(TY,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),HY=S.forwardRef(function(t,r){var n;const o=vb(),i=Wt({props:t,name:"MuiPopper"}),{anchorEl:s,component:a,components:l,componentsProps:c,container:u,disablePortal:d,keepMounted:f,modifiers:p,open:h,placement:m,popperOptions:b,popperRef:v,transition:g,slots:y,slotProps:x}=i,k=ve(i,DY),w=(n=y==null?void 0:y.root)!=null?n:l==null?void 0:l.Root,E=_({anchorEl:s,container:u,disablePortal:d,keepMounted:f,modifiers:p,open:h,placement:m,popperOptions:b,popperRef:v,transition:g},k);return O.jsx($Y,_({as:a,direction:o==null?void 0:o.direction,slots:{root:w},slotProps:x??c},E,{ref:r}))}),zb=HY,BY=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],FY={entering:{opacity:1},entered:{opacity:1}},VY=S.forwardRef(function(t,r){const n=Km(),o={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:s=!0,children:a,easing:l,in:c,onEnter:u,onEntered:d,onEntering:f,onExit:p,onExited:h,onExiting:m,style:b,timeout:v=o,TransitionComponent:g=f3}=t,y=ve(t,BY),x=S.useRef(null),k=Ur(x,a.ref,r),w=V=>j=>{if(V){const z=x.current;j===void 0?V(z):V(z,j)}},E=w(f),T=w((V,j)=>{p3(V);const z=gh({style:b,timeout:v,easing:l},{mode:"enter"});V.style.webkitTransition=n.transitions.create("opacity",z),V.style.transition=n.transitions.create("opacity",z),u&&u(V,j)}),C=w(d),M=w(m),N=w(V=>{const j=gh({style:b,timeout:v,easing:l},{mode:"exit"});V.style.webkitTransition=n.transitions.create("opacity",j),V.style.transition=n.transitions.create("opacity",j),p&&p(V)}),F=w(h),I=V=>{i&&i(x.current,V)};return O.jsx(g,_({appear:s,in:c,nodeRef:x,onEnter:T,onEntered:C,onEntering:E,onExit:N,onExited:F,onExiting:M,addEndListener:I,timeout:v},y,{children:(V,j)=>S.cloneElement(a,_({style:_({opacity:0,visibility:V==="exited"&&!c?"hidden":void 0},FY[V],b,a.props.style),ref:k},j))}))}),jY=VY;function UY(e){return Vt("MuiBackdrop",e)}jt("MuiBackdrop",["root","invisible"]);const WY=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],KY=e=>{const{classes:t,invisible:r}=e;return rr({root:["root",r&&"invisible"]},UY,t)},qY=Xe("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.invisible&&t.invisible]}})(({ownerState:e})=>_({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),GY=S.forwardRef(function(t,r){var n,o,i;const s=Wt({props:t,name:"MuiBackdrop"}),{children:a,className:l,component:c="div",components:u={},componentsProps:d={},invisible:f=!1,open:p,slotProps:h={},slots:m={},TransitionComponent:b=jY,transitionDuration:v}=s,g=ve(s,WY),y=_({},s,{component:c,invisible:f}),x=KY(y),k=(n=h.root)!=null?n:d.root;return O.jsx(b,_({in:p,timeout:v},g,{children:O.jsx(qY,_({"aria-hidden":!0},k,{as:(o=(i=m.root)!=null?i:u.Root)!=null?o:c,className:Ce(x.root,l,k==null?void 0:k.className),ownerState:_({},y,k==null?void 0:k.ownerState),classes:x,ref:r,children:a}))}))}),YY=GY;function JY(e){return Vt("MuiBadge",e)}const XY=jt("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),bi=XY,QY=["anchorOrigin","className","classes","component","components","componentsProps","children","overlap","color","invisible","max","badgeContent","slots","slotProps","showZero","variant"],o1=10,i1=4,ZY=e=>{const{color:t,anchorOrigin:r,invisible:n,overlap:o,variant:i,classes:s={}}=e,a={root:["root"],badge:["badge",i,n&&"invisible",`anchorOrigin${Fe(r.vertical)}${Fe(r.horizontal)}`,`anchorOrigin${Fe(r.vertical)}${Fe(r.horizontal)}${Fe(o)}`,`overlap${Fe(o)}`,t!=="default"&&`color${Fe(t)}`]};return rr(a,JY,s)},eJ=Xe("span",{name:"MuiBadge",slot:"Root",overridesResolver:(e,t)=>t.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),tJ=Xe("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.badge,t[r.variant],t[`anchorOrigin${Fe(r.anchorOrigin.vertical)}${Fe(r.anchorOrigin.horizontal)}${Fe(r.overlap)}`],r.color!=="default"&&t[`color${Fe(r.color)}`],r.invisible&&t.invisible]}})(({theme:e,ownerState:t})=>_({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:o1*2,lineHeight:1,padding:"0 6px",height:o1*2,borderRadius:o1,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen})},t.color!=="default"&&{backgroundColor:(e.vars||e).palette[t.color].main,color:(e.vars||e).palette[t.color].contrastText},t.variant==="dot"&&{borderRadius:i1,height:i1*2,minWidth:i1*2,padding:0},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular"&&{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular"&&{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular"&&{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular"&&{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular"&&{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular"&&{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular"&&{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular"&&{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}},t.invisible&&{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})})),rJ=S.forwardRef(function(t,r){var n,o,i,s,a,l;const c=Wt({props:t,name:"MuiBadge"}),{anchorOrigin:u={vertical:"top",horizontal:"right"},className:d,component:f,components:p={},componentsProps:h={},children:m,overlap:b="rectangular",color:v="default",invisible:g=!1,max:y=99,badgeContent:x,slots:k,slotProps:w,showZero:E=!1,variant:T="standard"}=c,C=ve(c,QY),{badgeContent:M,invisible:N,max:F,displayValue:I}=oG({max:y,invisible:g,badgeContent:x,showZero:E}),V=LT({anchorOrigin:u,color:v,overlap:b,variant:T,badgeContent:x}),j=N||M==null&&T!=="dot",{color:z=v,overlap:q=b,anchorOrigin:A=u,variant:P=T}=j?V:c,B=P!=="dot"?I:void 0,Y=_({},c,{badgeContent:M,invisible:j,max:F,displayValue:B,showZero:E,anchorOrigin:A,color:z,overlap:q,variant:P}),J=ZY(Y),Ne=(n=(o=k==null?void 0:k.root)!=null?o:p.Root)!=null?n:eJ,ie=(i=(s=k==null?void 0:k.badge)!=null?s:p.Badge)!=null?i:tJ,ue=(a=w==null?void 0:w.root)!=null?a:h.root,de=(l=w==null?void 0:w.badge)!=null?l:h.badge,me=si({elementType:Ne,externalSlotProps:ue,externalForwardedProps:C,additionalProps:{ref:r,as:f},ownerState:Y,className:Ce(ue==null?void 0:ue.className,J.root,d)}),Me=si({elementType:ie,externalSlotProps:de,ownerState:Y,className:Ce(J.badge,de==null?void 0:de.className)});return O.jsxs(Ne,_({},me,{children:[m,O.jsx(ie,_({},Me,{children:B}))]}))}),nJ=rJ,oJ=kb(),iJ=JW({themeId:Kl,defaultTheme:oJ,defaultClassName:"MuiBox-root",generateClassName:DT.generate}),M3=iJ;function sJ(e){return Vt("MuiModal",e)}jt("MuiModal",["root","hidden","backdrop"]);const aJ=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],lJ=e=>{const{open:t,exited:r,classes:n}=e;return rr({root:["root",!t&&r&&"hidden"],backdrop:["backdrop"]},sJ,n)},cJ=Xe("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.open&&r.exited&&t.hidden]}})(({theme:e,ownerState:t})=>_({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),uJ=Xe(YY,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),dJ=S.forwardRef(function(t,r){var n,o,i,s,a,l;const c=Wt({name:"MuiModal",props:t}),{BackdropComponent:u=uJ,BackdropProps:d,className:f,closeAfterTransition:p=!1,children:h,container:m,component:b,components:v={},componentsProps:g={},disableAutoFocus:y=!1,disableEnforceFocus:x=!1,disableEscapeKeyDown:k=!1,disablePortal:w=!1,disableRestoreFocus:E=!1,disableScrollLock:T=!1,hideBackdrop:C=!1,keepMounted:M=!1,onBackdropClick:N,open:F,slotProps:I,slots:V}=c,j=ve(c,aJ),z=_({},c,{closeAfterTransition:p,disableAutoFocus:y,disableEnforceFocus:x,disableEscapeKeyDown:k,disablePortal:w,disableRestoreFocus:E,disableScrollLock:T,hideBackdrop:C,keepMounted:M}),{getRootProps:q,getBackdropProps:A,getTransitionProps:P,portalRef:B,isTopModal:Y,exited:J,hasTransition:Ne}=IY(_({},z,{rootRef:r})),ie=_({},z,{exited:J}),ue=lJ(ie),de={};if(h.props.tabIndex===void 0&&(de.tabIndex="-1"),Ne){const{onEnter:he,onExited:De}=P();de.onEnter=he,de.onExited=De}const me=(n=(o=V==null?void 0:V.root)!=null?o:v.Root)!=null?n:cJ,Me=(i=(s=V==null?void 0:V.backdrop)!=null?s:v.Backdrop)!=null?i:u,Se=(a=I==null?void 0:I.root)!=null?a:g.root,ft=(l=I==null?void 0:I.backdrop)!=null?l:g.backdrop,rt=si({elementType:me,externalSlotProps:Se,externalForwardedProps:j,getSlotProps:q,additionalProps:{ref:r,as:b},ownerState:ie,className:Ce(f,Se==null?void 0:Se.className,ue==null?void 0:ue.root,!ie.open&&ie.exited&&(ue==null?void 0:ue.hidden))}),Or=si({elementType:Me,externalSlotProps:ft,additionalProps:d,getSlotProps:he=>A(_({},he,{onClick:De=>{N&&N(De),he!=null&&he.onClick&&he.onClick(De)}})),className:Ce(ft==null?void 0:ft.className,d==null?void 0:d.className,ue==null?void 0:ue.backdrop),ownerState:ie});return!M&&!F&&(!Ne||J)?null:O.jsx(C3,{ref:B,container:m,disablePortal:w,children:O.jsxs(me,_({},rt,{children:[!C&&u?O.jsx(Me,_({},Or)):null,O.jsx(dG,{disableEnforceFocus:x,disableAutoFocus:y,disableRestoreFocus:E,isEnabled:Y,open:F,children:S.cloneElement(h,de)})]}))})}),fJ=dJ,pJ=jt("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),RS=pJ,hJ=OK({createStyledComponent:Xe("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>Wt({props:e,name:"MuiStack"})}),mJ=hJ,gJ=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function iv(e){return`scale(${e}, ${e**2})`}const vJ={entering:{opacity:1,transform:iv(1)},entered:{opacity:1,transform:"none"}},s1=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),T3=S.forwardRef(function(t,r){const{addEndListener:n,appear:o=!0,children:i,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:d,onExited:f,onExiting:p,style:h,timeout:m="auto",TransitionComponent:b=f3}=t,v=ve(t,gJ),g=S.useRef(),y=S.useRef(),x=Km(),k=S.useRef(null),w=Ur(k,i.ref,r),E=j=>z=>{if(j){const q=k.current;z===void 0?j(q):j(q,z)}},T=E(u),C=E((j,z)=>{p3(j);const{duration:q,delay:A,easing:P}=gh({style:h,timeout:m,easing:s},{mode:"enter"});let B;m==="auto"?(B=x.transitions.getAutoHeightDuration(j.clientHeight),y.current=B):B=q,j.style.transition=[x.transitions.create("opacity",{duration:B,delay:A}),x.transitions.create("transform",{duration:s1?B:B*.666,delay:A,easing:P})].join(","),l&&l(j,z)}),M=E(c),N=E(p),F=E(j=>{const{duration:z,delay:q,easing:A}=gh({style:h,timeout:m,easing:s},{mode:"exit"});let P;m==="auto"?(P=x.transitions.getAutoHeightDuration(j.clientHeight),y.current=P):P=z,j.style.transition=[x.transitions.create("opacity",{duration:P,delay:q}),x.transitions.create("transform",{duration:s1?P:P*.666,delay:s1?q:q||P*.333,easing:A})].join(","),j.style.opacity=0,j.style.transform=iv(.75),d&&d(j)}),I=E(f),V=j=>{m==="auto"&&(g.current=setTimeout(j,y.current||0)),n&&n(k.current,j)};return S.useEffect(()=>()=>{clearTimeout(g.current)},[]),O.jsx(b,_({appear:o,in:a,nodeRef:k,onEnter:C,onEntered:M,onEntering:T,onExit:F,onExited:I,onExiting:N,addEndListener:V,timeout:m==="auto"?null:m},v,{children:(j,z)=>S.cloneElement(i,_({style:_({opacity:0,transform:iv(.75),visibility:j==="exited"&&!a?"hidden":void 0},vJ[j],h,i.props.style),ref:w},z))}))});T3.muiSupportAuto=!0;const sv=T3,yJ=S.createContext({}),yd=yJ;function bJ(e){return Vt("MuiList",e)}jt("MuiList",["root","padding","dense","subheader"]);const xJ=["children","className","component","dense","disablePadding","subheader"],kJ=e=>{const{classes:t,disablePadding:r,dense:n,subheader:o}=e;return rr({root:["root",!r&&"padding",n&&"dense",o&&"subheader"]},bJ,t)},wJ=Xe("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disablePadding&&t.padding,r.dense&&t.dense,r.subheader&&t.subheader]}})(({ownerState:e})=>_({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),SJ=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiList"}),{children:o,className:i,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:c}=n,u=ve(n,xJ),d=S.useMemo(()=>({dense:a}),[a]),f=_({},n,{component:s,dense:a,disablePadding:l}),p=kJ(f);return O.jsx(yd.Provider,{value:d,children:O.jsxs(wJ,_({as:s,className:Ce(p.root,i),ref:r,ownerState:f},u,{children:[c,o]}))})}),EJ=SJ;function CJ(e){return Vt("MuiListItemIcon",e)}const MJ=jt("MuiListItemIcon",["root","alignItemsFlexStart"]),PS=MJ,TJ=["className"],OJ=e=>{const{alignItems:t,classes:r}=e;return rr({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},CJ,r)},_J=Xe("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(({theme:e,ownerState:t})=>_({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex"},t.alignItems==="flex-start"&&{marginTop:8})),AJ=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiListItemIcon"}),{className:o}=n,i=ve(n,TJ),s=S.useContext(yd),a=_({},n,{alignItems:s.alignItems}),l=OJ(a);return O.jsx(_J,_({className:Ce(l.root,o),ownerState:a,ref:r},i))}),NJ=AJ;function RJ(e){return Vt("MuiListItemText",e)}const PJ=jt("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),yh=PJ,zJ=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],LJ=e=>{const{classes:t,inset:r,primary:n,secondary:o,dense:i}=e;return rr({root:["root",r&&"inset",i&&"dense",n&&o&&"multiline"],primary:["primary"],secondary:["secondary"]},RJ,t)},IJ=Xe("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${yh.primary}`]:t.primary},{[`& .${yh.secondary}`]:t.secondary},t.root,r.inset&&t.inset,r.primary&&r.secondary&&t.multiline,r.dense&&t.dense]}})(({ownerState:e})=>_({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},e.primary&&e.secondary&&{marginTop:6,marginBottom:6},e.inset&&{paddingLeft:56})),DJ=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiListItemText"}),{children:o,className:i,disableTypography:s=!1,inset:a=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:d}=n,f=ve(n,zJ),{dense:p}=S.useContext(yd);let h=l??o,m=u;const b=_({},n,{disableTypography:s,inset:a,primary:!!h,secondary:!!m,dense:p}),v=LJ(b);return h!=null&&h.type!==cu&&!s&&(h=O.jsx(cu,_({variant:p?"body2":"body1",className:v.primary,component:c!=null&&c.variant?void 0:"span",display:"block"},c,{children:h}))),m!=null&&m.type!==cu&&!s&&(m=O.jsx(cu,_({variant:"body2",className:v.secondary,color:"text.secondary",display:"block"},d,{children:m}))),O.jsxs(IJ,_({className:Ce(v.root,i),ownerState:b,ref:r},f,{children:[h,m]}))}),$J=DJ,HJ=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function a1(e,t,r){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:r?null:e.firstChild}function zS(e,t,r){return e===t?r?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:r?null:e.lastChild}function O3(e,t){if(t===void 0)return!0;let r=e.innerText;return r===void 0&&(r=e.textContent),r=r.trim().toLowerCase(),r.length===0?!1:t.repeating?r[0]===t.keys[0]:r.indexOf(t.keys.join(""))===0}function Ac(e,t,r,n,o,i){let s=!1,a=o(e,t,t?r:!1);for(;a;){if(a===e.firstChild){if(s)return!1;s=!0}const l=n?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!O3(a,i)||l)a=o(e,a,r);else return a.focus(),!0}return!1}const BJ=S.forwardRef(function(t,r){const{actions:n,autoFocus:o=!1,autoFocusItem:i=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:d="selectedMenu"}=t,f=ve(t,HJ),p=S.useRef(null),h=S.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});ha(()=>{o&&p.current.focus()},[o]),S.useImperativeHandle(n,()=>({adjustStyleForScrollbar:(y,x)=>{const k=!p.current.style.width;if(y.clientHeight{const x=p.current,k=y.key,w=Br(x).activeElement;if(k==="ArrowDown")y.preventDefault(),Ac(x,w,c,l,a1);else if(k==="ArrowUp")y.preventDefault(),Ac(x,w,c,l,zS);else if(k==="Home")y.preventDefault(),Ac(x,null,c,l,a1);else if(k==="End")y.preventDefault(),Ac(x,null,c,l,zS);else if(k.length===1){const E=h.current,T=k.toLowerCase(),C=performance.now();E.keys.length>0&&(C-E.lastTime>500?(E.keys=[],E.repeating=!0,E.previousKeyMatched=!0):E.repeating&&T!==E.keys[0]&&(E.repeating=!1)),E.lastTime=C,E.keys.push(T);const M=w&&!E.repeating&&O3(w,E);E.previousKeyMatched&&(M||Ac(x,w,!1,l,a1,E))?y.preventDefault():E.previousKeyMatched=!1}u&&u(y)},b=Ur(p,r);let v=-1;S.Children.forEach(s,(y,x)=>{if(!S.isValidElement(y)){v===x&&(v+=1,v>=s.length&&(v=-1));return}y.props.disabled||(d==="selectedMenu"&&y.props.selected||v===-1)&&(v=x),v===x&&(y.props.disabled||y.props.muiSkipListHighlight||y.type.muiSkipListHighlight)&&(v+=1,v>=s.length&&(v=-1))});const g=S.Children.map(s,(y,x)=>{if(x===v){const k={};return i&&(k.autoFocus=!0),y.props.tabIndex===void 0&&d==="selectedMenu"&&(k.tabIndex=0),S.cloneElement(y,k)}return y});return O.jsx(EJ,_({role:"menu",ref:b,className:a,onKeyDown:m,tabIndex:o?0:-1},f,{children:g}))}),FJ=BJ;function VJ(e){return Vt("MuiPopover",e)}jt("MuiPopover",["root","paper"]);const jJ=["onEntering"],UJ=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],WJ=["slotProps"];function LS(e,t){let r=0;return typeof t=="number"?r=t:t==="center"?r=e.height/2:t==="bottom"&&(r=e.height),r}function IS(e,t){let r=0;return typeof t=="number"?r=t:t==="center"?r=e.width/2:t==="right"&&(r=e.width),r}function DS(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function l1(e){return typeof e=="function"?e():e}const KJ=e=>{const{classes:t}=e;return rr({root:["root"],paper:["paper"]},VJ,t)},qJ=Xe(fJ,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),_3=Xe(yq,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),GJ=S.forwardRef(function(t,r){var n,o,i;const s=Wt({props:t,name:"MuiPopover"}),{action:a,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:d="anchorEl",children:f,className:p,container:h,elevation:m=8,marginThreshold:b=16,open:v,PaperProps:g={},slots:y,slotProps:x,transformOrigin:k={vertical:"top",horizontal:"left"},TransitionComponent:w=sv,transitionDuration:E="auto",TransitionProps:{onEntering:T}={},disableScrollLock:C=!1}=s,M=ve(s.TransitionProps,jJ),N=ve(s,UJ),F=(n=x==null?void 0:x.paper)!=null?n:g,I=S.useRef(),V=Ur(I,F.ref),j=_({},s,{anchorOrigin:c,anchorReference:d,elevation:m,marginThreshold:b,externalPaperSlotProps:F,transformOrigin:k,TransitionComponent:w,transitionDuration:E,TransitionProps:M}),z=KJ(j),q=S.useCallback(()=>{if(d==="anchorPosition")return u;const he=l1(l),Ke=(he&&he.nodeType===1?he:Br(I.current).body).getBoundingClientRect();return{top:Ke.top+LS(Ke,c.vertical),left:Ke.left+IS(Ke,c.horizontal)}},[l,c.horizontal,c.vertical,u,d]),A=S.useCallback(he=>({vertical:LS(he,k.vertical),horizontal:IS(he,k.horizontal)}),[k.horizontal,k.vertical]),P=S.useCallback(he=>{const De={width:he.offsetWidth,height:he.offsetHeight},Ke=A(De);if(d==="none")return{top:null,left:null,transformOrigin:DS(Ke)};const Fn=q();let Gr=Fn.top-Ke.vertical,nr=Fn.left-Ke.horizontal;const zo=Gr+De.height,Pt=nr+De.width,Yr=fd(l1(l)),vn=Yr.innerHeight-b,Vn=Yr.innerWidth-b;if(b!==null&&Grvn){const Qe=zo-vn;Gr-=Qe,Ke.vertical+=Qe}if(b!==null&&nrVn){const Qe=Pt-Vn;nr-=Qe,Ke.horizontal+=Qe}return{top:`${Math.round(Gr)}px`,left:`${Math.round(nr)}px`,transformOrigin:DS(Ke)}},[l,d,q,A,b]),[B,Y]=S.useState(v),J=S.useCallback(()=>{const he=I.current;if(!he)return;const De=P(he);De.top!==null&&(he.style.top=De.top),De.left!==null&&(he.style.left=De.left),he.style.transformOrigin=De.transformOrigin,Y(!0)},[P]);S.useEffect(()=>(C&&window.addEventListener("scroll",J),()=>window.removeEventListener("scroll",J)),[l,C,J]);const Ne=(he,De)=>{T&&T(he,De),J()},ie=()=>{Y(!1)};S.useEffect(()=>{v&&J()}),S.useImperativeHandle(a,()=>v?{updatePosition:()=>{J()}}:null,[v,J]),S.useEffect(()=>{if(!v)return;const he=zj(()=>{J()}),De=fd(l);return De.addEventListener("resize",he),()=>{he.clear(),De.removeEventListener("resize",he)}},[l,v,J]);let ue=E;E==="auto"&&!w.muiSupportAuto&&(ue=void 0);const de=h||(l?Br(l1(l)).body:void 0),me=(o=y==null?void 0:y.root)!=null?o:qJ,Me=(i=y==null?void 0:y.paper)!=null?i:_3,Se=si({elementType:Me,externalSlotProps:_({},F,{style:B?F.style:_({},F.style,{opacity:0})}),additionalProps:{elevation:m,ref:V},ownerState:j,className:Ce(z.paper,F==null?void 0:F.className)}),ft=si({elementType:me,externalSlotProps:(x==null?void 0:x.root)||{},externalForwardedProps:N,additionalProps:{ref:r,slotProps:{backdrop:{invisible:!0}},container:de,open:v},ownerState:j,className:Ce(z.root,p)}),{slotProps:rt}=ft,Or=ve(ft,WJ);return O.jsx(me,_({},Or,!h3(me)&&{slotProps:rt,disableScrollLock:C},{children:O.jsx(w,_({appear:!0,in:v,onEntering:Ne,onExited:ie,timeout:ue},M,{children:O.jsx(Me,_({},Se,{children:f}))}))}))}),YJ=GJ;function JJ(e){return Vt("MuiMenu",e)}jt("MuiMenu",["root","paper","list"]);const XJ=["onEntering"],QJ=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],ZJ={vertical:"top",horizontal:"right"},eX={vertical:"top",horizontal:"left"},tX=e=>{const{classes:t}=e;return rr({root:["root"],paper:["paper"],list:["list"]},JJ,t)},rX=Xe(YJ,{shouldForwardProp:e=>Sb(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),nX=Xe(_3,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),oX=Xe(FJ,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),iX=S.forwardRef(function(t,r){var n,o;const i=Wt({props:t,name:"MuiMenu"}),{autoFocus:s=!0,children:a,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:d,open:f,PaperProps:p={},PopoverClasses:h,transitionDuration:m="auto",TransitionProps:{onEntering:b}={},variant:v="selectedMenu",slots:g={},slotProps:y={}}=i,x=ve(i.TransitionProps,XJ),k=ve(i,QJ),w=Km(),E=w.direction==="rtl",T=_({},i,{autoFocus:s,disableAutoFocusItem:c,MenuListProps:u,onEntering:b,PaperProps:p,transitionDuration:m,TransitionProps:x,variant:v}),C=tX(T),M=s&&!c&&f,N=S.useRef(null),F=(P,B)=>{N.current&&N.current.adjustStyleForScrollbar(P,w),b&&b(P,B)},I=P=>{P.key==="Tab"&&(P.preventDefault(),d&&d(P,"tabKeyDown"))};let V=-1;S.Children.map(a,(P,B)=>{S.isValidElement(P)&&(P.props.disabled||(v==="selectedMenu"&&P.props.selected||V===-1)&&(V=B))});const j=(n=g.paper)!=null?n:nX,z=(o=y.paper)!=null?o:p,q=si({elementType:g.root,externalSlotProps:y.root,ownerState:T,className:[C.root,l]}),A=si({elementType:j,externalSlotProps:z,ownerState:T,className:C.paper});return O.jsx(rX,_({onClose:d,anchorOrigin:{vertical:"bottom",horizontal:E?"right":"left"},transformOrigin:E?ZJ:eX,slots:{paper:j,root:g.root},slotProps:{root:q,paper:A},open:f,ref:r,transitionDuration:m,TransitionProps:_({onEntering:F},x),ownerState:T},k,{classes:h,children:O.jsx(oX,_({onKeyDown:I,actions:N,autoFocus:s&&(V===-1||c),autoFocusItem:M,variant:v},u,{className:Ce(C.list,u.className),children:a}))}))}),sX=iX;function aX(e){return Vt("MuiMenuItem",e)}const lX=jt("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),Nc=lX,cX=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],uX=(e,t)=>{const{ownerState:r}=e;return[t.root,r.dense&&t.dense,r.divider&&t.divider,!r.disableGutters&&t.gutters]},dX=e=>{const{disabled:t,dense:r,divider:n,disableGutters:o,selected:i,classes:s}=e,l=rr({root:["root",r&&"dense",t&&"disabled",!o&&"gutters",n&&"divider",i&&"selected"]},aX,s);return _({},s,l)},fX=Xe(Mb,{shouldForwardProp:e=>Sb(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:uX})(({theme:e,ownerState:t})=>_({},e.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Nc.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${Nc.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${Nc.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${Nc.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Nc.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${RS.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${RS.inset}`]:{marginLeft:52},[`& .${yh.root}`]:{marginTop:0,marginBottom:0},[`& .${yh.inset}`]:{paddingLeft:36},[`& .${PS.root}`]:{minWidth:36}},!t.dense&&{[e.breakpoints.up("sm")]:{minHeight:"auto"}},t.dense&&_({minHeight:32,paddingTop:4,paddingBottom:4},e.typography.body2,{[`& .${PS.root} svg`]:{fontSize:"1.25rem"}}))),pX=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:i="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:d,className:f}=n,p=ve(n,cX),h=S.useContext(yd),m=S.useMemo(()=>({dense:s||h.dense||!1,disableGutters:l}),[h.dense,s,l]),b=S.useRef(null);ha(()=>{o&&b.current&&b.current.focus()},[o]);const v=_({},n,{dense:m.dense,divider:a,disableGutters:l}),g=dX(n),y=Ur(b,r);let x;return n.disabled||(x=d!==void 0?d:-1),O.jsx(yd.Provider,{value:m,children:O.jsx(fX,_({ref:y,role:u,tabIndex:x,component:i,focusVisibleClassName:Ce(g.focusVisible,c),className:Ce(g.root,f)},p,{ownerState:v,classes:g}))})}),hX=pX;function mX(e){return Vt("MuiTooltip",e)}const gX=jt("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),Hi=gX,vX=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function yX(e){return Math.round(e*1e5)/1e5}const bX=e=>{const{classes:t,disableInteractive:r,arrow:n,touch:o,placement:i}=e,s={popper:["popper",!r&&"popperInteractive",n&&"popperArrow"],tooltip:["tooltip",n&&"tooltipArrow",o&&"touch",`tooltipPlacement${Fe(i.split("-")[0])}`],arrow:["arrow"]};return rr(s,mX,t)},xX=Xe(zb,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.popper,!r.disableInteractive&&t.popperInteractive,r.arrow&&t.popperArrow,!r.open&&t.popperClose]}})(({theme:e,ownerState:t,open:r})=>_({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none"},!t.disableInteractive&&{pointerEvents:"auto"},!r&&{pointerEvents:"none"},t.arrow&&{[`&[data-popper-placement*="bottom"] .${Hi.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Hi.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Hi.arrow}`]:_({},t.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${Hi.arrow}`]:_({},t.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),kX=Xe("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.tooltip,r.touch&&t.touch,r.arrow&&t.tooltipArrow,t[`tooltipPlacement${Fe(r.placement.split("-")[0])}`]]}})(({theme:e,ownerState:t})=>_({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:Lr(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},t.arrow&&{position:"relative",margin:0},t.touch&&{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${yX(16/14)}em`,fontWeight:e.typography.fontWeightRegular},{[`.${Hi.popper}[data-popper-placement*="left"] &`]:_({transformOrigin:"right center"},t.isRtl?_({marginLeft:"14px"},t.touch&&{marginLeft:"24px"}):_({marginRight:"14px"},t.touch&&{marginRight:"24px"})),[`.${Hi.popper}[data-popper-placement*="right"] &`]:_({transformOrigin:"left center"},t.isRtl?_({marginRight:"14px"},t.touch&&{marginRight:"24px"}):_({marginLeft:"14px"},t.touch&&{marginLeft:"24px"})),[`.${Hi.popper}[data-popper-placement*="top"] &`]:_({transformOrigin:"center bottom",marginBottom:"14px"},t.touch&&{marginBottom:"24px"}),[`.${Hi.popper}[data-popper-placement*="bottom"] &`]:_({transformOrigin:"center top",marginTop:"14px"},t.touch&&{marginTop:"24px"})})),wX=Xe("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:Lr(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let Mf=!1,c1=null,Rc={x:0,y:0};function Tf(e,t){return r=>{t&&t(r),e(r)}}const SX=S.forwardRef(function(t,r){var n,o,i,s,a,l,c,u,d,f,p,h,m,b,v,g,y,x,k;const w=Wt({props:t,name:"MuiTooltip"}),{arrow:E=!1,children:T,components:C={},componentsProps:M={},describeChild:N=!1,disableFocusListener:F=!1,disableHoverListener:I=!1,disableInteractive:V=!1,disableTouchListener:j=!1,enterDelay:z=100,enterNextDelay:q=0,enterTouchDelay:A=700,followCursor:P=!1,id:B,leaveDelay:Y=0,leaveTouchDelay:J=1500,onClose:Ne,onOpen:ie,open:ue,placement:de="bottom",PopperComponent:me,PopperProps:Me={},slotProps:Se={},slots:ft={},title:rt,TransitionComponent:Or=sv,TransitionProps:he}=w,De=ve(w,vX),Ke=S.isValidElement(T)?T:O.jsx("span",{children:T}),Fn=Km(),Gr=Fn.direction==="rtl",[nr,zo]=S.useState(),[Pt,Yr]=S.useState(null),vn=S.useRef(!1),Vn=V||P,Qe=S.useRef(),Jr=S.useRef(),yn=S.useRef(),mi=S.useRef(),[Oa,fe]=$j({controlled:ue,default:!1,name:"Tooltip",state:"open"});let bn=Oa;const fc=Dj(B),gi=S.useRef(),pc=S.useCallback(()=>{gi.current!==void 0&&(document.body.style.WebkitUserSelect=gi.current,gi.current=void 0),clearTimeout(mi.current)},[]);S.useEffect(()=>()=>{clearTimeout(Qe.current),clearTimeout(Jr.current),clearTimeout(yn.current),pc()},[pc]);const Nx=ke=>{clearTimeout(c1),Mf=!0,fe(!0),ie&&!bn&&ie(ke)},ef=Ks(ke=>{clearTimeout(c1),c1=setTimeout(()=>{Mf=!1},800+Y),fe(!1),Ne&&bn&&Ne(ke),clearTimeout(Qe.current),Qe.current=setTimeout(()=>{vn.current=!1},Fn.transitions.duration.shortest)}),Zm=ke=>{vn.current&&ke.type!=="touchstart"||(nr&&nr.removeAttribute("title"),clearTimeout(Jr.current),clearTimeout(yn.current),z||Mf&&q?Jr.current=setTimeout(()=>{Nx(ke)},Mf?q:z):Nx(ke))},Rx=ke=>{clearTimeout(Jr.current),clearTimeout(yn.current),yn.current=setTimeout(()=>{ef(ke)},Y)},{isFocusVisibleRef:Px,onBlur:GO,onFocus:YO,ref:JO}=PT(),[,zx]=S.useState(!1),Lx=ke=>{GO(ke),Px.current===!1&&(zx(!1),Rx(ke))},Ix=ke=>{nr||zo(ke.currentTarget),YO(ke),Px.current===!0&&(zx(!0),Zm(ke))},Dx=ke=>{vn.current=!0;const Xr=Ke.props;Xr.onTouchStart&&Xr.onTouchStart(ke)},$x=Zm,Hx=Rx,XO=ke=>{Dx(ke),clearTimeout(yn.current),clearTimeout(Qe.current),pc(),gi.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",mi.current=setTimeout(()=>{document.body.style.WebkitUserSelect=gi.current,Zm(ke)},A)},QO=ke=>{Ke.props.onTouchEnd&&Ke.props.onTouchEnd(ke),pc(),clearTimeout(yn.current),yn.current=setTimeout(()=>{ef(ke)},J)};S.useEffect(()=>{if(!bn)return;function ke(Xr){(Xr.key==="Escape"||Xr.key==="Esc")&&ef(Xr)}return document.addEventListener("keydown",ke),()=>{document.removeEventListener("keydown",ke)}},[ef,bn]);const ZO=Ur(Ke.ref,JO,zo,r);!rt&&rt!==0&&(bn=!1);const eg=S.useRef(),e_=ke=>{const Xr=Ke.props;Xr.onMouseMove&&Xr.onMouseMove(ke),Rc={x:ke.clientX,y:ke.clientY},eg.current&&eg.current.update()},hc={},tg=typeof rt=="string";N?(hc.title=!bn&&tg&&!I?rt:null,hc["aria-describedby"]=bn?fc:null):(hc["aria-label"]=tg?rt:null,hc["aria-labelledby"]=bn&&!tg?fc:null);const jn=_({},hc,De,Ke.props,{className:Ce(De.className,Ke.props.className),onTouchStart:Dx,ref:ZO},P?{onMouseMove:e_}:{}),mc={};j||(jn.onTouchStart=XO,jn.onTouchEnd=QO),I||(jn.onMouseOver=Tf($x,jn.onMouseOver),jn.onMouseLeave=Tf(Hx,jn.onMouseLeave),Vn||(mc.onMouseOver=$x,mc.onMouseLeave=Hx)),F||(jn.onFocus=Tf(Ix,jn.onFocus),jn.onBlur=Tf(Lx,jn.onBlur),Vn||(mc.onFocus=Ix,mc.onBlur=Lx));const t_=S.useMemo(()=>{var ke;let Xr=[{name:"arrow",enabled:!!Pt,options:{element:Pt,padding:4}}];return(ke=Me.popperOptions)!=null&&ke.modifiers&&(Xr=Xr.concat(Me.popperOptions.modifiers)),_({},Me.popperOptions,{modifiers:Xr})},[Pt,Me]),gc=_({},w,{isRtl:Gr,arrow:E,disableInteractive:Vn,placement:de,PopperComponentProp:me,touch:vn.current}),rg=bX(gc),Bx=(n=(o=ft.popper)!=null?o:C.Popper)!=null?n:xX,Fx=(i=(s=(a=ft.transition)!=null?a:C.Transition)!=null?s:Or)!=null?i:sv,Vx=(l=(c=ft.tooltip)!=null?c:C.Tooltip)!=null?l:kX,jx=(u=(d=ft.arrow)!=null?d:C.Arrow)!=null?u:wX,r_=uu(Bx,_({},Me,(f=Se.popper)!=null?f:M.popper,{className:Ce(rg.popper,Me==null?void 0:Me.className,(p=(h=Se.popper)!=null?h:M.popper)==null?void 0:p.className)}),gc),n_=uu(Fx,_({},he,(m=Se.transition)!=null?m:M.transition),gc),o_=uu(Vx,_({},(b=Se.tooltip)!=null?b:M.tooltip,{className:Ce(rg.tooltip,(v=(g=Se.tooltip)!=null?g:M.tooltip)==null?void 0:v.className)}),gc),i_=uu(jx,_({},(y=Se.arrow)!=null?y:M.arrow,{className:Ce(rg.arrow,(x=(k=Se.arrow)!=null?k:M.arrow)==null?void 0:x.className)}),gc);return O.jsxs(S.Fragment,{children:[S.cloneElement(Ke,jn),O.jsx(Bx,_({as:me??zb,placement:de,anchorEl:P?{getBoundingClientRect:()=>({top:Rc.y,left:Rc.x,right:Rc.x,bottom:Rc.y,width:0,height:0})}:nr,popperRef:eg,open:nr?bn:!1,id:fc,transition:!0},mc,r_,{popperOptions:t_,children:({TransitionProps:ke})=>O.jsx(Fx,_({timeout:Fn.transitions.duration.shorter},ke,n_,{children:O.jsxs(Vx,_({},o_,{children:[rt,E?O.jsx(jx,_({},i_,{ref:Yr})):null]}))}))}))]})}),A3=SX;function EX(e){return Vt("MuiToggleButton",e)}const CX=jt("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge"]),$S=CX,MX=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],TX=e=>{const{classes:t,fullWidth:r,selected:n,disabled:o,size:i,color:s}=e,a={root:["root",n&&"selected",o&&"disabled",r&&"fullWidth",`size${Fe(i)}`,s]};return rr(a,EX,t)},OX=Xe(Mb,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`size${Fe(r.size)}`]]}})(({theme:e,ownerState:t})=>{let r=t.color==="standard"?e.palette.text.primary:e.palette[t.color].main,n;return e.vars&&(r=t.color==="standard"?e.vars.palette.text.primary:e.vars.palette[t.color].main,n=t.color==="standard"?e.vars.palette.text.primaryChannel:e.vars.palette[t.color].mainChannel),_({},e.typography.button,{borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active},t.fullWidth&&{width:"100%"},{[`&.${$S.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Lr(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${$S.selected}`]:{color:r,backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:Lr(r,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${n} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Lr(r,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:Lr(r,e.palette.action.selectedOpacity)}}}},t.size==="small"&&{padding:7,fontSize:e.typography.pxToRem(13)},t.size==="large"&&{padding:15,fontSize:e.typography.pxToRem(15)})}),_X=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiToggleButton"}),{children:o,className:i,color:s="standard",disabled:a=!1,disableFocusRipple:l=!1,fullWidth:c=!1,onChange:u,onClick:d,selected:f,size:p="medium",value:h}=n,m=ve(n,MX),b=_({},n,{color:s,disabled:a,disableFocusRipple:l,fullWidth:c,size:p}),v=TX(b),g=y=>{d&&(d(y,h),y.defaultPrevented)||u&&u(y,h)};return O.jsx(OX,_({className:Ce(v.root,i),disabled:a,focusRipple:!l,ref:r,onClick:g,onChange:u,value:h,ownerState:b,"aria-pressed":f},m,{children:o}))}),AX=_X;var NX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 15v2c0 1.054.95 2 2 2h3v2H7a4 4 0 0 1-4-4v-2h2zm13-5l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16 10h2zm-1 2.885L15.753 16h2.492L17 12.885zM3 3h6a3 3 0 0 1 2.235 5A3 3 0 0 1 9 13H3V3zm6 6H5v2h4a1 1 0 0 0 0-2zm8-6a4 4 0 0 1 4 4v2h-2V7a2 2 0 0 0-2-2h-3V3h3zM9 5H5v2h4a1 1 0 1 0 0-2z"}}],RX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"}}],PX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"}}],zX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0zm-8.66 16h15.588L12 5.5 4.206 19zM11 16h2v2h-2v-2zm0-7h2v5h-2V9z"}}],LX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 19h18v2H3v-2zm5-6h3l-4 4-4-4h3V3h2v10zm10 0h3l-4 4-4-4h3V3h2v10z"}}],IX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm2 15h14v2H5v-2zm-2-5h18v2H3v-2zm2-5h14v2H5V9z"}}],DX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm0-5h18v2H3v-2zm0-5h18v2H3V9z"}}],$X=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h14v2H3v-2zm0-5h18v2H3v-2zm0-5h14v2H3V9z"}}],HX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm4 15h14v2H7v-2zm-4-5h18v2H3v-2zm4-5h14v2H7V9z"}}],BX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3h18v2H3V3zm5 8v10H6V11H3l4-4 4 4H8zm10 0v10h-2V11h-3l4-4 4 4h-3z"}}],FX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 11h18v2H3v-2zm15 7v3h-2v-3h-3l4-4 4 4h-3zM8 18v3H6v-3H3l4-4 4 4H8zM18 6h3l-4 4-4-4h3V3h2v3zM8 6h3l-4 4-4-4h3V3h2v3z"}}],VX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6.75 2.5A4.25 4.25 0 0 1 11 6.75V11H6.75a4.25 4.25 0 1 1 0-8.5zM9 9V6.75A2.25 2.25 0 1 0 6.75 9H9zm-2.25 4H11v4.25A4.25 4.25 0 1 1 6.75 13zm0 2A2.25 2.25 0 1 0 9 17.25V15H6.75zm10.5-12.5a4.25 4.25 0 1 1 0 8.5H13V6.75a4.25 4.25 0 0 1 4.25-4.25zm0 6.5A2.25 2.25 0 1 0 15 6.75V9h2.25zM13 13h4.25A4.25 4.25 0 1 1 13 17.25V13zm2 2v2.25A2.25 2.25 0 1 0 17.25 15H15z"}}],jX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 16l-6-6h12z"}}],UX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 7v4L2 6l6-5v4h5a8 8 0 1 1 0 16H4v-2h9a6 6 0 1 0 0-12H8z"}}],WX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 7h-5a6 6 0 1 0 0 12h9v2h-9a8 8 0 1 1 0-16h5V1l6 5-6 5V7z"}}],KX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 12l6-6v12z"}}],qX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 12l-6 6V6z"}}],GX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 8l6 6H6z"}}],YX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 3v7.267l6.294-3.633 1 1.732-6.293 3.633 6.293 3.635-1 1.732L13 13.732V21h-2v-7.268l-6.294 3.634-1-1.732L9.999 12 3.706 8.366l1-1.732L11 10.267V3z"}}],JX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.828 7.757l-5.656 5.657a1 1 0 1 0 1.414 1.414l5.657-5.656A3 3 0 1 0 12 4.929l-5.657 5.657a5 5 0 1 0 7.071 7.07L19.071 12l1.414 1.414-5.657 5.657a7 7 0 1 1-9.9-9.9l5.658-5.656a5 5 0 0 1 7.07 7.07L12 16.244A3 3 0 1 1 7.757 12l5.657-5.657 1.414 1.414z"}}],XX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 11h4.5a2.5 2.5 0 1 0 0-5H8v5zm10 4.5a4.5 4.5 0 0 1-4.5 4.5H6V4h6.5a4.5 4.5 0 0 1 3.256 7.606A4.498 4.498 0 0 1 18 15.5zM8 13v5h5.5a2.5 2.5 0 1 0 0-5H8z"}}],QX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12 2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3zm16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5z"}}],ZX=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M14 3c.552 0 1 .448 1 1v5h5c.552 0 1 .448 1 1v10c0 .552-.448 1-1 1H10c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h10zm-1 2H5v8h8V5z"}}],eQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M11 3c.552 0 1 .448 1 1v2h5c.552 0 1 .448 1 1v5h2c.552 0 1 .448 1 1v7c0 .552-.448 1-1 1h-7c-.552 0-1-.448-1-1v-2H7c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h7zm5 5H8v8h8V8z"}}],tQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 3v2H4v13.385L5.763 17H20v-7h2v8a1 1 0 0 1-1 1H6.455L2 22.5V4a1 1 0 0 1 1-1h11zm5 0V0h2v3h3v2h-3v3h-2V5h-3V3h3z"}}],rQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-.997-4L6.76 11.757l1.414-1.414 2.829 2.829 5.656-5.657 1.415 1.414L11.003 16z"}}],nQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M7 7V3a1 1 0 0 1 1-1h13a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-4v3.993c0 .556-.449 1.007-1.007 1.007H3.007A1.006 1.006 0 0 1 2 20.993l.003-12.986C2.003 7.451 2.452 7 3.01 7H7zm2 0h6.993C16.549 7 17 7.449 17 8.007V15h3V4H9v3zm6 2H4.003L4 20h11V9zm-6.497 9l-3.536-3.536 1.414-1.414 2.122 2.122 4.242-4.243 1.414 1.414L8.503 18z"}}],oQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6 4v4h12V4h2.007c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 21.007V4.993C3 4.445 3.445 4 3.993 4H6zm2-2h8v4H8V2z"}}],iQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 4V2h10v2h3.007c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 21.007V4.993C3 4.445 3.445 4 3.993 4H7zm0 2H5v14h14V6h-2v2H7V6zm2-2v2h6V4H9z"}}],sQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm0-9.414l2.828-2.829 1.415 1.415L13.414 12l2.829 2.828-1.415 1.415L12 13.414l-2.828 2.829-1.415-1.415L10.586 12 7.757 9.172l1.415-1.415L12 10.586z"}}],aQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"}}],lQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"}}],cQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M23 12l-7.071 7.071-1.414-1.414L20.172 12l-5.657-5.657 1.414-1.414L23 12zM3.828 12l5.657 5.657-1.414 1.414L1 12l7.071-7.071 1.414 1.414L3.828 12z"}}],uQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16.95 8.464l1.414-1.414 4.95 4.95-4.95 4.95-1.414-1.414L20.485 12 16.95 8.464zm-9.9 0L3.515 12l3.535 3.536-1.414 1.414L.686 12l4.95-4.95L7.05 8.464z"}}],dQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 6h5v2h-2v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8H2V6h5V3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v3zm-8 5v6h2v-6H9zm4 0v6h2v-6h-2zM9 4v2h6V4H9z"}}],fQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 6h5v2h-2v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8H2V6h5V3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v3zm1 2H6v12h12V8zm-9 3h2v6H9v-6zm4 0h2v6h-2v-6zM9 4v2h6V4H9z"}}],pQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 3c.552 0 1 .448 1 1v8c.835-.628 1.874-1 3-1 2.761 0 5 2.239 5 5s-2.239 5-5 5c-1.032 0-1.99-.313-2.787-.848L13 20c0 .552-.448 1-1 1H6c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zm-1 2H7v14h4V5zm8 10h-6v2h6v-2z"}}],hQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 5c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1 .628.835 1 1.874 1 3 0 2.761-2.239 5-5 5s-5-2.239-5-5c0-1.126.372-2.165 1-3H4c-.552 0-1-.448-1-1V6c0-.552.448-1 1-1h16zm-7 10v2h6v-2h-6zm6-8H5v4h14V7z"}}],mQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4.583 17.321C3.553 16.227 3 15 3 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179zm10 0C13.553 16.227 13 15 13 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179z"}}],gQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19.417 6.679C20.447 7.773 21 9 21 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311-1.804-.167-3.226-1.648-3.226-3.489a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179zm-10 0C10.447 7.773 11 9 11 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311C4.591 12.322 3.17 10.841 3.17 9a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179z"}}],vQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 19h16v-7h2v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-8h2v7zM14 9h5l-7 7-7-7h5V3h4v6z"}}],yQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M16 13l6.964 4.062-2.973.85 2.125 3.681-1.732 1-2.125-3.68-2.223 2.15L16 13zm-2-7h2v2h5a1 1 0 0 1 1 1v4h-2v-3H10v10h4v2H9a1 1 0 0 1-1-1v-5H6v-2h2V9a1 1 0 0 1 1-1h5V6zM4 14v2H2v-2h2zm0-4v2H2v-2h2zm0-4v2H2V6h2zm0-4v2H2V2h2zm4 0v2H6V2h2zm4 0v2h-2V2h2zm4 0v2h-2V2h2z"}}],bQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 19a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm-5.5 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm11 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zM13 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.621 6.302 14.685 14.685 0 0 0 5.327 3.042l-.536 1.93A16.685 16.685 0 0 1 12 13.726a16.696 16.696 0 0 1-6.202 3.547l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042 18.077 18.077 0 0 1-2.822-4.3h2.24A16.031 16.031 0 0 0 12 10.876a16.168 16.168 0 0 0 2.91-4.876L5 6V4h6V2h2z"}}],xQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 19a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm-5.5 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm11 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zM18 3v2H8v4h9v2H8v4h10v2H6V3h12z"}}],kQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 10h2v.757a4.5 4.5 0 0 1 7 3.743V20h-2v-5.5c0-1.43-1.175-2.5-2.5-2.5S16 13.07 16 14.5V20h-2V10zm-2-6v2H4v5h8v2H4v5h8v2H2V4h10z"}}],wQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-1-5h2v2h-2v-2zm0-8h2v6h-2V7z"}}],SQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm11-3v9l-3.794-3.793-5.999 6-1.414-1.414 5.999-6L12 3h9z"}}],EQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1.001 1.001 0 0 1 3 21l.003-14c0-.552.45-1 1.007-1H7zM5.003 8L5 20h10V8H5.003zM9 6h8v10h2V4H9v2z"}}],CQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M6 21.5c-1.933 0-3.5-1.567-3.5-3.5s1.567-3.5 3.5-3.5c1.585 0 2.924 1.054 3.355 2.5H15v-2h2V9.242L14.757 7H9V9H3V3h6v2h5.757L18 1.756 22.243 6 19 9.241V15L21 15v6h-6v-2H9.355c-.43 1.446-1.77 2.5-3.355 2.5zm0-5c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5zm13 .5h-2v2h2v-2zM18 4.586L16.586 6 18 7.414 19.414 6 18 4.586zM7 5H5v2h2V5z"}}],MQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.246 14H8.754l-1.6 4H5l6-15h2l6 15h-2.154l-1.6-4zm-.8-2L12 5.885 9.554 12h4.892zM3 20h18v2H3v-2z"}}],TQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6v15H8V6H2V4h14v2h-6zm8 8v7h-2v-7h-3v-2h8v2h-3z"}}],OQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"}}],_Q=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12.651 14.065L11.605 20H9.574l1.35-7.661-7.41-7.41L4.93 3.515 20.485 19.07l-1.414 1.414-6.42-6.42zm-.878-6.535l.27-1.53h-1.8l-2-2H20v2h-5.927L13.5 9.257 11.773 7.53z"}}],AQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z"}}],NQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 3h2v6h-2V5h-4V3h4zM4 3h4v2H4v4H2V3h2zm16 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z"}}],RQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 18l7.68-6L5 6V4h14v2H8.263L16 12l-7.737 6H19v2H5v-2z"}}],PQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 1v4H4v14h16V3h1.008c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3H6V1h2zm4 7l4 4h-3v4h-2v-4H8l4-4zm6-7v4h-8V3h6V1h2z"}}],zQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M13 20h-2v-7H4v7H2V4h2v7h7V4h2v16zm8-12v12h-2v-9.796l-2 .536V8.67L19.5 8H21z"}}],LQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 4c2.071 0 3.75 1.679 3.75 3.75 0 .857-.288 1.648-.772 2.28l-.148.18L18.034 18H22v2h-7v-1.556l4.82-5.546c.268-.307.43-.709.43-1.148 0-.966-.784-1.75-1.75-1.75-.918 0-1.671.707-1.744 1.606l-.006.144h-2C14.75 9.679 16.429 8 18.5 8z"}}],IQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M22 8l-.002 2-2.505 2.883c1.59.435 2.757 1.89 2.757 3.617 0 2.071-1.679 3.75-3.75 3.75-1.826 0-3.347-1.305-3.682-3.033l1.964-.382c.156.806.866 1.415 1.718 1.415.966 0 1.75-.784 1.75-1.75s-.784-1.75-1.75-1.75c-.286 0-.556.069-.794.19l-1.307-1.547L19.35 10H15V8h7zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2z"}}],DQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M13 20h-2v-7H4v7H2V4h2v7h7V4h2v16zm9-12v8h1.5v2H22v2h-2v-2h-5.5v-1.34l5-8.66H22zm-2 3.133L17.19 16H20v-4.867z"}}],$Q=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M22 8v2h-4.323l-.464 2.636c.33-.089.678-.136 1.037-.136 2.21 0 4 1.79 4 4s-1.79 4-4 4c-1.827 0-3.367-1.224-3.846-2.897l1.923-.551c.24.836 1.01 1.448 1.923 1.448 1.105 0 2-.895 2-2s-.895-2-2-2c-.63 0-1.193.292-1.56.748l-1.81-.904L16 8h6zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2z"}}],HQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21.097 8l-2.598 4.5c2.21 0 4.001 1.79 4.001 4s-1.79 4-4 4-4-1.79-4-4c0-.736.199-1.426.546-2.019L18.788 8h2.309zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 10.5c-1.105 0-2 .895-2 2s.895 2 2 2 2-.895 2-2-.895-2-2-2z"}}],BQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7.784 14l.42-4H4V8h4.415l.525-5h2.011l-.525 5h3.989l.525-5h2.011l-.525 5H20v2h-3.784l-.42 4H20v2h-4.415l-.525 5h-2.011l.525-5H9.585l-.525 5H7.049l.525-5H4v-2h3.784zm2.011 0h3.99l.42-4h-3.99l-.42 4z"}}],FQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 11V4h2v17h-2v-8H7v8H5V4h2v7z"}}],VQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 15v3h3v2h-3v3h-2v-3h-3v-2h3v-3h2zm.008-12c.548 0 .992.445.992.993V13h-2V5H4v13.999L14 9l3 3v2.829l-3-3L6.827 19H14v2H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016zM8 7a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"}}],jQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v1.757l-2 2V5H5v8.1l4-4 4.328 4.329-1.415 1.413L9 11.93l-4 3.999V19h10.533l.708.001 1.329-1.33L18.9 19h.1v-2.758l2-2V20c0 .552-.448 1-1 1H4c-.55 0-1-.45-1-1V4c0-.552.448-1 1-1h16zm1.778 4.808l1.414 1.414L15.414 17l-1.416-.002.002-1.412 7.778-7.778zM15.5 7c.828 0 1.5.672 1.5 1.5s-.672 1.5-1.5 1.5S14 9.328 14 8.5 14.672 7 15.5 7z"}}],UQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4.828 21l-.02.02-.021-.02H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H4.828zM20 15V5H4v14L14 9l6 6zm0 2.828l-6-6L6.828 19H20v-1.172zM8 11a2 2 0 1 1 0-4 2 2 0 0 1 0 4z"}}],WQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm8-5h10v2H11v-2zm0-5h10v2H11V9zm-8 3.5L7 9v7l-4-3.5z"}}],KQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm8-5h10v2H11v-2zm0-5h10v2H11V9zm-4 3.5L3 16V9l4 3.5z"}}],qQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM11 7h2v2h-2V7zm0 4h2v6h-2v-6z"}}],GQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 21v-2h3V5H8V3h8v2h-3v14h3v2H8zM18.05 7.05L23 12l-4.95 4.95-1.414-1.414L20.172 12l-3.536-3.536L18.05 7.05zm-12.1 0l1.414 1.414L3.828 12l3.536 3.536L5.95 16.95 1 12l4.95-4.95z"}}],YQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zm-1 2h-4v14h4V5zM6 7c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2H5v1.999L3 11v2l2-.001V15h2v-2.001L9 13v-2l-2-.001V9z"}}],JQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M10 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zM9 5H5v14h4V5zm9 2c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L15 11v2l2-.001V15h2v-2.001L21 13v-2l-2-.001V9z"}}],XQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 13c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L9 17v2l2-.001V21h2v-2.001L15 19v-2l-2-.001V15zm7-12c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zM5 5v4h14V5H5z"}}],QQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 13c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1v-6c0-.552.448-1 1-1h16zm-1 2H5v4h14v-4zM12 1c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L9 5v2l2-.001V9h2V6.999L15 7V5l-2-.001V3z"}}],ZQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 20H7v-2h2.927l2.116-12H9V4h8v2h-2.927l-2.116 12H15z"}}],eZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M11 5H5v14h6V5zm2 0v14h6V5h-6zM4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],tZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 4h10v2H11V4zM6 7v4H4V7H1l4-4 4 4H6zm0 10h3l-4 4-4-4h3v-4h2v4zm5 1h10v2H11v-2zm-2-7h12v2H9v-2z"}}],rZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.657 14.828l-1.414-1.414L17.657 12A4 4 0 1 0 12 6.343l-1.414 1.414-1.414-1.414 1.414-1.414a6 6 0 0 1 8.485 8.485l-1.414 1.414zm-2.829 2.829l-1.414 1.414a6 6 0 1 1-8.485-8.485l1.414-1.414 1.414 1.414L6.343 12A4 4 0 1 0 12 17.657l1.414-1.414 1.414 1.414zm0-9.9l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],nZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.657 14.828l-1.414-1.414L17.657 12A4 4 0 1 0 12 6.343l-1.414 1.414-1.414-1.414 1.414-1.414a6 6 0 0 1 8.485 8.485l-1.414 1.414zm-2.829 2.829l-1.414 1.414a6 6 0 1 1-8.485-8.485l1.414-1.414 1.414 1.414L6.343 12A4 4 0 1 0 12 17.657l1.414-1.414 1.414 1.414zm0-9.9l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07zM5.775 2.293l1.932-.518L8.742 5.64l-1.931.518-1.036-3.864zm9.483 16.068l1.931-.518 1.036 3.864-1.932.518-1.035-3.864zM2.293 5.775l3.864 1.036-.518 1.931-3.864-1.035.518-1.932zm16.068 9.483l3.864 1.035-.518 1.932-3.864-1.036.518-1.931z"}}],oZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 17h5v2h-3v3h-2v-5zM7 7H2V5h3V2h2v5zm11.364 8.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],iZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18.364 15.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],sZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 4h10v2H11V4zm0 4h6v2h-6V8zm0 6h10v2H11v-2zm0 4h6v2h-6v-2zM3 4h6v6H3V4zm2 2v2h2V6H5zm-2 8h6v6H3v-6zm2 2v2h2v-2H5z"}}],aZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zm-5-.5h3v3H3v-3zm0 7h3v3H3v-3zm0 7h3v3H3v-3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],lZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zM5 3v3h1v1H3V6h1V4H3V3h2zM3 14v-2.5h2V11H3v-1h3v2.5H4v.5h2v1H3zm2 5.5H3v-1h2V18H3v-1h3v4H3v-1h2v-.5zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],cZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zM4.5 6.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 6.9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],uZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.243 4.515l-6.738 6.737-.707 2.121-1.04 1.041 2.828 2.829 1.04-1.041 2.122-.707 6.737-6.738-4.242-4.242zm6.364 3.535a1 1 0 0 1 0 1.414l-7.779 7.779-2.12.707-1.415 1.414a1 1 0 0 1-1.414 0l-4.243-4.243a1 1 0 0 1 0-1.414l1.414-1.414.707-2.121 7.779-7.779a1 1 0 0 1 1.414 0l5.657 5.657zm-6.364-.707l1.414 1.414-4.95 4.95-1.414-1.414 4.95-4.95zM4.283 16.89l2.828 2.829-1.414 1.414-4.243-1.414 2.828-2.829z"}}],dZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm4 12.5v-4l2 2 2-2v4h2v-7h-2l-2 2-2-2H5v7h2zm11-3v-4h-2v4h-2l3 3 3-3h-2z"}}],fZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm1 2v14h16V5H4zm3 10.5H5v-7h2l2 2 2-2h2v7h-2v-4l-2 2-2-2v4zm11-3h2l-3 3-3-3h2v-4h2v4z"}}],pZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-9 2H5v5.999h2V9l3 3-3 3v-2H5v6h6v-2h2v2h6v-6h-2v2l-3-3 3-3v1.999h2V5h-6v2h-2V5zm2 8v2h-2v-2h2zm0-4v2h-2V9h2z"}}],hZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21 20c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16c.552 0 1 .448 1 1v16zm-2-9V5h-5.999v2H15l-3 3-3-3h2V5H5v6h2v2H5v6h6v-2H9l3-3 3 3h-1.999v2H19v-6h-2v-2h2zm-8 2H9v-2h2v2zm4 0h-2v-2h2v2z"}}],mZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M18 3c1.657 0 3 1.343 3 3s-1.343 3-3 3h-3c-1.306 0-2.417-.834-2.829-2H11c-1.1 0-2 .9-2 2v.171c1.166.412 2 1.523 2 2.829 0 1.306-.834 2.417-2 2.829V15c0 1.1.9 2 2 2h1.17c.412-1.165 1.524-2 2.83-2h3c1.657 0 3 1.343 3 3s-1.343 3-3 3h-3c-1.306 0-2.417-.834-2.829-2H11c-2.21 0-4-1.79-4-4H5c-1.657 0-3-1.343-3-3s1.343-3 3-3h2c0-2.21 1.79-4 4-4h1.17c.412-1.165 1.524-2 2.83-2h3zm0 14h-3c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1zM8 11H5c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1zm10-6h-3c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1z"}}],gZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm14 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-7 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}}],vZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M10 2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1H8v2h5V9c0-.552.448-1 1-1h6c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-1H8v6h5v-1c0-.552.448-1 1-1h6c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-1H7c-.552 0-1-.448-1-1V8H4c-.552 0-1-.448-1-1V3c0-.552.448-1 1-1h6zm9 16h-4v2h4v-2zm0-8h-4v2h4v-2zM9 4H5v2h4V4z"}}],yZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5c1.321 0 2.484.348 3.447.994.963.645 1.726 1.588 2.249 2.778.522 1.19.804 2.625.804 4.257v4.942c0 1.632-.282 3.068-.804 4.257-.523 1.19-1.286 2.133-2.25 2.778-.962.646-2.125.994-3.446.994-1.321 0-2.484-.348-3.447-.994-.963-.645-1.726-1.588-2.249-2.778-.522-1.19-.804-2.625-.804-4.257V9.529c0-1.632.282-3.068.804-4.257.523-1.19 1.286-2.133 2.25-2.778C9.515 1.848 10.678 1.5 12 1.5zm0 2c-.916 0-1.694.226-2.333.655-.637.427-1.158 1.07-1.532 1.92-.412.94-.635 2.108-.635 3.454v4.942c0 1.346.223 2.514.635 3.453.374.851.895 1.494 1.532 1.921.639.429 1.417.655 2.333.655.916 0 1.694-.226 2.333-.655.637-.427 1.158-1.07 1.532-1.92.412-.94.635-2.108.635-3.454V9.529c0-1.346-.223-2.514-.635-3.453-.374-.851-.895-1.494-1.532-1.921C13.694 3.726 12.916 3.5 12 3.5z"}}],bZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 1.5V22h-2V3.704L7.5 4.91V2.839l5-1.339z"}}],xZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 7.5a4 4 0 1 0-8 0H6a6 6 0 1 1 10.663 3.776l-7.32 8.723L18 20v2H6v-1.127l9.064-10.802A3.982 3.982 0 0 0 16 7.5z"}}],kZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 2v1.362L12.809 9.55a6.501 6.501 0 1 1-7.116 8.028l1.94-.486A4.502 4.502 0 0 0 16.5 16a4.5 4.5 0 0 0-6.505-4.03l-.228.122-.69-1.207L14.855 4 6.5 4V2H18z"}}],wZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 1.5V16h3v2h-3v4h-2v-4H4v-1.102L14 1.5h2zM14 16V5.171L6.968 16H14z"}}],SZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 2v2H9.3l-.677 6.445a6.5 6.5 0 1 1-2.93 7.133l1.94-.486A4.502 4.502 0 0 0 16.5 16a4.5 4.5 0 0 0-4.5-4.5c-2.022 0-3.278.639-3.96 1.53l-1.575-1.182L7.5 2H18z"}}],EZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.886 2l-4.438 7.686A6.5 6.5 0 1 1 6.4 12.7L12.576 2h2.31zM12 11.5a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9z"}}],CZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 2v1.5L10.763 22H8.574l8.013-18H6V2z"}}],MZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5a5.5 5.5 0 0 1 3.352 9.86C17.24 12.41 18.5 14.32 18.5 16.5c0 3.314-2.91 6-6.5 6s-6.5-2.686-6.5-6c0-2.181 1.261-4.09 3.147-5.141A5.5 5.5 0 0 1 12 1.5zm0 11c-2.52 0-4.5 1.828-4.5 4 0 2.172 1.98 4 4.5 4s4.5-1.828 4.5-4c0-2.172-1.98-4-4.5-4zm0-9a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7z"}}],TZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5a6.5 6.5 0 0 1 5.619 9.77l-6.196 10.729H9.114l4.439-7.686A6.5 6.5 0 1 1 12 1.5zm0 2a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9z"}}],OZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M14 20v-2.157c1.863-1.192 3.5-3.875 3.5-6.959 0-3.073-2-6.029-5.5-6.029s-5.5 2.956-5.5 6.03c0 3.083 1.637 5.766 3.5 6.958V20H3v-2h4.76C5.666 16.505 4 13.989 4 10.884 4 6.247 7.5 3 12 3s8 3.247 8 7.884c0 3.105-1.666 5.621-3.76 7.116H21v2h-7z"}}],_Z=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M15 3c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-2v2h4c.552 0 1 .448 1 1v3h2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1h2v-2H8v2h2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1h2v-3c0-.552.448-1 1-1h4V9H9c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zM9 17H5v2h4v-2zm10 0h-4v2h4v-2zM14 5h-4v2h4V5z"}}],AZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 21v-4H7v4H5v-5a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v5h-2zM7 3v4h10V3h2v5a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V3h2zM2 9l4 3-4 3V9zm20 0v6l-4-3 4-3z"}}],NZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 6v15h-2v-5a6 6 0 1 1 0-12h10v2h-3v15h-2V6h-3zm-2 0a4 4 0 1 0 0 8V6z"}}],RZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12.9 6.858l4.242 4.243L7.242 21H3v-4.243l9.9-9.9zm1.414-1.414l2.121-2.122a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414l-2.122 2.121-4.242-4.242z"}}],PZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.728 9.686l-1.414-1.414L5 17.586V19h1.414l9.314-9.314zm1.414-1.414l1.414-1.414-1.414-1.414-1.414 1.414 1.414 1.414zM7.242 21H3v-4.243L16.435 3.322a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414L7.243 21z"}}],zZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.934 3.036l1.732 1L18.531 6H21v2h-2v4h2v2h-2v7h-2v-7h-3.084c-.325 2.862-1.564 5.394-3.37 7.193l-1.562-1.27c1.52-1.438 2.596-3.522 2.917-5.922L10 14v-2l2-.001V8h-2V6h2.467l-1.133-1.964 1.732-1L14.777 6h1.444l1.713-2.964zM5 13.803l-2 .536v-2.071l2-.536V8H3V6h2V3h2v3h2v2H7v3.197l2-.536v2.07l-2 .536V18.5A2.5 2.5 0 0 1 4.5 21H3v-2h1.5a.5.5 0 0 0 .492-.41L5 18.5v-4.697zM17 8h-3v4h3V8z"}}],LZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 19c.828 0 1.5.672 1.5 1.5S12.828 22 12 22s-1.5-.672-1.5-1.5.672-1.5 1.5-1.5zm0-17c3.314 0 6 2.686 6 6 0 2.165-.753 3.29-2.674 4.923C13.399 14.56 13 15.297 13 17h-2c0-2.474.787-3.695 3.031-5.601C15.548 10.11 16 9.434 16 8c0-2.21-1.79-4-4-4S8 5.79 8 8v1H6V8c0-3.314 2.686-6 6-6z"}}],IZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21 19v2h-2v-2h2zm-4 0v2h-2v-2h2zm-4 0v2h-2v-2h2zm-4 0v2H7v-2h2zm-4 0v2H3v-2h2zm16-4v2h-2v-2h2zM5 15v2H3v-2h2zm0-4v2H3v-2h2zm11-8c2.687 0 4.882 2.124 4.995 4.783L21 8v5h-2V8c0-1.591-1.255-2.903-2.824-2.995L16 5h-5V3h5zM5 7v2H3V7h2zm0-4v2H3V3h2zm4 0v2H7V3h2z"}}],DZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M9.683 7.562L12 9.88l6.374-6.375a2 2 0 0 1 2.829 0l.707.707L9.683 16.438a4 4 0 1 1-2.121-2.121L9.88 12 7.562 9.683a4 4 0 1 1 2.121-2.121zM6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 12a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm9.535-6.587l6.375 6.376-.707.707a2 2 0 0 1-2.829 0l-4.96-4.961 2.12-2.122z"}}],$Z=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M14 3c.552 0 1 .448 1 1v5h5c.552 0 1 .448 1 1v10c0 .552-.448 1-1 1H10c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h10zm-1 2H5v8h4v-3c0-.552.448-1 1-1h3V5z"}}],HZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M11 3c.552 0 1 .448 1 1v2h5c.552 0 1 .448 1 1v5h2c.552 0 1 .448 1 1v7c0 .552-.448 1-1 1h-7c-.552 0-1-.448-1-1v-2H7c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h7zm5 5h-4v3c0 .552-.448 1-1 1H8v4h4v-3c0-.552.448-1 1-1h3V8z"}}],BZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M2 11h2v2H2v-2zm4 0h12v2H6v-2zm14 0h2v2h-2v-2z"}}],FZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M9.583 17.321C8.553 16.227 8 15 8 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179z"}}],VZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.417 6.679C15.447 7.773 16 9 16 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311C9.591 12.322 8.17 10.841 8.17 9a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179z"}}],jZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M19 3l4 5h-3v12h-2V8h-3l4-5zm-5 15v2H3v-2h11zm0-7v2H3v-2h11zm-2-7v2H3V4h9z"}}],UZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 4v12h3l-4 5-4-5h3V4h2zm-8 14v2H3v-2h9zm2-7v2H3v-2h11zm0-7v2H3V4h11z"}}],WZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 9v4h16V9h2v5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V9h2z"}}],KZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M17.5 2.5L23 12l-5.5 9.5h-11L1 12l5.5-9.5h11zm-1.153 2H7.653L3.311 12l4.342 7.5h8.694l4.342-7.5-4.342-7.5zM11 15h2v2h-2v-2zm0-8h2v6h-2V7z"}}],qZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-9 2H5v14h6v-4h2v4h6V5h-6v4h-2V5zm4 4l3 3-3 3v-2H9v2l-3-3 3-3v2h6V9z"}}],GZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-1 2H5v5.999L9 11v2H5v6h14v-6h-4v-2l4-.001V5zm-7 1l3 3h-2v6h2l-3 3-3-3h2V9H9l3-3z"}}],YZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 9h-2V6H5V4h14v2h-6v3zm0 6v5h-2v-5h2zM3 11h18v2H3v-2z"}}],JZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.154 14c.23.516.346 1.09.346 1.72 0 1.342-.524 2.392-1.571 3.147C14.88 19.622 13.433 20 11.586 20c-1.64 0-3.263-.381-4.87-1.144V16.6c1.52.877 3.075 1.316 4.666 1.316 2.551 0 3.83-.732 3.839-2.197a2.21 2.21 0 0 0-.648-1.603l-.12-.117H3v-2h18v2h-3.846zm-4.078-3H7.629a4.086 4.086 0 0 1-.481-.522C6.716 9.92 6.5 9.246 6.5 8.452c0-1.236.466-2.287 1.397-3.153C8.83 4.433 10.271 4 12.222 4c1.471 0 2.879.328 4.222.984v2.152c-1.2-.687-2.515-1.03-3.946-1.03-2.48 0-3.719.782-3.719 2.346 0 .42.218.786.654 1.099.436.313.974.562 1.613.75.62.18 1.297.414 2.03.699z"}}],XZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 6v13H9V6H3V4h14v2h-6zm8.55 10.58a.8.8 0 1 0-1.32-.36l-1.154.33A2.001 2.001 0 0 1 19 14a2 2 0 0 1 1.373 3.454L18.744 19H21v1h-4v-1l2.55-2.42z"}}],QZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5.596 4L10.5 9.928 15.404 4H18l-6.202 7.497L18 18.994V19h-2.59l-4.91-5.934L5.59 19H3v-.006l6.202-7.497L3 4h2.596zM21.55 16.58a.8.8 0 1 0-1.32-.36l-1.155.33A2.001 2.001 0 0 1 21 14a2 2 0 0 1 1.373 3.454L20.744 19H23v1h-4v-1l2.55-2.42z"}}],ZZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 11h14v2H5z"}}],eee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 7v13H9V7H3V5h12v2h-4zm8.55-.42a.8.8 0 1 0-1.32-.36l-1.154.33A2.001 2.001 0 0 1 19 4a2 2 0 0 1 1.373 3.454L18.744 9H21v1h-4V9l2.55-2.42z"}}],tee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5.596 5l4.904 5.928L15.404 5H18l-6.202 7.497L18 19.994V20h-2.59l-4.91-5.934L5.59 20H3v-.006l6.202-7.497L3 5h2.596zM21.55 6.58a.8.8 0 1 0-1.32-.36l-1.155.33A2.001 2.001 0 0 1 21 4a2 2 0 0 1 1.373 3.454L20.744 9H23v1h-4V9l2.55-2.42z"}}],ree=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M13 10v4h6v-4h-6zm-2 0H5v4h6v-4zm2 9h6v-3h-6v3zm-2 0v-3H5v3h6zm2-14v3h6V5h-6zm-2 0H5v3h6V5zM4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],nee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 8h16V5H4v3zm10 11v-9h-4v9h4zm2 0h4v-9h-4v9zm-8 0v-9H4v9h4zM3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],oee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 5v10H9v-4a4 4 0 1 1 0-8h8v2h-2v10h-2V5h-2zM9 5a2 2 0 1 0 0 4V5zm8 12v-2.5l4 3.5-4 3.5V19H5v-2h12z"}}],iee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 5v10H9v-4a4 4 0 1 1 0-8h8v2h-2v10h-2V5h-2zM9 5a2 2 0 1 0 0 4V5zM7 17h12v2H7v2.5L3 18l4-3.5V17z"}}],see=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 17h10v-2.5l3.5 3.5-3.5 3.5V19H7v2.5L3.5 18 7 14.5V17zm6-11v9h-2V6H5V4h14v2h-6z"}}],aee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 18h1.5a2.5 2.5 0 1 0 0-5H3v-2h13.5a4.5 4.5 0 1 1 0 9H15v2l-4-3 4-3v2zM3 4h18v2H3V4zm6 14v2H3v-2h6z"}}],lee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 6v15h-2V6H5V4h14v2z"}}],cee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301 14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"}}],uee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 15v2a2 2 0 0 0 1.85 1.995L7 19h3v2H7a4 4 0 0 1-4-4v-2h2zm13-5l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16 10h2zm-1 2.885L15.753 16h2.492L17 12.885zM8 2v2h4v7H8v3H6v-3H2V4h4V2h2zm9 1a4 4 0 0 1 4 4v2h-2V7a2 2 0 0 0-2-2h-3V3h3zM6 6H4v3h2V6zm4 0H8v3h2V6z"}}],dee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 3v9a4 4 0 1 0 8 0V3h2v9a6 6 0 1 1-12 0V3h2zM4 20h16v2H4v-2z"}}],fee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 19h16v-7h2v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-8h2v7zM14 9v6h-4V9H5l7-7 7 7h-5z"}}],pee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3.993C3 3.445 3.445 3 3.993 3h16.014c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 20.007V3.993zM5 5v14h14V5H5zm5.622 3.415l4.879 3.252a.4.4 0 0 1 0 .666l-4.88 3.252a.4.4 0 0 1-.621-.332V8.747a.4.4 0 0 1 .622-.332z"}}],hee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 21v-2h3.662l1.234-7H5v-2h3.249l.881-5H4V3h16v2h-8.839l-.882 5H18v9h3v2H3zm13-9H9.927l-1.235 7H16v-7z"}}];const mee=Object.freeze(Object.defineProperty({__proto__:null,ab:NX,addFill:RX,addLine:PX,alertLine:zX,alignBottom:LX,alignCenter:IX,alignJustify:DX,alignLeft:$X,alignRight:HX,alignTop:BX,alignVertically:FX,appsLine:VX,arrowDownSFill:jX,arrowGoBackFill:UX,arrowGoForwardFill:WX,arrowLeftSFill:KX,arrowRightSFill:qX,arrowUpSFill:GX,asterisk:YX,attachment2:JX,bold:XX,bracesLine:QX,bringForward:ZX,bringToFront:eQ,chatNewLine:tQ,checkboxCircleLine:rQ,checkboxMultipleLine:nQ,clipboardFill:oQ,clipboardLine:iQ,closeCircleLine:sQ,closeFill:aQ,closeLine:lQ,codeLine:cQ,codeView:uQ,deleteBinFill:dQ,deleteBinLine:fQ,deleteColumn:pQ,deleteRow:hQ,doubleQuotesL:mQ,doubleQuotesR:gQ,download2Fill:vQ,dragDropLine:yQ,emphasis:xQ,emphasisCn:bQ,englishInput:kQ,errorWarningLine:wQ,externalLinkFill:SQ,fileCopyLine:EQ,flowChart:CQ,fontColor:MQ,fontSize:OQ,fontSize2:TQ,formatClear:_Q,fullscreenExitLine:AQ,fullscreenLine:NQ,functions:RQ,galleryUploadLine:PQ,h1:zQ,h2:LQ,h3:IQ,h4:DQ,h5:$Q,h6:HQ,hashtag:BQ,heading:FQ,imageAddLine:VQ,imageEditLine:jQ,imageLine:UQ,indentDecrease:WQ,indentIncrease:KQ,informationLine:qQ,inputCursorMove:GQ,insertColumnLeft:YQ,insertColumnRight:JQ,insertRowBottom:XQ,insertRowTop:QQ,italic:ZQ,layoutColumnLine:eZ,lineHeight:tZ,link:iZ,linkM:rZ,linkUnlink:oZ,linkUnlinkM:nZ,listCheck:aZ,listCheck2:sZ,listOrdered:lZ,listUnordered:cZ,markPenLine:uZ,markdownFill:dZ,markdownLine:fZ,mergeCellsHorizontal:pZ,mergeCellsVertical:hZ,mindMap:mZ,moreFill:gZ,nodeTree:vZ,number0:yZ,number1:bZ,number2:xZ,number3:kZ,number4:wZ,number5:SZ,number6:EZ,number7:CZ,number8:MZ,number9:TZ,omega:OZ,organizationChart:_Z,pageSeparator:AZ,paragraph:NZ,pencilFill:RZ,pencilLine:PZ,pinyinInput:zZ,questionMark:LZ,roundedCorner:IZ,scissorsFill:DZ,sendBackward:$Z,sendToBack:HZ,separator:BZ,singleQuotesL:FZ,singleQuotesR:VZ,sortAsc:jZ,sortDesc:UZ,space:WZ,spamLine:KZ,splitCellsHorizontal:qZ,splitCellsVertical:GZ,strikethrough:JZ,strikethrough2:YZ,subscript:QZ,subscript2:XZ,subtractLine:ZZ,superscript:tee,superscript2:eee,table2:ree,tableLine:nee,text:lee,textDirectionL:oee,textDirectionR:iee,textSpacing:see,textWrap:aee,translate:uee,translate2:cee,underline:dee,upload2Fill:fee,videoLine:pee,wubiInput:hee},Symbol.toStringTag,{value:"Module"}));function gee(e,t=null){return function(r,n){let{$from:o,$to:i}=r.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(e)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=r.doc.resolve(s.start-2);l=new na(u,u,s.depth),s.endIndex=0;u--)i=R.from(r[u].type.create(r[u].attrs,i));e.step(new bt(t.start-(n?2:0),t.end,t.start,t.end,new K(i,0,0),r.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==e);return i?r?n.node(i.depth-1).type==e?bee(t,r,e,i):xee(t,r,i):!0:!1}}function bee(e,t,r,n){let o=e.tr,i=n.end,s=n.$to.end(n.depth);im;h--)p-=o.child(h).nodeSize,n.delete(p-1,p+1);let i=n.doc.resolve(r.start),s=i.nodeAfter;if(n.mapping.map(r.end)!=r.start+i.nodeAfter.nodeSize)return!1;let a=r.startIndex==0,l=r.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?R.empty:R.from(o))))return!1;let d=i.pos,f=d+s.nodeSize;return n.step(new bt(d-(a?1:0),f+(l?1:0),d+1,f-1,new K((a?R.empty:R.from(o.copy(R.empty))).append(l?R.empty:R.from(o.copy(R.empty))),a?0:1,l?0:1),a?0:1)),t(n.scrollIntoView()),!0}var kee=Object.defineProperty,wee=Object.getOwnPropertyDescriptor,Hn=(e,t,r,n)=>{for(var o=n>1?void 0:n?wee(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&kee(t,r,o),o};function av(e){var t;return!!((t=e.spec.group)!=null&&t.includes(oe.ListContainerNode))}function See(e){var t;return!!((t=e.spec.group)!=null&&t.includes(oe.ListItemNode))}function cs(e){return av(e.type)}function Qi(e){return See(e.type)}function Lb(e,t){return r=>{const{dispatch:n,tr:o}=r,i=Vv(o,r.state),{$from:s,$to:a}=o.selection,l=s.blockRange(a);if(!l)return!1;const c=Ld({predicate:u=>av(u.type),selection:o.selection});if(c&&l.depth-c.depth<=1&&l.startIndex===0){if(c.node.type===e)return P3(t)(r);if(av(c.node.type))return e.validContent(c.node.content)?(n==null||n(o.setNodeMarkup(c.pos,e)),!0):Eee(o,c,e,t)?(n==null||n(o.scrollIntoView()),!0):!1}return gee(e)(i,n)}}function N3(e,t=["checked"]){return function({tr:r,dispatch:n,state:o}){var i,s;const a=uz(e,o.schema),{$from:l,$to:c}=r.selection;if(Dd(r.selection)&&r.selection.node.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(n){const m=l.index(-1)>0;let b=R.empty;for(let y=l.depth-(m?1:2);y>=l.depth-3;y--)b=R.from(l.node(y).copy(b));const v=((i=a.contentMatch.defaultType)==null?void 0:i.createAndFill())||void 0;b=b.append(R.from(a.createAndFill(null,v)||void 0));const g=l.indexAfter(-1)!t.includes(m))),f=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,p={...l.node().attrs};r.delete(l.pos,c.pos);const h=f?[{type:a,attrs:d},{type:f,attrs:p}]:[{type:a,attrs:d}];return dl(r.doc,l.pos,2)?(n&&n(r.split(l.pos,2,h).scrollIntoView()),!0):!1}}function Eee(e,t,r,n){const o=t.node,i=e.doc.resolve(t.start),s=i.node(-1),a=i.index(-1);if(!s||!s.canReplace(a,a+1,R.from(r.create())))return!1;const l=[];for(let p=0;pb;m--)h-=o.child(m).nodeSize,n.delete(h-1,h+1);const s=n.doc.resolve(r.start),a=s.nodeAfter;if(!a||n.mapping.slice(i).map(r.end)!==r.start+a.nodeSize)return!1;const l=r.startIndex===0,c=r.endIndex===o.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(l?0:1),d+1,a.content.append(c?R.empty:R.from(o))))return!1;const f=s.pos,p=f+a.nodeSize;return n.step(new bt(f-(l?1:0),p+(c?1:0),f+1,p-1,new K((l?R.empty:R.from(o.copy(R.empty))).append(c?R.empty:R.from(o.copy(R.empty))),l?0:1,c?0:1),l?0:1)),t(n.scrollIntoView()),!0}function R3(e,t){const r=t||e.selection.$from;let n=[],o,i,s,a;for(let c=r.depth;c>=0;c--){if(i=r.node(c),o=r.index(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&cs(s)){const u=r.before(c+1);n.push(u)}if(o=r.indexAfter(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&cs(s)){const u=r.after(c+1);n.push(u)}}n=[...new Set(n)].sort((c,u)=>u-c);let l=!1;for(const c of n)Rd(e.doc,c)&&(e.join(c),l=!0);return l}function P3(e){return t=>{const{dispatch:r,tr:n}=t,o=Vv(n,t.state),i=Tee(e,n.selection);return i?(r&&Mee(o,r,i),!0):!1}}function Tee(e,t){const{$from:r,$to:n}=t;return r.blockRange(n,i=>{var s;return((s=i.firstChild)==null?void 0:s.type)===e})}function bh(e){const{$from:t,$to:r}=e;return t.blockRange(r,cs)}function Oee(e){const t=e.selection.$from,r=t.blockRange();if(!r||!Qi(r.parent)||r.startIndex!==0)return!1;const n=t.node(r.depth-2),o=t.index(r.depth),i=t.index(r.depth-1),s=t.index(r.depth-2),a=n.maybeChild(s-1),l=a==null?void 0:a.lastChild;if(o!==0||i!==0)return!1;if(a&&cs(a)&&l&&Qi(l))return Ql({listType:a.type,itemType:l.type,tr:e});if(Qi(n)){const c=n,u=t.node(r.depth-3);if(cs(u))return Ql({listType:u.type,itemType:c.type,tr:e})}return!1}function HS({view:e}){if(!e)return!1;{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const r=t.blockRange();if(!r||!Qi(r.parent)||r.startIndex!==0)return!1}{const t=e.state.tr;Oee(t)&&e.dispatch(t)}{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const r=t.blockRange();if(!r||!Qi(r.parent)||r.startIndex!==0)return!1;const n=t.index(r.depth),o=t.index(r.depth-1),i=t.index(r.depth-2),s=r.depth-2>=1&&Qi(t.node(r.depth-2));n===0&&o===0&&i<=1&&s&&yee(r.parent.type)(e.state,e.dispatch)}return jC(e.state,e.dispatch,e),!0}function z3({node:e,mark:t,updateDOM:r,updateMark:n}){const o=document.createElement("label");o.contentEditable="false",o.classList.add(ls.LIST_ITEM_MARKER_CONTAINER),o.append(t);const i=document.createElement("div"),s=document.createElement("li");s.classList.add(ls.LIST_ITEM_WITH_CUSTOM_MARKER),s.append(o),s.append(i);const a=l=>l.type!==e.type?!1:(e=l,r(e,s),n(e,t),!0);return a(e),{dom:s,contentDOM:i,update:a}}function _ee(e,t){const r=e.node(t.depth-1),n=e.node(t.depth-2);return!Qi(r)||!cs(n)?!1:{parentItem:r,parentList:n}}function Aee(e,t){const r=t.parent,n=t.parent.child(t.endIndex-1),o=t.end,i=t.$to.end(t.depth);return oPee(e)?(t==null||t(e.scrollIntoView()),!0):!1;function Lee(e,t,r){let n,o,i,s;const a=t.doc;if(r.startIndex>=1){n=e.child(r.startIndex-1),o=e,s=a.resolve(r.start).start(r.depth),i=s+1;for(let l=0;l=1){const c=t.node(r.depth-1),u=t.start(r.depth-1);if(o=c.child(l-1),!cs(o))return!1;s=u+1;for(let d=0;d=r.depth+2?t.end(r.depth+2):r.end-1,a=r.end;return s+1>=a?(n=e.slice(i,a),o=null):(n=e.slice(i,s),o=e.slice(s+1,a-1)),{selectedSlice:n,unselectedSlice:o}}function Dee(e){const{$from:t,$to:r}=e.selection,n=bh(e.selection);if(!n)return!1;const o=e.doc.resolve(n.start).node();if(!cs(o))return!1;const i=Lee(o,t,n);if(!i)return!1;const{previousItem:s,previousList:a,previousItemStart:l}=i,{selectedSlice:c,unselectedSlice:u}=Iee(e.doc,r,n),d=s.content.append(R.fromArray([o.copy(c.content)])).append(u?u.content:R.empty);e.deleteRange(n.start,n.end);const f=l+s.nodeSize-2,p=s.copy(d);return p.check(),e.replaceRangeWith(l-1,f+1,p),e.setSelection(a===o?le.between(e.doc.resolve(t.pos),e.doc.resolve(r.pos)):le.between(e.doc.resolve(t.pos-2),e.doc.resolve(r.pos-2))),!0}var $ee=({tr:e,dispatch:t})=>Dee(e)?(t==null||t(e.scrollIntoView()),!0):!1,L3=class extends Ve{get name(){return"listItemShared"}createKeymap(){const e={Tab:$ee,"Shift-Tab":zee,Backspace:HS,"Mod-Backspace":HS};if(on.isMac){const t={"Ctrl-h":e.Backspace,"Alt-Backspace":e["Mod-Backspace"]};return{...e,...t}}return e}createPlugin(){return{appendTransaction:(e,t,r)=>{const n=r.tr;return R3(n)?n:null}}}},ya=class extends er{get name(){return"listItem"}createTags(){return[oe.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),closed:{default:!1},nested:{default:!1}},parseDOM:[{tag:"li",getAttrs:e.parse,priority:Ae.Lowest},...t.parseDOM??[]],toDOM:r=>["li",e.dom(r),0]}}createNodeViews(){return this.options.enableCollapsible?(e,t,r)=>{const n=document.createElement("div");return n.classList.add(ls.COLLAPSIBLE_LIST_ITEM_BUTTON),n.contentEditable="false",n.addEventListener("click",()=>{if(n.classList.contains("disabled"))return;const o=r(),i=ce.create(t.state.doc,o);return t.dispatch(t.state.tr.setSelection(i)),this.store.commands.toggleListItemClosed(),!0}),z3({mark:n,node:e,updateDOM:Hee,updateMark:Bee})}:{}}createKeymap(){return{Enter:N3(this.type)}}createExtensions(){return[new L3]}toggleListItemClosed(e){return({state:{tr:t,selection:r},dispatch:n})=>{if(!Dd(r)||r.node.type.name!==this.name)return!1;const{node:o,from:i}=r;return e=E1(e)?e:!o.attrs.closed,n==null||n(t.setNodeMarkup(i,void 0,{...o.attrs,closed:e})),!0}}liftListItemOutOfList(e){return P3(e??this.type)}};Hn([U()],ya.prototype,"toggleListItemClosed",1);Hn([U()],ya.prototype,"liftListItemOutOfList",1);ya=Hn([pe({defaultOptions:{enableCollapsible:!1},staticKeys:["enableCollapsible"]})],ya);function Hee(e,t){e.attrs.closed?t.classList.add(ls.COLLAPSIBLE_LIST_ITEM_CLOSED):t.classList.remove(ls.COLLAPSIBLE_LIST_ITEM_CLOSED)}function Bee(e,t){e.childCount<=1?t.classList.add("disabled"):t.classList.remove("disabled")}var bd=class extends er{get name(){return"bulletList"}createTags(){return[oe.Block,oe.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["ul",e.dom(r),0]}}createNodeViews(){return this.options.enableSpine?(e,t,r)=>{var n;const o=document.createElement("div");o.style.position="relative";const i=r(),s=t.state.doc.resolve(i+1),a=s.node(s.depth-1);if(!(((n=a==null?void 0:a.type)==null?void 0:n.name)!=="listItem")){const u=document.createElement("div");u.contentEditable="false",u.classList.add(ls.LIST_SPINE),u.addEventListener("click",d=>{const f=r(),p=t.state.doc.resolve(f+1),h=p.start(p.depth-1),m=ce.create(t.state.doc,h-1);t.dispatch(t.state.tr.setSelection(m)),this.store.commands.toggleListItemClosed(),d.preventDefault(),d.stopPropagation()}),o.append(u)}const c=document.createElement("ul");return c.classList.add(ls.UL_LIST_CONTENT),o.append(c),{dom:o,contentDOM:c}}:{}}createExtensions(){return[new ya({priority:Ae.Low,enableCollapsible:this.options.enableSpine})]}toggleBulletList(){return Lb(this.type,it(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleBulletList()(e)}createInputRules(){const e=/^\s*([*+-])\s$/;return[zh(e,this.type),new wa(e,(t,r,n,o)=>{const i=t.tr;return i.deleteRange(n,o),Ql({listType:this.type,itemType:it(this.store.schema.nodes,"listItem"),tr:i})?i:null})]}};Hn([U({icon:"listUnordered",label:({t:e})=>e(Nv.BULLET_LIST_LABEL)})],bd.prototype,"toggleBulletList",1);Hn([je({shortcut:D.BulletList,command:"toggleBulletList"})],bd.prototype,"listShortcut",1);bd=Hn([pe({defaultOptions:{enableSpine:!1},staticKeys:["enableSpine"]})],bd);var xd=class extends er{get name(){return"orderedList"}createTags(){return[oe.Block,oe.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:{...e.defaults(),order:{default:1}},parseDOM:[{tag:"ol",getAttrs:r=>Je(r)?{...e.parse(r),order:+(r.getAttribute("start")??1)}:{}},...t.parseDOM??[]],toDOM:r=>{const n=e.dom(r);return r.attrs.order===1?["ol",n,0]:["ol",{...n,start:r.attrs.order},0]}}}createExtensions(){return[new ya({priority:Ae.Low})]}toggleOrderedList(){return Lb(this.type,it(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleOrderedList()(e)}createInputRules(){const e=/^(\d+)\.\s$/;return[zh(e,this.type,t=>({order:+it(t,1)}),(t,r)=>r.childCount+r.attrs.order===+it(t,1)),new wa(e,(t,r,n,o)=>{const i=t.tr;if(i.deleteRange(n,o),!Ql({listType:this.type,itemType:it(this.store.schema.nodes,"listItem"),tr:i}))return null;const a=+it(r,1);if(a!==1){const l=ts({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{order:a})}return i})]}};Hn([U({icon:"listOrdered",label:({t:e})=>e(Nv.ORDERED_LIST_LABEL)})],xd.prototype,"toggleOrderedList",1);Hn([je({shortcut:D.OrderedList,command:"toggleOrderedList"})],xd.prototype,"listShortcut",1);xd=Hn([pe({})],xd);var I3=class extends er{get name(){return"taskListItem"}createTags(){return[oe.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),checked:{default:!1}},parseDOM:[{tag:"li[data-task-list-item]",getAttrs:r=>{let n=!1;return Je(r)&&r.getAttribute("data-checked")!==null&&(n=!0),{checked:n,...e.parse(r)}},priority:Ae.Medium},...t.parseDOM??[]],toDOM:r=>["li",{...e.dom(r),"data-task-list-item":"","data-checked":r.attrs.checked?"":void 0},0]}}createNodeViews(){return(e,t,r)=>{const n=document.createElement("input");return n.type="checkbox",n.classList.add(ls.LIST_ITEM_CHECKBOX),n.contentEditable="false",n.addEventListener("click",o=>{t.editable||o.preventDefault()}),n.addEventListener("change",()=>{const o=r(),i=t.state.doc.resolve(o+1);this.store.commands.toggleCheckboxChecked({$pos:i})}),n.checked=e.attrs.checked,z3({node:e,mark:n,updateDOM:Fee,updateMark:Vee})}}createKeymap(){return{Enter:N3(this.type)}}createExtensions(){return[new L3]}toggleCheckboxChecked(e){let t,r;return typeof e=="boolean"?t=e:e&&(t=e.checked,r=e.$pos),({tr:n,dispatch:o})=>{const i=ts({selection:r??n.selection.$from,types:this.type});if(!i)return!1;const{node:s,pos:a}=i,l={...s.attrs,checked:t??!s.attrs.checked};return o==null||o(n.setNodeMarkup(a,void 0,l)),!0}}createInputRules(){const e=/^\s*(\[( ?|x|X)]\s)$/;return[zh(e,this.type,t=>({checked:["x","X"].includes(Zo(t,2))})),new wa(e,(t,r,n,o)=>{const i=t.tr;if(i.deleteRange(n,o),!Ql({listType:it(this.store.schema.nodes,"taskList"),itemType:this.type,tr:i}))return null;const a=["x","X"].includes(Zo(r,2));if(a){const l=ts({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{checked:a})}return i})]}};Hn([U()],I3.prototype,"toggleCheckboxChecked",1);function Fee(e,t){e.attrs.checked?t.setAttribute("data-checked",""):t.removeAttribute("data-checked"),t.setAttribute("data-task-list-item","")}function Vee(e,t){t.checked=!!e.attrs.checked}var D3=class extends er{get name(){return"taskList"}createTags(){return[oe.Block,oe.ListContainerNode]}createNodeSpec(e,t){return{content:"taskListItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul[data-task-list]",getAttrs:e.parse,priority:Ae.Medium},...t.parseDOM??[]],toDOM:r=>["ul",{...e.dom(r),"data-task-list":""},0]}}createExtensions(){return[new I3({})]}toggleTaskList(){return Lb(this.type,it(this.store.schema.nodes,"taskListItem"))}listShortcut(e){return this.toggleTaskList()(e)}};Hn([U({icon:"checkboxMultipleLine",label:({t:e})=>e(Nv.TASK_LIST_LABEL)})],D3.prototype,"toggleTaskList",1);Hn([je({shortcut:D.TaskList,command:"toggleTaskList"})],D3.prototype,"listShortcut",1);var fo,jee=(e=document)=>fo||(fo=e.createElement("div"),fo.setAttribute("id","a11y-status-message"),fo.setAttribute("role","status"),fo.setAttribute("aria-live","polite"),fo.setAttribute("aria-relevant","additions text"),Object.assign(fo.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.append(fo),fo);j4(500,()=>{jee().textContent=""});function BS(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function FS(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function u1(e,t){if(e.clientHeightt||i>e&&s=t&&a>=r?i-e-n:s>t&&ar?s-t+o:0}var Uee=function(e,t){var r=window,n=t.scrollMode,o=t.block,i=t.inline,s=t.boundary,a=t.skipOverflowHiddenElements,l=typeof s=="function"?s:function(De){return De!==s};if(!BS(e))throw new TypeError("Invalid target");for(var c,u,d=document.scrollingElement||document.documentElement,f=[],p=e;BS(p)&&l(p);){if((p=(u=(c=p).parentElement)==null?c.getRootNode().host||null:u)===d){f.push(p);break}p!=null&&p===document.body&&u1(p)&&!u1(document.documentElement)||p!=null&&u1(p,a)&&f.push(p)}for(var h=r.visualViewport?r.visualViewport.width:innerWidth,m=r.visualViewport?r.visualViewport.height:innerHeight,b=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,g=e.getBoundingClientRect(),y=g.height,x=g.width,k=g.top,w=g.right,E=g.bottom,T=g.left,C=o==="start"||o==="nearest"?k:o==="end"?E:k+y/2,M=i==="center"?T+x/2:i==="end"?w:T,N=[],F=0;F=0&&T>=0&&E<=m&&w<=h&&k>=q&&E<=P&&T>=B&&w<=A)return N;var Y=getComputedStyle(I),J=parseInt(Y.borderLeftWidth,10),Ne=parseInt(Y.borderTopWidth,10),ie=parseInt(Y.borderRightWidth,10),ue=parseInt(Y.borderBottomWidth,10),de=0,me=0,Me="offsetWidth"in I?I.offsetWidth-I.clientWidth-J-ie:0,Se="offsetHeight"in I?I.offsetHeight-I.clientHeight-Ne-ue:0,ft="offsetWidth"in I?I.offsetWidth===0?0:z/I.offsetWidth:0,rt="offsetHeight"in I?I.offsetHeight===0?0:j/I.offsetHeight:0;if(d===I)de=o==="start"?C:o==="end"?C-m:o==="nearest"?Of(v,v+m,m,Ne,ue,v+C,v+C+y,y):C-m/2,me=i==="start"?M:i==="center"?M-h/2:i==="end"?M-h:Of(b,b+h,h,J,ie,b+M,b+M+x,x),de=Math.max(0,de+v),me=Math.max(0,me+b);else{de=o==="start"?C-q-Ne:o==="end"?C-P+ue+Se:o==="nearest"?Of(q,P,j,Ne,ue+Se,C,C+y,y):C-(q+j/2)+Se/2,me=i==="start"?M-B-J:i==="center"?M-(B+z/2)+Me/2:i==="end"?M-A+ie+Me:Of(B,A,z,J,ie+Me,M,M+x,x);var Or=I.scrollLeft,he=I.scrollTop;C+=he-(de=Math.max(0,Math.min(he+de/rt,I.scrollHeight-j/rt+Se))),M+=Or-(me=Math.max(0,Math.min(Or+me/ft,I.scrollWidth-z/ft+Me)))}N.push({el:I,top:de,left:me})}return N};typeof xr=="object"&&xr.__esModule&&xr.default&&xr.default;Rh(Uee);var Wee=typeof document<"u"?S.useLayoutEffect:S.useEffect;function Kee(e){const t=S.useRef();return Wee(()=>{t.current=e}),t.current}function qee(e,t){const[r,n]=S.useState([]),[o,i]=S.useState(()=>K0(e)),[s,a]=S.useState([]),l=S.useRef(e),c=Kee(o);return l.current=e,Wd(Ul,({addCustomHandler:u})=>{const d=K0(l.current),f=u("positioner",d);return i(d),f},t),S.useLayoutEffect(()=>{const u=o.addListener("update",f=>{const p=[];for(const{id:h,data:m,setElement:b}of f){const v=g=>{g&&b(g)};p.push({id:h,data:m,ref:v})}a(p)}),d=o.addListener("done",f=>{n(f)});return c!=null&&c.recentUpdate&&o.onActiveChanged(c==null?void 0:c.recentUpdate),()=>{u(),d()}},[o,c]),S.useMemo(()=>{const u=[];for(const[d,{ref:f,data:p,id:h}]of s.entries()){const m=r[d],{element:b,position:v={}}=m??{},g={...Qy,...q4(v)};u.push({ref:f,element:b,data:p,key:h,...g})}return u},[s,r])}function Gee(e,t){const r=t==null||E1(t)?[e]:t,n=E1(t)?t:!0,o=S.useRef(Cl()),s=qee(e,r)[0];return S.useMemo(()=>s&&n?{...s,active:!0}:{...Qy,ref:void 0,data:{},active:!1,key:o.current},[n,s])}function d1(e,t){return _e(e)?e(t):e}function Yee(e){return ne(e[0])}function Jee(e,t){var r;return ne(e)?e:ct(e)?Yee(e)?e[0]??"":((r=e.find(n=>G4(n.attrs,t))??e[0])==null?void 0:r.shortcut)??"":e.shortcut}var Xee={title:e=>dA(e),upper:e=>e.toLocaleUpperCase(),lower:e=>e.toLocaleLowerCase()};function Qee(e,t){const{casing:r="title",namedAsSymbol:n=!1,modifierAsSymbol:o=!0,separator:i=" ",t:s}=t,a=Bz(e),l=[],c=Xee[r];for(const u of a){if(u.type==="char"){l.push(c(u.key));continue}if(u.type==="named"){const f=n===!0||ct(n)&&fr(n,u.key)?u.symbol??s(u.i18n):s(u.i18n);l.push(c(f));continue}const d=o===!0||ct(o)&&fr(o,u.key)?u.symbol:s(u.i18n);l.push(c(d))}return l.join(i)}var $3=({commandName:e,active:t,enabled:r,attrs:n})=>{const{t:o}=dj(),{getCommandOptions:i}=dm(),s=i(e),{description:a,label:l,icon:c,shortcut:u}=s||{},d=S.useMemo(()=>({active:t,attrs:n,enabled:r,t:o}),[t,n,r,o]),f=S.useMemo(()=>{if(u)return Qee(Jee(u,n??{}),{t:o,separator:""})},[u,n,o]);return S.useMemo(()=>({description:d1(a,d),label:d1(l,d),icon:d1(c,d),shortcut:f}),[d,a,l,c,f])},Zee={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},H3=S.createContext(Zee);H3.Provider;function B3(e){return e.map((t,r)=>S.createElement(t.tag,{key:r,...t.attr},B3(t.child??[])))}var Ym=e=>{const{name:t}=e;return L.createElement(ete,{...e},B3(mee[t]))},ete=e=>{const t=r=>{const n=e.size??r.size??"1em";let o;r.className&&(o=r.className),e.className&&(o=(o?`${o} `:"")+e.className);const{title:i,...s}=e;return L.createElement("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",...r.attr,...s,className:o,style:{color:e.color??r.color,...r.style,...e.style},height:n,width:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},i&&L.createElement("title",null,i),e.children)};return L.createElement(H3.Consumer,null,t)},tte=e=>hs(e)?!!e.name:!1,rte=({icon:e})=>ne(e)?L.createElement(Ym,{name:e,size:"1rem"}):e,nte=({icon:e,children:t})=>{if(!tte(e))return L.createElement(L.Fragment,null,t);const{sub:r,sup:n}=e,o=r??n,i=r!==void 0;return o===void 0?L.createElement(L.Fragment,null,t):L.createElement(nJ,{anchorOrigin:{vertical:i?"bottom":"top",horizontal:"right"},badgeContent:o,sx:{"& > .MuiBadge-badge":{bgcolor:"background.paper",color:"text.secondary",minWidth:12,height:12,margin:"2px 0",padding:"1px"}}},t)},dt=({commandName:e,active:t=!1,enabled:r,attrs:n,onSelect:o,onChange:i,icon:s,displayShortcut:a=!0,"aria-label":l,label:c,...u})=>{const d=S.useCallback((g,y)=>{o(),i==null||i(g,y)},[o,i]),f=S.useCallback(g=>{g.preventDefault()},[]),p=$3({commandName:e,active:t,enabled:r,attrs:n});let h=null;p.icon&&(h=ne(p.icon)?p.icon:p.icon.name);const m=l??p.label??"",b=c??m,v=a&&p.shortcut?` (${p.shortcut})`:"";return L.createElement(A3,{title:`${b}${v}`},L.createElement(M3,{component:"span",sx:{"&:not(:first-of-type)":{marginLeft:"-1px"}}},L.createElement(AX,{"aria-label":m,selected:t,disabled:!r,onMouseDown:f,color:"primary",size:"small",sx:{padding:"6px 12px","&.Mui-selected":{backgroundColor:"primary.main",color:"primary.contrastText"},"&.Mui-selected:hover":{backgroundColor:"primary.dark",color:"primary.contrastText"},"&:not(:first-of-type)":{borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-of-type)":{borderTopRightRadius:0,borderBottomRightRadius:0}},...u,value:e,onChange:d},L.createElement(nte,{icon:p.icon},L.createElement(rte,{icon:s??h})))))},ote=({icon:e})=>ne(e)?L.createElement(Ym,{name:e,size:"1rem"}):e,F3=({label:e,"aria-label":t,icon:r,children:n,onClose:o,...i})=>{const s=S.useRef(Cl()),[a,l]=S.useState(null),c=!!a,u=S.useCallback(p=>{p.preventDefault()},[]),d=S.useCallback(p=>{l(p.currentTarget)},[]),f=S.useCallback((p,h)=>{l(null),o==null||o(p,h)},[o]);return L.createElement(L.Fragment,null,L.createElement(A3,{title:e??t},L.createElement(Uq,{"aria-label":t,"aria-controls":c?s.current:void 0,"aria-haspopup":!0,"aria-expanded":c?"true":void 0,onMouseDown:u,onClick:d,size:"small",sx:p=>({border:`1px solid ${p.palette.divider}`,borderRadius:`${p.shape.borderRadius}px`,padding:"6px 12px","&:not(:first-of-type)":{marginLeft:"-1px",borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-of-type)":{borderTopRightRadius:0,borderBottomRightRadius:0}})},r&&L.createElement(ote,{icon:r}),L.createElement(Ym,{name:"arrowDownSFill",size:"1rem"}))),L.createElement(sX,{...i,id:s.current,anchorEl:a,open:c,onClose:f},n))},ite=e=>{const{insertHorizontalRule:t}=tr();tb();const r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=t.enabled();return L.createElement(dt,{...e,commandName:"insertHorizontalRule",enabled:n,onSelect:r})},ste=e=>{const{redo:t}=tr(),{redoDepth:r}=dm(!0),n=S.useCallback(()=>{t.enabled()&&t()},[t]),o=r()>0;return L.createElement(dt,{...e,commandName:"redo",active:!1,enabled:o,onSelect:n})},ate=e=>{const{toggleBlockquote:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().blockquote(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleBlockquote",active:n,enabled:o,onSelect:r})},lv=e=>{const{toggleBold:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().bold(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleBold",active:n,enabled:o,onSelect:r})},lte=e=>{const{toggleBulletList:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().bulletList(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleBulletList",active:n,enabled:o,onSelect:r})},cte=({attrs:e={},...t})=>{const{toggleCodeBlock:r}=tr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=qr().codeBlock(),i=r.enabled(e);return L.createElement(dt,{...t,commandName:"toggleCodeBlock",active:o,enabled:i,attrs:e,onSelect:n})},cv=e=>{const{toggleCode:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().code(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleCode",active:n,enabled:o,onSelect:r})},f1=({attrs:e,...t})=>{const{toggleHeading:r}=tr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=qr().heading(e),i=r.enabled(e);return L.createElement(dt,{...t,commandName:"toggleHeading",active:o,enabled:i,attrs:e,onSelect:n})},uv=e=>{const{toggleItalic:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().italic(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleItalic",active:n,enabled:o,onSelect:r})},ute=e=>{const{toggleOrderedList:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().orderedList(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleOrderedList",active:n,enabled:o,onSelect:r})},dte=e=>{const{toggleStrike:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().strike(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleStrike",active:n,enabled:o,onSelect:r})},dv=e=>{const{toggleUnderline:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().underline(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleUnderline",active:n,enabled:o,onSelect:r})},fte=e=>{const{undo:t}=tr(),{undoDepth:r}=dm(!0),n=S.useCallback(()=>{t.enabled()&&t()},[t]),o=r()>0;return L.createElement(dt,{...e,commandName:"undo",active:!1,enabled:o,onSelect:n})},En=e=>L.createElement(M3,{sx:{display:"flex",alignItems:"center",width:"fit-content",bgcolor:"background.paper",color:"text.secondary"},...e}),pte=({children:e})=>L.createElement(En,null,L.createElement(lv,null),L.createElement(uv,null),L.createElement(dv,null),L.createElement(dte,null),L.createElement(cv,null),e),hte=({icon:e})=>e?L.createElement(NJ,null,ne(e)?L.createElement(Ym,{name:e,size:"1rem"}):L.createElement(L.Fragment,null,e)):null,Ib=({commandName:e,active:t=!1,enabled:r,attrs:n,onSelect:o,onClick:i,icon:s,displayShortcut:a=!0,label:l,description:c,displayDescription:u=!0,...d})=>{const f=S.useCallback(g=>{o(),i==null||i(g)},[o,i]),p=S.useCallback(g=>{g.preventDefault()},[]),h=$3({commandName:e,active:t,enabled:r,attrs:n});let m=null;h.icon&&(m=ne(h.icon)?h.icon:h.icon.name);const b=l??h.label??"",v=u&&(c??h.description);return L.createElement(hX,{selected:t,disabled:!r,onMouseDown:p,...d,onClick:f},s!==null&&L.createElement(hte,{icon:s??m}),L.createElement($J,{primary:b,secondary:v}),a&&h.shortcut&&L.createElement(cu,{variant:"body2",color:"text.secondary",sx:{ml:2}},h.shortcut))},_f=({attrs:e,...t})=>{const{toggleHeading:r}=tr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=qr().heading(e),i=r.enabled(e);return L.createElement(Ib,{...t,commandName:"toggleHeading",active:o,enabled:i,attrs:e,onSelect:n})},mte={level:1},gte={level:2},VS={level:3},vte={level:4},yte={level:5},bte={level:6},xte=({showAll:e=!1,children:t})=>L.createElement(En,null,L.createElement(f1,{attrs:mte}),L.createElement(f1,{attrs:gte}),e?L.createElement(F3,{"aria-label":"More heading options"},L.createElement(_f,{attrs:VS}),L.createElement(_f,{attrs:vte}),L.createElement(_f,{attrs:yte}),L.createElement(_f,{attrs:bte})):L.createElement(f1,{attrs:VS}),t),kte=({children:e})=>L.createElement(En,null,L.createElement(fte,null),L.createElement(ste,null),e);typeof xr=="object"&&xr.__esModule&&xr.default&&xr.default;var V3=S.createContext({});function wte(e={}){const t=S.useContext(V3),r=S.useMemo(()=>X4(t,e.theme??{}),[t,e.theme]),n=S.useMemo(()=>CV(r).styles,[r]),o=ju(EV,e.className);return S.useMemo(()=>({style:n,className:o,theme:r}),[n,o,r])}var Ste=e=>{var t,r,n,o,i,s,a,l;const{children:c,as:u="div"}=e,{theme:d,style:f,className:p}=wte({theme:e.theme??Ss}),h=kb({palette:{primary:{main:((t=d.color)==null?void 0:t.primary)??Ss.color.primary,dark:((n=(r=d.color)==null?void 0:r.hover)==null?void 0:n.primary)??Ss.color.hover.primary,contrastText:((o=d.color)==null?void 0:o.primaryText)??Ss.color.primaryText},secondary:{main:((i=d.color)==null?void 0:i.secondary)??Ss.color.secondary,dark:((a=(s=d.color)==null?void 0:s.hover)==null?void 0:a.secondary)??Ss.color.hover.secondary,contrastText:((l=d.color)==null?void 0:l.secondaryText)??Ss.color.secondaryText}}});return L.createElement(nq,{theme:h},L.createElement(V3.Provider,{value:d},L.createElement(u,{style:f,className:p},c)))},j3=e=>L.createElement(mJ,{direction:"row",spacing:1,sx:{backgroundColor:"background.paper",overflowX:"auto"},...e}),Ete=[{name:"offset",options:{offset:[0,8]}}],Cte=({positioner:e="selection",children:t,...r})=>{const{ref:n,x:o,y:i,width:s,height:a,active:l}=Gee(()=>K0(e),[e]),[c,u]=S.useState(null),d=S.useMemo(()=>({position:"absolute",pointerEvents:"none",left:o,top:i,width:s,height:a}),[o,i,s,a]),f=S.useCallback(p=>{u(p),n==null||n(p)},[n]);return L.createElement(L.Fragment,null,L.createElement("div",{ref:f,style:d}),L.createElement(zb,{placement:"top",modifiers:Ete,...r,open:l,anchorEl:c},L.createElement(j3,null,t?L.createElement(L.Fragment,null,t):L.createElement(pte,null))))},Ct=Rh(dh),Db=xt` /** * Styles extracted from: packages/remirror__theme/src/components-theme.ts */ @@ -771,8 +771,8 @@ Error generating stack: `+i.message+` .remirror-color-picker-cell-selected { } `;Ct.div` - ${zb} -`;var Lb=xt` + ${Db} +`;var $b=xt` /** * Styles extracted from: packages/remirror__theme/src/core-theme.ts */ @@ -838,8 +838,8 @@ Error generating stack: `+i.message+` pointer-events: none; } `;Ct.div` - ${Lb} -`;var Ib=xt` + ${$b} +`;var Hb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-blockquote-theme.ts */ @@ -854,8 +854,8 @@ Error generating stack: `+i.message+` color: #888; } `;Ct.div` - ${Ib} -`;var Db=xt` + ${Hb} +`;var Bb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-callout-theme.ts */ @@ -891,8 +891,8 @@ Error generating stack: `+i.message+` background: #f8f8f8; } `;Ct.div` - ${Db} -`;var $b=xt` + ${Bb} +`;var Fb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-code-block-theme.ts */ @@ -3689,8 +3689,8 @@ Error generating stack: `+i.message+` bottom: 0.4em; } `;Ct.div` - ${$b} -`;var Hb=xt` + ${Fb} +`;var Vb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-count-theme.ts */ @@ -3698,8 +3698,8 @@ Error generating stack: `+i.message+` background-color: var(--rmr-hue-red-4); } `;Ct.div` - ${Hb} -`;var Bb=xt` + ${Vb} +`;var jb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-emoji-theme.ts */ @@ -3757,8 +3757,8 @@ Error generating stack: `+i.message+` padding-right: 5px; } `;Ct.div` - ${Bb} -`;var Fb=xt` + ${jb} +`;var Ub=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-file-theme.ts */ @@ -3810,8 +3810,8 @@ Error generating stack: `+i.message+` color: #000; } `;Ct.div` - ${Fb} -`;var Vb=xt` + ${Ub} +`;var Wb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-gap-cursor-theme.ts */ @@ -3839,8 +3839,8 @@ Error generating stack: `+i.message+` display: block; } `;Ct.div` - ${Vb} -`;var jb=xt` + ${Wb} +`;var Kb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-image-theme.ts */ @@ -3862,8 +3862,8 @@ Error generating stack: `+i.message+` } } `;Ct.div` - ${jb} -`;var Ub=xt` + ${Kb} +`;var qb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-list-theme.ts */ @@ -3958,8 +3958,8 @@ Error generating stack: `+i.message+` border-left-color: var(--rmr-color-primary); } `;Ct.div` - ${Ub} -`;var Wb=xt` + ${qb} +`;var Gb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-mention-atom-theme.ts */ @@ -4024,16 +4024,16 @@ Error generating stack: `+i.message+` padding-right: 5px; } `;Ct.div` - ${Wb} -`;var Kb=xt` + ${Gb} +`;var Yb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-node-formatting-theme.ts */ .remirror-editor.ProseMirror { } `;Ct.div` - ${Kb} -`;var qb=xt` + ${Yb} +`;var Jb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-placeholder-theme.ts */ @@ -4046,8 +4046,8 @@ Error generating stack: `+i.message+` content: attr(data-placeholder); } `;Ct.div` - ${qb} -`;var Gb=xt` + ${Jb} +`;var Xb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-positioner-theme.ts */ @@ -4074,8 +4074,8 @@ Error generating stack: `+i.message+` position: absolute; } `;Ct.div` - ${Gb} -`;var Yb=xt` + ${Xb} +`;var Qb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-tables-theme.ts */ @@ -4442,8 +4442,8 @@ Error generating stack: `+i.message+` background-color: var(--rmr-color-table-predelete-controller) !important; } `;Ct.div` - ${Yb} -`;var Jb=xt` + ${Qb} +`;var Zb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-whitespace-theme.ts */ @@ -4473,8 +4473,8 @@ Error generating stack: `+i.message+` content: '¶'; } `;Ct.div` - ${Jb} -`;var Xb=xt` + ${Zb} +`;var ex=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-yjs-theme.ts */ @@ -4518,8 +4518,8 @@ Error generating stack: `+i.message+` display: inline-block; } `;Ct.div` - ${Xb} -`;var Qb=xt` + ${ex} +`;var tx=xt` /** * Styles extracted from: packages/remirror__theme/src/theme.ts */ @@ -4821,11 +4821,8 @@ Error generating stack: `+i.message+` /* margin-bottom: var(--rmr-space-2); */ } `;Ct.div` - ${Qb} + ${tx} `;xt` - ${zb} - ${Lb} - ${Ib} ${Db} ${$b} ${Hb} @@ -4842,10 +4839,10 @@ Error generating stack: `+i.message+` ${Jb} ${Xb} ${Qb} -`;var kte=Ct.div` - ${zb} - ${Lb} - ${Ib} + ${Zb} + ${ex} + ${tx} +`;var Mte=Ct.div` ${Db} ${$b} ${Hb} @@ -4862,63 +4859,66 @@ Error generating stack: `+i.message+` ${Jb} ${Xb} ${Qb} -`,wte=Object.defineProperty,Ste=Object.getOwnPropertyDescriptor,H3=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ste(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&wte(t,r,o),o},Zb=class extends er{get name(){return"blockquote"}createTags(){return[oe.Block,oe.FormattingNode]}createNodeSpec(e,t){return{content:"block+",defining:!0,draggable:!1,...t,attrs:e.defaults(),parseDOM:[{tag:"blockquote",getAttrs:e.parse,priority:100},...t.parseDOM??[]],toDOM:r=>["blockquote",e.dom(r),0]}}toggleBlockquote(){return P5(this.type)}shortcut(e){return this.toggleBlockquote()(e)}createInputRules(){return[Nh(/^\s*>\s$/,this.type)]}createPasteRules(){return{type:"node",nodeType:this.type,regexp:/^\s*>\s$/,startOfTextBlock:!0}}};H3([U({icon:"doubleQuotesL",description:({t:e})=>e(fk.DESCRIPTION),label:({t:e})=>e(fk.LABEL)})],Zb.prototype,"toggleBlockquote",1);H3([je({shortcut:"Ctrl->",command:"toggleBlockquote"})],Zb.prototype,"shortcut",1);var Ete=Object.defineProperty,Cte=Object.getOwnPropertyDescriptor,Gd=(e,t,r,n)=>{for(var o=n>1?void 0:n?Cte(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ete(t,r,o),o},Mte={icon:"bold",label:({t:e})=>e(pk.LABEL),description:({t:e})=>e(pk.DESCRIPTION)},ba=class extends li{get name(){return"bold"}createTags(){return[oe.FormattingMark,oe.FontStyle]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"strong",getAttrs:e.parse},{tag:"b",getAttrs:r=>Je(r)&&r.style.fontWeight!=="normal"?e.parse(r):!1},{style:"font-weight",getAttrs:r=>ne(r)&&/^(bold(er)?|[5-9]\d{2,})$/.test(r)?null:!1},...t.parseDOM??[]],toDOM:r=>{const{weight:n}=this.options;return n?["strong",{"font-weight":n.toString()},0]:["strong",e.dom(r),0]}}}createInputRules(){return[Fu({regexp:/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,type:this.type,ignoreWhitespace:!0})]}toggleBold(e){return ns({type:this.type,selection:e})}setBold(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=jr(e??t.selection,t.doc);return r==null||r(t.addMark(n,o,this.type.create())),!0}}removeBold(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=jr(e??t.selection,t.doc);return t.doc.rangeHasMark(n,o,this.type)?(r==null||r(t.removeMark(n,o,this.type)),!0):!1}}shortcut(e){return this.toggleBold()(e)}};Gd([U(Mte)],ba.prototype,"toggleBold",1);Gd([U()],ba.prototype,"setBold",1);Gd([U()],ba.prototype,"removeBold",1);Gd([je({shortcut:D.Bold,command:"toggleBold"})],ba.prototype,"shortcut",1);ba=Gd([me({defaultOptions:{weight:void 0},staticKeys:["weight"]})],ba);var Tte=Object.defineProperty,Ote=Object.getOwnPropertyDescriptor,ex=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ote(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Tte(t,r,o),o},{DESCRIPTION:_te,LABEL:Ate}=ZN,Nte={icon:"codeLine",description:({t:e})=>e(_te),label:({t:e})=>e(Ate)},xd=class extends li{get name(){return"code"}createTags(){return[oe.Code,oe.ExcludeInputRules]}createMarkSpec(e,t){return{excludes:"_",...t,attrs:e.defaults(),parseDOM:[{tag:"code",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["code",{spellcheck:"false",...e.dom(r)},0]}}createKeymap(){return{"Mod-`":ns({type:this.type})}}keyboardShortcut(e){return this.toggleCode()(e)}toggleCode(){return ns({type:this.type})}createInputRules(){return[Fu({regexp:new RegExp(`(?:\`)([^\`${yv}]+)(?:\`)$`),type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{type:"mark",regexp:/`([^`]+)`/g,markType:this.type}]}};ex([je({shortcut:D.Code,command:"toggleCode"})],xd.prototype,"keyboardShortcut",1);ex([U(Nte)],xd.prototype,"toggleCode",1);xd=ex([me({})],xd);var Rte=zte,Pte=Object.prototype.hasOwnProperty;function zte(){for(var e={},t=0;t4&&r.slice(0,4)===ix&&kre.test(t)&&(t.charAt(4)==="-"?n=Ere(t):t=Cre(t),o=yre),new o(n,t))}function Ere(e){var t=e.slice(5).replace(G3,Tre);return ix+t.charAt(0).toUpperCase()+t.slice(1)}function Cre(e){var t=e.slice(4);return G3.test(t)?e:(t=t.replace(wre,Mre),t.charAt(0)!=="-"&&(t="-"+t),ix+t)}function Mre(e){return"-"+e.toLowerCase()}function Tre(e){return e.charAt(1).toUpperCase()}var Ore=_re,US=/[#.]/g;function _re(e,t){for(var r=e||"",n=t||"div",o={},i=0,s,a,l;i=48&&t<=57}var Xoe=Qoe;function Qoe(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}var Zoe=eie;function eie(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}var tie=Zoe,rie=X3,nie=oie;function oie(e){return tie(e)||rie(e)}var _f,iie=59,sie=aie;function aie(e){var t="&"+e+";",r;return _f=_f||document.createElement("i"),_f.innerHTML=t,r=_f.textContent,r.charCodeAt(r.length-1)===iie&&e!=="semi"||r===t?!1:r}var XS=Goe,QS=Yoe,lie=X3,cie=Xoe,Q3=nie,uie=sie,die=Eie,fie={}.hasOwnProperty,Ba=String.fromCharCode,pie=Function.prototype,ZS={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},hie=9,e4=10,mie=12,gie=32,t4=38,vie=59,yie=60,bie=61,xie=35,kie=88,wie=120,Sie=65533,Ja="named",lx="hexadecimal",cx="decimal",ux={};ux[lx]=16;ux[cx]=10;var qm={};qm[Ja]=Q3;qm[cx]=lie;qm[lx]=cie;var Z3=1,eO=2,tO=3,rO=4,nO=5,uv=6,oO=7,ws={};ws[Z3]="Named character references must be terminated by a semicolon";ws[eO]="Numeric character references must be terminated by a semicolon";ws[tO]="Named character references cannot be empty";ws[rO]="Numeric character references cannot be empty";ws[nO]="Named character references must be known";ws[uv]="Numeric character references cannot be disallowed";ws[oO]="Numeric character references cannot be outside the permissible Unicode range";function Eie(e,t){var r={},n,o;t||(t={});for(o in ZS)n=t[o],r[o]=n??ZS[o];return(r.position.indent||r.position.start)&&(r.indent=r.position.indent||[],r.position=r.position.start),Cie(e,r)}function Cie(e,t){var r=t.additional,n=t.nonTerminated,o=t.text,i=t.reference,s=t.warning,a=t.textContext,l=t.referenceContext,c=t.warningContext,u=t.position,d=t.indent||[],f=e.length,p=0,h=-1,m=u.column||1,b=u.line||1,v="",g=[],y,x,k,w,E,M,C,T,N,F,I,V,j,z,q,A,P,B,Y;for(typeof r=="string"&&(r=r.charCodeAt(0)),A=J(),T=s?Ne:pie,p--,f++;++p65535&&(M-=65536,F+=Ba(M>>>10|55296),M=56320|M&1023),M=F+Ba(M))):z!==Ja&&T(rO,B)),M?(ie(),A=J(),p=Y-1,m+=Y-j+1,g.push(M),P=J(),P.offset++,i&&i.call(l,M,{start:A,end:P},e.slice(j-1,Y)),A=P):(w=e.slice(j-1,Y),v+=w,m+=w.length,p=Y-1)}else E===10&&(b++,h++,m=0),E===E?(v+=Ba(E),m++):ie();return g.join("");function J(){return{line:b,column:m,offset:p+(u.offset||0)}}function Ne(ue,de){var he=J();he.column+=de,he.offset+=de,s.call(c,ws[ue],he,ue)}function ie(){v&&(g.push(v),o&&o.call(a,v,{start:A,end:J()}),v="")}}function Mie(e){return e>=55296&&e<=57343||e>1114111}function Tie(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var iO={exports:{}};(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** + ${Zb} + ${ex} + ${tx} +`,Tte=Object.defineProperty,Ote=Object.getOwnPropertyDescriptor,U3=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ote(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Tte(t,r,o),o},rx=class extends er{get name(){return"blockquote"}createTags(){return[oe.Block,oe.FormattingNode]}createNodeSpec(e,t){return{content:"block+",defining:!0,draggable:!1,...t,attrs:e.defaults(),parseDOM:[{tag:"blockquote",getAttrs:e.parse,priority:100},...t.parseDOM??[]],toDOM:r=>["blockquote",e.dom(r),0]}}toggleBlockquote(){return DC(this.type)}shortcut(e){return this.toggleBlockquote()(e)}createInputRules(){return[zh(/^\s*>\s$/,this.type)]}createPasteRules(){return{type:"node",nodeType:this.type,regexp:/^\s*>\s$/,startOfTextBlock:!0}}};U3([U({icon:"doubleQuotesL",description:({t:e})=>e(mk.DESCRIPTION),label:({t:e})=>e(mk.LABEL)})],rx.prototype,"toggleBlockquote",1);U3([je({shortcut:"Ctrl->",command:"toggleBlockquote"})],rx.prototype,"shortcut",1);var _te=Object.defineProperty,Ate=Object.getOwnPropertyDescriptor,Jd=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ate(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&_te(t,r,o),o},Nte={icon:"bold",label:({t:e})=>e(gk.LABEL),description:({t:e})=>e(gk.DESCRIPTION)},ba=class extends li{get name(){return"bold"}createTags(){return[oe.FormattingMark,oe.FontStyle]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"strong",getAttrs:e.parse},{tag:"b",getAttrs:r=>Je(r)&&r.style.fontWeight!=="normal"?e.parse(r):!1},{style:"font-weight",getAttrs:r=>ne(r)&&/^(bold(er)?|[5-9]\d{2,})$/.test(r)?null:!1},...t.parseDOM??[]],toDOM:r=>{const{weight:n}=this.options;return n?["strong",{"font-weight":n.toString()},0]:["strong",e.dom(r),0]}}}createInputRules(){return[Vu({regexp:/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,type:this.type,ignoreWhitespace:!0})]}toggleBold(e){return ns({type:this.type,selection:e})}setBold(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=jr(e??t.selection,t.doc);return r==null||r(t.addMark(n,o,this.type.create())),!0}}removeBold(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=jr(e??t.selection,t.doc);return t.doc.rangeHasMark(n,o,this.type)?(r==null||r(t.removeMark(n,o,this.type)),!0):!1}}shortcut(e){return this.toggleBold()(e)}};Jd([U(Nte)],ba.prototype,"toggleBold",1);Jd([U()],ba.prototype,"setBold",1);Jd([U()],ba.prototype,"removeBold",1);Jd([je({shortcut:D.Bold,command:"toggleBold"})],ba.prototype,"shortcut",1);ba=Jd([pe({defaultOptions:{weight:void 0},staticKeys:["weight"]})],ba);var Rte=Object.defineProperty,Pte=Object.getOwnPropertyDescriptor,nx=(e,t,r,n)=>{for(var o=n>1?void 0:n?Pte(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Rte(t,r,o),o},{DESCRIPTION:zte,LABEL:Lte}=sR,Ite={icon:"codeLine",description:({t:e})=>e(zte),label:({t:e})=>e(Lte)},kd=class extends li{get name(){return"code"}createTags(){return[oe.Code,oe.ExcludeInputRules]}createMarkSpec(e,t){return{excludes:"_",...t,attrs:e.defaults(),parseDOM:[{tag:"code",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["code",{spellcheck:"false",...e.dom(r)},0]}}createKeymap(){return{"Mod-`":ns({type:this.type})}}keyboardShortcut(e){return this.toggleCode()(e)}toggleCode(){return ns({type:this.type})}createInputRules(){return[Vu({regexp:new RegExp(`(?:\`)([^\`${kv}]+)(?:\`)$`),type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{type:"mark",regexp:/`([^`]+)`/g,markType:this.type}]}};nx([je({shortcut:D.Code,command:"toggleCode"})],kd.prototype,"keyboardShortcut",1);nx([U(Ite)],kd.prototype,"toggleCode",1);kd=nx([pe({})],kd);var Dte=Hte,$te=Object.prototype.hasOwnProperty;function Hte(){for(var e={},t=0;t4&&r.slice(0,4)===lx&&Mre.test(t)&&(t.charAt(4)==="-"?n=_re(t):t=Are(t),o=Sre),new o(n,t))}function _re(e){var t=e.slice(5).replace(Z3,Rre);return lx+t.charAt(0).toUpperCase()+t.slice(1)}function Are(e){var t=e.slice(4);return Z3.test(t)?e:(t=t.replace(Tre,Nre),t.charAt(0)!=="-"&&(t="-"+t),lx+t)}function Nre(e){return"-"+e.toLowerCase()}function Rre(e){return e.charAt(1).toUpperCase()}var Pre=zre,qS=/[#.]/g;function zre(e,t){for(var r=e||"",n=t||"div",o={},i=0,s,a,l;i=48&&t<=57}var rie=nie;function nie(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}var oie=iie;function iie(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}var sie=oie,aie=rO,lie=cie;function cie(e){return sie(e)||aie(e)}var Nf,uie=59,die=fie;function fie(e){var t="&"+e+";",r;return Nf=Nf||document.createElement("i"),Nf.innerHTML=t,r=Nf.textContent,r.charCodeAt(r.length-1)===uie&&e!=="semi"||r===t?!1:r}var e4=Zoe,t4=eie,pie=rO,hie=rie,nO=lie,mie=die,gie=_ie,vie={}.hasOwnProperty,Ba=String.fromCharCode,yie=Function.prototype,r4={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},bie=9,n4=10,xie=12,kie=32,o4=38,wie=59,Sie=60,Eie=61,Cie=35,Mie=88,Tie=120,Oie=65533,Ja="named",dx="hexadecimal",fx="decimal",px={};px[dx]=16;px[fx]=10;var Jm={};Jm[Ja]=nO;Jm[fx]=pie;Jm[dx]=hie;var oO=1,iO=2,sO=3,aO=4,lO=5,pv=6,cO=7,ws={};ws[oO]="Named character references must be terminated by a semicolon";ws[iO]="Numeric character references must be terminated by a semicolon";ws[sO]="Named character references cannot be empty";ws[aO]="Numeric character references cannot be empty";ws[lO]="Named character references must be known";ws[pv]="Numeric character references cannot be disallowed";ws[cO]="Numeric character references cannot be outside the permissible Unicode range";function _ie(e,t){var r={},n,o;t||(t={});for(o in r4)n=t[o],r[o]=n??r4[o];return(r.position.indent||r.position.start)&&(r.indent=r.position.indent||[],r.position=r.position.start),Aie(e,r)}function Aie(e,t){var r=t.additional,n=t.nonTerminated,o=t.text,i=t.reference,s=t.warning,a=t.textContext,l=t.referenceContext,c=t.warningContext,u=t.position,d=t.indent||[],f=e.length,p=0,h=-1,m=u.column||1,b=u.line||1,v="",g=[],y,x,k,w,E,T,C,M,N,F,I,V,j,z,q,A,P,B,Y;for(typeof r=="string"&&(r=r.charCodeAt(0)),A=J(),M=s?Ne:yie,p--,f++;++p65535&&(T-=65536,F+=Ba(T>>>10|55296),T=56320|T&1023),T=F+Ba(T))):z!==Ja&&M(aO,B)),T?(ie(),A=J(),p=Y-1,m+=Y-j+1,g.push(T),P=J(),P.offset++,i&&i.call(l,T,{start:A,end:P},e.slice(j-1,Y)),A=P):(w=e.slice(j-1,Y),v+=w,m+=w.length,p=Y-1)}else E===10&&(b++,h++,m=0),E===E?(v+=Ba(E),m++):ie();return g.join("");function J(){return{line:b,column:m,offset:p+(u.offset||0)}}function Ne(ue,de){var me=J();me.column+=de,me.offset+=de,s.call(c,ws[ue],me,ue)}function ie(){v&&(g.push(v),o&&o.call(a,v,{start:A,end:J()}),v="")}}function Nie(e){return e>=55296&&e<=57343||e>1114111}function Rie(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var uO={exports:{}};(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** * Prism: Lightweight, robust, elegant syntax highlighting * * @license MIT * @author Lea Verou * @namespace * @public - */var r=function(n){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,s={},a={manual:n.Prism&&n.Prism.manual,disableWorkerMessageHandler:n.Prism&&n.Prism.disableWorkerMessageHandler,util:{encode:function g(y){return y instanceof l?new l(y.type,g(y.content),y.alias):Array.isArray(y)?y.map(g):y.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(k){var g=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(k.stack)||[])[1];if(g){var y=document.getElementsByTagName("script");for(var x in y)if(y[x].src==g)return y[x]}return null}},isActive:function(g,y,x){for(var k="no-"+y;g;){var w=g.classList;if(w.contains(y))return!0;if(w.contains(k))return!1;g=g.parentElement}return!!x}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(g,y){var x=a.util.clone(a.languages[g]);for(var k in y)x[k]=y[k];return x},insertBefore:function(g,y,x,k){k=k||a.languages;var w=k[g],E={};for(var M in w)if(w.hasOwnProperty(M)){if(M==y)for(var C in x)x.hasOwnProperty(C)&&(E[C]=x[C]);x.hasOwnProperty(M)||(E[M]=w[M])}var T=k[g];return k[g]=E,a.languages.DFS(a.languages,function(N,F){F===T&&N!=g&&(this[N]=E)}),E},DFS:function g(y,x,k,w){w=w||{};var E=a.util.objId;for(var M in y)if(y.hasOwnProperty(M)){x.call(y,M,y[M],k||M);var C=y[M],T=a.util.type(C);T==="Object"&&!w[E(C)]?(w[E(C)]=!0,g(C,x,null,w)):T==="Array"&&!w[E(C)]&&(w[E(C)]=!0,g(C,x,M,w))}}},plugins:{},highlightAll:function(g,y){a.highlightAllUnder(document,g,y)},highlightAllUnder:function(g,y,x){var k={callback:x,container:g,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",k),k.elements=Array.prototype.slice.apply(k.container.querySelectorAll(k.selector)),a.hooks.run("before-all-elements-highlight",k);for(var w=0,E;E=k.elements[w++];)a.highlightElement(E,y===!0,k.callback)},highlightElement:function(g,y,x){var k=a.util.getLanguage(g),w=a.languages[k];a.util.setLanguage(g,k);var E=g.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(E,k);var M=g.textContent,C={element:g,language:k,grammar:w,code:M};function T(F){C.highlightedCode=F,a.hooks.run("before-insert",C),C.element.innerHTML=C.highlightedCode,a.hooks.run("after-highlight",C),a.hooks.run("complete",C),x&&x.call(C.element)}if(a.hooks.run("before-sanity-check",C),E=C.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!C.code){a.hooks.run("complete",C),x&&x.call(C.element);return}if(a.hooks.run("before-highlight",C),!C.grammar){T(a.util.encode(C.code));return}if(y&&n.Worker){var N=new Worker(a.filename);N.onmessage=function(F){T(F.data)},N.postMessage(JSON.stringify({language:C.language,code:C.code,immediateClose:!0}))}else T(a.highlight(C.code,C.grammar,C.language))},highlight:function(g,y,x){var k={code:g,grammar:y,language:x};if(a.hooks.run("before-tokenize",k),!k.grammar)throw new Error('The language "'+k.language+'" has no grammar.');return k.tokens=a.tokenize(k.code,k.grammar),a.hooks.run("after-tokenize",k),l.stringify(a.util.encode(k.tokens),k.language)},tokenize:function(g,y){var x=y.rest;if(x){for(var k in x)y[k]=x[k];delete y.rest}var w=new d;return f(w,w.head,g),u(g,w,y,w.head,0),h(w)},hooks:{all:{},add:function(g,y){var x=a.hooks.all;x[g]=x[g]||[],x[g].push(y)},run:function(g,y){var x=a.hooks.all[g];if(!(!x||!x.length))for(var k=0,w;w=x[k++];)w(y)}},Token:l};n.Prism=a;function l(g,y,x,k){this.type=g,this.content=y,this.alias=x,this.length=(k||"").length|0}l.stringify=function g(y,x){if(typeof y=="string")return y;if(Array.isArray(y)){var k="";return y.forEach(function(T){k+=g(T,x)}),k}var w={type:y.type,content:g(y.content,x),tag:"span",classes:["token",y.type],attributes:{},language:x},E=y.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(w.classes,E):w.classes.push(E)),a.hooks.run("wrap",w);var M="";for(var C in w.attributes)M+=" "+C+'="'+(w.attributes[C]||"").replace(/"/g,""")+'"';return"<"+w.tag+' class="'+w.classes.join(" ")+'"'+M+">"+w.content+""};function c(g,y,x,k){g.lastIndex=y;var w=g.exec(x);if(w&&k&&w[1]){var E=w[1].length;w.index+=E,w[0]=w[0].slice(E)}return w}function u(g,y,x,k,w,E){for(var M in x)if(!(!x.hasOwnProperty(M)||!x[M])){var C=x[M];C=Array.isArray(C)?C:[C];for(var T=0;T=E.reach);P+=A.value.length,A=A.next){var B=A.value;if(y.length>g.length)return;if(!(B instanceof l)){var Y=1,J;if(V){if(J=c(q,P,g,I),!J||J.index>=g.length)break;var de=J.index,Ne=J.index+J[0].length,ie=P;for(ie+=A.value.length;de>=ie;)A=A.next,ie+=A.value.length;if(ie-=A.value.length,P=ie,A.value instanceof l)continue;for(var ue=A;ue!==y.tail&&(ieE.reach&&(E.reach=ft);var rt=A.prev;Me&&(rt=f(y,rt,Me),P+=Me.length),p(y,rt,Y);var Or=new l(M,F?a.tokenize(he,F):he,j,he);if(A=f(y,rt,Or),Se&&f(y,A,Se),Y>1){var pe={cause:M+","+T,reach:ft};u(g,y,x,A.prev,P,pe),E&&pe.reach>E.reach&&(E.reach=pe.reach)}}}}}}function d(){var g={value:null,prev:null,next:null},y={value:null,prev:g,next:null};g.next=y,this.head=g,this.tail=y,this.length=0}function f(g,y,x){var k=y.next,w={value:x,prev:y,next:k};return y.next=w,k.prev=w,g.length++,w}function p(g,y,x){for(var k=y.next,w=0;w/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(r,n){var o={};o["language-"+n]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[n]},o.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:o}};i["language-"+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var s={};s[r]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return r}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",s)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,r){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[r,"language-"+r],inside:e.languages[r]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}var Aie=fx;fx.displayName="css";fx.aliases=[];function fx(e){(function(t){var r=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+r.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+r.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+r.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:r,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(e)}var Nie=px;px.displayName="clike";px.aliases=[];function px(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}var Rie=hx;hx.displayName="javascript";hx.aliases=["js"];function hx(e){e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}var du=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof Ru=="object"?Ru:{},Pie=Yie();du.Prism={manual:!0,disableWorkerMessageHandler:!0};var zie=Yre,Lie=die,sO=Oie,Iie=_ie,Die=Aie,$ie=Nie,Hie=Rie;Pie();var mx={}.hasOwnProperty;function aO(){}aO.prototype=sO;var Et=new aO,Bie=Et;Et.highlight=Vie;Et.register=Jd;Et.alias=Fie;Et.registered=jie;Et.listLanguages=Uie;Jd(Iie);Jd(Die);Jd($ie);Jd(Hie);Et.util.encode=qie;Et.Token.stringify=Wie;function Jd(e){if(typeof e!="function"||!e.displayName)throw new Error("Expected `function` for `grammar`, got `"+e+"`");Et.languages[e.displayName]===void 0&&e(Et)}function Fie(e,t){var r=Et.languages,n=e,o,i,s,a;t&&(n={},n[e]=t);for(o in n)for(i=n[o],i=typeof i=="string"?[i]:i,s=i.length,a=-1;++a{for(var o=n>1?void 0:n?Xie(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Jie(t,r,o),o},lO=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},xi=(e,t,r)=>(lO(e,t,"read from private field"),r?r.call(e):t.get(e)),u1=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},d1=(e,t,r,n)=>(lO(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),cO="data-code-block-language";function uO(e,t,r=[]){return e.map(n=>{const o=[...r];return n.type==="element"&&n.properties.className?o.push(...n.properties.className):n.type==="text"&&o.length===0&&t&&o.push(t),n.type==="element"?uO(n.children,t,o):{text:n.value,classes:o}})}function Qie(e,t){var r;const{node:n,pos:o}=e,i=yh({language:(r=n.attrs.language)==null?void 0:r.replace("language-",""),fallback:"markup"}),s=gx.highlight(n.textContent??"",i),a=uO(s,t);let l=o+1;function c(u){const d=l,f=d+u.text.length;return l=f,{...u,from:d,to:f}}return W4(a).map(c)}function r4(e){const{blocks:t,skipLast:r,plainTextClassName:n}=e,o=[];for(const i of t){const s=Qie(i,n),a=r?s.length-1:s.length;for(const l of kv(a)){const c=s[l],u=c==null?void 0:c.classes;if(!c||!(u!=null&&u.length))continue;const d=Ge.inline(c.from,c.to,{class:u.join(" ")});o.push(d)}}return o}function Zie(e){return!!(e&&Zt(e)&&ne(e.language)&&e.language.length>0)}function ese(e){return t=>({state:{tr:r,selection:n},dispatch:o})=>{if(!Zie(t))throw new Error("Invalid attrs passed to the updateAttributes method");const i=ts({types:e,selection:n});return!i||U4(t,i.node.attrs)?!1:(r.setNodeMarkup(i.pos,e,{...i.node.attrs,...t}),o&&o(r),!0)}}function yh(e){const{language:t,fallback:r}=e;if(!t)return r;const n=gx.listLanguages();for(const o of n)if(o.toLowerCase()===t.toLowerCase())return o;return r}function tse(e,t){const{language:r,wrap:n}=Dd(e.attrs,t),{style:o,...i}=t.dom(e);let s=i.style;return n&&(s=Uv({whiteSpace:"pre-wrap",wordBreak:"break-all"},s)),["pre",{spellcheck:"false",...i,class:Vu(i.class,`language-${r}`)},["code",{[cO]:r,style:s},0]]}function rse(e){return({pos:t}=ee())=>({tr:r,dispatch:n})=>{const{type:o,formatter:i,defaultLanguage:s}=e,{from:a,to:l}=t?{from:t,to:t}:r.selection,c=ts({types:o,selection:r.selection});if(!c)return!1;const{node:{attrs:u,textContent:d},start:f}=c,p=a-f,h=l-f,m=yh({language:u.language,fallback:s}),b=i({source:d,language:m,cursorOffset:p});let v;if(p!==h&&(v=i({source:d,language:m,cursorOffset:h})),!b)return!1;const{cursorOffset:g,formatted:y}=b;if(y===d)return!1;const x=f+d.length;r.insertText(y,f,x);const k=f+g,w=v?f+v.cursorOffset:void 0;return r.setSelection(le.between(r.doc.resolve(k),r.doc.resolve(w??k))),n&&n(r),!0}}function nse(e){var t;return(t=e.getAttribute(cO)??e.classList[0])==null?void 0:t.replace("language-","")}var{DESCRIPTION:ose,LABEL:ise}=JN,sse={icon:"bracesLine",description:({t:e})=>e(ose),label:({t:e})=>e(ise)},Ps,fu,pu,ase=class{constructor(e,t){u1(this,Ps,void 0),u1(this,fu,void 0),u1(this,pu,!1),d1(this,fu,e),d1(this,Ps,t)}init(e){const t=Lz({node:e.doc,type:xi(this,fu)});return this.refreshDecorationSet(e.doc,t),this}refreshDecorationSet(e,t){const r=r4({blocks:t,skipLast:xi(this,pu),defaultLanguage:xi(this,Ps).options.defaultLanguage,plainTextClassName:xi(this,Ps).options.plainTextClassName??void 0});this.decorationSet=Ee.create(e,r)}apply(e,t){if(!e.docChanged)return this;this.decorationSet=this.decorationSet.map(e.mapping,e.doc);const r=Iz(e,{descend:!0,predicate:n=>n.type===xi(this,fu),StepTypes:[]});return this.updateDecorationSet(e,r),this}updateDecorationSet(e,t){if(t.length===0)return;let r=this.decorationSet;for(const{node:n,pos:o}of t)r=this.decorationSet.remove(this.decorationSet.find(o,o+n.nodeSize));this.decorationSet=r.add(e.doc,r4({blocks:t,skipLast:xi(this,pu),defaultLanguage:xi(this,Ps).options.defaultLanguage,plainTextClassName:xi(this,Ps).options.plainTextClassName??void 0}))}setDeleted(e){d1(this,pu,e)}};Ps=new WeakMap;fu=new WeakMap;pu=new WeakMap;var lo=class extends er{get name(){return"codeBlock"}createTags(){return[oe.Block,oe.Code]}init(){this.registerLanguages()}createNodeSpec(e,t){const r=/highlight-(?:text|source)-([\da-z]+)/;return{content:"text*",marks:"",defining:!0,draggable:!1,...t,code:!0,attrs:{...e.defaults(),language:{default:this.options.defaultLanguage},wrap:{default:this.options.defaultWrap}},parseDOM:[{tag:"div.highlight",preserveWhitespace:"full",getAttrs:n=>{var o,i;if(!Je(n))return!1;const s=n.querySelector("pre.code");if(!Je(s))return!1;const a=xn(s,"white-space")==="pre-wrap",l=(i=(o=n.className.match(r))==null?void 0:o[1])==null?void 0:i.replace("language-","");return{...e.parse(n),language:l,wrap:a}}},{tag:"pre",preserveWhitespace:"full",getAttrs:n=>{if(!Je(n))return!1;const o=n.querySelector("code");if(!Je(o))return!1;const i=xn(o,"white-space")==="pre-wrap",s=this.options.getLanguageFromDom(o,n);return{...e.parse(n),language:s,wrap:i}}},...t.parseDOM??[]],toDOM:n=>tse(n,e)}}createAttributes(){return{class:eV[this.options.syntaxTheme.toUpperCase()]}}createInputRules(){const e=/^```([\dA-Za-z]*) $/,t=r=>({language:yh({language:Zo(r,1),fallback:this.options.defaultLanguage})});return[I5({regexp:e,type:this.type,beforeDispatch:({tr:r,start:n})=>{const o=r.doc.resolve(n);r.setSelection(le.near(o))},getAttributes:t})]}onSetOptions(e){const{changes:t}=e;t.supportedLanguages.changed&&this.registerLanguages(),t.syntaxTheme.changed&&this.store.updateAttributes()}createPlugin(){const e=new ase(this.type,this),t=()=>(e.setDeleted(!0),!1);return{state:{init(r,n){return e.init(n)},apply(r,n,o,i){return e.apply(r,i)}},props:{handleKeyDown:qv({Backspace:t,"Mod-Backspace":t,Delete:t,"Mod-Delete":t,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t}),decorations(){return e.setDeleted(!1),e.decorationSet}}}}toggleCodeBlock(e={}){return Wv({type:this.type,toggleType:this.options.toggleName,attrs:{language:this.options.defaultLanguage,...e}})}createCodeBlock(e){return Bu(this.type,e)}updateCodeBlock(e){return ese(this.type)(e)}formatCodeBlock(e){return rse({type:this.type,formatter:this.options.formatter,defaultLanguage:this.options.defaultLanguage})(e)}tabKey({state:e,dispatch:t}){const{selection:r,tr:n,schema:o}=e,{node:i}=J6(r);if(!Lh({node:i,types:this.type}))return!1;if(r.empty)n.insertText(" ");else{const{from:s,to:a}=r;n.replaceWith(s,a,o.text(" "))}return t&&t(n),!0}backspaceKey({dispatch:e,tr:t,state:r}){if(!t.selection.empty)return!1;const n=ts({types:this.type,selection:t.selection});if((n==null?void 0:n.start)!==t.selection.from)return!1;const{pos:o,node:i,start:s}=n,a=it(r.schema.nodes,this.options.toggleName);return i.textContent.trim()===""?t.doc.lastChild===i&&t.doc.firstChild===i?G6({pos:o,tr:t,content:a.create()}):q6({pos:o,tr:t}):s>2?t.setSelection(le.near(t.doc.resolve(s-2))):(t.insert(0,a.create()),t.setSelection(le.near(t.doc.resolve(1)))),e&&e(t),!0}enterKey({dispatch:e,tr:t}){if(!(gs(t.selection)&&t.selection.empty))return!1;const{nodeBefore:r,parent:n}=t.selection.$anchor;if(!(r!=null&&r.isText)||!n.type.isTextblock)return!1;const o=/^```([A-Za-z]*)?$/,{text:i,nodeSize:s}=r,{textContent:a}=n;if(!i)return!1;const l=i.match(o),c=a.match(o);if(!l||!c)return!1;const[,u]=l,d=yh({language:u,fallback:this.options.defaultLanguage}),f=t.selection.$from.before(),p=f+s+1;return t.replaceWith(f,p,this.type.create({language:d})),t.setSelection(le.near(t.doc.resolve(f+1))),e&&e(t),!0}formatShortcut({tr:e}){const t=this.store.commands;if(!b5({type:this.type,state:e}))return!1;const r=t.formatCodeBlock.isEnabled();return r&&t.formatCodeBlock(),r}registerLanguages(){for(const e of this.options.supportedLanguages)gx.register(e)}};pi([U(sse)],lo.prototype,"toggleCodeBlock",1);pi([U()],lo.prototype,"createCodeBlock",1);pi([U()],lo.prototype,"updateCodeBlock",1);pi([U()],lo.prototype,"formatCodeBlock",1);pi([je({shortcut:"Tab"})],lo.prototype,"tabKey",1);pi([je({shortcut:"Backspace"})],lo.prototype,"backspaceKey",1);pi([je({shortcut:"Enter"})],lo.prototype,"enterKey",1);pi([je({shortcut:D.Format})],lo.prototype,"formatShortcut",1);lo=pi([me({defaultOptions:{supportedLanguages:[],toggleName:"paragraph",formatter:({source:e})=>({cursorOffset:0,formatted:e}),syntaxTheme:"a11y_dark",defaultLanguage:"markup",defaultWrap:!1,plainTextClassName:"",getLanguageFromDom:nse},staticKeys:["getLanguageFromDom"]})],lo);var dO=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},ze=(e,t,r)=>(dO(e,t,"read from private field"),r?r.call(e):t.get(e)),Xa=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Mi=(e,t,r,n)=>(dO(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),lse='',cse='',use=encodeURIComponent(lse),dse=encodeURIComponent(cse),Ar,fse=class{constructor(e){Xa(this,Ar,void 0);const t=document.createElement("div"),r=document.createElement("div");this.dom=t,Mi(this,Ar,r),this.type=e,this.createHandle(e)}createHandle(e){switch(sr(this.dom,{position:"absolute",pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"100"}),sr(ze(this,Ar),{opacity:"0",transition:"opacity 300ms ease-in 0s"}),ze(this,Ar).dataset.dragging="",e){case 0:sr(this.dom,{right:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),sr(ze(this,Ar),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 1:sr(this.dom,{left:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),sr(ze(this,Ar),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 2:sr(this.dom,{bottom:"0px",width:"100%",height:"14px",cursor:"row-resize"}),sr(ze(this,Ar),{width:" 42px",height:"4px",boxSizing:"content-box",maxWidth:"50%",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 3:sr(this.dom,{right:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nwse-resize",zIndex:"101"}),sr(ze(this,Ar),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${dse}") `});break;case 4:sr(this.dom,{left:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nesw-resize",zIndex:"101"}),sr(ze(this,Ar),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${use}") `});break}this.dom.append(ze(this,Ar))}setHandleVisibility(e){const t=e||!!ze(this,Ar).dataset.dragging;ze(this,Ar).style.opacity=t?"1":"0"}dataSetDragging(e){ze(this,Ar).dataset.dragging=e?"true":""}};Ar=new WeakMap;var Af=50,fO=(e=>(e[e.Fixed=0]="Fixed",e[e.Flexible=1]="Flexible",e))(fO||{}),zs,Ls,Is,Bo,Ds,pse=class{constructor({node:e,view:t,getPos:r,aspectRatio:n=0,options:o,initialSize:i}){Xa(this,zs,void 0),Xa(this,Ls,void 0),Xa(this,Is,[]),Xa(this,Bo,void 0),Xa(this,Ds,void 0);const s=this.createWrapper(e,i),a=this.createElement({node:e,view:t,getPos:r,options:o}),c=(n===1?[0,1,2,3,4]:[0,1]).map(f=>new fse(f));for(const f of c){const p=h=>{this.startResizing(h,t,r,f)};f.dom.addEventListener("mousedown",p),ze(this,Is).push(()=>f.dom.removeEventListener("mousedown",p)),s.append(f.dom)}const u=()=>{c.forEach(f=>f.setHandleVisibility(!0))},d=()=>{c.forEach(f=>f.setHandleVisibility(!1))};s.addEventListener("mouseover",u),s.addEventListener("mouseout",d),ze(this,Is).push(()=>s.removeEventListener("mouseover",u),()=>s.removeEventListener("mouseout",d)),s.append(a),this.dom=s,Mi(this,Ls,e),Mi(this,zs,a),this.aspectRatio=n}createWrapper(e,t){const r=document.createElement("div");return r.classList.add("remirror-resizable-view"),r.style.position="relative",t?sr(r,{width:n4(t.width),aspectRatio:`${t.width} / ${t.height}`}):sr(r,{width:n4(e.attrs.width),aspectRatio:`${e.attrs.width} / ${e.attrs.height}`}),sr(r,{maxWidth:"100%",minWidth:`${Af}px`,verticalAlign:"bottom",display:"inline-block",lineHeight:"0",transition:"width 0.15s ease-out, height 0.15s ease-out"}),r}startResizing(e,t,r,n){var o,i;e.preventDefault(),n.dataSetDragging(!0),ze(this,zs).style.pointerEvents="none";const s=e.pageX,a=e.pageY,l=((o=ze(this,zs))==null?void 0:o.getBoundingClientRect().width)||0,c=((i=ze(this,zs))==null?void 0:i.getBoundingClientRect().height)||0,u=x1(100,!1,f=>{const p=f.pageX,h=f.pageY,m=p-s,b=h-a;let v=null,g=null;if(this.aspectRatio===0&&l&&c)switch(n.type){case 0:case 3:v=l+m,g=c/l*v;break;case 1:case 4:v=l-m,g=c/l*v;break;case 2:g=c+b,v=l/c*g;break}else if(this.aspectRatio===1)switch(n.type){case 0:v=l+m;break;case 1:v=l-m;break;case 2:g=c+b;break;case 3:v=l+m,g=c+b;break;case 4:v=l-m,g=c+b;break}typeof v=="number"&&v{f.preventDefault(),n.dataSetDragging(!1),n.setHandleVisibility(!1),ze(this,zs).style.pointerEvents="auto",document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",d);const p=r(),h=t.state.tr.setNodeMarkup(p,void 0,{...ze(this,Ls).attrs,width:ze(this,Bo),height:ze(this,Ds)});t.dispatch(h)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",d),ze(this,Is).push(()=>document.removeEventListener("mousemove",u)),ze(this,Is).push(()=>document.removeEventListener("mouseup",d))}update(e){return e.type!==ze(this,Ls).type||this.aspectRatio===0&&e.attrs.width&&e.attrs.width!==ze(this,Bo)||this.aspectRatio===1&&e.attrs.width&&e.attrs.height&&e.attrs.width!==ze(this,Bo)&&e.attrs.height!==ze(this,Ds)||!hse(ze(this,Ls),e,["width","height"])?!1:(Mi(this,Ls,e),Mi(this,Bo,e.attrs.width),Mi(this,Ds,e.attrs.height),!0)}destroy(){ze(this,Is).forEach(e=>e())}};zs=new WeakMap;Ls=new WeakMap;Is=new WeakMap;Bo=new WeakMap;Ds=new WeakMap;function hse(e,t,r){return e===t||mse(e,t,r)&&e.content.eq(t.content)}function mse(e,t,r){const n=e.attrs,o=t.attrs,i={};for(const a of r)i[a]=null;e.attrs={...n,...i},t.attrs={...o,...i};const s=e.sameMarkup(t);return e.attrs=n,t.attrs=o,s}function n4(e){return typeof e=="number"?`${e}px`:e||void 0}var pO={exports:{}},gse=Number.isNaN||function(e){return e!==e},vse=gse,vx=Number.isFinite||function(e){return!(typeof e!="number"||vse(e)||e===1/0||e===-1/0)},yse=vx,bse=Number.isInteger||function(e){return typeof e=="number"&&yse(e)&&Math.floor(e)===e},xse=vx,kse=bse,wse=function(t,r){if(!xse(t))throw new Error("Value must be a finite number");if(!kse(r)||r<0)throw new Error("Precision must be a non-negative integer");return parseFloat(t.toFixed(r))},Sse=/^(-?\d?\.?\d+)e([\+\-]\d)+/,Ese=function(t){var r=t.match(Sse);if(!r)throw new Error("Invalid exponential");return r.slice(1)},Cse=vx,Mse=Ese,Tse=function(t){if(!Cse(t))throw new Error("Value must be a finite number");var r=Mse(t.toExponential()),n=r[0],o=parseInt(r[1],10),i=(n.split(".")[1]||"").length;return!i&&o>0?0:i+-1*o};(function(e,t){var r=wse,n=Tse;e.exports=i;var o={down:"floor",up:"ceil"};function i(s,a,l){if(a=a||1,l){if(!o.hasOwnProperty(l))throw new Error("invalid direction");var c=o[l];return r(Math[c](s/a)*a,n(a))}var u=i(s,a,"down"),d=i(s,a,"up");return s-u{for(var o=n>1?void 0:n?Nse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ase(t,r,o),o},Rse={icon:"fontSize",description:({t:e})=>e(Al.SET_DESCRIPTION),label:({t:e})=>e(Al.SET_LABEL)},Pse={icon:"addLine",description:({t:e})=>e(Al.INCREASE_DESCRIPTION),label:({t:e})=>e(Al.INCREASE_LABEL)},zse={icon:"subtractLine",description:({t:e})=>e(Al.DECREASE_DESCRIPTION),label:({t:e})=>e(Al.DECREASE_LABEL)},f1="data-font-size-mark",co=class extends li{get name(){return"fontSize"}createTags(){return[oe.FormattingMark,oe.FontStyle]}createMarkSpec(e,t){return{...t,attrs:{...e.defaults(),size:{default:this.options.defaultSize}},parseDOM:[{tag:`span[${f1}]`,getAttrs:r=>{if(!Je(r))return null;let n=r.getAttribute(f1);return n?(n=`${gg(n,this.options.unit,r)}${this.options.unit}`,{...e.parse(r),size:n}):null}},{style:"font-size",priority:Ae.Low,getAttrs:r=>ne(r)?(r=this.getFontSize(r),{size:r}):null},...t.parseDOM??[]],toDOM:r=>{const{size:n,...o}=Dd(r.attrs,e),i=e.dom(r);let s=i.style,a;return n&&(s=Uv({fontSize:this.getFontSize(n)},s)),["span",{...o,...i,style:s,[f1]:a},0]}}}getFontSize(e){var t;const{unit:r,roundingMultiple:n,max:o,min:i,defaultSize:s}=this.options,a=gg(e,r,(t=this.store.view)==null?void 0:t.dom);return Number.isNaN(a)?s||"1rem":`${_d({value:_se(a,n),max:o,min:i})}${r}`}setFontSize(e,t){return this.store.commands.applyMark.original(this.type,{size:String(e)},t==null?void 0:t.selection)}increaseFontSize(e){const{increment:t}=this.options;return r=>{const[n]=this.getFontSizeForSelection(e==null?void 0:e.selection);let[o]=n;return o+=_e(t)?t(n,1):t,this.setFontSize(o,e)(r)}}decreaseFontSize(e){const{increment:t}=this.options;return r=>{const[n]=this.getFontSizeForSelection(e==null?void 0:e.selection);let[o]=n;return o-=_e(t)?t(n,-1):t,this.setFontSize(o,e)(r)}}removeFontSize(e){return this.store.commands.removeMark.original({type:this.type,expand:!1,...e})}increaseFontSizeShortcut(e){return this.increaseFontSize()(e)}decreaseFontSizeShortcut(e){return this.decreaseFontSize()(e)}getFontSizeForSelection(e){const t=this.store.getState(),r=jr(e??t.selection,t.doc),[n,...o]=dz(r,this.type);if(n)return[If(n.mark.attrs.size),...o.map(l=>If(l.mark.attrs.size))];const{defaultSize:i,unit:s}=this.options;return[[gg(i,s),s]]}getFontSizeFromDom(e){const t=this.store.getState(),r=jr(e??t.selection,t.doc),n=this.store.view.domAtPos(r.from),o=Je(n.node)?n.node:this.store.view.dom;return If(Pl(o))}};hi([U(Rse)],co.prototype,"setFontSize",1);hi([U(Pse)],co.prototype,"increaseFontSize",1);hi([U(zse)],co.prototype,"decreaseFontSize",1);hi([U()],co.prototype,"removeFontSize",1);hi([je({shortcut:D.IncreaseFontSize,command:"increaseFontSize"})],co.prototype,"increaseFontSizeShortcut",1);hi([je({shortcut:D.IncreaseFontSize,command:"decreaseFontSize"})],co.prototype,"decreaseFontSizeShortcut",1);hi([He()],co.prototype,"getFontSizeForSelection",1);hi([He()],co.prototype,"getFontSizeFromDom",1);co=hi([me({defaultOptions:{defaultSize:"",unit:"pt",increment:1,max:100,min:1,roundingMultiple:.5},staticKeys:["defaultSize"]})],co);var Lse=Object.defineProperty,Ise=Object.getOwnPropertyDescriptor,hO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ise(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Lse(t,r,o),o},bh=class extends er{get name(){return"hardBreak"}createTags(){return[oe.InlineNode]}createNodeSpec(e,t){return{inline:!0,selectable:!1,atom:!0,leafText:()=>` -`,...t,attrs:e.defaults(),parseDOM:[{tag:"br",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["br",e.dom(r)]}}createKeymap(){const e=F6(yu(V5),()=>(this.store.commands.insertHardBreak(),!0));return{"Mod-Enter":e,"Shift-Enter":e}}insertHardBreak(){return e=>{const{tr:t,dispatch:r}=e;return r==null||r(t.replaceSelectionWith(this.type.create()).scrollIntoView()),!0}}};hO([U()],bh.prototype,"insertHardBreak",1);bh=hO([me({defaultPriority:Ae.Low})],bh);var Dse=Object.defineProperty,$se=Object.getOwnPropertyDescriptor,mO=(e,t,r,n)=>{for(var o=n>1?void 0:n?$se(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Dse(t,r,o),o},{LABEL:Hse}=aR,Bse={icon:({attrs:e})=>`h${(e==null?void 0:e.level)??"1"}`,label:({t:e,attrs:t})=>e({...Hse,values:{level:t==null?void 0:t.level}})},Fse=[D.H1,D.H2,D.H3,D.H4,D.H5,D.H6],xh=class extends er{get name(){return"heading"}createTags(){return[oe.Block,oe.TextBlock,oe.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),level:{default:this.options.defaultLevel}},parseDOM:[...this.options.levels.map(r=>({tag:`h${r}`,getAttrs:n=>({...e.parse(n),level:r})})),...t.parseDOM??[]],toDOM:r=>this.options.levels.includes(r.attrs.level)?[`h${r.attrs.level}`,e.dom(r),0]:[`h${this.options.defaultLevel}`,e.dom(r),0]}}toggleHeading(e={}){return Wv({type:this.type,toggleType:"paragraph",attrs:e})}createKeymap(e){const t=this.store.getExtension(xe),r=ee(),n=[];for(const o of this.options.levels){const i=Fse[o-1]??D.H1;r[i]=Bu(this.type,{level:o}),n.push({attrs:{level:o},shortcut:e(i)[0]})}return t.updateDecorated("toggleHeading",{shortcut:n}),r}createInputRules(){return this.options.levels.map(e=>DR(new RegExp(`^(#{1,${e}})\\s$`),this.type,()=>({level:e})))}createPasteRules(){return this.options.levels.map(e=>({type:"node",nodeType:this.type,regexp:new RegExp(`^#{${e}}\\s([\\s\\w]+)$`),getAttributes:()=>({level:e}),startOfTextBlock:!0}))}};mO([U(Bse)],xh.prototype,"toggleHeading",1);xh=mO([me({defaultOptions:{levels:[1,2,3,4,5,6],defaultLevel:1},staticKeys:["defaultLevel","levels"]})],xh);var Vse=Object.defineProperty,jse=Object.getOwnPropertyDescriptor,gO=(e,t,r,n)=>{for(var o=n>1?void 0:n?jse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Vse(t,r,o),o},Use={icon:"separator",label:({t:e})=>e(hk.LABEL),description:({t:e})=>e(hk.DESCRIPTION)},kh=class extends er{get name(){return"horizontalRule"}createTags(){return[oe.Block]}createNodeSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"hr",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["hr",e.dom(r)]}}insertHorizontalRule(){return e=>{const{tr:t,dispatch:r}=e,n=t.selection.$anchor,o=n.parent;return o.type.name==="doc"||o.isAtom||o.isLeaf?!1:(r&&(t.selection.empty&&Dh(o)&&t.insert(n.pos+1,o),t.replaceSelectionWith(this.type.create()),this.updateFromNodeSelection(t),r(t.scrollIntoView())),!0)}}createInputRules(){return[I5({regexp:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type,beforeDispatch:({tr:e})=>{this.updateFromNodeSelection(e)}})]}updateFromNodeSelection(e){if(!Id(e.selection)||e.selection.node.type.name!==this.name)return;const t=e.selection.$from.pos+1,{insertionNode:r}=this.options;if(!r)return;const n=this.store.schema.nodes[r];te(n,{code:H.EXTENSION,message:`'${r}' node provided as the insertionNode to the '${this.constructorName}' does not exist.`});const o=n.create();e.insert(t,o),e.setSelection(le.near(e.doc.resolve(t+1)))}};gO([U(Use)],kh.prototype,"insertHorizontalRule",1);kh=gO([me({defaultOptions:{insertionNode:"paragraph"}})],kh);var Wse=Object.defineProperty,Kse=Object.getOwnPropertyDescriptor,yx=(e,t,r,n)=>{for(var o=n>1?void 0:n?Kse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Wse(t,r,o),o},qse=class extends pse{constructor(e,t,r){super({node:e,view:t,getPos:r,aspectRatio:fO.Fixed})}createElement({node:e}){const t=document.createElement("img");return t.setAttribute("src",e.attrs.src),sr(t,{width:"100%",minWidth:"50px",objectFit:"contain"}),t}},kd=class extends er{get name(){return"image"}createTags(){return[oe.InlineNode,oe.Media]}createNodeSpec(e,t){const{preferPastedTextContent:r}=this.options;return{inline:!0,draggable:!0,selectable:!1,...t,attrs:{...e.defaults(),alt:{default:""},crop:{default:null},height:{default:null},width:{default:null},rotate:{default:null},src:{default:null},title:{default:""},fileName:{default:null},resizable:{default:!1}},parseDOM:[{tag:"img[src]",getAttrs:n=>{var o;if(Je(n)){const i=Yse({element:n,parse:e.parse});return r&&((o=i.src)!=null&&o.startsWith("file:///"))?!1:i}return{}}},...t.parseDOM??[]],toDOM:n=>{const o=Dd(n.attrs,e);return["img",{...e.dom(n),...o}]}}}insertImage(e,t){return({tr:r,dispatch:n})=>{const{from:o,to:i}=jr(t??r.selection,r.doc),s=this.type.create(e);return n==null||n(r.replaceRangeWith(o,i,s)),!0}}uploadImage(e,t){const{updatePlaceholder:r,destroyPlaceholder:n,createPlaceholder:o}=this.options;return i=>{const{tr:s}=i;let a=s.selection.from;return this.store.createPlaceholderCommand({promise:e,placeholder:{type:"widget",get pos(){return a},createElement:(l,c)=>{const u=o(l,c);return t==null||t(u),u},onUpdate:(l,c,u,d)=>{r(l,c,u,d)},onDestroy:(l,c)=>{n(l,c)}},onSuccess:(l,c,u)=>this.insertImage(l,c)(u)}).validate(({tr:l,dispatch:c})=>{const u=xE(l.doc,a,this.type);return u==null?!1:(a=u,l.selection.empty||c==null||c(l.deleteSelection()),!0)},"unshift").generateCommand()(i)}}fileUploadFileHandler(e,t,r){var n;const{preferPastedTextContent:o,uploadHandler:i}=this.options;if(o&&Qse(t)&&((n=t.clipboardData)!=null&&n.getData("text/plain")))return!1;const{commands:s,chain:a}=this.store,l=e.map((u,d)=>({file:u,progress:f=>{s.updatePlaceholder(c[d],f)}})),c=i(l);Jt(r)&&a.selectText(r);for(const u of c)a.uploadImage(u);return a.run(),!0}createPasteRules(){return[{type:"file",regexp:/image/i,fileHandler:e=>{const t=e.type==="drop"?e.pos:void 0;return this.fileUploadFileHandler(e.files,e.event,t)}}]}createNodeViews(){return this.options.enableResizing?(e,t,r)=>new qse(e,t,r):{}}};yx([U()],kd.prototype,"insertImage",1);yx([U()],kd.prototype,"uploadImage",1);kd=yx([me({defaultOptions:{createPlaceholder:Jse,updatePlaceholder:()=>{},destroyPlaceholder:()=>{},uploadHandler:Xse,enableResizing:!1,preferPastedTextContent:!0}})],kd);function Gse(e){let{width:t,height:r}=e.style;return t=t||e.getAttribute("width")||"",r=r||e.getAttribute("height")||"",{width:t,height:r}}function Yse({element:e,parse:t}){const{width:r,height:n}=Gse(e);return{...t(e),alt:e.getAttribute("alt")??"",height:Number.parseInt(n||"0",10)||null,src:e.getAttribute("src")??null,title:e.getAttribute("title")??"",width:Number.parseInt(r||"0",10)||null,fileName:e.getAttribute("data-file-name")??null}}function Jse(e,t){const r=document.createElement("div");return r.classList.add(rV.IMAGE_LOADER),r}function Xse(e){te(e.length>0,{code:H.EXTENSION,message:"The upload handler was applied for the image extension without any valid files"});let t=0;const r=[];for(const{file:n,progress:o}of e)r.push(()=>new Promise(i=>{const s=new FileReader;s.addEventListener("load",a=>{var l;t+=1,o(t/e.length),i({src:(l=a.target)==null?void 0:l.result,fileName:n.name})},{once:!0}),s.readAsDataURL(n)}));return r}function Qse(e){return e.clipboardData!==void 0}var Zse=Object.defineProperty,eae=Object.getOwnPropertyDescriptor,bx=(e,t,r,n)=>{for(var o=n>1?void 0:n?eae(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Zse(t,r,o),o},tae={icon:"italic",label:({t:e})=>e(mk.LABEL),description:({t:e})=>e(mk.DESCRIPTION)},wd=class extends li{get name(){return"italic"}createTags(){return[oe.FontStyle,oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"i",getAttrs:e.parse},{tag:"em",getAttrs:e.parse},{style:"font-style=italic"},...t.parseDOM??[]],toDOM:r=>["em",e.dom(r),0]}}createKeymap(){return{"Mod-i":ns({type:this.type})}}createInputRules(){return[Fu({regexp:/(?:^|[^*])\*([^*]+)\*$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:t+1}}),Fu({regexp:/(?:^|\W)_([^_]+)_$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:t+1}})]}createPasteRules(){return[{type:"mark",markType:this.type,regexp:/(?:^|\W)_([^_]+)_/g},{type:"mark",markType:this.type,regexp:/\*([^*]+)\*/g}]}toggleItalic(e){return ns({type:this.type,selection:e})}shortcut(e){return this.toggleItalic()(e)}};bx([U(tae)],wd.prototype,"toggleItalic",1);bx([je({shortcut:D.Italic,command:"toggleItalic"})],wd.prototype,"shortcut",1);wd=bx([me({})],wd);var vO={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(typeof self<"u"?self:Ru,function(){return function(r){function n(i){if(o[i])return o[i].exports;var s=o[i]={i,l:!1,exports:{}};return r[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}var o={};return n.m=r,n.c=o,n.d=function(i,s,a){n.o(i,s)||Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:a})},n.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(s,"a",s),s},n.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},n.p="",n(n.s=0)}([function(r,n,o){function i(){throw new TypeError("The given URL is not a string. Please verify your string|array.")}function s(c){typeof c!="string"&&i();for(var u=0,d=0,f=0,p=c.length,h=0;p--&&++h&&!(u&&-1f?"":c.slice(f,u)}var a=["/",":","?","#"],l=[".","/","@"];r.exports=function(c){if(typeof c=="string")return s(c);if(Array.isArray(c)){var u=[],d,f=0;for(d=c.length;f{for(var o=n>1?void 0:n?iae(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&oae(t,r,o),o},sae=["com","de","net","org","uk","cn","ga","nl","cf","ml","tk","ru","br","gq","xyz","fr","eu","info","co","au","ca","it","in","ch","pl","es","online","us","top","be","jp","biz","se","at","dk","cz","za","me","ir","icu","shop","kr","site","mx","hu","io","cc","club","no","cyou"],o4="updateLink",aae=/(?:(?:(?:https?|ftp):)?\/\/)?(?:\S+(?::\S*)?@)?(?:(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)*(?:(?:\d(?!\.)|[a-z\u00A1-\uFFFF])(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)+[a-z\u00A1-\uFFFF]{2,}(?::\d{2,5})?(?:[#/?]\S*)?/gi,us=class extends li{constructor(){super(...arguments),this._autoLinkRegexNonGlobal=void 0}get name(){return"link"}createTags(){return[oe.Link,oe.ExcludeInputRules]}createMarkSpec(e,t){const r="data-link-auto",n=o=>{const{defaultTarget:i,supportedTargets:s}=this.options,a=i?[...s,i]:s;return o&&dr(a,o)?{target:o}:void 0};return{inclusive:!1,excludes:"_",...t,attrs:{...e.defaults(),href:{},target:{default:this.options.defaultTarget},auto:{default:!1}},parseDOM:[{tag:"a[href]",getAttrs:o=>{if(!Je(o))return!1;const i=o.getAttribute("href"),s=o.textContent,a=this.options.autoLink&&(o.hasAttribute(r)||i===s||(i==null?void 0:i.replace(`${this.options.defaultProtocol}//`,""))===s);return{...e.parse(o),href:i,auto:a,...n(o.getAttribute("target"))}}},...t.parseDOM??[]],toDOM:o=>{const{auto:i,target:s,...a}=Dd(o.attrs,e),l=o.attrs.auto?{[r]:""}:{},c="noopener noreferrer nofollow";return["a",{...e.dom(o),...a,rel:c,...l,...n(o.attrs.target)},0]}}}onCreate(){const{autoLinkRegex:e}=this.options;this._autoLinkRegexNonGlobal=new RegExp(`^${e.source}$`,e.flags.replace("g",""))}shortcut({tr:e}){let t="",{from:r,to:n,empty:o,$from:i}=e.selection,s=!1;const a=_o(i,this.type);if(o){const l=a??C5(e);if(!l)return!1;({text:t,from:r,to:n}=l),s=!0}return r===n?!1:(s||(t=e.doc.textBetween(r,n)),this.options.onActivateLink(t),this.options.onShortcut({activeLink:a?{attrs:a.mark.attrs,from:a.from,to:a.to}:void 0,selectedText:t,from:r,to:n}),!0)}updateLink(e,t){return r=>{const{tr:n}=r;return!(gs(n.selection)&&!Bv(n.selection)||az(n.selection)||Ap({trState:n,type:this.type}))&&!t?!1:(n.setMeta(this.name,{command:o4,attrs:e,range:t}),Mz({type:this.type,attrs:e,range:t})(r))}}selectLink(){return this.store.commands.selectMark.original(this.type)}removeLink(e){return t=>{const{tr:r}=t;return Ap({trState:r,type:this.type,...e})?L5({type:this.type,expand:!0,range:e})(t):!1}}createPasteRules(){return[{type:"mark",regexp:this.options.autoLinkRegex,markType:this.type,getAttributes:(e,t)=>({href:this.buildHref(Zo(e)),auto:!t}),transformMatch:e=>{const t=Zo(e);return!t||!this.isValidUrl(t)?!1:t}}]}createEventHandlers(){return{clickMark:(e,t)=>{const r=t.getMark(this.type);if(!r)return;const n=r.mark.attrs,o={...n,...r};if(this.options.onClick(e,o))return!0;if(!this.store.view.editable)return;let i=!1;if(this.options.openLinkOnClick){i=!0;const s=n.href;window.open(s,"_blank")}return this.options.selectTextOnClick&&(i=!0,this.store.commands.selectText(r)),i}}}createPlugin(){return{appendTransaction:(e,t,r)=>{if(e.filter(p=>!!p.getMeta(this.name)).forEach(p=>{const h=p.getMeta(this.name);if(h.command===o4){const{range:m,attrs:b}=h,{selection:v,doc:g}=r,y={range:m,selection:v,doc:g,attrs:b},{from:x,to:k}=m??v;this.options.onUpdateLink(g.textBetween(x,k),y)}}),!this.options.autoLink||V0(t)-V0(r)===1||!e.some(p=>p.docChanged))return;const s=K6(e,t),a=E5(s,[bt,Dt]),{mapping:l}=s,{tr:c,doc:u}=r,{updateLink:d,removeLink:f}=this.store.chain(c);if(a.forEach(({prevFrom:p,prevTo:h,from:m,to:b})=>{const v=[],g=b-m===2,y=this.getLinkMarksInRange(t.doc,p,h,!0).filter(x=>x.mark.type===this.type).map(({from:x,to:k,text:w})=>({mappedFrom:l.map(x),mappedTo:l.map(k),text:w,from:x,to:k}));y.forEach(({mappedFrom:x,mappedTo:k,from:w,to:E},M)=>this.getLinkMarksInRange(u,x,k,!0).filter(C=>C.mark.type===this.type).forEach(C=>{const T=t.doc.textBetween(w,E,void 0," "),N=u.textBetween(C.from,C.to+1,void 0," ").trim(),F=this.isValidUrl(T);this.isValidUrl(N)||(F&&(f({from:C.from,to:C.to}).tr(),y.splice(M,1)),!g&&m===b&&this.findAutoLinks(N).map(V=>this.addLinkProperties({...V,from:x+V.start,to:x+V.end})).forEach(({attrs:V,range:j,text:z})=>{d(V,j).tr(),v.push({attrs:V,range:j,text:z})}))})),this.findTextBlocksInRange(u,{from:m,to:b}).forEach(({text:x,positionStart:k})=>{this.findAutoLinks(x).map(w=>this.addLinkProperties({...w,from:k+w.start+1,to:k+w.end+1})).filter(({range:w})=>{const E=m>=w.from&&m<=w.to,M=b>=w.from&&b<=w.to;return E||M||g}).filter(({range:w})=>this.getLinkMarksInRange(c.doc,w.from,w.to,!1).length===0).filter(({range:{from:w},text:E})=>!y.some(({text:M,mappedFrom:C})=>C===w&&M===E)).forEach(({attrs:w,text:E,range:M})=>{d(w,M).tr(),v.push({attrs:w,range:M,text:E})})}),window.requestAnimationFrame(()=>{v.forEach(({attrs:x,range:k,text:w})=>{const{doc:E,selection:M}=c;this.options.onUpdateLink(w,{attrs:x,doc:E,range:k,selection:M})})})}),c.steps.length!==0)return c}}}buildHref(e){return this.options.extractHref({url:e,defaultProtocol:this.options.defaultProtocol})}getLinkMarksInRange(e,t,r,n){const o=[];if(t===r){const i=Math.max(t-1,0),s=e.resolve(i),a=_o(s,this.type);(a==null?void 0:a.mark.attrs.auto)===n&&o.push(a)}else e.nodesBetween(t,r,(i,s)=>{const l=(i.marks??[]).find(({type:c,attrs:u})=>c===this.type&&u.auto===n);l&&o.push({from:s,to:s+i.nodeSize,mark:l,text:i.textContent})});return o}findTextBlocksInRange(e,t){const r=[];return e.nodesBetween(t.from,t.to,(n,o)=>{!n.isTextblock||!n.type.allowsMarkType(this.type)||r.push({node:n,pos:o})}),r.map(n=>({text:e.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," "),positionStart:n.pos}))}addLinkProperties({from:e,to:t,href:r,...n}){return{...n,range:{from:e,to:t},attrs:{href:r,auto:!0}}}findAutoLinks(e){if(this.options.findAutoLinks)return this.options.findAutoLinks(e,this.options.defaultProtocol);const t=[];for(const r of xa(e,this.options.autoLinkRegex)){const n=Zo(r);if(!n)continue;const o=this.buildHref(n);!this.isValidTLD(o)&&!o.startsWith("tel:")||t.push({text:n,href:o,start:r.index,end:r.index+n.length})}return t}isValidUrl(e){var t;return this.options.isValidUrl?this.options.isValidUrl(e,this.options.defaultProtocol):this.isValidTLD(this.buildHref(e))&&!!((t=this._autoLinkRegexNonGlobal)!=null&&t.test(e))}isValidTLD(e){const{autoLinkAllowedTLDs:t}=this.options;if(t.length===0)return!0;const r=nae(e);if(r==="")return!0;const n=G4(r.split("."));return t.includes(n)}};Xd([je({shortcut:D.InsertLink})],us.prototype,"shortcut",1);Xd([U()],us.prototype,"updateLink",1);Xd([U()],us.prototype,"selectLink",1);Xd([U()],us.prototype,"removeLink",1);us=Xd([me({defaultOptions:{autoLink:!1,defaultProtocol:"",selectTextOnClick:!1,openLinkOnClick:!1,autoLinkRegex:aae,autoLinkAllowedTLDs:sae,findAutoLinks:void 0,isValidUrl:void 0,defaultTarget:null,supportedTargets:[],extractHref:lae},staticKeys:["autoLinkRegex"],handlerKeyOptions:{onClick:{earlyReturnValue:!0}},handlerKeys:["onActivateLink","onShortcut","onUpdateLink","onClick"],defaultPriority:Ae.Medium})],us);function lae({url:e,defaultProtocol:t}){const r=/^((?:https?|ftp)?:)\/\//.test(e);return!r&&e.includes("@")?`mailto:${e}`:r?e:`${t}//${e}`}function cae(e){for(var t=1;t0&&e[t-1]===` -`;)t--;return e.substring(0,t)}var fae=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function xx(e){return kx(e,fae)}var yO=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function bO(e){return kx(e,yO)}function pae(e){return kO(e,yO)}var xO=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function hae(e){return kx(e,xO)}function mae(e){return kO(e,xO)}function kx(e,t){return t.indexOf(e.nodeName)>=0}function kO(e,t){return e.getElementsByTagName&&t.some(function(r){return e.getElementsByTagName(r).length})}var pr={};pr.paragraph={filter:"p",replacement:function(e){return` + */var r=function(n){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,s={},a={manual:n.Prism&&n.Prism.manual,disableWorkerMessageHandler:n.Prism&&n.Prism.disableWorkerMessageHandler,util:{encode:function g(y){return y instanceof l?new l(y.type,g(y.content),y.alias):Array.isArray(y)?y.map(g):y.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(k){var g=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(k.stack)||[])[1];if(g){var y=document.getElementsByTagName("script");for(var x in y)if(y[x].src==g)return y[x]}return null}},isActive:function(g,y,x){for(var k="no-"+y;g;){var w=g.classList;if(w.contains(y))return!0;if(w.contains(k))return!1;g=g.parentElement}return!!x}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(g,y){var x=a.util.clone(a.languages[g]);for(var k in y)x[k]=y[k];return x},insertBefore:function(g,y,x,k){k=k||a.languages;var w=k[g],E={};for(var T in w)if(w.hasOwnProperty(T)){if(T==y)for(var C in x)x.hasOwnProperty(C)&&(E[C]=x[C]);x.hasOwnProperty(T)||(E[T]=w[T])}var M=k[g];return k[g]=E,a.languages.DFS(a.languages,function(N,F){F===M&&N!=g&&(this[N]=E)}),E},DFS:function g(y,x,k,w){w=w||{};var E=a.util.objId;for(var T in y)if(y.hasOwnProperty(T)){x.call(y,T,y[T],k||T);var C=y[T],M=a.util.type(C);M==="Object"&&!w[E(C)]?(w[E(C)]=!0,g(C,x,null,w)):M==="Array"&&!w[E(C)]&&(w[E(C)]=!0,g(C,x,T,w))}}},plugins:{},highlightAll:function(g,y){a.highlightAllUnder(document,g,y)},highlightAllUnder:function(g,y,x){var k={callback:x,container:g,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",k),k.elements=Array.prototype.slice.apply(k.container.querySelectorAll(k.selector)),a.hooks.run("before-all-elements-highlight",k);for(var w=0,E;E=k.elements[w++];)a.highlightElement(E,y===!0,k.callback)},highlightElement:function(g,y,x){var k=a.util.getLanguage(g),w=a.languages[k];a.util.setLanguage(g,k);var E=g.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(E,k);var T=g.textContent,C={element:g,language:k,grammar:w,code:T};function M(F){C.highlightedCode=F,a.hooks.run("before-insert",C),C.element.innerHTML=C.highlightedCode,a.hooks.run("after-highlight",C),a.hooks.run("complete",C),x&&x.call(C.element)}if(a.hooks.run("before-sanity-check",C),E=C.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!C.code){a.hooks.run("complete",C),x&&x.call(C.element);return}if(a.hooks.run("before-highlight",C),!C.grammar){M(a.util.encode(C.code));return}if(y&&n.Worker){var N=new Worker(a.filename);N.onmessage=function(F){M(F.data)},N.postMessage(JSON.stringify({language:C.language,code:C.code,immediateClose:!0}))}else M(a.highlight(C.code,C.grammar,C.language))},highlight:function(g,y,x){var k={code:g,grammar:y,language:x};if(a.hooks.run("before-tokenize",k),!k.grammar)throw new Error('The language "'+k.language+'" has no grammar.');return k.tokens=a.tokenize(k.code,k.grammar),a.hooks.run("after-tokenize",k),l.stringify(a.util.encode(k.tokens),k.language)},tokenize:function(g,y){var x=y.rest;if(x){for(var k in x)y[k]=x[k];delete y.rest}var w=new d;return f(w,w.head,g),u(g,w,y,w.head,0),h(w)},hooks:{all:{},add:function(g,y){var x=a.hooks.all;x[g]=x[g]||[],x[g].push(y)},run:function(g,y){var x=a.hooks.all[g];if(!(!x||!x.length))for(var k=0,w;w=x[k++];)w(y)}},Token:l};n.Prism=a;function l(g,y,x,k){this.type=g,this.content=y,this.alias=x,this.length=(k||"").length|0}l.stringify=function g(y,x){if(typeof y=="string")return y;if(Array.isArray(y)){var k="";return y.forEach(function(M){k+=g(M,x)}),k}var w={type:y.type,content:g(y.content,x),tag:"span",classes:["token",y.type],attributes:{},language:x},E=y.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(w.classes,E):w.classes.push(E)),a.hooks.run("wrap",w);var T="";for(var C in w.attributes)T+=" "+C+'="'+(w.attributes[C]||"").replace(/"/g,""")+'"';return"<"+w.tag+' class="'+w.classes.join(" ")+'"'+T+">"+w.content+""};function c(g,y,x,k){g.lastIndex=y;var w=g.exec(x);if(w&&k&&w[1]){var E=w[1].length;w.index+=E,w[0]=w[0].slice(E)}return w}function u(g,y,x,k,w,E){for(var T in x)if(!(!x.hasOwnProperty(T)||!x[T])){var C=x[T];C=Array.isArray(C)?C:[C];for(var M=0;M=E.reach);P+=A.value.length,A=A.next){var B=A.value;if(y.length>g.length)return;if(!(B instanceof l)){var Y=1,J;if(V){if(J=c(q,P,g,I),!J||J.index>=g.length)break;var de=J.index,Ne=J.index+J[0].length,ie=P;for(ie+=A.value.length;de>=ie;)A=A.next,ie+=A.value.length;if(ie-=A.value.length,P=ie,A.value instanceof l)continue;for(var ue=A;ue!==y.tail&&(ieE.reach&&(E.reach=ft);var rt=A.prev;Me&&(rt=f(y,rt,Me),P+=Me.length),p(y,rt,Y);var Or=new l(T,F?a.tokenize(me,F):me,j,me);if(A=f(y,rt,Or),Se&&f(y,A,Se),Y>1){var he={cause:T+","+M,reach:ft};u(g,y,x,A.prev,P,he),E&&he.reach>E.reach&&(E.reach=he.reach)}}}}}}function d(){var g={value:null,prev:null,next:null},y={value:null,prev:g,next:null};g.next=y,this.head=g,this.tail=y,this.length=0}function f(g,y,x){var k=y.next,w={value:x,prev:y,next:k};return y.next=w,k.prev=w,g.length++,w}function p(g,y,x){for(var k=y.next,w=0;w/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(r,n){var o={};o["language-"+n]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[n]},o.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:o}};i["language-"+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var s={};s[r]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return r}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",s)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,r){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[r,"language-"+r],inside:e.languages[r]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}var Lie=mx;mx.displayName="css";mx.aliases=[];function mx(e){(function(t){var r=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+r.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+r.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+r.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:r,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(e)}var Iie=gx;gx.displayName="clike";gx.aliases=[];function gx(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}var Die=vx;vx.displayName="javascript";vx.aliases=["js"];function vx(e){e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}var fu=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof Pu=="object"?Pu:{},$ie=ese();fu.Prism={manual:!0,disableWorkerMessageHandler:!0};var Hie=ene,Bie=gie,dO=Pie,Fie=zie,Vie=Lie,jie=Iie,Uie=Die;$ie();var yx={}.hasOwnProperty;function fO(){}fO.prototype=dO;var Et=new fO,Wie=Et;Et.highlight=qie;Et.register=Qd;Et.alias=Kie;Et.registered=Gie;Et.listLanguages=Yie;Qd(Fie);Qd(Vie);Qd(jie);Qd(Uie);Et.util.encode=Qie;Et.Token.stringify=Jie;function Qd(e){if(typeof e!="function"||!e.displayName)throw new Error("Expected `function` for `grammar`, got `"+e+"`");Et.languages[e.displayName]===void 0&&e(Et)}function Kie(e,t){var r=Et.languages,n=e,o,i,s,a;t&&(n={},n[e]=t);for(o in n)for(i=n[o],i=typeof i=="string"?[i]:i,s=i.length,a=-1;++a{for(var o=n>1?void 0:n?rse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&tse(t,r,o),o},pO=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},xi=(e,t,r)=>(pO(e,t,"read from private field"),r?r.call(e):t.get(e)),p1=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},h1=(e,t,r,n)=>(pO(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),hO="data-code-block-language";function mO(e,t,r=[]){return e.map(n=>{const o=[...r];return n.type==="element"&&n.properties.className?o.push(...n.properties.className):n.type==="text"&&o.length===0&&t&&o.push(t),n.type==="element"?mO(n.children,t,o):{text:n.value,classes:o}})}function nse(e,t){var r;const{node:n,pos:o}=e,i=xh({language:(r=n.attrs.language)==null?void 0:r.replace("language-",""),fallback:"markup"}),s=bx.highlight(n.textContent??"",i),a=mO(s,t);let l=o+1;function c(u){const d=l,f=d+u.text.length;return l=f,{...u,from:d,to:f}}return Y4(a).map(c)}function i4(e){const{blocks:t,skipLast:r,plainTextClassName:n}=e,o=[];for(const i of t){const s=nse(i,n),a=r?s.length-1:s.length;for(const l of Ev(a)){const c=s[l],u=c==null?void 0:c.classes;if(!c||!(u!=null&&u.length))continue;const d=Ge.inline(c.from,c.to,{class:u.join(" ")});o.push(d)}}return o}function ose(e){return!!(e&&Zt(e)&&ne(e.language)&&e.language.length>0)}function ise(e){return t=>({state:{tr:r,selection:n},dispatch:o})=>{if(!ose(t))throw new Error("Invalid attrs passed to the updateAttributes method");const i=ts({types:e,selection:n});return!i||G4(t,i.node.attrs)?!1:(r.setNodeMarkup(i.pos,e,{...i.node.attrs,...t}),o&&o(r),!0)}}function xh(e){const{language:t,fallback:r}=e;if(!t)return r;const n=bx.listLanguages();for(const o of n)if(o.toLowerCase()===t.toLowerCase())return o;return r}function sse(e,t){const{language:r,wrap:n}=$d(e.attrs,t),{style:o,...i}=t.dom(e);let s=i.style;return n&&(s=qv({whiteSpace:"pre-wrap",wordBreak:"break-all"},s)),["pre",{spellcheck:"false",...i,class:ju(i.class,`language-${r}`)},["code",{[hO]:r,style:s},0]]}function ase(e){return({pos:t}=ee())=>({tr:r,dispatch:n})=>{const{type:o,formatter:i,defaultLanguage:s}=e,{from:a,to:l}=t?{from:t,to:t}:r.selection,c=ts({types:o,selection:r.selection});if(!c)return!1;const{node:{attrs:u,textContent:d},start:f}=c,p=a-f,h=l-f,m=xh({language:u.language,fallback:s}),b=i({source:d,language:m,cursorOffset:p});let v;if(p!==h&&(v=i({source:d,language:m,cursorOffset:h})),!b)return!1;const{cursorOffset:g,formatted:y}=b;if(y===d)return!1;const x=f+d.length;r.insertText(y,f,x);const k=f+g,w=v?f+v.cursorOffset:void 0;return r.setSelection(le.between(r.doc.resolve(k),r.doc.resolve(w??k))),n&&n(r),!0}}function lse(e){var t;return(t=e.getAttribute(hO)??e.classList[0])==null?void 0:t.replace("language-","")}var{DESCRIPTION:cse,LABEL:use}=nR,dse={icon:"bracesLine",description:({t:e})=>e(cse),label:({t:e})=>e(use)},Ps,pu,hu,fse=class{constructor(e,t){p1(this,Ps,void 0),p1(this,pu,void 0),p1(this,hu,!1),h1(this,pu,e),h1(this,Ps,t)}init(e){const t=Vz({node:e.doc,type:xi(this,pu)});return this.refreshDecorationSet(e.doc,t),this}refreshDecorationSet(e,t){const r=i4({blocks:t,skipLast:xi(this,hu),defaultLanguage:xi(this,Ps).options.defaultLanguage,plainTextClassName:xi(this,Ps).options.plainTextClassName??void 0});this.decorationSet=Ee.create(e,r)}apply(e,t){if(!e.docChanged)return this;this.decorationSet=this.decorationSet.map(e.mapping,e.doc);const r=jz(e,{descend:!0,predicate:n=>n.type===xi(this,pu),StepTypes:[]});return this.updateDecorationSet(e,r),this}updateDecorationSet(e,t){if(t.length===0)return;let r=this.decorationSet;for(const{node:n,pos:o}of t)r=this.decorationSet.remove(this.decorationSet.find(o,o+n.nodeSize));this.decorationSet=r.add(e.doc,i4({blocks:t,skipLast:xi(this,hu),defaultLanguage:xi(this,Ps).options.defaultLanguage,plainTextClassName:xi(this,Ps).options.plainTextClassName??void 0}))}setDeleted(e){h1(this,hu,e)}};Ps=new WeakMap;pu=new WeakMap;hu=new WeakMap;var lo=class extends er{get name(){return"codeBlock"}createTags(){return[oe.Block,oe.Code]}init(){this.registerLanguages()}createNodeSpec(e,t){const r=/highlight-(?:text|source)-([\da-z]+)/;return{content:"text*",marks:"",defining:!0,draggable:!1,...t,code:!0,attrs:{...e.defaults(),language:{default:this.options.defaultLanguage},wrap:{default:this.options.defaultWrap}},parseDOM:[{tag:"div.highlight",preserveWhitespace:"full",getAttrs:n=>{var o,i;if(!Je(n))return!1;const s=n.querySelector("pre.code");if(!Je(s))return!1;const a=kn(s,"white-space")==="pre-wrap",l=(i=(o=n.className.match(r))==null?void 0:o[1])==null?void 0:i.replace("language-","");return{...e.parse(n),language:l,wrap:a}}},{tag:"pre",preserveWhitespace:"full",getAttrs:n=>{if(!Je(n))return!1;const o=n.querySelector("code");if(!Je(o))return!1;const i=kn(o,"white-space")==="pre-wrap",s=this.options.getLanguageFromDom(o,n);return{...e.parse(n),language:s,wrap:i}}},...t.parseDOM??[]],toDOM:n=>sse(n,e)}}createAttributes(){return{class:aV[this.options.syntaxTheme.toUpperCase()]}}createInputRules(){const e=/^```([\dA-Za-z]*) $/,t=r=>({language:xh({language:Zo(r,1),fallback:this.options.defaultLanguage})});return[BC({regexp:e,type:this.type,beforeDispatch:({tr:r,start:n})=>{const o=r.doc.resolve(n);r.setSelection(le.near(o))},getAttributes:t})]}onSetOptions(e){const{changes:t}=e;t.supportedLanguages.changed&&this.registerLanguages(),t.syntaxTheme.changed&&this.store.updateAttributes()}createPlugin(){const e=new fse(this.type,this),t=()=>(e.setDeleted(!0),!1);return{state:{init(r,n){return e.init(n)},apply(r,n,o,i){return e.apply(r,i)}},props:{handleKeyDown:Jv({Backspace:t,"Mod-Backspace":t,Delete:t,"Mod-Delete":t,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t}),decorations(){return e.setDeleted(!1),e.decorationSet}}}}toggleCodeBlock(e={}){return Gv({type:this.type,toggleType:this.options.toggleName,attrs:{language:this.options.defaultLanguage,...e}})}createCodeBlock(e){return Fu(this.type,e)}updateCodeBlock(e){return ise(this.type)(e)}formatCodeBlock(e){return ase({type:this.type,formatter:this.options.formatter,defaultLanguage:this.options.defaultLanguage})(e)}tabKey({state:e,dispatch:t}){const{selection:r,tr:n,schema:o}=e,{node:i}=nz(r);if(!$h({node:i,types:this.type}))return!1;if(r.empty)n.insertText(" ");else{const{from:s,to:a}=r;n.replaceWith(s,a,o.text(" "))}return t&&t(n),!0}backspaceKey({dispatch:e,tr:t,state:r}){if(!t.selection.empty)return!1;const n=ts({types:this.type,selection:t.selection});if((n==null?void 0:n.start)!==t.selection.from)return!1;const{pos:o,node:i,start:s}=n,a=it(r.schema.nodes,this.options.toggleName);return i.textContent.trim()===""?t.doc.lastChild===i&&t.doc.firstChild===i?tz({pos:o,tr:t,content:a.create()}):ez({pos:o,tr:t}):s>2?t.setSelection(le.near(t.doc.resolve(s-2))):(t.insert(0,a.create()),t.setSelection(le.near(t.doc.resolve(1)))),e&&e(t),!0}enterKey({dispatch:e,tr:t}){if(!(gs(t.selection)&&t.selection.empty))return!1;const{nodeBefore:r,parent:n}=t.selection.$anchor;if(!(r!=null&&r.isText)||!n.type.isTextblock)return!1;const o=/^```([A-Za-z]*)?$/,{text:i,nodeSize:s}=r,{textContent:a}=n;if(!i)return!1;const l=i.match(o),c=a.match(o);if(!l||!c)return!1;const[,u]=l,d=xh({language:u,fallback:this.options.defaultLanguage}),f=t.selection.$from.before(),p=f+s+1;return t.replaceWith(f,p,this.type.create({language:d})),t.setSelection(le.near(t.doc.resolve(f+1))),e&&e(t),!0}formatShortcut({tr:e}){const t=this.store.commands;if(!SC({type:this.type,state:e}))return!1;const r=t.formatCodeBlock.isEnabled();return r&&t.formatCodeBlock(),r}registerLanguages(){for(const e of this.options.supportedLanguages)bx.register(e)}};pi([U(dse)],lo.prototype,"toggleCodeBlock",1);pi([U()],lo.prototype,"createCodeBlock",1);pi([U()],lo.prototype,"updateCodeBlock",1);pi([U()],lo.prototype,"formatCodeBlock",1);pi([je({shortcut:"Tab"})],lo.prototype,"tabKey",1);pi([je({shortcut:"Backspace"})],lo.prototype,"backspaceKey",1);pi([je({shortcut:"Enter"})],lo.prototype,"enterKey",1);pi([je({shortcut:D.Format})],lo.prototype,"formatShortcut",1);lo=pi([pe({defaultOptions:{supportedLanguages:[],toggleName:"paragraph",formatter:({source:e})=>({cursorOffset:0,formatted:e}),syntaxTheme:"a11y_dark",defaultLanguage:"markup",defaultWrap:!1,plainTextClassName:"",getLanguageFromDom:lse},staticKeys:["getLanguageFromDom"]})],lo);var gO=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},ze=(e,t,r)=>(gO(e,t,"read from private field"),r?r.call(e):t.get(e)),Xa=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Mi=(e,t,r,n)=>(gO(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),pse='',hse='',mse=encodeURIComponent(pse),gse=encodeURIComponent(hse),Ar,vse=class{constructor(e){Xa(this,Ar,void 0);const t=document.createElement("div"),r=document.createElement("div");this.dom=t,Mi(this,Ar,r),this.type=e,this.createHandle(e)}createHandle(e){switch(ar(this.dom,{position:"absolute",pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"100"}),ar(ze(this,Ar),{opacity:"0",transition:"opacity 300ms ease-in 0s"}),ze(this,Ar).dataset.dragging="",e){case 0:ar(this.dom,{right:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),ar(ze(this,Ar),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 1:ar(this.dom,{left:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),ar(ze(this,Ar),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 2:ar(this.dom,{bottom:"0px",width:"100%",height:"14px",cursor:"row-resize"}),ar(ze(this,Ar),{width:" 42px",height:"4px",boxSizing:"content-box",maxWidth:"50%",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 3:ar(this.dom,{right:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nwse-resize",zIndex:"101"}),ar(ze(this,Ar),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${gse}") `});break;case 4:ar(this.dom,{left:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nesw-resize",zIndex:"101"}),ar(ze(this,Ar),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${mse}") `});break}this.dom.append(ze(this,Ar))}setHandleVisibility(e){const t=e||!!ze(this,Ar).dataset.dragging;ze(this,Ar).style.opacity=t?"1":"0"}dataSetDragging(e){ze(this,Ar).dataset.dragging=e?"true":""}};Ar=new WeakMap;var Rf=50,vO=(e=>(e[e.Fixed=0]="Fixed",e[e.Flexible=1]="Flexible",e))(vO||{}),zs,Ls,Is,Bo,Ds,yse=class{constructor({node:e,view:t,getPos:r,aspectRatio:n=0,options:o,initialSize:i}){Xa(this,zs,void 0),Xa(this,Ls,void 0),Xa(this,Is,[]),Xa(this,Bo,void 0),Xa(this,Ds,void 0);const s=this.createWrapper(e,i),a=this.createElement({node:e,view:t,getPos:r,options:o}),c=(n===1?[0,1,2,3,4]:[0,1]).map(f=>new vse(f));for(const f of c){const p=h=>{this.startResizing(h,t,r,f)};f.dom.addEventListener("mousedown",p),ze(this,Is).push(()=>f.dom.removeEventListener("mousedown",p)),s.append(f.dom)}const u=()=>{c.forEach(f=>f.setHandleVisibility(!0))},d=()=>{c.forEach(f=>f.setHandleVisibility(!1))};s.addEventListener("mouseover",u),s.addEventListener("mouseout",d),ze(this,Is).push(()=>s.removeEventListener("mouseover",u),()=>s.removeEventListener("mouseout",d)),s.append(a),this.dom=s,Mi(this,Ls,e),Mi(this,zs,a),this.aspectRatio=n}createWrapper(e,t){const r=document.createElement("div");return r.classList.add("remirror-resizable-view"),r.style.position="relative",t?ar(r,{width:s4(t.width),aspectRatio:`${t.width} / ${t.height}`}):ar(r,{width:s4(e.attrs.width),aspectRatio:`${e.attrs.width} / ${e.attrs.height}`}),ar(r,{maxWidth:"100%",minWidth:`${Rf}px`,verticalAlign:"bottom",display:"inline-block",lineHeight:"0",transition:"width 0.15s ease-out, height 0.15s ease-out"}),r}startResizing(e,t,r,n){var o,i;e.preventDefault(),n.dataSetDragging(!0),ze(this,zs).style.pointerEvents="none";const s=e.pageX,a=e.pageY,l=((o=ze(this,zs))==null?void 0:o.getBoundingClientRect().width)||0,c=((i=ze(this,zs))==null?void 0:i.getBoundingClientRect().height)||0,u=S1(100,!1,f=>{const p=f.pageX,h=f.pageY,m=p-s,b=h-a;let v=null,g=null;if(this.aspectRatio===0&&l&&c)switch(n.type){case 0:case 3:v=l+m,g=c/l*v;break;case 1:case 4:v=l-m,g=c/l*v;break;case 2:g=c+b,v=l/c*g;break}else if(this.aspectRatio===1)switch(n.type){case 0:v=l+m;break;case 1:v=l-m;break;case 2:g=c+b;break;case 3:v=l+m,g=c+b;break;case 4:v=l-m,g=c+b;break}typeof v=="number"&&v{f.preventDefault(),n.dataSetDragging(!1),n.setHandleVisibility(!1),ze(this,zs).style.pointerEvents="auto",document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",d);const p=r(),h=t.state.tr.setNodeMarkup(p,void 0,{...ze(this,Ls).attrs,width:ze(this,Bo),height:ze(this,Ds)});t.dispatch(h)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",d),ze(this,Is).push(()=>document.removeEventListener("mousemove",u)),ze(this,Is).push(()=>document.removeEventListener("mouseup",d))}update(e){return e.type!==ze(this,Ls).type||this.aspectRatio===0&&e.attrs.width&&e.attrs.width!==ze(this,Bo)||this.aspectRatio===1&&e.attrs.width&&e.attrs.height&&e.attrs.width!==ze(this,Bo)&&e.attrs.height!==ze(this,Ds)||!bse(ze(this,Ls),e,["width","height"])?!1:(Mi(this,Ls,e),Mi(this,Bo,e.attrs.width),Mi(this,Ds,e.attrs.height),!0)}destroy(){ze(this,Is).forEach(e=>e())}};zs=new WeakMap;Ls=new WeakMap;Is=new WeakMap;Bo=new WeakMap;Ds=new WeakMap;function bse(e,t,r){return e===t||xse(e,t,r)&&e.content.eq(t.content)}function xse(e,t,r){const n=e.attrs,o=t.attrs,i={};for(const a of r)i[a]=null;e.attrs={...n,...i},t.attrs={...o,...i};const s=e.sameMarkup(t);return e.attrs=n,t.attrs=o,s}function s4(e){return typeof e=="number"?`${e}px`:e||void 0}var yO={exports:{}},kse=Number.isNaN||function(e){return e!==e},wse=kse,xx=Number.isFinite||function(e){return!(typeof e!="number"||wse(e)||e===1/0||e===-1/0)},Sse=xx,Ese=Number.isInteger||function(e){return typeof e=="number"&&Sse(e)&&Math.floor(e)===e},Cse=xx,Mse=Ese,Tse=function(t,r){if(!Cse(t))throw new Error("Value must be a finite number");if(!Mse(r)||r<0)throw new Error("Precision must be a non-negative integer");return parseFloat(t.toFixed(r))},Ose=/^(-?\d?\.?\d+)e([\+\-]\d)+/,_se=function(t){var r=t.match(Ose);if(!r)throw new Error("Invalid exponential");return r.slice(1)},Ase=xx,Nse=_se,Rse=function(t){if(!Ase(t))throw new Error("Value must be a finite number");var r=Nse(t.toExponential()),n=r[0],o=parseInt(r[1],10),i=(n.split(".")[1]||"").length;return!i&&o>0?0:i+-1*o};(function(e,t){var r=Tse,n=Rse;e.exports=i;var o={down:"floor",up:"ceil"};function i(s,a,l){if(a=a||1,l){if(!o.hasOwnProperty(l))throw new Error("invalid direction");var c=o[l];return r(Math[c](s/a)*a,n(a))}var u=i(s,a,"down"),d=i(s,a,"up");return s-u{for(var o=n>1?void 0:n?Ise(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Lse(t,r,o),o},Dse={icon:"fontSize",description:({t:e})=>e(Al.SET_DESCRIPTION),label:({t:e})=>e(Al.SET_LABEL)},$se={icon:"addLine",description:({t:e})=>e(Al.INCREASE_DESCRIPTION),label:({t:e})=>e(Al.INCREASE_LABEL)},Hse={icon:"subtractLine",description:({t:e})=>e(Al.DECREASE_DESCRIPTION),label:({t:e})=>e(Al.DECREASE_LABEL)},m1="data-font-size-mark",co=class extends li{get name(){return"fontSize"}createTags(){return[oe.FormattingMark,oe.FontStyle]}createMarkSpec(e,t){return{...t,attrs:{...e.defaults(),size:{default:this.options.defaultSize}},parseDOM:[{tag:`span[${m1}]`,getAttrs:r=>{if(!Je(r))return null;let n=r.getAttribute(m1);return n?(n=`${bg(n,this.options.unit,r)}${this.options.unit}`,{...e.parse(r),size:n}):null}},{style:"font-size",priority:Ae.Low,getAttrs:r=>ne(r)?(r=this.getFontSize(r),{size:r}):null},...t.parseDOM??[]],toDOM:r=>{const{size:n,...o}=$d(r.attrs,e),i=e.dom(r);let s=i.style,a;return n&&(s=qv({fontSize:this.getFontSize(n)},s)),["span",{...o,...i,style:s,[m1]:a},0]}}}getFontSize(e){var t;const{unit:r,roundingMultiple:n,max:o,min:i,defaultSize:s}=this.options,a=bg(e,r,(t=this.store.view)==null?void 0:t.dom);return Number.isNaN(a)?s||"1rem":`${Ad({value:zse(a,n),max:o,min:i})}${r}`}setFontSize(e,t){return this.store.commands.applyMark.original(this.type,{size:String(e)},t==null?void 0:t.selection)}increaseFontSize(e){const{increment:t}=this.options;return r=>{const[n]=this.getFontSizeForSelection(e==null?void 0:e.selection);let[o]=n;return o+=_e(t)?t(n,1):t,this.setFontSize(o,e)(r)}}decreaseFontSize(e){const{increment:t}=this.options;return r=>{const[n]=this.getFontSizeForSelection(e==null?void 0:e.selection);let[o]=n;return o-=_e(t)?t(n,-1):t,this.setFontSize(o,e)(r)}}removeFontSize(e){return this.store.commands.removeMark.original({type:this.type,expand:!1,...e})}increaseFontSizeShortcut(e){return this.increaseFontSize()(e)}decreaseFontSizeShortcut(e){return this.decreaseFontSize()(e)}getFontSizeForSelection(e){const t=this.store.getState(),r=jr(e??t.selection,t.doc),[n,...o]=yz(r,this.type);if(n)return[$f(n.mark.attrs.size),...o.map(l=>$f(l.mark.attrs.size))];const{defaultSize:i,unit:s}=this.options;return[[bg(i,s),s]]}getFontSizeFromDom(e){const t=this.store.getState(),r=jr(e??t.selection,t.doc),n=this.store.view.domAtPos(r.from),o=Je(n.node)?n.node:this.store.view.dom;return $f(Pl(o))}};hi([U(Dse)],co.prototype,"setFontSize",1);hi([U($se)],co.prototype,"increaseFontSize",1);hi([U(Hse)],co.prototype,"decreaseFontSize",1);hi([U()],co.prototype,"removeFontSize",1);hi([je({shortcut:D.IncreaseFontSize,command:"increaseFontSize"})],co.prototype,"increaseFontSizeShortcut",1);hi([je({shortcut:D.IncreaseFontSize,command:"decreaseFontSize"})],co.prototype,"decreaseFontSizeShortcut",1);hi([He()],co.prototype,"getFontSizeForSelection",1);hi([He()],co.prototype,"getFontSizeFromDom",1);co=hi([pe({defaultOptions:{defaultSize:"",unit:"pt",increment:1,max:100,min:1,roundingMultiple:.5},staticKeys:["defaultSize"]})],co);var Bse=Object.defineProperty,Fse=Object.getOwnPropertyDescriptor,bO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Fse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Bse(t,r,o),o},kh=class extends er{get name(){return"hardBreak"}createTags(){return[oe.InlineNode]}createNodeSpec(e,t){return{inline:!0,selectable:!1,atom:!0,leafText:()=>` +`,...t,attrs:e.defaults(),parseDOM:[{tag:"br",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["br",e.dom(r)]}}createKeymap(){const e=G6(bu(KC),()=>(this.store.commands.insertHardBreak(),!0));return{"Mod-Enter":e,"Shift-Enter":e}}insertHardBreak(){return e=>{const{tr:t,dispatch:r}=e;return r==null||r(t.replaceSelectionWith(this.type.create()).scrollIntoView()),!0}}};bO([U()],kh.prototype,"insertHardBreak",1);kh=bO([pe({defaultPriority:Ae.Low})],kh);var Vse=Object.defineProperty,jse=Object.getOwnPropertyDescriptor,xO=(e,t,r,n)=>{for(var o=n>1?void 0:n?jse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Vse(t,r,o),o},{LABEL:Use}=hR,Wse={icon:({attrs:e})=>`h${(e==null?void 0:e.level)??"1"}`,label:({t:e,attrs:t})=>e({...Use,values:{level:t==null?void 0:t.level}})},Kse=[D.H1,D.H2,D.H3,D.H4,D.H5,D.H6],wh=class extends er{get name(){return"heading"}createTags(){return[oe.Block,oe.TextBlock,oe.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),level:{default:this.options.defaultLevel}},parseDOM:[...this.options.levels.map(r=>({tag:`h${r}`,getAttrs:n=>({...e.parse(n),level:r})})),...t.parseDOM??[]],toDOM:r=>this.options.levels.includes(r.attrs.level)?[`h${r.attrs.level}`,e.dom(r),0]:[`h${this.options.defaultLevel}`,e.dom(r),0]}}toggleHeading(e={}){return Gv({type:this.type,toggleType:"paragraph",attrs:e})}createKeymap(e){const t=this.store.getExtension(xe),r=ee(),n=[];for(const o of this.options.levels){const i=Kse[o-1]??D.H1;r[i]=Fu(this.type,{level:o}),n.push({attrs:{level:o},shortcut:e(i)[0]})}return t.updateDecorated("toggleHeading",{shortcut:n}),r}createInputRules(){return this.options.levels.map(e=>UR(new RegExp(`^(#{1,${e}})\\s$`),this.type,()=>({level:e})))}createPasteRules(){return this.options.levels.map(e=>({type:"node",nodeType:this.type,regexp:new RegExp(`^#{${e}}\\s([\\s\\w]+)$`),getAttributes:()=>({level:e}),startOfTextBlock:!0}))}};xO([U(Wse)],wh.prototype,"toggleHeading",1);wh=xO([pe({defaultOptions:{levels:[1,2,3,4,5,6],defaultLevel:1},staticKeys:["defaultLevel","levels"]})],wh);var qse=Object.defineProperty,Gse=Object.getOwnPropertyDescriptor,kO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Gse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&qse(t,r,o),o},Yse={icon:"separator",label:({t:e})=>e(vk.LABEL),description:({t:e})=>e(vk.DESCRIPTION)},Sh=class extends er{get name(){return"horizontalRule"}createTags(){return[oe.Block]}createNodeSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"hr",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["hr",e.dom(r)]}}insertHorizontalRule(){return e=>{const{tr:t,dispatch:r}=e,n=t.selection.$anchor,o=n.parent;return o.type.name==="doc"||o.isAtom||o.isLeaf?!1:(r&&(t.selection.empty&&Bh(o)&&t.insert(n.pos+1,o),t.replaceSelectionWith(this.type.create()),this.updateFromNodeSelection(t),r(t.scrollIntoView())),!0)}}createInputRules(){return[BC({regexp:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type,beforeDispatch:({tr:e})=>{this.updateFromNodeSelection(e)}})]}updateFromNodeSelection(e){if(!Dd(e.selection)||e.selection.node.type.name!==this.name)return;const t=e.selection.$from.pos+1,{insertionNode:r}=this.options;if(!r)return;const n=this.store.schema.nodes[r];te(n,{code:H.EXTENSION,message:`'${r}' node provided as the insertionNode to the '${this.constructorName}' does not exist.`});const o=n.create();e.insert(t,o),e.setSelection(le.near(e.doc.resolve(t+1)))}};kO([U(Yse)],Sh.prototype,"insertHorizontalRule",1);Sh=kO([pe({defaultOptions:{insertionNode:"paragraph"}})],Sh);var Jse=Object.defineProperty,Xse=Object.getOwnPropertyDescriptor,kx=(e,t,r,n)=>{for(var o=n>1?void 0:n?Xse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Jse(t,r,o),o},Qse=class extends yse{constructor(e,t,r){super({node:e,view:t,getPos:r,aspectRatio:vO.Fixed})}createElement({node:e}){const t=document.createElement("img");return t.setAttribute("src",e.attrs.src),ar(t,{width:"100%",minWidth:"50px",objectFit:"contain"}),t}},wd=class extends er{get name(){return"image"}createTags(){return[oe.InlineNode,oe.Media]}createNodeSpec(e,t){const{preferPastedTextContent:r}=this.options;return{inline:!0,draggable:!0,selectable:!1,...t,attrs:{...e.defaults(),alt:{default:""},crop:{default:null},height:{default:null},width:{default:null},rotate:{default:null},src:{default:null},title:{default:""},fileName:{default:null},resizable:{default:!1}},parseDOM:[{tag:"img[src]",getAttrs:n=>{var o;if(Je(n)){const i=eae({element:n,parse:e.parse});return r&&((o=i.src)!=null&&o.startsWith("file:///"))?!1:i}return{}}},...t.parseDOM??[]],toDOM:n=>{const o=$d(n.attrs,e);return["img",{...e.dom(n),...o}]}}}insertImage(e,t){return({tr:r,dispatch:n})=>{const{from:o,to:i}=jr(t??r.selection,r.doc),s=this.type.create(e);return n==null||n(r.replaceRangeWith(o,i,s)),!0}}uploadImage(e,t){const{updatePlaceholder:r,destroyPlaceholder:n,createPlaceholder:o}=this.options;return i=>{const{tr:s}=i;let a=s.selection.from;return this.store.createPlaceholderCommand({promise:e,placeholder:{type:"widget",get pos(){return a},createElement:(l,c)=>{const u=o(l,c);return t==null||t(u),u},onUpdate:(l,c,u,d)=>{r(l,c,u,d)},onDestroy:(l,c)=>{n(l,c)}},onSuccess:(l,c,u)=>this.insertImage(l,c)(u)}).validate(({tr:l,dispatch:c})=>{const u=EE(l.doc,a,this.type);return u==null?!1:(a=u,l.selection.empty||c==null||c(l.deleteSelection()),!0)},"unshift").generateCommand()(i)}}fileUploadFileHandler(e,t,r){var n;const{preferPastedTextContent:o,uploadHandler:i}=this.options;if(o&&nae(t)&&((n=t.clipboardData)!=null&&n.getData("text/plain")))return!1;const{commands:s,chain:a}=this.store,l=e.map((u,d)=>({file:u,progress:f=>{s.updatePlaceholder(c[d],f)}})),c=i(l);Jt(r)&&a.selectText(r);for(const u of c)a.uploadImage(u);return a.run(),!0}createPasteRules(){return[{type:"file",regexp:/image/i,fileHandler:e=>{const t=e.type==="drop"?e.pos:void 0;return this.fileUploadFileHandler(e.files,e.event,t)}}]}createNodeViews(){return this.options.enableResizing?(e,t,r)=>new Qse(e,t,r):{}}};kx([U()],wd.prototype,"insertImage",1);kx([U()],wd.prototype,"uploadImage",1);wd=kx([pe({defaultOptions:{createPlaceholder:tae,updatePlaceholder:()=>{},destroyPlaceholder:()=>{},uploadHandler:rae,enableResizing:!1,preferPastedTextContent:!0}})],wd);function Zse(e){let{width:t,height:r}=e.style;return t=t||e.getAttribute("width")||"",r=r||e.getAttribute("height")||"",{width:t,height:r}}function eae({element:e,parse:t}){const{width:r,height:n}=Zse(e);return{...t(e),alt:e.getAttribute("alt")??"",height:Number.parseInt(n||"0",10)||null,src:e.getAttribute("src")??null,title:e.getAttribute("title")??"",width:Number.parseInt(r||"0",10)||null,fileName:e.getAttribute("data-file-name")??null}}function tae(e,t){const r=document.createElement("div");return r.classList.add(cV.IMAGE_LOADER),r}function rae(e){te(e.length>0,{code:H.EXTENSION,message:"The upload handler was applied for the image extension without any valid files"});let t=0;const r=[];for(const{file:n,progress:o}of e)r.push(()=>new Promise(i=>{const s=new FileReader;s.addEventListener("load",a=>{var l;t+=1,o(t/e.length),i({src:(l=a.target)==null?void 0:l.result,fileName:n.name})},{once:!0}),s.readAsDataURL(n)}));return r}function nae(e){return e.clipboardData!==void 0}var oae=Object.defineProperty,iae=Object.getOwnPropertyDescriptor,wx=(e,t,r,n)=>{for(var o=n>1?void 0:n?iae(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&oae(t,r,o),o},sae={icon:"italic",label:({t:e})=>e(yk.LABEL),description:({t:e})=>e(yk.DESCRIPTION)},Sd=class extends li{get name(){return"italic"}createTags(){return[oe.FontStyle,oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"i",getAttrs:e.parse},{tag:"em",getAttrs:e.parse},{style:"font-style=italic"},...t.parseDOM??[]],toDOM:r=>["em",e.dom(r),0]}}createKeymap(){return{"Mod-i":ns({type:this.type})}}createInputRules(){return[Vu({regexp:/(?:^|[^*])\*([^*]+)\*$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:t+1}}),Vu({regexp:/(?:^|\W)_([^_]+)_$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:t+1}})]}createPasteRules(){return[{type:"mark",markType:this.type,regexp:/(?:^|\W)_([^_]+)_/g},{type:"mark",markType:this.type,regexp:/\*([^*]+)\*/g}]}toggleItalic(e){return ns({type:this.type,selection:e})}shortcut(e){return this.toggleItalic()(e)}};wx([U(sae)],Sd.prototype,"toggleItalic",1);wx([je({shortcut:D.Italic,command:"toggleItalic"})],Sd.prototype,"shortcut",1);Sd=wx([pe({})],Sd);var wO={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(typeof self<"u"?self:Pu,function(){return function(r){function n(i){if(o[i])return o[i].exports;var s=o[i]={i,l:!1,exports:{}};return r[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}var o={};return n.m=r,n.c=o,n.d=function(i,s,a){n.o(i,s)||Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:a})},n.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(s,"a",s),s},n.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},n.p="",n(n.s=0)}([function(r,n,o){function i(){throw new TypeError("The given URL is not a string. Please verify your string|array.")}function s(c){typeof c!="string"&&i();for(var u=0,d=0,f=0,p=c.length,h=0;p--&&++h&&!(u&&-1f?"":c.slice(f,u)}var a=["/",":","?","#"],l=[".","/","@"];r.exports=function(c){if(typeof c=="string")return s(c);if(Array.isArray(c)){var u=[],d,f=0;for(d=c.length;f{for(var o=n>1?void 0:n?uae(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&cae(t,r,o),o},dae=["com","de","net","org","uk","cn","ga","nl","cf","ml","tk","ru","br","gq","xyz","fr","eu","info","co","au","ca","it","in","ch","pl","es","online","us","top","be","jp","biz","se","at","dk","cz","za","me","ir","icu","shop","kr","site","mx","hu","io","cc","club","no","cyou"],a4="updateLink",fae=/(?:(?:(?:https?|ftp):)?\/\/)?(?:\S+(?::\S*)?@)?(?:(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)*(?:(?:\d(?!\.)|[a-z\u00A1-\uFFFF])(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)+[a-z\u00A1-\uFFFF]{2,}(?::\d{2,5})?(?:[#/?]\S*)?/gi,us=class extends li{constructor(){super(...arguments),this._autoLinkRegexNonGlobal=void 0}get name(){return"link"}createTags(){return[oe.Link,oe.ExcludeInputRules]}createMarkSpec(e,t){const r="data-link-auto",n=o=>{const{defaultTarget:i,supportedTargets:s}=this.options,a=i?[...s,i]:s;return o&&fr(a,o)?{target:o}:void 0};return{inclusive:!1,excludes:"_",...t,attrs:{...e.defaults(),href:{},target:{default:this.options.defaultTarget},auto:{default:!1}},parseDOM:[{tag:"a[href]",getAttrs:o=>{if(!Je(o))return!1;const i=o.getAttribute("href"),s=o.textContent,a=this.options.autoLink&&(o.hasAttribute(r)||i===s||(i==null?void 0:i.replace(`${this.options.defaultProtocol}//`,""))===s);return{...e.parse(o),href:i,auto:a,...n(o.getAttribute("target"))}}},...t.parseDOM??[]],toDOM:o=>{const{auto:i,target:s,...a}=$d(o.attrs,e),l=o.attrs.auto?{[r]:""}:{},c="noopener noreferrer nofollow";return["a",{...e.dom(o),...a,rel:c,...l,...n(o.attrs.target)},0]}}}onCreate(){const{autoLinkRegex:e}=this.options;this._autoLinkRegexNonGlobal=new RegExp(`^${e.source}$`,e.flags.replace("g",""))}shortcut({tr:e}){let t="",{from:r,to:n,empty:o,$from:i}=e.selection,s=!1;const a=_o(i,this.type);if(o){const l=a??_C(e);if(!l)return!1;({text:t,from:r,to:n}=l),s=!0}return r===n?!1:(s||(t=e.doc.textBetween(r,n)),this.options.onActivateLink(t),this.options.onShortcut({activeLink:a?{attrs:a.mark.attrs,from:a.from,to:a.to}:void 0,selectedText:t,from:r,to:n}),!0)}updateLink(e,t){return r=>{const{tr:n}=r;return!(gs(n.selection)&&!jv(n.selection)||hz(n.selection)||Rp({trState:n,type:this.type}))&&!t?!1:(n.setMeta(this.name,{command:a4,attrs:e,range:t}),Pz({type:this.type,attrs:e,range:t})(r))}}selectLink(){return this.store.commands.selectMark.original(this.type)}removeLink(e){return t=>{const{tr:r}=t;return Rp({trState:r,type:this.type,...e})?HC({type:this.type,expand:!0,range:e})(t):!1}}createPasteRules(){return[{type:"mark",regexp:this.options.autoLinkRegex,markType:this.type,getAttributes:(e,t)=>({href:this.buildHref(Zo(e)),auto:!t}),transformMatch:e=>{const t=Zo(e);return!t||!this.isValidUrl(t)?!1:t}}]}createEventHandlers(){return{clickMark:(e,t)=>{const r=t.getMark(this.type);if(!r)return;const n=r.mark.attrs,o={...n,...r};if(this.options.onClick(e,o))return!0;if(!this.store.view.editable)return;let i=!1;if(this.options.openLinkOnClick){i=!0;const s=n.href;window.open(s,"_blank")}return this.options.selectTextOnClick&&(i=!0,this.store.commands.selectText(r)),i}}}createPlugin(){return{appendTransaction:(e,t,r)=>{if(e.filter(p=>!!p.getMeta(this.name)).forEach(p=>{const h=p.getMeta(this.name);if(h.command===a4){const{range:m,attrs:b}=h,{selection:v,doc:g}=r,y={range:m,selection:v,doc:g,attrs:b},{from:x,to:k}=m??v;this.options.onUpdateLink(g.textBetween(x,k),y)}}),!this.options.autoLink||W0(t)-W0(r)===1||!e.some(p=>p.docChanged))return;const s=Z6(e,t),a=OC(s,[bt,Dt]),{mapping:l}=s,{tr:c,doc:u}=r,{updateLink:d,removeLink:f}=this.store.chain(c);if(a.forEach(({prevFrom:p,prevTo:h,from:m,to:b})=>{const v=[],g=b-m===2,y=this.getLinkMarksInRange(t.doc,p,h,!0).filter(x=>x.mark.type===this.type).map(({from:x,to:k,text:w})=>({mappedFrom:l.map(x),mappedTo:l.map(k),text:w,from:x,to:k}));y.forEach(({mappedFrom:x,mappedTo:k,from:w,to:E},T)=>this.getLinkMarksInRange(u,x,k,!0).filter(C=>C.mark.type===this.type).forEach(C=>{const M=t.doc.textBetween(w,E,void 0," "),N=u.textBetween(C.from,C.to+1,void 0," ").trim(),F=this.isValidUrl(M);this.isValidUrl(N)||(F&&(f({from:C.from,to:C.to}).tr(),y.splice(T,1)),!g&&m===b&&this.findAutoLinks(N).map(V=>this.addLinkProperties({...V,from:x+V.start,to:x+V.end})).forEach(({attrs:V,range:j,text:z})=>{d(V,j).tr(),v.push({attrs:V,range:j,text:z})}))})),this.findTextBlocksInRange(u,{from:m,to:b}).forEach(({text:x,positionStart:k})=>{this.findAutoLinks(x).map(w=>this.addLinkProperties({...w,from:k+w.start+1,to:k+w.end+1})).filter(({range:w})=>{const E=m>=w.from&&m<=w.to,T=b>=w.from&&b<=w.to;return E||T||g}).filter(({range:w})=>this.getLinkMarksInRange(c.doc,w.from,w.to,!1).length===0).filter(({range:{from:w},text:E})=>!y.some(({text:T,mappedFrom:C})=>C===w&&T===E)).forEach(({attrs:w,text:E,range:T})=>{d(w,T).tr(),v.push({attrs:w,range:T,text:E})})}),window.requestAnimationFrame(()=>{v.forEach(({attrs:x,range:k,text:w})=>{const{doc:E,selection:T}=c;this.options.onUpdateLink(w,{attrs:x,doc:E,range:k,selection:T})})})}),c.steps.length!==0)return c}}}buildHref(e){return this.options.extractHref({url:e,defaultProtocol:this.options.defaultProtocol})}getLinkMarksInRange(e,t,r,n){const o=[];if(t===r){const i=Math.max(t-1,0),s=e.resolve(i),a=_o(s,this.type);(a==null?void 0:a.mark.attrs.auto)===n&&o.push(a)}else e.nodesBetween(t,r,(i,s)=>{const l=(i.marks??[]).find(({type:c,attrs:u})=>c===this.type&&u.auto===n);l&&o.push({from:s,to:s+i.nodeSize,mark:l,text:i.textContent})});return o}findTextBlocksInRange(e,t){const r=[];return e.nodesBetween(t.from,t.to,(n,o)=>{!n.isTextblock||!n.type.allowsMarkType(this.type)||r.push({node:n,pos:o})}),r.map(n=>({text:e.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," "),positionStart:n.pos}))}addLinkProperties({from:e,to:t,href:r,...n}){return{...n,range:{from:e,to:t},attrs:{href:r,auto:!0}}}findAutoLinks(e){if(this.options.findAutoLinks)return this.options.findAutoLinks(e,this.options.defaultProtocol);const t=[];for(const r of xa(e,this.options.autoLinkRegex)){const n=Zo(r);if(!n)continue;const o=this.buildHref(n);!this.isValidTLD(o)&&!o.startsWith("tel:")||t.push({text:n,href:o,start:r.index,end:r.index+n.length})}return t}isValidUrl(e){var t;return this.options.isValidUrl?this.options.isValidUrl(e,this.options.defaultProtocol):this.isValidTLD(this.buildHref(e))&&!!((t=this._autoLinkRegexNonGlobal)!=null&&t.test(e))}isValidTLD(e){const{autoLinkAllowedTLDs:t}=this.options;if(t.length===0)return!0;const r=lae(e);if(r==="")return!0;const n=Q4(r.split("."));return t.includes(n)}};Zd([je({shortcut:D.InsertLink})],us.prototype,"shortcut",1);Zd([U()],us.prototype,"updateLink",1);Zd([U()],us.prototype,"selectLink",1);Zd([U()],us.prototype,"removeLink",1);us=Zd([pe({defaultOptions:{autoLink:!1,defaultProtocol:"",selectTextOnClick:!1,openLinkOnClick:!1,autoLinkRegex:fae,autoLinkAllowedTLDs:dae,findAutoLinks:void 0,isValidUrl:void 0,defaultTarget:null,supportedTargets:[],extractHref:pae},staticKeys:["autoLinkRegex"],handlerKeyOptions:{onClick:{earlyReturnValue:!0}},handlerKeys:["onActivateLink","onShortcut","onUpdateLink","onClick"],defaultPriority:Ae.Medium})],us);function pae({url:e,defaultProtocol:t}){const r=/^((?:https?|ftp)?:)\/\//.test(e);return!r&&e.includes("@")?`mailto:${e}`:r?e:`${t}//${e}`}function hae(e){for(var t=1;t0&&e[t-1]===` +`;)t--;return e.substring(0,t)}var vae=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function Sx(e){return Ex(e,vae)}var SO=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function EO(e){return Ex(e,SO)}function yae(e){return MO(e,SO)}var CO=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function bae(e){return Ex(e,CO)}function xae(e){return MO(e,CO)}function Ex(e,t){return t.indexOf(e.nodeName)>=0}function MO(e,t){return e.getElementsByTagName&&t.some(function(r){return e.getElementsByTagName(r).length})}var hr={};hr.paragraph={filter:"p",replacement:function(e){return` `+e+` -`}};pr.lineBreak={filter:"br",replacement:function(e,t,r){return r.br+` -`}};pr.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,r){var n=Number(t.nodeName.charAt(1));if(r.headingStyle==="setext"&&n<3){var o=dv(n===1?"=":"-",e.length);return` +`}};hr.lineBreak={filter:"br",replacement:function(e,t,r){return r.br+` +`}};hr.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,r){var n=Number(t.nodeName.charAt(1));if(r.headingStyle==="setext"&&n<3){var o=hv(n===1?"=":"-",e.length);return` `+e+` `+o+` `}else return` -`+dv("#",n)+" "+e+` +`+hv("#",n)+" "+e+` -`}};pr.blockquote={filter:"blockquote",replacement:function(e){return e=e.replace(/^\n+|\n+$/g,""),e=e.replace(/^/gm,"> "),` +`}};hr.blockquote={filter:"blockquote",replacement:function(e){return e=e.replace(/^\n+|\n+$/g,""),e=e.replace(/^/gm,"> "),` `+e+` -`}};pr.list={filter:["ul","ol"],replacement:function(e,t){var r=t.parentNode;return r.nodeName==="LI"&&r.lastElementChild===t?` +`}};hr.list={filter:["ul","ol"],replacement:function(e,t){var r=t.parentNode;return r.nodeName==="LI"&&r.lastElementChild===t?` `+e:` `+e+` -`}};pr.listItem={filter:"li",replacement:function(e,t,r){e=e.replace(/^\n+/,"").replace(/\n+$/,` +`}};hr.listItem={filter:"li",replacement:function(e,t,r){e=e.replace(/^\n+/,"").replace(/\n+$/,` `).replace(/\n/gm,` `);var n=r.bulletListMarker+" ",o=t.parentNode;if(o.nodeName==="OL"){var i=o.getAttribute("start"),s=Array.prototype.indexOf.call(o.children,t);n=(i?Number(i)+s:s+1)+". "}return n+e+(t.nextSibling&&!/\n$/.test(e)?` -`:"")}};pr.indentedCodeBlock={filter:function(e,t){return t.codeBlockStyle==="indented"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,t,r){return` +`:"")}};hr.indentedCodeBlock={filter:function(e,t){return t.codeBlockStyle==="indented"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,t,r){return` `+t.firstChild.textContent.replace(/\n/g,` `)+` -`}};pr.fencedCodeBlock={filter:function(e,t){return t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,t,r){for(var n=t.firstChild.getAttribute("class")||"",o=(n.match(/language-(\S+)/)||[null,""])[1],i=t.firstChild.textContent,s=r.fence.charAt(0),a=3,l=new RegExp("^"+s+"{3,}","gm"),c;c=l.exec(i);)c[0].length>=a&&(a=c[0].length+1);var u=dv(s,a);return` +`}};hr.fencedCodeBlock={filter:function(e,t){return t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,t,r){for(var n=t.firstChild.getAttribute("class")||"",o=(n.match(/language-(\S+)/)||[null,""])[1],i=t.firstChild.textContent,s=r.fence.charAt(0),a=3,l=new RegExp("^"+s+"{3,}","gm"),c;c=l.exec(i);)c[0].length>=a&&(a=c[0].length+1);var u=hv(s,a);return` `+u+o+` `+i.replace(/\n$/,"")+` `+u+` -`}};pr.horizontalRule={filter:"hr",replacement:function(e,t,r){return` +`}};hr.horizontalRule={filter:"hr",replacement:function(e,t,r){return` `+r.hr+` -`}};pr.inlineLink={filter:function(e,t){return t.linkStyle==="inlined"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t){var r=t.getAttribute("href"),n=wh(t.getAttribute("title"));return n&&(n=' "'+n+'"'),"["+e+"]("+r+n+")"}};pr.referenceLink={filter:function(e,t){return t.linkStyle==="referenced"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t,r){var n=t.getAttribute("href"),o=wh(t.getAttribute("title"));o&&(o=' "'+o+'"');var i,s;switch(r.linkReferenceStyle){case"collapsed":i="["+e+"][]",s="["+e+"]: "+n+o;break;case"shortcut":i="["+e+"]",s="["+e+"]: "+n+o;break;default:var a=this.references.length+1;i="["+e+"]["+a+"]",s="["+a+"]: "+n+o}return this.references.push(s),i},references:[],append:function(e){var t="";return this.references.length&&(t=` +`}};hr.inlineLink={filter:function(e,t){return t.linkStyle==="inlined"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t){var r=t.getAttribute("href"),n=Eh(t.getAttribute("title"));return n&&(n=' "'+n+'"'),"["+e+"]("+r+n+")"}};hr.referenceLink={filter:function(e,t){return t.linkStyle==="referenced"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t,r){var n=t.getAttribute("href"),o=Eh(t.getAttribute("title"));o&&(o=' "'+o+'"');var i,s;switch(r.linkReferenceStyle){case"collapsed":i="["+e+"][]",s="["+e+"]: "+n+o;break;case"shortcut":i="["+e+"]",s="["+e+"]: "+n+o;break;default:var a=this.references.length+1;i="["+e+"]["+a+"]",s="["+a+"]: "+n+o}return this.references.push(s),i},references:[],append:function(e){var t="";return this.references.length&&(t=` `+this.references.join(` `)+` -`,this.references=[]),t}};pr.emphasis={filter:["em","i"],replacement:function(e,t,r){return e.trim()?r.emDelimiter+e+r.emDelimiter:""}};pr.strong={filter:["strong","b"],replacement:function(e,t,r){return e.trim()?r.strongDelimiter+e+r.strongDelimiter:""}};pr.code={filter:function(e){var t=e.previousSibling||e.nextSibling,r=e.parentNode.nodeName==="PRE"&&!t;return e.nodeName==="CODE"&&!r},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",r="`",n=e.match(/`+/gm)||[];n.indexOf(r)!==-1;)r=r+"`";return r+t+e+t+r}};pr.image={filter:"img",replacement:function(e,t){var r=wh(t.getAttribute("alt")),n=t.getAttribute("src")||"",o=wh(t.getAttribute("title")),i=o?' "'+o+'"':"";return n?"!["+r+"]("+n+i+")":""}};function wh(e){return e?e.replace(/(\n+\s*)+/g,` -`):""}function wO(e){this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[];for(var t in e.rules)this.array.push(e.rules[t])}wO.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){if(e.isBlank)return this.blankRule;var t;return(t=p1(this.array,e,this.options))||(t=p1(this._keep,e,this.options))||(t=p1(this._remove,e,this.options))?t:this.defaultRule},forEach:function(e){for(var t=0;t-1)return!0}else if(typeof n=="function"){if(n.call(e,t,r))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function vae(e){var t=e.element,r=e.isBlock,n=e.isVoid,o=e.isPre||function(d){return d.nodeName==="PRE"};if(!(!t.firstChild||o(t))){for(var i=null,s=!1,a=null,l=i4(a,t,o);l!==t;){if(l.nodeType===3||l.nodeType===4){var c=l.data.replace(/[ \r\n\t]+/g," ");if((!i||/ $/.test(i.data))&&!s&&c[0]===" "&&(c=c.substr(1)),!c){l=h1(l);continue}l.data=c,i=l}else if(l.nodeType===1)r(l)||l.nodeName==="BR"?(i&&(i.data=i.data.replace(/ $/,"")),i=null,s=!1):n(l)||o(l)?(i=null,s=!0):i&&(s=!1);else{l=h1(l);continue}var u=i4(a,l,o);a=l,l=u}i&&(i.data=i.data.replace(/ $/,""),i.data||h1(i))}}function h1(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function i4(e,t,r){return e&&e.parentNode===t||r(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}var SO=typeof window<"u"?window:{};function yae(){var e=SO.DOMParser,t=!1;try{new e().parseFromString("","text/html")&&(t=!0)}catch{}return t}function bae(){var e=function(){};return xae()?e.prototype.parseFromString=function(t){var r=new window.ActiveXObject("htmlfile");return r.designMode="on",r.open(),r.write(t),r.close(),r}:e.prototype.parseFromString=function(t){var r=document.implementation.createHTMLDocument("");return r.open(),r.write(t),r.close(),r},e}function xae(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch{window.ActiveXObject&&(e=!0)}return e}var kae=yae()?SO.DOMParser:bae();function wae(e,t){var r;if(typeof e=="string"){var n=Sae().parseFromString(''+e+"","text/html");r=n.getElementById("turndown-root")}else r=e.cloneNode(!0);return vae({element:r,isBlock:xx,isVoid:bO,isPre:t.preformattedCode?Eae:null}),r}var m1;function Sae(){return m1=m1||new kae,m1}function Eae(e){return e.nodeName==="PRE"||e.nodeName==="CODE"}function Cae(e,t){return e.isBlock=xx(e),e.isCode=e.nodeName==="CODE"||e.parentNode.isCode,e.isBlank=Mae(e),e.flankingWhitespace=Tae(e,t),e}function Mae(e){return!bO(e)&&!hae(e)&&/^\s*$/i.test(e.textContent)&&!pae(e)&&!mae(e)}function Tae(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var r=Oae(e.textContent);return r.leadingAscii&&s4("left",e,t)&&(r.leading=r.leadingNonAscii),r.trailingAscii&&s4("right",e,t)&&(r.trailing=r.trailingNonAscii),{leading:r.leading,trailing:r.trailing}}function Oae(e){var t=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:t[1],leadingAscii:t[2],leadingNonAscii:t[3],trailing:t[4],trailingNonAscii:t[5],trailingAscii:t[6]}}function s4(e,t,r){var n,o,i;return e==="left"?(n=t.previousSibling,o=/ $/):(n=t.nextSibling,o=/^ /),n&&(n.nodeType===3?i=o.test(n.nodeValue):r.preformattedCode&&n.nodeName==="CODE"?i=!1:n.nodeType===1&&!xx(n)&&(i=o.test(n.textContent))),i}var _ae=Array.prototype.reduce,Aae=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Sd(e){if(!(this instanceof Sd))return new Sd(e);var t={rules:pr,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(r,n){return n.isBlock?` +`,this.references=[]),t}};hr.emphasis={filter:["em","i"],replacement:function(e,t,r){return e.trim()?r.emDelimiter+e+r.emDelimiter:""}};hr.strong={filter:["strong","b"],replacement:function(e,t,r){return e.trim()?r.strongDelimiter+e+r.strongDelimiter:""}};hr.code={filter:function(e){var t=e.previousSibling||e.nextSibling,r=e.parentNode.nodeName==="PRE"&&!t;return e.nodeName==="CODE"&&!r},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",r="`",n=e.match(/`+/gm)||[];n.indexOf(r)!==-1;)r=r+"`";return r+t+e+t+r}};hr.image={filter:"img",replacement:function(e,t){var r=Eh(t.getAttribute("alt")),n=t.getAttribute("src")||"",o=Eh(t.getAttribute("title")),i=o?' "'+o+'"':"";return n?"!["+r+"]("+n+i+")":""}};function Eh(e){return e?e.replace(/(\n+\s*)+/g,` +`):""}function TO(e){this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[];for(var t in e.rules)this.array.push(e.rules[t])}TO.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){if(e.isBlank)return this.blankRule;var t;return(t=g1(this.array,e,this.options))||(t=g1(this._keep,e,this.options))||(t=g1(this._remove,e,this.options))?t:this.defaultRule},forEach:function(e){for(var t=0;t-1)return!0}else if(typeof n=="function"){if(n.call(e,t,r))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function wae(e){var t=e.element,r=e.isBlock,n=e.isVoid,o=e.isPre||function(d){return d.nodeName==="PRE"};if(!(!t.firstChild||o(t))){for(var i=null,s=!1,a=null,l=l4(a,t,o);l!==t;){if(l.nodeType===3||l.nodeType===4){var c=l.data.replace(/[ \r\n\t]+/g," ");if((!i||/ $/.test(i.data))&&!s&&c[0]===" "&&(c=c.substr(1)),!c){l=v1(l);continue}l.data=c,i=l}else if(l.nodeType===1)r(l)||l.nodeName==="BR"?(i&&(i.data=i.data.replace(/ $/,"")),i=null,s=!1):n(l)||o(l)?(i=null,s=!0):i&&(s=!1);else{l=v1(l);continue}var u=l4(a,l,o);a=l,l=u}i&&(i.data=i.data.replace(/ $/,""),i.data||v1(i))}}function v1(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function l4(e,t,r){return e&&e.parentNode===t||r(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}var OO=typeof window<"u"?window:{};function Sae(){var e=OO.DOMParser,t=!1;try{new e().parseFromString("","text/html")&&(t=!0)}catch{}return t}function Eae(){var e=function(){};return Cae()?e.prototype.parseFromString=function(t){var r=new window.ActiveXObject("htmlfile");return r.designMode="on",r.open(),r.write(t),r.close(),r}:e.prototype.parseFromString=function(t){var r=document.implementation.createHTMLDocument("");return r.open(),r.write(t),r.close(),r},e}function Cae(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch{window.ActiveXObject&&(e=!0)}return e}var Mae=Sae()?OO.DOMParser:Eae();function Tae(e,t){var r;if(typeof e=="string"){var n=Oae().parseFromString(''+e+"","text/html");r=n.getElementById("turndown-root")}else r=e.cloneNode(!0);return wae({element:r,isBlock:Sx,isVoid:EO,isPre:t.preformattedCode?_ae:null}),r}var y1;function Oae(){return y1=y1||new Mae,y1}function _ae(e){return e.nodeName==="PRE"||e.nodeName==="CODE"}function Aae(e,t){return e.isBlock=Sx(e),e.isCode=e.nodeName==="CODE"||e.parentNode.isCode,e.isBlank=Nae(e),e.flankingWhitespace=Rae(e,t),e}function Nae(e){return!EO(e)&&!bae(e)&&/^\s*$/i.test(e.textContent)&&!yae(e)&&!xae(e)}function Rae(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var r=Pae(e.textContent);return r.leadingAscii&&c4("left",e,t)&&(r.leading=r.leadingNonAscii),r.trailingAscii&&c4("right",e,t)&&(r.trailing=r.trailingNonAscii),{leading:r.leading,trailing:r.trailing}}function Pae(e){var t=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:t[1],leadingAscii:t[2],leadingNonAscii:t[3],trailing:t[4],trailingNonAscii:t[5],trailingAscii:t[6]}}function c4(e,t,r){var n,o,i;return e==="left"?(n=t.previousSibling,o=/ $/):(n=t.nextSibling,o=/^ /),n&&(n.nodeType===3?i=o.test(n.nodeValue):r.preformattedCode&&n.nodeName==="CODE"?i=!1:n.nodeType===1&&!Sx(n)&&(i=o.test(n.textContent))),i}var zae=Array.prototype.reduce,Lae=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Ed(e){if(!(this instanceof Ed))return new Ed(e);var t={rules:hr,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(r,n){return n.isBlock?` `:""},keepReplacement:function(r,n){return n.isBlock?` @@ -4928,22 +4928,22 @@ Error generating stack: `+i.message+` `+r+` -`:r}};this.options=cae({},t,e),this.rules=new wO(this.options)}Sd.prototype={turndown:function(e){if(!Pae(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(e==="")return"";var t=EO.call(this,new wae(e,this.options));return Nae.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t"']/,Lae=new RegExp(TO.source,"g"),OO=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Iae=new RegExp(OO.source,"g"),Dae={"&":"&","<":"<",">":">",'"':""","'":"'"},a4=e=>Dae[e];function lr(e,t){if(t){if(TO.test(e))return e.replace(Lae,a4)}else if(OO.test(e))return e.replace(Iae,a4);return e}const $ae=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function _O(e){return e.replace($ae,(t,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}const Hae=/(^|[^\[])\^/g;function We(e,t){e=typeof e=="string"?e:e.source,t=t||"";const r={replace:(n,o)=>(o=o.source||o,o=o.replace(Hae,"$1"),e=e.replace(n,o),r),getRegex:()=>new RegExp(e,t)};return r}const Bae=/[^\w:]/g,Fae=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function l4(e,t,r){if(e){let n;try{n=decodeURIComponent(_O(r)).replace(Bae,"").toLowerCase()}catch{return null}if(n.indexOf("javascript:")===0||n.indexOf("vbscript:")===0||n.indexOf("data:")===0)return null}t&&!Fae.test(r)&&(r=Wae(t,r));try{r=encodeURI(r).replace(/%25/g,"%")}catch{return null}return r}const Nf={},Vae=/^[^:]+:\/*[^/]*$/,jae=/^([^:]+:)[\s\S]*$/,Uae=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Wae(e,t){Nf[" "+e]||(Vae.test(e)?Nf[" "+e]=e+"/":Nf[" "+e]=pp(e,"/",!0)),e=Nf[" "+e];const r=e.indexOf(":")===-1;return t.substring(0,2)==="//"?r?t:e.replace(jae,"$1")+t:t.charAt(0)==="/"?r?t:e.replace(Uae,"$1")+t:e+t}const Sh={exec:function(){}};function c4(e,t){const r=e.replace(/\|/g,(i,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),n=r.split(/ \|/);let o=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length1;)t&1&&(r+=e),t>>=1,e+=e;return r+e}function d4(e,t,r,n){const o=t.href,i=t.title?lr(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){n.state.inLink=!0;const a={type:"link",raw:r,href:o,title:i,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,a}return{type:"image",raw:r,href:o,title:i,text:lr(s)}}function Gae(e,t){const r=e.match(/^(\s+)(?:```)/);if(r===null)return t;const n=r[1];return t.split(` +`.substring(0,o);return r+i+n}function $ae(e){return e!=null&&(typeof e=="string"||e.nodeType&&(e.nodeType===1||e.nodeType===9||e.nodeType===11))}function NO(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Ta=NO();function Hae(e){Ta=e}const RO=/[&<>"']/,Bae=new RegExp(RO.source,"g"),PO=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Fae=new RegExp(PO.source,"g"),Vae={"&":"&","<":"<",">":">",'"':""","'":"'"},u4=e=>Vae[e];function cr(e,t){if(t){if(RO.test(e))return e.replace(Bae,u4)}else if(PO.test(e))return e.replace(Fae,u4);return e}const jae=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function zO(e){return e.replace(jae,(t,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}const Uae=/(^|[^\[])\^/g;function We(e,t){e=typeof e=="string"?e:e.source,t=t||"";const r={replace:(n,o)=>(o=o.source||o,o=o.replace(Uae,"$1"),e=e.replace(n,o),r),getRegex:()=>new RegExp(e,t)};return r}const Wae=/[^\w:]/g,Kae=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function d4(e,t,r){if(e){let n;try{n=decodeURIComponent(zO(r)).replace(Wae,"").toLowerCase()}catch{return null}if(n.indexOf("javascript:")===0||n.indexOf("vbscript:")===0||n.indexOf("data:")===0)return null}t&&!Kae.test(r)&&(r=Jae(t,r));try{r=encodeURI(r).replace(/%25/g,"%")}catch{return null}return r}const Pf={},qae=/^[^:]+:\/*[^/]*$/,Gae=/^([^:]+:)[\s\S]*$/,Yae=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Jae(e,t){Pf[" "+e]||(qae.test(e)?Pf[" "+e]=e+"/":Pf[" "+e]=mp(e,"/",!0)),e=Pf[" "+e];const r=e.indexOf(":")===-1;return t.substring(0,2)==="//"?r?t:e.replace(Gae,"$1")+t:t.charAt(0)==="/"?r?t:e.replace(Yae,"$1")+t:e+t}const Ch={exec:function(){}};function f4(e,t){const r=e.replace(/\|/g,(i,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),n=r.split(/ \|/);let o=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length1;)t&1&&(r+=e),t>>=1,e+=e;return r+e}function h4(e,t,r,n){const o=t.href,i=t.title?cr(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){n.state.inLink=!0;const a={type:"link",raw:r,href:o,title:i,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,a}return{type:"image",raw:r,href:o,title:i,text:cr(s)}}function Zae(e,t){const r=e.match(/^(\s+)(?:```)/);if(r===null)return t;const n=r[1];return t.split(` `).map(o=>{const i=o.match(/^\s+/);if(i===null)return o;const[s]=i;return s.length>=n.length?o.slice(n.length):o}).join(` -`)}class wx{constructor(t){this.options=t||Ta}space(t){const r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){const r=this.rules.block.code.exec(t);if(r){const n=r[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:pp(n,` -`)}}}fences(t){const r=this.rules.block.fences.exec(t);if(r){const n=r[0],o=Gae(n,r[3]||"");return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline._escapes,"$1"):r[2],text:o}}}heading(t){const r=this.rules.block.heading.exec(t);if(r){let n=r[2].trim();if(/#$/.test(n)){const o=pp(n,"#");(this.options.pedantic||!o||/ $/.test(o))&&(n=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:r[0]}}blockquote(t){const r=this.rules.block.blockquote.exec(t);if(r){const n=r[0].replace(/^ *>[ \t]?/gm,""),o=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(n);return this.lexer.state.top=o,{type:"blockquote",raw:r[0],tokens:i,text:n}}}list(t){let r=this.rules.block.list.exec(t);if(r){let n,o,i,s,a,l,c,u,d,f,p,h,m=r[1].trim();const b=m.length>1,v={type:"list",raw:"",ordered:b,start:b?+m.slice(0,-1):"",loose:!1,items:[]};m=b?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=b?m:"[*+-]");const g=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(h=!1,!(!(r=g.exec(t))||this.rules.block.hr.test(t)));){if(n=r[0],t=t.substring(n.length),u=r[2].split(` +`)}class Cx{constructor(t){this.options=t||Ta}space(t){const r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){const r=this.rules.block.code.exec(t);if(r){const n=r[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:mp(n,` +`)}}}fences(t){const r=this.rules.block.fences.exec(t);if(r){const n=r[0],o=Zae(n,r[3]||"");return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline._escapes,"$1"):r[2],text:o}}}heading(t){const r=this.rules.block.heading.exec(t);if(r){let n=r[2].trim();if(/#$/.test(n)){const o=mp(n,"#");(this.options.pedantic||!o||/ $/.test(o))&&(n=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:r[0]}}blockquote(t){const r=this.rules.block.blockquote.exec(t);if(r){const n=r[0].replace(/^ *>[ \t]?/gm,""),o=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(n);return this.lexer.state.top=o,{type:"blockquote",raw:r[0],tokens:i,text:n}}}list(t){let r=this.rules.block.list.exec(t);if(r){let n,o,i,s,a,l,c,u,d,f,p,h,m=r[1].trim();const b=m.length>1,v={type:"list",raw:"",ordered:b,start:b?+m.slice(0,-1):"",loose:!1,items:[]};m=b?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=b?m:"[*+-]");const g=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(h=!1,!(!(r=g.exec(t))||this.rules.block.hr.test(t)));){if(n=r[0],t=t.substring(n.length),u=r[2].split(` `,1)[0].replace(/^\t+/,x=>" ".repeat(3*x.length)),d=t.split(` `,1)[0],this.options.pedantic?(s=2,p=u.trimLeft()):(s=r[2].search(/[^ ]/),s=s>4?1:s,p=u.slice(s),s+=r[1].length),l=!1,!u&&/^ *$/.test(d)&&(n+=d+` `,t=t.substring(d.length+1),h=!0),!h){const x=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),k=new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),w=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),E=new RegExp(`^ {0,${Math.min(3,s-1)}}#`);for(;t&&(f=t.split(` `,1)[0],d=f,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(w.test(d)||E.test(d)||x.test(d)||k.test(t)));){if(d.search(/[^ ]/)>=s||!d.trim())p+=` `+d.slice(s);else{if(l||u.search(/[^ ]/)>=4||w.test(u)||E.test(u)||k.test(u))break;p+=` `+d}!l&&!d.trim()&&(l=!0),n+=f+` -`,t=t.substring(f.length+1),u=d.slice(s)}}v.loose||(c?v.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(o=/^\[[ xX]\] /.exec(p),o&&(i=o[0]!=="[ ] ",p=p.replace(/^\[[ xX]\] +/,""))),v.items.push({type:"list_item",raw:n,task:!!o,checked:i,loose:!1,text:p}),v.raw+=n}v.items[v.items.length-1].raw=n.trimRight(),v.items[v.items.length-1].text=p.trimRight(),v.raw=v.raw.trimRight();const y=v.items.length;for(a=0;aw.type==="space"),k=x.length>0&&x.some(w=>/\n.*\n/.test(w.raw));v.loose=k}if(v.loose)for(a=0;a$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline._escapes,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:o,title:i}}}table(t){const r=this.rules.block.table.exec(t);if(r){const n={type:"table",header:c4(r[1]).map(o=>({text:o})),align:r[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:r[3]&&r[3].trim()?r[3].replace(/\n[ \t]*$/,"").split(` -`):[]};if(n.header.length===n.align.length){n.raw=r[0];let o=n.align.length,i,s,a,l;for(i=0;i({text:c}));for(o=n.header.length,s=0;s/i.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):lr(r[0]):r[0]}}link(t){const r=this.rules.inline.link.exec(t);if(r){const n=r[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;const s=pp(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{const s=Kae(r[2],"()");if(s>-1){const l=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,l).trim(),r[3]=""}}let o=r[2],i="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);s&&(o=s[1],i=s[3])}else i=r[3]?r[3].slice(1,-1):"";return o=o.trim(),/^$/.test(n)?o=o.slice(1):o=o.slice(1,-1)),d4(r,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},r[0],this.lexer)}}reflink(t,r){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let o=(n[2]||n[1]).replace(/\s+/g," ");if(o=r[o.toLowerCase()],!o){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return d4(n,o,n[0],this.lexer)}}emStrong(t,r,n=""){let o=this.rules.inline.emStrong.lDelim.exec(t);if(!o||o[3]&&n.match(/[\p{L}\p{N}]/u))return;const i=o[1]||o[2]||"";if(!i||i&&(n===""||this.rules.inline.punctuation.exec(n))){const s=o[0].length-1;let a,l,c=s,u=0;const d=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,r=r.slice(-1*t.length+s);(o=d.exec(r))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(l=a.length,o[3]||o[4]){c+=l;continue}else if((o[5]||o[6])&&s%3&&!((s+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);const f=t.slice(0,s+o.index+(o[0].length-a.length)+l);if(Math.min(s,l)%2){const h=f.slice(1,-1);return{type:"em",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}const p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){const r=this.rules.inline.code.exec(t);if(r){let n=r[2].replace(/\n/g," ");const o=/[^ ]/.test(n),i=/^ /.test(n)&&/ $/.test(n);return o&&i&&(n=n.substring(1,n.length-1)),n=lr(n,!0),{type:"codespan",raw:r[0],text:n}}}br(t){const r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){const r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t,r){const n=this.rules.inline.autolink.exec(t);if(n){let o,i;return n[2]==="@"?(o=lr(this.options.mangle?r(n[1]):n[1]),i="mailto:"+o):(o=lr(n[1]),i=o),{type:"link",raw:n[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}url(t,r){let n;if(n=this.rules.inline.url.exec(t)){let o,i;if(n[2]==="@")o=lr(this.options.mangle?r(n[0]):n[0]),i="mailto:"+o;else{let s;do s=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(s!==n[0]);o=lr(n[0]),n[1]==="www."?i="http://"+n[0]:i=n[0]}return{type:"link",raw:n[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(t,r){const n=this.rules.inline.text.exec(t);if(n){let o;return this.lexer.state.inRawBlock?o=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):lr(n[0]):n[0]:o=lr(this.options.smartypants?r(n[0]):n[0]),{type:"text",raw:n[0],text:o}}}}const ae={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Sh,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};ae._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;ae.def=We(ae.def).replace("label",ae._label).replace("title",ae._title).getRegex();ae.bullet=/(?:[*+-]|\d{1,9}[.)])/;ae.listItemStart=We(/^( *)(bull) */).replace("bull",ae.bullet).getRegex();ae.list=We(ae.list).replace(/bull/g,ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ae.def.source+")").getRegex();ae._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";ae._comment=/|$)/;ae.html=We(ae.html,"i").replace("comment",ae._comment).replace("tag",ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();ae.paragraph=We(ae._paragraph).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ae._tag).getRegex();ae.blockquote=We(ae.blockquote).replace("paragraph",ae.paragraph).getRegex();ae.normal={...ae};ae.gfm={...ae.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};ae.gfm.table=We(ae.gfm.table).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ae._tag).getRegex();ae.gfm.paragraph=We(ae._paragraph).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",ae.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ae._tag).getRegex();ae.pedantic={...ae.normal,html:We(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ae._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Sh,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:We(ae.normal._paragraph).replace("hr",ae.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Sh,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Sh,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";Q.punctuation=We(Q.punctuation).replace(/punctuation/g,Q._punctuation).getRegex();Q.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;Q.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;Q._comment=We(ae._comment).replace("(?:-->|$)","-->").getRegex();Q.emStrong.lDelim=We(Q.emStrong.lDelim).replace(/punct/g,Q._punctuation).getRegex();Q.emStrong.rDelimAst=We(Q.emStrong.rDelimAst,"g").replace(/punct/g,Q._punctuation).getRegex();Q.emStrong.rDelimUnd=We(Q.emStrong.rDelimUnd,"g").replace(/punct/g,Q._punctuation).getRegex();Q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;Q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Q._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Q.autolink=We(Q.autolink).replace("scheme",Q._scheme).replace("email",Q._email).getRegex();Q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Q.tag=We(Q.tag).replace("comment",Q._comment).replace("attribute",Q._attribute).getRegex();Q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Q._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Q.link=We(Q.link).replace("label",Q._label).replace("href",Q._href).replace("title",Q._title).getRegex();Q.reflink=We(Q.reflink).replace("label",Q._label).replace("ref",ae._label).getRegex();Q.nolink=We(Q.nolink).replace("ref",ae._label).getRegex();Q.reflinkSearch=We(Q.reflinkSearch,"g").replace("reflink",Q.reflink).replace("nolink",Q.nolink).getRegex();Q.normal={...Q};Q.pedantic={...Q.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:We(/^!?\[(label)\]\((.*?)\)/).replace("label",Q._label).getRegex(),reflink:We(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Q._label).getRegex()};Q.gfm={...Q.normal,escape:We(Q.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),t+="&#"+n+";";return t}class ds{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ta,this.options.tokenizer=this.options.tokenizer||new wx,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={block:ae.normal,inline:Q.normal};this.options.pedantic?(r.block=ae.pedantic,r.inline=Q.pedantic):this.options.gfm&&(r.block=ae.gfm,this.options.breaks?r.inline=Q.breaks:r.inline=Q.gfm),this.tokenizer.rules=r}static get rules(){return{block:ae,inline:Q}}static lex(t,r){return new ds(r).lex(t)}static lexInline(t,r){return new ds(r).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,` +`,t=t.substring(f.length+1),u=d.slice(s)}}v.loose||(c?v.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(o=/^\[[ xX]\] /.exec(p),o&&(i=o[0]!=="[ ] ",p=p.replace(/^\[[ xX]\] +/,""))),v.items.push({type:"list_item",raw:n,task:!!o,checked:i,loose:!1,text:p}),v.raw+=n}v.items[v.items.length-1].raw=n.trimRight(),v.items[v.items.length-1].text=p.trimRight(),v.raw=v.raw.trimRight();const y=v.items.length;for(a=0;aw.type==="space"),k=x.length>0&&x.some(w=>/\n.*\n/.test(w.raw));v.loose=k}if(v.loose)for(a=0;a$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline._escapes,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:o,title:i}}}table(t){const r=this.rules.block.table.exec(t);if(r){const n={type:"table",header:f4(r[1]).map(o=>({text:o})),align:r[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:r[3]&&r[3].trim()?r[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(n.header.length===n.align.length){n.raw=r[0];let o=n.align.length,i,s,a,l;for(i=0;i({text:c}));for(o=n.header.length,s=0;s/i.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):cr(r[0]):r[0]}}link(t){const r=this.rules.inline.link.exec(t);if(r){const n=r[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;const s=mp(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{const s=Xae(r[2],"()");if(s>-1){const l=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,l).trim(),r[3]=""}}let o=r[2],i="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);s&&(o=s[1],i=s[3])}else i=r[3]?r[3].slice(1,-1):"";return o=o.trim(),/^$/.test(n)?o=o.slice(1):o=o.slice(1,-1)),h4(r,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},r[0],this.lexer)}}reflink(t,r){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let o=(n[2]||n[1]).replace(/\s+/g," ");if(o=r[o.toLowerCase()],!o){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return h4(n,o,n[0],this.lexer)}}emStrong(t,r,n=""){let o=this.rules.inline.emStrong.lDelim.exec(t);if(!o||o[3]&&n.match(/[\p{L}\p{N}]/u))return;const i=o[1]||o[2]||"";if(!i||i&&(n===""||this.rules.inline.punctuation.exec(n))){const s=o[0].length-1;let a,l,c=s,u=0;const d=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,r=r.slice(-1*t.length+s);(o=d.exec(r))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(l=a.length,o[3]||o[4]){c+=l;continue}else if((o[5]||o[6])&&s%3&&!((s+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);const f=t.slice(0,s+o.index+(o[0].length-a.length)+l);if(Math.min(s,l)%2){const h=f.slice(1,-1);return{type:"em",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}const p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){const r=this.rules.inline.code.exec(t);if(r){let n=r[2].replace(/\n/g," ");const o=/[^ ]/.test(n),i=/^ /.test(n)&&/ $/.test(n);return o&&i&&(n=n.substring(1,n.length-1)),n=cr(n,!0),{type:"codespan",raw:r[0],text:n}}}br(t){const r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){const r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t,r){const n=this.rules.inline.autolink.exec(t);if(n){let o,i;return n[2]==="@"?(o=cr(this.options.mangle?r(n[1]):n[1]),i="mailto:"+o):(o=cr(n[1]),i=o),{type:"link",raw:n[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}url(t,r){let n;if(n=this.rules.inline.url.exec(t)){let o,i;if(n[2]==="@")o=cr(this.options.mangle?r(n[0]):n[0]),i="mailto:"+o;else{let s;do s=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(s!==n[0]);o=cr(n[0]),n[1]==="www."?i="http://"+n[0]:i=n[0]}return{type:"link",raw:n[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(t,r){const n=this.rules.inline.text.exec(t);if(n){let o;return this.lexer.state.inRawBlock?o=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):cr(n[0]):n[0]:o=cr(this.options.smartypants?r(n[0]):n[0]),{type:"text",raw:n[0],text:o}}}}const ae={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Ch,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};ae._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;ae.def=We(ae.def).replace("label",ae._label).replace("title",ae._title).getRegex();ae.bullet=/(?:[*+-]|\d{1,9}[.)])/;ae.listItemStart=We(/^( *)(bull) */).replace("bull",ae.bullet).getRegex();ae.list=We(ae.list).replace(/bull/g,ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ae.def.source+")").getRegex();ae._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";ae._comment=/|$)/;ae.html=We(ae.html,"i").replace("comment",ae._comment).replace("tag",ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();ae.paragraph=We(ae._paragraph).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ae._tag).getRegex();ae.blockquote=We(ae.blockquote).replace("paragraph",ae.paragraph).getRegex();ae.normal={...ae};ae.gfm={...ae.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};ae.gfm.table=We(ae.gfm.table).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ae._tag).getRegex();ae.gfm.paragraph=We(ae._paragraph).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",ae.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ae._tag).getRegex();ae.pedantic={...ae.normal,html:We(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ae._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ch,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:We(ae.normal._paragraph).replace("hr",ae.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ch,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ch,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";Q.punctuation=We(Q.punctuation).replace(/punctuation/g,Q._punctuation).getRegex();Q.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;Q.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;Q._comment=We(ae._comment).replace("(?:-->|$)","-->").getRegex();Q.emStrong.lDelim=We(Q.emStrong.lDelim).replace(/punct/g,Q._punctuation).getRegex();Q.emStrong.rDelimAst=We(Q.emStrong.rDelimAst,"g").replace(/punct/g,Q._punctuation).getRegex();Q.emStrong.rDelimUnd=We(Q.emStrong.rDelimUnd,"g").replace(/punct/g,Q._punctuation).getRegex();Q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;Q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Q._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Q.autolink=We(Q.autolink).replace("scheme",Q._scheme).replace("email",Q._email).getRegex();Q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Q.tag=We(Q.tag).replace("comment",Q._comment).replace("attribute",Q._attribute).getRegex();Q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Q._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Q.link=We(Q.link).replace("label",Q._label).replace("href",Q._href).replace("title",Q._title).getRegex();Q.reflink=We(Q.reflink).replace("label",Q._label).replace("ref",ae._label).getRegex();Q.nolink=We(Q.nolink).replace("ref",ae._label).getRegex();Q.reflinkSearch=We(Q.reflinkSearch,"g").replace("reflink",Q.reflink).replace("nolink",Q.nolink).getRegex();Q.normal={...Q};Q.pedantic={...Q.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:We(/^!?\[(label)\]\((.*?)\)/).replace("label",Q._label).getRegex(),reflink:We(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Q._label).getRegex()};Q.gfm={...Q.normal,escape:We(Q.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),t+="&#"+n+";";return t}class ds{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ta,this.options.tokenizer=this.options.tokenizer||new Cx,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={block:ae.normal,inline:Q.normal};this.options.pedantic?(r.block=ae.pedantic,r.inline=Q.pedantic):this.options.gfm&&(r.block=ae.gfm,this.options.breaks?r.inline=Q.breaks:r.inline=Q.gfm),this.tokenizer.rules=r}static get rules(){return{block:ae,inline:Q}}static lex(t,r){return new ds(r).lex(t)}static lexInline(t,r){return new ds(r).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,` `),this.blockTokens(t,this.tokens);let r;for(;r=this.inlineQueue.shift();)this.inlineTokens(r.src,r.tokens);return this.tokens}blockTokens(t,r=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(a,l,c)=>l+" ".repeat(c.length));let n,o,i,s;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(n=a.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length),n.raw.length===1&&r.length>0?r[r.length-1].raw+=` `:r.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=` `+n.raw,o.text+=` @@ -4953,9 +4953,9 @@ Error generating stack: `+i.message+` `+n.raw,o.text+=` `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n),s=i.length!==t.length,t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&o.type==="text"?(o.raw+=` `+n.raw,o.text+=` -`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let n,o,i,s=t,a,l,c;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)u.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+u4("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+u4("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(s))!=null;)s=s.slice(0,a.index+a[0].length-2)+"++"+s.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(n=u.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.emStrong(t,s,c)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.autolink(t,f4)){t=t.substring(n.raw.length),r.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t,f4))){t=t.substring(n.raw.length),r.push(n);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const d=t.slice(1);let f;this.options.extensions.startInline.forEach(function(p){f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(n=this.tokenizer.inlineText(i,Yae)){t=t.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(c=n.raw.slice(-1)),l=!0,o=r[r.length-1],o&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return r}}class Sx{constructor(t){this.options=t||Ta}code(t,r,n){const o=(r||"").match(/\S*/)[0];if(this.options.highlight){const i=this.options.highlight(t,o);i!=null&&i!==t&&(n=!0,t=i)}return t=t.replace(/\n$/,"")+` -`,o?'
'+(n?t:lr(t,!0))+`
-`:"
"+(n?t:lr(t,!0))+`
+`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let n,o,i,s=t,a,l,c;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)u.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+p4("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+p4("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(s))!=null;)s=s.slice(0,a.index+a[0].length-2)+"++"+s.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(n=u.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.emStrong(t,s,c)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.autolink(t,m4)){t=t.substring(n.raw.length),r.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t,m4))){t=t.substring(n.raw.length),r.push(n);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const d=t.slice(1);let f;this.options.extensions.startInline.forEach(function(p){f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(n=this.tokenizer.inlineText(i,ele)){t=t.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(c=n.raw.slice(-1)),l=!0,o=r[r.length-1],o&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return r}}class Mx{constructor(t){this.options=t||Ta}code(t,r,n){const o=(r||"").match(/\S*/)[0];if(this.options.highlight){const i=this.options.highlight(t,o);i!=null&&i!==t&&(n=!0,t=i)}return t=t.replace(/\n$/,"")+` +`,o?'
'+(n?t:cr(t,!0))+`
+`:"
"+(n?t:cr(t,!0))+`
`}blockquote(t){return`
${t}
`}html(t){return t}heading(t,r,n,o){if(this.options.headerIds){const i=this.options.headerPrefix+o.slug(n);return`${t} @@ -4973,18 +4973,18 @@ ${t} `}tablerow(t){return` ${t} `}tablecell(t,r){const n=r.header?"th":"td";return(r.align?`<${n} align="${r.align}">`:`<${n}>`)+t+` -`}strong(t){return`${t}`}em(t){return`${t}`}codespan(t){return`${t}`}br(){return this.options.xhtml?"
":"
"}del(t){return`${t}`}link(t,r,n){if(t=l4(this.options.sanitize,this.options.baseUrl,t),t===null)return n;let o='",o}image(t,r,n){if(t=l4(this.options.sanitize,this.options.baseUrl,t),t===null)return n;let o=`${n}":">",o}text(t){return t}}class AO{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,r,n){return""+n}image(t,r,n){return""+n}br(){return""}}class NO{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,r){let n=t,o=0;if(this.seen.hasOwnProperty(n)){o=this.seen[t];do o++,n=t+"-"+o;while(this.seen.hasOwnProperty(n))}return r||(this.seen[t]=o,this.seen[n]=0),n}slug(t,r={}){const n=this.serialize(t);return this.getNextSafeSlug(n,r.dryrun)}}class fs{constructor(t){this.options=t||Ta,this.options.renderer=this.options.renderer||new Sx,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new AO,this.slugger=new NO}static parse(t,r){return new fs(r).parse(t)}static parseInline(t,r){return new fs(r).parseInline(t)}parse(t,r=!0){let n="",o,i,s,a,l,c,u,d,f,p,h,m,b,v,g,y,x,k,w;const E=t.length;for(o=0;o0&&g.tokens[0].type==="paragraph"?(g.tokens[0].text=k+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&g.tokens[0].tokens[0].type==="text"&&(g.tokens[0].tokens[0].text=k+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:k}):v+=k),v+=this.parse(g.tokens,b),f+=this.renderer.listitem(v,x,y);n+=this.renderer.list(f,h,m);continue}case"html":{n+=this.renderer.html(p.text);continue}case"paragraph":{n+=this.renderer.paragraph(this.parseInline(p.tokens));continue}case"text":{for(f=p.tokens?this.parseInline(p.tokens):p.text;o+1{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){const o="

An error occurred:

"+lr(n.message+"",!0)+"
";if(t)return Promise.resolve(o);if(r){r(null,o);return}return o}if(t)return Promise.reject(n);if(r){r(n);return}throw n}}function RO(e,t){return(r,n,o)=>{typeof n=="function"&&(o=n,n=null);const i={...n};n={...se.defaults,...i};const s=Jae(n.silent,n.async,o);if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(qae(n),n.hooks&&(n.hooks.options=n),o){const a=n.highlight;let l;try{n.hooks&&(r=n.hooks.preprocess(r)),l=e(r,n)}catch(d){return s(d)}const c=function(d){let f;if(!d)try{n.walkTokens&&se.walkTokens(l,n.walkTokens),f=t(l,n),n.hooks&&(f=n.hooks.postprocess(f))}catch(p){d=p}return n.highlight=a,d?s(d):o(null,f)};if(!a||a.length<3||(delete n.highlight,!l.length))return c();let u=0;se.walkTokens(l,function(d){d.type==="code"&&(u++,setTimeout(()=>{a(d.text,d.lang,function(f,p){if(f)return c(f);p!=null&&p!==d.text&&(d.text=p,d.escaped=!0),u--,u===0&&c()})},0))}),u===0&&c();return}if(n.async)return Promise.resolve(n.hooks?n.hooks.preprocess(r):r).then(a=>e(a,n)).then(a=>n.walkTokens?Promise.all(se.walkTokens(a,n.walkTokens)).then(()=>a):a).then(a=>t(a,n)).then(a=>n.hooks?n.hooks.postprocess(a):a).catch(s);try{n.hooks&&(r=n.hooks.preprocess(r));const a=e(r,n);n.walkTokens&&se.walkTokens(a,n.walkTokens);let l=t(a,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(a){return s(a)}}}function se(e,t,r){return RO(ds.lex,fs.parse)(e,t,r)}se.options=se.setOptions=function(e){return se.defaults={...se.defaults,...e},zae(se.defaults),se};se.getDefaults=MO;se.defaults=Ta;se.use=function(...e){const t=se.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(r=>{const n={...r};if(n.async=se.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if(o.renderer){const i=t.renderers[o.name];i?t.renderers[o.name]=function(...s){let a=o.renderer.apply(this,s);return a===!1&&(a=i.apply(this,s)),a}:t.renderers[o.name]=o.renderer}if(o.tokenizer){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[o.level]?t[o.level].unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),n.extensions=t),r.renderer){const o=se.defaults.renderer||new Sx;for(const i in r.renderer){const s=o[i];o[i]=(...a)=>{let l=r.renderer[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.renderer=o}if(r.tokenizer){const o=se.defaults.tokenizer||new wx;for(const i in r.tokenizer){const s=o[i];o[i]=(...a)=>{let l=r.tokenizer[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.tokenizer=o}if(r.hooks){const o=se.defaults.hooks||new Eh;for(const i in r.hooks){const s=o[i];Eh.passThroughHooks.has(i)?o[i]=a=>{if(se.defaults.async)return Promise.resolve(r.hooks[i].call(o,a)).then(c=>s.call(o,c));const l=r.hooks[i].call(o,a);return s.call(o,l)}:o[i]=(...a)=>{let l=r.hooks[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.hooks=o}if(r.walkTokens){const o=se.defaults.walkTokens;n.walkTokens=function(i){let s=[];return s.push(r.walkTokens.call(this,i)),o&&(s=s.concat(o.call(this,i))),s}}se.setOptions(n)})};se.walkTokens=function(e,t){let r=[];for(const n of e)switch(r=r.concat(t.call(se,n)),n.type){case"table":{for(const o of n.header)r=r.concat(se.walkTokens(o.tokens,t));for(const o of n.rows)for(const i of o)r=r.concat(se.walkTokens(i.tokens,t));break}case"list":{r=r.concat(se.walkTokens(n.items,t));break}default:se.defaults.extensions&&se.defaults.extensions.childTokens&&se.defaults.extensions.childTokens[n.type]?se.defaults.extensions.childTokens[n.type].forEach(function(o){r=r.concat(se.walkTokens(n[o],t))}):n.tokens&&(r=r.concat(se.walkTokens(n.tokens,t)))}return r};se.parseInline=RO(ds.lexInline,fs.parseInline);se.Parser=fs;se.parser=fs.parse;se.Renderer=Sx;se.TextRenderer=AO;se.Lexer=ds;se.lexer=ds.lex;se.Tokenizer=wx;se.Slugger=NO;se.Hooks=Eh;se.parse=se;se.options;se.setOptions;se.use;se.walkTokens;se.parseInline;fs.parse;ds.lex;var Xae=Object.defineProperty,Qae=Object.getOwnPropertyDescriptor,Gm=(e,t,r,n)=>{for(var o=n>1?void 0:n?Qae(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Xae(t,r,o),o},Zae=_h(Sd);function ele(e){return rle.turndown(e)}function g1(e){const t=e.parentNode;if(!Je(t))return!1;if(t.nodeName==="THEAD")return!0;if(t.nodeName!=="TABLE"&&!PO(t))return!1;const r=[...e.childNodes];return r.every(n=>n.nodeName==="TH")&&r.some(n=>!!n.textContent)}function Ch(e){return Je(e)&&e.matches("th[data-controller-cell]")}function tle(e){const t=e.parentNode;return!Je(t)||t.nodeName!=="TABLE"&&!PO(t)?!1:[...e.childNodes].every(n=>Ch(n))}function PO(e){var t;if(e.nodeName!=="TBODY")return!1;const r=e.previousSibling;return r?Je(r)&&r.nodeName==="THEAD"&&!((t=r.textContent)!=null&&t.trim()):!0}function p4(e){const t=e.closest("table");if(!t)return!1;const{parentNode:r}=t;return r?!!r.closest("table"):!0}function h4(e,t){var r;const n=[];for(const s of((r=t.parentNode)==null?void 0:r.childNodes)??[])Ch(s)||n.push(s);return`${(n.indexOf(t)===0?"| ":" ")+e.trim()} |`}var rle=new Zae({codeBlockStyle:"fenced",headingStyle:"atx"}).addRule("taskListItems",{filter:e=>e.nodeName==="LI"&&e.hasAttribute("data-task-list-item"),replacement:(e,t)=>`- ${t.hasAttribute("data-checked")?"[x]":"[ ]"} ${e.trimStart()}`}).addRule("tableCell",{filter:["th","td"],replacement:(e,t)=>Ch(t)?"":h4(e,t)}).addRule("tableRow",{filter:"tr",replacement:(e,t)=>{let r="";const n={left:":--",right:"--:",center:":-:"},o=[...t.childNodes].filter(i=>!Ch(i));if(g1(t))for(const i of o){if(!Je(i))continue;let s="---";const a=(i.getAttribute("align")??"").toLowerCase();a&&(s=n[a]||s),r+=h4(s,i)}return` +`}strong(t){return`${t}`}em(t){return`${t}`}codespan(t){return`${t}`}br(){return this.options.xhtml?"
":"
"}del(t){return`${t}`}link(t,r,n){if(t=d4(this.options.sanitize,this.options.baseUrl,t),t===null)return n;let o='
",o}image(t,r,n){if(t=d4(this.options.sanitize,this.options.baseUrl,t),t===null)return n;let o=`${n}":">",o}text(t){return t}}class LO{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,r,n){return""+n}image(t,r,n){return""+n}br(){return""}}class IO{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,r){let n=t,o=0;if(this.seen.hasOwnProperty(n)){o=this.seen[t];do o++,n=t+"-"+o;while(this.seen.hasOwnProperty(n))}return r||(this.seen[t]=o,this.seen[n]=0),n}slug(t,r={}){const n=this.serialize(t);return this.getNextSafeSlug(n,r.dryrun)}}class fs{constructor(t){this.options=t||Ta,this.options.renderer=this.options.renderer||new Mx,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new LO,this.slugger=new IO}static parse(t,r){return new fs(r).parse(t)}static parseInline(t,r){return new fs(r).parseInline(t)}parse(t,r=!0){let n="",o,i,s,a,l,c,u,d,f,p,h,m,b,v,g,y,x,k,w;const E=t.length;for(o=0;o0&&g.tokens[0].type==="paragraph"?(g.tokens[0].text=k+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&g.tokens[0].tokens[0].type==="text"&&(g.tokens[0].tokens[0].text=k+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:k}):v+=k),v+=this.parse(g.tokens,b),f+=this.renderer.listitem(v,x,y);n+=this.renderer.list(f,h,m);continue}case"html":{n+=this.renderer.html(p.text);continue}case"paragraph":{n+=this.renderer.paragraph(this.parseInline(p.tokens));continue}case"text":{for(f=p.tokens?this.parseInline(p.tokens):p.text;o+1{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){const o="

An error occurred:

"+cr(n.message+"",!0)+"
";if(t)return Promise.resolve(o);if(r){r(null,o);return}return o}if(t)return Promise.reject(n);if(r){r(n);return}throw n}}function DO(e,t){return(r,n,o)=>{typeof n=="function"&&(o=n,n=null);const i={...n};n={...se.defaults,...i};const s=tle(n.silent,n.async,o);if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(Qae(n),n.hooks&&(n.hooks.options=n),o){const a=n.highlight;let l;try{n.hooks&&(r=n.hooks.preprocess(r)),l=e(r,n)}catch(d){return s(d)}const c=function(d){let f;if(!d)try{n.walkTokens&&se.walkTokens(l,n.walkTokens),f=t(l,n),n.hooks&&(f=n.hooks.postprocess(f))}catch(p){d=p}return n.highlight=a,d?s(d):o(null,f)};if(!a||a.length<3||(delete n.highlight,!l.length))return c();let u=0;se.walkTokens(l,function(d){d.type==="code"&&(u++,setTimeout(()=>{a(d.text,d.lang,function(f,p){if(f)return c(f);p!=null&&p!==d.text&&(d.text=p,d.escaped=!0),u--,u===0&&c()})},0))}),u===0&&c();return}if(n.async)return Promise.resolve(n.hooks?n.hooks.preprocess(r):r).then(a=>e(a,n)).then(a=>n.walkTokens?Promise.all(se.walkTokens(a,n.walkTokens)).then(()=>a):a).then(a=>t(a,n)).then(a=>n.hooks?n.hooks.postprocess(a):a).catch(s);try{n.hooks&&(r=n.hooks.preprocess(r));const a=e(r,n);n.walkTokens&&se.walkTokens(a,n.walkTokens);let l=t(a,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(a){return s(a)}}}function se(e,t,r){return DO(ds.lex,fs.parse)(e,t,r)}se.options=se.setOptions=function(e){return se.defaults={...se.defaults,...e},Hae(se.defaults),se};se.getDefaults=NO;se.defaults=Ta;se.use=function(...e){const t=se.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(r=>{const n={...r};if(n.async=se.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if(o.renderer){const i=t.renderers[o.name];i?t.renderers[o.name]=function(...s){let a=o.renderer.apply(this,s);return a===!1&&(a=i.apply(this,s)),a}:t.renderers[o.name]=o.renderer}if(o.tokenizer){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[o.level]?t[o.level].unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),n.extensions=t),r.renderer){const o=se.defaults.renderer||new Mx;for(const i in r.renderer){const s=o[i];o[i]=(...a)=>{let l=r.renderer[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.renderer=o}if(r.tokenizer){const o=se.defaults.tokenizer||new Cx;for(const i in r.tokenizer){const s=o[i];o[i]=(...a)=>{let l=r.tokenizer[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.tokenizer=o}if(r.hooks){const o=se.defaults.hooks||new Mh;for(const i in r.hooks){const s=o[i];Mh.passThroughHooks.has(i)?o[i]=a=>{if(se.defaults.async)return Promise.resolve(r.hooks[i].call(o,a)).then(c=>s.call(o,c));const l=r.hooks[i].call(o,a);return s.call(o,l)}:o[i]=(...a)=>{let l=r.hooks[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.hooks=o}if(r.walkTokens){const o=se.defaults.walkTokens;n.walkTokens=function(i){let s=[];return s.push(r.walkTokens.call(this,i)),o&&(s=s.concat(o.call(this,i))),s}}se.setOptions(n)})};se.walkTokens=function(e,t){let r=[];for(const n of e)switch(r=r.concat(t.call(se,n)),n.type){case"table":{for(const o of n.header)r=r.concat(se.walkTokens(o.tokens,t));for(const o of n.rows)for(const i of o)r=r.concat(se.walkTokens(i.tokens,t));break}case"list":{r=r.concat(se.walkTokens(n.items,t));break}default:se.defaults.extensions&&se.defaults.extensions.childTokens&&se.defaults.extensions.childTokens[n.type]?se.defaults.extensions.childTokens[n.type].forEach(function(o){r=r.concat(se.walkTokens(n[o],t))}):n.tokens&&(r=r.concat(se.walkTokens(n.tokens,t)))}return r};se.parseInline=DO(ds.lexInline,fs.parseInline);se.Parser=fs;se.parser=fs.parse;se.Renderer=Mx;se.TextRenderer=LO;se.Lexer=ds;se.lexer=ds.lex;se.Tokenizer=Cx;se.Slugger=IO;se.Hooks=Mh;se.parse=se;se.options;se.setOptions;se.use;se.walkTokens;se.parseInline;fs.parse;ds.lex;var rle=Object.defineProperty,nle=Object.getOwnPropertyDescriptor,Xm=(e,t,r,n)=>{for(var o=n>1?void 0:n?nle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&rle(t,r,o),o},ole=Rh(Ed);function ile(e){return ale.turndown(e)}function b1(e){const t=e.parentNode;if(!Je(t))return!1;if(t.nodeName==="THEAD")return!0;if(t.nodeName!=="TABLE"&&!$O(t))return!1;const r=[...e.childNodes];return r.every(n=>n.nodeName==="TH")&&r.some(n=>!!n.textContent)}function Th(e){return Je(e)&&e.matches("th[data-controller-cell]")}function sle(e){const t=e.parentNode;return!Je(t)||t.nodeName!=="TABLE"&&!$O(t)?!1:[...e.childNodes].every(n=>Th(n))}function $O(e){var t;if(e.nodeName!=="TBODY")return!1;const r=e.previousSibling;return r?Je(r)&&r.nodeName==="THEAD"&&!((t=r.textContent)!=null&&t.trim()):!0}function g4(e){const t=e.closest("table");if(!t)return!1;const{parentNode:r}=t;return r?!!r.closest("table"):!0}function v4(e,t){var r;const n=[];for(const s of((r=t.parentNode)==null?void 0:r.childNodes)??[])Th(s)||n.push(s);return`${(n.indexOf(t)===0?"| ":" ")+e.trim()} |`}var ale=new ole({codeBlockStyle:"fenced",headingStyle:"atx"}).addRule("taskListItems",{filter:e=>e.nodeName==="LI"&&e.hasAttribute("data-task-list-item"),replacement:(e,t)=>`- ${t.hasAttribute("data-checked")?"[x]":"[ ]"} ${e.trimStart()}`}).addRule("tableCell",{filter:["th","td"],replacement:(e,t)=>Th(t)?"":v4(e,t)}).addRule("tableRow",{filter:"tr",replacement:(e,t)=>{let r="";const n={left:":--",right:"--:",center:":-:"},o=[...t.childNodes].filter(i=>!Th(i));if(b1(t))for(const i of o){if(!Je(i))continue;let s="---";const a=(i.getAttribute("align")??"").toLowerCase();a&&(s=n[a]||s),r+=v4(s,i)}return` ${e}${r?` -${r}`:""}`}}).addRule("table",{filter:e=>{if(e.nodeName!=="TABLE"||p4(e))return!1;const t=[...e.rows].filter(r=>!tle(r));return g1(t[0])},replacement:e=>(e=e.replace(` +${r}`:""}`}}).addRule("table",{filter:e=>{if(e.nodeName!=="TABLE"||g4(e))return!1;const t=[...e.rows].filter(r=>!sle(r));return b1(t[0])},replacement:e=>(e=e.replace(` `,` `),` ${e} -`)}).addRule("tableSection",{filter:["thead","tbody","tfoot"],replacement:function(e){return e}}).keep(e=>e.nodeName==="TABLE"&&!g1(e.rows[0])).keep(e=>e.nodeName==="TABLE"&&p4(e)).addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return`~${e}~`}}).addRule("fencedCodeBlock",{filter:(e,t)=>!!(t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"),replacement:(e,t,r)=>{var n,o;te(Je(t.firstChild),{code:H.EXTENSION,message:`Invalid node \`${(n=t.firstChild)==null?void 0:n.nodeName}\` encountered for codeblock when converting html to markdown.`});const s=((o=(t.firstChild.getAttribute("class")??"").match(/(?:lang|language)-(\S+)/))==null?void 0:o[1])??t.firstChild.getAttribute("data-code-block-language")??"";return` +`)}).addRule("tableSection",{filter:["thead","tbody","tfoot"],replacement:function(e){return e}}).keep(e=>e.nodeName==="TABLE"&&!b1(e.rows[0])).keep(e=>e.nodeName==="TABLE"&&g4(e)).addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return`~${e}~`}}).addRule("fencedCodeBlock",{filter:(e,t)=>!!(t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"),replacement:(e,t,r)=>{var n,o;te(Je(t.firstChild),{code:H.EXTENSION,message:`Invalid node \`${(n=t.firstChild)==null?void 0:n.nodeName}\` encountered for codeblock when converting html to markdown.`});const s=((o=(t.firstChild.getAttribute("class")??"").match(/(?:lang|language)-(\S+)/))==null?void 0:o[1])??t.firstChild.getAttribute("data-code-block-language")??"";return` ${r.fence}${s} ${t.firstChild.textContent} @@ -4996,6 +4996,20 @@ ${e} ${e} `},listitem(e,t,r){return t?`
  • ${e}
  • `:`
  • ${e}
  • -`}}});function nle(e,t){return se(e,{gfm:!0,smartLists:!0,xhtml:!0,sanitizer:t})}function ole(e){te(typeof document,{code:H.EXTENSION,message:"Attempting to sanitize html within a non-browser environment. Please provide your own `sanitizeHtml` method to the `MarkdownExtension`."});const t=new DOMParser().parseFromString(`${e}`,"text/html");return t.normalize(),zO(t.body),t.body.innerHTML}function zO(e){if(!W6(e)){if(!Je(e)||/^(script|iframe|object|embed|svg)$/i.test(e.tagName))return e==null?void 0:e.remove();for(const{name:t}of e.attributes)/^(class|id|name|href|src|alt|align|valign)$/i.test(t)||e.attributes.removeNamedItem(t);for(const t of e.childNodes)zO(t)}}var Zl=class extends Ve{get name(){return"markdown"}onCreate(){this.store.setStringHandler("markdown",this.markdownToProsemirrorNode.bind(this))}createPlugin(){return{props:{clipboardTextSerializer:this.options.copyAsMarkdown?t=>{const r=document.createElement("div"),n=sn.fromSchema(this.store.schema);return r.append(n.serializeFragment(t.content)),this.options.htmlToMarkdown(r.innerHTML)}:void 0}}}markdownToProsemirrorNode(e){return this.store.stringHandlers.html({...e,content:this.options.markdownToHtml(e.content,this.options.htmlSanitizer)})}insertMarkdown(e,t){return r=>{const{state:n}=r;let o=this.options.markdownToHtml(e,this.options.htmlSanitizer);o=!(t!=null&&t.alwaysWrapInBlock)&&o.startsWith("

    <")&&o.endsWith(`

    -`)?o.slice(3,-5):`
    ${o}
    `;const i=this.store.stringHandlers.html({content:o,schema:n.schema,fragment:!0});return this.store.commands.insertNode.original(i,{...t,replaceEmptyParentBlock:!0})(r)}}getMarkdown(e){return this.options.htmlToMarkdown(this.store.helpers.getHTML(e))}toggleBoldMarkdown(){return e=>!1}};Gm([U()],Zl.prototype,"insertMarkdown",1);Gm([He()],Zl.prototype,"getMarkdown",1);Gm([U()],Zl.prototype,"toggleBoldMarkdown",1);Zl=Gm([me({defaultOptions:{htmlToMarkdown:ele,markdownToHtml:nle,htmlSanitizer:ole,activeNodes:[oe.Code],copyAsMarkdown:!1},staticKeys:["htmlToMarkdown","markdownToHtml","htmlSanitizer"]})],Zl);var ile=Object.defineProperty,sle=Object.getOwnPropertyDescriptor,hr=(e,t,r,n)=>{for(var o=n>1?void 0:n?sle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ile(t,r,o),o},ale={label:({t:e})=>e(rc.INCREASE_INDENT_LABEL),icon:"indentIncrease"},lle={label:({t:e})=>e(rc.DECREASE_INDENT_LABEL),icon:"indentDecrease"},cle={label:({t:e})=>e(rc.CENTER_ALIGN_LABEL),icon:"alignCenter",active:Ym(({node:e})=>e.attrs.nodeTextAlignment==="center")},ule={label:({t:e})=>e(rc.JUSTIFY_ALIGN_LABEL),icon:"alignJustify",active:Ym(({node:e})=>e.attrs.nodeTextAlignment==="justify")},dle={label:({t:e})=>e(rc.RIGHT_ALIGN_LABEL),icon:"alignRight",active:Ym(({node:e})=>e.attrs.nodeTextAlignment==="right")},fle={label:({t:e})=>e(rc.LEFT_ALIGN_LABEL),icon:"alignLeft",active:Ym(({node:e})=>{const{nodeTextAlignment:t}=e.attrs;return t==="left"||t===""})};function Ym(e){return({excludeNodes:t},r)=>{const{getState:n,nodeTags:o}=r;return LO(n(),o.formattingNode,t).some(e)}}function m4(e,t,r){return r.includes(e.name)?!1:t.includes(e.name)}function LO(e,t,r){const n=[],{$from:o,$to:i}=e.selection,s=o.blockRange(i);if(!s)return[];const{parent:a,start:l,end:c}=s;return a.nodeSize-2===c-l&&m4(a.type,t,r)?[{node:a,pos:l-1}]:(e.doc.nodesBetween(l,c,(d,f)=>{if(!(fc)&&m4(d.type,t,r))return n.push({node:d,pos:f}),!1}),n)}var g4="data-node-indent",v4="data-node-text-align",y4="data-line-height-align";function ple(e,t){const r=Qs(G4(e)),n=Qs(t??"0"),o=e.length??1,i=r/o;return _d({max:o,min:0,value:Math.floor(n/i)})}var hle=/^\d+(?:\.\d+)?$/,mle=/^(\d+(?:\.\d+)?)%$/;function b4(e){if(Jt(e))return e;if(!e)return null;const t=e.trim(),r=t.match(mle);if(r)return Number.parseFloat(r[1])/100;const n=t.match(hle);return n?Number.parseFloat(n[0]):null}var Ft=class extends Ve{get name(){return"nodeFormatting"}createSchemaAttributes(){return[{identifiers:{type:"node",tags:[oe.FormattingNode],excludeNames:this.options.excludeNodes},attributes:{nodeIndent:this.nodeIndent(),nodeTextAlignment:this.nodeTextAlignment(),nodeLineHeight:this.nodeLineHeight(),style:{default:"",parseDOM:()=>"",toDOM:({nodeIndent:e,nodeTextAlignment:t,nodeLineHeight:r,style:n})=>{const o=e?this.options.indents[e]:void 0;return{style:Uv({marginLeft:o,textAlign:t&&t!=="none"?t:void 0,lineHeight:r||void 0},n)}}}}}]}setLineHeight(e){return this.setNodeAttribute(({node:t})=>{if(e!==t.attrs.nodeLineHeight)return{nodeLineHeight:e}})}setTextAlignment(e){return this.setNodeAttribute(({node:t})=>{if(e!==t.attrs.nodeTextAlignment)return{nodeTextAlignment:e}})}setIndent(e){return this.setNodeAttribute(({node:t})=>{const r=t.attrs.nodeIndent??0,n=e==="-1"?r-1:e==="+1"?r+1:e,o=_d({min:0,max:this.options.indents.length-1,value:n});if(o!==r)return{nodeIndent:o}})}centerAlign(){return this.setTextAlignment("center")}justifyAlign(){return this.setTextAlignment("justify")}leftAlign(){return this.setTextAlignment("left")}rightAlign(){return this.setTextAlignment("right")}increaseIndent(){return e=>this.setIndent("+1")(e)}decreaseIndent(){return e=>this.setIndent("-1")(e)}centerAlignShortcut(e){return this.centerAlign()(e)}justifyAlignShortcut(e){return this.justifyAlign()(e)}leftAlignShortcut(e){return this.leftAlign()(e)}rightAlignShortcut(e){return this.rightAlign()(e)}increaseIndentShortcut(e){return this.increaseIndent()(e)}decreaseIndentShortcut(e){return this.decreaseIndent()(e)}nodeIndent(){return{default:null,parseDOM:e=>e.getAttribute(g4)??ple(this.options.indents,e.style.marginLeft),toDOM:e=>{if(!e.nodeIndent)return;const t=`${e.nodeIndent}`;if(this.options.indents[e.nodeIndent])return{[g4]:t}}}}nodeTextAlignment(){return{default:null,parseDOM:e=>e.getAttribute(v4)??e.style.textAlign,toDOM:e=>{const t=e.nodeTextAlignment;if(!(!t||t==="none"))return{[v4]:t}}}}nodeLineHeight(){return{default:null,parseDOM:e=>{const t=e.getAttribute(y4);return b4(t)??b4(e.style.lineHeight)},toDOM:e=>{const t=e.nodeLineHeight;if(t)return{[y4]:t.toString()}}}}setNodeAttribute(e){return t=>{const{tr:r,dispatch:n}=t,o=LO(r,this.store.nodeTags.formattingNode,this.options.excludeNodes);if(Mo(o))return!1;if(!n)return!0;const i=[];for(const s of o){const{node:a,pos:l}=s,c=e(s);c&&i.push([l,{...a.attrs,...c}])}if(Mo(i))return!1;if(!n)return!0;for(const[s,a]of i)r.setNodeMarkup(s,void 0,a);return n(r),!0}}};hr([U()],Ft.prototype,"setLineHeight",1);hr([U()],Ft.prototype,"setTextAlignment",1);hr([U()],Ft.prototype,"setIndent",1);hr([U(cle)],Ft.prototype,"centerAlign",1);hr([U(ule)],Ft.prototype,"justifyAlign",1);hr([U(fle)],Ft.prototype,"leftAlign",1);hr([U(dle)],Ft.prototype,"rightAlign",1);hr([U(ale)],Ft.prototype,"increaseIndent",1);hr([U(lle)],Ft.prototype,"decreaseIndent",1);hr([je({shortcut:D.CenterAlignment,command:"centerAlign"})],Ft.prototype,"centerAlignShortcut",1);hr([je({shortcut:D.JustifyAlignment,command:"justifyAlign"})],Ft.prototype,"justifyAlignShortcut",1);hr([je({shortcut:D.LeftAlignment,command:"leftAlign"})],Ft.prototype,"leftAlignShortcut",1);hr([je({shortcut:D.RightAlignment,command:"rightAlign"})],Ft.prototype,"rightAlignShortcut",1);hr([je({shortcut:D.IncreaseIndent,command:"increaseIndent",priority:Ae.Low})],Ft.prototype,"increaseIndentShortcut",1);hr([je({shortcut:D.DecreaseIndent,command:"decreaseIndent",priority:Ae.Medium})],Ft.prototype,"decreaseIndentShortcut",1);Ft=hr([me({defaultOptions:{indents:["0","20px","40px","60px","80px","100px","120px","140px","160px","180px","200px"],excludeNodes:[]},staticKeys:["indents"]})],Ft);var gle=Object.defineProperty,vle=Object.getOwnPropertyDescriptor,Ex=(e,t,r,n)=>{for(var o=n>1?void 0:n?vle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&gle(t,r,o),o},yle={icon:"strikethrough",label:({t:e})=>e(gk.LABEL),description:({t:e})=>e(gk.DESCRIPTION)},Ed=class extends li{get name(){return"strike"}createTags(){return[oe.FontStyle,oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"s",getAttrs:e.parse},{tag:"del",getAttrs:e.parse},{tag:"strike",getAttrs:e.parse},{style:"text-decoration",getAttrs:r=>r==="line-through"?{}:!1},...t.parseDOM??[]],toDOM:r=>["s",e.dom(r),0]}}toggleStrike(){return ns({type:this.type})}shortcut(e){return this.toggleStrike()(e)}createInputRules(){return[Fu({regexp:/~([^~]+)~$/,type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{regexp:/~([^~]+)~/g,type:"mark",markType:this.type}]}};Ex([U(yle)],Ed.prototype,"toggleStrike",1);Ex([je({shortcut:D.Strike,command:"toggleStrike"})],Ed.prototype,"shortcut",1);Ed=Ex([me({})],Ed);var x4=new ka("trailingNode");function ble(e){const{ignoredNodes:t=[],nodeName:r="paragraph"}=e??{},n=Ml([...t,r]);let o,i;return new Ro({key:x4,appendTransaction(s,a,l){const{doc:c,tr:u}=l,d=x4.getState(l),f=c.content.size;if(d)return u.insert(f,o.create())},state:{init:(s,{doc:a,schema:l})=>{var c;const u=l.nodes[r];if(!u)throw new Error(`Invalid node being used for trailing node extension: '${r}'`);return o=u,i=Object.values(l.nodes).map(d=>d).filter(d=>!n.includes(d.name)),dr(i,(c=a.lastChild)==null?void 0:c.type)},apply:(s,a)=>{var l;return s.docChanged?dr(i,(l=s.doc.lastChild)==null?void 0:l.type):a}}})}var xle=Object.defineProperty,kle=Object.getOwnPropertyDescriptor,wle=(e,t,r,n)=>{for(var o=n>1?void 0:n?kle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&xle(t,r,o),o},fv=class extends Ve{get name(){return"trailingNode"}onSetOptions(e){const{changes:t}=e;(t.disableTags.changed||t.ignoredNodes.changed||t.nodeName.changed)&&this.store.updateExtensionPlugins(this)}createExternalPlugins(){const{tags:e}=this.store,{disableTags:t,nodeName:r}=this.options,n=t?[...this.options.ignoredNodes]:[...this.options.ignoredNodes,...e.lastNodeCompatible];return[ble({ignoredNodes:n,nodeName:r})]}};fv=wle([me({defaultOptions:{ignoredNodes:[],disableTags:!1,nodeName:"paragraph"}})],fv);var Sle=Object.defineProperty,Ele=Object.getOwnPropertyDescriptor,Cx=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ele(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Sle(t,r,o),o},Cle={icon:"underline",label:({t:e})=>e(vk.LABEL),description:({t:e})=>e(vk.DESCRIPTION)},Cd=class extends li{get name(){return"underline"}createTags(){return[oe.FontStyle,oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"u",getAttrs:e.parse},{style:"text-decoration",getAttrs:r=>r==="underline"?{}:!1},...t.parseDOM??[]],toDOM:r=>["u",e.dom(r),0]}}toggleUnderline(e){return ns({type:this.type,selection:e})}shortcut(e){return this.toggleUnderline()(e)}};Cx([U(Cle)],Cd.prototype,"toggleUnderline",1);Cx([je({shortcut:D.Underline,command:"toggleUnderline"})],Cd.prototype,"shortcut",1);Cd=Cx([me({})],Cd);const Mle=({onSelectAIText:e})=>{const t=lc(),r=S.useCallback(async()=>{const n=await e();Tle(n)&&n.length>0&&t.insertText(n),t.run()},[t,e]);return O.jsx(dt,{commandName:"addImage",enabled:!0,onSelect:r,label:"Add AI generated Text",icon:O.jsx("span",{style:{height:"16px",lineHeight:"16px"},children:"AI"})})};function Tle(e){return typeof e=="string"||e instanceof String}const ps=e=>{const{type:t}=e;return t==="Assets"?O.jsxs("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 28 28",children:[O.jsx("path",{d:"M21.875 28h-15.75c-3.413 0-6.125-2.713-6.125-6.125v-15.75c0-3.413 2.712-6.125 6.125-6.125h15.75c3.412 0 6.125 2.712 6.125 6.125v15.75c0 3.412-2.713 6.125-6.125 6.125zM6.125 1.75c-2.45 0-4.375 1.925-4.375 4.375v15.75c0 2.45 1.925 4.375 4.375 4.375h15.75c2.45 0 4.375-1.925 4.375-4.375v-15.75c0-2.45-1.925-4.375-4.375-4.375h-15.75z"}),O.jsx("path",{d:"M21.088 23.537h-11.988c-0.35 0-0.612-0.175-0.787-0.525s-0.088-0.7 0.088-0.962l8.225-9.713c0.175-0.175 0.438-0.35 0.7-0.35s0.525 0.175 0.7 0.35l5.25 7.525c0.088 0.087 0.088 0.175 0.088 0.262 0.438 1.225 0.087 2.012-0.175 2.45-0.613 0.875-1.925 0.963-2.1 0.963zM11.025 21.787h10.15c0.175 0 0.612-0.088 0.7-0.262 0.088-0.088 0.088-0.35 0-0.7l-4.55-6.475-6.3 7.438z"}),O.jsx("path",{d:"M9.1 13.737c-2.1 0-3.85-1.75-3.85-3.85s1.75-3.85 3.85-3.85 3.85 1.75 3.85 3.85-1.663 3.85-3.85 3.85zM9.1 7.788c-1.138 0-2.1 0.875-2.1 2.1s0.962 2.1 2.1 2.1 2.1-0.962 2.1-2.1-0.875-2.1-2.1-2.1z"})]}):t==="Contents"?O.jsxs("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 28 28",children:[O.jsx("path",{d:"M21.875 28h-15.75c-3.413 0-6.125-2.713-6.125-6.125v-15.75c0-3.413 2.712-6.125 6.125-6.125h15.75c3.412 0 6.125 2.712 6.125 6.125v15.75c0 3.412-2.713 6.125-6.125 6.125zM6.125 1.75c-2.45 0-4.375 1.925-4.375 4.375v15.75c0 2.45 1.925 4.375 4.375 4.375h15.75c2.45 0 4.375-1.925 4.375-4.375v-15.75c0-2.45-1.925-4.375-4.375-4.375h-15.75z"}),O.jsx("path",{d:"M13.125 12.25h-5.775c-1.575 0-2.888-1.313-2.888-2.888v-2.013c0-1.575 1.313-2.888 2.888-2.888h5.775c1.575 0 2.887 1.313 2.887 2.888v2.013c0 1.575-1.312 2.888-2.887 2.888zM7.35 6.212c-0.613 0-1.138 0.525-1.138 1.138v2.012c0 0.612 0.525 1.138 1.138 1.138h5.775c0.612 0 1.138-0.525 1.138-1.138v-2.013c0-0.612-0.525-1.138-1.138-1.138h-5.775z"}),O.jsx("path",{d:"M22.662 16.713h-17.325c-0.525 0-0.875-0.35-0.875-0.875s0.35-0.875 0.875-0.875h17.237c0.525 0 0.875 0.35 0.875 0.875s-0.35 0.875-0.787 0.875z"}),O.jsx("path",{d:"M15.138 21.262h-9.8c-0.525 0-0.875-0.35-0.875-0.875s0.35-0.875 0.875-0.875h9.713c0.525 0 0.875 0.35 0.875 0.875s-0.35 0.875-0.787 0.875z"})]}):t==="Check"?O.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",width:"1rem",height:"1rem",children:O.jsx("path",{d:"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"})}):t==="Cancel"?O.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",width:"1rem",height:"1rem",children:O.jsx("path",{d:"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"})}):t==="Edit"?O.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1rem",height:"1rem",children:O.jsx("path",{d:"M15.728 9.686l-1.414-1.414L5 17.586V19h1.414l9.314-9.314zm1.414-1.414l1.414-1.414-1.414-1.414-1.414 1.414 1.414 1.414zM7.242 21H3v-4.243L16.435 3.322a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414L7.243 21z"})}):null},Ole=({onSelectAssets:e})=>{const t=lc(),r=S.useCallback(async()=>{const n=await e();for(const o of n){if(o.mimeType.startsWith("image/")){const i={src:o.src,alt:o.alt,title:o.fileName};t.insertImage(i)}else t.insertText(o.fileName,{marks:{link:{href:o.src}}});t.insertText(" ")}t.run()},[t,e]);return O.jsx(dt,{commandName:"addImage",enabled:!0,onSelect:r,label:"Add Asset",icon:O.jsx(ps,{type:"Assets"})})},_le=({onSelectContents:e})=>{const t=lc(),r=S.useCallback(async()=>{const n=await e();for(const o of n)t.insertNode("content-link",{attrs:{contentId:o.id,contentTitle:o.title,schemaName:o.schemaName}}),t.insertText(" ");t.run()},[t,e]);return O.jsx(dt,{commandName:"addContent",enabled:!0,onSelect:r,label:"Add Content",icon:O.jsx(ps,{type:"Contents"})})},Ale=()=>{const e=lc(),t=S.useCallback(async()=>{e.insertNode("plain-html",{attrs:{content:""}}).run()},[e]);return O.jsx(dt,{commandName:"addImage",enabled:!0,onSelect:t,label:"Add HTML",icon:O.jsx("span",{style:{height:"16px",lineHeight:"16px"},children:"HTML"})})};var Nle=Object.defineProperty,Rle=Object.getOwnPropertyDescriptor,Mx=(e,t,r,n)=>{for(var o=n>1?void 0:n?Rle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Nle(t,r,o),o};let Md=class extends li{get name(){return"className"}createTags(){return[oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:{...e.defaults(),className:{}},parseDOM:[{tag:"*",getAttrs:r=>{if(!Je(r))return!1;for(const n of r.classList)if(this.options.classNames.indexOf(n)>=0)return{...e.parse(r),className:n};return!1}},...t.parseDOM??[]],toDOM:r=>{const{className:n,...o}=Dd(r.attrs,e),i=e.dom(r),s=i.className,a=Ple(n,s);return["span",{...o,...i,className:a},0]}}}setClassName(e,t){return this.store.commands.applyMark.original(this.type,{className:e},t)}removeClassName(e){return this.store.commands.removeMark.original({type:this.type,selection:e,expand:!0})}};Mx([U({})],Md.prototype,"setClassName",1);Mx([U({})],Md.prototype,"removeClassName",1);Md=Mx([me({defaultOptions:{classNames:[]}})],Md);function Ple(e,t){return e&&t?`${e} ${t}`:e||t}const zle=_h(Sd);function IO(e){const[t,r]=S.useState(e),n=S.useRef(e);return n.current=t,[t,r,n]}const Tx=new zle({hr:"---"});Tx.addRule("link2",{filter:(e,t)=>t.linkStyle==="inlined"&&e.nodeName==="A"&&!!e.getAttribute("href"),replacement:function(e,t){const r=t,n=r.getAttribute("href");if(!n)return"";const o=pv(r.getAttribute("title"));return o?`[${e}](${n} '${o}')`:`[${e}](${n})`}});Tx.addRule("link2",{filter:"img",replacement:(e,t)=>{const r=t,n=r.getAttribute("src")||"";if(!n)return"";const o=pv(r.getAttribute("alt")),i=pv(r.getAttribute("title"));return i?`![${o}](${n} '${i}')`:`![${o}](${n})`}});function pv(e){return(e==null?void 0:e.replace(/(\n+\s*)+/g,` -`))||""}function Lle(e){return Tx.turndown(e)}function Ile(e,t,r){if(!e)return;const n=`${t}/api/assets/${r}/`;if(e.startsWith(n)){const o=e.substring(n.length).split(/[/?]+/);return o.length<1?null:{id:o[0]}}return null}function Dle(e,t,r){if(!e)return;const n=`${t}/api/content/${r}/`;if(e.startsWith(n)){const o=e.substring(n.length).split(/[/?]+/);return o.length<2?null:{schemaName:o[0],id:o[1]}}return null}class $le extends er{constructor(r){super({...r,disableExtraAttributes:!0});gc(this,"ReactComponent",r=>O.jsx(Hle,{...r,...this.options}))}get name(){return"content-link"}createTags(){return[oe.Block]}createNodeSpec(){return{attrs:{contentId:{default:""},contentTitle:{default:""},schemaName:{default:""}},toDOM:r=>["a",{href:`${this.options.baseUrl}/api/content/${this.options.appName}/${r.attrs.schemaName}/${r.attrs.contentId}`},r.attrs.contentTitle],parseDOM:[{tag:"a[href]",getAttrs:r=>{if(!Je(r))return!1;const n=r.getAttribute("href");if(!n)return!1;const o=Dle(n,this.options.baseUrl,this.options.appName);return o?{contentId:o.id,contentTitle:r.innerText,schemaName:o.schemaName}:!1},priority:1e4}]}}}const Hle=({appName:e,baseUrl:t,node:r})=>{const n=r.attrs.contentId,o=r.attrs.contentTitle,i=r.attrs.schemaName,s=S.useMemo(()=>`${t}/app/${e}/content/${i}/${n}`,[e,t,n,i]);return O.jsxs("div",{className:"squidex-editor-content-link",children:[O.jsx("a",{href:s,target:"_blank",className:"squidex-editor-button",children:O.jsx(ps,{type:"Contents"})}),O.jsx("div",{className:"squidex-editor-content-schema",children:i}),O.jsx("div",{className:"squidex-editor-content-name",children:o})]})},Ble=()=>{const e=Zy(is);return O.jsxs("div",{className:"squidex-editor-counter",children:["Words: ",O.jsx("strong",{children:e.getWordCount()}),", Characters: ",O.jsx("strong",{children:e.getCharacterCount()})]})},Fle=({appName:e,baseUrl:t,node:r,onEdit:n,getPosition:o})=>{const i=Ile(r.attrs.src,t,e);return O.jsxs("div",{style:{position:"relative"},className:"squidex-editor-image-view",children:[O.jsx("img",{className:"squidex-editor-image-element",src:r.attrs.src}),O.jsx("button",{style:{position:"absolute"},className:"squidex-editor-button",onClick:()=>n({node:r,getPos:o}),children:O.jsx(ps,{type:"Edit"})}),i&&O.jsx("div",{style:{position:"absolute"},className:"squidex-editor-image-info",children:"Asset"})]})};class Vle extends Ve{get name(){return"html-copy"}createPlugin(){return{props:{clipboardTextSerializer:this.options.copyAsHtml?r=>{const n=document.createElement("div");return n.append(sn.fromSchema(this.store.schema).serializeFragment(r.content)),n.innerHTML}:void 0}}}}const k4=({onEdit:e})=>{const t=lc(),n=In().link(),o=Qy(),i=S.useCallback(()=>{t.removeLink().focus().run()},[t]);return O.jsxs(O.Fragment,{children:[O.jsx(dt,{commandName:"updateLink",enabled:!o.empty,label:"Add or Edit Link",onSelect:e,icon:"link"}),O.jsx(dt,{commandName:"removeLink",enabled:n,label:"Remove Link",onSelect:i,icon:"linkUnlink"})]})},DO=e=>{const t=S.useRef(null);return S.useEffect(()=>{const r=window.requestAnimationFrame(()=>{var n;(n=t.current)==null||n.focus()});return()=>{window.cancelAnimationFrame(r)}},[]),O.jsx("input",{className:"squidex-editor-input",ref:t,...e})},$O=({children:e,title:t})=>O.jsxs("div",{className:"squidex-editor-modal-wrapper",children:[O.jsx("div",{className:"squidex-editor-modal-backdrop"}),O.jsxs("div",{className:"squidex-editor-modal-window",children:[t&&O.jsx("div",{className:"squidex-editor-modal-title",children:t}),O.jsx("div",{className:"squidex-editor-modal-body",children:e})]})]}),jle=({onClose:e})=>{const[t,r,n]=IO(""),o=lc(),i=tj(!0).link(),s=(i==null?void 0:i.href)??"",a=Qy();S.useEffect(()=>{r(s)},[s,a,r]);const l=S.useCallback(()=>{const d=n.current;d?o.updateLink({href:d,auto:!1}):o.removeLink(),o.focus(a.to).run(),e()},[o,n,e,a.to]),c=S.useCallback(d=>{r(d.target.value)},[r]),u=S.useCallback(d=>{const{code:f}=d;f==="Enter"&&l(),f==="Escape"&&e()},[e,l]);return O.jsxs($O,{title:"Change Link",children:[O.jsx(DO,{value:t,onChange:c,onKeyDown:u,placeholder:"Enter Link..."}),O.jsxs(Xn,{children:[O.jsx(dt,{commandName:"submitLink",enabled:!0,onSelect:l,icon:O.jsx(ps,{type:"Check"})}),O.jsx(dt,{commandName:"cancelLink",enabled:!0,onSelect:e,icon:O.jsx(ps,{type:"Cancel"})})]})]})},Ule=({mode:e,onChange:t,state:r,value:n})=>{const{setContent:o}=di(),{getMarkdown:i,getHTML:s}=lm(),a=S.useRef(null),l=S.useRef(!1),c=S.useRef(0),u=pj();return S.useEffect(()=>{c.current+=1},[u]),S.useEffect(()=>{l.current=!!n&&n.length>0,a.current!==n&&(a.current=n,o(n||""),c.current=-1)},[o,n]),S.useEffect(()=>{if(!t)return;function d(){switch(e){case"Markdown":return i(r);default:return s(r)}}if(c.current<=0)return;let f=d().trim();f==="

    "&&(f=""),a.current!==f&&(!l.current&&f.length===0?t(void 0):t(f),a.current=f,l.current=!!f&&f.length>0)},[s,i,e,t,r]),null};class Wle extends er{constructor(){super({disableExtraAttributes:!0});gc(this,"ReactComponent",Kle)}get name(){return"plain-html"}createTags(){return[oe.Block]}createNodeSpec(){return{attrs:{html:{default:""}},toDOM:r=>{const n=r.attrs.html;return["div",{class:"raw-content"},...qle(n)]},parseDOM:[{tag:"div[class~=raw-content]",getAttrs:r=>({content:r.innerHTML}),priority:1e4}]}}}const Kle=({node:e,getPosition:t,view:r})=>{const n=S.useCallback(o=>{const i=r.state.tr.setNodeAttribute(t(),"html",o.target.value);r.dispatch(i)},[t,r]);return O.jsxs("div",{className:"squidex-editor-html",children:[O.jsx("div",{className:"squidex-editor-html-label",children:"Plain HTML"}),O.jsx("textarea",{spellCheck:"false",value:e.attrs.content,onChange:n})]})};function qle(e){if(!e)return[""];const t=document.createElement("div");return t.innerHTML=e,HO(t)}function Gle(e){const t={};for(let r=0;r{const[r,n,o]=IO(""),i=Tr();S.useEffect(()=>{n(t.node.attrs.title||"")},[t,n]);const s=S.useCallback(c=>{n(c.target.value)},[n]),a=S.useCallback(()=>{i.updateNodeAttributes(t.getPos()||0,{...t.node.attrs||{},title:o.current}),e()},[i,t,e,o]),l=S.useCallback(c=>{const{code:u}=c;u==="Enter"&&a(),u==="Escape"&&e()},[e,a]);return O.jsxs($O,{title:"Change Image Title",children:[O.jsx(DO,{value:r,onChange:s,onKeyDown:l,placeholder:"Enter Title..."}),O.jsxs(Xn,{children:[O.jsx(dt,{commandName:"submitLink",enabled:!0,onSelect:a,icon:O.jsx(ps,{type:"Check"})}),O.jsx(dt,{commandName:"cancelLink",enabled:!0,onSelect:e,icon:O.jsx(ps,{type:"Cancel"})})]})]})};const Jle=!1,Xle=e=>{const{appName:t,canSelectAIText:r,canSelectAssets:n,canSelectContents:o,isDisabled:i,mode:s,onChange:a,onSelectAIText:l,onSelectAssets:c,onSelectContents:u,onUpload:d,value:f}=e,p=S.useMemo(()=>{let C=e.baseUrl;return C.endsWith("/")&&(C=C.substring(0,C.length-1)),C},[e.baseUrl]),[h,m]=S.useState(),[b,v]=S.useState(!1),g=S.useCallback(()=>{v(!0)},[]),y=S.useCallback(()=>{v(!1)},[]),x=S.useCallback(()=>{m(null)},[]),k=S.useCallback(()=>[new Zb,new ba({}),new yd({enableSpine:!0}),new Md,new lo({}),new xd,new $le({appName:t,baseUrl:p}),new is({}),new co,new bh,new xh({}),new kh,new Vle({copyAsHtml:s==="Html"}),new kd({uploadHandler:d}),new wd,new us({autoLink:!0}),new us({autoLink:!0}),new ya({enableCollapsible:!0}),new Zl({copyAsMarkdown:s==="Markdown",htmlToMarkdown:Lle}),new Ft,new bd,new Wle,new Ed,new fv,new Cd],[t,p,s,d]),{manager:w,state:E,setState:M}=fj({extensions:k,stringHandler:s==="Markdown"?"markdown":"html",content:f,nodeViewComponents:{image:C=>O.jsx(Fle,{...C,appName:t,baseUrl:p,onEdit:m})}});return O.jsx(kte,{children:O.jsx(yte,{theme:{color:{primary:"#3389ff",active:{primary:"#3389ff"}}},children:O.jsxs(mj,{classNames:i?["squidex-editor-disabled"]:[],manager:w,state:E,onChange:C=>M(C.state),children:[O.jsx("div",{className:"squidex-editor-menu",children:O.jsxs($3,{children:[O.jsx(gte,{}),O.jsx(mte,{showAll:!0}),O.jsxs(Xn,{children:[O.jsx(iv,{}),O.jsx(av,{}),O.jsx(lv,{}),O.jsx(sv,{})]}),O.jsxs(Xn,{children:[O.jsx(tte,{}),O.jsx(nte,{}),O.jsx(Zee,{})]}),O.jsxs(Xn,{children:[O.jsx(rte,{}),O.jsx(ote,{})]}),Jle,O.jsx(Xn,{children:O.jsx(k4,{onEdit:g})}),O.jsxs(Xn,{children:[n&&c&&O.jsx(Ole,{onSelectAssets:c}),o&&u&&O.jsx(_le,{onSelectContents:u}),r&&l&&O.jsx(Mle,{onSelectAIText:l})]}),s==="Html"&&O.jsx(Xn,{children:O.jsx(Ale,{})})]})}),O.jsx(Ule,{mode:s,onChange:a,state:E,value:f}),O.jsx(W0,{}),b?O.jsx(jle,{onClose:y}):h?O.jsx(Yle,{node:h,onClose:x}):O.jsxs(xte,{className:"squidex-editor-floating",children:[O.jsx(iv,{}),O.jsx(av,{}),O.jsx(lv,{}),O.jsx(sv,{}),O.jsx(k4,{onEdit:g})]}),O.jsx(Ble,{})]})})})};var BO,w4=om;BO=w4.createRoot,w4.hydrateRoot;class Qle{constructor(t,r){gc(this,"root");this.element=t,this.props=r,this.root=BO(this.element),this.render()}update(t){this.props={...this.props,...t},this.render()}setValue(t){this.update({value:t})}setIsDisabled(t){this.update({isDisabled:t})}destroy(){this.root.unmount()}render(){this.root.render(O.jsx(Xle,{...this.props}))}}window.SquidexEditorWrapper=Qle; +`}}});function lle(e,t){return se(e,{gfm:!0,smartLists:!0,xhtml:!0,sanitizer:t})}function cle(e){te(typeof document,{code:H.EXTENSION,message:"Attempting to sanitize html within a non-browser environment. Please provide your own `sanitizeHtml` method to the `MarkdownExtension`."});const t=new DOMParser().parseFromString(`${e}`,"text/html");return t.normalize(),HO(t.body),t.body.innerHTML}function HO(e){if(!Q6(e)){if(!Je(e)||/^(script|iframe|object|embed|svg)$/i.test(e.tagName))return e==null?void 0:e.remove();for(const{name:t}of e.attributes)/^(class|id|name|href|src|alt|align|valign)$/i.test(t)||e.attributes.removeNamedItem(t);for(const t of e.childNodes)HO(t)}}var Zl=class extends Ve{get name(){return"markdown"}onCreate(){this.store.setStringHandler("markdown",this.markdownToProsemirrorNode.bind(this))}createPlugin(){return{props:{clipboardTextSerializer:this.options.copyAsMarkdown?t=>{const r=document.createElement("div"),n=an.fromSchema(this.store.schema);return r.append(n.serializeFragment(t.content)),this.options.htmlToMarkdown(r.innerHTML)}:void 0}}}markdownToProsemirrorNode(e){return this.store.stringHandlers.html({...e,content:this.options.markdownToHtml(e.content,this.options.htmlSanitizer)})}insertMarkdown(e,t){return r=>{const{state:n}=r;let o=this.options.markdownToHtml(e,this.options.htmlSanitizer);o=!(t!=null&&t.alwaysWrapInBlock)&&o.startsWith("

    <")&&o.endsWith(`

    +`)?o.slice(3,-5):`
    ${o}
    `;const i=this.store.stringHandlers.html({content:o,schema:n.schema,fragment:!0});return this.store.commands.insertNode.original(i,{...t,replaceEmptyParentBlock:!0})(r)}}getMarkdown(e){return this.options.htmlToMarkdown(this.store.helpers.getHTML(e))}toggleBoldMarkdown(){return e=>!1}};Xm([U()],Zl.prototype,"insertMarkdown",1);Xm([He()],Zl.prototype,"getMarkdown",1);Xm([U()],Zl.prototype,"toggleBoldMarkdown",1);Zl=Xm([pe({defaultOptions:{htmlToMarkdown:ile,markdownToHtml:lle,htmlSanitizer:cle,activeNodes:[oe.Code],copyAsMarkdown:!1},staticKeys:["htmlToMarkdown","markdownToHtml","htmlSanitizer"]})],Zl);var ule=Object.defineProperty,dle=Object.getOwnPropertyDescriptor,mr=(e,t,r,n)=>{for(var o=n>1?void 0:n?dle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ule(t,r,o),o},fle={label:({t:e})=>e(nc.INCREASE_INDENT_LABEL),icon:"indentIncrease"},ple={label:({t:e})=>e(nc.DECREASE_INDENT_LABEL),icon:"indentDecrease"},hle={label:({t:e})=>e(nc.CENTER_ALIGN_LABEL),icon:"alignCenter",active:Qm(({node:e})=>e.attrs.nodeTextAlignment==="center")},mle={label:({t:e})=>e(nc.JUSTIFY_ALIGN_LABEL),icon:"alignJustify",active:Qm(({node:e})=>e.attrs.nodeTextAlignment==="justify")},gle={label:({t:e})=>e(nc.RIGHT_ALIGN_LABEL),icon:"alignRight",active:Qm(({node:e})=>e.attrs.nodeTextAlignment==="right")},vle={label:({t:e})=>e(nc.LEFT_ALIGN_LABEL),icon:"alignLeft",active:Qm(({node:e})=>{const{nodeTextAlignment:t}=e.attrs;return t==="left"||t===""})};function Qm(e){return({excludeNodes:t},r)=>{const{getState:n,nodeTags:o}=r;return BO(n(),o.formattingNode,t).some(e)}}function y4(e,t,r){return r.includes(e.name)?!1:t.includes(e.name)}function BO(e,t,r){const n=[],{$from:o,$to:i}=e.selection,s=o.blockRange(i);if(!s)return[];const{parent:a,start:l,end:c}=s;return a.nodeSize-2===c-l&&y4(a.type,t,r)?[{node:a,pos:l-1}]:(e.doc.nodesBetween(l,c,(d,f)=>{if(!(fc)&&y4(d.type,t,r))return n.push({node:d,pos:f}),!1}),n)}var b4="data-node-indent",x4="data-node-text-align",k4="data-line-height-align";function yle(e,t){const r=Qs(Q4(e)),n=Qs(t??"0"),o=e.length??1,i=r/o;return Ad({max:o,min:0,value:Math.floor(n/i)})}var ble=/^\d+(?:\.\d+)?$/,xle=/^(\d+(?:\.\d+)?)%$/;function w4(e){if(Jt(e))return e;if(!e)return null;const t=e.trim(),r=t.match(xle);if(r)return Number.parseFloat(r[1])/100;const n=t.match(ble);return n?Number.parseFloat(n[0]):null}var Ft=class extends Ve{get name(){return"nodeFormatting"}createSchemaAttributes(){return[{identifiers:{type:"node",tags:[oe.FormattingNode],excludeNames:this.options.excludeNodes},attributes:{nodeIndent:this.nodeIndent(),nodeTextAlignment:this.nodeTextAlignment(),nodeLineHeight:this.nodeLineHeight(),style:{default:"",parseDOM:()=>"",toDOM:({nodeIndent:e,nodeTextAlignment:t,nodeLineHeight:r,style:n})=>{const o=e?this.options.indents[e]:void 0;return{style:qv({marginLeft:o,textAlign:t&&t!=="none"?t:void 0,lineHeight:r||void 0},n)}}}}}]}setLineHeight(e){return this.setNodeAttribute(({node:t})=>{if(e!==t.attrs.nodeLineHeight)return{nodeLineHeight:e}})}setTextAlignment(e){return this.setNodeAttribute(({node:t})=>{if(e!==t.attrs.nodeTextAlignment)return{nodeTextAlignment:e}})}setIndent(e){return this.setNodeAttribute(({node:t})=>{const r=t.attrs.nodeIndent??0,n=e==="-1"?r-1:e==="+1"?r+1:e,o=Ad({min:0,max:this.options.indents.length-1,value:n});if(o!==r)return{nodeIndent:o}})}centerAlign(){return this.setTextAlignment("center")}justifyAlign(){return this.setTextAlignment("justify")}leftAlign(){return this.setTextAlignment("left")}rightAlign(){return this.setTextAlignment("right")}increaseIndent(){return e=>this.setIndent("+1")(e)}decreaseIndent(){return e=>this.setIndent("-1")(e)}centerAlignShortcut(e){return this.centerAlign()(e)}justifyAlignShortcut(e){return this.justifyAlign()(e)}leftAlignShortcut(e){return this.leftAlign()(e)}rightAlignShortcut(e){return this.rightAlign()(e)}increaseIndentShortcut(e){return this.increaseIndent()(e)}decreaseIndentShortcut(e){return this.decreaseIndent()(e)}nodeIndent(){return{default:null,parseDOM:e=>e.getAttribute(b4)??yle(this.options.indents,e.style.marginLeft),toDOM:e=>{if(!e.nodeIndent)return;const t=`${e.nodeIndent}`;if(this.options.indents[e.nodeIndent])return{[b4]:t}}}}nodeTextAlignment(){return{default:null,parseDOM:e=>e.getAttribute(x4)??e.style.textAlign,toDOM:e=>{const t=e.nodeTextAlignment;if(!(!t||t==="none"))return{[x4]:t}}}}nodeLineHeight(){return{default:null,parseDOM:e=>{const t=e.getAttribute(k4);return w4(t)??w4(e.style.lineHeight)},toDOM:e=>{const t=e.nodeLineHeight;if(t)return{[k4]:t.toString()}}}}setNodeAttribute(e){return t=>{const{tr:r,dispatch:n}=t,o=BO(r,this.store.nodeTags.formattingNode,this.options.excludeNodes);if(Mo(o))return!1;if(!n)return!0;const i=[];for(const s of o){const{node:a,pos:l}=s,c=e(s);c&&i.push([l,{...a.attrs,...c}])}if(Mo(i))return!1;if(!n)return!0;for(const[s,a]of i)r.setNodeMarkup(s,void 0,a);return n(r),!0}}};mr([U()],Ft.prototype,"setLineHeight",1);mr([U()],Ft.prototype,"setTextAlignment",1);mr([U()],Ft.prototype,"setIndent",1);mr([U(hle)],Ft.prototype,"centerAlign",1);mr([U(mle)],Ft.prototype,"justifyAlign",1);mr([U(vle)],Ft.prototype,"leftAlign",1);mr([U(gle)],Ft.prototype,"rightAlign",1);mr([U(fle)],Ft.prototype,"increaseIndent",1);mr([U(ple)],Ft.prototype,"decreaseIndent",1);mr([je({shortcut:D.CenterAlignment,command:"centerAlign"})],Ft.prototype,"centerAlignShortcut",1);mr([je({shortcut:D.JustifyAlignment,command:"justifyAlign"})],Ft.prototype,"justifyAlignShortcut",1);mr([je({shortcut:D.LeftAlignment,command:"leftAlign"})],Ft.prototype,"leftAlignShortcut",1);mr([je({shortcut:D.RightAlignment,command:"rightAlign"})],Ft.prototype,"rightAlignShortcut",1);mr([je({shortcut:D.IncreaseIndent,command:"increaseIndent",priority:Ae.Low})],Ft.prototype,"increaseIndentShortcut",1);mr([je({shortcut:D.DecreaseIndent,command:"decreaseIndent",priority:Ae.Medium})],Ft.prototype,"decreaseIndentShortcut",1);Ft=mr([pe({defaultOptions:{indents:["0","20px","40px","60px","80px","100px","120px","140px","160px","180px","200px"],excludeNodes:[]},staticKeys:["indents"]})],Ft);var kle=Object.defineProperty,wle=Object.getOwnPropertyDescriptor,Tx=(e,t,r,n)=>{for(var o=n>1?void 0:n?wle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&kle(t,r,o),o},Sle={icon:"strikethrough",label:({t:e})=>e(bk.LABEL),description:({t:e})=>e(bk.DESCRIPTION)},Cd=class extends li{get name(){return"strike"}createTags(){return[oe.FontStyle,oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"s",getAttrs:e.parse},{tag:"del",getAttrs:e.parse},{tag:"strike",getAttrs:e.parse},{style:"text-decoration",getAttrs:r=>r==="line-through"?{}:!1},...t.parseDOM??[]],toDOM:r=>["s",e.dom(r),0]}}toggleStrike(){return ns({type:this.type})}shortcut(e){return this.toggleStrike()(e)}createInputRules(){return[Vu({regexp:/~([^~]+)~$/,type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{regexp:/~([^~]+)~/g,type:"mark",markType:this.type}]}};Tx([U(Sle)],Cd.prototype,"toggleStrike",1);Tx([je({shortcut:D.Strike,command:"toggleStrike"})],Cd.prototype,"shortcut",1);Cd=Tx([pe({})],Cd);var S4=new ka("trailingNode");function Ele(e){const{ignoredNodes:t=[],nodeName:r="paragraph"}=e??{},n=Ml([...t,r]);let o,i;return new Ro({key:S4,appendTransaction(s,a,l){const{doc:c,tr:u}=l,d=S4.getState(l),f=c.content.size;if(d)return u.insert(f,o.create())},state:{init:(s,{doc:a,schema:l})=>{var c;const u=l.nodes[r];if(!u)throw new Error(`Invalid node being used for trailing node extension: '${r}'`);return o=u,i=Object.values(l.nodes).map(d=>d).filter(d=>!n.includes(d.name)),fr(i,(c=a.lastChild)==null?void 0:c.type)},apply:(s,a)=>{var l;return s.docChanged?fr(i,(l=s.doc.lastChild)==null?void 0:l.type):a}}})}var Cle=Object.defineProperty,Mle=Object.getOwnPropertyDescriptor,Tle=(e,t,r,n)=>{for(var o=n>1?void 0:n?Mle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Cle(t,r,o),o},mv=class extends Ve{get name(){return"trailingNode"}onSetOptions(e){const{changes:t}=e;(t.disableTags.changed||t.ignoredNodes.changed||t.nodeName.changed)&&this.store.updateExtensionPlugins(this)}createExternalPlugins(){const{tags:e}=this.store,{disableTags:t,nodeName:r}=this.options,n=t?[...this.options.ignoredNodes]:[...this.options.ignoredNodes,...e.lastNodeCompatible];return[Ele({ignoredNodes:n,nodeName:r})]}};mv=Tle([pe({defaultOptions:{ignoredNodes:[],disableTags:!1,nodeName:"paragraph"}})],mv);var Ole=Object.defineProperty,_le=Object.getOwnPropertyDescriptor,Ox=(e,t,r,n)=>{for(var o=n>1?void 0:n?_le(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ole(t,r,o),o},Ale={icon:"underline",label:({t:e})=>e(xk.LABEL),description:({t:e})=>e(xk.DESCRIPTION)},Md=class extends li{get name(){return"underline"}createTags(){return[oe.FontStyle,oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"u",getAttrs:e.parse},{style:"text-decoration",getAttrs:r=>r==="underline"?{}:!1},...t.parseDOM??[]],toDOM:r=>["u",e.dom(r),0]}}toggleUnderline(e){return ns({type:this.type,selection:e})}shortcut(e){return this.toggleUnderline()(e)}};Ox([U(Ale)],Md.prototype,"toggleUnderline",1);Ox([je({shortcut:D.Underline,command:"toggleUnderline"})],Md.prototype,"shortcut",1);Md=Ox([pe({})],Md);const E4={};function Nle(e){if(E4[e])return;const t=document.createElement("style"),r=Rle(e)/1e4,n=Ple({h:Math.abs(r),s:.6,v:.6}),o=zle(n);t.type="text/css",t.textContent=` + .remirror-editor-wrapper .__editor_${e}::before { + content: '[${e}]'; + font-family: monospace; + font-size: 90%; + color: ${o}; + } + + .remirror-editor-wrapper .__editor_${e}::after { + content: '[/${e}]'; + font-family: monospace; + font-size: 90%; + color: ${o}; + } + `,document.head.appendChild(t),E4[e]=!0}function Rle(e){let t=0;if(!e||e.length===0)return t;for(let r=0;r{for(var o=n>1?void 0:n?Ile(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Lle(t,r,o),o};let ec=class extends li{get name(){return"className"}constructor(e){super(e);for(const t of e.classNames||[])Nle(t)}createTags(){return[oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:{...e.defaults(),className:{}},parseDOM:[{tag:"*",getAttrs:r=>{if(!Je(r))return!1;for(const n of r.classList)if(this.options.classNames.indexOf(n)>=0)return{...e.parse(r),className:n};return!1}},...t.parseDOM??[]],toDOM:r=>{const{className:n,...o}=$d(r.attrs,e),i=e.dom(r),s=i.className,a=Dle(n,s);return["span",{...o,...i,class:a},0]}}}setClassName(e,t){return this.store.commands.applyMark.original(this.type,{className:e},t)}removeClassName(e){return this.store.commands.removeMark.original({type:this.type,selection:e,expand:!0})}};_x([U({})],ec.prototype,"setClassName",1);_x([U({})],ec.prototype,"removeClassName",1);ec=_x([pe({defaultOptions:{classNames:[]}})],ec);function Dle(e,t){return e&&(e=`__editor_${e}`),e&&t?`${e} ${t}`:e||t}function FO(e){const[t,r]=S.useState(e),n=S.useRef(e);return n.current=t,[t,r,n]}function $le(e,t,r){if(!e)return;const n=`${t}/api/assets/${r}/`;if(e.startsWith(n)){const o=e.substring(n.length).split(/[/?]+/);return o.length<1?null:{id:o[0]}}return null}function Hle(e,t,r){if(!e)return;const n=`${t}/api/content/${r}/`;if(e.startsWith(n)){const o=e.substring(n.length).split(/[/?]+/);return o.length<2?null:{schemaName:o[0],id:o[1]}}return null}const Ble=Rh(Ed),Ax=new Ble({hr:"---"});Ax.addRule("link2",{filter:(e,t)=>t.linkStyle==="inlined"&&e.nodeName==="A"&&!!e.getAttribute("href"),replacement:function(e,t){const r=t,n=r.getAttribute("href");if(!n)return"";const o=gv(r.getAttribute("title"));return o?`[${e}](${n} '${o}')`:`[${e}](${n})`}});Ax.addRule("link2",{filter:"img",replacement:(e,t)=>{const r=t,n=r.getAttribute("src")||"";if(!n)return"";const o=gv(r.getAttribute("alt")),i=gv(r.getAttribute("title"));return i?`![${o}](${n} '${i}')`:`![${o}](${n})`}});function gv(e){return(e==null?void 0:e.replace(/(\n+\s*)+/g,` +`))||""}function Fle(e){return Ax.turndown(e)}const ps=e=>{const{type:t}=e;return t==="Assets"?O.jsxs("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 28 28",children:[O.jsx("path",{d:"M21.875 28h-15.75c-3.413 0-6.125-2.713-6.125-6.125v-15.75c0-3.413 2.712-6.125 6.125-6.125h15.75c3.412 0 6.125 2.712 6.125 6.125v15.75c0 3.412-2.713 6.125-6.125 6.125zM6.125 1.75c-2.45 0-4.375 1.925-4.375 4.375v15.75c0 2.45 1.925 4.375 4.375 4.375h15.75c2.45 0 4.375-1.925 4.375-4.375v-15.75c0-2.45-1.925-4.375-4.375-4.375h-15.75z"}),O.jsx("path",{d:"M21.088 23.537h-11.988c-0.35 0-0.612-0.175-0.787-0.525s-0.088-0.7 0.088-0.962l8.225-9.713c0.175-0.175 0.438-0.35 0.7-0.35s0.525 0.175 0.7 0.35l5.25 7.525c0.088 0.087 0.088 0.175 0.088 0.262 0.438 1.225 0.087 2.012-0.175 2.45-0.613 0.875-1.925 0.963-2.1 0.963zM11.025 21.787h10.15c0.175 0 0.612-0.088 0.7-0.262 0.088-0.088 0.088-0.35 0-0.7l-4.55-6.475-6.3 7.438z"}),O.jsx("path",{d:"M9.1 13.737c-2.1 0-3.85-1.75-3.85-3.85s1.75-3.85 3.85-3.85 3.85 1.75 3.85 3.85-1.663 3.85-3.85 3.85zM9.1 7.788c-1.138 0-2.1 0.875-2.1 2.1s0.962 2.1 2.1 2.1 2.1-0.962 2.1-2.1-0.875-2.1-2.1-2.1z"})]}):t==="Contents"?O.jsxs("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 28 28",children:[O.jsx("path",{d:"M21.875 28h-15.75c-3.413 0-6.125-2.713-6.125-6.125v-15.75c0-3.413 2.712-6.125 6.125-6.125h15.75c3.412 0 6.125 2.712 6.125 6.125v15.75c0 3.412-2.713 6.125-6.125 6.125zM6.125 1.75c-2.45 0-4.375 1.925-4.375 4.375v15.75c0 2.45 1.925 4.375 4.375 4.375h15.75c2.45 0 4.375-1.925 4.375-4.375v-15.75c0-2.45-1.925-4.375-4.375-4.375h-15.75z"}),O.jsx("path",{d:"M13.125 12.25h-5.775c-1.575 0-2.888-1.313-2.888-2.888v-2.013c0-1.575 1.313-2.888 2.888-2.888h5.775c1.575 0 2.887 1.313 2.887 2.888v2.013c0 1.575-1.312 2.888-2.887 2.888zM7.35 6.212c-0.613 0-1.138 0.525-1.138 1.138v2.012c0 0.612 0.525 1.138 1.138 1.138h5.775c0.612 0 1.138-0.525 1.138-1.138v-2.013c0-0.612-0.525-1.138-1.138-1.138h-5.775z"}),O.jsx("path",{d:"M22.662 16.713h-17.325c-0.525 0-0.875-0.35-0.875-0.875s0.35-0.875 0.875-0.875h17.237c0.525 0 0.875 0.35 0.875 0.875s-0.35 0.875-0.787 0.875z"}),O.jsx("path",{d:"M15.138 21.262h-9.8c-0.525 0-0.875-0.35-0.875-0.875s0.35-0.875 0.875-0.875h9.713c0.525 0 0.875 0.35 0.875 0.875s-0.35 0.875-0.787 0.875z"})]}):t==="Check"?O.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",width:"1rem",height:"1rem",children:O.jsx("path",{d:"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"})}):t==="Cancel"?O.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",width:"1rem",height:"1rem",children:O.jsx("path",{d:"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"})}):t==="Edit"?O.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1rem",height:"1rem",children:O.jsx("path",{d:"M15.728 9.686l-1.414-1.414L5 17.586V19h1.414l9.314-9.314zm1.414-1.414l1.414-1.414-1.414-1.414-1.414 1.414 1.414 1.414zM7.242 21H3v-4.243L16.435 3.322a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414L7.243 21z"})}):null},Vle=({node:e})=>{const t=Wd(Td),r=e.attrs.contentId,n=e.attrs.contentTitle,o=e.attrs.schemaName,i=S.useMemo(()=>`${t.options.baseUrl}/app/${t.options.appName}/content/${o}/${r}`,[r,t.options.appName,t.options.baseUrl,o]);return O.jsxs("div",{className:"squidex-editor-content-link",children:[O.jsx("a",{href:i,target:"_blank",className:"squidex-editor-button",children:O.jsx(ps,{type:"Contents"})}),O.jsx("div",{className:"squidex-editor-content-schema",children:o}),O.jsx("div",{className:"squidex-editor-content-name",children:n})]})};var jle=Object.defineProperty,Ule=Object.getOwnPropertyDescriptor,VO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ule(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&jle(t,r,o),o};let Td=class extends er{constructor(t){super({...t,disableExtraAttributes:!0});vc(this,"ReactComponent",Vle)}get name(){return"contentLink"}createTags(){return[oe.Block]}createNodeSpec(){return{attrs:{contentId:{default:""},contentTitle:{default:""},schemaName:{default:""}},toDOM:t=>["a",{href:`${this.options.baseUrl}/api/content/${this.options.appName}/${t.attrs.schemaName}/${t.attrs.contentId}`},t.attrs.contentTitle],parseDOM:[{tag:"a[href]",getAttrs:t=>{if(!Je(t))return!1;const r=t.getAttribute("href");if(!r)return!1;const n=Hle(r,this.options.baseUrl,this.options.appName);return n?{contentId:n.id,contentTitle:t.innerText,schemaName:n.schemaName}:!1},priority:1e4}]}}addContent(t,r){return this.store.commands.insertNode.original(this.type,{attrs:{contentId:t,contentTitle:t.title,schemaName:t.schemaName},selection:r})}};VO([U({})],Td.prototype,"addContent",1);Td=VO([pe({defaultOptions:{baseUrl:"url",appName:"app"}})],Td);const Wle=({appName:e,baseUrl:t,node:r,onEdit:n,getPosition:o})=>{const i=$le(r.attrs.src,t,e);return O.jsxs("div",{style:{position:"relative"},className:"squidex-editor-image-view",children:[O.jsx("img",{className:"squidex-editor-image-element",src:r.attrs.src}),O.jsx("button",{style:{position:"absolute"},className:"squidex-editor-button",onClick:()=>n({node:r,getPos:o}),children:O.jsx(ps,{type:"Edit"})}),i&&O.jsx("div",{style:{position:"absolute"},className:"squidex-editor-image-info",children:"Asset"})]})};class Kle extends Ve{get name(){return"htmlCopy"}createPlugin(){return{props:{clipboardTextSerializer:this.options.copyAsHtml?r=>{const n=document.createElement("div");return n.append(an.fromSchema(this.store.schema).serializeFragment(r.content)),n.innerHTML}:void 0}}}}const qle=({mode:e,onChange:t,state:r,value:n})=>{const{setContent:o}=di(),{getMarkdown:i,getHTML:s}=dm(),a=S.useRef(null),l=S.useRef(!1),c=S.useRef(0),u=xj();return S.useEffect(()=>{c.current+=1},[u]),S.useEffect(()=>{l.current=!!n&&n.length>0,a.current!==n&&(a.current=n,o(n||""),c.current=-1)},[o,n]),S.useEffect(()=>{if(!t)return;function d(){switch(e){case"Markdown":return i(r);default:return s(r)}}if(c.current<=0)return;let f=d().trim();f==="

    "&&(f=""),a.current!==f&&(!l.current&&f.length===0?t(void 0):t(f),a.current=f,l.current=!!f&&f.length>0)},[s,i,e,t,r]),null},Gle=({node:e,getPosition:t,view:r})=>{const n=S.useCallback(o=>{const i=r.state.tr.setNodeAttribute(t(),"html",o.target.value);r.dispatch(i)},[t,r]);return O.jsxs("div",{className:"squidex-editor-html",children:[O.jsx("div",{className:"squidex-editor-html-label",children:"Plain HTML"}),O.jsx("textarea",{spellCheck:"false",value:e.attrs.content,onChange:n})]})};var Yle=Object.defineProperty,Jle=Object.getOwnPropertyDescriptor,jO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Jle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Yle(t,r,o),o};let Oh=class extends er{constructor(){super({disableExtraAttributes:!0});vc(this,"ReactComponent",Gle)}get name(){return"plainHtml"}createTags(){return[oe.Block]}createNodeSpec(){return{attrs:{html:{default:""}},toDOM:t=>{const r=t.attrs.html;return["div",{class:"__editor_html"},...Xle(r)]},parseDOM:[{tag:"div[class~=__editor_html]",getAttrs:t=>({content:t.innerHTML}),priority:1e4}]}}insertPlainHtml(t){return this.store.commands.insertNode.original(this.type,{attrs:{content:""},selection:t})}};jO([U({})],Oh.prototype,"insertPlainHtml",1);Oh=jO([pe({defaultOptions:{}})],Oh);function Xle(e){if(!e)return[""];const t=document.createElement("div");return t.innerHTML=e,UO(t)}function Qle(e){const t={};for(let r=0;r{const t=cc(),r=S.useCallback(async()=>{const n=await e();ece(n)&&n.length>0&&t.insertText(n),t.run()},[t,e]);return O.jsx(dt,{commandName:"addImage",enabled:!0,onSelect:r,label:"Add AI generated Text",icon:O.jsx("span",{style:{height:"16px",lineHeight:"16px"},children:"AI"})})};function ece(e){return typeof e=="string"||e instanceof String}const WO=e=>{const t=S.useRef(null);return S.useEffect(()=>{const r=window.requestAnimationFrame(()=>{var n;(n=t.current)==null||n.focus()});return()=>{window.cancelAnimationFrame(r)}},[]),O.jsx("input",{className:"squidex-editor-input",ref:t,...e})},KO=({children:e,title:t})=>O.jsxs("div",{className:"squidex-editor-modal-wrapper",children:[O.jsx("div",{className:"squidex-editor-modal-backdrop"}),O.jsxs("div",{className:"squidex-editor-modal-window",children:[t&&O.jsx("div",{className:"squidex-editor-modal-title",children:t}),O.jsx("div",{className:"squidex-editor-modal-body",children:e})]})]}),tce=({onSelectAssets:e})=>{const t=cc(),r=S.useCallback(async()=>{const n=await e();for(const o of n){if(o.mimeType.startsWith("image/")){const i={src:o.src,alt:o.alt,title:o.fileName};t.insertImage(i)}else t.insertAsset(o);t.insertText(" ")}t.run()},[t,e]);return O.jsx(dt,{commandName:"addImage",enabled:!0,onSelect:r,label:"Add Asset",icon:O.jsx(ps,{type:"Assets"})})},rce=({onSelectContents:e})=>{const t=cc(),r=S.useCallback(async()=>{const n=await e();for(const o of n)t.insertNode("content-link",{attrs:{contentId:o.id,contentTitle:o.title,schemaName:o.schemaName}}),t.insertText(" ");t.run()},[t,e]);return O.jsx(dt,{commandName:"addContent",enabled:!0,onSelect:r,label:"Add Content",icon:O.jsx(ps,{type:"Contents"})})},nce=()=>{const e=cc(),t=S.useCallback(async()=>{e.insertPlainHtml().run()},[e]);return O.jsx(dt,{commandName:"addImage",enabled:!0,onSelect:t,label:"Add HTML",icon:O.jsx("span",{style:{height:"16px",lineHeight:"16px"},children:"HTML"})})},oce=({attrs:e,...t})=>{const{setClassName:r}=tr(),n=S.useCallback(()=>{r(e.className)},[e.className,r]),o=qr().className(e);return O.jsx(Ib,{...t,commandName:"toggleClass",active:o,attrs:e,enabled:!0,onSelect:n,label:(e==null?void 0:e.className)||"No Class"})},ice=({...e})=>{const{removeClassName:t}=tr(),r=S.useCallback(()=>{t()},[t]),n=!qr().className();return O.jsx(Ib,{...e,commandName:"removeClass",active:n,attrs:{},enabled:!0,onSelect:r,label:"No Class"})},sce=()=>{const e=Wd(ec);return!e.options.classNames||e.options.classNames.length===0?null:O.jsxs(F3,{"aria-label":"Class Name",icon:O.jsx("span",{style:{height:"14px",lineHeight:"14px",fontSize:"14px"},children:"Class"}),children:[O.jsx(ice,{}),e.options.classNames.map(t=>O.jsx(oce,{attrs:{className:t}},t))]})},ace=()=>{const e=Wd(is);return O.jsxs("div",{className:"squidex-editor-counter",children:["Words: ",O.jsx("strong",{children:e.getWordCount()}),", Characters: ",O.jsx("strong",{children:e.getCharacterCount()})]})},C4=({onEdit:e})=>{const t=cc(),n=qr().link(),o=tb(),i=S.useCallback(()=>{t.removeLink().focus().run()},[t]);return O.jsxs(O.Fragment,{children:[O.jsx(dt,{commandName:"updateLink",enabled:!o.empty,label:"Add or Edit Link",onSelect:e,icon:"link"}),O.jsx(dt,{commandName:"removeLink",enabled:n,label:"Remove Link",onSelect:i,icon:"linkUnlink"})]})},lce=({onClose:e})=>{const[t,r,n]=FO(""),o=cc(),i=lj(!0).link(),s=(i==null?void 0:i.href)??"",a=tb();S.useEffect(()=>{r(s)},[s,a,r]);const l=S.useCallback(()=>{const d=n.current;d?o.updateLink({href:d,auto:!1}):o.removeLink(),o.focus(a.to).run(),e()},[o,n,e,a.to]),c=S.useCallback(d=>{r(d.target.value)},[r]),u=S.useCallback(d=>{const{code:f}=d;f==="Enter"&&l(),f==="Escape"&&e()},[e,l]);return O.jsxs(KO,{title:"Change Link",children:[O.jsx(WO,{value:t,onChange:c,onKeyDown:u,placeholder:"Enter Link..."}),O.jsxs(En,{children:[O.jsx(dt,{commandName:"submitLink",enabled:!0,onSelect:l,icon:O.jsx(ps,{type:"Check"})}),O.jsx(dt,{commandName:"cancelLink",enabled:!0,onSelect:e,icon:O.jsx(ps,{type:"Cancel"})})]})]})},cce=({onClose:e,node:t})=>{const[r,n,o]=FO(""),i=tr();S.useEffect(()=>{n(t.node.attrs.title||"")},[t,n]);const s=S.useCallback(c=>{n(c.target.value)},[n]),a=S.useCallback(()=>{i.updateNodeAttributes(t.getPos()||0,{...t.node.attrs||{},title:o.current}),e()},[i,t,e,o]),l=S.useCallback(c=>{const{code:u}=c;u==="Enter"&&a(),u==="Escape"&&e()},[e,a]);return O.jsxs(KO,{title:"Change Image Title",children:[O.jsx(WO,{value:r,onChange:s,onKeyDown:l,placeholder:"Enter Title..."}),O.jsxs(En,{children:[O.jsx(dt,{commandName:"submitLink",enabled:!0,onSelect:a,icon:O.jsx(ps,{type:"Check"})}),O.jsx(dt,{commandName:"cancelLink",enabled:!0,onSelect:e,icon:O.jsx(ps,{type:"Cancel"})})]})]})};const uce=e=>{const{appName:t,classNames:r,canSelectAIText:n,canSelectAssets:o,canSelectContents:i,isDisabled:s,mode:a,onChange:l,onSelectAIText:c,onSelectAssets:u,onSelectContents:d,onUpload:f,value:p}=e,h=S.useMemo(()=>{let M=e.baseUrl;return M.endsWith("/")&&(M=M.substring(0,M.length-1)),M},[e.baseUrl]),[m,b]=S.useState(),[v,g]=S.useState(!1),y=S.useCallback(()=>{g(!0)},[]),x=S.useCallback(()=>{g(!1)},[]),k=S.useCallback(()=>{b(null)},[]),w=S.useCallback(()=>[new rx,new ba({}),new bd({enableSpine:!0}),new ec({classNames:r}),new lo({}),new kd,new Td({appName:t,baseUrl:h}),new is({}),new co,new kh,new wh({}),new Sh,new Kle({copyAsHtml:a==="Html"}),new wd({uploadHandler:f}),new Sd,new us({autoLink:!0}),new us({autoLink:!0}),new ya({enableCollapsible:!0}),new Zl({copyAsMarkdown:a==="Markdown",htmlToMarkdown:Fle}),new Ft,new xd,new Oh,new Cd,new mv,new Md],[t,h,r,a,f]),{manager:E,state:T,setState:C}=bj({stringHandler:a==="Markdown"?"markdown":"html",content:p,nodeViewComponents:{image:M=>O.jsx(Wle,{...M,appName:t,baseUrl:h,onEdit:b})},extensions:w});return O.jsx(Mte,{children:O.jsx(Ste,{theme:{color:{primary:"#3389ff",active:{primary:"#3389ff"}}},children:O.jsxs(wj,{classNames:s?["squidex-editor-disabled"]:[],manager:E,state:T,onChange:M=>C(M.state),children:[O.jsx("div",{className:"squidex-editor-menu",children:O.jsxs(j3,{children:[O.jsx(kte,{}),O.jsx(xte,{showAll:!0}),O.jsxs(En,{children:[O.jsx(lv,{}),O.jsx(uv,{}),O.jsx(dv,{}),O.jsx(cv,{})]}),O.jsxs(En,{children:[O.jsx(ate,{}),O.jsx(cte,{}),O.jsx(ite,{})]}),O.jsxs(En,{children:[O.jsx(lte,{}),O.jsx(ute,{})]}),a==="Html"&&r&&r.length>0&&O.jsx(En,{children:O.jsx(sce,{})}),O.jsx(En,{children:O.jsx(C4,{onEdit:y})}),O.jsxs(En,{children:[o&&u&&O.jsx(tce,{onSelectAssets:u}),i&&d&&O.jsx(rce,{onSelectContents:d}),n&&c&&O.jsx(Zle,{onSelectAIText:c})]}),a==="Html"&&O.jsx(En,{children:O.jsx(nce,{})})]})}),O.jsx(qle,{mode:a,onChange:l,state:T,value:p}),O.jsx(G0,{}),v?O.jsx(lce,{onClose:x}):m?O.jsx(cce,{node:m,onClose:k}):O.jsxs(Cte,{className:"squidex-editor-floating",children:[O.jsx(lv,{}),O.jsx(uv,{}),O.jsx(dv,{}),O.jsx(cv,{}),O.jsx(C4,{onEdit:y})]}),O.jsx(ace,{})]})})})};var qO,M4=am;qO=M4.createRoot,M4.hydrateRoot;class dce{constructor(t,r){vc(this,"root");this.element=t,this.props=r,this.root=qO(this.element),this.render()}update(t){this.props={...this.props,...t},this.render()}setValue(t){this.update({value:t})}setIsDisabled(t){this.update({isDisabled:t})}destroy(){this.root.unmount()}render(){this.root.render(O.jsx(uce,{...this.props}))}}window.SquidexEditorWrapper=dce; diff --git a/frontend/src/app/declarations.d.ts b/frontend/src/app/declarations.d.ts index 352cc72ffc..a518b48027 100644 --- a/frontend/src/app/declarations.d.ts +++ b/frontend/src/app/declarations.d.ts @@ -74,6 +74,9 @@ interface EditorProps { // The name to the app. appName: string; + // The class names. + classNames?: ReadonlyArray; + // Called when the value has been changed. onChange?: OnChange; diff --git a/frontend/src/app/features/content/shared/forms/field-editor.component.html b/frontend/src/app/features/content/shared/forms/field-editor.component.html index 14384464cf..82d9e6b048 100644 --- a/frontend/src/app/features/content/shared/forms/field-editor.component.html +++ b/frontend/src/app/features/content/shared/forms/field-editor.component.html @@ -195,6 +195,7 @@ +
    + + +
    + + + + {{ 'schemas.fieldTypes.string.classNamesHint' | sqxTranslate }} + +
    +
    +
    diff --git a/frontend/src/app/features/schemas/pages/schema/fields/types/string-ui.component.ts b/frontend/src/app/features/schemas/pages/schema/fields/types/string-ui.component.ts index 12d59f424c..24f89b1e4c 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/types/string-ui.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/fields/types/string-ui.component.ts @@ -30,6 +30,7 @@ export class StringUIComponent { public properties!: StringFieldPropertiesDto; public hideAllowedValues?: Observable; + public hideClassNames?: Observable; public hideInlineEditable?: Observable; public hideSchemaIds?: Observable; @@ -47,6 +48,9 @@ export class StringUIComponent { this.hideAllowedValues = valueProjection$(editor, x => !(x && (x === 'Radio' || x === 'Dropdown'))); + this.hideClassNames = + valueProjection$(editor, x => !(x && (x === 'RichText'))); + this.hideInlineEditable = valueProjection$(editor, x => !(x && (x === 'Input' || x === 'Dropdown' || x === 'Slug'))); diff --git a/frontend/src/app/shared/components/forms/rich-editor.component.ts b/frontend/src/app/shared/components/forms/rich-editor.component.ts index eebb6b52d8..89fc8172ac 100644 --- a/frontend/src/app/shared/components/forms/rich-editor.component.ts +++ b/frontend/src/app/shared/components/forms/rich-editor.component.ts @@ -48,6 +48,9 @@ export class RichEditorComponent extends StatefulControlComponent<{}, string> im @Input() public folderId = ''; + @Input({ required: true }) + public classNames?: ReadonlyArray; + @Input({ required: true }) public mode: SquidexEditorMode = 'Html'; @@ -128,6 +131,7 @@ export class RichEditorComponent extends StatefulControlComponent<{}, string> im canSelectAIText: this.hasChatBot, canSelectAssets: true, canSelectContents: !!this.schemaIds, + classNames: this.classNames, mode: this.mode, }); }); @@ -212,7 +216,7 @@ export class RichEditorComponent extends StatefulControlComponent<{}, string> im } private buildAsset(asset: AssetDto): Asset { - return { type: asset.mimeType, src: asset.fullUrl(this.apiUrl), fileName: asset.fileName }; + return { ...asset, src: asset.fullUrl(this.apiUrl) }; } private buildContent(content: ContentDto): Content { diff --git a/frontend/src/app/shared/services/schemas.types.ts b/frontend/src/app/shared/services/schemas.types.ts index 6f0c348ff9..6b62c7aa2a 100644 --- a/frontend/src/app/shared/services/schemas.types.ts +++ b/frontend/src/app/shared/services/schemas.types.ts @@ -433,6 +433,7 @@ export class StringFieldPropertiesDto extends FieldPropertiesDto { public readonly fieldType = 'String'; public readonly allowedValues?: ReadonlyArray; + public readonly classNames?: ReadonlyArray; public readonly contentType?: StringContentType; public readonly createEnum: boolean = false; public readonly defaultValue?: string; diff --git a/frontend/src/app/shared/state/schemas.forms.ts b/frontend/src/app/shared/state/schemas.forms.ts index 83227059a8..f7c46e3d2b 100644 --- a/frontend/src/app/shared/state/schemas.forms.ts +++ b/frontend/src/app/shared/state/schemas.forms.ts @@ -333,6 +333,7 @@ export class EditFieldFormVisitor implements FieldPropertiesVisitor { public visitString() { this.config['allowedValues'] = new UntypedFormControl(undefined); + this.config['classNames'] = new UntypedFormControl(undefined); this.config['contentType'] = new UntypedFormControl(undefined); this.config['createEnum'] = new UntypedFormControl(undefined); this.config['defaultValue'] = new UntypedFormControl(undefined);